@basthon/browser-bundle 0.38.10 → 0.40.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/lib/{0.38.10 → 0.40.3}/basthon.data +0 -0
  2. package/lib/0.40.3/basthon.js +1 -0
  3. package/lib/0.40.3/modules/IPython-0.0.1-py3-none-any.whl +0 -0
  4. package/lib/{0.38.10 → 0.40.3}/modules/extern/pytutor-main.min.css +0 -0
  5. package/lib/0.40.3/modules/extern/pytutor-main.min.js +1 -0
  6. package/lib/{0.38.10 → 0.40.3}/modules/extern/pytutor-main.min.js.map +0 -0
  7. package/lib/{0.38.10 → 0.40.3}/modules/graphviz-0.0.1-py3-none-any.whl +0 -0
  8. package/lib/{0.38.10 → 0.40.3}/modules/ipythonblocks-0.0.1-py3-none-any.whl +0 -0
  9. package/lib/{0.38.10 → 0.40.3}/modules/ivp-0.0.1-py3-none-any.whl +0 -0
  10. package/lib/{0.38.10 → 0.40.3}/modules/lolviz-0.0.1-py3-none-any.whl +0 -0
  11. package/lib/{0.38.10 → 0.40.3}/modules/p5-0.0.1-py3-none-any.whl +0 -0
  12. package/lib/{0.38.10 → 0.40.3}/modules/proj4py-0.0.1-py3-none-any.whl +0 -0
  13. package/lib/{0.38.10 → 0.40.3}/modules/rcviz-0.0.1-py3-none-any.whl +0 -0
  14. package/lib/{0.38.10 → 0.40.3}/modules/requests-0.0.1-py3-none-any.whl +0 -0
  15. package/lib/{0.38.10 → 0.40.3}/modules/turtle-0.0.1-py3-none-any.whl +0 -0
  16. package/lib/{0.38.10 → 0.40.3}/modules/tutor-0.0.1-py3-none-any.whl +0 -0
  17. package/lib/bundle.js +2 -0
  18. package/lib/bundle.js.map +1 -0
  19. package/lib/kernel-javascript_lib_index_js.js +2 -0
  20. package/lib/kernel-javascript_lib_index_js.js.map +1 -0
  21. package/lib/kernel-ocaml_lib___kernel___js.js +52 -0
  22. package/lib/kernel-ocaml_lib___kernel___js.js.map +1 -0
  23. package/lib/kernel-ocaml_lib_index_js.js +2 -0
  24. package/lib/kernel-ocaml_lib_index_js.js.map +1 -0
  25. package/lib/kernel-python3_lib_index_js.js +2 -0
  26. package/lib/kernel-python3_lib_index_js.js.map +1 -0
  27. package/lib/kernel-sql_lib_index_js.js +2 -0
  28. package/lib/kernel-sql_lib_index_js.js.map +1 -0
  29. package/package.json +24 -19
  30. package/lib/0.38.10/basthon.js +0 -180
  31. package/lib/0.38.10/modules/IPython-0.0.1-py3-none-any.whl +0 -0
  32. package/lib/0.38.10/modules/extern/pytutor-main.min.js +0 -8
  33. package/lib/main.min.js +0 -2
  34. package/lib/main.min.js.map +0 -1
@@ -0,0 +1 @@
1
+ !function(){function t(){}function e(t){return t}function n(){return this}function i(){return!0}function r(t){return"function"==typeof t?t:function(){return t}}function o(t){return null!=t&&!isNaN(t)}function a(t){return t.length}function s(t){return null==t}function l(t){return t.replace(/^\s+|\s+$/g,"").replace(/\s+/g," ")}function u(){}function c(e){function n(){for(var t,n=i,r=-1,o=n.length;++r<o;)(t=n[r].on)&&t.apply(this,arguments);return e}var i=[],r=new t;return n.on=function(t,n){var o=r.get(t);return arguments.length<2?o&&o.on:(o&&(o.on=null,i=i.slice(0,o=i.indexOf(o)).concat(i.slice(o+1)),r.remove(t)),n&&i.push(r.set(t,{on:n})),e)},n}function d(t,e){return e-(t?1+Math.floor(Math.log(t+Math.pow(10,1+Math.floor(Math.log(t)/Math.LN10)-e))/Math.LN10):1)}function h(t){return t+""}function p(t){for(var e=t.lastIndexOf("."),n=0<=e?t.substring(e):(e=t.length,""),i=[];0<e;)i.push(t.substring(e-=3,e+3));return i.reverse().join(",")+n}function f(t){return function(e){return 1-t(1-e)}}function g(t){return function(e){return.5*(e<.5?t(2*e):2-t(2-2*e))}}function m(t){return t}function v(t){return function(e){return Math.pow(e,t)}}function y(t){return 1-Math.cos(t*Math.PI/2)}function b(t){return Math.pow(2,10*(t-1))}function x(t){return 1-Math.sqrt(1-t*t)}function w(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}function C(){d3.event.stopPropagation(),d3.event.preventDefault()}function _(){for(var t,e=d3.event;t=e.sourceEvent;)e=t;return e}function E(t){for(var e=new u,n=0,i=arguments.length;++n<i;)e[arguments[n]]=c(e);return e.of=function(n,i){return function(r){try{var o=r.sourceEvent=d3.event;r.target=t,d3.event=r,e[r.type].apply(n,i)}finally{d3.event=o}}},e}function M(t){return"transform"==t?d3.interpolateTransform:d3.interpolate}function D(t,e){return e=e-(t=+t)?1/(e-t):0,function(n){return(n-t)*e}}function S(t,e){return e=e-(t=+t)?1/(e-t):0,function(n){return Math.max(0,Math.min(1,(n-t)*e))}}function P(t,e,n){return new j(t,e,n)}function j(t,e,n){this.r=t,this.g=e,this.b=n}function T(t){return t<16?"0"+Math.max(0,t).toString(16):Math.min(255,t).toString(16)}function A(t,e,n){var i,r=0,o=0,a=0,s=/([a-z]+)\((.*)\)/i.exec(t);if(s)switch(i=s[2].split(","),s[1]){case"hsl":return n(parseFloat(i[0]),parseFloat(i[1])/100,parseFloat(i[2])/100);case"rgb":return e(I(i[0]),I(i[1]),I(i[2]))}return(s=xn.get(t))?e(s.r,s.g,s.b):(null!=t&&"#"===t.charAt(0)&&(4===t.length?(r=t.charAt(1),r+=r,o=t.charAt(2),o+=o,a=t.charAt(3),a+=a):7===t.length&&(r=t.substring(1,3),o=t.substring(3,5),a=t.substring(5,7)),r=parseInt(r,16),o=parseInt(o,16),a=parseInt(a,16)),e(r,o,a))}function k(t,e,n){var i,r,o=Math.min(t/=255,e/=255,n/=255),a=Math.max(t,e,n),s=a-o,l=(a+o)/2;return s?(r=l<.5?s/(a+o):s/(2-a-o),i=t==a?(e-n)/s+(e<n?6:0):e==a?(n-t)/s+2:(t-e)/s+4,i*=60):r=i=0,L(i,r,l)}function I(t){var e=parseFloat(t);return"%"===t.charAt(t.length-1)?Math.round(2.55*e):e}function L(t,e,n){return new O(t,e,n)}function O(t,e,n){this.h=t,this.s=e,this.l=n}function N(t,e,n){function i(t){return Math.round(255*(360<(t=t)?t-=360:t<0&&(t+=360),t<60?r+(o-r)*t/60:t<180?o:t<240?r+(o-r)*(240-t)/60:r))}var r,o;return(t%=360)<0&&(t+=360),e=e<0?0:1<e?1:e,r=2*(n=n<0?0:1<n?1:n)-(o=n<=.5?n*(1+e):n+e-n*e),P(i(t+120),i(t),i(t-120))}function z(t){return an(t,Mn),t}function R(t){return function(){return wn(t,this)}}function H(t){return function(){return Cn(t,this)}}function F(t,e){function n(){if(e=this.classList)return e.add(t);var e=this.className,n=null!=e.baseVal,i=n?e.baseVal:e;r.lastIndex=0,r.test(i)||(i=l(i+" "+t),n?e.baseVal=i:this.className=i)}function i(){if(e=this.classList)return e.remove(t);var e=this.className,n=null!=e.baseVal,i=l((i=n?e.baseVal:e).replace(r," "));n?e.baseVal=i:this.className=i}var r=new RegExp("(^|\\s+)"+d3.requote(t)+"(\\s+|$)","g");if(arguments.length<2){var o=this.node();if(a=o.classList)return a.contains(t);var a=o.className;return r.lastIndex=0,r.test(null!=a.baseVal?a.baseVal:a)}return this.each("function"==typeof e?function(){(e.apply(this,arguments)?n:i).call(this)}:e?n:i)}function V(t){return{__data__:t}}function B(t,e){for(var n=0,i=t.length;n<i;n++)for(var r,o=t[n],a=0,s=o.length;a<s;a++)(r=o[a])&&e(r,a,n);return t}function W(t){return an(t,Sn),t}function $(e,n,i){an(e,jn);var r=new t,o=d3.dispatch("start","end"),a=On;return e.id=n,e.time=i,e.tween=function(t,n){return arguments.length<2?r.get(t):(null==n?r.remove(t):r.set(t,n),e)},e.ease=function(t){return arguments.length?(a="function"==typeof t?t:d3.ease.apply(d3,arguments),e):a},e.each=function(t,n){return arguments.length<2?function(t){var e=An,n=On,i=In,r=Ln;return An=this.id,On=this.ease(),B(this,(function(e,n,i){In=e.delay,Ln=e.duration,t.call(e=e.node,e.__data__,n,i)})),An=e,On=n,In=i,Ln=r,this}.call(e,t):(o.on(t,n),e)},d3.timer((function(t){return B(e,(function(e,s,l){function u(t){return g.active>n?d():(g.active=n,r.forEach((function(t,n){(n=n.call(e,m,s))&&h.push(n)})),o.start.call(e,m,s),c(t)||d3.timer(c,0,i),1)}function c(t){if(g.active!==n)return d();for(var i=a(t=(t-p)/f),r=h.length;0<r;)h[--r].call(e,i);return 1<=t?(d(),An=n,o.end.call(e,m,s),An=0,1):void 0}function d(){return--g.count||delete e.__transition__,1}var h=[],p=e.delay,f=e.duration,g=(e=e.node).__transition__||(e.__transition__={active:0,count:0}),m=e.__data__;++g.count,p<=t?u(t):d3.timer(u,p,i)}))}),0,i),e}function U(t,e,n){return""!=n&&Pn}function q(t,e){var n=M(t);return"function"==typeof e?function(t,i,r){return null==(i=e.call(this,t,i))?""!=r&&Pn:r!=i&&n(r,i)}:null==e?U:(e+="",function(t,i,r){return r!=e&&n(r,e)})}function G(){for(var t,e=Date.now(),n=Rn;n;)(t=e-n.then)>=n.delay&&(n.flush=n.callback(t)),n=n.next;var i=Y()-e;24<i?(isFinite(i)&&(clearTimeout(zn),zn=setTimeout(G,i)),Nn=0):(Nn=1,Hn(G))}function Y(){for(var t=null,e=Rn,n=1/0;e;)e=e.flush?t?t.next=e.next:Rn=e.next:(n=Math.min(n,e.then+e.delay),(t=e).next);return n}function X(t){var e,n,i=[t.a,t.b],r=[t.c,t.d],o=K(i),a=Q(i,r),s=K(((s=r)[0]+=(n=-a)*(e=i)[0],s[1]+=n*e[1],s))||0;i[0]*r[1]<r[0]*i[1]&&(i[0]*=-1,i[1]*=-1,o*=-1,a*=-1),this.rotate=(o?Math.atan2(i[1],i[0]):Math.atan2(-r[0],r[1]))*Fn,this.translate=[t.e,t.f],this.scale=[o,s],this.skew=s?Math.atan2(a,s)*Fn:0}function Q(t,e){return t[0]*e[0]+t[1]*e[1]}function K(t){var e=Math.sqrt(Q(t,t));return e&&(t[0]/=e,t[1]/=e),e}function J(t,e){if((n=t.ownerSVGElement||t).createSVGPoint){var n,i,r=n.createSVGPoint();return Vn<0&&(window.scrollX||window.scrollY)&&(i=(n=d3.select(document.body).append("svg").style("position","absolute").style("top",0).style("left",0))[0][0].getScreenCTM(),Vn=!i.f&&!i.e,n.remove()),Vn?(r.x=e.pageX,r.y=e.pageY):(r.x=e.clientX,r.y=e.clientY),[(r=r.matrixTransform(t.getScreenCTM().inverse())).x,r.y]}return r=t.getBoundingClientRect(),[e.clientX-r.left-t.clientLeft,e.clientY-r.top-t.clientTop]}function Z(t){var e=t[0];return e<(t=t[t.length-1])?[e,t]:[t,e]}function tt(t){return t.rangeExtent?t.rangeExtent():Z(t.range())}function et(t,e){var n,i=0,r=t.length-1,o=t[i],a=t[r];return a<o&&(n=i,i=r,r=n,n=o,o=a,a=n),(n=a-o)&&(e=e(n),t[i]=e.floor(o),t[r]=e.ceil(a)),t}function nt(){return Math}function it(t,e){return d3.rebind(t,e,"range","rangeRound","interpolate","clamp")}function rt(t){return t=Math.pow(10,Math.round(Math.log(t)/Math.LN10)-1),{floor:function(e){return Math.floor(e/t)*t},ceil:function(e){return Math.ceil(e/t)*t}}}function ot(t,e){var n,i=Z(t);return(n=e/(n=i[1]-i[0])*(t=Math.pow(10,Math.floor(Math.log(n/e)/Math.LN10))))<=.15?t*=10:n<=.35?t*=5:n<=.75&&(t*=2),i[0]=Math.ceil(i[0]/t)*t,i[1]=Math.floor(i[1]/t)*t+.5*t,i[2]=t,i}function at(t,e){return d3.range.apply(d3,ot(t,e))}function st(t,e){return d3.format(",."+Math.max(0,-Math.floor(Math.log(ot(t,e)[2])/Math.LN10+.01))+"f")}function lt(t,e,n,i){var r=n(t[0],t[1]),o=i(e[0],e[1]);return function(t){return o(r(t))}}function ut(t,e,n,i){var r=[],o=[],a=0,s=Math.min(t.length,e.length)-1;for(t[s]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++a<=s;)r.push(n(t[a-1],t[a])),o.push(i(e[a-1],e[a]));return function(e){var n=d3.bisect(t,e,1,s)-1;return o[n](r[n](e))}}function ct(t){return Math.log(t<0?0:t)/Math.LN10}function dt(t){return-Math.log(0<t?0:-t)/Math.LN10}function ht(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function pt(t){return t.innerRadius}function ft(t){return t.outerRadius}function gt(t){return t.startAngle}function mt(t){return t.endAngle}function vt(t){function e(e){function i(){c.push("M",l(t(d),u))}for(var s,c=[],d=[],h=-1,p=e.length,f=r(n),g=r(o);++h<p;)a.call(this,s=e[h],h)?d.push([+f.call(this,s,h),+g.call(this,s,h)]):d.length&&(i(),d=[]);return d.length&&i(),c.length?c.join(""):null}var n=yt,o=bt,a=i,s=Xn,l=xt,u=.7;return e.x=function(t){return arguments.length?(n=t,e):n},e.y=function(t){return arguments.length?(o=t,e):o},e.defined=function(t){return arguments.length?(a=t,e):a},e.interpolate=function(t){return arguments.length?(Qn.has(t+="")||(t=Xn),l=Qn.get(s=t),e):s},e.tension=function(t){return arguments.length?(u=t,e):u},e}function yt(t){return t[0]}function bt(t){return t[1]}function xt(t){for(var e=0,n=t.length,i=t[0],r=[i[0],",",i[1]];++e<n;)r.push("L",(i=t[e])[0],",",i[1]);return r.join("")}function wt(t){for(var e=0,n=t.length,i=t[0],r=[i[0],",",i[1]];++e<n;)r.push("V",(i=t[e])[1],"H",i[0]);return r.join("")}function Ct(t){for(var e=0,n=t.length,i=t[0],r=[i[0],",",i[1]];++e<n;)r.push("H",(i=t[e])[0],"V",i[1]);return r.join("")}function _t(t,e){if(e.length<1||t.length!=e.length&&t.length!=e.length+2)return xt(t);var n=t.length!=e.length,i="",r=t[0],o=t[1],a=e[0],s=a,l=1;if(n&&(i+="Q"+(o[0]-2*a[0]/3)+","+(o[1]-2*a[1]/3)+","+o[0]+","+o[1],r=t[1],l=2),1<e.length){s=e[1],o=t[l],l++,i+="C"+(r[0]+a[0])+","+(r[1]+a[1])+","+(o[0]-s[0])+","+(o[1]-s[1])+","+o[0]+","+o[1];for(var u=2;u<e.length;u++,l++)o=t[l],s=e[u],i+="S"+(o[0]-s[0])+","+(o[1]-s[1])+","+o[0]+","+o[1]}return n&&(n=t[l],i+="Q"+(o[0]+2*s[0]/3)+","+(o[1]+2*s[1]/3)+","+n[0]+","+n[1]),i}function Et(t,e){for(var n,i=[],r=(1-e)/2,o=t[0],a=t[1],s=1,l=t.length;++s<l;)n=o,o=a,a=t[s],i.push([r*(a[0]-n[0]),r*(a[1]-n[1])]);return i}function Mt(t){if(t.length<3)return xt(t);var e=1,n=t.length,i=t[0],r=i[0],o=i[1],a=[r,r,r,(i=t[1])[0]],s=[o,o,o,i[1]],l=[r,",",o];for(St(l,a,s);++e<n;)i=t[e],a.shift(),a.push(i[0]),s.shift(),s.push(i[1]),St(l,a,s);for(e=-1;++e<2;)a.shift(),a.push(i[0]),s.shift(),s.push(i[1]),St(l,a,s);return l.join("")}function Dt(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function St(t,e,n){t.push("C",Dt(Kn,e),",",Dt(Kn,n),",",Dt(Jn,e),",",Dt(Jn,n),",",Dt(Zn,e),",",Dt(Zn,n))}function Pt(t,e){return(e[1]-t[1])/(e[0]-t[0])}function jt(t){for(var e,n,i,r=-1,o=t.length;++r<o;)n=(e=t[r])[0],i=e[1]+Gn,e[0]=n*Math.cos(i),e[1]=n*Math.sin(i);return t}function Tt(t){function e(e){function i(){m.push("M",c(t(y),p),h,d(t(v.reverse()),p),"Z")}for(var u,f,g,m=[],v=[],y=[],b=-1,x=e.length,w=r(n),C=r(a),_=n===o?function(){return f}:r(o),E=a===s?function(){return g}:r(s);++b<x;)l.call(this,u=e[b],b)?(v.push([f=+w.call(this,u,b),g=+C.call(this,u,b)]),y.push([+_.call(this,u,b),+E.call(this,u,b)])):v.length&&(i(),v=[],y=[]);return v.length&&i(),m.length?m.join(""):null}var n=yt,o=yt,a=0,s=bt,l=i,u=Xn,c=xt,d=xt,h="L",p=.7;return e.x=function(t){return arguments.length?(n=o=t,e):o},e.x0=function(t){return arguments.length?(n=t,e):n},e.x1=function(t){return arguments.length?(o=t,e):o},e.y=function(t){return arguments.length?(a=s=t,e):s},e.y0=function(t){return arguments.length?(a=t,e):a},e.y1=function(t){return arguments.length?(s=t,e):s},e.defined=function(t){return arguments.length?(l=t,e):l},e.interpolate=function(t){return arguments.length?(Qn.has(t+="")||(t=Xn),c=Qn.get(u=t),d=c.reverse||c,h=/-closed$/.test(t)?"M":"L",e):u},e.tension=function(t){return arguments.length?(p=t,e):p},e}function At(t){return t.source}function kt(t){return t.target}function It(t){return t.radius}function Lt(t){return[t.x,t.y]}function Ot(){return 64}function Nt(){return"circle"}function zt(t){return"M0,"+(t=Math.sqrt(t/Math.PI))+"A"+t+","+t+" 0 1,1 0,"+-t+"A"+t+","+t+" 0 1,1 0,"+t+"Z"}function Rt(t,e){t.attr("transform",(function(t){return"translate("+e(t)+",0)"}))}function Ht(t,e){t.attr("transform",(function(t){return"translate(0,"+e(t)+")"}))}function Ft(t){for(var e=t.source,n=t.target,i=function(t,e){if(t===e)return t;for(var n=Vt(t),i=Vt(e),r=n.pop(),o=i.pop(),a=null;r===o;)a=r,r=n.pop(),o=i.pop();return a}(e,n),r=[e];e!==i;)e=e.parent,r.push(e);for(var o=r.length;n!==i;)r.splice(o,0,n),n=n.parent;return r}function Vt(t){for(var e=[],n=t.parent;null!=n;)e.push(t),n=(t=n).parent;return e.push(t),e}function Bt(t){t.fixed|=2}function Wt(t){t!==si&&(t.fixed&=1)}function $t(){si.fixed&=1,ai=si=null}function Ut(){si.px=d3.event.x,si.py=d3.event.y,ai.resume()}function qt(t){return 20}function Gt(t){return 1}function Yt(t){return t.x}function Xt(t){return t.y}function Qt(t,e,n){t.y0=e,t.y=n}function Kt(t){return d3.range(t.length)}function Jt(t){for(var e=-1,n=t[0].length,i=[];++e<n;)i[e]=0;return i}function Zt(t){for(var e,n=1,i=0,r=t[0][1],o=t.length;n<o;++n)(e=t[n][1])>r&&(i=n,r=e);return i}function te(t){return t.reduce(ee,0)}function ee(t,e){return t+e[1]}function ne(t,e){return ie(t,Math.ceil(Math.log(e.length)/Math.LN2+1))}function ie(t,e){for(var n=-1,i=+t[0],r=(t[1]-i)/e,o=[];++n<=e;)o[n]=r*n+i;return o}function re(t){return[d3.min(t),d3.max(t)]}function oe(t,e){return d3.rebind(t,e,"sort","children","value"),t.links=ue,t.nodes=function(e){return hi=!0,(t.nodes=t)(e)},t}function ae(t){return t.children}function se(t){return t.value}function le(t,e){return e.value-t.value}function ue(t){return d3.merge(t.map((function(t){return(t.children||[]).map((function(e){return{source:t,target:e}}))})))}function ce(t,e){return t.value-e.value}function de(t,e){var n=t._pack_next;(t._pack_next=e)._pack_prev=t,(e._pack_next=n)._pack_prev=e}function he(t,e){(t._pack_next=e)._pack_prev=t}function pe(t,e){var n=e.x-t.x,i=e.y-t.y;return.001<(e=t.r+e.r)*e-n*n-i*i}function fe(t){t._pack_next=t._pack_prev=t}function ge(t){delete t._pack_next,delete t._pack_prev}function me(t){var e=t.children;e&&e.length?(e.forEach(me),t.r=function(t){function e(t){o=Math.min(t.x-t.r,o),a=Math.max(t.x+t.r,a),s=Math.min(t.y-t.r,s),l=Math.max(t.y+t.r,l)}var n,i,r,o=1/0,a=-1/0,s=1/0,l=-1/0,u=t.length;if(t.forEach(fe),(n=t[0]).x=-n.r,n.y=0,e(n),1<u&&((c=t[1]).x=c.r,c.y=0,e(c),2<u)){ve(n,c,i=t[2]),e(i),de(n,i),de(n._pack_prev=i,c);for(var c=n._pack_next,d=3;d<u;d++){ve(n,c,i=t[d]);for(var h=0,p=1,f=1,g=c._pack_next;g!==c;g=g._pack_next,p++)if(pe(g,i)){h=1;break}if(1==h)for(r=n._pack_prev;r!==g._pack_prev&&!pe(r,i);r=r._pack_prev,f++);h?(p<f||p==f&&c.r<n.r?he(n,c=g):he(n=r,c),d--):(de(n,i),e(c=i))}}var m=(o+a)/2,v=(s+l)/2,y=0;for(d=0;d<u;d++){var b=t[d];b.x-=m,b.y-=v,y=Math.max(y,b.r+Math.sqrt(b.x*b.x+b.y*b.y))}return t.forEach(ge),y}(e)):t.r=Math.sqrt(t.value)}function ve(t,e,n){var i,r,o=t.r+n.r,a=e.x-t.x,s=e.y-t.y;o&&(a||s)?(r=e.r+n.r,i=Math.sqrt(a*a+s*s),e=Math.max(-1,Math.min(1,(o*o+i*i-r*r)/(2*o*i))),r=Math.acos(e),i=e*(o/=i),r=Math.sin(r)*o,n.x=t.x+i*a+r*s,n.y=t.y+i*s-r*a):(n.x=t.x+o,n.y=t.y)}function ye(t,e){return t.parent==e.parent?1:2}function be(t){var e=t.children;return e&&e.length?e[0]:t._tree.thread}function xe(t){var e,n=t.children;return n&&(e=n.length)?n[e-1]:t._tree.thread}function we(t,e){var n=t.children;if(n&&(r=n.length))for(var i,r,o=-1;++o<r;)0<e(i=we(n[o],e),t)&&(t=i);return t}function Ce(t,e){return t.x-e.x}function _e(t,e){return e.x-t.x}function Ee(t,e){return t.depth-e.depth}function Me(t,e){!function t(n,i){var r=n.children;if(r&&(a=r.length))for(var o,a,s=null,l=-1;++l<a;)t(o=r[l],s),s=o;e(n,i)}(t,null)}function De(t){return{x:t.x,y:t.y,dx:t.dx,dy:t.dy}}function Se(t,e){var n=t.x+e[3],i=t.y+e[0],r=t.dx-e[1]-e[3];return r<0&&(n+=r/2,r=0),(e=t.dy-e[0]-e[2])<0&&(i+=e/2,e=0),{x:n,y:i,dx:r,dy:e}}function Pe(t){return t.map(je).join(",")}function je(t){return/[",\n]/.test(t)?'"'+t.replace(/\"/g,'""')+'"':t}function Te(t,e){return function(n){return n&&t.hasOwnProperty(n.type)?t[n.type](n):e}}function Ae(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function ke(t,e){fi.hasOwnProperty(t.type)&&fi[t.type](t,e)}function Ie(t,e){for(var n=t.coordinates,i=0,r=n.length;i<r;i++)e.apply(null,n[i])}function Le(t){return t.source}function Oe(t){return t.target}function Ne(){function t(t){var e=Math.sin(t*=p)*f,n=Math.sin(p-t)*f,i=n*o+e*d;t=n*a+e*h,e=n*r+e*c;return[Math.atan2(t,i)/pi,Math.atan2(e,Math.sqrt(i*i+t*t))/pi]}var e,n,i,r,o,a,s,l,u,c,d,h,p,f;return t.distance=function(){return null==p&&(f=1/Math.sin(p=Math.acos(Math.max(-1,Math.min(1,r*c+i*u*Math.cos(s-e)))))),p},t.source=function(s){var l=Math.cos(e=s[0]*pi),u=Math.sin(e);return i=Math.cos(n=s[1]*pi),r=Math.sin(n),o=i*l,a=i*u,p=null,t},t.target=function(e){var n=Math.cos(s=e[0]*pi),i=Math.sin(s);return u=Math.cos(l=e[1]*pi),c=Math.sin(l),d=u*n,h=u*i,p=null,t},t}function ze(t,e){return(e=Ne().source(t).target(e)).distance(),e}function Re(t,e,n){return(n[0]-e[0])*(t[1]-e[1])<(n[1]-e[1])*(t[0]-e[0])}function He(t,e,n,i){var r=t[0],o=e[0],a=n[0],s=i[0];t=t[1],o-=r,e=(e=e[1])-t;return[r+(s=((s=s-a)*(t-(n=n[1]))-(i=i[1]-n)*(r-a))/(i*o-s*e))*o,t+s*e]}function Fe(t,e){var n={list:t.map((function(t,e){return{index:e,x:t[0],y:t[1]}})).sort((function(t,e){return t.y<e.y?-1:t.y>e.y?1:t.x<e.x?-1:t.x>e.x?1:0})),bottomSite:null},i={list:[],leftEnd:null,rightEnd:null,init:function(){i.leftEnd=i.createHalfEdge(null,"l"),i.rightEnd=i.createHalfEdge(null,"l"),i.leftEnd.r=i.rightEnd,i.rightEnd.l=i.leftEnd,i.list.unshift(i.leftEnd,i.rightEnd)},createHalfEdge:function(t,e){return{edge:t,side:e,vertex:null,l:null,r:null}},insert:function(t,e){e.l=t,e.r=t.r,t.r.l=e,t.r=e},leftBound:function(t){for(var e=i.leftEnd;(e=e.r)!=i.rightEnd&&r.rightOf(e,t););return e.l},del:function(t){t.l.r=t.r,t.r.l=t.l,t.edge=null},right:function(t){return t.r},left:function(t){return t.l},leftRegion:function(t){return null==t.edge?n.bottomSite:t.edge.region[t.side]},rightRegion:function(t){return null==t.edge?n.bottomSite:t.edge.region[vi[t.side]]}},r={bisect:function(t,e){var n={region:{l:t,r:e},ep:{l:null,r:null}},i=e.x-t.x,r=e.y-t.y,o=0<i?i:-i;e=0<r?r:-r;return n.c=t.x*i+t.y*r+.5*(i*i+r*r),e<o?(n.a=1,n.b=r/i,n.c/=i):(n.b=1,n.a=i/r,n.c/=r),n},intersect:function(t,e){var n=t.edge,i=e.edge;if(!n||!i||n.region.r==i.region.r)return null;var r=n.a*i.b-n.b*i.a;if(Math.abs(r)<1e-10)return null;var o,a=(n.c*i.b-i.c*n.b)/r,s=(i.c*n.a-n.c*i.a)/r,l=n.region.r;r=i.region.r;return(i=a>=(i=l.y<r.y||l.y==r.y&&l.x<r.x?(o=t,n):(o=e,i)).region.r.x)&&"l"===o.side||!i&&"r"===o.side?null:{x:a,y:s}},rightOf:function(t,e){var n,i,r,o,a,s=t.edge,l=s.region.r,u=e.x>l.x;return u&&"l"===t.side?1:u||"r"!==t.side?(1===s.a?(n=e.y-l.y,i=e.x-l.x,o=r=0,!u&&s.b<0||u&&0<=s.b?o=r=n>=s.b*i:(o=e.x+e.y*s.b>s.c,(o=s.b<0?!o:o)||(r=1)),r||(a=l.x-s.region.l.x,o=s.b*(i*i-n*n)<a*n*(1+2*i/a+s.b*s.b),s.b<0&&(o=!o))):(a=s.c-s.a*e.x,s=e.y-a,o=(e=e.x-l.x)*e+(l=a-l.y)*l<s*s),"l"===t.side?o:!o):0},endPoint:function(t,n,i){t.ep[n]=i,t.ep[vi[n]]&&e(t)},distance:function(t,e){var n=t.x-e.x;e=t.y-e.y;return Math.sqrt(n*n+e*e)}},o={list:[],insert:function(t,e,n){t.vertex=e,t.ystar=e.y+n;for(var i=0,r=o.list,a=r.length;i<a;i++){var s=r[i];if(!(t.ystar>s.ystar||t.ystar==s.ystar&&e.x>s.vertex.x))break}r.splice(i,0,t)},del:function(t){for(var e=0,n=o.list,i=n.length;e<i&&n[e]!=t;++e);n.splice(e,1)},empty:function(){return 0===o.list.length},nextEvent:function(t){for(var e=0,n=o.list,i=n.length;e<i;++e)if(n[e]==t)return n[e+1];return null},min:function(){var t=o.list[0];return{x:t.vertex.x,y:t.ystar}},extractMin:function(){return o.list.shift()}};i.init(),n.bottomSite=n.list.shift();for(var a,s,l,u,c,d,h,p,f,g,m,v,y,b=n.list.shift();;)if(o.empty()||(a=o.min()),b&&(o.empty()||b.y<a.y||b.y==a.y&&b.x<a.x))s=i.leftBound(b),l=i.right(s),h=i.rightRegion(s),v=r.bisect(h,b),d=i.createHalfEdge(v,"l"),i.insert(s,d),(g=r.intersect(s,d))&&(o.del(s),o.insert(s,g,r.distance(g,b))),s=d,d=i.createHalfEdge(v,"r"),i.insert(s,d),(g=r.intersect(d,l))&&o.insert(d,g,r.distance(g,b)),b=n.list.shift();else{if(o.empty())break;s=o.extractMin(),u=i.left(s),l=i.right(s),c=i.right(l),h=i.leftRegion(s),p=i.rightRegion(l),m=s.vertex,r.endPoint(s.edge,s.side,m),r.endPoint(l.edge,l.side,m),i.del(s),o.del(l),i.del(l),y="l",h.y>p.y&&(f=h,h=p,p=f,y="r"),v=r.bisect(h,p),d=i.createHalfEdge(v,y),i.insert(u,d),r.endPoint(v,vi[y],m),(g=r.intersect(u,d))&&(o.del(u),o.insert(u,g,r.distance(g,h))),(g=r.intersect(d,c))&&o.insert(d,g,r.distance(g,h))}for(s=i.right(i.leftEnd);s!=i.rightEnd;s=i.right(s))e(s.edge)}function Ve(t){return{x:t[0],y:t[1]}}function Be(){this._=new Date(1<arguments.length?Date.UTC.apply(this,arguments):arguments[0])}function We(t,e,n,i){for(var r,o,a=0,s=e.length,l=n.length;a<s;){if(l<=i)return-1;if(37==(r=e.charCodeAt(a++))){if(!(o=Mi[e.charAt(a++)])||(i=o(t,n,i))<0)return-1}else if(r!=n.charCodeAt(i++))return-1}return i}function $e(t,e,n){return Ii.lastIndex=0,(e=Ii.exec(e.substring(n,n+2)))?(t.d=+e[0],n+e[0].length):-1}function Ue(t,e,n){return Ii.lastIndex=0,(e=Ii.exec(e.substring(n,n+2)))?(t.H=+e[0],n+e[0].length):-1}function qe(t){return t.toISOString()}function Ge(t,e,n){function i(e){var n=t(e),i=o(n,1);return e-n<i-e?n:i}function r(n){return e(n=t(new yi(n-1)),1),n}function o(t,n){return e(t=new yi(+t),n),t}function a(t,i,o){var a=r(t),s=[];if(1<o)for(;a<i;)n(a)%o||s.push(new Date(+a)),e(a,1);else for(;a<i;)s.push(new Date(+a)),e(a,1);return s}(t.floor=t).round=i,t.ceil=r,t.offset=o,t.range=a;var s=t.utc=Ye(t);return(s.floor=s).round=Ye(i),s.ceil=Ye(r),s.offset=Ye(o),s.range=function(t,e,n){try{var i=new(yi=Be);return i._=t,a(i,e,n)}finally{yi=Date}},t}function Ye(t){return function(e,n){try{var i=new(yi=Be);return i._=e,t(i,n)._}finally{yi=Date}}}function Xe(t,e,n){function i(e){return t(e)}return i.invert=function(e){return Ke(t.invert(e))},i.domain=function(e){return arguments.length?(t.domain(e),i):t.domain().map(Ke)},i.nice=function(t){var e=Qe(i.domain());return i.domain([t.floor(e[0]),t.ceil(e[1])])},i.ticks=function(n,r){var o=Qe(i.domain());if("function"!=typeof n){var a=(o[1]-o[0])/n,s=d3.bisect(Oi,a);if(s==Oi.length)return e.year(o,n);if(!s)return t.ticks(n).map(Ke);Math.log(a/Oi[s-1])<Math.log(Oi[s]/a)&&--s,r=(n=e[s])[1],n=n[0].range}return n(o[0],new Date(+o[1]+1),r)},i.tickFormat=function(){return n},i.copy=function(){return Xe(t.copy(),e,n)},d3.rebind(i,t,"range","rangeRound","interpolate","clamp")}function Qe(t){var e=t[0];return e<(t=t[t.length-1])?[e,t]:[t,e]}function Ke(t){return new Date(t)}function Je(t){return function(e){for(var n=t.length-1,i=t[n];!i[1](e);)i=t[--n];return i[0](e)}}function Ze(t){var e=new Date(t,0,1);return e.setFullYear(t),e}function tn(t){var e=t.getFullYear(),n=Ze(e);return e+(t-n)/(Ze(e+1)-n)}function en(t){var e=new Date(Date.UTC(t,0,1));return e.setUTCFullYear(t),e}function nn(t){var e=t.getUTCFullYear(),n=en(e);return e+(t-n)/(en(e+1)-n)}Date.now||(Date.now=function(){return+new Date});try{document.createElement("div").style.setProperty("opacity",0,"")}catch(n){var rn=(kn=CSSStyleDeclaration.prototype).setProperty;kn.setProperty=function(t,e,n){rn.call(this,t,e+"",n)}}d3={version:"2.9.6"};var on=function(t){return Array.prototype.slice.call(t)};try{on(document.documentElement.childNodes)[0].nodeType}catch(n){on=function(t){for(var e=-1,n=t.length,i=[];++e<n;)i.push(t[e]);return i}}var an=[].__proto__?function(t,e){t.__proto__=e}:function(t,e){for(var n in e)t[n]=e[n]};d3.map=function(e){var n,i=new t;for(n in e)i.set(n,e[n]);return i},function(t,e){try{for(var n in e)Object.defineProperty(t.prototype,n,{value:e[n],enumerable:!1})}catch(n){t.prototype=e}}(t,{has:function(t){return sn+t in this},get:function(t){return this[sn+t]},set:function(t,e){return this[sn+t]=e},remove:function(t){return(t=sn+t)in this&&delete this[t]},keys:function(){var t=[];return this.forEach((function(e){t.push(e)})),t},values:function(){var t=[];return this.forEach((function(e,n){t.push(n)})),t},entries:function(){var t=[];return this.forEach((function(e,n){t.push({key:e,value:n})})),t},forEach:function(t){for(var e in this)e.charCodeAt(0)===ln&&t.call(this,e.substring(1),this[e])}});var sn="\0",ln=sn.charCodeAt(0);d3.functor=r,d3.rebind=function(t,e){for(var n,i=1,r=arguments.length;++i<r;)t[n=arguments[i]]=function(t,e,n){return function(){var i=n.apply(e,arguments);return arguments.length?t:i}}(t,e,e[n]);return t},d3.ascending=function(t,e){return t<e?-1:e<t?1:e<=t?0:NaN},d3.descending=function(t,e){return e<t?-1:t<e?1:t<=e?0:NaN},d3.mean=function(t,e){var n,i=t.length,r=0,a=-1,s=0;if(1===arguments.length)for(;++a<i;)o(n=t[a])&&(r+=(n-r)/++s);else for(;++a<i;)o(n=e.call(t,t[a],a))&&(r+=(n-r)/++s);return s?r:void 0},d3.median=function(t,e){return(t=(t=1<arguments.length?t.map(e):t).filter(o)).length?d3.quantile(t.sort(d3.ascending),.5):void 0},d3.min=function(t,e){var n,i,r=-1,o=t.length;if(1===arguments.length){for(;++r<o&&(null==(n=t[r])||n!=n);)n=void 0;for(;++r<o;)null!=(i=t[r])&&i<n&&(n=i)}else{for(;++r<o&&(null==(n=e.call(t,t[r],r))||n!=n);)n=void 0;for(;++r<o;)null!=(i=e.call(t,t[r],r))&&i<n&&(n=i)}return n},d3.max=function(t,e){var n,i,r=-1,o=t.length;if(1===arguments.length){for(;++r<o&&(null==(n=t[r])||n!=n);)n=void 0;for(;++r<o;)null!=(i=t[r])&&n<i&&(n=i)}else{for(;++r<o&&(null==(n=e.call(t,t[r],r))||n!=n);)n=void 0;for(;++r<o;)null!=(i=e.call(t,t[r],r))&&n<i&&(n=i)}return n},d3.extent=function(t,e){var n,i,r,o=-1,a=t.length;if(1===arguments.length){for(;++o<a&&(null==(n=r=t[o])||n!=n);)n=r=void 0;for(;++o<a;)null!=(i=t[o])&&(i<n&&(n=i),r<i&&(r=i))}else{for(;++o<a&&(null==(n=r=e.call(t,t[o],o))||n!=n);)n=void 0;for(;++o<a;)null!=(i=e.call(t,t[o],o))&&(i<n&&(n=i),r<i&&(r=i))}return[n,r]},d3.random={normal:function(t,e){return arguments.length<2&&(e=1),arguments.length<1&&(t=0),function(){for(var n,i,r;!(r=(n=2*Math.random()-1)*n+(i=2*Math.random()-1)*i)||1<r;);return t+e*n*Math.sqrt(-2*Math.log(r)/r)}}},d3.sum=function(t,e){var n,i=0,r=t.length,o=-1;if(1===arguments.length)for(;++o<r;)isNaN(n=+t[o])||(i+=n);else for(;++o<r;)isNaN(n=+e.call(t,t[o],o))||(i+=n);return i},d3.quantile=function(t,e){var n=(t.length-1)*e+1,i=Math.floor(n);e=t[i-1];return(n=n-i)?e+n*(t[i]-e):e},d3.transpose=function(t){return d3.zip.apply(d3,t)},d3.zip=function(){if(!(i=arguments.length))return[];for(var t=-1,e=d3.min(arguments,a),n=new Array(e);++t<e;)for(var i,r=-1,o=n[t]=new Array(i);++r<i;)o[r]=arguments[r][t];return n},d3.bisector=function(t){return{left:function(e,n,i,r){for(arguments.length<3&&(i=0),arguments.length<4&&(r=e.length);i<r;){var o=i+r>>1;t.call(e,e[o],o)<n?i=1+o:r=o}return i},right:function(e,n,i,r){for(arguments.length<3&&(i=0),arguments.length<4&&(r=e.length);i<r;){var o=i+r>>1;n<t.call(e,e[o],o)?r=o:i=1+o}return i}}},kn=d3.bisector((function(t){return t})),d3.bisectLeft=kn.left,d3.bisect=d3.bisectRight=kn.right,d3.first=function(t,e){var n,i=0,r=t.length,o=t[0];for(1===arguments.length&&(e=d3.ascending);++i<r;)0<e.call(t,o,n=t[i])&&(o=n);return o},d3.last=function(t,e){var n,i=0,r=t.length,o=t[0];for(1===arguments.length&&(e=d3.ascending);++i<r;)e.call(t,o,n=t[i])<=0&&(o=n);return o},d3.nest=function(){function e(a,s){if(s>=o.length)return i?i.call(r,a):n?a.sort(n):a;for(var l,u,c,d=-1,h=a.length,p=o[s++],f=new t,g={};++d<h;)(c=f.get(l=p(u=a[d])))?c.push(u):f.set(l,[u]);return f.forEach((function(t){g[t]=e(f.get(t),s)})),g}var n,i,r={},o=[],a=[];return r.map=function(t){return e(t,0)},r.entries=function(t){return function t(e,n){if(n>=o.length)return e;var i,r=[],s=a[n++];for(i in e)r.push({key:i,values:t(e[i],n)});return s&&r.sort((function(t,e){return s(t.key,e.key)})),r}(e(t,0),0)},r.key=function(t){return o.push(t),r},r.sortKeys=function(t){return a[o.length-1]=t,r},r.sortValues=function(t){return n=t,r},r.rollup=function(t){return i=t,r},r},d3.keys=function(t){var e,n=[];for(e in t)n.push(e);return n},d3.values=function(t){var e,n=[];for(e in t)n.push(t[e]);return n},d3.entries=function(t){var e,n=[];for(e in t)n.push({key:e,value:t[e]});return n},d3.permute=function(t,e){for(var n=[],i=-1,r=e.length;++i<r;)n[i]=t[e[i]];return n},d3.merge=function(t){return Array.prototype.concat.apply([],t)},d3.split=function(t,e){var n,i=[],r=[],o=-1,a=t.length;for(arguments.length<2&&(e=s);++o<a;)e.call(r,n=t[o],o)?r=[]:(r.length||i.push(r),r.push(n));return i},d3.range=function(t,e,n){if(arguments.length<3&&(n=1,arguments.length<2&&(e=t,t=0)),(e-t)/n==1/0)throw new Error("infinite range");var i,r=[],o=function(t){for(var e=1;t*e%1;)e*=10;return e}(Math.abs(n)),a=-1;if(t*=o,e*=o,(n*=o)<0)for(;(i=t+n*++a)>e;)r.push(i/o);else for(;(i=t+n*++a)<e;)r.push(i/o);return r},d3.requote=function(t){return t.replace(un,"\\$&")};var un=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g;d3.round=function(t,e){return e?Math.round(t*(e=Math.pow(10,e)))/e:Math.round(t)},d3.xhr=function(t,e,n){var i=new XMLHttpRequest;arguments.length<3?(n=e,e=null):e&&i.overrideMimeType&&i.overrideMimeType(e),i.open("GET",t,!0),e&&i.setRequestHeader("Accept",e),i.onreadystatechange=function(){var t;4===i.readyState&&(t=i.status,n(!t&&i.response||200<=t&&t<300||304===t?i:null))},i.send(null)},d3.text=function(t,e,n){arguments.length<3&&(n=e,e=null),d3.xhr(t,e,(function(t){n(t&&t.responseText)}))},d3.json=function(t,e){d3.text(t,"application/json",(function(t){e(t?JSON.parse(t):null)}))},d3.html=function(t,e){d3.text(t,"text/html",(function(t){var n;null!=t&&((n=document.createRange()).selectNode(document.body),t=n.createContextualFragment(t)),e(t)}))},d3.xml=function(t,e,n){arguments.length<3&&(n=e,e=null),d3.xhr(t,e,(function(t){n(t&&t.responseXML)}))};var cn={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};d3.ns={prefix:cn,qualify:function(t){var e=t.indexOf(":"),n=t;return 0<=e&&(n=t.substring(0,e),t=t.substring(e+1)),cn.hasOwnProperty(n)?{space:cn[n],local:t}:t}},d3.dispatch=function(){for(var t=new u,e=-1,n=arguments.length;++e<n;)t[arguments[e]]=c(t);return t},u.prototype.on=function(t,e){var n=t.indexOf("."),i="";return 0<n&&(i=t.substring(n+1),t=t.substring(0,n)),arguments.length<2?this[t].on(i):this[t].on(i,e)},d3.format=function(t){var e=(t=dn.exec(t))[1]||" ",n=t[3]||"",i=t[5],r=+t[6],o=t[7],a=t[8],s=t[9],l=1,u="",c=!1;a=a&&+a.substring(1);switch(i&&(e="0",o&&(r-=Math.floor((r-1)/4))),s){case"n":o=!0,s="g";break;case"%":l=100,u="%",s="f";break;case"p":l=100,u="%",s="r";break;case"d":c=!0,a=0;break;case"s":l=-1,s="r"}return"r"!=s||a||(s="g"),s=hn.get(s)||h,function(t){if(c&&t%1)return"";var d,h,f=t<0&&(t=-t)?"−":n;return l<0?(t=(d=d3.formatPrefix(t,a)).scale(t),u=d.symbol):t*=l,t=s(t,a),i?((h=t.length+f.length)<r&&(t=new Array(r-h+1).join(e)+t),t=f+(t=o?p(t):t)):(h=(t=f+(t=o?p(t):t)).length)<r&&(t=new Array(r-h+1).join(e)+t),t+u}};var dn=/(?:([^{])?([<>=^]))?([+\- ])?(#)?(0)?([0-9]+)?(,)?(\.[0-9]+)?([a-zA-Z%])?/,hn=d3.map({g:function(t,e){return t.toPrecision(e)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},r:function(t,e){return d3.round(t,e=d(t,e)).toFixed(Math.max(0,Math.min(20,e)))}}),pn=["y","z","a","f","p","n","μ","m","","k","M","G","T","P","E","Z","Y"].map((function(t,e){var n=Math.pow(10,3*Math.abs(8-e));return{scale:8<e?function(t){return t/n}:function(t){return t*n},symbol:t}}));function fn(){return m}d3.formatPrefix=function(t,e){var n=0;return t&&(t<0&&(t*=-1),e&&(t=d3.round(t,d(t,e))),n=1+Math.floor(1e-12+Math.log(t)/Math.LN10),n=Math.max(-24,Math.min(24,3*Math.floor((n<=0?n+1:n-1)/3)))),pn[8+n/3]};var gn=v(2),mn=v(3),vn=d3.map({linear:fn,poly:v,quad:function(){return gn},cubic:function(){return mn},sin:function(){return y},exp:function(){return b},circle:function(){return x},elastic:function(t,e){var n;return arguments.length<2&&(e=.45),n=arguments.length<1?(t=1,e/4):e/(2*Math.PI)*Math.asin(1/t),function(i){return 1+t*Math.pow(2,10*-i)*Math.sin(2*(i-n)*Math.PI/e)}},back:function(t){return t=t||1.70158,function(e){return e*e*((t+1)*e-t)}},bounce:function(){return w}}),yn=d3.map({in:m,out:f,"in-out":g,"out-in":function(t){return g(f(t))}});d3.ease=function(t){var e,n=0<=(i=t.indexOf("-"))?t.substring(0,i):t,i=0<=i?t.substring(i+1):"in";n=vn.get(n)||fn,i=yn.get(i)||m;return e=i(n.apply(null,Array.prototype.slice.call(arguments,1))),function(t){return t<=0?0:1<=t?1:e(t)}},d3.event=null,d3.interpolate=function(t,e){for(var n,i=d3.interpolators.length;0<=--i&&!(n=d3.interpolators[i](t,e)););return n},d3.interpolateNumber=function(t,e){return e-=t,function(n){return t+e*n}},d3.interpolateRound=function(t,e){return e-=t,function(n){return Math.round(t+e*n)}},d3.interpolateString=function(t,e){var n,i,r,o,a,s=0,l=[],u=[];for(bn.lastIndex=0,i=0;n=bn.exec(e);++i)n.index&&l.push(e.substring(s,n.index)),u.push({i:l.length,x:n[0]}),l.push(null),s=bn.lastIndex;for(s<e.length&&l.push(e.substring(s)),i=0,o=u.length;(n=bn.exec(t))&&i<o;++i)if((a=u[i]).x==n[0]){if(a.i)if(null==l[a.i+1])for(l[a.i-1]+=a.x,l.splice(a.i,1),r=i+1;r<o;++r)u[r].i--;else for(l[a.i-1]+=a.x+l[a.i+1],l.splice(a.i,2),r=i+1;r<o;++r)u[r].i-=2;else if(null==l[a.i+1])l[a.i]=a.x;else for(l[a.i]=a.x+l[a.i+1],l.splice(a.i+1,1),r=i+1;r<o;++r)u[r].i--;u.splice(i,1),o--,i--}else a.x=d3.interpolateNumber(parseFloat(n[0]),parseFloat(a.x));for(;i<o;)a=u.pop(),null==l[a.i+1]?l[a.i]=a.x:(l[a.i]=a.x+l[a.i+1],l.splice(a.i+1,1)),o--;return 1===l.length?null==l[0]?u[0].x:function(){return e}:function(t){for(i=0;i<o;++i)l[(a=u[i]).i]=a.x(t);return l.join("")}},d3.interpolateTransform=function(t,e){var n,i=[],r=[],o=d3.transform(t),a=d3.transform(e),s=o.translate,l=a.translate,u=o.rotate,c=a.rotate;t=o.skew,e=a.skew,o=o.scale,a=a.scale;return s[0]!=l[0]||s[1]!=l[1]?(i.push("translate(",null,",",null,")"),r.push({i:1,x:d3.interpolateNumber(s[0],l[0])},{i:3,x:d3.interpolateNumber(s[1],l[1])})):l[0]||l[1]?i.push("translate("+l+")"):i.push(""),u!=c?(180<u-c?c+=360:180<c-u&&(u+=360),r.push({i:i.push(i.pop()+"rotate(",null,")")-2,x:d3.interpolateNumber(u,c)})):c&&i.push(i.pop()+"rotate("+c+")"),t!=e?r.push({i:i.push(i.pop()+"skewX(",null,")")-2,x:d3.interpolateNumber(t,e)}):e&&i.push(i.pop()+"skewX("+e+")"),o[0]!=a[0]||o[1]!=a[1]?(n=i.push(i.pop()+"scale(",null,",",null,")"),r.push({i:n-4,x:d3.interpolateNumber(o[0],a[0])},{i:n-2,x:d3.interpolateNumber(o[1],a[1])})):1==a[0]&&1==a[1]||i.push(i.pop()+"scale("+a+")"),n=r.length,function(t){for(var e,o=-1;++o<n;)i[(e=r[o]).i]=e.x(t);return i.join("")}},d3.interpolateRgb=function(t,e){t=d3.rgb(t),e=d3.rgb(e);var n=t.r,i=t.g,r=t.b,o=e.r-n,a=e.g-i,s=e.b-r;return function(t){return"#"+T(Math.round(n+o*t))+T(Math.round(i+a*t))+T(Math.round(r+s*t))}},d3.interpolateHsl=function(t,e){t=d3.hsl(t),e=d3.hsl(e);var n=t.h,i=t.s,r=t.l,o=e.h-n,a=e.s-i,s=e.l-r;return 180<o?o-=360:o<-180&&(o+=360),function(t){return N(n+o*t,i+a*t,r+s*t).toString()}},d3.interpolateArray=function(t,e){for(var n=[],i=[],r=t.length,o=e.length,a=Math.min(t.length,e.length),s=0;s<a;++s)n.push(d3.interpolate(t[s],e[s]));for(;s<r;++s)i[s]=t[s];for(;s<o;++s)i[s]=e[s];return function(t){for(s=0;s<a;++s)i[s]=n[s](t);return i}},d3.interpolateObject=function(t,e){var n,i={},r={};for(n in t)n in e?i[n]=M(n)(t[n],e[n]):r[n]=t[n];for(n in e)n in t||(r[n]=e[n]);return function(t){for(n in i)r[n]=i[n](t);return r}};var bn=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g;d3.interpolators=[d3.interpolateObject,function(t,e){return e instanceof Array&&d3.interpolateArray(t,e)},function(t,e){return("string"==typeof t||"string"==typeof e)&&d3.interpolateString(t+"",e+"")},function(t,e){return("string"==typeof e?xn.has(e)||/^(#|rgb\(|hsl\()/.test(e):e instanceof j||e instanceof O)&&d3.interpolateRgb(t,e)},function(t,e){return!isNaN(t=+t)&&!isNaN(e=+e)&&d3.interpolateNumber(t,e)}],d3.rgb=function(t,e,n){return 1===arguments.length?t instanceof j?P(t.r,t.g,t.b):A(""+t,P,N):P(~~t,~~e,~~n)},j.prototype.brighter=function(t){t=Math.pow(.7,arguments.length?t:1);var e=this.r,n=this.g,i=this.b;return e||n||i?(e&&e<30&&(e=30),n&&n<30&&(n=30),i&&i<30&&(i=30),P(Math.min(255,Math.floor(e/t)),Math.min(255,Math.floor(n/t)),Math.min(255,Math.floor(i/t)))):P(30,30,30)},j.prototype.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),P(Math.floor(t*this.r),Math.floor(t*this.g),Math.floor(t*this.b))},j.prototype.hsl=function(){return k(this.r,this.g,this.b)},j.prototype.toString=function(){return"#"+T(this.r)+T(this.g)+T(this.b)};var xn=d3.map({aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"});xn.forEach((function(t,e){xn.set(t,A(e,P,N))})),d3.hsl=function(t,e,n){return 1===arguments.length?t instanceof O?L(t.h,t.s,t.l):A(""+t,k,L):L(+t,+e,+n)},O.prototype.brighter=function(t){return t=Math.pow(.7,arguments.length?t:1),L(this.h,this.s,this.l/t)},O.prototype.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),L(this.h,this.s,t*this.l)},O.prototype.rgb=function(){return N(this.h,this.s,this.l)},O.prototype.toString=function(){return this.rgb().toString()};var wn=function(t,e){return e.querySelector(t)},Cn=function(t,e){return e.querySelectorAll(t)},_n=(kn=document.documentElement).matchesSelector||kn.webkitMatchesSelector||kn.mozMatchesSelector||kn.msMatchesSelector||kn.oMatchesSelector,En=function(t,e){return _n.call(t,e)};"function"==typeof Sizzle&&(wn=function(t,e){return Sizzle(t,e)[0]||null},Cn=function(t,e){return Sizzle.uniqueSort(Sizzle(t,e))},En=Sizzle.matchesSelector);var Mn=[];d3.selection=function(){return Dn},(d3.selection.prototype=Mn).select=function(t){var e,n,i,r,o=[];"function"!=typeof t&&(t=R(t));for(var a=-1,s=this.length;++a<s;){o.push(e=[]),e.parentNode=(i=this[a]).parentNode;for(var l=-1,u=i.length;++l<u;)(r=i[l])?(e.push(n=t.call(r,r.__data__,l)),n&&"__data__"in r&&(n.__data__=r.__data__)):e.push(null)}return z(o)},Mn.selectAll=function(t){var e,n,i=[];"function"!=typeof t&&(t=H(t));for(var r=-1,o=this.length;++r<o;)for(var a=this[r],s=-1,l=a.length;++s<l;)(n=a[s])&&(i.push(e=on(t.call(n,n.__data__,s))),e.parentNode=n);return z(i)},Mn.attr=function(t,e){if(t=d3.ns.qualify(t),arguments.length<2){var n=this.node();return t.local?n.getAttributeNS(t.space,t.local):n.getAttribute(t)}return this.each(null==e?t.local?function(){this.removeAttributeNS(t.space,t.local)}:function(){this.removeAttribute(t)}:"function"==typeof e?t.local?function(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}:function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}:t.local?function(){this.setAttributeNS(t.space,t.local,e)}:function(){this.setAttribute(t,e)})},Mn.classed=function(t,e){var n=l(t).split(" "),i=n.length,r=-1;if(1<arguments.length){for(;++r<i;)F.call(this,n[r],e);return this}for(;++r<i;)if(!F.call(this,n[r]))return!1;return!0},Mn.style=function(t,e,n){return arguments.length<3&&(n=""),arguments.length<2?window.getComputedStyle(this.node(),null).getPropertyValue(t):this.each(null==e?function(){this.style.removeProperty(t)}:"function"==typeof e?function(){var i=e.apply(this,arguments);null==i?this.style.removeProperty(t):this.style.setProperty(t,i,n)}:function(){this.style.setProperty(t,e,n)})},Mn.property=function(t,e){return arguments.length<2?this.node()[t]:this.each(null==e?function(){delete this[t]}:"function"==typeof e?function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}:function(){this[t]=e})},Mn.text=function(t){return arguments.length<1?this.node().textContent:this.each("function"==typeof t?function(){var e=t.apply(this,arguments);this.textContent=null==e?"":e}:null==t?function(){this.textContent=""}:function(){this.textContent=t})},Mn.html=function(t){return arguments.length<1?this.node().innerHTML:this.each("function"==typeof t?function(){var e=t.apply(this,arguments);this.innerHTML=null==e?"":e}:null==t?function(){this.innerHTML=""}:function(){this.innerHTML=t})},Mn.append=function(t){return t=d3.ns.qualify(t),this.select(t.local?function(){return this.appendChild(document.createElementNS(t.space,t.local))}:function(){return this.appendChild(document.createElementNS(this.namespaceURI,t))})},Mn.insert=function(t,e){return t=d3.ns.qualify(t),this.select(t.local?function(){return this.insertBefore(document.createElementNS(t.space,t.local),wn(e,this))}:function(){return this.insertBefore(document.createElementNS(this.namespaceURI,t),wn(e,this))})},Mn.remove=function(){return this.each((function(){var t=this.parentNode;t&&t.removeChild(this)}))},Mn.data=function(e,n){function i(e,i){var r,o,a=e.length,s=i.length,d=Math.min(a,s),h=Math.max(a,s),p=[],f=[],g=[];if(n){for(var m,v=new t,y=[],b=i.length,x=-1;++x<a;)m=n.call(r=e[x],r.__data__,x),v.has(m)?g[b++]=r:v.set(m,r),y.push(m);for(x=-1;++x<s;)m=n.call(i,o=i[x],x),v.has(m)?(p[x]=r=v.get(m),r.__data__=o,f[x]=g[x]=null):(f[x]=V(o),p[x]=g[x]=null),v.remove(m);for(x=-1;++x<a;)v.has(y[x])&&(g[x]=e[x])}else{for(x=-1;++x<d;)r=e[x],o=i[x],r?(r.__data__=o,p[x]=r,f[x]=g[x]=null):(f[x]=V(o),p[x]=g[x]=null);for(;x<s;++x)f[x]=V(i[x]),p[x]=g[x]=null;for(;x<h;++x)g[x]=e[x],f[x]=p[x]=null}f.update=p,f.parentNode=p.parentNode=g.parentNode=e.parentNode,l.push(f),u.push(p),c.push(g)}var r,o,a=-1,s=this.length;if(!arguments.length){for(e=new Array(s=(r=this[0]).length);++a<s;)(o=r[a])&&(e[a]=o.__data__);return e}var l=W([]),u=z([]),c=z([]);if("function"==typeof e)for(;++a<s;)i(r=this[a],e.call(r,r.parentNode.__data__,a));else for(;++a<s;)i(r=this[a],e);return u.enter=function(){return l},u.exit=function(){return c},u},Mn.datum=Mn.map=function(t){return arguments.length<1?this.property("__data__"):this.property("__data__",t)},Mn.filter=function(t){var e,n,i,r,o=[];"function"!=typeof t&&(r=t,t=function(){return En(this,r)});for(var a=0,s=this.length;a<s;a++){o.push(e=[]),e.parentNode=(n=this[a]).parentNode;for(var l=0,u=n.length;l<u;l++)(i=n[l])&&t.call(i,i.__data__,l)&&e.push(i)}return z(o)},Mn.order=function(){for(var t=-1,e=this.length;++t<e;)for(var n,i=this[t],r=i.length-1,o=i[r];0<=--r;)(n=i[r])&&(o&&o!==n.nextSibling&&o.parentNode.insertBefore(n,o),o=n);return this},Mn.sort=function(t){t=function(t){return arguments.length||(t=d3.ascending),function(e,n){return t(e&&e.__data__,n&&n.__data__)}}.apply(this,arguments);for(var e=-1,n=this.length;++e<n;)this[e].sort(t);return this.order()},Mn.on=function(t,e,n){arguments.length<3&&(n=!1);var i="__on"+t,r=t.indexOf(".");return 0<r&&(t=t.substring(0,r)),arguments.length<2?(r=this.node()[i])&&r._:this.each((function(r,o){function a(t){var n=d3.event;d3.event=t;try{e.call(s,s.__data__,o)}finally{d3.event=n}}var s=this,l=s[i];l&&(s.removeEventListener(t,l,l.$),delete s[i]),e&&(s.addEventListener(t,s[i]=a,a.$=n),a._=e)}))},Mn.each=function(t){return B(this,(function(e,n,i){t.call(e,e.__data__,n,i)}))},Mn.call=function(t){return t.apply(this,(arguments[0]=this,arguments)),this},Mn.empty=function(){return!this.node()},Mn.node=function(t){for(var e=0,n=this.length;e<n;e++)for(var i=this[e],r=0,o=i.length;r<o;r++){var a=i[r];if(a)return a}return null},Mn.transition=function(){for(var t,e,n=[],i=-1,r=this.length;++i<r;){n.push(t=[]);for(var o=this[i],a=-1,s=o.length;++a<s;)t.push((e=o[a])?{node:e,delay:In,duration:Ln}:null)}return $(n,An||++Tn,Date.now())};var Dn=z([[document]]);Dn[0].parentNode=kn,d3.select=function(t){return"string"==typeof t?Dn.select(t):z([[t]])},d3.selectAll=function(t){return"string"==typeof t?Dn.selectAll(t):z([on(t)])};var Sn=[];d3.selection.enter=W,(d3.selection.enter.prototype=Sn).append=Mn.append,Sn.insert=Mn.insert,Sn.empty=Mn.empty,Sn.node=Mn.node,Sn.select=function(t){for(var e,n,i,r,o,a=[],s=-1,l=this.length;++s<l;){i=(r=this[s]).update,a.push(e=[]),e.parentNode=r.parentNode;for(var u=-1,c=r.length;++u<c;)(o=r[u])?(e.push(i[u]=n=t.call(r.parentNode,o.__data__,u)),n.__data__=o.__data__):e.push(null)}return z(a)};var Pn={},jn=[],Tn=0,An=0,kn=d3.ease("cubic-in-out"),In=0,Ln=250,On=kn;jn.call=Mn.call,d3.transition=function(t){return arguments.length?An?t.transition():t:Dn.transition()},(d3.transition.prototype=jn).select=function(t){var e,n,i,r=[];"function"!=typeof t&&(t=R(t));for(var o=-1,a=this.length;++o<a;){r.push(e=[]);for(var s=this[o],l=-1,u=s.length;++l<u;)(i=s[l])&&(n=t.call(i.node,i.node.__data__,l))?("__data__"in i.node&&(n.__data__=i.node.__data__),e.push({node:n,delay:i.delay,duration:i.duration})):e.push(null)}return $(r,this.id,this.time).ease(this.ease())},jn.selectAll=function(t){var e,n,i,r=[];"function"!=typeof t&&(t=H(t));for(var o=-1,a=this.length;++o<a;)for(var s=this[o],l=-1,u=s.length;++l<u;)if(i=s[l]){n=t.call(i.node,i.node.__data__,l),r.push(e=[]);for(var c=-1,d=n.length;++c<d;)e.push({node:n[c],delay:i.delay,duration:i.duration})}return $(r,this.id,this.time).ease(this.ease())},jn.attr=function(t,e){return this.attrTween(t,q(t,e))},jn.attrTween=function(t,e){var n=d3.ns.qualify(t);return this.tween("attr."+t,n.local?function(t,i){var r=e.call(this,t,i,this.getAttributeNS(n.space,n.local));return r===Pn?(this.removeAttributeNS(n.space,n.local),null):r&&function(t){this.setAttributeNS(n.space,n.local,r(t))}}:function(t,i){var r=e.call(this,t,i,this.getAttribute(n));return r===Pn?(this.removeAttribute(n),null):r&&function(t){this.setAttribute(n,r(t))}})},jn.style=function(t,e,n){return arguments.length<3&&(n=""),this.styleTween(t,q(t,e),n)},jn.styleTween=function(t,e,n){return arguments.length<3&&(n=""),this.tween("style."+t,(function(i,r){var o=e.call(this,i,r,window.getComputedStyle(this,null).getPropertyValue(t));return o===Pn?(this.style.removeProperty(t),null):o&&function(e){this.style.setProperty(t,o(e),n)}}))},jn.text=function(t){return this.tween("text",(function(e,n){this.textContent="function"==typeof t?t.call(this,e,n):t}))},jn.remove=function(){return this.each("end.transition",(function(){var t;!this.__transition__&&(t=this.parentNode)&&t.removeChild(this)}))},jn.delay=function(t){return B(this,"function"==typeof t?function(e,n,i){e.delay=0|t.call(e=e.node,e.__data__,n,i)}:(t|=0,function(e){e.delay=t}))},jn.duration=function(t){return B(this,"function"==typeof t?function(e,n,i){e.duration=Math.max(1,0|t.call(e=e.node,e.__data__,n,i))}:(t=Math.max(1,0|t),function(e){e.duration=t}))},jn.transition=function(){return this.select(n)};var Nn,zn,Rn=null;d3.timer=function(t,e,n){var i=!1,r=Rn;if(arguments.length<3){if(arguments.length<2)e=0;else if(!isFinite(e))return;n=Date.now()}for(;r;){if(r.callback===t){r.then=n,r.delay=e,i=!0;break}r=r.next}i||(Rn={callback:t,then:n,delay:e,next:Rn}),Nn||(zn=clearTimeout(zn),Nn=1,Hn(G))},d3.timer.flush=function(){for(var t,e=Date.now(),n=Rn;n;)t=e-n.then,n.delay||(n.flush=n.callback(t)),n=n.next;Y()};var Hn=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){setTimeout(t,17)};d3.transform=function(t){var e=document.createElementNS(d3.ns.prefix.svg,"g"),n={a:1,b:0,c:0,d:1,e:0,f:0};return(d3.transform=function(t){return e.setAttribute("transform",t),new X((t=e.transform.baseVal.consolidate())?t.matrix:n)})(t)},X.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var Fn=180/Math.PI;d3.mouse=function(t){return J(t,_())};var Vn=/WebKit/.test(navigator.userAgent)?-1:0;d3.touches=function(t,e){return(e=arguments.length<2?_().touches:e)?on(e).map((function(e){var n=J(t,e);return n.identifier=e.identifier,n})):[]},d3.scale={},d3.scale.linear=function(){return function t(e,n,i,r){function o(){var t=2<Math.min(e.length,n.length)?ut:lt,o=r?S:D;return s=t(e,n,o,i),l=t(n,e,o,d3.interpolate),a}function a(t){return s(t)}var s,l;return a.invert=function(t){return l(t)},a.domain=function(t){return arguments.length?(e=t.map(Number),o()):e},a.range=function(t){return arguments.length?(n=t,o()):n},a.rangeRound=function(t){return a.range(t).interpolate(d3.interpolateRound)},a.clamp=function(t){return arguments.length?(r=t,o()):r},a.interpolate=function(t){return arguments.length?(i=t,o()):i},a.ticks=function(t){return at(e,t)},a.tickFormat=function(t){return st(e,t)},a.nice=function(){return et(e,rt),o()},a.copy=function(){return t(e,n,i,r)},o()}([0,1],[0,1],d3.interpolate,!1)},d3.scale.log=function(){return function t(e,n){function i(t){return e(n(t))}var r=n.pow;return i.invert=function(t){return r(e.invert(t))},i.domain=function(t){return arguments.length?(n=t[0]<0?dt:ct,r=n.pow,e.domain(t.map(n)),i):e.domain().map(r)},i.nice=function(){return e.domain(et(e.domain(),nt)),i},i.ticks=function(){var t=Z(e.domain()),i=[];if(t.every(isFinite)){var o=Math.floor(t[0]),a=Math.ceil(t[1]),s=r(t[0]),l=r(t[1]);if(n===dt)for(i.push(r(o));o++<a;)for(var u=9;0<u;u--)i.push(r(o)*u);else{for(;o<a;o++)for(u=1;u<10;u++)i.push(r(o)*u);i.push(r(o))}for(o=0;i[o]<s;o++);for(a=i.length;i[a-1]>l;a--);i=i.slice(o,a)}return i},i.tickFormat=function(t,e){if(arguments.length<2&&(e=Bn),arguments.length<1)return e;var o,a=Math.max(.1,t/i.ticks().length),s=n===dt?(o=-1e-12,Math.floor):(o=1e-12,Math.ceil);return function(t){return t/r(s(n(t)+o))<=a?e(t):""}},i.copy=function(){return t(e.copy(),n)},it(i,e)}(d3.scale.linear(),ct)};var Bn=d3.format(".0e");ct.pow=function(t){return Math.pow(10,t)},dt.pow=function(t){return-Math.pow(10,-t)},d3.scale.pow=function(){return function t(e,n){function i(t){return e(r(t))}var r=ht(n),o=ht(1/n);return i.invert=function(t){return o(e.invert(t))},i.domain=function(t){return arguments.length?(e.domain(t.map(r)),i):e.domain().map(o)},i.ticks=function(t){return at(i.domain(),t)},i.tickFormat=function(t){return st(i.domain(),t)},i.nice=function(){return i.domain(et(i.domain(),rt))},i.exponent=function(t){if(!arguments.length)return n;var e=i.domain();return r=ht(n=t),o=ht(1/n),i.domain(e)},i.copy=function(){return t(e.copy(),n)},it(i,e)}(d3.scale.linear(),1)},d3.scale.sqrt=function(){return d3.scale.pow().exponent(.5)},d3.scale.ordinal=function(){return function e(n,i){function r(t){return s[((a.get(t)||a.set(t,n.push(t)))-1)%s.length]}function o(t,e){return d3.range(n.length).map((function(n){return t+e*n}))}var a,s,l;return r.domain=function(e){if(!arguments.length)return n;n=[],a=new t;for(var o,s=-1,l=e.length;++s<l;)a.has(o=e[s])||a.set(o,n.push(o));return r[i.t](i.x,i.p)},r.range=function(t){return arguments.length?(l=0,i={t:"range",x:s=t},r):s},r.rangePoints=function(t,e){var a=t[0],u=t[1],c=(u-a)/(n.length-1+(e=arguments.length<2?0:e));return s=o(n.length<2?(a+u)/2:a+c*e/2,c),l=0,i={t:"rangePoints",x:t,p:e},r},r.rangeBands=function(t,e){var a=t[1]<t[0],u=t[+a],c=(t[1-a]-u)/(n.length+(e=arguments.length<2?0:e));return s=o(u+c*e,c),a&&s.reverse(),l=c*(1-e),i={t:"rangeBands",x:t,p:e},r},r.rangeRoundBands=function(t,e){arguments.length<2&&(e=0);var a=t[1]<t[0],u=t[+a],c=t[1-a],d=Math.floor((c-u)/(n.length+e));c=c-u-(n.length-e)*d;return s=o(u+Math.round(c/2),d),a&&s.reverse(),l=Math.round(d*(1-e)),i={t:"rangeRoundBands",x:t,p:e},r},r.rangeBand=function(){return l},r.rangeExtent=function(){return Z(i.x)},r.copy=function(){return e(n,i)},r.domain(n)}([],{t:"range",x:[]})},d3.scale.category10=function(){return d3.scale.ordinal().range(Wn)},d3.scale.category20=function(){return d3.scale.ordinal().range($n)},d3.scale.category20b=function(){return d3.scale.ordinal().range(Un)},d3.scale.category20c=function(){return d3.scale.ordinal().range(qn)};var Wn=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],$n=["#1f77b4","#aec7e8","#ff7f0e","#ffbb78","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5","#8c564b","#c49c94","#e377c2","#f7b6d2","#7f7f7f","#c7c7c7","#bcbd22","#dbdb8d","#17becf","#9edae5"],Un=["#393b79","#5254a3","#6b6ecf","#9c9ede","#637939","#8ca252","#b5cf6b","#cedb9c","#8c6d31","#bd9e39","#e7ba52","#e7cb94","#843c39","#ad494a","#d6616b","#e7969c","#7b4173","#a55194","#ce6dbd","#de9ed6"],qn=["#3182bd","#6baed6","#9ecae1","#c6dbef","#e6550d","#fd8d3c","#fdae6b","#fdd0a2","#31a354","#74c476","#a1d99b","#c7e9c0","#756bb1","#9e9ac8","#bcbddc","#dadaeb","#636363","#969696","#bdbdbd","#d9d9d9"];d3.scale.quantile=function(){return function t(e,n){function i(){var t=0,i=(e.length,n.length);for(o=[];++t<i;)o[t-1]=d3.quantile(e,t/i);return r}function r(t){return isNaN(t=+t)?NaN:n[d3.bisect(o,t)]}var o;return r.domain=function(t){return arguments.length?(e=t.filter((function(t){return!isNaN(t)})).sort(d3.ascending),i()):e},r.range=function(t){return arguments.length?(n=t,i()):n},r.quantiles=function(){return o},r.copy=function(){return t(e,n)},i()}([],[])},d3.scale.quantize=function(){return function t(e,n,i){function r(t){return i[Math.max(0,Math.min(s,Math.floor(a*(t-e))))]}function o(){return a=i.length/(n-e),s=i.length-1,r}var a,s;return r.domain=function(t){return arguments.length?(e=+t[0],n=+t[t.length-1],o()):[e,n]},r.range=function(t){return arguments.length?(i=t,o()):i},r.copy=function(){return t(e,n,i)},o()}(0,1,[0,1])},d3.scale.identity=function(){return function t(e){function n(t){return+t}return(n.invert=n).domain=n.range=function(t){return arguments.length?(e=t.map(n),n):e},n.ticks=function(t){return at(e,t)},n.tickFormat=function(t){return st(e,t)},n.copy=function(){return t(e)},n}([0,1])},d3.svg={},d3.svg.arc=function(){function t(){var t=e.apply(this,arguments),r=n.apply(this,arguments),a=i.apply(this,arguments)+Gn,s=((d=o.apply(this,arguments)+Gn)<a&&(s=a,a=d,d=s),d-a),l=s<Math.PI?"0":"1",u=Math.cos(a),c=Math.sin(a),d=(a=Math.cos(d),Math.sin(d));return Yn<=s?t?"M0,"+r+"A"+r+","+r+" 0 1,1 0,"+-r+"A"+r+","+r+" 0 1,1 0,"+r+"M0,"+t+"A"+t+","+t+" 0 1,0 0,"+-t+"A"+t+","+t+" 0 1,0 0,"+t+"Z":"M0,"+r+"A"+r+","+r+" 0 1,1 0,"+-r+"A"+r+","+r+" 0 1,1 0,"+r+"Z":t?"M"+r*u+","+r*c+"A"+r+","+r+" 0 "+l+",1 "+r*a+","+r*d+"L"+t*a+","+t*d+"A"+t+","+t+" 0 "+l+",0 "+t*u+","+t*c+"Z":"M"+r*u+","+r*c+"A"+r+","+r+" 0 "+l+",1 "+r*a+","+r*d+"L0,0Z"}var e=pt,n=ft,i=gt,o=mt;return t.innerRadius=function(n){return arguments.length?(e=r(n),t):e},t.outerRadius=function(e){return arguments.length?(n=r(e),t):n},t.startAngle=function(e){return arguments.length?(i=r(e),t):i},t.endAngle=function(e){return arguments.length?(o=r(e),t):o},t.centroid=function(){var t=(e.apply(this,arguments)+n.apply(this,arguments))/2,r=(i.apply(this,arguments)+o.apply(this,arguments))/2+Gn;return[Math.cos(r)*t,Math.sin(r)*t]},t};var Gn=-Math.PI/2,Yn=2*Math.PI-1e-6;d3.svg.line=function(){return vt(e)};var Xn="linear",Qn=d3.map({linear:xt,"step-before":wt,"step-after":Ct,basis:Mt,"basis-open":function(t){if(t.length<4)return xt(t);for(var e,n=[],i=-1,r=t.length,o=[0],a=[0];++i<3;)e=t[i],o.push(e[0]),a.push(e[1]);for(n.push(Dt(Zn,o)+","+Dt(Zn,a)),--i;++i<r;)e=t[i],o.shift(),o.push(e[0]),a.shift(),a.push(e[1]),St(n,o,a);return n.join("")},"basis-closed":function(t){for(var e,n,i=-1,r=t.length,o=r+4,a=[],s=[];++i<4;)n=t[i%r],a.push(n[0]),s.push(n[1]);for(e=[Dt(Zn,a),",",Dt(Zn,s)],--i;++i<o;)n=t[i%r],a.shift(),a.push(n[0]),s.shift(),s.push(n[1]),St(e,a,s);return e.join("")},bundle:function(t,e){var n=t.length-1;if(n)for(var i,r,o=t[0][0],a=t[0][1],s=t[n][0]-o,l=t[n][1]-a,u=-1;++u<=n;)(i=t[u])[0]=e*i[0]+(1-e)*(o+(r=u/n)*s),i[1]=e*i[1]+(1-e)*(a+r*l);return Mt(t)},cardinal:function(t,e,n){return t.length<3?xt(t):t[0]+_t(t,Et(t,e))},"cardinal-open":function(t,e){return t.length<4?xt(t):t[1]+_t(t.slice(1,t.length-1),Et(t,e))},"cardinal-closed":function(t,e){return t.length<3?xt(t):t[0]+_t((t.push(t[0]),t),Et([t[t.length-2]].concat(t,[t[1]]),e))},monotone:function(t){return t.length<3?xt(t):t[0]+_t(t,function(t){for(var e,n,i,r,o=[],a=function(t){for(var e=0,n=t.length-1,i=[],r=t[0],o=t[1],a=i[0]=Pt(r,o);++e<n;)i[e]=a+(a=Pt(o,o=t[e+1]));return i[e]=a,i}(t),s=-1,l=t.length-1;++s<l;)e=Pt(t[s],t[s+1]),Math.abs(e)<1e-6?a[s]=a[s+1]=0:9<(r=(n=a[s]/e)*n+(i=a[s+1]/e)*i)&&(r=3*e/Math.sqrt(r),a[s]=r*n,a[s+1]=r*i);for(s=-1;++s<=l;)r=(t[Math.min(l,s+1)][0]-t[Math.max(0,s-1)][0])/(6*(1+a[s]*a[s])),o.push([r||0,a[s]*r||0]);return o}(t))}}),Kn=[0,2/3,1/3,0],Jn=[0,1/3,2/3,0],Zn=[0,1/6,2/3,1/6];d3.svg.line.radial=function(){var t=vt(jt);return t.radius=t.x,delete t.x,t.angle=t.y,delete t.y,t},(wt.reverse=Ct).reverse=wt,d3.svg.area=function(){return Tt(Object)},d3.svg.area.radial=function(){var t=Tt(jt);return t.radius=t.x,delete t.x,t.innerRadius=t.x0,delete t.x0,t.outerRadius=t.x1,delete t.x1,t.angle=t.y,delete t.y,t.startAngle=t.y0,delete t.y0,t.endAngle=t.y1,delete t.y1,t},d3.svg.chord=function(){function t(t,r){var s=e(this,o,t,r),l=e(this,a,t,r);return"M"+s.p0+n(s.r,s.p1,s.a1-s.a0)+(t=l,((r=s).a0==t.a0&&r.a1==t.a1?i(s.r,s.p1,s.r,s.p0):i(s.r,s.p1,l.r,l.p0)+n(l.r,l.p1,l.a1-l.a0)+i(l.r,l.p1,s.r,s.p0))+"Z")}function e(t,e,n,i){var r=e.call(t,n,i);return{r:e=s.call(t,r,i),a0:n=l.call(t,r,i)+Gn,a1:i=u.call(t,r,i)+Gn,p0:[e*Math.cos(n),e*Math.sin(n)],p1:[e*Math.cos(i),e*Math.sin(i)]}}function n(t,e,n){return"A"+t+","+t+" 0 "+ +(n>Math.PI)+",1 "+e}function i(t,e,n,i){return"Q 0,0 "+i}var o=At,a=kt,s=It,l=gt,u=mt;return t.radius=function(e){return arguments.length?(s=r(e),t):s},t.source=function(e){return arguments.length?(o=r(e),t):o},t.target=function(e){return arguments.length?(a=r(e),t):a},t.startAngle=function(e){return arguments.length?(l=r(e),t):l},t.endAngle=function(e){return arguments.length?(u=r(e),t):u},t},d3.svg.diagonal=function(){function t(t,r){var o=e.call(this,t,r);t=n.call(this,t,r),r=(o.y+t.y)/2;return"M"+(t=(t=[o,{x:o.x,y:r},{x:t.x,y:r},t]).map(i))[0]+"C"+t[1]+" "+t[2]+" "+t[3]}var e=At,n=kt,i=Lt;return t.source=function(n){return arguments.length?(e=r(n),t):e},t.target=function(e){return arguments.length?(n=r(e),t):n},t.projection=function(e){return arguments.length?(i=e,t):i},t},d3.svg.diagonal.radial=function(){var t=d3.svg.diagonal(),e=Lt,n=t.projection;return t.projection=function(t){return arguments.length?n((i=e=t,function(){var t=(e=i.apply(this,arguments))[0],e=e[1]+Gn;return[t*Math.cos(e),t*Math.sin(e)]})):e;var i},t},d3.svg.mouse=d3.mouse,d3.svg.touches=d3.touches,d3.svg.symbol=function(){function t(t,i){return(ti.get(e.call(this,t,i))||zt)(n.call(this,t,i))}var e=Nt,n=Ot;return t.type=function(n){return arguments.length?(e=r(n),t):e},t.size=function(e){return arguments.length?(n=r(e),t):n},t};var ti=d3.map({circle:zt,cross:function(t){return"M"+-3*(t=Math.sqrt(t/5)/2)+","+-t+"H"+-t+"V"+-3*t+"H"+t+"V"+-t+"H"+3*t+"V"+t+"H"+t+"V"+3*t+"H"+-t+"V"+t+"H"+-3*t+"Z"},diamond:function(t){var e=Math.sqrt(t/(2*ni));return"M0,"+-e+"L"+(t=e*ni)+",0 0,"+e+" "+-t+",0Z"},square:function(t){return"M"+-(t=Math.sqrt(t)/2)+","+-t+"L"+t+","+-t+" "+t+","+t+" "+-t+","+t+"Z"},"triangle-down":function(t){var e=Math.sqrt(t/ei);return"M0,"+(t=e*ei/2)+"L"+e+","+-t+" "+-e+","+-t+"Z"},"triangle-up":function(t){var e=Math.sqrt(t/ei);return"M0,"+-(t=e*ei/2)+"L"+e+","+t+" "+-e+","+t+"Z"}});d3.svg.symbolTypes=ti.keys();var ei=Math.sqrt(3),ni=Math.tan(30*Math.PI/180);d3.svg.axis=function(){function t(t){t.each((function(){var t,d=d3.select(this),h=null==u?n.ticks?n.ticks.apply(n,l):n.domain():u,p=null==e?n.tickFormat?n.tickFormat.apply(n,l):String:e,f=function(t,e,n){if(i=[],n&&1<e.length){for(var i,r,o,a=Z(t.domain()),s=-1,l=e.length,u=(e[1]-e[0])/++n;++s<l;)for(r=n;0<--r;)(o=+e[s]-r*u)>=a[0]&&i.push(o);for(--s,r=0;++r<n&&(o=+e[s]+r*u)<a[1];)i.push(o)}return i}(n,h,c),g=(b=d.selectAll(".minor").data(f,String)).enter().insert("line","g").attr("class","tick minor").style("opacity",1e-6),m=d3.transition(b.exit()).style("opacity",1e-6).remove(),v=d3.transition(b).style("opacity",1),y=d.selectAll("g").data(h,String),b=(f=y.enter().insert("g","path").style("opacity",1e-6),d3.transition(y.exit()).style("opacity",1e-6).remove()),x=(h=d3.transition(y).style("opacity",1),tt(n)),w=((d=d.selectAll(".domain").data([0])).enter().append("path").attr("class","domain"),d3.transition(d)),C=n.copy();d=this.__chart__||C;this.__chart__=C,f.append("line").attr("class","tick"),f.append("text");var _,E=f.select("line"),M=h.select("line"),D=y.select("text").text(p),S=f.select("text"),P=h.select("text");switch(i){case"bottom":t=Rt,g.attr("y2",o),v.attr("x2",0).attr("y2",o),E.attr("y2",r),S.attr("y",Math.max(r,0)+s),M.attr("x2",0).attr("y2",r),P.attr("x",0).attr("y",Math.max(r,0)+s),D.attr("dy",".71em").attr("text-anchor","middle"),w.attr("d","M"+x[0]+","+a+"V0H"+x[1]+"V"+a);break;case"top":t=Rt,g.attr("y2",-o),v.attr("x2",0).attr("y2",-o),E.attr("y2",-r),S.attr("y",-(Math.max(r,0)+s)),M.attr("x2",0).attr("y2",-r),P.attr("x",0).attr("y",-(Math.max(r,0)+s)),D.attr("dy","0em").attr("text-anchor","middle"),w.attr("d","M"+x[0]+","+-a+"V0H"+x[1]+"V"+-a);break;case"left":t=Ht,g.attr("x2",-o),v.attr("x2",-o).attr("y2",0),E.attr("x2",-r),S.attr("x",-(Math.max(r,0)+s)),M.attr("x2",-r).attr("y2",0),P.attr("x",-(Math.max(r,0)+s)).attr("y",0),D.attr("dy",".32em").attr("text-anchor","end"),w.attr("d","M"+-a+","+x[0]+"H0V"+x[1]+"H"+-a);break;case"right":t=Ht,g.attr("x2",o),v.attr("x2",o).attr("y2",0),E.attr("x2",r),S.attr("x",Math.max(r,0)+s),M.attr("x2",r).attr("y2",0),P.attr("x",Math.max(r,0)+s).attr("y",0),D.attr("dy",".32em").attr("text-anchor","start"),w.attr("d","M"+a+","+x[0]+"H0V"+x[1]+"H"+a)}n.ticks?(f.call(t,d),h.call(t,C),b.call(t,C),g.call(t,d),v.call(t,C),m.call(t,C)):(_=C.rangeBand()/2,f.call(t,f=function(t){return C(t)+_}),h.call(t,f))}))}var e,n=d3.scale.linear(),i="bottom",r=6,o=6,a=6,s=3,l=[10],u=null,c=0;return t.scale=function(e){return arguments.length?(n=e,t):n},t.orient=function(e){return arguments.length?(i=e,t):i},t.ticks=function(){return arguments.length?(l=arguments,t):l},t.tickValues=function(e){return arguments.length?(u=e,t):u},t.tickFormat=function(n){return arguments.length?(e=n,t):e},t.tickSize=function(e,n,i){if(!arguments.length)return r;var s=arguments.length-1;return r=+e,o=1<s?+n:r,a=0<s?+arguments[s]:r,t},t.tickPadding=function(e){return arguments.length?(s=+e,t):s},t.tickSubdivide=function(e){return arguments.length?(c=+e,t):c},t},d3.svg.brush=function(){function t(o){o.each((function(){var o,a=d3.select(this),c=a.selectAll(".background").data([0]),d=a.selectAll(".extent").data([0]),h=a.selectAll(".resize").data(u,String);a.style("pointer-events","all").on("mousedown.brush",r).on("touchstart.brush",r),c.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),d.enter().append("rect").attr("class","extent").style("cursor","move"),h.enter().append("g").attr("class",(function(t){return"resize "+t})).style("cursor",(function(t){return ii[t]})).append("rect").attr("x",(function(t){return/[ew]$/.test(t)?-3:null})).attr("y",(function(t){return/^[ns]/.test(t)?-3:null})).attr("width",6).attr("height",6).style("visibility","hidden"),h.style("display",t.empty()?"none":null),h.exit().remove(),s&&(o=tt(s),c.attr("x",o[0]).attr("width",o[1]-o[0]),n(a)),l&&(o=tt(l),c.attr("y",o[0]).attr("height",o[1]-o[0]),i(a)),e(a)}))}function e(t){t.selectAll(".resize").attr("transform",(function(t){return"translate("+c[+/e$/.test(t)][0]+","+c[+/^s/.test(t)][1]+")"}))}function n(t){t.select(".extent").attr("x",c[0][0]),t.selectAll(".extent,.n>rect,.s>rect").attr("width",c[1][0]-c[0][0])}function i(t){t.select(".extent").attr("y",c[0][1]),t.selectAll(".extent,.e>rect,.w>rect").attr("height",c[1][1]-c[0][1])}function r(){function r(){var t=d3.event.changedTouches;return t?d3.touches(m,t)[0]:d3.mouse(m)}function u(){var t=r(),o=!1;g&&(t[0]+=g[0],t[1]+=g[1]),E||(d3.event.altKey?(p=p||[(c[0][0]+c[1][0])/2,(c[0][1]+c[1][1])/2],M[0]=c[+(t[0]<p[0])][0],M[1]=c[+(t[1]<p[1])][1]):p=null),w&&d(t,s,0)&&(n(b),o=!0),_&&d(t,l,1)&&(i(b),o=!0),o&&(e(b),y({type:"brush",mode:E?"move":"resize"}))}function d(t,e,n){var i,r=(s=tt(e))[0],a=s[1],s=(e=M[n],c[1][n]-c[0][n]);return E&&(r-=e,a-=s+e),t=Math.max(r,Math.min(a,t[n])),E?i=(t+=e)+s:(e=p?Math.max(r,Math.min(a,2*p[n]-t)):e)<t?(i=t,t=e):i=e,(c[0][n]!==t||c[1][n]!==i)&&(o=null,c[0][n]=t,c[1][n]=i,1)}function h(){u(),b.style("pointer-events","all").selectAll(".resize").style("display",t.empty()?"none":null),d3.select("body").style("cursor",null),D.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),y({type:"brushend"}),C()}var p,f,g,m=this,v=d3.select(d3.event.target),y=a.of(m,arguments),b=d3.select(m),x=v.datum(),w=!/^(n|s)$/.test(x)&&s,_=!/^(e|w)$/.test(x)&&l,E=v.classed("extent"),M=r(),D=d3.select(window).on("mousemove.brush",u).on("mouseup.brush",h).on("touchmove.brush",u).on("touchend.brush",h).on("keydown.brush",(function(){32==d3.event.keyCode&&(E||(p=null,M[0]-=c[1][0],M[1]-=c[1][1],E=2),C())})).on("keyup.brush",(function(){32==d3.event.keyCode&&2==E&&(M[0]+=c[1][0],M[1]+=c[1][1],E=0,C())}));E?(M[0]=c[0][0]-M[0],M[1]=c[0][1]-M[1]):x?(f=+/w$/.test(x),x=+/^n/.test(x),g=[c[1-f][0]-M[0],c[1-x][1]-M[1]],M[0]=c[f][0],M[1]=c[x][1]):d3.event.altKey&&(p=M.slice()),b.style("pointer-events","none").selectAll(".resize").style("display",null),d3.select("body").style("cursor",v.style("cursor")),y({type:"brushstart"}),u(),C()}var o,a=E(t,"brushstart","brush","brushend"),s=null,l=null,u=ri[0],c=[[0,0],[0,0]];return t.x=function(e){return arguments.length?(u=ri[!(s=e)<<1|!l],t):s},t.y=function(e){return arguments.length?(u=ri[!s<<1|!(l=e)],t):l},t.extent=function(e){var n,i,r,a,u;return arguments.length?(o=[[0,0],[0,0]],s&&(n=e[0],i=e[1],l&&(n=n[0],i=i[0]),o[0][0]=n,o[1][0]=i,s.invert&&(n=s(n),i=s(i)),i<n&&(u=n,n=i,i=u),c[0][0]=0|n,c[1][0]=0|i),l&&(r=e[0],a=e[1],s&&(r=r[1],a=a[1]),o[0][1]=r,o[1][1]=a,l.invert&&(r=l(r),a=l(a)),a<r&&(u=r,r=a,a=u),c[0][1]=0|r,c[1][1]=0|a),t):(e=o||c,s&&(n=e[0][0],i=e[1][0],o||(n=c[0][0],i=c[1][0],s.invert&&(n=s.invert(n),i=s.invert(i)),i<n&&(u=n,n=i,i=u))),l&&(r=e[0][1],a=e[1][1],o||(r=c[0][1],a=c[1][1],l.invert&&(r=l.invert(r),a=l.invert(a)),a<r&&(u=r,r=a,a=u))),s&&l?[[n,r],[i,a]]:s?[n,i]:l&&[r,a])},t.clear=function(){return o=null,c[0][0]=c[0][1]=c[1][0]=c[1][1]=0,t},t.empty=function(){return s&&c[0][0]===c[1][0]||l&&c[0][1]===c[1][1]},d3.rebind(t,a,"on")};var ii={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},ri=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]];d3.behavior={},d3.behavior.drag=function(){function t(){this.on("mousedown.drag",e).on("touchstart.drag",e)}function e(){function t(){var t=a.parentNode,e=d3.event.changedTouches;return e?d3.touches(t,e)[0]:d3.mouse(t)}function e(){if(!a.parentNode)return r();var e=t(),n=e[0]-u[0],i=e[1]-u[1];c|=n|i,u=e,C(),s({type:"drag",x:e[0]+h[0],y:e[1]+h[1],dx:n,dy:i})}function r(){s({type:"dragend"}),c&&(C(),d3.event.target===l&&d.on("click.drag",o,!0)),d.on("mousemove.drag",null).on("touchmove.drag",null).on("mouseup.drag",null).on("touchend.drag",null)}function o(){C(),d.on("click.drag",null)}var a=this,s=n.of(a,arguments),l=d3.event.target,u=t(),c=0,d=d3.select(window).on("mousemove.drag",e).on("touchmove.drag",e).on("mouseup.drag",r,!0).on("touchend.drag",r,!0),h=i?[(h=i.apply(a,arguments)).x-u[0],h.y-u[1]]:[0,0];C(),s({type:"dragstart"})}var n=E(t,"drag","dragstart","dragend"),i=null;return t.origin=function(e){return arguments.length?(i=e,t):i},d3.rebind(t,n,"on")},d3.behavior.zoom=function(){function t(){this.on("mousedown.zoom",o).on("mousewheel.zoom",a).on("mousemove.zoom",s).on("DOMMouseScroll.zoom",a).on("dblclick.zoom",l).on("touchstart.zoom",u).on("touchmove.zoom",c).on("touchend.zoom",u)}function e(t){return[(t[0]-y[0])/b,(t[1]-y[1])/b]}function n(t){b=Math.max(x[0],Math.min(x[1],t))}function i(t,e){var n;e=[(n=e)[0]*b+y[0],n[1]*b+y[1]],y[0]+=t[0]-e[0],y[1]+=t[1]-e[1]}function r(t){f&&f.domain(p.range().map((function(t){return(t-y[0])/b})).map(p.invert)),m&&m.domain(g.range().map((function(t){return(t-y[1])/b})).map(g.invert)),d3.event.preventDefault(),t({type:"zoom",scale:b,translate:y})}function o(){function t(){C(),l.on("click.zoom",null)}var n=this,o=w.of(n,arguments),a=d3.event.target,s=0,l=d3.select(window).on("mousemove.zoom",(function(){s=1,i(d3.mouse(n),u),r(o)})).on("mouseup.zoom",(function(){s&&C(),l.on("mousemove.zoom",null).on("mouseup.zoom",null),s&&d3.event.target===a&&l.on("click.zoom",t,!0)})),u=e(d3.mouse(n));window.focus(),C()}function a(){d=d||e(d3.mouse(this)),n(Math.pow(2,.002*function(){oi=oi||d3.select("body").append("div").style("visibility","hidden").style("top",0).style("height",0).style("width",0).style("overflow-y","scroll").append("div").style("height","2000px").node().parentNode;var t,e=d3.event;try{oi.scrollTop=1e3,oi.dispatchEvent(e),t=1e3-oi.scrollTop}catch(n){t=e.wheelDelta||5*-e.detail}return t}())*b),i(d3.mouse(this),d),r(w.of(this,arguments))}function s(){d=null}function l(){var t=d3.mouse(this),o=e(t);n(d3.event.shiftKey?b/2:2*b),i(t,o),r(w.of(this,arguments))}function u(){var t,o=d3.touches(this),a=Date.now();h=b,d={},o.forEach((function(t){d[t.identifier]=e(t)})),C(),1===o.length&&a-v<500&&(t=o[0],o=e(o[0]),n(2*b),i(t,o),r(w.of(this,arguments))),v=a}function c(){var t,e=d3.touches(this),o=e[0],a=d[o.identifier];(t=e[1])&&(e=d[t.identifier],o=[(o[0]+t[0])/2,(o[1]+t[1])/2],a=[(a[0]+e[0])/2,(a[1]+e[1])/2],n(d3.event.scale*h)),i(o,a),r(w.of(this,arguments))}var d,h,p,f,g,m,v,y=[0,0],b=1,x=li,w=E(t,"zoom");return t.translate=function(e){return arguments.length?(y=e.map(Number),t):y},t.scale=function(e){return arguments.length?(b=+e,t):b},t.scaleExtent=function(e){return arguments.length?(x=null==e?li:e.map(Number),t):x},t.x=function(e){return arguments.length?(p=(f=e).copy(),t):f},t.y=function(e){return arguments.length?(g=(m=e).copy(),t):m},d3.rebind(t,w,"on")};var oi,ai,si,li=[0,1/0];d3.layout={},d3.layout.bundle=function(){return function(t){for(var e=[],n=-1,i=t.length;++n<i;)e.push(Ft(t[n]));return e}},d3.layout.chord=function(){function t(){var t,u,d,h,p,f={},g=[],m=d3.range(o),v=[];for(n=[],i=[],t=0,h=-1;++h<o;){for(u=0,p=-1;++p<o;)u+=r[h][p];g.push(u),v.push(d3.range(o)),t+=u}for(a&&m.sort((function(t,e){return a(g[t],g[e])})),s&&v.forEach((function(t,e){t.sort((function(t,n){return s(r[e][t],r[e][n])}))})),t=(2*Math.PI-c*o)/t,u=0,h=-1;++h<o;){for(d=u,p=-1;++p<o;){var y=m[h],b=v[y][p],x=r[y][b],w=u,C=u+=x*t;f[y+"-"+b]={index:y,subindex:b,startAngle:w,endAngle:C,value:x}}i[y]={index:y,startAngle:d,endAngle:u,value:(u-d)/t},u+=c}for(h=-1;++h<o;)for(p=h-1;++p<o;){var _=f[h+"-"+p],E=f[p+"-"+h];(_.value||E.value)&&n.push(_.value<E.value?{source:E,target:_}:{source:_,target:E})}l&&e()}function e(){n.sort((function(t,e){return l((t.source.value+t.target.value)/2,(e.source.value+e.target.value)/2)}))}var n,i,r,o,a,s,l,u={},c=0;return u.matrix=function(t){return arguments.length?(o=(r=t)&&r.length,n=i=null,u):r},u.padding=function(t){return arguments.length?(c=t,n=i=null,u):c},u.sortGroups=function(t){return arguments.length?(a=t,n=i=null,u):a},u.sortSubgroups=function(t){return arguments.length?(s=t,n=null,u):s},u.sortChords=function(t){return arguments.length?(l=t,n&&e(),u):l},u.chords=function(){return n||t(),n},u.groups=function(){return i||t(),i},u},d3.layout.force=function(){function t(t){Bt(si=t),ai=l}var n,i,o,a,s,l={},u=d3.dispatch("start","tick","end"),c=[1,1],d=.9,h=qt,p=Gt,f=-30,g=.1,m=.8,v=[],y=[];return l.tick=function(){if((i*=.99)<.005)return u.end({type:"end",alpha:i=0}),!0;for(var t,e,n,r,l,h,p,b,x=v.length,w=y.length,C=0;C<w;++C)n=(e=y[C]).source,(l=(p=(r=e.target).x-n.x)*p+(b=r.y-n.y)*b)&&(p*=l=i*a[C]*((l=Math.sqrt(l))-o[C])/l,b*=l,r.x-=p*(h=n.weight/(r.weight+n.weight)),r.y-=b*h,n.x+=p*(h=1-h),n.y+=b*h);if((h=i*g)&&(p=c[0]/2,b=c[1]/2,C=-1,h))for(;++C<x;)(e=v[C]).x+=(p-e.x)*h,e.y+=(b-e.y)*h;if(f)for(function t(e,n,i){var r,o=0,a=0;if(e.charge=0,!e.leaf)for(var s,l=e.nodes,u=l.length,c=-1;++c<u;)null!=(s=l[c])&&(t(s,n,i),e.charge+=s.charge,o+=s.charge*s.cx,a+=s.charge*s.cy);e.point&&(e.leaf||(e.point.x+=Math.random()-.5,e.point.y+=Math.random()-.5),r=n*i[e.point.index],e.charge+=e.pointCharge=r,o+=r*e.point.x,a+=r*e.point.y),e.cx=o/e.charge,e.cy=a/e.charge}(t=d3.geom.quadtree(v),i,s),C=-1;++C<x;)(e=v[C]).fixed||t.visit(function(t){return function(e,n,i,r,o){if(e.point!==t){var a=e.cx-t.x,s=e.cy-t.y,l=1/Math.sqrt(a*a+s*s);if((r-n)*l<m){var u=e.charge*l*l;return t.px-=a*u,t.py-=s*u,!0}e.point&&isFinite(l)&&(u=e.pointCharge*l*l,t.px-=a*u,t.py-=s*u)}return!e.charge}}(e));for(C=-1;++C<x;)(e=v[C]).fixed?(e.x=e.px,e.y=e.py):(e.x-=(e.px-(e.px=e.x))*d,e.y-=(e.py-(e.py=e.y))*d);u.tick({type:"tick",alpha:i})},l.nodes=function(t){return arguments.length?(v=t,l):v},l.links=function(t){return arguments.length?(y=t,l):y},l.size=function(t){return arguments.length?(c=t,l):c},l.linkDistance=function(t){return arguments.length?(h=r(t),l):h},l.distance=l.linkDistance,l.linkStrength=function(t){return arguments.length?(p=r(t),l):p},l.friction=function(t){return arguments.length?(d=t,l):d},l.charge=function(t){return arguments.length?(f="function"==typeof t?t:+t,l):f},l.gravity=function(t){return arguments.length?(g=t,l):g},l.theta=function(t){return arguments.length?(m=t,l):m},l.alpha=function(t){return arguments.length?(i?i=0<t?t:0:0<t&&(u.start({type:"start",alpha:i=t}),d3.timer(l.tick)),l):i},l.start=function(){function t(t,i){for(var o,a=function(){if(!n){for(n=[],e=0;e<r;++e)n[e]=[];for(e=0;e<u;++e){var t=y[e];n[t.source.index].push(t.target),n[t.target.index].push(t.source)}}return n[m]}(),s=-1,l=a.length;++s<l;)if(!isNaN(o=a[s][t]))return o;return Math.random()*i}for(var e,n,i,r=v.length,u=y.length,d=c[0],g=c[1],m=0;m<r;++m)(i=v[m]).index=m,i.weight=0;for(o=[],a=[],m=0;m<u;++m)"number"==typeof(i=y[m]).source&&(i.source=v[i.source]),"number"==typeof i.target&&(i.target=v[i.target]),o[m]=h.call(this,i,m),a[m]=p.call(this,i,m),++i.source.weight,++i.target.weight;for(m=0;m<r;++m)i=v[m],isNaN(i.x)&&(i.x=t("x",d)),isNaN(i.y)&&(i.y=t("y",g)),isNaN(i.px)&&(i.px=i.x),isNaN(i.py)&&(i.py=i.y);if(s=[],"function"==typeof f)for(m=0;m<r;++m)s[m]=+f.call(this,v[m],m);else for(m=0;m<r;++m)s[m]=f;return l.resume()},l.resume=function(){return l.alpha(.1)},l.stop=function(){return l.alpha(0)},l.drag=function(){n=n||d3.behavior.drag().origin(e).on("dragstart",t).on("drag",Ut).on("dragend",$t),this.on("mouseover.force",Bt).on("mouseout.force",Wt).call(n)},d3.rebind(l,u,"on")},d3.layout.partition=function(){function t(t,i){return function t(e,n,i,r){var o=e.children;if(e.x=n,e.y=e.depth*r,e.dx=i,e.dy=r,o&&(a=o.length)){var a,s,l=-1;for(i=e.value?i/e.value:0;++l<a;)t(s=o[l],n,s=s.value*i,r),n+=s}}((i=e.call(this,t,i))[0],0,n[0],n[1]/function t(e){var n=e.children,i=0;if(n&&(r=n.length))for(var r,o=-1;++o<r;)i=Math.max(i,t(n[o]));return 1+i}(i[0])),i}var e=d3.layout.hierarchy(),n=[1,1];return t.size=function(e){return arguments.length?(n=e,t):n},oe(t,e)},d3.layout.pie=function(){function t(o,a){var s=o.map((function(n,i){return+e.call(t,n,i)})),l=+("function"==typeof i?i.apply(this,arguments):i),u=(("function"==typeof r?r.apply(this,arguments):r)-i)/d3.sum(s),c=d3.range(o.length);null!=n&&c.sort(n===ui?function(t,e){return s[e]-s[t]}:function(t,e){return n(o[t],o[e])});var d=[];return c.forEach((function(t){d[t]={data:o[t],value:t=s[t],startAngle:l,endAngle:l+=t*u}})),d}var e=Number,n=ui,i=0,r=2*Math.PI;return t.value=function(n){return arguments.length?(e=n,t):e},t.sort=function(e){return arguments.length?(n=e,t):n},t.startAngle=function(e){return arguments.length?(i=e,t):i},t.endAngle=function(e){return arguments.length?(r=e,t):r},t};var ui={};d3.layout.stack=function(){function t(e,l){for(var u,c,d=(p=e.map((function(e,i){return n.call(t,e,i)}))).map((function(e,n){return e.map((function(e,n){return[a.call(t,e,n),s.call(t,e,n)]}))})),h=i.call(t,d,l),p=d3.permute(p,h),f=(d=d3.permute(d,h),r.call(t,d,l)),g=p.length,m=p[0].length,v=0;v<m;++v)for(o.call(t,p[0][v],c=f[v],d[0][v][1]),u=1;u<g;++u)o.call(t,p[u][v],c+=d[u-1][v][1],d[u][v][1]);return e}var n=e,i=Kt,r=Jt,o=Qt,a=Yt,s=Xt;return t.values=function(e){return arguments.length?(n=e,t):n},t.order=function(e){return arguments.length?(i="function"==typeof e?e:ci.get(e)||Kt,t):i},t.offset=function(e){return arguments.length?(r="function"==typeof e?e:di.get(e)||Jt,t):r},t.x=function(e){return arguments.length?(a=e,t):a},t.y=function(e){return arguments.length?(s=e,t):s},t.out=function(e){return arguments.length?(o=e,t):o},t};var ci=d3.map({"inside-out":function(t){for(var e,n=t.length,i=t.map(Zt),r=t.map(te),o=d3.range(n).sort((function(t,e){return i[t]-i[e]})),a=0,s=0,l=[],u=[],c=0;c<n;++c)e=o[c],a<s?(a+=r[e],l.push(e)):(s+=r[e],u.push(e));return u.reverse().concat(l)},reverse:function(t){return d3.range(t.length).reverse()},default:Kt}),di=d3.map({silhouette:function(t){for(var e,n,i=t.length,r=t[0].length,o=[],a=0,s=[],l=0;l<r;++l){for(n=e=0;e<i;e++)n+=t[e][l][1];a<n&&(a=n),o.push(n)}for(l=0;l<r;++l)s[l]=(a-o[l])/2;return s},wiggle:function(t){var e,n,i,r,o,a,s,l,u,c=t.length,d=t[0],h=d.length,p=[];for(p[0]=l=u=0,n=1;n<h;++n){for(r=e=0;e<c;++e)r+=t[e][n][1];for(s=d[n][o=e=0]-d[n-1][0];e<c;++e){for(i=0,a=(t[e][n][1]-t[e][n-1][1])/(2*s);i<e;++i)a+=(t[i][n][1]-t[i][n-1][1])/s;o+=a*t[e][n][1]}p[n]=l-=r?o/r*s:0,l<u&&(u=l)}for(n=0;n<h;++n)p[n]-=u;return p},expand:function(t){for(var e,n,i=t.length,r=t[0].length,o=1/i,a=[],s=0;s<r;++s){for(n=e=0;e<i;e++)n+=t[e][s][1];if(n)for(e=0;e<i;e++)t[e][s][1]/=n;else for(e=0;e<i;e++)t[e][s][1]=o}for(s=0;s<r;++s)a[s]=0;return a},zero:Jt});d3.layout.histogram=function(){function t(t,r){for(var a,s,l=[],u=t.map(n,this),c=i.call(this,u,r),d=o.call(this,c,u,r),h=(r=-1,u.length),p=d.length-1,f=e?1:1/h;++r<p;)(a=l[r]=[]).dx=d[r+1]-(a.x=d[r]),a.y=0;if(0<p)for(r=-1;++r<h;)(s=u[r])>=c[0]&&s<=c[1]&&((a=l[d3.bisect(d,s,1,p)-1]).y+=f,a.push(t[r]));return l}var e=!0,n=Number,i=re,o=ne;return t.value=function(e){return arguments.length?(n=e,t):n},t.range=function(e){return arguments.length?(i=r(e),t):i},t.bins=function(e){return arguments.length?(o="number"==typeof e?function(t){return ie(t,e)}:r(e),t):o},t.frequency=function(n){return arguments.length?(e=!!n,t):e},t};var hi=!(d3.layout.hierarchy=function(){function t(r){var o=[];return function r(o,a,s){var l=n.call(t,o,a),u=hi?o:{data:o};if(u.depth=a,s.push(u),l&&(c=l.length)){for(var c,d,h=-1,p=u.children=[],f=0,g=a+1;++h<c;)(d=r(l[h],g,s)).parent=u,p.push(d),f+=d.value;e&&p.sort(e),i&&(u.value=f)}else i&&(u.value=+i.call(t,o,a)||0);return u}(r,0,o),o}var e=le,n=ae,i=se;return t.sort=function(n){return arguments.length?(e=n,t):e},t.children=function(e){return arguments.length?(n=e,t):n},t.value=function(e){return arguments.length?(i=e,t):i},t.revalue=function(e){return function e(n,r){var o=n.children,a=0;if(o&&(s=o.length))for(var s,l=-1,u=r+1;++l<s;)a+=e(o[l],u);else i&&(a=+i.call(t,hi?n:n.data,r)||0);return i&&(n.value=a),a}(e,0),e},t});d3.layout.pack=function(){function t(t,i){var r=e.call(this,t,i),o=r[0];return o.x=0,o.y=0,me(o),function t(e,n,i,r){var o=e.children;if(e.x=n+=r*e.x,e.y=i+=r*e.y,e.r*=r,o)for(var a=-1,s=o.length;++a<s;)t(o[a],n,i,r)}(o,(t=n[0])/2,(i=n[1])/2,1/Math.max(2*o.r/t,2*o.r/i)),r}var e=d3.layout.hierarchy().sort(ce),n=[1,1];return t.size=function(e){return arguments.length?(n=e,t):n},oe(t,e)},d3.layout.cluster=function(){function t(t,r){var o,a=e.call(this,t,r),s=a[0],l=0;Me(s,(function(t){var e,i=t.children;i&&i.length?(t.x=(e=i).reduce((function(t,e){return t+e.x}),0)/e.length,t.y=1+d3.max(i,(function(t){return t.y}))):(t.x=o?l+=n(t,o):0,t.y=0,o=t)}));t=function t(e){var n=e.children;return n&&n.length?t(n[0]):e}(s),r=function t(e){var n,i=e.children;return i&&(n=i.length)?t(i[n-1]):e}(s);var u=t.x-n(t,r)/2,c=r.x+n(r,t)/2;return Me(s,(function(t){t.x=(t.x-u)/(c-u)*i[0],t.y=(1-(s.y?t.y/s.y:1))*i[1]})),a}var e=d3.layout.hierarchy().sort(null).value(null),n=ye,i=[1,1];return t.separation=function(e){return arguments.length?(n=e,t):n},t.size=function(e){return arguments.length?(i=e,t):i},oe(t,e)},d3.layout.tree=function(){function t(t,r){var o=e.call(this,t,r),a=o[0];Me(a,(function(t,e){t._tree={ancestor:t,prelim:0,mod:0,change:0,shift:0,number:e?e._tree.number+1:0}})),function t(e,i){var r=e.children,o=e._tree;if(r&&(a=r.length)){for(var a,s,l,u=r[0],c=u,d=-1;++d<a;)t(l=r[d],s),c=function(t,e,i){if(e){for(var r,o=t,a=t,s=e,l=t.parent.children[0],u=o._tree.mod,c=a._tree.mod,d=s._tree.mod,h=l._tree.mod;s=xe(s),o=be(o),s&&o;)l=be(l),(a=xe(a))._tree.ancestor=t,0<(r=s._tree.prelim+d-o._tree.prelim-u+n(s,o))&&(function(t,e,n){t=t._tree;var i=n/((e=e._tree).number-t.number);t.change+=i,e.change-=i,e.shift+=n,e.prelim+=n,e.mod+=n}(function(t,e,n){return t._tree.ancestor.parent==e.parent?t._tree.ancestor:n}(s,t,i),t,r),u+=r,c+=r),d+=s._tree.mod,u+=o._tree.mod,h+=l._tree.mod,c+=a._tree.mod;s&&!xe(a)&&(a._tree.thread=s,a._tree.mod+=d-c),o&&!be(l)&&(l._tree.thread=o,l._tree.mod+=u-h,i=t)}return i}(l,s,c),s=l;!function(t){for(var e,n=0,i=0,r=t.children,o=r.length;0<=--o;)(e=r[o]._tree).prelim+=n,e.mod+=n,n+=e.shift+(i+=e.change)}(e),u=.5*(u._tree.prelim+l._tree.prelim),i?(o.prelim=i._tree.prelim+n(e,i),o.mod=o.prelim-u):o.prelim=u}else i&&(o.prelim=i._tree.prelim+n(e,i))}(a),function t(e,n){e.x=e._tree.prelim+n;var i=e.children;if(i&&(r=i.length)){var r,o=-1;for(n+=e._tree.mod;++o<r;)t(i[o],n)}}(a,-a._tree.prelim);var s=we(a,_e),l=(t=we(a,Ce),r=we(a,Ee),s.x-n(s,t)/2),u=t.x+n(t,s)/2,c=r.depth||1;return Me(a,(function(t){t.x=(t.x-l)/(u-l)*i[0],t.y=t.depth/c*i[1],delete t._tree})),o}var e=d3.layout.hierarchy().sort(null).value(null),n=ye,i=[1,1];return t.separation=function(e){return arguments.length?(n=e,t):n},t.size=function(e){return arguments.length?(i=e,t):i},oe(t,e)},d3.layout.treemap=function(){function t(t,e){for(var n,i,r=-1,o=t.length;++r<o;)i=(n=t[r]).value*(e<0?0:e),n.area=isNaN(i)||i<=0?0:i}function e(n){var r=n.children;if(r&&r.length){var o,a=c(n),s=[],l=r.slice(),u=1/0,d=Math.min(a.dx,a.dy);for(t(l,a.dx*a.dy/n.value),s.area=0;0<(o=l.length);)s.push(o=l[o-1]),s.area+=o.area,u=(o=function(t,e){for(var n,i=t.area,r=0,o=1/0,a=-1,s=t.length;++a<s;)(n=t[a].area)&&(n<o&&(o=n),r<n&&(r=n));return e*=e,(i*=i)?Math.max(e*r*h/i,i/(e*o*h)):1/0}(s,d))<=u?(l.pop(),o):(s.area-=s.pop().area,i(s,d,a,!1),d=Math.min(a.dx,a.dy),1/(s.length=s.area=0));s.length&&(i(s,d,a,!0),s.length=s.area=0),r.forEach(e)}}function n(e){var r=e.children;if(r&&r.length){var o,a=c(e),s=r.slice(),l=[];for(t(s,a.dx*a.dy/e.value),l.area=0;o=s.pop();)l.push(o),l.area+=o.area,null!=o.z&&(i(l,o.z?a.dx:a.dy,a,!s.length),l.length=l.area=0);r.forEach(n)}}function i(t,e,n,i){var r,o=-1,a=t.length,l=n.x,u=n.y,c=e?s(t.area/e):0;if(e==n.dx){for((i||c>n.dy)&&(c=n.dy);++o<a;)(r=t[o]).x=l,r.y=u,r.dy=c,l+=r.dx=Math.min(n.x+n.dx-l,c?s(r.area/c):0);r.z=!0,r.dx+=n.x+n.dx-l,n.y+=c,n.dy-=c}else{for((i||c>n.dx)&&(c=n.dx);++o<a;)(r=t[o]).x=l,r.y=u,r.dx=c,u+=r.dy=Math.min(n.y+n.dy-u,c?s(r.area/c):0);r.z=!1,r.dy+=n.y+n.dy-u,n.x+=c,n.dx-=c}}function r(i){var r=o||a(i);return(i=r[0]).x=0,i.y=0,i.dx=l[0],i.dy=l[1],o&&a.revalue(i),t([i],i.dx*i.dy/i.value),(o?n:e)(i),d&&(o=r),r}var o,a=d3.layout.hierarchy(),s=Math.round,l=[1,1],u=null,c=De,d=!1,h=.5*(1+Math.sqrt(5));return r.size=function(t){return arguments.length?(l=t,r):l},r.padding=function(t){function e(e){return Se(e,t)}return arguments.length?(c=null==(u=t)?De:"function"==(n=typeof t)?function(e){var n=t.call(r,e,e.depth);return null==n?De(e):Se(e,"number"==typeof n?[n,n,n,n]:n)}:("number"==n&&(t=[t,t,t,t]),e),r):u;var n},r.round=function(t){return arguments.length?(s=t?Math.round:Number,r):s!=Number},r.sticky=function(t){return arguments.length?(d=t,o=null,r):d},r.ratio=function(t){return arguments.length?(h=t,r):h},oe(r,a)},d3.csv=function(t,e){d3.text(t,"text/csv",(function(t){e(t&&d3.csv.parse(t))}))},d3.csv.parse=function(t){var e;return d3.csv.parseRows(t,(function(t,n){if(n){for(var i={},r=-1,o=e.length;++r<o;)i[e[r]]=t[r];return i}return e=t,null}))},d3.csv.parseRows=function(t,e){function n(){if(l.lastIndex>=t.length)return a;if(r)return r=!1,o;var e=l.lastIndex;if(34===t.charCodeAt(e)){for(var n=e;n++<t.length;)if(34===t.charCodeAt(n)){if(34!==t.charCodeAt(n+1))break;n++}l.lastIndex=n+2;var i=t.charCodeAt(n+1);return 13===i?(r=!0,10===t.charCodeAt(n+2)&&l.lastIndex++):10===i&&(r=!0),t.substring(e+1,n).replace(/""/g,'"')}return(i=l.exec(t))?(r=44!==i[0].charCodeAt(0),t.substring(e,i.index)):(l.lastIndex=t.length,t.substring(e))}var i,r,o={},a={},s=[],l=/\r\n|[,\r\n]/g,u=0;for(l.lastIndex=0;(i=n())!==a;){for(var c=[];i!==o&&i!==a;)c.push(i),i=n();e&&!(c=e(c,u++))||s.push(c)}return s},d3.csv.format=function(t){return t.map(Pe).join("\n")},d3.geo={};var pi=Math.PI/180;d3.geo.azimuthal=function(){function t(t){var e=t[0]*pi-n,i=t[1]*pi,u=Math.cos(e),c=Math.sin(e),d=Math.cos(i);t=Math.sin(i),e="orthographic"!==a?o*t+r*d*u:null,t=(e="stereographic"===a?1/(1+e):"gnomonic"===a?1/e:"equidistant"===a?(i=Math.acos(e))?i/Math.sin(i):0:"equalarea"===a?Math.sqrt(2/(1+e)):1)*(o*d*u-r*t);return[s*(e*d*c)+l[0],s*t+l[1]]}var e,n,i,r,o,a="orthographic",s=200,l=[480,250];return t.invert=function(t){var e=(t[0]-l[0])/s,i=(t[1]-l[1])/s,u=Math.sqrt(e*e+i*i),c="stereographic"===a?2*Math.atan(u):"gnomonic"===a?Math.atan(u):"equidistant"===a?u:"equalarea"===a?2*Math.asin(.5*u):Math.asin(u);t=Math.sin(c),c=Math.cos(c);return[(n+Math.atan2(e*t,u*r*c+i*o*t))/pi,Math.asin(c*o-(u?i*t*r/u:0))/pi]},t.mode=function(e){return arguments.length?(a=e+"",t):a},t.origin=function(a){return arguments.length?(n=(e=a)[0]*pi,i=e[1]*pi,r=Math.cos(i),o=Math.sin(i),t):e},t.scale=function(e){return arguments.length?(s=+e,t):s},t.translate=function(e){return arguments.length?(l=[+e[0],+e[1]],t):l},t.origin([0,0])},d3.geo.albers=function(){function t(t){var e=i*(pi*t[0]-n);t=Math.sqrt(r-2*i*Math.sin(pi*t[1]))/i;return[l*t*Math.sin(e)+u[0],l*(t*Math.cos(e)-o)+u[1]]}function e(){var e=pi*s[0],l=pi*s[1],u=pi*a[1],c=Math.sin(e);e=Math.cos(e);return n=pi*a[0],i=.5*(c+Math.sin(l)),r=e*e+2*i*c,o=Math.sqrt(r-2*i*Math.sin(u))/i,t}var n,i,r,o,a=[-98,38],s=[29.5,45.5],l=1e3,u=[480,250];return t.invert=function(t){var e=(t[0]-u[0])/l,a=(t[1]-u[1])/l;t=o+a,a=Math.atan2(e,t),t=Math.sqrt(e*e+t*t);return[(n+a/i)/pi,Math.asin((r-t*t*i*i)/(2*i))/pi]},t.origin=function(t){return arguments.length?(a=[+t[0],+t[1]],e()):a},t.parallels=function(t){return arguments.length?(s=[+t[0],+t[1]],e()):s},t.scale=function(e){return arguments.length?(l=+e,t):l},t.translate=function(e){return arguments.length?(u=[+e[0],+e[1]],t):u},e()},d3.geo.albersUsa=function(){function t(t){var o=t[0],a=t[1];return(50<a?n:o<-140?i:a<21?r:e)(t)}var e=d3.geo.albers(),n=d3.geo.albers().origin([-160,60]).parallels([55,65]),i=d3.geo.albers().origin([-160,20]).parallels([8,18]),r=d3.geo.albers().origin([-60,10]).parallels([8,18]);return t.scale=function(o){return arguments.length?(e.scale(o),n.scale(.6*o),i.scale(o),r.scale(1.5*o),t.translate(e.translate())):e.scale()},t.translate=function(o){if(!arguments.length)return e.translate();var a=e.scale()/1e3,s=o[0],l=o[1];return e.translate(o),n.translate([s-400*a,l+170*a]),i.translate([s-190*a,l+200*a]),r.translate([s+580*a,l+430*a]),t},t.scale(e.scale())},d3.geo.bonne=function(){function t(t){var s,l=t[0]*pi-e,u=t[1]*pi-n;return i?(s=r+i-u,t=l*Math.cos(u)/s,l=s*Math.sin(t),u=s*Math.cos(t)-r):(l*=Math.cos(u),u*=-1),[o*l+a[0],o*u+a[1]]}var e,n,i,r,o=200,a=[480,250];return t.invert=function(t){var n,s=(t[0]-a[0])/o,l=(t[1]-a[1])/o;return i?(n=r+l,t=Math.sqrt(s*s+n*n),l=r+i-t,s=e+t*Math.atan2(s,n)/Math.cos(l)):(l*=-1,s/=Math.cos(l)),[s/pi,l/pi]},t.parallel=function(e){return arguments.length?(r=1/Math.tan(i=e*pi),t):i/pi},t.origin=function(i){return arguments.length?(e=i[0]*pi,n=i[1]*pi,t):[e/pi,n/pi]},t.scale=function(e){return arguments.length?(o=+e,t):o},t.translate=function(e){return arguments.length?(a=[+e[0],+e[1]],t):a},t.origin([0,0]).parallel(45)},d3.geo.equirectangular=function(){function t(t){var i=t[0]/360;t=-t[1]/360;return[e*i+n[0],e*t+n[1]]}var e=500,n=[480,250];return t.invert=function(t){return[(t[0]-n[0])/e*360,(t[1]-n[1])/e*-360]},t.scale=function(n){return arguments.length?(e=+n,t):e},t.translate=function(e){return arguments.length?(n=[+e[0],+e[1]],t):n},t},d3.geo.mercator=function(){function t(t){var i=t[0]/360;t=-Math.log(Math.tan(Math.PI/4+t[1]*pi/2))/pi/360;return[e*i+n[0],e*Math.max(-.5,Math.min(.5,t))+n[1]]}var e=500,n=[480,250];return t.invert=function(t){var i=(t[0]-n[0])/e;t=(t[1]-n[1])/e;return[360*i,2*Math.atan(Math.exp(-360*t*pi))/pi-90]},t.scale=function(n){return arguments.length?(e=+n,t):e},t.translate=function(e){return arguments.length?(n=[+e[0],+e[1]],t):n},t},d3.geo.path=function(){function t(t,e){"function"==typeof o&&(a=Ae(o.apply(this,arguments))),u(t);var n=l.length?l.join(""):null;return l=[],n}function e(t){return s(t).join(",")}function n(t){for(var e=r(t[0]),n=0,i=t.length;++n<i;)e-=r(t[n]);return e}function i(t){for(var e=d3.geom.polygon(t[0].map(s)),n=e.area(),i=e.centroid(n<0?(n*=-1,1):-1),r=i[0],o=i[1],a=n,l=0,u=t.length;++l<u;)n=(e=d3.geom.polygon(t[l].map(s))).area(),r-=(i=e.centroid(n<0?(n*=-1,1):-1))[0],o-=i[1],a-=n;return[r,o,6*a]}function r(t){return Math.abs(d3.geom.polygon(t.map(s)).area())}var o=4.5,a=Ae(o),s=d3.geo.albersUsa(),l=[],u=Te({FeatureCollection:function(t){for(var e=t.features,n=-1,i=e.length;++n<i;)l.push(u(e[n].geometry))},Feature:function(t){u(t.geometry)},Point:function(t){l.push("M",e(t.coordinates),a)},MultiPoint:function(t){for(var n=t.coordinates,i=-1,r=n.length;++i<r;)l.push("M",e(n[i]),a)},LineString:function(t){var n=t.coordinates,i=-1,r=n.length;for(l.push("M");++i<r;)l.push(e(n[i]),"L");l.pop()},MultiLineString:function(t){for(var n,i,r,o=t.coordinates,a=-1,s=o.length;++a<s;){for(i=-1,r=(n=o[a]).length,l.push("M");++i<r;)l.push(e(n[i]),"L");l.pop()}},Polygon:function(t){for(var n,i,r,o=t.coordinates,a=-1,s=o.length;++a<s;)if(i=-1,0<(r=(n=o[a]).length-1)){for(l.push("M");++i<r;)l.push(e(n[i]),"L");l[l.length-1]="Z"}},MultiPolygon:function(t){for(var n,i,r,o,a,s,u=t.coordinates,c=-1,d=u.length;++c<d;)for(i=-1,r=(n=u[c]).length;++i<r;)if(a=-1,0<(s=(o=n[i]).length-1)){for(l.push("M");++a<s;)l.push(e(o[a]),"L");l[l.length-1]="Z"}},GeometryCollection:function(t){for(var e=t.geometries,n=-1,i=e.length;++n<i;)l.push(u(e[n]))}}),c=t.area=Te({FeatureCollection:function(t){for(var e=0,n=t.features,i=-1,r=n.length;++i<r;)e+=c(n[i]);return e},Feature:function(t){return c(t.geometry)},Polygon:function(t){return n(t.coordinates)},MultiPolygon:function(t){for(var e=0,i=t.coordinates,r=-1,o=i.length;++r<o;)e+=n(i[r]);return e},GeometryCollection:function(t){for(var e=0,n=t.geometries,i=-1,r=n.length;++i<r;)e+=c(n[i]);return e}},0),d=t.centroid=Te({Feature:function(t){return d(t.geometry)},Polygon:function(t){return[(t=i(t.coordinates))[0]/t[2],t[1]/t[2]]},MultiPolygon:function(t){for(var e,n=t.coordinates,r=0,o=0,a=0,s=-1,l=n.length;++s<l;)r+=(e=i(n[s]))[0],o+=e[1],a+=e[2];return[r/a,o/a]}});return t.projection=function(e){return s=e,t},t.pointRadius=function(e){return"function"==typeof e?o=e:a=Ae(o=+e),t},t},d3.geo.bounds=function(t){var e=1/0,n=1/0,i=-1/0,r=-1/0;return ke(t,(function(t,o){t<e&&(e=t),i<t&&(i=t),o<n&&(n=o),r<o&&(r=o)})),[[e,n],[i,r]]};var fi={Feature:function(t,e){ke(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,i=0,r=n.length;i<r;i++)ke(n[i].geometry,e)},GeometryCollection:function(t,e){for(var n=t.geometries,i=0,r=n.length;i<r;i++)ke(n[i],e)},LineString:Ie,MultiLineString:function(t,e){for(var n=t.coordinates,i=0,r=n.length;i<r;i++)for(var o=n[i],a=0,s=o.length;a<s;a++)e.apply(null,o[a])},MultiPoint:Ie,MultiPolygon:function(t,e){for(var n=t.coordinates,i=0,r=n.length;i<r;i++)for(var o=n[i][0],a=0,s=o.length;a<s;a++)e.apply(null,o[a])},Point:function(t,e){e.apply(null,t.coordinates)},Polygon:function(t,e){for(var n=t.coordinates[0],i=0,r=n.length;i<r;i++)e.apply(null,n[i])}};d3.geo.circle=function(){function t(){}function n(t){return s.distance(t)<a}function i(t){for(var e,n,i,r,o,l=-1,u=t.length,c=[];++l<u;)(o=s.distance(i=t[l]))<a?(n&&c.push(ze(n,i)((r-a)/(r-o))),c.push(i),e=n=null):(n=i,!e&&c.length&&(c.push(ze(c[c.length-1],n)((a-r)/(o-r))),e=n)),r=o;return e=t[0],!(n=c[0])||i[0]!==e[0]||i[1]!==e[1]||i[0]===n[0]&&i[1]===n[1]||c.push(n),function(t){for(var e,n,i,r=0,o=t.length,a=o?[t[0]]:t,l=s.source();++r<o;)for(e=0,n=(i=s.source(t[r-1])(t[r]).coordinates).length;++e<n;)a.push(i[e]);return s.source(l),a}(c)}var r=[0,0],o=89.99,a=o*pi,s=d3.geo.greatArc().source(r).target(e);t.clip=function(t){return"function"==typeof r&&s.source(r.apply(this,arguments)),l(t)||null};var l=Te({FeatureCollection:function(t){var n=t.features.map(l).filter(e);return n&&((t=Object.create(t)).features=n,t)},Feature:function(t){var e=l(t.geometry);return e&&((t=Object.create(t)).geometry=e,t)},Point:function(t){return n(t.coordinates)&&t},MultiPoint:function(t){var e=t.coordinates.filter(n);return e.length&&{type:t.type,coordinates:e}},LineString:function(t){var e=i(t.coordinates);return e.length&&((t=Object.create(t)).coordinates=e,t)},MultiLineString:function(t){var e=t.coordinates.map(i).filter((function(t){return t.length}));return e.length&&((t=Object.create(t)).coordinates=e,t)},Polygon:function(t){var e=t.coordinates.map(i);return e[0].length&&((t=Object.create(t)).coordinates=e,t)},MultiPolygon:function(t){var e=t.coordinates.map((function(t){return t.map(i)})).filter((function(t){return t[0].length}));return e.length&&((t=Object.create(t)).coordinates=e,t)},GeometryCollection:function(t){var n=t.geometries.map(l).filter(e);return n.length&&((t=Object.create(t)).geometries=n,t)}});return t.origin=function(e){return arguments.length?("function"!=typeof(r=e)&&s.source(r),t):r},t.angle=function(e){return arguments.length?(a=(o=+e)*pi,t):o},d3.rebind(t,s,"precision")},d3.geo.greatArc=function(){function t(){for(var i=t.distance.apply(this,arguments),r=0,s=o/i,l=[e];(r+=s)<1;)l.push(a(r));return l.push(n),{type:"LineString",coordinates:l}}var e,n,i=Le,r=Oe,o=6*pi,a=Ne();return t.distance=function(){return"function"==typeof i&&a.source(e=i.apply(this,arguments)),"function"==typeof r&&a.target(n=r.apply(this,arguments)),a.distance()},t.source=function(n){return arguments.length?("function"!=typeof(i=n)&&a.source(e=i),t):i},t.target=function(e){return arguments.length?("function"!=typeof(r=e)&&a.target(n=r),t):r},t.precision=function(e){return arguments.length?(o=e*pi,t):o/pi},t},d3.geo.greatCircle=d3.geo.circle,d3.geom={},d3.geom.contour=function(t,e){for(var n=e||function(t){for(var e=0,n=0;;){if(t(e,n))return[e,n];0===e?(e=n+1,n=0):(--e,n+=1)}}(t),i=[],r=n[0],o=n[1],a=0,s=0,l=NaN,u=NaN,c=0;c=0,t(r-1,o-1)&&(c+=1),t(r,o-1)&&(c+=2),t(r-1,o)&&(c+=4),t(r,o)&&(c+=8),s=6===c?(a=-1===u?-1:1,0):9===c?(a=0,1===l?-1:1):(a=gi[c],mi[c]),a!=l&&s!=u&&(i.push([r,o]),l=a,u=s),o+=s,n[0]!=(r+=a)||n[1]!=o;);return i};var gi=[1,0,1,1,-1,0,-1,1,0,0,0,0,-1,0,-1,NaN],mi=[0,-1,0,0,0,-1,0,0,1,-1,1,1,0,-1,0,NaN];d3.geom.hull=function(t){if(t.length<3)return[];for(var e,n,i,r,o,a,s,l,u,c,d,h,p,f,g=t.length,m=g-1,v=[],y=[],b=0,x=1;x<g;++x)t[x][1]<t[b][1]?b=x:t[x][1]==t[b][1]&&(b=t[x][0]<t[b][0]?x:b);for(x=0;x<g;++x)x!==b&&(i=t[x][1]-t[b][1],n=t[x][0]-t[b][0],v.push({angle:Math.atan2(i,n),index:x}));for(v.sort((function(t,e){return t.angle-e.angle})),s=v[0].angle,a=v[0].index,o=0,x=1;x<m;++x)e=v[x].index,s==v[x].angle?(n=t[a][0]-t[b][0],i=t[a][1]-t[b][1],(r=t[e][0]-t[b][0])*r+(r=t[e][1]-t[b][1])*r<=n*n+i*i?v[x].index=-1:(v[o].index=-1,s=v[x].angle,o=x,a=e)):(s=v[x].angle,o=x,a=e);for(y.push(b),e=x=0;x<2;++e)-1!==v[e].index&&(y.push(v[e].index),x++);for(l=y.length;e<m;++e)if(-1!==v[e].index){for(;u=y[l-2],c=y[l-1],d=v[e].index,h=void 0,p=(h=t[u])[0],f=h[1],u=(h=t[c])[0],c=h[1],d=(h=t[d])[0],!(0<(h[1]-f)*(u-p)-(c-f)*(d-p));)--l;y[l++]=v[e].index}var w=[];for(x=0;x<l;++x)w.push(t[y[x]]);return w},d3.geom.polygon=function(t){return t.area=function(){for(var e=0,n=t.length,i=t[n-1][0]*t[0][1],r=t[n-1][1]*t[0][0];++e<n;)i+=t[e-1][0]*t[e][1],r+=t[e-1][1]*t[e][0];return.5*(r-i)},t.centroid=function(e){var n,i,r=-1,o=t.length,a=0,s=0,l=t[o-1];for(arguments.length||(e=-1/(6*t.area()));++r<o;)n=l,l=t[r],i=n[0]*l[1]-l[0]*n[1],a+=(n[0]+l[0])*i,s+=(n[1]+l[1])*i;return[a*e,s*e]},t.clip=function(e){for(var n,i,r,o,a,s,l=-1,u=t.length,c=t[u-1];++l<u;){for(n=e.slice(),e.length=0,o=t[l],a=n[(r=n.length)-1],i=-1;++i<r;)Re(s=n[i],c,o)?(Re(a,c,o)||e.push(He(a,s,c,o)),e.push(s)):Re(a,c,o)&&e.push(He(a,s,c,o)),a=s;c=o}return e},t},d3.geom.voronoi=function(t){var e=t.map((function(){return[]}));return Fe(t,(function(t){var n,i,r,o=1===t.a&&0<=t.b?(n=t.ep.r,t.ep.l):(n=t.ep.l,t.ep.r);1===t.a?(a=n?n.y:-1e6,i=t.c-t.b*a,s=o?o.y:1e6,r=t.c-t.b*s):(i=n?n.x:-1e6,a=t.c-t.a*i,r=o?o.x:1e6,s=t.c-t.a*r);var a=[i,a],s=[r,s];e[t.region.l.index].push(a,s),e[t.region.r.index].push(a,s)})),e.map((function(e,n){var i=t[n][0],r=t[n][1];return e.forEach((function(t){t.angle=Math.atan2(t[0]-i,t[1]-r)})),e.sort((function(t,e){return t.angle-e.angle})).filter((function(t,n){return!n||1e-10<t.angle-e[n-1].angle}))}))};var vi={l:"r",r:"l"};d3.geom.delaunay=function(t){var e=t.map((function(){return[]})),n=[];return Fe(t,(function(n){e[n.region.l.index].push(t[n.region.r.index])})),e.forEach((function(e,i){var r=t[i],o=r[0],a=r[1];e.forEach((function(t){t.angle=Math.atan2(t[0]-o,t[1]-a)})),e.sort((function(t,e){return t.angle-e.angle}));for(var s=0,l=e.length-1;s<l;s++)n.push([r,e[s],e[s+1]])})),n},d3.geom.quadtree=function(t,e,n,i,r){function o(t,e,n,i,r,o){var s;isNaN(e.x)||isNaN(e.y)||(t.leaf?(s=t.point)?(Math.abs(s.x-e.x)+Math.abs(s.y-e.y)<.01||(t.point=null,a(t,s,n,i,r,o)),a(t,e,n,i,r,o)):t.point=e:a(t,e,n,i,r,o))}function a(t,e,n,i,r,a){var s=.5*(n+r),l=.5*(i+a),u=e.x>=s,c=e.y>=l,d=(c<<1)+u;t.leaf=!1,u?n=s:r=s,c?i=l:a=l,o(t=t.nodes[d]||(t.nodes[d]={leaf:!0,nodes:[],point:null}),e,n,i,r,a)}var s,l=-1,u=t.length;if(u&&isNaN(t[0].x)&&(t=t.map(Ve)),arguments.length<5)if(3===arguments.length)r=i=n,n=e;else{for(e=n=1/0,i=r=-1/0;++l<u;)(s=t[l]).x<e&&(e=s.x),s.y<n&&(n=s.y),s.x>i&&(i=s.x),s.y>r&&(r=s.y);var c=i-e,d=r-n;d<c?r=n+c:i=e+d}var h={leaf:!0,nodes:[],point:null,add:function(t){o(h,t,e,n,i,r)},visit:function(t){!function t(e,n,i,r,o,a){var s,l;e(n,i,r,o,a)||(s=.5*(i+o),l=.5*(r+a),(n=n.nodes)[0]&&t(e,n[0],i,r,s,l),n[1]&&t(e,n[1],s,r,o,l),n[2]&&t(e,n[2],i,l,s,a),n[3]&&t(e,n[3],s,l,o,a))}(t,h,e,n,i,r)}};return t.forEach(h.add),h},d3.time={};var yi=Date;Be.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){bi.setUTCDate.apply(this._,arguments)},setDay:function(){bi.setUTCDay.apply(this._,arguments)},setFullYear:function(){bi.setUTCFullYear.apply(this._,arguments)},setHours:function(){bi.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){bi.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){bi.setUTCMinutes.apply(this._,arguments)},setMonth:function(){bi.setUTCMonth.apply(this._,arguments)},setSeconds:function(){bi.setUTCSeconds.apply(this._,arguments)},setTime:function(){bi.setTime.apply(this._,arguments)}};var bi=Date.prototype;d3.time.format=function(t){function e(e){for(var i,r,o=[],a=-1,s=0;++a<n;)37==t.charCodeAt(a)&&(o.push(t.substring(s,a),(r=Ei[i=t.charAt(++a)])?r(e):i),s=a+1);return o.push(t.substring(s,a)),o.join("")}var n=t.length;return e.parse=function(e){var n={y:1900,m:0,d:1,H:0,M:0,S:0,L:0};return We(n,t,e,0)!=e.length?null:("p"in n&&(n.H=n.H%12+12*n.p),(e=new yi).setFullYear(n.y,n.m,n.d),e.setHours(n.H,n.M,n.S,n.L),e)},e.toString=function(){return t},e};var xi=d3.format("02d"),wi=d3.format("03d"),Ci=d3.format("04d"),_i=d3.format("2d"),Ei={a:function(t){return Pi[t.getDay()].substring(0,3)},A:function(t){return Pi[t.getDay()]},b:function(t){return ki[t.getMonth()].substring(0,3)},B:function(t){return ki[t.getMonth()]},c:d3.time.format("%a %b %e %H:%M:%S %Y"),d:function(t){return xi(t.getDate())},e:function(t){return _i(t.getDate())},H:function(t){return xi(t.getHours())},I:function(t){return xi(t.getHours()%12||12)},j:function(t){return wi(1+d3.time.dayOfYear(t))},L:function(t){return wi(t.getMilliseconds())},m:function(t){return xi(t.getMonth()+1)},M:function(t){return xi(t.getMinutes())},p:function(t){return 12<=t.getHours()?"PM":"AM"},S:function(t){return xi(t.getSeconds())},U:function(t){return xi(d3.time.sundayOfYear(t))},w:function(t){return t.getDay()},W:function(t){return xi(d3.time.mondayOfYear(t))},x:d3.time.format("%m/%d/%y"),X:d3.time.format("%H:%M:%S"),y:function(t){return xi(t.getFullYear()%100)},Y:function(t){return Ci(t.getFullYear()%1e4)},Z:function(t){var e=0<(n=t.getTimezoneOffset())?"-":"+",n=(t=~~(Math.abs(n)/60),Math.abs(n)%60);return e+xi(t)+xi(n)},"%":function(t){return"%"}},Mi={a:function(t,e,n){return Di.test(e.substring(n,n+=3))?n:-1},A:function(t,e,n){return Si.lastIndex=0,(e=Si.exec(e.substring(n,n+10)))?n+e[0].length:-1},b:function(t,e,n){return null==(e=ji.get(e.substring(n,n+=3).toLowerCase()))?-1:(t.m=e,n)},B:function(t,e,n){return Ti.lastIndex=0,(e=Ti.exec(e.substring(n,n+12)))?(t.m=Ai.get(e[0].toLowerCase()),n+e[0].length):-1},c:function(t,e,n){return We(t,Ei.c.toString(),e,n)},d:$e,e:$e,H:Ue,I:Ue,L:function(t,e,n){return Ii.lastIndex=0,(e=Ii.exec(e.substring(n,n+3)))?(t.L=+e[0],n+e[0].length):-1},m:function(t,e,n){return Ii.lastIndex=0,(e=Ii.exec(e.substring(n,n+2)))?(t.m=e[0]-1,n+e[0].length):-1},M:function(t,e,n){return Ii.lastIndex=0,(e=Ii.exec(e.substring(n,n+2)))?(t.M=+e[0],n+e[0].length):-1},p:function(t,e,n){return null==(e=Li.get(e.substring(n,n+=2).toLowerCase()))?-1:(t.p=e,n)},S:function(t,e,n){return Ii.lastIndex=0,(e=Ii.exec(e.substring(n,n+2)))?(t.S=+e[0],n+e[0].length):-1},x:function(t,e,n){return We(t,Ei.x.toString(),e,n)},X:function(t,e,n){return We(t,Ei.X.toString(),e,n)},y:function(t,e,n){return Ii.lastIndex=0,(e=Ii.exec(e.substring(n,n+2)))?(t.y=1e3*~~((new Date).getFullYear()/1e3)+ +e[0],n+e[0].length):-1},Y:function(t,e,n){return Ii.lastIndex=0,(e=Ii.exec(e.substring(n,n+4)))?(t.y=+e[0],n+e[0].length):-1}},Di=/^(?:sun|mon|tue|wed|thu|fri|sat)/i,Si=/^(?:Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday)/i,Pi=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],ji=d3.map({jan:0,feb:1,mar:2,apr:3,may:4,jun:5,jul:6,aug:7,sep:8,oct:9,nov:10,dec:11}),Ti=/^(?:January|February|March|April|May|June|July|August|September|October|November|December)/gi,Ai=d3.map({january:0,february:1,march:2,april:3,may:4,june:5,july:6,august:7,september:8,october:9,november:10,december:11}),ki=["January","February","March","April","May","June","July","August","September","October","November","December"],Ii=/\s*\d+/,Li=d3.map({am:0,pm:1});d3.time.format.utc=function(t){function e(t){try{var e=new(yi=Be);return e._=t,n(e)}finally{yi=Date}}var n=d3.time.format(t);return e.parse=function(t){try{yi=Be;var e=n.parse(t);return e&&e._}finally{yi=Date}},e.toString=n.toString,e},kn=d3.time.format.utc("%Y-%m-%dT%H:%M:%S.%LZ"),d3.time.format.iso=Date.prototype.toISOString?qe:kn,qe.parse=function(t){return t=new Date(t),isNaN(t)?null:t},qe.toString=kn.toString,d3.time.second=Ge((function(t){return new yi(1e3*Math.floor(t/1e3))}),(function(t,e){t.setTime(t.getTime()+1e3*Math.floor(e))}),(function(t){return t.getSeconds()})),d3.time.seconds=d3.time.second.range,d3.time.seconds.utc=d3.time.second.utc.range,d3.time.minute=Ge((function(t){return new yi(6e4*Math.floor(t/6e4))}),(function(t,e){t.setTime(t.getTime()+6e4*Math.floor(e))}),(function(t){return t.getMinutes()})),d3.time.minutes=d3.time.minute.range,d3.time.minutes.utc=d3.time.minute.utc.range,d3.time.hour=Ge((function(t){var e=t.getTimezoneOffset()/60;return new yi(36e5*(Math.floor(t/36e5-e)+e))}),(function(t,e){t.setTime(t.getTime()+36e5*Math.floor(e))}),(function(t){return t.getHours()})),d3.time.hours=d3.time.hour.range,d3.time.hours.utc=d3.time.hour.utc.range,d3.time.day=Ge((function(t){return new yi(t.getFullYear(),t.getMonth(),t.getDate())}),(function(t,e){t.setDate(t.getDate()+e)}),(function(t){return t.getDate()-1})),d3.time.days=d3.time.day.range,d3.time.days.utc=d3.time.day.utc.range,d3.time.dayOfYear=function(t){var e=d3.time.year(t);return Math.floor((t-e)/864e5-(t.getTimezoneOffset()-e.getTimezoneOffset())/1440)},Pi.forEach((function(t,e){t=t.toLowerCase(),e=7-e;var n=d3.time[t]=Ge((function(t){return(t=d3.time.day(t)).setDate(t.getDate()-(t.getDay()+e)%7),t}),(function(t,e){t.setDate(t.getDate()+7*Math.floor(e))}),(function(t){var n=d3.time.year(t).getDay();return Math.floor((d3.time.dayOfYear(t)+(n+e)%7)/7)-(n!==e)}));d3.time[t+"s"]=n.range,d3.time[t+"s"].utc=n.utc.range,d3.time[t+"OfYear"]=function(t){var n=d3.time.year(t).getDay();return Math.floor((d3.time.dayOfYear(t)+(n+e)%7)/7)}})),d3.time.week=d3.time.sunday,d3.time.weeks=d3.time.sunday.range,d3.time.weeks.utc=d3.time.sunday.utc.range,d3.time.weekOfYear=d3.time.sundayOfYear,d3.time.month=Ge((function(t){return new yi(t.getFullYear(),t.getMonth(),1)}),(function(t,e){t.setMonth(t.getMonth()+e)}),(function(t){return t.getMonth()})),d3.time.months=d3.time.month.range,d3.time.months.utc=d3.time.month.utc.range,d3.time.year=Ge((function(t){return new yi(t.getFullYear(),0,1)}),(function(t,e){t.setFullYear(t.getFullYear()+e)}),(function(t){return t.getFullYear()})),d3.time.years=d3.time.year.range,d3.time.years.utc=d3.time.year.utc.range;var Oi=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],Ni=[[d3.time.second,1],[d3.time.second,5],[d3.time.second,15],[d3.time.second,30],[d3.time.minute,1],[d3.time.minute,5],[d3.time.minute,15],[d3.time.minute,30],[d3.time.hour,1],[d3.time.hour,3],[d3.time.hour,6],[d3.time.hour,12],[d3.time.day,1],[d3.time.day,2],[d3.time.week,1],[d3.time.month,1],[d3.time.month,3],[d3.time.year,1]],zi=(kn=[[d3.time.format("%Y"),function(t){return!0}],[d3.time.format("%B"),function(t){return t.getMonth()}],[d3.time.format("%b %d"),function(t){return 1!=t.getDate()}],[d3.time.format("%a %d"),function(t){return t.getDay()&&1!=t.getDate()}],[d3.time.format("%I %p"),function(t){return t.getHours()}],[d3.time.format("%I:%M"),function(t){return t.getMinutes()}],[d3.time.format(":%S"),function(t){return t.getSeconds()}],[d3.time.format(".%L"),function(t){return t.getMilliseconds()}]],d3.scale.linear()),Ri=Je(kn);Ni.year=function(t,e){return zi.domain(t.map(tn)).ticks(e).map(Ze)},d3.time.scale=function(){return Xe(d3.scale.linear(),Ni,Ri)};var Hi=Ni.map((function(t){return[t[0].utc,t[1]]})),Fi=Je([[d3.time.format.utc("%Y"),function(t){return!0}],[d3.time.format.utc("%B"),function(t){return t.getUTCMonth()}],[d3.time.format.utc("%b %d"),function(t){return 1!=t.getUTCDate()}],[d3.time.format.utc("%a %d"),function(t){return t.getUTCDay()&&1!=t.getUTCDate()}],[d3.time.format.utc("%I %p"),function(t){return t.getUTCHours()}],[d3.time.format.utc("%I:%M"),function(t){return t.getUTCMinutes()}],[d3.time.format.utc(":%S"),function(t){return t.getUTCSeconds()}],[d3.time.format.utc(".%L"),function(t){return t.getUTCMilliseconds()}]]);Hi.year=function(t,e){return zi.domain(t.map(nn)).ticks(e).map(en)},d3.time.scale.utc=function(){return Xe(d3.scale.linear(),Hi,Fi)}}(),function(t,e){function n(t,n,i){if(i===e&&1===t.nodeType){var r="data-"+n.replace(st,"-$1").toLowerCase();if("string"==typeof(i=t.getAttribute(r))){try{i="true"===i||"false"!==i&&("null"===i?null:+i+""===i?+i:at.test(i)?$.parseJSON(i):i)}catch(t){}$.data(t,n,i)}else i=e}return i}function i(t){for(var e in t)if(("data"!==e||!$.isEmptyObject(t[e]))&&"toJSON"!==e)return!1;return!0}function r(){return!1}function o(){return!0}function a(t){return!t||!t.parentNode||11===t.parentNode.nodeType}function s(t,e){for(;(t=t[e])&&1!==t.nodeType;);return t}function l(t,e,n){if(e=e||0,$.isFunction(e))return $.grep(t,(function(t,i){return!!e.call(t,i,t)===n}));if(e.nodeType)return $.grep(t,(function(t,i){return t===e===n}));if("string"==typeof e){var i=$.grep(t,(function(t){return 1===t.nodeType}));if(St.test(e))return $.filter(e,i,!n);e=$.filter(e,i)}return $.grep(t,(function(t,i){return 0<=$.inArray(t,e)===n}))}function u(t){var e=At.split("|"),n=t.createDocumentFragment();if(n.createElement)for(;e.length;)n.createElement(e.pop());return n}function c(t,e){if(1===e.nodeType&&$.hasData(t)){var n,i,r,o=$._data(t),a=(t=$._data(e,o),o.events);if(a)for(n in delete t.handle,t.events={},a)for(i=0,r=a[n].length;i<r;i++)$.event.add(e,n,a[n][i]);t.data&&(t.data=$.extend({},t.data))}}function d(t,e){var n;1===e.nodeType&&(e.clearAttributes&&e.clearAttributes(),e.mergeAttributes&&e.mergeAttributes(t),"object"===(n=e.nodeName.toLowerCase())?(e.parentNode&&(e.outerHTML=t.outerHTML),$.support.html5Clone&&t.innerHTML&&!$.trim(e.innerHTML)&&(e.innerHTML=t.innerHTML)):"input"===n&&Vt.test(t.type)?(e.defaultChecked=e.checked=t.checked,e.value!==t.value&&(e.value=t.value)):"option"===n?e.selected=t.defaultSelected:"input"===n||"textarea"===n?e.defaultValue=t.defaultValue:"script"===n&&e.text!==t.text&&(e.text=t.text),e.removeAttribute($.expando))}function h(t){return void 0!==t.getElementsByTagName?t.getElementsByTagName("*"):void 0!==t.querySelectorAll?t.querySelectorAll("*"):[]}function p(t){Vt.test(t.type)&&(t.defaultChecked=t.checked)}function f(t,e){if(e in t)return e;for(var n=e.charAt(0).toUpperCase()+e.slice(1),i=e,r=ue.length;r--;)if((e=ue[r]+n)in t)return e;return i}function g(t,e){return"none"===$.css(t=e||t,"display")||!$.contains(t.ownerDocument,t)}function m(t,e){for(var n,i,r=[],o=0,a=t.length;o<a;o++)(n=t[o]).style&&(r[o]=$._data(n,"olddisplay"),e?(r[o]||"none"!==n.style.display||(n.style.display=""),""===n.style.display&&g(n)&&(r[o]=$._data(n,"olddisplay",x(n.nodeName)))):(i=Yt(n,"display"),r[o]||"none"===i||$._data(n,"olddisplay",i)));for(o=0;o<a;o++)(n=t[o]).style&&(e&&"none"!==n.style.display&&""!==n.style.display||(n.style.display=e?r[o]||"":"none"));return t}function v(t,e,n){var i=ne.exec(e);return i?Math.max(0,i[1]-(n||0))+(i[2]||"px"):e}function y(t,e,n,i){for(var r=n===(i?"border":"content")?4:"width"===e?1:0,o=0;r<4;r+=2)"margin"===n&&(o+=$.css(t,n+le[r],!0)),i?("content"===n&&(o-=parseFloat(Yt(t,"padding"+le[r]))||0),"margin"!==n&&(o-=parseFloat(Yt(t,"border"+le[r]+"Width"))||0)):(o+=parseFloat(Yt(t,"padding"+le[r]))||0,"padding"!==n&&(o+=parseFloat(Yt(t,"border"+le[r]+"Width"))||0));return o}function b(t,e,n){var i="width"===e?t.offsetWidth:t.offsetHeight,r=!0,o=$.support.boxSizing&&"border-box"===$.css(t,"boxSizing");if(i<=0||null==i){if(((i=Yt(t,e))<0||null==i)&&(i=t.style[e]),ie.test(i))return i;r=o&&($.support.boxSizingReliable||i===t.style[e]),i=parseFloat(i)||0}return i+y(t,e,n||(o?"border":"content"),r)+"px"}function x(t){if(oe[t])return oe[t];var e=$("<"+t+">").appendTo(I.body),n=e.css("display");return e.remove(),"none"!==n&&""!==n||(Xt=I.body.appendChild(Xt||$.extend(I.createElement("iframe"),{frameBorder:0,width:0,height:0})),Qt&&Xt.createElement||((Qt=(Xt.contentWindow||Xt.contentDocument).document).write("<!doctype html><html><body>"),Qt.close()),e=Qt.body.appendChild(Qt.createElement(t)),n=Yt(e,"display"),I.body.removeChild(Xt)),oe[t]=n}function w(t){return function(e,n){"string"!=typeof e&&(n=e,e="*");var i,r,o=e.toLowerCase().split(G),a=0,s=o.length;if($.isFunction(n))for(;a<s;a++)i=o[a],(r=/^\+/.test(i))&&(i=i.substr(1)||"*"),(t[i]=t[i]||[])[r?"unshift":"push"](n)}}function C(t,n,i,r,o,a){(a=a||{})[o=o||n.dataTypes[0]]=!0;for(var s,l=t[o],u=0,c=l?l.length:0,d=t===De;u<c&&(d||!s);u++)"string"==typeof(s=l[u](n,i,r))&&(s=!d||a[s]?e:(n.dataTypes.unshift(s),C(t,n,i,r,s,a)));return!d&&s||a["*"]?s:C(t,n,i,r,"*",a)}function _(t,n){var i,r,o=$.ajaxSettings.flatOptions||{};for(i in n)n[i]!==e&&((o[i]?t:r=r||{})[i]=n[i]);r&&$.extend(!0,t,r)}function E(){try{return new t.XMLHttpRequest}catch(t){}}function M(){return setTimeout((function(){ze=e}),0),ze=$.now()}function D(t,e,n){var i,r,o=0,a=Be.length,s=$.Deferred().always((function(){delete l.elem})),l=function(){for(var e=ze||M(),n=1-((e=Math.max(0,u.startTime+u.duration-e))/u.duration||0),i=0,r=u.tweens.length;i<r;i++)u.tweens[i].run(n);return s.notifyWith(t,[u,n,e]),n<1&&r?e:(s.resolveWith(t,[u]),!1)},u=s.promise({elem:t,props:$.extend({},e),opts:$.extend(!0,{specialEasing:{}},n),originalProperties:e,originalOptions:n,startTime:ze||M(),duration:n.duration,tweens:[],createTween:function(e,n,i){return e=$.Tween(t,u.opts,e,n,u.opts.specialEasing[e]||u.opts.easing),u.tweens.push(e),e},stop:function(e){for(var n=0,i=e?u.tweens.length:0;n<i;n++)u.tweens[n].run(1);return e?s.resolveWith(t,[u,e]):s.rejectWith(t,[u,e]),this}}),c=u.props;for(function(t,e){var n,i,r,o,a;for(n in t)if(r=e[i=$.camelCase(n)],o=t[n],$.isArray(o)&&(r=o[1],o=t[n]=o[0]),n!==i&&(t[i]=o,delete t[n]),(a=$.cssHooks[i])&&"expand"in a)for(n in o=a.expand(o),delete t[i],o)n in t||(t[n]=o[n],e[n]=r);else e[i]=r}(c,u.opts.specialEasing);o<a;o++)if(i=Be[o].call(u,t,c,u.opts))return i;return r=u,$.each(c,(function(t,e){for(var n=(We[t]||[]).concat(We["*"]),i=0,o=n.length;i<o;i++)if(n[i].call(r,t,e))return})),$.isFunction(u.opts.start)&&u.opts.start.call(t,u),$.fx.timer($.extend(l,{anim:u,queue:u.opts.queue,elem:t})),u.progress(u.opts.progress).done(u.opts.done,u.opts.complete).fail(u.opts.fail).always(u.opts.always)}function S(t,e,n,i,r){return new S.prototype.init(t,e,n,i,r)}function P(t,e){var n,i={height:t},r=0;for(e=e?1:0;r<4;r+=2-e)i["margin"+(n=le[r])]=i["padding"+n]=t;return e&&(i.opacity=i.width=t),i}function j(t){return $.isWindow(t)?t:9===t.nodeType&&(t.defaultView||t.parentWindow)}function T(t,e){return(e+"").toUpperCase()}function A(){I.addEventListener?(I.removeEventListener("DOMContentLoaded",A,!1),$.ready()):"complete"===I.readyState&&(I.detachEvent("onreadystatechange",A),$.ready())}var k,I=t.document,L=t.location,O=t.navigator,N=t.jQuery,z=t.$,R=Array.prototype.push,H=Array.prototype.slice,F=Array.prototype.indexOf,V=Object.prototype.toString,B=Object.prototype.hasOwnProperty,W=String.prototype.trim,$=function(t,e){return new $.fn.init(t,e,rt)},U=/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source,q=/\S/,G=/\s+/,Y=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,X=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,Q=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,K=/^[\],:{}\s]*$/,J=/(?:^|:|,)(?:\s*\[)+/g,Z=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,tt=/"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,et=/^-ms-/,nt=/-([\da-z])/gi,it={};$.fn=$.prototype={constructor:$,init:function(t,n,i){var r,o;if(!t)return this;if(t.nodeType)return this.context=this[0]=t,this.length=1,this;if("string"!=typeof t)return $.isFunction(t)?i.ready(t):(t.selector!==e&&(this.selector=t.selector,this.context=t.context),$.makeArray(t,this));if(!(r="<"===t.charAt(0)&&">"===t.charAt(t.length-1)&&3<=t.length?[null,t,null]:X.exec(t))||!r[1]&&n)return(!n||n.jquery?n||i:this.constructor(n)).find(t);if(r[1])return o=(n=n instanceof $?n[0]:n)&&n.nodeType?n.ownerDocument||n:I,t=$.parseHTML(r[1],o,!0),Q.test(r[1])&&$.isPlainObject(n)&&this.attr.call(t,n,!0),$.merge(this,t);if((n=I.getElementById(r[2]))&&n.parentNode){if(n.id!==r[2])return i.find(t);this.length=1,this[0]=n}return this.context=I,this.selector=t,this},selector:"",jquery:"1.8.2",length:0,size:function(){return this.length},toArray:function(){return H.call(this)},get:function(t){return null==t?this.toArray():t<0?this[this.length+t]:this[t]},pushStack:function(t,e,n){return(t=$.merge(this.constructor(),t)).prevObject=this,t.context=this.context,"find"===e?t.selector=this.selector+(this.selector?" ":"")+n:e&&(t.selector=this.selector+"."+e+"("+n+")"),t},each:function(t,e){return $.each(this,t,e)},ready:function(t){return $.ready.promise().done(t),this},eq:function(t){return-1==(t=+t)?this.slice(t):this.slice(t,t+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(H.apply(this,arguments),"slice",H.call(arguments).join(","))},map:function(t){return this.pushStack($.map(this,(function(e,n){return t.call(e,n,e)})))},end:function(){return this.prevObject||this.constructor(null)},push:R,sort:[].sort,splice:[].splice},$.fn.init.prototype=$.fn,$.extend=$.fn.extend=function(){var t,n,i,r,o,a=arguments[0]||{},s=1,l=arguments.length,u=!1;for("boolean"==typeof a&&(u=a,a=arguments[1]||{},s=2),"object"==typeof a||$.isFunction(a)||(a={}),l===s&&(a=this,--s);s<l;s++)if(null!=(t=arguments[s]))for(n in t)o=a[n],a!==(i=t[n])&&(u&&i&&($.isPlainObject(i)||(r=$.isArray(i)))?(o=r?(r=!1,o&&$.isArray(o)?o:[]):o&&$.isPlainObject(o)?o:{},a[n]=$.extend(u,o,i)):i!==e&&(a[n]=i));return a},$.extend({noConflict:function(e){return t.$===$&&(t.$=z),e&&t.jQuery===$&&(t.jQuery=N),$},isReady:!1,readyWait:1,holdReady:function(t){t?$.readyWait++:$.ready(!0)},ready:function(t){if(!0===t?!--$.readyWait:!$.isReady){if(!I.body)return setTimeout($.ready,1);($.isReady=!0)!==t&&0<--$.readyWait||(k.resolveWith(I,[$]),$.fn.trigger&&$(I).trigger("ready").off("ready"))}},isFunction:function(t){return"function"===$.type(t)},isArray:Array.isArray||function(t){return"array"===$.type(t)},isWindow:function(t){return null!=t&&t==t.window},isNumeric:function(t){return!isNaN(parseFloat(t))&&isFinite(t)},type:function(t){return null==t?String(t):it[V.call(t)]||"object"},isPlainObject:function(t){if(!t||"object"!==$.type(t)||t.nodeType||$.isWindow(t))return!1;try{if(t.constructor&&!B.call(t,"constructor")&&!B.call(t.constructor.prototype,"isPrototypeOf"))return!1}catch(t){return!1}for(var n in t);return n===e||B.call(t,n)},isEmptyObject:function(t){for(var e in t)return!1;return!0},error:function(t){throw new Error(t)},parseHTML:function(t,e,n){var i;return t&&"string"==typeof t?("boolean"==typeof e&&(n=e,e=0),e=e||I,(i=Q.exec(t))?[e.createElement(i[1])]:(i=$.buildFragment([t],e,n?null:[]),$.merge([],(i.cacheable?$.clone(i.fragment):i.fragment).childNodes))):null},parseJSON:function(e){return e&&"string"==typeof e?(e=$.trim(e),t.JSON&&t.JSON.parse?t.JSON.parse(e):K.test(e.replace(Z,"@").replace(tt,"]").replace(J,""))?new Function("return "+e)():void $.error("Invalid JSON: "+e)):null},parseXML:function(n){var i;if(!n||"string"!=typeof n)return null;try{t.DOMParser?i=(new DOMParser).parseFromString(n,"text/xml"):((i=new ActiveXObject("Microsoft.XMLDOM")).async="false",i.loadXML(n))}catch(n){i=e}return i&&i.documentElement&&!i.getElementsByTagName("parsererror").length||$.error("Invalid XML: "+n),i},noop:function(){},globalEval:function(e){e&&q.test(e)&&(t.execScript||function(e){t.eval.call(t,e)})(e)},camelCase:function(t){return t.replace(et,"ms-").replace(nt,T)},nodeName:function(t,e){return t.nodeName&&t.nodeName.toLowerCase()===e.toLowerCase()},each:function(t,n,i){var r,o=0,a=t.length,s=a===e||$.isFunction(t);if(i)if(s){for(r in t)if(!1===n.apply(t[r],i))break}else for(;o<a&&!1!==n.apply(t[o++],i););else if(s){for(r in t)if(!1===n.call(t[r],r,t[r]))break}else for(;o<a&&!1!==n.call(t[o],o,t[o++]););return t},trim:W&&!W.call("\ufeff ")?function(t){return null==t?"":W.call(t)}:function(t){return null==t?"":(t+"").replace(Y,"")},makeArray:function(t,e){var n=e||[];return null!=t&&(e=$.type(t),null==t.length||"string"===e||"function"===e||"regexp"===e||$.isWindow(t)?R.call(n,t):$.merge(n,t)),n},inArray:function(t,e,n){var i;if(e){if(F)return F.call(e,t,n);for(i=e.length,n=n?n<0?Math.max(0,i+n):n:0;n<i;n++)if(n in e&&e[n]===t)return n}return-1},merge:function(t,n){var i=n.length,r=t.length,o=0;if("number"==typeof i)for(;o<i;o++)t[r++]=n[o];else for(;n[o]!==e;)t[r++]=n[o++];return t.length=r,t},grep:function(t,e,n){var i=[],r=0,o=t.length;for(n=!!n;r<o;r++)n!==!!e(t[r],r)&&i.push(t[r]);return i},map:function(t,n,i){var r,o,a=[],s=0,l=t.length;if(t instanceof $||l!==e&&"number"==typeof l&&(0<l&&t[0]&&t[l-1]||0===l||$.isArray(t)))for(;s<l;s++)null!=(r=n(t[s],s,i))&&(a[a.length]=r);else for(o in t)null!=(r=n(t[o],o,i))&&(a[a.length]=r);return a.concat.apply([],a)},guid:1,proxy:function(t,n){var i,r;return"string"==typeof n&&(r=t[n],n=t,t=r),$.isFunction(t)?(i=H.call(arguments,2),(r=function(){return t.apply(n,i.concat(H.call(arguments)))}).guid=t.guid=t.guid||$.guid++,r):e},access:function(t,n,i,r,o,a,s){var l,u=null==i,c=0,d=t.length;if(i&&"object"==typeof i){for(c in i)$.access(t,n,c,i[c],1,a,r);o=1}else if(r!==e){if(l=s===e&&$.isFunction(r),n=u?l?(l=n,function(t,e,n){return l.call($(t),n)}):(n.call(t,r),null):n)for(;c<d;c++)n(t[c],i,l?r.call(t[c],c,n(t[c],i)):r,s);o=1}return o?t:u?n.call(t):d?n(t[0],i):a},now:function(){return(new Date).getTime()}}),$.ready.promise=function(e){if(!k)if(k=$.Deferred(),"complete"===I.readyState)setTimeout($.ready,1);else if(I.addEventListener)I.addEventListener("DOMContentLoaded",A,!1),t.addEventListener("load",$.ready,!1);else{I.attachEvent("onreadystatechange",A),t.attachEvent("onload",$.ready);var n=!1;try{n=null==t.frameElement&&I.documentElement}catch(e){}n&&n.doScroll&&function t(){if(!$.isReady){try{n.doScroll("left")}catch(e){return setTimeout(t,50)}$.ready()}}()}return k.promise(e)},$.each("Boolean Number String Function Array Date RegExp Object".split(" "),(function(t,e){it["[object "+e+"]"]=e.toLowerCase()}));var rt=$(I),ot={};$.Callbacks=function(t){var n,i;function r(e){for(o=t.memory&&e,a=!0,c=l||0,l=0,u=d.length,s=!0;d&&c<u;c++)if(!1===d[c].apply(e[0],e[1])&&t.stopOnFalse){o=!1;break}s=!1,d&&(h?h.length&&r(h.shift()):o?d=[]:p.disable())}t="string"==typeof t?ot[t]||(i=ot[n=t]={},$.each(n.split(G),(function(t,e){i[e]=!0})),i):$.extend({},t);var o,a,s,l,u,c,d=[],h=!t.once&&[],p={add:function(){var e;return d&&(e=d.length,function e(n){$.each(n,(function(n,i){var r=$.type(i);"function"!==r||t.unique&&p.has(i)?i&&i.length&&"string"!==r&&e(i):d.push(i)}))}(arguments),s?u=d.length:o&&(l=e,r(o))),this},remove:function(){return d&&$.each(arguments,(function(t,e){for(var n;-1<(n=$.inArray(e,d,n));)d.splice(n,1),s&&(n<=u&&u--,n<=c&&c--)})),this},has:function(t){return-1<$.inArray(t,d)},empty:function(){return d=[],this},disable:function(){return d=h=o=e,this},disabled:function(){return!d},lock:function(){return h=e,o||p.disable(),this},locked:function(){return!h},fireWith:function(t,e){return e=[t,(e=e||[]).slice?e.slice():e],!d||a&&!h||(s?h.push(e):r(e)),this},fire:function(){return p.fireWith(this,arguments),this},fired:function(){return!!a}};return p},$.extend({Deferred:function(t){var e=[["resolve","done",$.Callbacks("once memory"),"resolved"],["reject","fail",$.Callbacks("once memory"),"rejected"],["notify","progress",$.Callbacks("memory")]],n="pending",i={state:function(){return n},always:function(){return r.done(arguments).fail(arguments),this},then:function(){var t=arguments;return $.Deferred((function(n){$.each(e,(function(e,i){var o=i[0],a=t[e];r[i[1]]($.isFunction(a)?function(){var t=a.apply(this,arguments);t&&$.isFunction(t.promise)?t.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[o+"With"](this===r?n:this,[t])}:n[o])})),t=null})).promise()},promise:function(t){return null!=t?$.extend(t,i):i}},r={};return i.pipe=i.then,$.each(e,(function(t,o){var a=o[2],s=o[3];i[o[1]]=a.add,s&&a.add((function(){n=s}),e[1^t][2].disable,e[2][2].lock),r[o[0]]=a.fire,r[o[0]+"With"]=a.fireWith})),i.promise(r),t&&t.call(r,r),r},when:function(t){function e(t,e,i){return function(r){e[t]=this,i[t]=1<arguments.length?H.call(arguments):r,i===n?u.notifyWith(e,i):--l||u.resolveWith(e,i)}}var n,i,r,o=0,a=H.call(arguments),s=a.length,l=1!==s||t&&$.isFunction(t.promise)?s:0,u=1===l?t:$.Deferred();if(1<s)for(n=new Array(s),i=new Array(s),r=new Array(s);o<s;o++)a[o]&&$.isFunction(a[o].promise)?a[o].promise().done(e(o,r,a)).fail(u.reject).progress(e(o,i,n)):--l;return l||u.resolveWith(r,a),u.promise()}}),$.support=function(){var e,n,i,r,o,a,s,l,u,c,d=I.createElement("div");if(d.setAttribute("className","t"),d.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",n=d.getElementsByTagName("*"),(i=d.getElementsByTagName("a")[0]).style.cssText="top:1px;float:left;opacity:.5",!n||!n.length)return{};o=(r=I.createElement("select")).appendChild(I.createElement("option")),a=d.getElementsByTagName("input")[0],e={leadingWhitespace:3===d.firstChild.nodeType,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/top/.test(i.getAttribute("style")),hrefNormalized:"/a"===i.getAttribute("href"),opacity:/^0.5/.test(i.style.opacity),cssFloat:!!i.style.cssFloat,checkOn:"on"===a.value,optSelected:o.selected,getSetAttribute:"t"!==d.className,enctype:!!I.createElement("form").enctype,html5Clone:"<:nav></:nav>"!==I.createElement("nav").cloneNode(!0).outerHTML,boxModel:"CSS1Compat"===I.compatMode,submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},a.checked=!0,e.noCloneChecked=a.cloneNode(!0).checked,r.disabled=!0,e.optDisabled=!o.disabled;try{delete d.test}catch(n){e.deleteExpando=!1}if(!d.addEventListener&&d.attachEvent&&d.fireEvent&&(d.attachEvent("onclick",c=function(){e.noCloneEvent=!1}),d.cloneNode(!0).fireEvent("onclick"),d.detachEvent("onclick",c)),(a=I.createElement("input")).value="t",a.setAttribute("type","radio"),e.radioValue="t"===a.value,a.setAttribute("checked","checked"),a.setAttribute("name","t"),d.appendChild(a),(c=I.createDocumentFragment()).appendChild(d.lastChild),e.checkClone=c.cloneNode(!0).cloneNode(!0).lastChild.checked,e.appendChecked=a.checked,c.removeChild(a),c.appendChild(d),d.attachEvent)for(l in{submit:!0,change:!0,focusin:!0})(u=(s="on"+l)in d)||(d.setAttribute(s,"return;"),u="function"==typeof d[s]),e[l+"Bubbles"]=u;return $((function(){var n,i,r,o="padding:0;margin:0;border:0;display:block;overflow:hidden;",a=I.getElementsByTagName("body")[0];a&&((n=I.createElement("div")).style.cssText="visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px",a.insertBefore(n,a.firstChild),i=I.createElement("div"),n.appendChild(i),i.innerHTML="<table><tr><td></td><td>t</td></tr></table>",(r=i.getElementsByTagName("td"))[0].style.cssText="padding:0;margin:0;border:0;display:none",u=0===r[0].offsetHeight,r[0].style.display="",r[1].style.display="none",e.reliableHiddenOffsets=u&&0===r[0].offsetHeight,i.innerHTML="",i.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",e.boxSizing=4===i.offsetWidth,e.doesNotIncludeMarginInBodyOffset=1!==a.offsetTop,t.getComputedStyle&&(e.pixelPosition="1%"!==(t.getComputedStyle(i,null)||{}).top,e.boxSizingReliable="4px"===(t.getComputedStyle(i,null)||{width:"4px"}).width,(r=I.createElement("div")).style.cssText=i.style.cssText=o,r.style.marginRight=r.style.width="0",i.style.width="1px",i.appendChild(r),e.reliableMarginRight=!parseFloat((t.getComputedStyle(r,null)||{}).marginRight)),void 0!==i.style.zoom&&(i.innerHTML="",i.style.cssText=o+"width:1px;padding:1px;display:inline;zoom:1",e.inlineBlockNeedsLayout=3===i.offsetWidth,i.style.display="block",i.style.overflow="visible",i.innerHTML="<div></div>",i.firstChild.style.width="5px",e.shrinkWrapBlocks=3!==i.offsetWidth,n.style.zoom=1),a.removeChild(n))})),c.removeChild(d),n=i=r=a=c=d=null,e}();var at=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,st=/([A-Z])/g;$.extend({cache:{},deletedIds:[],uuid:0,expando:"jQuery"+($.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(t){return!!(t=t.nodeType?$.cache[t[$.expando]]:t[$.expando])&&!i(t)},data:function(t,n,i,r){if($.acceptData(t)){var o,a=$.expando,s="string"==typeof n,l=t.nodeType,u=l?$.cache:t,c=l?t[a]:t[a]&&a;if(c&&u[c]&&(r||u[c].data)||!s||i!==e)return c||(l?t[a]=c=$.deletedIds.pop()||$.guid++:c=a),u[c]||(u[c]={},l||(u[c].toJSON=$.noop)),"object"!=typeof n&&"function"!=typeof n||(r?u[c]=$.extend(u[c],n):u[c].data=$.extend(u[c].data,n)),c=u[c],r||(c.data||(c.data={}),c=c.data),i!==e&&(c[$.camelCase(n)]=i),s?null==(o=c[n])&&(o=c[$.camelCase(n)]):o=c,o}},removeData:function(t,e,n){if($.acceptData(t)){var r,o,a,s=t.nodeType,l=s?$.cache:t,u=s?t[$.expando]:$.expando;if(l[u]){if(e&&(r=n?l[u]:l[u].data)){for((o=0,a=(e=$.isArray(e)?e:e in r||(e=$.camelCase(e))in r?[e]:e.split(" ")).length);o<a;o++)delete r[e[o]];if(!(n?i:$.isEmptyObject)(r))return}(n||(delete l[u].data,i(l[u])))&&(s?$.cleanData([t],!0):$.support.deleteExpando||l!=l.window?delete l[u]:l[u]=null)}}},_data:function(t,e,n){return $.data(t,e,n,!0)},acceptData:function(t){var e=t.nodeName&&$.noData[t.nodeName.toLowerCase()];return!e||!0!==e&&t.getAttribute("classid")===e}}),$.fn.extend({data:function(t,i){var r,o,a,s,l,u=this[0],c=0,d=null;if(t!==e)return"object"==typeof t?this.each((function(){$.data(this,t)})):((r=t.split(".",2))[1]=r[1]?"."+r[1]:"",o=r[1]+"!",$.access(this,(function(i){return i===e?((d=this.triggerHandler("getData"+o,[r[0]]))===e&&u&&(d=$.data(u,t),d=n(u,t,d)),d===e&&r[1]?this.data(r[0]):d):(r[1]=i,void this.each((function(){var e=$(this);e.triggerHandler("setData"+o,r),$.data(this,t,i),e.triggerHandler("changeData"+o,r)})))}),null,i,1<arguments.length,null,!1));if(this.length&&(d=$.data(u),1===u.nodeType&&!$._data(u,"parsedAttrs"))){for(l=(a=u.attributes).length;c<l;c++)(s=a[c].name).indexOf("data-")||(s=$.camelCase(s.substring(5)),n(u,s,d[s]));$._data(u,"parsedAttrs",!0)}return d},removeData:function(t){return this.each((function(){$.removeData(this,t)}))}}),$.extend({queue:function(t,e,n){var i;if(t)return i=$._data(t,e=(e||"fx")+"queue"),n&&(!i||$.isArray(n)?i=$._data(t,e,$.makeArray(n)):i.push(n)),i||[]},dequeue:function(t,e){e=e||"fx";var n=$.queue(t,e),i=n.length,r=n.shift(),o=$._queueHooks(t,e);"inprogress"===r&&(r=n.shift(),i--),r&&("fx"===e&&n.unshift("inprogress"),delete o.stop,r.call(t,(function(){$.dequeue(t,e)}),o)),!i&&o&&o.empty.fire()},_queueHooks:function(t,e){var n=e+"queueHooks";return $._data(t,n)||$._data(t,n,{empty:$.Callbacks("once memory").add((function(){$.removeData(t,e+"queue",!0),$.removeData(t,n,!0)}))})}}),$.fn.extend({queue:function(t,n){var i=2;return"string"!=typeof t&&(n=t,t="fx",i--),arguments.length<i?$.queue(this[0],t):n===e?this:this.each((function(){var e=$.queue(this,t,n);$._queueHooks(this,t),"fx"===t&&"inprogress"!==e[0]&&$.dequeue(this,t)}))},dequeue:function(t){return this.each((function(){$.dequeue(this,t)}))},delay:function(t,e){return t=$.fx&&$.fx.speeds[t]||t,this.queue(e=e||"fx",(function(e,n){var i=setTimeout(e,t);n.stop=function(){clearTimeout(i)}}))},clearQueue:function(t){return this.queue(t||"fx",[])},promise:function(t,n){function i(){--o||a.resolveWith(s,[s])}var r,o=1,a=$.Deferred(),s=this,l=this.length;for("string"!=typeof t&&(n=t,t=e),t=t||"fx";l--;)(r=$._data(s[l],t+"queueHooks"))&&r.empty&&(o++,r.empty.add(i));return i(),a.promise(n)}});var lt,ut,ct,dt=/[\t\r\n]/g,ht=/\r/g,pt=/^(?:button|input)$/i,ft=/^(?:button|input|object|select|textarea)$/i,gt=/^a(?:rea|)$/i,mt=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,vt=$.support.getSetAttribute;function yt(t){return $.event.special.hover?t:t.replace(wt,"mouseenter$1 mouseleave$1")}$.fn.extend({attr:function(t,e){return $.access(this,$.attr,t,e,1<arguments.length)},removeAttr:function(t){return this.each((function(){$.removeAttr(this,t)}))},prop:function(t,e){return $.access(this,$.prop,t,e,1<arguments.length)},removeProp:function(t){return t=$.propFix[t]||t,this.each((function(){try{this[t]=e,delete this[t]}catch(t){}}))},addClass:function(t){var e,n,i,r,o,a,s;if($.isFunction(t))return this.each((function(e){$(this).addClass(t.call(this,e,this.className))}));if(t&&"string"==typeof t)for(e=t.split(G),n=0,i=this.length;n<i;n++)if(1===(r=this[n]).nodeType)if(r.className||1!==e.length){for(o=" "+r.className+" ",a=0,s=e.length;a<s;a++)o.indexOf(" "+e[a]+" ")<0&&(o+=e[a]+" ");r.className=$.trim(o)}else r.className=t;return this},removeClass:function(t){var n,i,r,o,a,s,l;if($.isFunction(t))return this.each((function(e){$(this).removeClass(t.call(this,e,this.className))}));if(t&&"string"==typeof t||t===e)for(n=(t||"").split(G),s=0,l=this.length;s<l;s++)if(1===(r=this[s]).nodeType&&r.className){for(i=(" "+r.className+" ").replace(dt," "),o=0,a=n.length;o<a;o++)for(;0<=i.indexOf(" "+n[o]+" ");)i=i.replace(" "+n[o]+" "," ");r.className=t?$.trim(i):""}return this},toggleClass:function(t,e){var n=typeof t,i="boolean"==typeof e;return $.isFunction(t)?this.each((function(n){$(this).toggleClass(t.call(this,n,this.className,e),e)})):this.each((function(){if("string"==n)for(var r,o=0,a=$(this),s=e,l=t.split(G);r=l[o++];)s=i?s:!a.hasClass(r),a[s?"addClass":"removeClass"](r);else"undefined"!=n&&"boolean"!=n||(this.className&&$._data(this,"__className__",this.className),this.className=!this.className&&!1!==t&&$._data(this,"__className__")||"")}))},hasClass:function(t){for(var e=" "+t+" ",n=0,i=this.length;n<i;n++)if(1===this[n].nodeType&&0<=(" "+this[n].className+" ").replace(dt," ").indexOf(e))return!0;return!1},val:function(t){var n,i,r,o=this[0];return arguments.length?(r=$.isFunction(t),this.each((function(i){var o=$(this);1===this.nodeType&&(null==(o=r?t.call(this,i,o.val()):t)?o="":"number"==typeof o?o+="":$.isArray(o)&&(o=$.map(o,(function(t){return null==t?"":t+""}))),(n=$.valHooks[this.type]||$.valHooks[this.nodeName.toLowerCase()])&&"set"in n&&n.set(this,o,"value")!==e||(this.value=o))}))):o?(n=$.valHooks[o.type]||$.valHooks[o.nodeName.toLowerCase()])&&"get"in n&&(i=n.get(o,"value"))!==e?i:"string"==typeof(i=o.value)?i.replace(ht,""):null==i?"":i:void 0}}),$.extend({valHooks:{option:{get:function(t){var e=t.attributes.value;return!e||e.specified?t.value:t.text}},select:{get:function(t){var e,n,i,r=t.selectedIndex,o=[],a=t.options,s="select-one"===t.type;if(r<0)return null;for(e=s?r:0,n=s?r+1:a.length;e<n;e++)if((i=a[e]).selected&&($.support.optDisabled?!i.disabled:null===i.getAttribute("disabled"))&&(!i.parentNode.disabled||!$.nodeName(i.parentNode,"optgroup"))){if(i=$(i).val(),s)return i;o.push(i)}return s&&!o.length&&a.length?$(a[r]).val():o},set:function(t,e){var n=$.makeArray(e);return $(t).find("option").each((function(){this.selected=0<=$.inArray($(this).val(),n)})),n.length||(t.selectedIndex=-1),n}}},attrFn:{},attr:function(t,n,i,r){var o,a,s=t.nodeType;if(t&&3!==s&&8!==s&&2!==s)return r&&$.isFunction($.fn[n])?$(t)[n](i):void 0===t.getAttribute?$.prop(t,n,i):((s=1!==s||!$.isXMLDoc(t))&&(n=n.toLowerCase(),a=$.attrHooks[n]||(mt.test(n)?ut:lt)),i!==e?null===i?void $.removeAttr(t,n):a&&"set"in a&&s&&(o=a.set(t,i,n))!==e?o:(t.setAttribute(n,i+""),i):a&&"get"in a&&s&&null!==(o=a.get(t,n))?o:null===(o=t.getAttribute(n))?e:o)},removeAttr:function(t,e){var n,i,r,o,a=0;if(e&&1===t.nodeType)for(i=e.split(G);a<i.length;a++)(r=i[a])&&(n=$.propFix[r]||r,(o=mt.test(r))||$.attr(t,r,""),t.removeAttribute(vt?r:n),o&&n in t&&(t[n]=!1))},attrHooks:{type:{set:function(t,e){if(pt.test(t.nodeName)&&t.parentNode)$.error("type property can't be changed");else if(!$.support.radioValue&&"radio"===e&&$.nodeName(t,"input")){var n=t.value;return t.setAttribute("type",e),n&&(t.value=n),e}}},value:{get:function(t,e){return lt&&$.nodeName(t,"button")?lt.get(t,e):e in t?t.value:null},set:function(t,e,n){if(lt&&$.nodeName(t,"button"))return lt.set(t,e,n);t.value=e}}},propFix:{tabindex:"tabIndex",readonly:"readOnly",for:"htmlFor",class:"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(t,n,i){var r,o,a=t.nodeType;if(t&&3!==a&&8!==a&&2!==a)return(1!==a||!$.isXMLDoc(t))&&(n=$.propFix[n]||n,o=$.propHooks[n]),i!==e?o&&"set"in o&&(r=o.set(t,i,n))!==e?r:t[n]=i:o&&"get"in o&&null!==(r=o.get(t,n))?r:t[n]},propHooks:{tabIndex:{get:function(t){var n=t.getAttributeNode("tabindex");return n&&n.specified?parseInt(n.value,10):ft.test(t.nodeName)||gt.test(t.nodeName)&&t.href?0:e}}}}),ut={get:function(t,n){var i,r=$.prop(t,n);return!0===r||"boolean"!=typeof r&&(i=t.getAttributeNode(n))&&!1!==i.nodeValue?n.toLowerCase():e},set:function(t,e,n){return!1===e?$.removeAttr(t,n):((e=$.propFix[n]||n)in t&&(t[e]=!0),t.setAttribute(n,n.toLowerCase())),n}},vt||(ct={name:!0,id:!0,coords:!0},lt=$.valHooks.button={get:function(t,n){return(t=t.getAttributeNode(n))&&(ct[n]?""!==t.value:t.specified)?t.value:e},set:function(t,e,n){var i=t.getAttributeNode(n);return i||(i=I.createAttribute(n),t.setAttributeNode(i)),i.value=e+""}},$.each(["width","height"],(function(t,e){$.attrHooks[e]=$.extend($.attrHooks[e],{set:function(t,n){if(""===n)return t.setAttribute(e,"auto"),n}})})),$.attrHooks.contenteditable={get:lt.get,set:function(t,e,n){lt.set(t,e=""===e?"false":e,n)}}),$.support.hrefNormalized||$.each(["href","src","width","height"],(function(t,n){$.attrHooks[n]=$.extend($.attrHooks[n],{get:function(t){return null===(t=t.getAttribute(n,2))?e:t}})})),$.support.style||($.attrHooks.style={get:function(t){return t.style.cssText.toLowerCase()||e},set:function(t,e){return t.style.cssText=e+""}}),$.support.optSelected||($.propHooks.selected=$.extend($.propHooks.selected,{get:function(t){return(t=t.parentNode)&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}})),$.support.enctype||($.propFix.enctype="encoding"),$.support.checkOn||$.each(["radio","checkbox"],(function(){$.valHooks[this]={get:function(t){return null===t.getAttribute("value")?"on":t.value}}})),$.each(["radio","checkbox"],(function(){$.valHooks[this]=$.extend($.valHooks[this],{set:function(t,e){if($.isArray(e))return t.checked=0<=$.inArray($(t).val(),e)}})}));var bt=/^(?:textarea|input|select)$/i,xt=/^([^\.]*|)(?:\.(.+)|)$/,wt=/(?:^|\s)hover(\.\S+|)\b/,Ct=/^key/,_t=/^(?:mouse|contextmenu)|click/,Et=/^(?:focusinfocus|focusoutblur)$/;$.event={add:function(t,n,i,r,o){var a,s,l,u,c,d,h,p,f,g;if(3!==t.nodeType&&8!==t.nodeType&&n&&i&&(a=$._data(t)))for(i.handler&&(i=(p=i).handler,o=p.selector),i.guid||(i.guid=$.guid++),(l=a.events)||(a.events=l={}),(s=a.handle)||(a.handle=s=function(t){return void 0===$||t&&$.event.triggered===t.type?e:$.event.dispatch.apply(s.elem,arguments)},s.elem=t),n=$.trim(yt(n)).split(" "),u=0;u<n.length;u++)c=(f=xt.exec(n[u])||[])[1],d=(f[2]||"").split(".").sort(),g=$.event.special[c]||{},c=(o?g.delegateType:g.bindType)||c,g=$.event.special[c]||{},h=$.extend({type:c,origType:f[1],data:r,handler:i,guid:i.guid,selector:o,needsContext:o&&$.expr.match.needsContext.test(o),namespace:d.join(".")},p),(f=l[c])||((f=l[c]=[]).delegateCount=0,g.setup&&!1!==g.setup.call(t,r,d,s)||(t.addEventListener?t.addEventListener(c,s,!1):t.attachEvent&&t.attachEvent("on"+c,s))),g.add&&(g.add.call(t,h),h.handler.guid||(h.handler.guid=i.guid)),o?f.splice(f.delegateCount++,0,h):f.push(h),$.event.global[c]=!0},global:{},remove:function(t,e,n,i,r){var o,a,s,l,u,c,d,h,p,f,g=$.hasData(t)&&$._data(t);if(g&&(d=g.events)){for(e=$.trim(yt(e||"")).split(" "),o=0;o<e.length;o++)if(a=s=(u=xt.exec(e[o])||[])[1],l=u[2],a){for(h=$.event.special[a]||{},u=(p=d[a=(i?h.delegateType:h.bindType)||a]||[]).length,l=l?new RegExp("(^|\\.)"+l.split(".").sort().join("\\.(?:.*\\.|)")+"(\\.|$)"):null,c=0;c<p.length;c++)f=p[c],!r&&s!==f.origType||n&&n.guid!==f.guid||l&&!l.test(f.namespace)||i&&i!==f.selector&&("**"!==i||!f.selector)||(p.splice(c--,1),f.selector&&p.delegateCount--,h.remove&&h.remove.call(t,f));0===p.length&&u!==p.length&&(h.teardown&&!1!==h.teardown.call(t,l,g.handle)||$.removeEvent(t,a,g.handle),delete d[a])}else for(a in d)$.event.remove(t,a+e[o],n,i,!0);$.isEmptyObject(d)&&(delete g.handle,$.removeData(t,"events",!0))}},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(n,i,r,o){if(!r||3!==r.nodeType&&8!==r.nodeType){var a,s,l,u,c,d,h,p,f,g=n.type||n,m=[];if(Et.test(g+$.event.triggered))return;if(0<=g.indexOf("!")&&(g=g.slice(0,-1),s=!0),0<=g.indexOf(".")&&(g=(m=g.split(".")).shift(),m.sort()),(!r||$.event.customEvent[g])&&!$.event.global[g])return;if((n="object"==typeof n?n[$.expando]?n:new $.Event(g,n):new $.Event(g)).type=g,n.isTrigger=!0,n.exclusive=s,n.namespace=m.join("."),n.namespace_re=n.namespace?new RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,d=g.indexOf(":")<0?"on"+g:"",!r){for(l in a=$.cache)a[l].events&&a[l].events[g]&&$.event.trigger(n,i,a[l].handle.elem,!0);return}if(n.result=e,n.target||(n.target=r),(i=null!=i?$.makeArray(i):[]).unshift(n),(m=$.event.special[g]||{}).trigger&&!1===m.trigger.apply(r,i))return;if(p=[[r,m.bindType||g]],!o&&!m.noBubble&&!$.isWindow(r)){for(f=m.delegateType||g,u=Et.test(f+g)?r:r.parentNode,c=r;u;u=u.parentNode)p.push([u,f]),c=u;c===(r.ownerDocument||I)&&p.push([c.defaultView||c.parentWindow||t,f])}for(l=0;l<p.length&&!n.isPropagationStopped();l++)u=p[l][0],n.type=p[l][1],(h=($._data(u,"events")||{})[n.type]&&$._data(u,"handle"))&&h.apply(u,i),(h=d&&u[d])&&$.acceptData(u)&&h.apply&&!1===h.apply(u,i)&&n.preventDefault();return n.type=g,o||n.isDefaultPrevented()||m._default&&!1!==m._default.apply(r.ownerDocument,i)||"click"===g&&$.nodeName(r,"a")||!$.acceptData(r)||!d||!r[g]||("focus"===g||"blur"===g)&&0===n.target.offsetWidth||$.isWindow(r)||((c=r[d])&&(r[d]=null),r[$.event.triggered=g](),$.event.triggered=e,c&&(r[d]=c)),n.result}},dispatch:function(n){n=$.event.fix(n||t.event);var i,r,o,a,s,l,u,c,d,h=($._data(this,"events")||{})[n.type]||[],p=h.delegateCount,f=H.call(arguments),g=!n.exclusive&&!n.namespace,m=$.event.special[n.type]||{},v=[];if((f[0]=n).delegateTarget=this,!m.preDispatch||!1!==m.preDispatch.call(this,n)){if(p&&(!n.button||"click"!==n.type))for(o=n.target;o!=this;o=o.parentNode||this)if(!0!==o.disabled||"click"!==n.type){for(s={},u=[],i=0;i<p;i++)s[d=(c=h[i]).selector]===e&&(s[d]=c.needsContext?0<=$(d,this).index(o):$.find(d,this,null,[o]).length),s[d]&&u.push(c);u.length&&v.push({elem:o,matches:u})}for(h.length>p&&v.push({elem:this,matches:h.slice(p)}),i=0;i<v.length&&!n.isPropagationStopped();i++)for(l=v[i],n.currentTarget=l.elem,r=0;r<l.matches.length&&!n.isImmediatePropagationStopped();r++)c=l.matches[r],(g||!n.namespace&&!c.namespace||n.namespace_re&&n.namespace_re.test(c.namespace))&&(n.data=c.data,n.handleObj=c,(a=(($.event.special[c.origType]||{}).handle||c.handler).apply(l.elem,f))===e||!1===(n.result=a)&&(n.preventDefault(),n.stopPropagation()));return m.postDispatch&&m.postDispatch.call(this,n),n.result}},props:"attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(t,e){return null==t.which&&(t.which=null!=e.charCode?e.charCode:e.keyCode),t}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(t,n){var i,r,o=n.button,a=n.fromElement;return null==t.pageX&&null!=n.clientX&&(i=(r=t.target.ownerDocument||I).documentElement,r=r.body,t.pageX=n.clientX+(i&&i.scrollLeft||r&&r.scrollLeft||0)-(i&&i.clientLeft||r&&r.clientLeft||0),t.pageY=n.clientY+(i&&i.scrollTop||r&&r.scrollTop||0)-(i&&i.clientTop||r&&r.clientTop||0)),!t.relatedTarget&&a&&(t.relatedTarget=a===t.target?n.toElement:a),t.which||o===e||(t.which=1&o?1:2&o?3:4&o?2:0),t}},fix:function(t){if(t[$.expando])return t;var e,n,i=t,r=$.event.fixHooks[t.type]||{},o=r.props?this.props.concat(r.props):this.props;for(t=$.Event(i),e=o.length;e;)t[n=o[--e]]=i[n];return t.target||(t.target=i.srcElement||I),3===t.target.nodeType&&(t.target=t.target.parentNode),t.metaKey=!!t.metaKey,r.filter?r.filter(t,i):t},special:{load:{noBubble:!0},focus:{delegateType:"focusin"},blur:{delegateType:"focusout"},beforeunload:{setup:function(t,e,n){$.isWindow(this)&&(this.onbeforeunload=n)},teardown:function(t,e){this.onbeforeunload===e&&(this.onbeforeunload=null)}}},simulate:function(t,e,n,i){t=$.extend(new $.Event,n,{type:t,isSimulated:!0,originalEvent:{}}),i?$.event.trigger(t,null,e):$.event.dispatch.call(e,t),t.isDefaultPrevented()&&n.preventDefault()}},$.event.handle=$.event.dispatch,$.removeEvent=I.removeEventListener?function(t,e,n){t.removeEventListener&&t.removeEventListener(e,n,!1)}:function(t,e,n){e="on"+e,t.detachEvent&&(void 0===t[e]&&(t[e]=null),t.detachEvent(e,n))},$.Event=function(t,e){if(!(this instanceof $.Event))return new $.Event(t,e);t&&t.type?(this.originalEvent=t,this.type=t.type,this.isDefaultPrevented=t.defaultPrevented||!1===t.returnValue||t.getPreventDefault&&t.getPreventDefault()?o:r):this.type=t,e&&$.extend(this,e),this.timeStamp=t&&t.timeStamp||$.now(),this[$.expando]=!0},$.Event.prototype={preventDefault:function(){this.isDefaultPrevented=o;var t=this.originalEvent;t&&(t.preventDefault?t.preventDefault():t.returnValue=!1)},stopPropagation:function(){this.isPropagationStopped=o;var t=this.originalEvent;t&&(t.stopPropagation&&t.stopPropagation(),t.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=o,this.stopPropagation()},isDefaultPrevented:r,isPropagationStopped:r,isImmediatePropagationStopped:r},$.each({mouseenter:"mouseover",mouseleave:"mouseout"},(function(t,e){$.event.special[t]={delegateType:e,bindType:e,handle:function(t){var n,i=t.relatedTarget,r=t.handleObj;return r.selector,i&&(i===this||$.contains(this,i))||(t.type=r.origType,n=r.handler.apply(this,arguments),t.type=e),n}}})),$.support.submitBubbles||($.event.special.submit={setup:function(){if($.nodeName(this,"form"))return!1;$.event.add(this,"click._submit keypress._submit",(function(t){t=t.target,(t=$.nodeName(t,"input")||$.nodeName(t,"button")?t.form:e)&&!$._data(t,"_submit_attached")&&($.event.add(t,"submit._submit",(function(t){t._submit_bubble=!0})),$._data(t,"_submit_attached",!0))}))},postDispatch:function(t){t._submit_bubble&&(delete t._submit_bubble,this.parentNode&&!t.isTrigger&&$.event.simulate("submit",this.parentNode,t,!0))},teardown:function(){if($.nodeName(this,"form"))return!1;$.event.remove(this,"._submit")}}),$.support.changeBubbles||($.event.special.change={setup:function(){if(bt.test(this.nodeName))return"checkbox"!==this.type&&"radio"!==this.type||($.event.add(this,"propertychange._change",(function(t){"checked"===t.originalEvent.propertyName&&(this._just_changed=!0)})),$.event.add(this,"click._change",(function(t){this._just_changed&&!t.isTrigger&&(this._just_changed=!1),$.event.simulate("change",this,t,!0)}))),!1;$.event.add(this,"beforeactivate._change",(function(t){t=t.target,bt.test(t.nodeName)&&!$._data(t,"_change_attached")&&($.event.add(t,"change._change",(function(t){!this.parentNode||t.isSimulated||t.isTrigger||$.event.simulate("change",this.parentNode,t,!0)})),$._data(t,"_change_attached",!0))}))},handle:function(t){var e=t.target;if(this!==e||t.isSimulated||t.isTrigger||"radio"!==e.type&&"checkbox"!==e.type)return t.handleObj.handler.apply(this,arguments)},teardown:function(){return $.event.remove(this,"._change"),!bt.test(this.nodeName)}}),$.support.focusinBubbles||$.each({focus:"focusin",blur:"focusout"},(function(t,e){function n(t){$.event.simulate(e,t.target,$.event.fix(t),!0)}var i=0;$.event.special[e]={setup:function(){0==i++&&I.addEventListener(t,n,!0)},teardown:function(){0==--i&&I.removeEventListener(t,n,!0)}}})),$.fn.extend({on:function(t,n,i,o,a){var s,l;if("object"==typeof t){for(l in"string"!=typeof n&&(i=i||n,n=e),t)this.on(l,n,i,t[l],a);return this}if(null==i&&null==o?(o=n,i=n=e):null==o&&("string"==typeof n?(o=i,i=e):(o=i,i=n,n=e)),!1===o)o=r;else if(!o)return this;return 1===a&&(s=o,(o=function(t){return $().off(t),s.apply(this,arguments)}).guid=s.guid||(s.guid=$.guid++)),this.each((function(){$.event.add(this,t,o,i,n)}))},one:function(t,e,n,i){return this.on(t,e,n,i,1)},off:function(t,n,i){var o,a;if(t&&t.preventDefault&&t.handleObj)return o=t.handleObj,$(t.delegateTarget).off(o.namespace?o.origType+"."+o.namespace:o.origType,o.selector,o.handler),this;if("object"!=typeof t)return!1!==n&&"function"!=typeof n||(i=n,n=e),!1===i&&(i=r),this.each((function(){$.event.remove(this,t,i,n)}));for(a in t)this.off(a,n,t[a]);return this},bind:function(t,e,n){return this.on(t,null,e,n)},unbind:function(t,e){return this.off(t,null,e)},live:function(t,e,n){return $(this.context).on(t,this.selector,e,n),this},die:function(t,e){return $(this.context).off(t,this.selector||"**",e),this},delegate:function(t,e,n,i){return this.on(e,t,n,i)},undelegate:function(t,e,n){return 1===arguments.length?this.off(t,"**"):this.off(e,t||"**",n)},trigger:function(t,e){return this.each((function(){$.event.trigger(t,e,this)}))},triggerHandler:function(t,e){if(this[0])return $.event.trigger(t,e,this[0],!0)},toggle:function(t){function e(e){var i=($._data(this,"lastToggle"+t.guid)||0)%r;return $._data(this,"lastToggle"+t.guid,1+i),e.preventDefault(),n[i].apply(this,arguments)||!1}var n=arguments,i=t.guid||$.guid++,r=0;for(e.guid=i;r<n.length;)n[r++].guid=i;return this.click(e)},hover:function(t,e){return this.mouseenter(t).mouseleave(e||t)}}),$.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),(function(t,e){$.fn[e]=function(t,n){return null==n&&(n=t,t=null),0<arguments.length?this.on(e,null,t,n):this.trigger(e)},Ct.test(e)&&($.event.fixHooks[e]=$.event.keyHooks),_t.test(e)&&($.event.fixHooks[e]=$.event.mouseHooks)})),function(t){function e(t,e,n,i){n=n||[];var r,o,a,s,l=(e=e||N).nodeType;if(!t||"string"!=typeof t)return n;if(1!==l&&9!==l)return[];if(!(a=b(e))&&!i&&(r=nt.exec(t)))if(s=r[1]){if(9===l){if(!(o=e.getElementById(s))||!o.parentNode)return n;if(o.id===s)return n.push(o),n}else if(e.ownerDocument&&(o=e.ownerDocument.getElementById(s))&&x(e,o)&&o.id===s)return n.push(o),n}else{if(r[2])return V.apply(n,B.call(e.getElementsByTagName(t),0)),n;if((s=r[3])&&ct&&e.getElementsByClassName)return V.apply(n,B.call(e.getElementsByClassName(s),0)),n}return d(t.replace(J,"$1"),e,n,i,a)}function n(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function i(t){return function(e){var n=e.nodeName.toLowerCase();return("input"===n||"button"===n)&&e.type===t}}function r(t){return U((function(e){return e=+e,U((function(n,i){for(var r,o=t([],n.length,e),a=o.length;a--;)n[r=o[a]]&&(n[r]=!(i[r]=n[r]))}))}))}function o(t,e,n){if(t===e)return n;for(var i=t.nextSibling;i;){if(i===e)return-1;i=i.nextSibling}return 1}function a(t,n){var i,r,o,a,s,l,u,c=G[L][t];if(c)return n?0:c.slice(0);for(s=t,l=[],u=v.preFilter;s;){for(a in i&&!(r=Z.exec(s))||(r&&(s=s.slice(r[0].length)),l.push(o=[])),i=!1,(r=tt.exec(s))&&(o.push(i=new O(r.shift())),s=s.slice(i.length),i.type=r[0].replace(J," ")),v.filter)!(r=st[a].exec(s))||u[a]&&!(r=u[a](r,N,!0))||(o.push(i=new O(r.shift())),s=s.slice(i.length),i.type=a,i.matches=r);if(!i)break}return n?s.length:s?e.error(t):G(t,l).slice(0)}function s(t,e,n){var i=e.dir,r=n&&"parentNode"===e.dir,o=H++;return e.first?function(e,n,o){for(;e=e[i];)if(r||1===e.nodeType)return t(e,n,o)}:function(e,n,a){if(a){for(;e=e[i];)if((r||1===e.nodeType)&&t(e,n,a))return e}else for(var s,l=R+" "+o+" ",u=l+g;e=e[i];)if(r||1===e.nodeType){if((s=e[L])===u)return e.sizset;if("string"==typeof s&&0===s.indexOf(l)){if(e.sizset)return e}else{if(e[L]=u,t(e,n,a))return e.sizset=!0,e;e.sizset=!1}}}}function l(t){return 1<t.length?function(e,n,i){for(var r=t.length;r--;)if(!t[r](e,n,i))return!1;return!0}:t[0]}function u(t,e,n,i,r){for(var o,a=[],s=0,l=t.length,u=null!=e;s<l;s++)(o=t[s])&&(n&&!n(o,i,r)||(a.push(o),u&&e.push(s)));return a}function c(t,n,i,r,o,a){return r&&!r[L]&&(r=c(r)),o&&!o[L]&&(o=c(o,a)),U((function(a,s,l,c){if(!a||!o){var d,h,p,f=[],g=[],m=s.length,v=a||function(t,n,i,r){for(var o=0,a=n.length;o<a;o++)e(t,n[o],i,r);return i}(n||"*",l.nodeType?[l]:l,[],a),y=!t||!a&&n?v:u(v,f,t,l,c),b=i?o||(a?t:m||r)?[]:s:y;if(i&&i(y,b,l,c),r)for(p=u(b,g),r(p,[],l,c),d=p.length;d--;)(h=p[d])&&(b[g[d]]=!(y[g[d]]=h));if(a)for(d=t&&b.length;d--;)(h=b[d])&&(a[f[d]]=!(s[f[d]]=h));else b=u(b===s?b.splice(m,b.length):b),o?o(null,s,b,c):V.apply(s,b)}}))}function d(t,e,n,i,r){var o,s,l,u,c,d=a(t);if(d.length,!i&&1===d.length){if(2<(s=d[0]=d[0].slice(0)).length&&"ID"===(l=s[0]).type&&9===e.nodeType&&!r&&v.relative[s[1].type]){if(!(e=v.find.ID(l.matches[0].replace(at,""),e,r)[0]))return n;t=t.slice(s.shift().length)}for(o=st.POS.test(t)?-1:s.length-1;0<=o&&(l=s[o],!v.relative[u=l.type]);o--)if((c=v.find[u])&&(i=c(l.matches[0].replace(at,""),it.test(s[0].type)&&e.parentNode||e,r))){if(s.splice(o,1),!(t=i.length&&s.join("")))return V.apply(n,B.call(i,0)),n;break}}return w(t,d)(i,e,r,n,it.test(t)),n}function h(){}function p(){var t={},e=[];return U((function(n,i){return e.push(n)>v.cacheLength&&delete t[e.shift()],t[n]=i}),t)}function f(t){var e=N.createElement("div");try{return t(e)}catch(t){return!1}}var g,m,v,y,b,x,w,C,_,E,M,D,S,P,j,T,A,k,I="undefined",L=("sizcache"+Math.random()).replace(".",""),O=String,N=t.document,z=N.documentElement,R=0,H=0,F=[].pop,V=[].push,B=[].slice,W=[].indexOf||function(t){for(var e=0,n=this.length;e<n;e++)if(this[e]===t)return e;return-1},U=function(t,e){return t[L]=null==e||e,t},q=p(),G=p(),Y=p(),X="[\\x20\\t\\r\\n\\f]",Q=(lt="(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+").replace("w","w#"),K=":("+lt+")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:"+(t="\\["+X+"*("+lt+")"+X+"*(?:([*^$|!~]?=)"+X+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+Q+")|)|)"+X+"*\\]")+")|[^:]|\\\\.)*|.*))\\)|)",J=(Q=":(even|odd|eq|gt|lt|nth|first|last)(?:\\("+X+"*((?:-\\d)?\\d*)"+X+"*\\)|)(?=[^-]|$)",new RegExp("^"+X+"+|((?:^|[^\\\\])(?:\\\\.)*)"+X+"+$","g")),Z=new RegExp("^"+X+"*,"+X+"*"),tt=new RegExp("^"+X+"*([\\x20\\t\\r\\n\\f>+~])"+X+"*"),et=new RegExp(K),nt=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,it=/[\x20\t\r\n\f]*[+~]/,rt=/h\d/i,ot=/input|select|textarea|button/i,at=/\\(?!\\)/g,st={ID:new RegExp("^#("+lt+")"),CLASS:new RegExp("^\\.("+lt+")"),NAME:new RegExp("^\\[name=['\"]?("+lt+")['\"]?\\]"),TAG:new RegExp("^("+lt.replace("w","w*")+")"),ATTR:new RegExp("^"+t),PSEUDO:new RegExp("^"+K),POS:new RegExp(Q,"i"),CHILD:new RegExp("^:(only|nth|first|last)-child(?:\\("+X+"*(even|odd|(([+-]|)(\\d*)n|)"+X+"*(?:([+-]|)"+X+"*(\\d+)|))"+X+"*\\)|)","i"),needsContext:new RegExp("^"+X+"*[>+~]|"+Q,"i")},lt=f((function(t){return t.appendChild(N.createComment("")),!t.getElementsByTagName("*").length})),ut=(t=f((function(t){return t.innerHTML="<a href='#'></a>",t.firstChild&&typeof t.firstChild.getAttribute!=I&&"#"===t.firstChild.getAttribute("href")})),f((function(t){return t.innerHTML="<select></select>","boolean"!=(t=typeof t.lastChild.getAttribute("multiple"))&&"string"!=t}))),ct=f((function(t){return t.innerHTML="<div class='hidden e'></div><div class='hidden'></div>",!(!t.getElementsByClassName||!t.getElementsByClassName("e").length)&&(t.lastChild.className="e",2===t.getElementsByClassName("e").length)}));Q=f((function(t){t.id=L+0,t.innerHTML="<a name='"+L+"'></a><div name='"+L+"'></div>",z.insertBefore(t,z.firstChild);var e=N.getElementsByName&&N.getElementsByName(L).length===2+N.getElementsByName(L+0).length;return m=!N.getElementById(L),z.removeChild(t),e}));try{B.call(z.childNodes,0)[0].nodeType}catch(t){B=function(t){for(var e,n=[];e=this[t];t++)n.push(e);return n}}e.matches=function(t,n){return e(t,null,null,n)},e.matchesSelector=function(t,n){return 0<e(n,null,null,[t]).length},y=e.getText=function(t){var e,n="",i=0,r=t.nodeType;if(r){if(1===r||9===r||11===r){if("string"==typeof t.textContent)return t.textContent;for(t=t.firstChild;t;t=t.nextSibling)n+=y(t)}else if(3===r||4===r)return t.nodeValue}else for(;e=t[i];i++)n+=y(e);return n},b=e.isXML=function(t){return!!(t=t&&(t.ownerDocument||t).documentElement)&&"HTML"!==t.nodeName},x=e.contains=z.contains?function(t,e){var n=9===t.nodeType?t.documentElement:t;return t===(e=e&&e.parentNode)||!!(e&&1===e.nodeType&&n.contains&&n.contains(e))}:z.compareDocumentPosition?function(t,e){return e&&!!(16&t.compareDocumentPosition(e))}:function(t,e){for(;e=e.parentNode;)if(e===t)return!0;return!1},e.attr=function(t,e){var n,i=b(t);return i||(e=e.toLowerCase()),(n=v.attrHandle[e])?n(t):i||ut?t.getAttribute(e):(n=t.getAttributeNode(e))?"boolean"==typeof t[e]?t[e]?e:null:n.specified?n.value:null:null},v=e.selectors={cacheLength:50,createPseudo:U,match:st,attrHandle:t?{}:{href:function(t){return t.getAttribute("href",2)},type:function(t){return t.getAttribute("type")}},find:{ID:m?function(t,e,n){if(typeof e.getElementById!=I&&!n)return(t=e.getElementById(t))&&t.parentNode?[t]:[]}:function(t,e,n){if(typeof e.getElementById!=I&&!n)return(e=e.getElementById(t))?e.id===t||typeof e.getAttributeNode!=I&&e.getAttributeNode("id").value===t?[e]:void 0:[]},TAG:lt?function(t,e){if(typeof e.getElementsByTagName!=I)return e.getElementsByTagName(t)}:function(t,e){var n=e.getElementsByTagName(t);if("*"!==t)return n;for(var i,r=[],o=0;i=n[o];o++)1===i.nodeType&&r.push(i);return r},NAME:Q&&function(t,e){if(typeof e.getElementsByName!=I)return e.getElementsByName(name)},CLASS:ct&&function(t,e,n){if(typeof e.getElementsByClassName!=I&&!n)return e.getElementsByClassName(t)}},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){return t[1]=t[1].replace(at,""),t[3]=(t[4]||t[5]||"").replace(at,""),"~="===t[2]&&(t[3]=" "+t[3]+" "),t.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1]?(t[2]||e.error(t[0]),t[3]=+(t[3]?t[4]+(t[5]||1):2*("even"===t[2]||"odd"===t[2])),t[4]=+(t[6]+t[7]||"odd"===t[2])):t[2]&&e.error(t[0]),t},PSEUDO:function(t){var e,n;return st.CHILD.test(t[0])?null:(t[3]?t[2]=t[3]:(e=t[4])&&(et.test(e)&&(n=a(e,!0))&&(n=e.indexOf(")",e.length-n)-e.length)&&(e=e.slice(0,n),t[0]=t[0].slice(0,n)),t[2]=e),t.slice(0,3))}},filter:{ID:m?function(t){return t=t.replace(at,""),function(e){return e.getAttribute("id")===t}}:function(t){return t=t.replace(at,""),function(e){return(e=typeof e.getAttributeNode!=I&&e.getAttributeNode("id"))&&e.value===t}},TAG:function(t){return"*"===t?function(){return!0}:(t=t.replace(at,"").toLowerCase(),function(e){return e.nodeName&&e.nodeName.toLowerCase()===t})},CLASS:function(t){var e=(e=q[L][t])||q(t,new RegExp("(^|"+X+")"+t+"("+X+"|$)"));return function(t){return e.test(t.className||typeof t.getAttribute!=I&&t.getAttribute("class")||"")}},ATTR:function(t,n,i){return function(r,o){return null==(r=e.attr(r,t))?"!="===n:!n||(r+="","="===n?r===i:"!="===n?r!==i:"^="===n?i&&0===r.indexOf(i):"*="===n?i&&-1<r.indexOf(i):"$="===n?i&&r.substr(r.length-i.length)===i:"~="===n?-1<(" "+r+" ").indexOf(i):"|="===n&&(r===i||r.substr(0,i.length+1)===i+"-"))}},CHILD:function(t,e,n,i){return"nth"===t?function(t){var e,r,o=t.parentNode;if(1===n&&0===i)return!0;if(o)for(r=0,e=o.firstChild;e&&(1!==e.nodeType||(r++,t!==e));e=e.nextSibling);return(r-=i)===n||r%n==0&&0<=r/n}:function(e){var n=e;switch(t){case"only":case"first":for(;n=n.previousSibling;)if(1===n.nodeType)return!1;if("first"===t)return!0;n=e;case"last":for(;n=n.nextSibling;)if(1===n.nodeType)return!1;return!0}}},PSEUDO:function(t,n){var i,r=v.pseudos[t]||v.setFilters[t.toLowerCase()]||e.error("unsupported pseudo: "+t);return r[L]?r(n):1<r.length?(i=[t,t,"",n],v.setFilters.hasOwnProperty(t.toLowerCase())?U((function(t,e){for(var i,o=r(t,n),a=o.length;a--;)t[i=W.call(t,o[a])]=!(e[i]=o[a])})):function(t){return r(t,0,i)}):r}},pseudos:{not:U((function(t){var e=[],n=[],i=w(t.replace(J,"$1"));return i[L]?U((function(t,e,n,r){for(var o,a=i(t,null,r,[]),s=t.length;s--;)(o=a[s])&&(t[s]=!(e[s]=o))})):function(t,r,o){return e[0]=t,i(e,null,o,n),!n.pop()}})),has:U((function(t){return function(n){return 0<e(t,n).length}})),contains:U((function(t){return function(e){return-1<(e.textContent||e.innerText||y(e)).indexOf(t)}})),enabled:function(t){return!1===t.disabled},disabled:function(t){return!0===t.disabled},checked:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&!!t.checked||"option"===e&&!!t.selected},selected:function(t){return t.parentNode&&t.parentNode.selectedIndex,!0===t.selected},parent:function(t){return!v.pseudos.empty(t)},empty:function(t){var e;for(t=t.firstChild;t;){if("@"<t.nodeName||3===(e=t.nodeType)||4===e)return!1;t=t.nextSibling}return!0},header:function(t){return rt.test(t.nodeName)},text:function(t){var e;return"input"===t.nodeName.toLowerCase()&&"text"===(e=t.type)&&(null==(t=t.getAttribute("type"))||t.toLowerCase()===e)},radio:n("radio"),checkbox:n("checkbox"),file:n("file"),password:n("password"),image:n("image"),submit:i("submit"),reset:i("reset"),button:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&"button"===t.type||"button"===e},input:function(t){return ot.test(t.nodeName)},focus:function(t){var e=t.ownerDocument;return t===e.activeElement&&(!e.hasFocus||e.hasFocus())&&(!!t.type||!!t.href)},active:function(t){return t===t.ownerDocument.activeElement},first:r((function(t,e,n){return[0]})),last:r((function(t,e,n){return[e-1]})),eq:r((function(t,e,n){return[n<0?n+e:n]})),even:r((function(t,e,n){for(var i=0;i<e;i+=2)t.push(i);return t})),odd:r((function(t,e,n){for(var i=1;i<e;i+=2)t.push(i);return t})),lt:r((function(t,e,n){for(var i=n<0?n+e:n;0<=--i;)t.push(i);return t})),gt:r((function(t,e,n){for(var i=n<0?n+e:n;++i<e;)t.push(i);return t}))}},C=z.compareDocumentPosition?function(t,e){return t===e?(_=!0,0):(t.compareDocumentPosition&&e.compareDocumentPosition?4&t.compareDocumentPosition(e):t.compareDocumentPosition)?-1:1}:function(t,e){if(t===e)return _=!0,0;if(t.sourceIndex&&e.sourceIndex)return t.sourceIndex-e.sourceIndex;var n=[],i=[],r=t.parentNode,a=e.parentNode,s=r;if(r===a)return o(t,e);if(!r)return-1;if(!a)return 1;for(;s;)n.unshift(s),s=s.parentNode;for(s=a;s;)i.unshift(s),s=s.parentNode;for(var l=n.length,u=i.length,c=0;c<l&&c<u;c++)if(n[c]!==i[c])return o(n[c],i[c]);return c===l?o(t,i[c],-1):o(n[c],e,1)},[0,0].sort(C),M=!_,e.uniqueSort=function(t){var e,n=1;if(_=M,t.sort(C),_)for(;e=t[n];n++)e===t[n-1]&&t.splice(n--,1);return t},e.error=function(t){throw new Error("Syntax error, unrecognized expression: "+t)},w=e.compile=function(t,n){var i,r=[],o=[],d=Y[L][t];if(!d){for(i=(n=n||a(t)).length;i--;)((d=function t(e){for(var n,i,r,o=e.length,a=v.relative[e[0].type],u=a||v.relative[" "],d=a?1:0,h=s((function(t){return t===n}),u,!0),p=s((function(t){return-1<W.call(n,t)}),u,!0),f=[function(t,e,i){return!a&&(i||e!==E)||((n=e).nodeType?h:p)(t,e,i)}];d<o;d++)if(i=v.relative[e[d].type])f=[s(l(f),i)];else{if((i=v.filter[e[d].type].apply(null,e[d].matches))[L]){for(r=++d;r<o&&!v.relative[e[r].type];r++);return c(1<d&&l(f),1<d&&e.slice(0,d-1).join("").replace(J,"$1"),i,d<r&&t(e.slice(d,r)),r<o&&t(e=e.slice(r)),r<o&&e.join(""))}f.push(i)}return l(f)}(n[i]))[L]?r:o).push(d);d=Y(t,function(t,n){function i(a,s,l,c,d){var h,p,f,m=[],y=0,b="0",x=a&&[],w=null!=d,C=E,_=a||o&&v.find.TAG("*",d&&s.parentNode||s),M=R+=null==C?1:Math.E;for(w&&(E=s!==N&&s,g=i.el);null!=(h=_[b]);b++){if(o&&h){for(p=0;f=t[p];p++)if(f(h,s,l)){c.push(h);break}w&&(R=M,g=++i.el)}r&&((h=!f&&h)&&y--,a&&x.push(h))}if(y+=b,r&&b!==y){for(p=0;f=n[p];p++)f(x,m,s,l);if(a){if(0<y)for(;b--;)x[b]||m[b]||(m[b]=F.call(c));m=u(m)}V.apply(c,m),w&&!a&&0<m.length&&1<y+n.length&&e.uniqueSort(c)}return w&&(R=M,E=C),x}var r=0<n.length,o=0<t.length;return i.el=0,r?U(i):i}(o,r))}return d},N.querySelectorAll&&(S=d,P=/'|\\/g,j=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,T=[":focus"],A=[":active",":focus"],k=z.matchesSelector||z.mozMatchesSelector||z.webkitMatchesSelector||z.oMatchesSelector||z.msMatchesSelector,f((function(t){t.innerHTML="<select><option selected=''></option></select>",t.querySelectorAll("[selected]").length||T.push("\\["+X+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),t.querySelectorAll(":checked").length||T.push(":checked")})),f((function(t){t.innerHTML="<p test=''></p>",t.querySelectorAll("[test^='']").length&&T.push("[*^$]="+X+"*(?:\"\"|'')"),t.innerHTML="<input type='hidden'/>",t.querySelectorAll(":enabled").length||T.push(":enabled",":disabled")})),T=new RegExp(T.join("|")),d=function(t,e,n,i,r){if(!(i||r||T&&T.test(t))){var o,s,l=!0,u=L,c=e,d=9===e.nodeType&&t;if(1===e.nodeType&&"object"!==e.nodeName.toLowerCase()){for(o=a(t),(l=e.getAttribute("id"))?u=l.replace(P,"\\$&"):e.setAttribute("id",u),u="[id='"+u+"'] ",s=o.length;s--;)o[s]=u+o[s].join("");c=it.test(t)&&e.parentNode||e,d=o.join(",")}if(d)try{return V.apply(n,B.call(c.querySelectorAll(d),0)),n}catch(t){}finally{l||e.removeAttribute("id")}}return S(t,e,n,i,r)},k&&(f((function(t){D=k.call(t,"div");try{k.call(t,"[test!='']:sizzle"),A.push("!=",K)}catch(t){}})),A=new RegExp(A.join("|")),e.matchesSelector=function(t,n){if(n=n.replace(j,"='$1']"),!(b(t)||A.test(n)||T&&T.test(n)))try{var i=k.call(t,n);if(i||D||t.document&&11!==t.document.nodeType)return i}catch(t){}return 0<e(n,null,null,[t]).length})),v.pseudos.nth=v.pseudos.eq,v.filters=h.prototype=v.pseudos,v.setFilters=new h,e.attr=$.attr,$.find=e,$.expr=e.selectors,$.expr[":"]=$.expr.pseudos,$.unique=e.uniqueSort,$.text=e.getText,$.isXMLDoc=e.isXML,$.contains=e.contains}(t);var Mt=/Until$/,Dt=/^(?:parents|prev(?:Until|All))/,St=/^.[^:#\[\.,]*$/,Pt=$.expr.match.needsContext,jt={children:!0,contents:!0,next:!0,prev:!0};$.fn.extend({find:function(t){var e,n,i,r,o,a,s=this;if("string"!=typeof t)return $(t).filter((function(){for(e=0,n=s.length;e<n;e++)if($.contains(s[e],this))return!0}));for(a=this.pushStack("","find",t),e=0,n=this.length;e<n;e++)if(i=a.length,$.find(t,this[e],a),0<e)for(r=i;r<a.length;r++)for(o=0;o<i;o++)if(a[o]===a[r]){a.splice(r--,1);break}return a},has:function(t){var e,n=$(t,this),i=n.length;return this.filter((function(){for(e=0;e<i;e++)if($.contains(this,n[e]))return!0}))},not:function(t){return this.pushStack(l(this,t,!1),"not",t)},filter:function(t){return this.pushStack(l(this,t,!0),"filter",t)},is:function(t){return!!t&&("string"==typeof t?Pt.test(t)?0<=$(t,this.context).index(this[0]):0<$.filter(t,this).length:0<this.filter(t).length)},closest:function(t,e){for(var n,i=0,r=this.length,o=[],a=Pt.test(t)||"string"!=typeof t?$(t,e||this.context):0;i<r;i++)for(n=this[i];n&&n.ownerDocument&&n!==e&&11!==n.nodeType;){if(a?-1<a.index(n):$.find.matchesSelector(n,t)){o.push(n);break}n=n.parentNode}return o=1<o.length?$.unique(o):o,this.pushStack(o,"closest",t)},index:function(t){return t?"string"==typeof t?$.inArray(this[0],$(t)):$.inArray(t.jquery?t[0]:t,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(t,e){return e="string"==typeof t?$(t,e):$.makeArray(t&&t.nodeType?[t]:t),t=$.merge(this.get(),e),this.pushStack(a(e[0])||a(t[0])?t:$.unique(t))},addBack:function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}}),$.fn.andSelf=$.fn.addBack,$.each({parent:function(t){return(t=t.parentNode)&&11!==t.nodeType?t:null},parents:function(t){return $.dir(t,"parentNode")},parentsUntil:function(t,e,n){return $.dir(t,"parentNode",n)},next:function(t){return s(t,"nextSibling")},prev:function(t){return s(t,"previousSibling")},nextAll:function(t){return $.dir(t,"nextSibling")},prevAll:function(t){return $.dir(t,"previousSibling")},nextUntil:function(t,e,n){return $.dir(t,"nextSibling",n)},prevUntil:function(t,e,n){return $.dir(t,"previousSibling",n)},siblings:function(t){return $.sibling((t.parentNode||{}).firstChild,t)},children:function(t){return $.sibling(t.firstChild)},contents:function(t){return $.nodeName(t,"iframe")?t.contentDocument||t.contentWindow.document:$.merge([],t.childNodes)}},(function(t,e){$.fn[t]=function(n,i){var r=$.map(this,e,n);return(i=Mt.test(t)?i:n)&&"string"==typeof i&&(r=$.filter(i,r)),r=1<this.length&&!jt[t]?$.unique(r):r,1<this.length&&Dt.test(t)&&(r=r.reverse()),this.pushStack(r,t,H.call(arguments).join(","))}})),$.extend({filter:function(t,e,n){return n&&(t=":not("+t+")"),1===e.length?$.find.matchesSelector(e[0],t)?[e[0]]:[]:$.find.matches(t,e)},dir:function(t,n,i){for(var r=[],o=t[n];o&&9!==o.nodeType&&(i===e||1!==o.nodeType||!$(o).is(i));)1===o.nodeType&&r.push(o),o=o[n];return r},sibling:function(t,e){for(var n=[];t;t=t.nextSibling)1===t.nodeType&&t!==e&&n.push(t);return n}});var Tt,At="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",kt=/ jQuery\d+="(?:null|\d+)"/g,It=/^\s+/,Lt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,Ot=/<([\w:]+)/,Nt=/<tbody/i,zt=/<|&#?\w+;/,Rt=/<(?:script|style|link)/i,Ht=/<(?:script|object|embed|option|style)/i,Ft=new RegExp("<(?:"+At+")[\\s/>]","i"),Vt=/^(?:checkbox|radio)$/,Bt=/checked\s*(?:[^=]|=\s*.checked.)/i,Wt=/\/(java|ecma)script/i,$t=/^\s*<!(?:\[CDATA\[|\-\-)|[\]\-]{2}>\s*$/g,Ut={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]},qt=u(I),Gt=qt.appendChild(I.createElement("div"));Ut.optgroup=Ut.option,Ut.tbody=Ut.tfoot=Ut.colgroup=Ut.caption=Ut.thead,Ut.th=Ut.td,$.support.htmlSerialize||(Ut._default=[1,"X<div>","</div>"]),$.fn.extend({text:function(t){return $.access(this,(function(t){return t===e?$.text(this):this.empty().append((this[0]&&this[0].ownerDocument||I).createTextNode(t))}),null,t,arguments.length)},wrapAll:function(t){return $.isFunction(t)?this.each((function(e){$(this).wrapAll(t.call(this,e))})):(this[0]&&(e=$(t,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&e.insertBefore(this[0]),e.map((function(){for(var t=this;t.firstChild&&1===t.firstChild.nodeType;)t=t.firstChild;return t})).append(this)),this);var e},wrapInner:function(t){return $.isFunction(t)?this.each((function(e){$(this).wrapInner(t.call(this,e))})):this.each((function(){var e=$(this),n=e.contents();n.length?n.wrapAll(t):e.append(t)}))},wrap:function(t){var e=$.isFunction(t);return this.each((function(n){$(this).wrapAll(e?t.call(this,n):t)}))},unwrap:function(){return this.parent().each((function(){$.nodeName(this,"body")||$(this).replaceWith(this.childNodes)})).end()},append:function(){return this.domManip(arguments,!0,(function(t){1!==this.nodeType&&11!==this.nodeType||this.appendChild(t)}))},prepend:function(){return this.domManip(arguments,!0,(function(t){1!==this.nodeType&&11!==this.nodeType||this.insertBefore(t,this.firstChild)}))},before:function(){if(!a(this[0]))return this.domManip(arguments,!1,(function(t){this.parentNode.insertBefore(t,this)}));if(arguments.length){var t=$.clean(arguments);return this.pushStack($.merge(t,this),"before",this.selector)}},after:function(){if(!a(this[0]))return this.domManip(arguments,!1,(function(t){this.parentNode.insertBefore(t,this.nextSibling)}));if(arguments.length){var t=$.clean(arguments);return this.pushStack($.merge(this,t),"after",this.selector)}},remove:function(t,e){for(var n,i=0;null!=(n=this[i]);i++)t&&!$.filter(t,[n]).length||(e||1!==n.nodeType||($.cleanData(n.getElementsByTagName("*")),$.cleanData([n])),n.parentNode&&n.parentNode.removeChild(n));return this},empty:function(){for(var t,e=0;null!=(t=this[e]);e++)for(1===t.nodeType&&$.cleanData(t.getElementsByTagName("*"));t.firstChild;)t.removeChild(t.firstChild);return this},clone:function(t,e){return t=null!=t&&t,e=null==e?t:e,this.map((function(){return $.clone(this,t,e)}))},html:function(t){return $.access(this,(function(t){var n=this[0]||{},i=0,r=this.length;if(t===e)return 1===n.nodeType?n.innerHTML.replace(kt,""):e;if("string"==typeof t&&!Rt.test(t)&&($.support.htmlSerialize||!Ft.test(t))&&($.support.leadingWhitespace||!It.test(t))&&!Ut[(Ot.exec(t)||["",""])[1].toLowerCase()]){t=t.replace(Lt,"<$1></$2>");try{for(;i<r;i++)1===(n=this[i]||{}).nodeType&&($.cleanData(n.getElementsByTagName("*")),n.innerHTML=t);n=0}catch(t){}}n&&this.empty().append(t)}),null,t,arguments.length)},replaceWith:function(t){return a(this[0])?this.length?this.pushStack($($.isFunction(t)?t():t),"replaceWith",t):this:$.isFunction(t)?this.each((function(e){var n=$(this),i=n.html();n.replaceWith(t.call(this,e,i))})):("string"!=typeof t&&(t=$(t).detach()),this.each((function(){var e=this.nextSibling,n=this.parentNode;$(this).remove(),e?$(e).before(t):$(n).append(t)})))},detach:function(t){return this.remove(t,!0)},domManip:function(t,n,i){var r,o,a,s,l,u,c=0,d=(t=[].concat.apply([],t))[0],h=[],p=this.length;if(!$.support.checkClone&&1<p&&"string"==typeof d&&Bt.test(d))return this.each((function(){$(this).domManip(t,n,i)}));if($.isFunction(d))return this.each((function(r){var o=$(this);t[0]=d.call(this,r,n?o.html():e),o.domManip(t,n,i)}));if(this[0]){if(o=(a=(r=$.buildFragment(t,this,h)).fragment).firstChild,1===a.childNodes.length&&(a=o),o)for(n=n&&$.nodeName(o,"tr"),s=r.cacheable||p-1;c<p;c++)i.call(n&&$.nodeName(this[c],"table")?(u="tbody",(l=this[c]).getElementsByTagName(u)[0]||l.appendChild(l.ownerDocument.createElement(u))):this[c],c===s?a:$.clone(a,!0,!0));a=o=null,h.length&&$.each(h,(function(t,e){e.src?$.ajax?$.ajax({url:e.src,type:"GET",dataType:"script",async:!1,global:!1,throws:!0}):$.error("no ajax"):$.globalEval((e.text||e.textContent||e.innerHTML||"").replace($t,"")),e.parentNode&&e.parentNode.removeChild(e)}))}return this}}),$.buildFragment=function(t,n,i){var r,o,a,s=t[0];return n=(n=!(n=n||I).nodeType&&n[0]||n).ownerDocument||n,!(1===t.length&&"string"==typeof s&&s.length<512&&n===I&&"<"===s.charAt(0))||Ht.test(s)||!$.support.checkClone&&Bt.test(s)||!$.support.html5Clone&&Ft.test(s)||(o=!0,a=(r=$.fragments[s])!==e),r||(r=n.createDocumentFragment(),$.clean(t,n,r,i),o&&($.fragments[s]=a&&r)),{fragment:r,cacheable:o}},$.fragments={},$.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},(function(t,e){$.fn[t]=function(n){var i,r=0,o=[],a=$(n),s=a.length;if((null==(n=1===this.length&&this[0].parentNode)||n&&11===n.nodeType&&1===n.childNodes.length)&&1===s)return a[e](this[0]),this;for(;r<s;r++)i=(0<r?this.clone(!0):this).get(),$(a[r])[e](i),o=o.concat(i);return this.pushStack(o,t,a.selector)}})),$.extend({clone:function(t,e,n){var i,r,o,a;if($.support.html5Clone||$.isXMLDoc(t)||!Ft.test("<"+t.nodeName+">")?a=t.cloneNode(!0):(Gt.innerHTML=t.outerHTML,Gt.removeChild(a=Gt.firstChild)),!($.support.noCloneEvent&&$.support.noCloneChecked||1!==t.nodeType&&11!==t.nodeType||$.isXMLDoc(t)))for(d(t,a),i=h(t),r=h(a),o=0;i[o];++o)r[o]&&d(i[o],r[o]);if(e&&(c(t,a),n))for(i=h(t),r=h(a),o=0;i[o];++o)c(i[o],r[o]);return i=r=null,a},clean:function(t,e,n,i){var r,o,a,s,l,c,d,h,f,g,m,v=e===I&&qt,y=[];for(e&&void 0!==e.createDocumentFragment||(e=I),r=0;null!=(a=t[r]);r++)if("number"==typeof a&&(a+=""),a){if("string"==typeof a)if(zt.test(a)){for(v=v||u(e),d=e.createElement("div"),v.appendChild(d),a=a.replace(Lt,"<$1></$2>"),s=(Ot.exec(a)||["",""])[1].toLowerCase(),c=(l=Ut[s]||Ut._default)[0],d.innerHTML=l[1]+a+l[2];c--;)d=d.lastChild;if(!$.support.tbody)for(h=Nt.test(a),o=(f="table"!==s||h?"<table>"!==l[1]||h?[]:d.childNodes:d.firstChild&&d.firstChild.childNodes).length-1;0<=o;--o)$.nodeName(f[o],"tbody")&&!f[o].childNodes.length&&f[o].parentNode.removeChild(f[o]);!$.support.leadingWhitespace&&It.test(a)&&d.insertBefore(e.createTextNode(It.exec(a)[0]),d.firstChild),a=d.childNodes,d.parentNode.removeChild(d)}else a=e.createTextNode(a);a.nodeType?y.push(a):$.merge(y,a)}if(d&&(a=d=v=null),!$.support.appendChecked)for(r=0;null!=(a=y[r]);r++)$.nodeName(a,"input")?p(a):void 0!==a.getElementsByTagName&&$.grep(a.getElementsByTagName("input"),p);if(n)for(g=function(t){if(!t.type||Wt.test(t.type))return i?i.push(t.parentNode?t.parentNode.removeChild(t):t):n.appendChild(t)},r=0;null!=(a=y[r]);r++)$.nodeName(a,"script")&&g(a)||(n.appendChild(a),void 0!==a.getElementsByTagName&&(m=$.grep($.merge([],a.getElementsByTagName("script")),g),y.splice.apply(y,[r+1,0].concat(m)),r+=m.length));return y},cleanData:function(t,e){for(var n,i,r,o,a=0,s=$.expando,l=$.cache,u=$.support.deleteExpando,c=$.event.special;null!=(r=t[a]);a++)if((e||$.acceptData(r))&&(n=(i=r[s])&&l[i])){if(n.events)for(o in n.events)c[o]?$.event.remove(r,o):$.removeEvent(r,o,n.handle);l[i]&&(delete l[i],u?delete r[s]:r.removeAttribute?r.removeAttribute(s):r[s]=null,$.deletedIds.push(i))}}}),$.uaMatch=function(t){return t=t.toLowerCase(),{browser:(t=/(chrome)[ \/]([\w.]+)/.exec(t)||/(webkit)[ \/]([\w.]+)/.exec(t)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(t)||/(msie) ([\w.]+)/.exec(t)||t.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(t)||[])[1]||"",version:t[2]||"0"}},Tt={},(O=$.uaMatch(O.userAgent)).browser&&(Tt[O.browser]=!0,Tt.version=O.version),Tt.chrome?Tt.webkit=!0:Tt.webkit&&(Tt.safari=!0),$.browser=Tt,$.sub=function(){function t(e,n){return new t.fn.init(e,n)}$.extend(!0,t,this),t.superclass=this,((t.fn=t.prototype=this()).constructor=t).sub=this.sub,t.fn.init=function(n,i){return i&&i instanceof $&&!(i instanceof t)&&(i=t(i)),$.fn.init.call(this,n,i,e)},t.fn.init.prototype=t.fn;var e=t(I);return t};var Yt,Xt,Qt,Kt=/alpha\([^)]*\)/i,Jt=/opacity=([^)]*)/,Zt=/^(top|right|bottom|left)$/,te=/^(none|table(?!-c[ea]).+)/,ee=/^margin/,ne=new RegExp("^("+U+")(.*)$","i"),ie=new RegExp("^("+U+")(?!px)[a-z%]+$","i"),re=new RegExp("^([-+])=("+U+")","i"),oe={},ae={position:"absolute",visibility:"hidden",display:"block"},se={letterSpacing:0,fontWeight:400},le=["Top","Right","Bottom","Left"],ue=["Webkit","O","Moz","ms"],ce=$.fn.toggle;$.fn.extend({css:function(t,n){return $.access(this,(function(t,n,i){return i!==e?$.style(t,n,i):$.css(t,n)}),t,n,1<arguments.length)},show:function(){return m(this,!0)},hide:function(){return m(this)},toggle:function(t,e){var n="boolean"==typeof t;return $.isFunction(t)&&$.isFunction(e)?ce.apply(this,arguments):this.each((function(){(n?t:g(this))?$(this).show():$(this).hide()}))}}),$.extend({cssHooks:{opacity:{get:function(t,e){if(e)return""===(t=Yt(t,"opacity"))?"1":t}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{float:$.support.cssFloat?"cssFloat":"styleFloat"},style:function(t,n,i,r){if(t&&3!==t.nodeType&&8!==t.nodeType&&t.style){var o,a,s,l=$.camelCase(n),u=t.style;if(n=$.cssProps[l]||($.cssProps[l]=f(u,l)),s=$.cssHooks[n]||$.cssHooks[l],i===e)return s&&"get"in s&&(o=s.get(t,!1,r))!==e?o:u[n];if("string"==(a=typeof i)&&(o=re.exec(i))&&(i=(o[1]+1)*o[2]+parseFloat($.css(t,n)),a="number"),!(null==i||"number"===a&&isNaN(i)||("number"!==a||$.cssNumber[l]||(i+="px"),s&&"set"in s&&(i=s.set(t,i,r))===e)))try{u[n]=i}catch(t){}}},css:function(t,n,i,r){var o,a=$.camelCase(n);return n=$.cssProps[a]||($.cssProps[a]=f(t.style,a)),"normal"===(o=(o=(a=$.cssHooks[n]||$.cssHooks[a])&&"get"in a?a.get(t,!0,r):o)===e?Yt(t,n):o)&&n in se&&(o=se[n]),i||r!==e?(r=parseFloat(o),i||$.isNumeric(r)?r||0:o):o},swap:function(t,e,n){var i,r={};for(i in e)r[i]=t.style[i],t.style[i]=e[i];for(i in n=n.call(t),e)t.style[i]=r[i];return n}}),t.getComputedStyle?Yt=function(e,n){var i,r,o=t.getComputedStyle(e,null),a=e.style;return o&&(""!==(i=o[n])||$.contains(e.ownerDocument,e)||(i=$.style(e,n)),ie.test(i)&&ee.test(n)&&(r=a.width,e=a.minWidth,n=a.maxWidth,a.minWidth=a.maxWidth=a.width=i,i=o.width,a.width=r,a.minWidth=e,a.maxWidth=n)),i}:I.documentElement.currentStyle&&(Yt=function(t,e){var n,i,r=t.currentStyle&&t.currentStyle[e],o=t.style;return null==r&&o&&o[e]&&(r=o[e]),ie.test(r)&&!Zt.test(e)&&(n=o.left,(i=t.runtimeStyle&&t.runtimeStyle.left)&&(t.runtimeStyle.left=t.currentStyle.left),o.left="fontSize"===e?"1em":r,r=o.pixelLeft+"px",o.left=n,i&&(t.runtimeStyle.left=i)),""===r?"auto":r}),$.each(["height","width"],(function(t,e){$.cssHooks[e]={get:function(t,n,i){if(n)return 0===t.offsetWidth&&te.test(Yt(t,"display"))?$.swap(t,ae,(function(){return b(t,e,i)})):b(t,e,i)},set:function(t,n,i){return v(0,n,i?y(t,e,i,$.support.boxSizing&&"border-box"===$.css(t,"boxSizing")):0)}}})),$.support.opacity||($.cssHooks.opacity={get:function(t,e){return Jt.test((e&&t.currentStyle?t.currentStyle:t.style).filter||"")?.01*parseFloat(RegExp.$1)+"":e?"1":""},set:function(t,e){var n=t.style,i=t.currentStyle,r=$.isNumeric(e)?"alpha(opacity="+100*e+")":"";t=i&&i.filter||n.filter||"";(n.zoom=1)<=e&&""===$.trim(t.replace(Kt,""))&&n.removeAttribute&&(n.removeAttribute("filter"),i&&!i.filter)||(n.filter=Kt.test(t)?t.replace(Kt,r):t+" "+r)}}),$((function(){$.support.reliableMarginRight||($.cssHooks.marginRight={get:function(t,e){return $.swap(t,{display:"inline-block"},(function(){if(e)return Yt(t,"marginRight")}))}}),!$.support.pixelPosition&&$.fn.position&&$.each(["top","left"],(function(t,e){$.cssHooks[e]={get:function(t,n){if(n)return n=Yt(t,e),ie.test(n)?$(t).position()[e]+"px":n}}}))})),$.expr&&$.expr.filters&&($.expr.filters.hidden=function(t){return 0===t.offsetWidth&&0===t.offsetHeight||!$.support.reliableHiddenOffsets&&"none"===(t.style&&t.style.display||Yt(t,"display"))},$.expr.filters.visible=function(t){return!$.expr.filters.hidden(t)}),$.each({margin:"",padding:"",border:"Width"},(function(t,e){$.cssHooks[t+e]={expand:function(n){for(var i="string"==typeof n?n.split(" "):[n],r={},o=0;o<4;o++)r[t+le[o]+e]=i[o]||i[o-2]||i[0];return r}},ee.test(t)||($.cssHooks[t+e].set=v)}));var de=/%20/g,he=/\[\]$/,pe=/\r?\n/g,fe=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,ge=/^(?:select|textarea)/i;$.fn.extend({serialize:function(){return $.param(this.serializeArray())},serializeArray:function(){return this.map((function(){return this.elements?$.makeArray(this.elements):this})).filter((function(){return this.name&&!this.disabled&&(this.checked||ge.test(this.nodeName)||fe.test(this.type))})).map((function(t,e){var n=$(this).val();return null==n?null:$.isArray(n)?$.map(n,(function(t,n){return{name:e.name,value:t.replace(pe,"\r\n")}})):{name:e.name,value:n.replace(pe,"\r\n")}})).get()}}),$.param=function(t,n){function i(t,e){e=$.isFunction(e)?e():null==e?"":e,o[o.length]=encodeURIComponent(t)+"="+encodeURIComponent(e)}var r,o=[];if(n===e&&(n=$.ajaxSettings&&$.ajaxSettings.traditional),$.isArray(t)||t.jquery&&!$.isPlainObject(t))$.each(t,(function(){i(this.name,this.value)}));else for(r in t)!function t(e,n,i,r){if($.isArray(n))$.each(n,(function(n,o){i||he.test(e)?r(e,o):t(e+"["+("object"==typeof o?n:"")+"]",o,i,r)}));else if(i||"object"!==$.type(n))r(e,n);else for(var o in n)t(e+"["+o+"]",n[o],i,r)}(r,t[r],n,i);return o.join("&").replace(de,"+")};var me,ve=/#.*$/,ye=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,be=/^(?:GET|HEAD)$/,xe=/^\/\//,we=/\?/,Ce=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,_e=/([?&])_=[^&]*/,Ee=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,Me=$.fn.load,De={},Se={},Pe=["*/"]+["*"];try{Le=L.href}catch(m){(Le=I.createElement("a")).href="",Le=Le.href}me=Ee.exec(Le.toLowerCase())||[],$.fn.load=function(t,n,i){if("string"!=typeof t&&Me)return Me.apply(this,arguments);if(!this.length)return this;var r,o,a,s=this,l=t.indexOf(" ");return 0<=l&&(r=t.slice(l,t.length),t=t.slice(0,l)),$.isFunction(n)?(i=n,n=e):n&&"object"==typeof n&&(o="POST"),$.ajax({url:t,type:o,dataType:"html",data:n,complete:function(t,e){i&&s.each(i,a||[t.responseText,e,t])}}).done((function(t){a=arguments,s.html(r?$("<div>").append(t.replace(Ce,"")).find(r):t)})),this},$.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),(function(t,e){$.fn[e]=function(t){return this.on(e,t)}})),$.each(["get","post"],(function(t,n){$[n]=function(t,i,r,o){return $.isFunction(i)&&(o=o||r,r=i,i=e),$.ajax({type:n,url:t,data:i,success:r,dataType:o})}})),$.extend({getScript:function(t,n){return $.get(t,e,n,"script")},getJSON:function(t,e,n){return $.get(t,e,n,"json")},ajaxSetup:function(t,e){return e?_(t,$.ajaxSettings):(e=t,t=$.ajaxSettings),_(t,e),t},ajaxSettings:{url:Le,isLocal:/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/.test(me[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":Pe},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":t.String,"text html":!0,"text json":$.parseJSON,"text xml":$.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:w(De),ajaxTransport:w(Se),ajax:function(t,n){function i(t,n,i,a){var c,d,y,b,w=n;2!==x&&(x=2,l&&clearTimeout(l),s=e,o=a||"",_.readyState=0<t?4:0,i&&(b=function(t,n,i){var r,o,a,s,l=t.contents,u=t.dataTypes,c=t.responseFields;for(o in c)o in i&&(n[c[o]]=i[o]);for(;"*"===u[0];)u.shift(),r===e&&(r=t.mimeType||n.getResponseHeader("content-type"));if(r)for(o in l)if(l[o]&&l[o].test(r)){u.unshift(o);break}if(u[0]in i)a=u[0];else{for(o in i){if(!u[0]||t.converters[o+" "+u[0]]){a=o;break}s=s||o}a=a||s}if(a)return a!==u[0]&&u.unshift(a),i[a]}(h,_,i)),200<=t&&t<300||304===t?(h.ifModified&&((i=_.getResponseHeader("Last-Modified"))&&($.lastModified[r]=i),(i=_.getResponseHeader("Etag"))&&($.etag[r]=i)),c=304===t?(w="notmodified",!0):(w=(c=function(t,e){var n,i,r,o,a=t.dataTypes.slice(),s=a[0],l={},u=0;if(t.dataFilter&&(e=t.dataFilter(e,t.dataType)),a[1])for(n in t.converters)l[n.toLowerCase()]=t.converters[n];for(;r=a[++u];)if("*"!==r){if("*"!==s&&s!==r){if(!(n=l[s+" "+r]||l["* "+r]))for(i in l)if((o=i.split(" "))[1]===r&&(n=l[s+" "+o[0]]||l["* "+o[0]])){!0===n?n=l[i]:!0!==l[i]&&(r=o[0],a.splice(u--,0,r));break}if(!0!==n)if(n&&t.throws)e=n(e);else try{e=n(e)}catch(t){return{state:"parsererror",error:n?t:"No conversion from "+s+" to "+r}}}s=r}return{state:"success",data:e}}(h,b)).state,d=c.data,!(y=c.error))):(y=w)&&!t||(w="error",t<0&&(t=0)),_.status=t,_.statusText=(n||w)+"",c?g.resolveWith(p,[d,w,_]):g.rejectWith(p,[_,w,y]),_.statusCode(v),v=e,u&&f.trigger("ajax"+(c?"Success":"Error"),[_,h,c?d:y]),m.fireWith(p,[_,w]),u&&(f.trigger("ajaxComplete",[_,h]),--$.active||$.event.trigger("ajaxStop")))}"object"==typeof t&&(n=t,t=e);var r,o,a,s,l,u,c,d,h=$.ajaxSetup({},n=n||{}),p=h.context||h,f=p!==h&&(p.nodeType||p instanceof $)?$(p):$.event,g=$.Deferred(),m=$.Callbacks("once memory"),v=h.statusCode||{},y={},b={},x=0,w="canceled",_={readyState:0,setRequestHeader:function(t,e){var n;return x||(n=t.toLowerCase(),t=b[n]=b[n]||t,y[t]=e),this},getAllResponseHeaders:function(){return 2===x?o:null},getResponseHeader:function(t){var n;if(2===x){if(!a)for(a={};n=ye.exec(o);)a[n[1].toLowerCase()]=n[2];n=a[t.toLowerCase()]}return n===e?null:n},overrideMimeType:function(t){return x||(h.mimeType=t),this},abort:function(t){return t=t||w,s&&s.abort(t),i(0,t),this}};if(g.promise(_),_.success=_.done,_.error=_.fail,_.complete=m.add,_.statusCode=function(t){if(t)if(x<2)for(var e in t)v[e]=[v[e],t[e]];else e=t[_.status],_.always(e);return this},h.url=((t||h.url)+"").replace(ve,"").replace(xe,me[1]+"//"),h.dataTypes=$.trim(h.dataType||"*").toLowerCase().split(G),null==h.crossDomain&&(d=Ee.exec(h.url.toLowerCase())||!1,h.crossDomain=d&&d.join(":")+(d[3]?"":"http:"===d[1]?80:443)!==me.join(":")+(me[3]?"":"http:"===me[1]?80:443)),h.data&&h.processData&&"string"!=typeof h.data&&(h.data=$.param(h.data,h.traditional)),C(De,h,n,_),2===x)return _;for(c in u=h.global,h.type=h.type.toUpperCase(),h.hasContent=!be.test(h.type),u&&0==$.active++&&$.event.trigger("ajaxStart"),h.hasContent||(h.data&&(h.url+=(we.test(h.url)?"&":"?")+h.data,delete h.data),r=h.url,!1===h.cache&&(t=$.now(),d=h.url.replace(_e,"$1_="+t),h.url=d+(d===h.url?(we.test(h.url)?"&":"?")+"_="+t:""))),(h.data&&h.hasContent&&!1!==h.contentType||n.contentType)&&_.setRequestHeader("Content-Type",h.contentType),h.ifModified&&(r=r||h.url,$.lastModified[r]&&_.setRequestHeader("If-Modified-Since",$.lastModified[r]),$.etag[r]&&_.setRequestHeader("If-None-Match",$.etag[r])),_.setRequestHeader("Accept",h.dataTypes[0]&&h.accepts[h.dataTypes[0]]?h.accepts[h.dataTypes[0]]+("*"!==h.dataTypes[0]?", "+Pe+"; q=0.01":""):h.accepts["*"]),h.headers)_.setRequestHeader(c,h.headers[c]);if(!h.beforeSend||!1!==h.beforeSend.call(p,_,h)&&2!==x){for(c in w="abort",{success:1,error:1,complete:1})_[c](h[c]);if(s=C(Se,h,n,_)){_.readyState=1,u&&f.trigger("ajaxSend",[_,h]),h.async&&0<h.timeout&&(l=setTimeout((function(){_.abort("timeout")}),h.timeout));try{x=1,s.send(y,i)}catch(t){if(!(x<2))throw t;i(-1,t)}}else i(-1,"No Transport");return _}return _.abort()},active:0,lastModified:{},etag:{}});var je=[],Te=/\?/,Ae=/(=)\?(?=&|$)|\?\?/,ke=$.now();$.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var t=je.pop()||$.expando+"_"+ke++;return this[t]=!0,t}}),$.ajaxPrefilter("json jsonp",(function(n,i,r){var o,a,s,l=n.data,u=n.url,c=!1!==n.jsonp,d=c&&Ae.test(u),h=c&&!d&&"string"==typeof l&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&Ae.test(l);if("jsonp"===n.dataTypes[0]||d||h)return o=n.jsonpCallback=$.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,a=t[o],d?n.url=u.replace(Ae,"$1"+o):h?n.data=l.replace(Ae,"$1"+o):c&&(n.url+=(Te.test(u)?"&":"?")+n.jsonp+"="+o),n.converters["script json"]=function(){return s||$.error(o+" was not called"),s[0]},n.dataTypes[0]="json",t[o]=function(){s=arguments},r.always((function(){t[o]=a,n[o]&&(n.jsonpCallback=i.jsonpCallback,je.push(o)),s&&$.isFunction(a)&&a(s[0]),s=a=e})),"script"})),$.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(t){return $.globalEval(t),t}}}),$.ajaxPrefilter("script",(function(t){t.cache===e&&(t.cache=!1),t.crossDomain&&(t.type="GET",t.global=!1)})),$.ajaxTransport("script",(function(t){if(t.crossDomain){var n,i=I.head||I.getElementsByTagName("head")[0]||I.documentElement;return{send:function(r,o){(n=I.createElement("script")).async="async",t.scriptCharset&&(n.charset=t.scriptCharset),n.src=t.url,n.onload=n.onreadystatechange=function(t,r){!r&&n.readyState&&!/loaded|complete/.test(n.readyState)||(n.onload=n.onreadystatechange=null,i&&n.parentNode&&i.removeChild(n),n=e,r||o(200,"success"))},i.insertBefore(n,i.firstChild)},abort:function(){n&&n.onload(0,1)}}}}));var Ie,Le,Oe=!!t.ActiveXObject&&function(){for(var t in Ie)Ie[t](0,1)},Ne=0;$.ajaxSettings.xhr=t.ActiveXObject?function(){return!this.isLocal&&E()||function(){try{return new t.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}()}:E,Le=$.ajaxSettings.xhr(),$.extend($.support,{ajax:!!Le,cors:!!Le&&"withCredentials"in Le}),$.support.ajax&&$.ajaxTransport((function(n){var i;if(!n.crossDomain||$.support.cors)return{send:function(r,o){var a,s,l=n.xhr();if(n.username?l.open(n.type,n.url,n.async,n.username,n.password):l.open(n.type,n.url,n.async),n.xhrFields)for(s in n.xhrFields)l[s]=n.xhrFields[s];n.mimeType&&l.overrideMimeType&&l.overrideMimeType(n.mimeType),n.crossDomain||r["X-Requested-With"]||(r["X-Requested-With"]="XMLHttpRequest");try{for(s in r)l.setRequestHeader(s,r[s])}catch(r){}l.send(n.hasContent&&n.data||null),i=function(t,r){var s,u,c,d,h;try{if(i&&(r||4===l.readyState))if(i=e,a&&(l.onreadystatechange=$.noop,Oe&&delete Ie[a]),r)4!==l.readyState&&l.abort();else{s=l.status,c=l.getAllResponseHeaders(),d={},(h=l.responseXML)&&h.documentElement&&(d.xml=h);try{d.text=l.responseText}catch(t){}try{u=l.statusText}catch(t){u=""}s||!n.isLocal||n.crossDomain?1223===s&&(s=204):s=d.text?200:404}}catch(t){r||o(-1,t)}d&&o(s,u,d,c)},n.async?4===l.readyState?setTimeout(i,0):(a=++Ne,Oe&&(Ie||(Ie={},$(t).unload(Oe)),Ie[a]=i),l.onreadystatechange=i):i()},abort:function(){i&&i(0,1)}}}));var ze,Re,He=/^(?:toggle|show|hide)$/,Fe=new RegExp("^(?:([-+])=|)("+U+")([a-z%]*)$","i"),Ve=/queueHooks$/,Be=[function(t,e,n){var i,r,o,a,s,l,u,c,d=this,h=t.style,p={},f=[],m=t.nodeType&&g(t);for(i in n.queue||(null==(u=$._queueHooks(t,"fx")).unqueued&&(u.unqueued=0,c=u.empty.fire,u.empty.fire=function(){u.unqueued||c()}),u.unqueued++,d.always((function(){d.always((function(){u.unqueued--,$.queue(t,"fx").length||u.empty.fire()}))}))),1===t.nodeType&&("height"in e||"width"in e)&&(n.overflow=[h.overflow,h.overflowX,h.overflowY],"inline"===$.css(t,"display")&&"none"===$.css(t,"float")&&($.support.inlineBlockNeedsLayout&&"inline"!==x(t.nodeName)?h.zoom=1:h.display="inline-block")),n.overflow&&(h.overflow="hidden",$.support.shrinkWrapBlocks||d.done((function(){h.overflow=n.overflow[0],h.overflowX=n.overflow[1],h.overflowY=n.overflow[2]}))),e)o=e[i],He.exec(o)&&(delete e[i],o!==(m?"hide":"show")&&f.push(i));if(a=f.length)for(s=$._data(t,"fxshow")||$._data(t,"fxshow",{}),m?$(t).show():d.done((function(){$(t).hide()})),d.done((function(){for(var e in $.removeData(t,"fxshow",!0),p)$.style(t,e,p[e])})),i=0;i<a;i++)r=f[i],l=d.createTween(r,m?s[r]:0),p[r]=s[r]||$.style(t,r),r in s||(s[r]=l.start,m&&(l.end=l.start,l.start="width"===r||"height"===r?1:0))}],We={"*":[function(t,e){var n,i=this.createTween(t,e),r=Fe.exec(e),o=i.cur(),a=+o||0,s=1,l=20;if(r){if(e=+r[2],"px"!==(n=r[3]||($.cssNumber[t]?"":"px"))&&a)for(a=$.css(i.elem,t,!0)||e||1;$.style(i.elem,t,(a/=s=s||".5")+n),s!==(s=i.cur()/o)&&1!==s&&--l;);i.unit=n,i.start=a,i.end=r[1]?a+(r[1]+1)*e:e}return i}]};$.Animation=$.extend(D,{tweener:function(t,e){for(var n,i=0,r=(t=$.isFunction(t)?(e=t,["*"]):t.split(" ")).length;i<r;i++)n=t[i],We[n]=We[n]||[],We[n].unshift(e)},prefilter:function(t,e){e?Be.unshift(t):Be.push(t)}}),(($.Tween=S).prototype={constructor:S,init:function(t,e,n,i,r,o){this.elem=t,this.prop=n,this.easing=r||"swing",this.options=e,this.start=this.now=this.cur(),this.end=i,this.unit=o||($.cssNumber[n]?"":"px")},cur:function(){var t=S.propHooks[this.prop];return(t&&t.get?t:S.propHooks._default).get(this)},run:function(t){var e,n=S.propHooks[this.prop];return this.options.duration?this.pos=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:S.propHooks._default).set(this),this}}).init.prototype=S.prototype,(S.propHooks={_default:{get:function(t){var e;return null==t.elem[t.prop]||t.elem.style&&null!=t.elem.style[t.prop]?(e=$.css(t.elem,t.prop,!1,""))&&"auto"!==e?e:0:t.elem[t.prop]},set:function(t){$.fx.step[t.prop]?$.fx.step[t.prop](t):t.elem.style&&(null!=t.elem.style[$.cssProps[t.prop]]||$.cssHooks[t.prop])?$.style(t.elem,t.prop,t.now+t.unit):t.elem[t.prop]=t.now}}}).scrollTop=S.propHooks.scrollLeft={set:function(t){t.elem.nodeType&&t.elem.parentNode&&(t.elem[t.prop]=t.now)}},$.each(["toggle","show","hide"],(function(t,e){var n=$.fn[e];$.fn[e]=function(i,r,o){return null==i||"boolean"==typeof i||!t&&$.isFunction(i)&&$.isFunction(r)?n.apply(this,arguments):this.animate(P(e,!0),i,r,o)}})),$.fn.extend({fadeTo:function(t,e,n,i){return this.filter(g).css("opacity",0).show().end().animate({opacity:e},t,n,i)},animate:function(t,e,n,i){function r(){var e=D(this,$.extend({},t),a);o&&e.stop(!0)}var o=$.isEmptyObject(t),a=$.speed(e,n,i);return o||!1===a.queue?this.each(r):this.queue(a.queue,r)},stop:function(t,n,i){function r(t){var e=t.stop;delete t.stop,e(i)}return"string"!=typeof t&&(i=n,n=t,t=e),n&&!1!==t&&this.queue(t||"fx",[]),this.each((function(){var e=!0,n=null!=t&&t+"queueHooks",o=$.timers,a=$._data(this);if(n)a[n]&&a[n].stop&&r(a[n]);else for(n in a)a[n]&&a[n].stop&&Ve.test(n)&&r(a[n]);for(n=o.length;n--;)o[n].elem!==this||null!=t&&o[n].queue!==t||(o[n].anim.stop(i),e=!1,o.splice(n,1));!e&&i||$.dequeue(this,t)}))}}),$.each({slideDown:P("show"),slideUp:P("hide"),slideToggle:P("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},(function(t,e){$.fn[t]=function(t,n,i){return this.animate(e,t,n,i)}})),$.speed=function(t,e,n){var i=t&&"object"==typeof t?$.extend({},t):{complete:n||!n&&e||$.isFunction(t)&&t,duration:t,easing:n&&e||e&&!$.isFunction(e)&&e};return i.duration=$.fx.off?0:"number"==typeof i.duration?i.duration:i.duration in $.fx.speeds?$.fx.speeds[i.duration]:$.fx.speeds._default,null!=i.queue&&!0!==i.queue||(i.queue="fx"),i.old=i.complete,i.complete=function(){$.isFunction(i.old)&&i.old.call(this),i.queue&&$.dequeue(this,i.queue)},i},$.easing={linear:function(t){return t},swing:function(t){return.5-Math.cos(t*Math.PI)/2}},$.timers=[],$.fx=S.prototype.init,$.fx.tick=function(){for(var t,e=$.timers,n=0;n<e.length;n++)(t=e[n])()||e[n]!==t||e.splice(n--,1);e.length||$.fx.stop()},$.fx.timer=function(t){t()&&$.timers.push(t)&&!Re&&(Re=setInterval($.fx.tick,$.fx.interval))},$.fx.interval=13,$.fx.stop=function(){clearInterval(Re),Re=null},$.fx.speeds={slow:600,fast:200,_default:400},$.fx.step={},$.expr&&$.expr.filters&&($.expr.filters.animated=function(t){return $.grep($.timers,(function(e){return t===e.elem})).length});var $e=/^(?:body|html)$/i;$.fn.offset=function(t){if(arguments.length)return t===e?this:this.each((function(e){$.offset.setOffset(this,t,e)}));var n,i,r,o={top:0,left:0},a=this[0],s=a&&a.ownerDocument;return s?(i=s.body)===a?$.offset.bodyOffset(a):(r=s.documentElement,$.contains(r,a)?(void 0!==a.getBoundingClientRect&&(o=a.getBoundingClientRect()),n=j(s),a=r.clientTop||i.clientTop||0,s=r.clientLeft||i.clientLeft||0,i=n.pageYOffset||r.scrollTop,r=n.pageXOffset||r.scrollLeft,{top:o.top+i-a,left:o.left+r-s}):o):void 0},$.offset={bodyOffset:function(t){var e=t.offsetTop,n=t.offsetLeft;return $.support.doesNotIncludeMarginInBodyOffset&&(e+=parseFloat($.css(t,"marginTop"))||0,n+=parseFloat($.css(t,"marginLeft"))||0),{top:e,left:n}},setOffset:function(t,e,n){var i=$.css(t,"position");"static"===i&&(t.style.position="relative");var r,o=$(t),a=o.offset(),s=$.css(t,"top"),l=$.css(t,"left"),u={};l=("absolute"===i||"fixed"===i)&&-1<$.inArray("auto",[s,l])?(r=(i=o.position()).top,i.left):(r=parseFloat(s)||0,parseFloat(l)||0);null!=(e=$.isFunction(e)?e.call(t,n,a):e).top&&(u.top=e.top-a.top+r),null!=e.left&&(u.left=e.left-a.left+l),"using"in e?e.using.call(t,u):o.css(u)}},$.fn.extend({position:function(){if(this[0]){var t=this[0],e=this.offsetParent(),n=this.offset(),i=$e.test(e[0].nodeName)?{top:0,left:0}:e.offset();return n.top-=parseFloat($.css(t,"marginTop"))||0,n.left-=parseFloat($.css(t,"marginLeft"))||0,i.top+=parseFloat($.css(e[0],"borderTopWidth"))||0,i.left+=parseFloat($.css(e[0],"borderLeftWidth"))||0,{top:n.top-i.top,left:n.left-i.left}}},offsetParent:function(){return this.map((function(){for(var t=this.offsetParent||I.body;t&&!$e.test(t.nodeName)&&"static"===$.css(t,"position");)t=t.offsetParent;return t||I.body}))}}),$.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},(function(t,n){var i=/Y/.test(n);$.fn[t]=function(r){return $.access(this,(function(t,r,o){var a=j(t);if(o===e)return a?n in a?a[n]:a.document.documentElement[r]:t[r];a?a.scrollTo(i?$(a).scrollLeft():o,i?o:$(a).scrollTop()):t[r]=o}),t,r,arguments.length,null)}})),$.each({Height:"height",Width:"width"},(function(t,n){$.each({padding:"inner"+t,content:n,"":"outer"+t},(function(i,r){$.fn[r]=function(r,o){var a=arguments.length&&(i||"boolean"!=typeof r),s=i||(!0===r||!0===o?"margin":"border");return $.access(this,(function(n,i,r){var o;return $.isWindow(n)?n.document.documentElement["client"+t]:9===n.nodeType?(o=n.documentElement,Math.max(n.body["scroll"+t],o["scroll"+t],n.body["offset"+t],o["offset"+t],o["client"+t])):r===e?$.css(n,i,r,s):$.style(n,i,r,s)}),n,a?r:e,a,null)}}))})),t.jQuery=t.$=$,"function"==typeof define&&define.amd&&define.amd.jQuery&&define("jquery",[],(function(){return $}))}(window),function(t){"function"==typeof define&&define.amd?define(["jquery"],t):t(jQuery)}((function(t){var e=[],n=t(document),i=t.browser.msie&&6===parseInt(t.browser.version)&&"object"!=typeof window.XMLHttpRequest,r=t.browser.msie&&7===parseInt(t.browser.version),o=null,a=t(window),s=[];t.modal=function(e,n){return t.modal.impl.init(e,n)},t.modal.close=function(){t.modal.impl.close()},t.modal.focus=function(e){t.modal.impl.focus(e)},t.modal.setContainerDimensions=function(){t.modal.impl.setContainerDimensions()},t.modal.setPosition=function(){t.modal.impl.setPosition()},t.modal.update=function(e,n){t.modal.impl.update(e,n)},t.fn.modal=function(e){return t.modal.impl.init(this,e)},t.modal.defaults={appendTo:"body",focus:!0,opacity:50,overlayId:"simplemodal-overlay",overlayCss:{},containerId:"simplemodal-container",containerCss:{},dataId:"simplemodal-data",dataCss:{},minHeight:null,minWidth:null,maxHeight:null,maxWidth:null,autoResize:!1,autoPosition:!0,zIndex:1e3,close:!0,closeHTML:'<a class="modalCloseImg" title="Close"></a>',closeClass:"simplemodal-close",escClose:!0,overlayClose:!1,fixed:!0,position:null,persist:!1,modal:!0,onOpen:null,onShow:null,onClose:null},t.modal.impl={d:{},init:function(e,n){if(this.d.data)return!1;if(o=t.browser.msie&&!t.support.boxModel,this.o=t.extend({},t.modal.defaults,n),this.zIndex=this.o.zIndex,this.occb=!1,"object"==typeof e)e=e instanceof t?e:t(e),this.d.placeholder=!1,0<e.parent().parent().size()&&(e.before(t("<span></span>").attr("id","simplemodal-placeholder").css({display:"none"})),this.d.placeholder=!0,this.display=e.css("display"),!this.o.persist)&&(this.d.orig=e.clone(!0));else{if("string"!=typeof e&&"number"!=typeof e)return alert("SimpleModal Error: Unsupported data type: "+typeof e),this;e=t("<div></div>").html(e)}return this.create(e),this.open(),t.isFunction(this.o.onShow)&&this.o.onShow.apply(this,[this.d]),this},create:function(n){this.getDimensions(),this.o.modal&&i&&(this.d.iframe=t('<iframe src="javascript:false;"></iframe>').css(t.extend(this.o.iframeCss,{display:"none",opacity:0,position:"fixed",height:s[0],width:s[1],zIndex:this.o.zIndex,top:0,left:0})).appendTo(this.o.appendTo)),this.d.overlay=t("<div></div>").attr("id",this.o.overlayId).addClass("simplemodal-overlay").css(t.extend(this.o.overlayCss,{display:"none",opacity:this.o.opacity/100,height:this.o.modal?e[0]:0,width:this.o.modal?e[1]:0,position:"fixed",left:0,top:0,zIndex:this.o.zIndex+1})).appendTo(this.o.appendTo),this.d.container=t("<div></div>").attr("id",this.o.containerId).addClass("simplemodal-container").css(t.extend({position:this.o.fixed?"fixed":"absolute"},this.o.containerCss,{display:"none",zIndex:this.o.zIndex+2})).append(this.o.close&&this.o.closeHTML?t(this.o.closeHTML).addClass(this.o.closeClass):"").appendTo(this.o.appendTo),this.d.wrap=t("<div></div>").attr("tabIndex",-1).addClass("simplemodal-wrap").css({height:"100%",outline:0,width:"100%"}).appendTo(this.d.container),this.d.data=n.attr("id",n.attr("id")||this.o.dataId).addClass("simplemodal-data").css(t.extend(this.o.dataCss,{display:"none"})).appendTo("body"),this.setContainerDimensions(),this.d.data.appendTo(this.d.wrap),(i||o)&&this.fixIE()},bindEvents:function(){var r=this;t("."+r.o.closeClass).bind("click.simplemodal",(function(t){t.preventDefault(),r.close()})),r.o.modal&&r.o.close&&r.o.overlayClose&&r.d.overlay.bind("click.simplemodal",(function(t){t.preventDefault(),r.close()})),n.bind("keydown.simplemodal",(function(t){r.o.modal&&9===t.keyCode?r.watchTab(t):r.o.close&&r.o.escClose&&27===t.keyCode&&(t.preventDefault(),r.close())})),a.bind("resize.simplemodal orientationchange.simplemodal",(function(){r.getDimensions(),r.o.autoResize?r.setContainerDimensions():r.o.autoPosition&&r.setPosition(),i||o?r.fixIE():r.o.modal&&(r.d.iframe&&r.d.iframe.css({height:s[0],width:s[1]}),r.d.overlay.css({height:e[0],width:e[1]}))}))},unbindEvents:function(){t("."+this.o.closeClass).unbind("click.simplemodal"),n.unbind("keydown.simplemodal"),a.unbind(".simplemodal"),this.d.overlay.unbind("click.simplemodal")},fixIE:function(){var e=this.o.position;t.each([this.d.iframe||null,this.o.modal?this.d.overlay:null,"fixed"===this.d.container.css("position")?this.d.container:null],(function(t,n){var i,r,o;n&&((i=n[0].style).position="absolute",t<2?(i.removeExpression("height"),i.removeExpression("width"),i.setExpression("height",'document.body.scrollHeight > document.body.clientHeight ? document.body.scrollHeight : document.body.clientHeight + "px"'),i.setExpression("width",'document.body.scrollWidth > document.body.clientWidth ? document.body.scrollWidth : document.body.clientWidth + "px"')):(e&&e.constructor===Array?(r=-1===(r=e[0]?"number"==typeof e[0]?e[0].toString():e[0].replace(/px/,""):n.css("top").replace(/px/,"")).indexOf("%")?r+' + (t = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"':parseInt(r.replace(/%/,""))+' * ((document.documentElement.clientHeight || document.body.clientHeight) / 100) + (t = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"',e[1]&&(o=-1===(o="number"==typeof e[1]?e[1].toString():e[1].replace(/px/,"")).indexOf("%")?o+' + (t = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft) + "px"':parseInt(o.replace(/%/,""))+' * ((document.documentElement.clientWidth || document.body.clientWidth) / 100) + (t = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft) + "px"')):(r='(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (t = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"',o='(document.documentElement.clientWidth || document.body.clientWidth) / 2 - (this.offsetWidth / 2) + (t = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft) + "px"'),i.removeExpression("top"),i.removeExpression("left"),i.setExpression("top",r),i.setExpression("left",o)))}))},focus:function(e){var n=this,i=(e=e&&-1!==t.inArray(e,["first","last"])?e:"first",t(":input:enabled:visible:"+e,n.d.wrap));setTimeout((function(){(0<i.length?i:n.d.wrap).focus()}),10)},getDimensions:function(){var t=void 0===window.innerHeight?a.height():window.innerHeight;e=[n.height(),n.width()],s=[t,a.width()]},getVal:function(t,e){return t?"number"==typeof t?t:"auto"===t?0:0<t.indexOf("%")?parseInt(t.replace(/%/,""))/100*("h"===e?s[0]:s[1]):parseInt(t.replace(/px/,"")):null},update:function(t,e){if(!this.d.data)return!1;this.d.origHeight=this.getVal(t,"h"),this.d.origWidth=this.getVal(e,"w"),this.d.data.hide(),t&&this.d.container.css("height",t),e&&this.d.container.css("width",e),this.setContainerDimensions(),this.d.data.show(),this.o.focus&&this.focus(),this.unbindEvents(),this.bindEvents()},setContainerDimensions:function(){var e=i||r,n=this.d.origHeight||(t.browser.opera?this.d.container.height():this.getVal(e?this.d.container[0].currentStyle.height:this.d.container.css("height"),"h")),o=(e=this.d.origWidth||(t.browser.opera?this.d.container.width():this.getVal(e?this.d.container[0].currentStyle.width:this.d.container.css("width"),"w")),this.d.data.outerHeight(!0)),a=this.d.data.outerWidth(!0);this.d.origHeight=this.d.origHeight||n,this.d.origWidth=this.d.origWidth||e;var l=this.o.maxHeight?this.getVal(this.o.maxHeight,"h"):null,u=this.o.maxWidth?this.getVal(this.o.maxWidth,"w"):null,c=(l=l&&l<s[0]?l:s[0],u=u&&u<s[1]?u:s[1],this.o.minHeight?this.getVal(this.o.minHeight,"h"):"auto");n=n?this.o.autoResize&&l<n?l:n<c?c:n:o?l<o?l:this.o.minHeight&&"auto"!==c&&o<c?c:o:c,l=this.o.minWidth?this.getVal(this.o.minWidth,"w"):"auto",e=e?this.o.autoResize&&u<e?u:e<l?l:e:a?u<a?u:this.o.minWidth&&"auto"!==l&&a<l?l:a:l;this.d.container.css({height:n,width:e}),this.d.wrap.css({overflow:n<o||e<a?"auto":"visible"}),this.o.autoPosition&&this.setPosition()},setPosition:function(){var t=s[0]/2-this.d.container.outerHeight(!0)/2,e=s[1]/2-this.d.container.outerWidth(!0)/2,n="fixed"!==this.d.container.css("position")?a.scrollTop():0;this.o.position&&"[object Array]"===Object.prototype.toString.call(this.o.position)?(t=n+(this.o.position[0]||t),e=this.o.position[1]||e):t=n+t,this.d.container.css({left:e,top:t})},watchTab:function(e){0<t(e.target).parents(".simplemodal-container").length?(this.inputs=t(":input:enabled:visible:first, :input:enabled:visible:last",this.d.data[0]),(!e.shiftKey&&e.target===this.inputs[this.inputs.length-1]||e.shiftKey&&e.target===this.inputs[0]||0===this.inputs.length)&&(e.preventDefault(),this.focus(e.shiftKey?"last":"first"))):(e.preventDefault(),this.focus())},open:function(){this.d.iframe&&this.d.iframe.show(),t.isFunction(this.o.onOpen)?this.o.onOpen.apply(this,[this.d]):(this.d.overlay.show(),this.d.container.show(),this.d.data.show()),this.o.focus&&this.focus(),this.bindEvents()},close:function(){if(!this.d.data)return!1;var e;this.unbindEvents(),t.isFunction(this.o.onClose)&&!this.occb?(this.occb=!0,this.o.onClose.apply(this,[this.d])):(this.d.placeholder?(e=t("#simplemodal-placeholder"),this.o.persist?e.replaceWith(this.d.data.removeClass("simplemodal-data").css("display",this.display)):(this.d.data.hide().remove(),e.replaceWith(this.d.orig))):this.d.data.hide().remove(),this.d.container.hide().remove(),this.d.overlay.hide(),this.d.iframe&&this.d.iframe.hide().remove(),this.d.overlay.remove(),this.d={})}}})),function(t,e){var n,i,r,o,a,s,l,u,c=Array.prototype.slice,d=decodeURIComponent,h=t.param,p=t.bbq=t.bbq||{},f=t.event.special,g="hashchange",m="querystring",v="fragment",y="elemUrlAttr",b="location",x="href",w="src",C=/^.*\?|#.*$/g,_=/^.*\#/,E={};function M(t){return"string"==typeof t}function D(t){var e=c.call(arguments,1);return function(){return t.apply(this,e.concat(c.call(arguments)))}}function S(i,o,a,s,l){var c,p,f,g;return a=s!==n?(g=(p=a.match(i?/^([^#]*)\#?(.*)$/:/^([^#?]*)\??([^#]*)(#?.*)/))[3]||"",2===l&&M(s)?c=s.replace(i?_:C,""):(f=r(p[2]),s=M(s)?r[i?v:m](s):s,c=2===l?s:1===l?t.extend({},s,f):t.extend({},f,s),c=h(c),i&&(c=c.replace(u,d))),p[1]+(i?"#":c||!p[1]?"?":"")+c+g):o(a!==n?a:e[b][x])}function P(t,e,i){return e=e===n||"boolean"==typeof e?(i=e,h[t?v:m]()):M(e)?e.replace(t?_:C,""):e,r(e,i)}function j(e,i,r,o){return M(r)||"object"==typeof r||(o=r,r=i,i=n),this.each((function(){var n=t(this),a=i||l()[(this.nodeName||"").toLowerCase()]||"",s=a&&n.attr(a)||"";n.attr(a,h[e](s,r,o))}))}h[m]=D(S,0,(function(t){return t.replace(/(?:^[^?#]*\?([^#]*).*$)?.*/,"$1")})),h[v]=i=D(S,1,(function(t){return t.replace(/^[^#]*#?(.*)$/,"$1")})),i.noEscape=function(e){e=t.map((e=e||"").split(""),encodeURIComponent),u=new RegExp(e.join("|"),"g")},i.noEscape(",/"),t.deparam=r=function(e,i){var r={},o={true:!0,false:!1,null:null};return t.each(e.replace(/\+/g," ").split("&"),(function(e,a){a=a.split("=");var s,l=d(a[0]),u=r,c=0,h=l.split("]["),p=h.length-1;p=/\[/.test(h[0])&&/\]$/.test(h[p])?(h[p]=h[p].replace(/\]$/,""),(h=h.shift().split("[").concat(h)).length-1):0;if(2===a.length)if(s=d(a[1]),i&&(s=s&&!isNaN(s)?+s:"undefined"===s?n:o[s]!==n?o[s]:s),p)for(;c<=p;c++)u=u[l=""===h[c]?u.length:h[c]]=c<p?u[l]||(h[c+1]&&isNaN(h[c+1])?{}:[]):s;else t.isArray(r[l])?r[l].push(s):r[l]!==n?r[l]=[r[l],s]:r[l]=s;else l&&(r[l]=i?n:"")})),r},r[m]=D(P,0),r[v]=o=D(P,1),t[y]||(t[y]=function(e){return t.extend(E,e)})({a:x,base:x,iframe:w,img:w,input:w,form:"action",link:x,script:w}),l=t[y],t.fn[m]=D(j,m),t.fn[v]=D(j,v),p.pushState=a=function(t,r){M(t)&&/^#/.test(t)&&r===n&&(r=2);var o=t!==n;r=i(e[b][x],o?t:{},o?r:2);e[b][x]=r+(/#/.test(r)?"":"#")},p.getState=s=function(t,e){return t===n||"boolean"==typeof t?o(t):o(e)[t]},p.removeState=function(e){var i={};e!==n&&(i=s(),t.each(t.isArray(e)?e:arguments,(function(t,e){delete i[e]}))),a(i,2)},f[g]=t.extend(f[g],{add:function(e){var o;function a(t){var e=t[v]=i();t.getState=function(t,i){return t===n||"boolean"==typeof t?r(e,t):r(e,i)[t]},o.apply(this,arguments)}if(t.isFunction(e))return o=e,a;o=e.handler,e.handler=a}})}(jQuery,this),function(t,e){var n,i,r,o,a,s=t.event.special,l="location",u="hashchange",c="href",d=t.browser,h=document.documentMode,p=d.msie&&(void 0===h||h<8),f="on"+u in e&&!p;function g(t){return(t=t||e[l][c]).replace(/^[^#]*#?(.*)$/,"$1")}t[u+"Delay"]=100,s[u]=t.extend(s[u],{setup:function(){if(f)return!1;t(n.start)},teardown:function(){if(f)return!1;t(n.stop)}}),(s={}).start=function(){var n;i||(n=g(),o||(o=a=function(t){return t},p&&(r=t('<iframe src="javascript:0"/>').hide().insertAfter("body")[0].contentWindow,a=function(){return g(r.document[l][c])},(o=function(t,e){t!==e&&((e=r.document).open().close(),e[l].hash="#"+t)})(g()))),function r(){var s=g(),d=a(n);s!==n?(o(n=s,d),t(e).trigger(u)):d!==n&&(e[l][c]=e[l][c].replace(/#.*/,"")+"#"+d),i=setTimeout(r,t[u+"Delay"])}())},s.stop=function(){r||(i&&clearTimeout(i),i=0)},n=s}(jQuery,this),jsPlumbUtil={isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},isString:function(t){return"string"==typeof t},isObject:function(t){return"[object Object]"===Object.prototype.toString.call(t)},convertStyle:function(t,e){if("transparent"===t)return t;function n(t){return 1==(t=Number(t).toString(16)).length?"0"+t:t}var i=t,r=/(rgb[a]?\()(.*)(\))/;return t.match(r)&&(i="#"+n((r=t.match(r)[2].split(","))[0])+n(r[1])+n(r[2]),e||4!=r.length||(i+=n(r[3]))),i},gradient:function(t,e){return t=jsPlumbUtil.isArray(t)?t:[t.x,t.y],((e=jsPlumbUtil.isArray(e)?e:[e.x,e.y])[1]-t[1])/(e[0]-t[0])},normal:function(t,e){return-1/jsPlumbUtil.gradient(t,e)},lineLength:function(t,e){return t=jsPlumbUtil.isArray(t)?t:[t.x,t.y],e=jsPlumbUtil.isArray(e)?e:[e.x,e.y],Math.sqrt(Math.pow(e[1]-t[1],2)+Math.pow(e[0]-t[0],2))},segment:function(t,e){return t=jsPlumbUtil.isArray(t)?t:[t.x,t.y],(e=jsPlumbUtil.isArray(e)?e:[e.x,e.y])[0]>t[0]?e[1]>t[1]?2:1:e[1]>t[1]?3:4},intersects:function(t,e){var n=t.x,i=t.x+t.w,r=t.y,o=t.y+t.h,a=e.x,s=e.x+e.w;t=e.y,e=e.y+e.h;return n<=a&&a<=i&&r<=t&&t<=o||n<=s&&s<=i&&r<=t&&t<=o||n<=a&&a<=i&&r<=e&&e<=o||n<=s&&a<=i&&r<=e&&e<=o||a<=n&&n<=s&&t<=r&&r<=e||a<=i&&i<=s&&t<=r&&r<=e||a<=n&&n<=s&&t<=o&&o<=e||a<=i&&n<=s&&t<=o&&o<=e},segmentMultipliers:[null,[1,-1],[1,1],[-1,1],[-1,-1]],inverseSegmentMultipliers:[null,[-1,-1],[-1,1],[1,1],[1,-1]],pointOnLine:function(t,e,n){var i=jsPlumbUtil.gradient(t,e),r=jsPlumbUtil.segment(t,e);e=(0<n?jsPlumbUtil.segmentMultipliers:jsPlumbUtil.inverseSegmentMultipliers)[r],r=Math.atan(i),i=Math.abs(n*Math.sin(r))*e[1],e=Math.abs(n*Math.cos(r))*e[0];return{x:t.x+e,y:t.y+i}},perpendicularLineTo:function(t,e,n){var i=jsPlumbUtil.gradient(t,e);t=Math.atan(-1/i),i=n/2*Math.sin(t),t=n/2*Math.cos(t);return[{x:e.x+t,y:e.y+i},{x:e.x-t,y:e.y-i}]},findWithFunction:function(t,e){if(t)for(var n=0;n<t.length;n++)if(e(t[n]))return n;return-1},indexOf:function(t,e){return jsPlumbUtil.findWithFunction(t,(function(t){return t==e}))},removeWithFunction:function(t,e){return-1<(e=jsPlumbUtil.findWithFunction(t,e))&&t.splice(e,1),-1!=e},remove:function(t,e){return-1<(e=jsPlumbUtil.indexOf(t,e))&&t.splice(e,1),-1!=e},addWithFunction:function(t,e,n){-1==jsPlumbUtil.findWithFunction(t,n)&&t.push(e)},addToList:function(t,e,n){var i=t[e];return null==i&&(t[e]=i=[]),i.push(n),i},EventGenerator:function(){var t={},e=this,n=["ready"];this.bind=function(n,i){return jsPlumbUtil.addToList(t,n,i),e},this.fire=function(i,r,o){if(t[i])for(var a=0;a<t[i].length;a++)if(-1!=jsPlumbUtil.findWithFunction(n,(function(t){return t===i})))t[i][a](r,o);else try{t[i][a](r,o)}catch(r){jsPlumbUtil.log("jsPlumb: fire failed for event "+i+" : "+r)}return e},this.unbind=function(n){return n?delete t[n]:(delete t,t={}),e},this.getListener=function(e){return t[e]}},logEnabled:!0,log:function(){if(jsPlumbUtil.logEnabled&&"undefined"!=typeof console)try{var t=arguments[arguments.length-1];console.log(t)}catch(t){}},group:function(t){jsPlumbUtil.logEnabled&&"undefined"!=typeof console&&console.group(t)},groupEnd:function(t){jsPlumbUtil.logEnabled&&"undefined"!=typeof console&&console.groupEnd(t)},time:function(t){jsPlumbUtil.logEnabled&&"undefined"!=typeof console&&console.time(t)},timeEnd:function(t){jsPlumbUtil.logEnabled&&"undefined"!=typeof console&&console.timeEnd(t)}},function(){var t=!!document.createElement("canvas").getContext,e=!!window.SVGAngle||document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1"),n=function(){var t,e;return null==n.vml&&((t=document.body.appendChild(document.createElement("div"))).innerHTML='<v:shape id="vml_flag1" adj="1" />',(e=t.firstChild).style.behavior="url(#default#VML)",n.vml=!e||"object"==typeof e.adj,t.parentNode.removeChild(t)),n.vml},i=jsPlumbUtil.findWithFunction,r=jsPlumbUtil.indexOf,o=jsPlumbUtil.removeWithFunction,a=(jsPlumbUtil.remove,jsPlumbUtil.addWithFunction),s=(jsPlumbUtil.addToList,jsPlumbUtil.isArray),l=jsPlumbUtil.isString,u=jsPlumbUtil.isObject;function c(t,e){return C.CurrentLibrary.getAttribute(v(t),e)}function d(t,e,n){C.CurrentLibrary.setAttribute(v(t),e,n)}function h(t){return C.CurrentLibrary.getOffset(v(t))}function p(t){return C.CurrentLibrary.getSize(v(t))}function f(t){x.apply(this,arguments);var e=this;function n(t){var n=null;if(s(t)){var i=t[0],r=C.extend({component:e,_jsPlumb:e._jsPlumb},t[1]);if(3==t.length&&C.extend(r,t[2]),n=new(C.Overlays[e._jsPlumb.getRenderMode()][i])(r),r.events)for(var o in r.events)n.bind(o,r.events[o])}else n=t.constructor==String?new(C.Overlays[e._jsPlumb.getRenderMode()][t])({component:e,_jsPlumb:e._jsPlumb}):t;e.overlays.push(n)}this.overlays=[];var i=function(t){for(var n,i=e.defaultOverlayKeys||[],r=(r=t.overlays)||[],o=0;o<i.length;o++)r.unshift.apply(r,(n=i[o],e._jsPlumb.Defaults[n]||C.Defaults[n]||[]));return r}(t);if(i)for(var r=0;r<i.length;r++)n(i[r]);function o(t){for(var n=-1,i=0;i<e.overlays.length;i++)if(t===e.overlays[i].id){n=i;break}return n}function a(t){var n={cssClass:t.cssClass,labelStyle:this.labelStyle,id:c,component:e,_jsPlumb:e._jsPlumb};t=C.extend(n,t);return new(C.Overlays[e._jsPlumb.getRenderMode()].Label)(t)}this.addOverlay=function(t){n(t),e.repaint()},this.getOverlay=function(t){return 0<=(t=o(t))?e.overlays[t]:null},this.getOverlays=function(){return e.overlays},this.hideOverlay=function(t){(t=e.getOverlay(t))&&t.hide()},this.hideOverlays=function(){for(var t=0;t<e.overlays.length;t++)e.overlays[t].hide()},this.showOverlay=function(t){(t=e.getOverlay(t))&&t.show()},this.showOverlays=function(){for(var t=0;t<e.overlays.length;t++)e.overlays[t].show()},this.removeAllOverlays=function(){for(var t in e.overlays)e.overlays[t].cleanup();e.overlays.splice(0,e.overlays.length),e.repaint()},this.removeOverlay=function(t){-1!=(t=o(t))&&(e.overlays[t].cleanup(),e.overlays.splice(t,1))},this.removeOverlays=function(){for(var t=0;t<arguments.length;t++)e.removeOverlay(arguments[t])};var l,u,c="__label";t.label&&(l=t.labelLocation||e.defaultLabelLocation||.5,u=t.labelStyle||e._jsPlumb.Defaults.LabelStyle||C.Defaults.LabelStyle,this.overlays.push(a({label:t.label,location:l,labelStyle:u}))),this.setLabel=function(t){var n=e.getOverlay(c);n?t.constructor==String||t.constructor==Function?n.setLabel(t):(t.label&&n.setLabel(t.label),t.location&&n.setLocation(t.location)):(n=a(t=t.constructor==String||t.constructor==Function?{label:t}:t),this.overlays.push(n)),e.repaint()},this.getLabel=function(){var t=e.getOverlay(c);return null!=t?t.getLabel():null},this.getLabelOverlay=function(){return e.getOverlay(c)}}function g(t,e,n){t.bind("click",(function(t,n){e.fire("click",e,n)})),t.bind("dblclick",(function(t,n){e.fire("dblclick",e,n)})),t.bind("contextmenu",(function(t,n){e.fire("contextmenu",e,n)})),t.bind("mouseenter",(function(t,i){e.isHover()||(n(!0),e.fire("mouseenter",e,i))})),t.bind("mouseexit",(function(t,i){e.isHover()&&(n(!1),e.fire("mouseexit",e,i))}))}function m(m){this.Defaults={Anchor:"BottomCenter",Anchors:[null,null],ConnectionsDetachable:!0,ConnectionOverlays:[],Connector:"Bezier",Container:null,DragOptions:{},DropOptions:{},Endpoint:"Dot",EndpointOverlays:[],Endpoints:[null,null],EndpointStyle:{fillStyle:"#456"},EndpointStyles:[null,null],EndpointHoverStyle:null,EndpointHoverStyles:[null,null],HoverPaintStyle:null,LabelStyle:{color:"black"},LogEnabled:!1,Overlays:[],MaxConnections:1,PaintStyle:{lineWidth:8,strokeStyle:"#456"},RenderMode:"svg",Scope:"jsPlumb_DefaultScope"},m&&C.extend(this.Defaults,m),this.logEnabled=this.Defaults.LogEnabled,jsPlumbUtil.EventGenerator.apply(this);var _,E=this,M=(m=w+1,w++,m),D=E.bind,S={};for(_ in this.Defaults)S[_]=this.Defaults[_];function P(t,e,n){var i,r,o=null!=e&&e,a=C.CurrentLibrary;o&&a.isDragSupported(t)&&!a.isAlreadyDraggable(t)&&(i=n||E.Defaults.DragOptions||C.Defaults.DragOptions,i=C.extend({},i),r=a.dragEvents.drag,e=a.dragEvents.stop,i[n=a.dragEvents.start]=lt(i[n],(function(){E.setHoverSuspended(!0)})),i[r]=lt(i[r],(function(){var e,n=a.getUIPosition(arguments);Y(t,n),e=t,n="jsPlumb_dragged",C.CurrentLibrary.addClass(v(e),n)})),i[e]=lt(i[e],(function(){var e,n=a.getUIPosition(arguments);Y(t,n),e=t,n="jsPlumb_dragged",C.CurrentLibrary.removeClass(v(e),n),E.setHoverSuspended(!1)})),e=st(t),R[e]=!0,o=R[e],i.disabled=null!=o&&!o,a.initDraggable(t,i,!1),E.dragManager.register(t))}function j(t,e,n){e="block"===e;var i=null;n&&(i=e?function(t){t.setVisible(!0,!0,!0)}:function(t){t.setVisible(!1,!0,!0)});var r=c(t,"id");nt(r,(function(t){var i;e&&n?(i=t.sourceId===r?1:0,t.endpoints[i].isVisible()&&t.setVisible(!0)):t.setVisible(e)}),i)}function T(t,e){nt(t,(function(t){var e=t.isVisible();t.setVisible(!e)}),e?function(t){var e=t.isVisible();t.setVisible(!e)}:null)}this.bind=function(t,e){"ready"===t&&A?e():D.apply(E,[t,e])},E.importDefaults=function(t){for(var e in t)E.Defaults[e]=t[e]};var A=!(E.restoreDefaults=function(){E.Defaults=C.extend({},S)}),k={},I={},L={},O={},N={},z={},R={},H=[],F=this.Defaults.Scope,V=null,B=function(t,e,n){var i=t[e];return null==i&&(t[e]=i=[]),i.push(n),i},W=function(t,e){E.Defaults.Container?C.CurrentLibrary.appendElement(t,E.Defaults.Container):e?C.CurrentLibrary.appendElement(t,e):document.body.appendChild(t)},$=1,U=function(){return""+$++},q=function(t){return t._nodes||t},G=!1,Y=function(t,e,n){if(!G){t=c(t,"id");var i=E.dragManager.getElementsForDraggable(t);if(null==n&&(n=b()),E.anchorManager.redraw(t,e,n),i)for(var r in i)E.anchorManager.redraw(i[r].id,e,n,i[r].offset)}},X=function(t,e){var n=null;if(s(t)){n=[];for(var i=0;i<t.length;i++){var r=v(t[i]),o=c(r,"id");n.push(e(r,o))}}else n=e(r=v(t),o=c(r,"id"));return n},Q=function(t){return L[t]},K=function(t){var e=E.Defaults.ConnectionType||E.getDefaultConnectionType(),n=E.Defaults.EndpointType||Qt,i=C.CurrentLibrary.getParent;return t.container?t.parent=t.container:t.sourceEndpoint?t.parent=t.sourceEndpoint.parent:t.source.constructor==n?t.parent=t.source.parent:t.parent=i(t.source),t._jsPlumb=E,(t=new e(t)).id="con_"+U(),Z("click","click",t),Z("dblclick","dblclick",t),Z("contextmenu","contextmenu",t),t},J=function(t,e,n){e=e||{},t.suspendedEndpoint||B(k,t.scope,t),e.doNotFireConnectionEvent||!1===e.fireEvent||E.fire("jsPlumbConnection",{connection:t,source:t.source,target:t.target,sourceId:t.sourceId,targetId:t.targetId,sourceEndpoint:t.endpoints[0],targetEndpoint:t.endpoints[1]},n),E.anchorManager.newConnection(t),Y(t.source)},Z=function(t,e,n){n.bind(t,(function(t,i){E.fire(e,n,i)}))},tt=function(t){if(t.container)return t.container;var e=C.CurrentLibrary.getTagName(t.source);t=C.CurrentLibrary.getParent(t.source);return e&&"td"===e.toLowerCase()?C.CurrentLibrary.getParent(t):t},et=function(t){var e=E.Defaults.EndpointType||Qt;return t.parent=tt(t),t._jsPlumb=E,(t=new e(t)).id="ep_"+U(),Z("click","endpointClick",t),Z("dblclick","endpointDblClick",t),Z("contextmenu","contextmenu",t),t},nt=function(t,e,n){var i=I[t];if(i&&i.length)for(var r=0;r<i.length;r++){for(var o=0;o<i[r].connections.length;o++)if(e(i[r].connections[o]))return;n&&n(i[r])}},it=function(t,e){null!=t&&null!=t.parentNode&&t.parentNode.removeChild(t)},rt=function(t,e){for(var n=0;n<t.length;n++)it(t[n])},ot=function(t){var e,n=t.timestamp,i=t.recalc,r=t.offset;t=t.elId;return!i&&n&&n===N[t]||(i||!r?null!=(e=v(t))&&(H[t]=p(e),O[t]=h(e),N[t]=n):(O[t]=r,null==H[t]&&null!=(e=v(t))&&(H[t]=p(e))),O[t]&&!O[t].right&&(O[t].right=O[t].left+H[t][0],O[t].bottom=O[t].top+H[t][1],O[t].width=H[t][0],O[t].height=H[t][1],O[t].centerx=O[t].left+O[t].width/2,O[t].centery=O[t].top+O[t].height/2)),O[t]},at=function(t){return{o:O[t]||ot({elId:t}),s:H[t]}},st=function(t,e,n){var i=v(t),r=c(i,"id");return r&&"undefined"!=r||(2==arguments.length&&null!=e?r=e:1!=arguments.length&&(3!=arguments.length||n)||(r="jsPlumb_"+M+"_"+U()),d(i,"id",r)),r},lt=function(t,e,n){return t=t||function(){},e=e||function(){},function(){var i=null;try{i=e.apply(this,arguments)}catch(i){y(E,"jsPlumb function failed : "+i)}if(null==n||i!==n)try{t.apply(this,arguments)}catch(i){y(E,"wrapped function failed : "+i)}return i}};this.connectorClass="_jsPlumb_connector",this.endpointClass="_jsPlumb_endpoint",this.overlayClass="_jsPlumb_overlay",this.Anchors={},this.Connectors={canvas:{},svg:{},vml:{}},this.Endpoints={canvas:{},svg:{},vml:{}},this.Overlays={canvas:{},svg:{},vml:{}},this.addClass=function(t,e){return C.CurrentLibrary.addClass(t,e)},this.removeClass=function(t,e){return C.CurrentLibrary.removeClass(t,e)},this.hasClass=function(t,e){return C.CurrentLibrary.hasClass(t,e)},this.addEndpoint=function(t,e,n){var i=C.extend({},n=n||{});C.extend(i,e),i.endpoint=i.endpoint||E.Defaults.Endpoint||C.Defaults.Endpoint,i.paintStyle=i.paintStyle||E.Defaults.EndpointStyle||C.Defaults.EndpointStyle;for(var r=[],o=(t=q(t)).length&&t.constructor!=String?t:[t],a=0;a<o.length;a++){var s=v(o[a]),l=st(s);i.source=s,ot({elId:l});var u=et(i);i.parentAnchor&&(u.parentAnchor=i.parentAnchor),B(I,l,u);var c=O[l];l=H[l],l=u.anchor.compute({xy:[c.left,c.top],wh:l,element:u});u.paint({anchorLoc:l}),r.push(u),E.dragManager.endpointAdded(s)}return 1==r.length?r[0]:r},this.addEndpoints=function(t,e,n){for(var i=[],r=0;r<e.length;r++){var o=E.addEndpoint(t,e[r],n);s(o)?Array.prototype.push.apply(i,o):i.push(o)}return i},this.animate=function(t,e,n){var i=v(t),r=c(t,"id"),o=C.CurrentLibrary.dragEvents.step;t=C.CurrentLibrary.dragEvents.complete;(n=n||{})[o]=lt(n[o],(function(){E.repaint(r)})),n[t]=lt(n[t],(function(){E.repaint(r)})),C.CurrentLibrary.animate(i,e,n)},this.checkCondition=function(t,e){var n=E.getListener(t),i=!0;if(n&&0<n.length)try{for(var r=0;r<n.length;r++)i=i&&n[r](e)}catch(e){y(E,"cannot check condition ["+t+"]"+e)}return i},this.connect=function(t,e){if(t=function(t,e){var n=C.extend({},t);if(e&&C.extend(n,e),n.source&&n.source.endpoint&&(n.sourceEndpoint=n.source),n.source&&n.target.endpoint&&(n.targetEndpoint=n.target),t.uuids&&(n.sourceEndpoint=Q(t.uuids[0]),n.targetEndpoint=Q(t.uuids[1])),n.sourceEndpoint&&n.sourceEndpoint.isFull())y(E,"could not add connection; source endpoint is full");else{if(!n.targetEndpoint||!n.targetEndpoint.isFull()){if(n.sourceEndpoint&&n.sourceEndpoint.connectorOverlays){n.overlays=n.overlays||[];for(var i=0;i<n.sourceEndpoint.connectorOverlays.length;i++)n.overlays.push(n.sourceEndpoint.connectorOverlays[i])}if(n.tooltip=t.tooltip,!n.tooltip&&n.sourceEndpoint&&n.sourceEndpoint.connectorTooltip&&(n.tooltip=n.sourceEndpoint.connectorTooltip),n.target&&!n.target.endpoint&&!n.targetEndpoint&&!n.newConnection){var r=st(n.target),o=bt[r],a=xt[r];if(o){if(!Pt[r])return;var s=null!=a?a:E.addEndpoint(n.target,o);wt[r]&&(xt[r]=s),(n.targetEndpoint=s)._makeTargetCreator=!0}}if(n.source&&!n.source.endpoint&&!n.sourceEndpoint&&!n.newConnection&&(r=st(n.source),o=_t[r],a=Et[r],o)){if(!Dt[r])return;s=null!=a?a:E.addEndpoint(n.source,o),Mt[r]&&(Et[r]=s),n.sourceEndpoint=s}return n}y(E,"could not add connection; target endpoint is full")}}(t,e),t)return null==t.deleteEndpointsOnDetach&&(t.deleteEndpointsOnDetach=!0),e=K(t),J(e,t),e},this.deleteEndpoint=function(t){var e="string"==typeof t?L[t]:t;if(e){var n;t=e.getUuid();for(n in t&&(L[t]=null),e.detachAll(),rt(e.endpoint.getDisplayElements()),E.anchorManager.deleteEndpoint(e),I){var i=I[n];if(i){for(var r=[],o=0;o<i.length;o++)i[o]!=e&&r.push(i[o]);I[n]=r}}E.dragManager.endpointDeleted(e)}},this.deleteEveryEndpoint=function(){for(var t in I){var e=I[t];if(e&&e.length)for(var n=0;n<e.length;n++)E.deleteEndpoint(e[n])}delete I,I={},delete L,L={}};var ut=function(t,e,n){var i=E.Defaults.ConnectionType||E.getDefaultConnectionType();t=t.constructor==i?{connection:t,source:t.source,target:t.target,sourceId:t.sourceId,targetId:t.targetId,sourceEndpoint:t.endpoints[0],targetEndpoint:t.endpoints[1]}:t;e&&E.fire("jsPlumbConnectionDetached",t,n),E.anchorManager.connectionDetached(t)},ct=function(t){E.fire("connectionDrag",t)},dt=function(t){E.fire("connectionDragStop",t)};this.detach=function(){var t,e,n,i,r,o;0!=arguments.length&&(e=E.Defaults.ConnectionType||E.getDefaultConnectionType(),n=arguments[0].constructor==e,t=!1!==(i=2==arguments.length&&n?arguments[1]||{}:arguments[0]).fireEvent,e=i.forceDetach,(n=n?arguments[0]:i.connection)?(e||n.isDetachAllowed(n)&&n.endpoints[0].isDetachAllowed(n)&&n.endpoints[1].isDetachAllowed(n))&&(e||E.checkCondition("beforeDetach",n))&&n.endpoints[0].detach(n,!1,!0,t):(i=C.extend({},i)).uuids?Q(i.uuids[0]).detachFrom(Q(i.uuids[1]),t):i.sourceEndpoint&&i.targetEndpoint?i.sourceEndpoint.detachFrom(i.targetEndpoint):(r=st(i.source),o=st(i.target),nt(r,(function(e){(e.sourceId==r&&e.targetId==o||e.targetId==r&&e.sourceId==o)&&E.checkCondition("beforeDetach",e)&&e.endpoints[0].detach(e,!1,!0,t)}))))},this.detachAllConnections=function(t,e){e=e||{};t=c(t=v(t),"id");var n=I[t];if(n&&n.length)for(var i=0;i<n.length;i++)n[i].detachAll(e.fireEvent)},this.detachEveryConnection=function(t){for(var e in t=t||{},I){var n=I[e];if(n&&n.length)for(var i=0;i<n.length;i++)n[i].detachAll(t.fireEvent)}delete k,k={}},this.draggable=function(t,e){if("object"==typeof t&&t.length)for(var n=0;n<t.length;n++)(i=v(t[n]))&&P(i,!0,e);else if(t._nodes){var i;for(n=0;n<t._nodes.length;n++)(i=v(t._nodes[n]))&&P(i,!0,e)}else(i=v(t))&&P(i,!0,e)},this.extend=function(t,e){return C.CurrentLibrary.extend(t,e)},this.getDefaultEndpointType=function(){return Qt},this.getDefaultConnectionType=function(){return qt};var ht=function(t,e,n,i){for(var r=0;r<t.length;r++)t[r][e].apply(t[r],n);return i(t)},pt=function(t,e,n){for(var i=[],r=0;r<t.length;r++)i.push([t[r][e].apply(t[r],n),t[r]]);return i},ft=function(t,e,n){return function(){return ht(t,e,arguments,n)}},gt=function(t,e){return function(){return pt(t,e,arguments)}};this.getConnections=function(t,e){function n(t){var e=[];if(t)if("string"==typeof t){if("*"===t)return t;e.push(t)}else e=t;return e}function i(t,e){return"*"===t||!(0<t.length)||-1!=r(t,e)}t?t.constructor==String&&(t={scope:t}):t={};var o,a,s,l=n(t.scope||E.getDefaultScope()),u=n(t.source),c=n(t.target),d=!e&&1<l.length?{}:[];for(o in k)if(i(l,o))for(var h=0;h<k[o].length;h++){var p=k[o][h];i(u,p.sourceId)&&i(c,p.targetId)&&(a=o,s=p,p=void 0,!e&&1<l.length?(null==(p=d[a])&&(d[a]=p=[]),p.push(s)):d.push(s))}return d};var mt=function(t){return{setHover:ft(t,"setHover",mt),removeAllOverlays:ft(t,"removeAllOverlays",mt),setLabel:ft(t,"setLabel",mt),addOverlay:ft(t,"addOverlay",mt),removeOverlay:ft(t,"removeOverlay",mt),removeOverlays:ft(t,"removeOverlays",mt),showOverlay:ft(t,"showOverlay",mt),hideOverlay:ft(t,"hideOverlay",mt),showOverlays:ft(t,"showOverlays",mt),hideOverlays:ft(t,"hideOverlays",mt),setPaintStyle:ft(t,"setPaintStyle",mt),setHoverPaintStyle:ft(t,"setHoverPaintStyle",mt),setDetachable:ft(t,"setDetachable",mt),setConnector:ft(t,"setConnector",mt),setParameter:ft(t,"setParameter",mt),setParameters:ft(t,"setParameters",mt),detach:function(){for(var e=0;e<t.length;e++)E.detach(t[e])},getLabel:gt(t,"getLabel"),getOverlay:gt(t,"getOverlay"),isHover:gt(t,"isHover"),isDetachable:gt(t,"isDetachable"),getParameter:gt(t,"getParameter"),getParameters:gt(t,"getParameters"),getPaintStyle:gt(t,"getPaintStyle"),getHoverPaintStyle:gt(t,"getHoverPaintStyle"),length:t.length,each:function(e){for(var n=0;n<t.length;n++)e(t[n]);return mt(t)},get:function(e){return t[e]}}};this.select=function(t){return(t=t||{}).scope=t.scope||"*",t=E.getConnections(t,!0),mt(t)},this.getAllConnections=function(){return k},this.getDefaultScope=function(){return F},this.getEndpoint=Q,this.getEndpoints=function(t){return I[st(t)]},this.getId=st,this.getOffset=function(t){return O[t],ot({elId:t})},this.getSelector=function(t){return C.CurrentLibrary.getSelector(t)},this.getSize=function(t){return H[t]||ot({elId:t}),H[t]},this.appendElement=W;var vt=!1;function yt(t,e){t.paintStyle=t.paintStyle||E.Defaults.EndpointStyles[e]||E.Defaults.EndpointStyle||C.Defaults.EndpointStyles[e]||C.Defaults.EndpointStyle,t.hoverPaintStyle=t.hoverPaintStyle||E.Defaults.EndpointHoverStyles[e]||E.Defaults.EndpointHoverStyle||C.Defaults.EndpointHoverStyles[e]||C.Defaults.EndpointHoverStyle,t.anchor=t.anchor||E.Defaults.Anchors[e]||E.Defaults.Anchor||C.Defaults.Anchors[e]||C.Defaults.Anchor,t.endpoint=t.endpoint||E.Defaults.Endpoints[e]||E.Defaults.Endpoint||C.Defaults.Endpoints[e]||C.Defaults.Endpoint}this.isHoverSuspended=function(){return vt},this.setHoverSuspended=function(t){vt=t},this.isCanvasAvailable=function(){return t},this.isSVGAvailable=function(){return e},this.isVMLAvailable=n,this.hide=function(t,e){j(t,"none",e)},this.idstamp=U,this.init=function(){var t;A||(E.setRenderMode(E.Defaults.RenderMode),(t=function(t){C.CurrentLibrary.bind(document,t,(function(e){if(!E.currentlyDragging&&V==C.CANVAS){for(var n in k)for(var i=k[n],r=0;r<i.length;r++)if(i[r].connector[t](e))return;for(var o in I){var a=I[o];for(r=0;r<a.length;r++)if(a[r].endpoint[t](e))return}}}))})("click"),t("dblclick"),t("mousemove"),t("mousedown"),t("mouseup"),t("contextmenu"),A=!0,E.fire("ready"))},this.log=null,this.jsPlumbUIComponent=x,this.makeAnchor=function(){if(0==arguments.length)return null;var t,e,n=arguments[0],i=arguments[1],r=null;return n.compute&&n.getOrientation?n:("string"==typeof n?r=C.Anchors[arguments[0]]({elementId:i,jsPlumbInstance:E}):s(n)&&(s(n[0])||l(n[0])?r=2==n.length&&l(n[0])&&u(n[1])?(t=C.extend({elementId:i,jsPlumbInstance:E},n[1]),C.Anchors[n[0]](t)):new Ot(n,null,i):(e={x:n[0],y:n[1],orientation:4<=n.length?[n[2],n[3]]:[0,0],offsets:6==n.length?[n[4],n[5]]:[0,0],elementId:i},(r=new It(e)).clone=function(){return new It(e)})),r.id||(r.id="anchor_"+U()),r)},this.makeAnchors=function(t,e,n){for(var i=[],r=0;r<t.length;r++)"string"==typeof t[r]?i.push(C.Anchors[t[r]]({elementId:e,jsPlumbInstance:n})):s(t[r])&&i.push(E.makeAnchor(t[r],e,n));return i},this.makeDynamicAnchor=function(t,e){return new Ot(t,e)};var bt={},xt={},wt={},Ct={};this.makeTarget=function(t,e,n){var i=C.extend({_jsPlumb:E},n);C.extend(i,e),yt(i,1);for(var r=C.CurrentLibrary,o=i.scope||E.Defaults.Scope,a=!(!1===i.deleteEndpointsOnDetach),s=i.maxConnections||-1,l=(t=q(t)).length&&t.constructor!=String?t:[t],u=0;u<l.length;u++)!function(t){var e=st(t);bt[e]=i,wt[e]=i.uniqueEndpoint,Ct[e]=s,Pt[e]=!0,proxyComponent=new x(i);var n=C.extend({},i.dropOptions||{}),l=r.dragEvents.drop;n.scope=n.scope||o,n[l]=lt(n[l],(function(){var n=C.CurrentLibrary.getDropEvent(arguments),o=E.select({target:e}).length;if(!Pt[e]||0<Ct[e]&&o>=Ct[e])return console.log("target element "+e+" is full."),!1;E.currentlyDragging=!1;var s=v(r.getDragObject(arguments)),l=c(s,"dragId"),u=c(s,"originalScope"),d=z[l],h=d.endpoints[0];i.endpoint&&C.extend({},i.endpoint),h.anchor.locked=!1,u&&r.setDragScope(s,u);var p=proxyComponent.isDropAllowed(d.sourceId,st(t),d.scope,d,null);d.endpointsToDeleteOnDetach&&(h===d.endpointsToDeleteOnDetach[0]?d.endpointsToDeleteOnDetach[0]=null:h===d.endpointsToDeleteOnDetach[1]&&(d.endpointsToDeleteOnDetach[1]=null)),d.suspendedEndpoint&&(d.targetId=d.suspendedEndpoint.elementId,d.target=r.getElementObject(d.suspendedEndpoint.elementId),d.endpoints[1]=d.suspendedEndpoint),p?(h.detach(d,!1,!0,!1),o=xt[e]||E.addEndpoint(t,i),i.uniqueEndpoint&&(xt[e]=o),o._makeTargetCreator=!0,null!=o.anchor.positionFinder&&(l=r.getUIPosition(arguments),s=r.getOffset(t),p=r.getSize(t),p=o.anchor.positionFinder(l,s,p,o.anchor.constructorParams),o.anchor.x=p[0],o.anchor.y=p[1]),u=E.connect({source:h,target:o,scope:u,previousConnection:d,container:d.parent,deleteEndpointsOnDetach:a,doNotFireConnectionEvent:h.endpointWillMoveAfterConnection}),d.endpoints[1]._makeTargetCreator&&d.endpoints[1].connections.length<2&&E.deleteEndpoint(d.endpoints[1]),a&&(u.endpointsToDeleteOnDetach=[h,o]),u.repaint()):d.suspendedEndpoint&&(h.isReattach?(d.setHover(!1),d.floatingAnchorIndex=null,d.suspendedEndpoint.addConnection(d),E.repaint(h.elementId)):h.detach(d,!1,!0,!0,n))})),r.initDroppable(t,n,!0)}(v(l[u]));return E},this.unmakeTarget=function(t,e){return t=C.CurrentLibrary.getElementObject(t),t=st(t),e||(delete bt[t],delete wt[t],delete Ct[t],delete Pt[t]),E},this.makeTargets=function(t,e,n){for(var i=0;i<t.length;i++)E.makeTarget(t[i],e,n)};var _t={},Et={},Mt={},Dt={},St={},Pt={};function jt(t,e,n,i){var r="source"==t?Dt:Pt;if(l(e))r[e]=i?!r[e]:n;else if(e.length){e=q(e);for(var o=0;o<e.length;o++){var a=_el=C.CurrentLibrary.getElementObject(e[o]);r[a=st(_el)]=i?!r[a]:n}}return E}this.makeSource=function(t,e,n){var i=C.extend({},n);function r(t){var n=st(t),r=null!=(l=i.parent)?E.getId(a.getElementObject(l)):n;_t[r]=i,Mt[r]=i.uniqueEndpoint,Dt[r]=!0;var s=a.dragEvents.stop,l=a.dragEvents.drag,u=C.extend({},i.dragOptions||{}),c=u.drag,d=u.stop,h=null,p=!1;function f(o){if(Dt[r]){if(e.filter&&!1===e.filter(a.getOriginalEvent(o),t))return;var s,l=ot({elId:n}),c=((o.pageX||o.page.x)-l.left)/l.width,d=((o.pageY||o.page.y)-l.top)/l.height,f=c,g=d;function m(){p&&E.deleteEndpoint(h)}i.parent&&(s=a.getElementObject(i.parent),s=st(s),l=ot({elId:s}),f=((o.pageX||o.page.x)-l.left)/l.width,g=((o.pageY||o.page.y)-l.top)/l.height),l={},C.extend(l,i),l.isSource=!0,l.anchor=[c,d,0,0],l.parentAnchor=[f,g,0,0],l.dragOptions=u,i.parent&&(g=l.container||E.Defaults.Container||C.Defaults.Container,l.container=g||C.CurrentLibrary.getParent(i.parent)),h=E.addEndpoint(n,l),p=!0,h.endpointWillMoveAfterConnection=null!=i.parent,h.endpointWillMoveTo=i.parent?a.getElementObject(i.parent):null,E.registerListener(h.canvas,"mouseup",m),E.registerListener(t,"mouseup",m),a.trigger(h.canvas,"mousedown",o)}}u.scope=u.scope||i.scope,u[l]=lt(u[l],(function(){c&&c.apply(this,arguments),p=!1})),u[s]=lt(u[s],(function(){var t,e,r,s;d&&d.apply(this,arguments),E.currentlyDragging=!1,0==h.connections.length?E.deleteEndpoint(h):(a.unbind(h.canvas,"mousedown"),s=i.anchor||E.Defaults.Anchor,h.anchor,t=h.connections[0],h.anchor=E.makeAnchor(s,n,E),!i.parent||(e=a.getElementObject(i.parent))&&(r=h.elementId,s=i.container||E.Defaults.Container||C.Defaults.Container,h.setElement(e,s),h.endpointWillMoveAfterConnection=!1,E.anchorManager.rehomeEndpoint(r,e),t.previousConnection=null,o(k[t.scope],(function(e){return e.id===t.id})),E.anchorManager.connectionDetached({sourceId:t.sourceId,targetId:t.targetId,connection:t}),J(t)),h.repaint(),E.repaint(h.elementId),E.repaint(t.targetId))})),E.registerListener(t,"mousedown",f),St[n]=f}C.extend(i,e),yt(i,0);for(var a=C.CurrentLibrary,s=(t=q(t)).length&&t.constructor!=String?t:[t],l=0;l<s.length;l++)r(v(s[l]));return E},this.unmakeSource=function(t,e){t=C.CurrentLibrary.getElementObject(t);var n=st(t);return(t=St[n])&&E.unregisterListener(_el,"mousedown",t),e||(delete _t[n],delete Mt[n],delete Dt[n],delete St[n]),E},this.unmakeEverySource=function(){for(var t in Dt)E.unmakeSource(t,!0);_t={},Mt={},Dt={},St={}},this.unmakeEveryTarget=function(){for(var t in Pt)E.unmakeTarget(t,!0);return bt={},wt={},Ct={},Pt={},E},this.makeSources=function(t,e,n){for(var i=0;i<t.length;i++)E.makeSource(t[i],e,n);return E},this.setSourceEnabled=function(t,e){return jt("source",t,e)},this.toggleSourceEnabled=function(t){return jt("source",t,null,!0),E.isSourceEnabled(t)},this.isSource=function(t){return t=C.CurrentLibrary.getElementObject(t),null!=Dt[st(t)]},this.isSourceEnabled=function(t){return t=C.CurrentLibrary.getElementObject(t),!0===Dt[st(t)]},this.setTargetEnabled=function(t,e){return jt("target",t,e)},this.toggleTargetEnabled=function(t){return jt("target",t,null,!0)},this.isTarget=function(t){return t=C.CurrentLibrary.getElementObject(t),null!=Pt[st(t)]},this.isTargetEnabled=function(t){return t=C.CurrentLibrary.getElementObject(t),!0===Pt[st(t)]},this.ready=function(t){E.bind("ready",t)},this.repaint=function(t){function e(t){Y(v(t))}if("object"==typeof t)for(var n=0;n<t.length;n++)e(t[n]);else e(t)},this.repaintEverything=function(){for(var t in I)Y(v(t),null,null)},this.removeAllEndpoints=function(t){t=c(t,"id");var e=I[t];if(e)for(var n=0;n<e.length;n++)E.deleteEndpoint(e[n]);I[t]=[]},this.removeEveryEndpoint=this.deleteEveryEndpoint,this.removeEndpoint=function(t,e){E.deleteEndpoint(e)};var Tt={};function At(t){return function(e,n){return!1==(t?e[0][0]<n[0][0]||e[0][1]>n[0][1]:e[0][0]>n[0][0]||e[0][1]>n[0][1])?-1:1}}this.registerListener=function(t,e,n){C.CurrentLibrary.bind(t,e,n),B(Tt,e,{el:t,event:e,listener:n})},this.unregisterListener=function(t,e,n){C.CurrentLibrary.unbind(t,e,n),o(Tt,(function(t){return t.type==e&&t.listener==n}))},this.reset=function(){E.deleteEveryEndpoint(),E.unbind(),bt={},xt={},wt={},Ct={},_t={},Et={},Mt={},function(){for(var t in Tt)for(var e=0;e<Tt[t].length;e++){var n=Tt[t][e];C.CurrentLibrary.unbind(n.el,n.event,n.listener)}Tt={}}(),E.anchorManager.reset(),E.dragManager.reset()},this.setDefaultScope=function(t){F=t},this.setDraggable=function(t,e){return X(t,(function(t,n){R[n]=e,C.CurrentLibrary.isDragSupported(t)&&C.CurrentLibrary.setDraggable(t,e)}))},this.setId=function(t,e,n){var i=t.constructor==String?t:E.getId(t),r=E.getConnections({source:i,scope:"*"},!0),o=E.getConnections({target:i,scope:"*"},!0);e=""+e,n||(t=C.CurrentLibrary.getElementObject(i),C.CurrentLibrary.setAttribute(t,"id",e)),t=C.CurrentLibrary.getElementObject(e),I[e]=I[i]||[];for(var a=0;a<I[e].length;a++)I[e][a].elementId=e,I[e][a].element=t,I[e][a].anchor.elementId=e;function s(n,i,r){for(var o=0;o<n.length;o++)n[o].endpoints[i].elementId=e,n[o].endpoints[i].element=t,n[o][r+"Id"]=e,n[o][r]=t}delete I[i],E.anchorManager.changeId(i,e),s(r,0,"source"),s(o,1,"target")},this.setIdChanged=function(t,e){E.setId(t,e,!0)},this.setDebugLog=function(t){},this.setRepaintFunction=function(t){},this.setSuspendDrawing=function(t,e){G=t,e&&E.repaintEverything()},this.CANVAS="canvas",this.SVG="svg",this.VML="vml",this.setRenderMode=function(i){if(i){if((i=i.toLowerCase())!==C.CANVAS&&i!==C.SVG&&i!==C.VML)throw new Error("render mode must be one of jsPlumb.CANVAS, jsPlumb.SVG or jsPlumb.VML");return i===C.SVG?e?V=C.SVG:t?V=C.CANVAS:n()&&(V=C.VML):i===C.CANVAS&&t?V=C.CANVAS:n()&&(V=C.VML),V}},this.getRenderMode=function(){return V},this.show=function(t,e){j(t,"block",e)},this.sizeCanvas=function(t,e,n,i,r){t&&(t.style.height=r+"px",t.height=r,t.style.width=i+"px",t.width=i,t.style.left=e+"px",t.style.top=n+"px")},this.getTestHarness=function(){return{endpointsByElement:I,endpointCount:function(t){return(t=I[t])?t.length:0},connectionCount:function(t){return(t=k[t=t||F])?t.length:0},getId:st,makeAnchor:self.makeAnchor,makeDynamicAnchor:self.makeDynamicAnchor}},this.toggle=T,this.toggleVisible=T,this.toggleDraggable=function(t){return X(t,(function(t,e){var n=null!=R[e]&&R[e];return R[e]=n=!n,C.CurrentLibrary.setDraggable(t,n),n}))},this.unload=function(){},this.wrap=lt,this.addListener=this.bind;var kt=function(t,e){var n=null,i=t;return"svg"===e.tagName.toLowerCase()&&e.parentNode?n=e.parentNode:e.offsetParent&&(n=e.offsetParent),null!=n&&(e="body"===n.tagName.toLowerCase()?{left:0,top:0}:h(n),n="body"===n.tagName.toLowerCase()?{left:0,top:0}:{left:n.scrollLeft,top:n.scrollTop},i[0]=t[0]-e.left+n.left,i[1]=t[1]-e.top+n.top),i},It=function(t){var e=this;this.x=t.x||0,this.y=t.y||0,this.elementId=t.elementId;var n=t.orientation||[0,0],i=null;this.offsets=t.offsets||[0,0],e.timestamp=null,this.compute=function(t){var n=t.xy,r=t.wh,o=t.element;return(t=t.timestamp)&&t===e.timestamp||(i=[n[0]+e.x*r[0]+e.offsets[0],n[1]+e.y*r[1]+e.offsets[1]],i=kt(i,o.canvas),e.timestamp=t),i},this.getOrientation=function(t){return n},this.equals=function(t){if(!t)return!1;var e=t.getOrientation(),n=this.getOrientation();return this.x==t.x&&this.y==t.y&&this.offsets[0]==t.offsets[0]&&this.offsets[1]==t.offsets[1]&&n[0]==e[0]&&n[1]==e[1]},this.getCurrentLocation=function(){return i}},Lt=function(t){var e=t.reference,n=(t=t.referenceCanvas,p(v(t))),i=null,r=null;this.x=0,this.y=0,this.isFloating=!0,this.compute=function(t){var e=t.xy;t=t.element,e=[e[0]+n[0]/2,e[1]+n[1]/2],e=kt(e,t.canvas);return r=e},this.getOrientation=function(t){return i||(t=e.getOrientation(t),[0*Math.abs(t[0])*-1,0*Math.abs(t[1])*-1])},this.over=function(t){i=t.getOrientation()},this.out=function(){i=null},this.getCurrentLocation=function(){return r}},Ot=function(t,e,n){function i(t){return t.constructor==It?t:E.makeAnchor(t,n,E)}this.isSelective=!0,this.isDynamic=!0;for(var r=[],o=0;o<t.length;o++)r[o]=i(t[o]);this.addAnchor=function(t){r.push(i(t))},this.getAnchors=function(){return r},this.locked=!1;var a=0<r.length?r[0]:null,s=(r.length,this),l=e||function(t,e,n,i,r){for(var o,a,s,l=n[0]+i[0]/2,u=n[1]+i[1]/2,c=-1,d=1/0,h=0;h<r.length;h++){var p=(o=r[h],a=u,p=e,void 0,s=t[0]+o.x*e[0],p=t[1]+o.y*e[1],Math.sqrt(Math.pow(l-s,2)+Math.pow(a-p,2)));p<d&&(c=h+0,d=p)}return r[c]};this.compute=function(t){var e=t.xy,n=t.wh,i=(t.timestamp,t.txy),o=t.twh;return s.locked||null==i||null==o||(t.timestamp=null,a=l(e,n,i,o,r),s.x=a.x,s.y=a.y),a.compute(t)},this.getCurrentLocation=function(){return null!=a?a.getCurrentLocation():null},this.getOrientation=function(t){return null!=a?a.getOrientation(t):[0,0]},this.over=function(t){null!=a&&a.over(t)},this.out=function(){null!=a&&a.out()}},Nt={},zt={},Rt={},Ht="horizontal",Ft="vertical",Vt="diagonal",Bt="identity",Wt=function(t,e,n,i){if(t===e)return{orientation:Bt,a:["top","top"]};var r=Math.atan2(i.centery-n.centery,i.centerx-n.centerx),o=Math.atan2(n.centery-i.centery,n.centerx-i.centerx);t=n.left<=i.left&&n.right>=i.left||n.left<=i.right&&n.right>=i.right||n.left<=i.left&&n.right>=i.right||i.left<=n.left&&i.right>=n.right,e=n.top<=i.top&&n.bottom>=i.top||n.top<=i.bottom&&n.bottom>=i.bottom||n.top<=i.top&&n.bottom>=i.bottom||i.top<=n.top&&i.bottom>=n.bottom;return t||e?t?{orientation:Ht,a:n.top<i.top?["bottom","top"]:["top","bottom"],theta:r,theta2:o}:{orientation:Ft,a:n.left<i.left?["right","left"]:["left","right"],theta:r,theta2:o}:(t=null,i.left>n.left&&i.top>n.top?t=["right","top"]:i.left>n.left&&n.top>i.top?t=["top","left"]:i.left<n.left&&i.top<n.top?t=["top","right"]:i.left<n.left&&i.top>n.top&&(t=["left","top"]),{orientation:Vt,a:t,theta:r,theta2:o})},$t={top:function(t,e){return t[0]>e[0]?1:-1},right:At(!0),bottom:At(!0),left:function(t,e){var n=t[0][0]<0?-Math.PI-t[0][0]:Math.PI-t[0][0];return(e[0][0]<0?-Math.PI-e[0][0]:Math.PI-e[0][0])<n||t[0][1]>e[0][1]?1:-1}},Ut=function(t,e){function n(e,n,i,r,o,a,s){if(0<r.length){function l(t,e){var n=kt([e[0],e[1]],t.canvas);zt[t.id]=[n[0],n[1],e[2],e[3]],Rt[t.id]=s}r=function(t,e){return t.sort(e)}(r,$t[e]);for(var u=function(t,e,n,i,r,o,a){for(var s=[],l=e[r?0:1]/(i.length+1),u=0;u<i.length;u++){var c=(u+1)*l,d=o*e[r?1:0];a&&(c=e[r?0:1]-c);var h=r?c:d,p=n[0]+h;h/=e[0],d=r?d:c,c=n[1]+d,d/=e[1],s.push([p,c,h,d,i[u][1],i[u][2]])}return s}(0,n,i,r,o,a,"right"===e||"top"===e),c=0;c<u.length;c++){var d=u[c][4],h=d.endpoints[0].elementId===t,p=d.endpoints[1].elementId===t;h?l(d.endpoints[0],u[c]):p&&l(d.endpoints[1],u[c])}}}var i=H[t],r=O[t];n("bottom",i,[r.left,r.top],e.bottom,!0,1,[0,1]),n("top",i,[r.left,r.top],e.top,!0,0,[0,-1]),n("left",i,[r.left,r.top],e.left,!1,0,[-1,0]),n("right",i,[r.left,r.top],e.right,!1,1,[1,0])};E.anchorManager=new function(){var t={},e={},n=this,r={};function s(t,e,n,r,o,s,l,u,c,d,h,p){var f=-1,g=r.endpoints[l],m=g.id,v=(o=[[e,n],r,o,s,m],t[c]),y=g._continuousAnchorEdge?t[g._continuousAnchorEdge]:null;if(y&&-1!=(t=i(y,(function(t){return t[4]==m})))){y.splice(t,1);for(var b=0;b<y.length;b++)a(h,y[b][1],(function(t){return t.id==y[b][1].id})),a(p,y[b][1].endpoints[l],(function(t){return t.id==y[b][1].endpoints[l].id}))}for(b=0;b<v.length;b++)1==l&&v[b][3]===s&&-1==f&&(f=b),a(h,v[b][1],(function(t){return t.id==v[b][1].id})),a(p,v[b][1].endpoints[l],(function(t){return t.id==v[b][1].endpoints[l].id}));u=u?-1!=f?f:0:v.length,v.splice(u,0,o),g._continuousAnchorEdge=c}this.reset=function(){t={},e={},r={}},this.newConnection=function(t){function n(t,n,s,l,u){i==r&&s.isContinuous&&(C.CurrentLibrary.removeElement(o[1].canvas),a=!1),B(e,l,[u,n,s.constructor==Ot])}var i=t.sourceId,r=t.targetId,o=t.endpoints,a=!0;n(0,o[0],o[0].anchor,r,t),a&&n(0,o[1],o[1].anchor,i,t)},this.connectionDetached=function(t){function i(t,n,i,r,a){i.constructor==Lt||o(e[r],(function(t){return t[0].id==a.id}))}var a=t.connection||t,s=a.sourceId,l=a.targetId;function u(t,e){var n;t&&(o(t.top,n=function(t){return t[4]==e}),o(t.left,n),o(t.bottom,n),o(t.right,n))}i(0,(t=a.endpoints)[1],t[1].anchor,s,a),i(0,t[0],t[0].anchor,l,a),s=a.sourceId,t=a.targetId,l=a.endpoints[0].id,a=a.endpoints[1].id,u(r[s],l),u(r[t],a),n.redraw(s),n.redraw(t)},this.add=function(e,n){B(t,n,e)},this.changeId=function(n,i){e[i]=e[n],t[i]=t[n],delete e[n],delete t[n]},this.getConnectionsFor=function(t){return e[t]||[]},this.getEndpointsFor=function(e){return t[e]||[]},this.deleteEndpoint=function(e){o(t[e.elementId],(function(t){return t.id==e.id}))},this.clearFor=function(e){delete t[e],t[e]=[]},this.redraw=function(n,i,o,l){var u=t[n]||[],c=e[n]||[],d=[],h=[],p=[];o=o||b(),l=l||{left:0,top:0},i=i&&{left:i.left+l.left,top:i.top+l.top},ot({elId:n,offset:i,recalc:!1,timestamp:o});for(var f=O[n],g=H[n],m={},v=0;v<c.length;v++){var y,x,w,C,_,E=c[v][0],M=E.sourceId,D=E.targetId,S=E.endpoints[0].anchor.isContinuous,P=E.endpoints[1].anchor.isContinuous;(S||P)&&(x=m[y=M+"_"+D],w=E.sourceId==n?1:0,S&&!r[M]&&(r[M]={top:[],right:[],bottom:[],left:[]}),P&&!r[D]&&(r[D]={top:[],right:[],bottom:[],left:[]}),n!=D&&ot({elId:D,timestamp:o}),n!=M&&ot({elId:M,timestamp:o}),C=at(D),_=at(M),D==M&&(S||P)?s(r[M],-Math.PI/2,0,E,!1,D,0,!1,"top",0,d,h):(x||(x=Wt(M,D,_.o,C.o),m[y]=x),S&&s(r[M],x.theta,0,E,!1,D,0,!1,x.a[0],0,d,h),P&&s(r[D],x.theta2,-1,E,!0,M,1,!0,x.a[1],0,d,h)),S&&a(p,M,(function(t){return t===M})),P&&a(p,D,(function(t){return t===D})),a(d,E,(function(t){return t.id==E.id})),(S&&0==w||P&&1==w)&&a(h,E.endpoints[w],(function(t){return t.id==E.endpoints[w].id})))}for(v=0;v<p.length;v++)Ut(p[v],r[p[v]]);for(v=0;v<u.length;v++)u[v].paint({timestamp:o,offset:f,dimensions:g});for(v=0;v<h.length;v++)h[v].paint({timestamp:o,offset:f,dimensions:g});for(v=0;v<c.length;v++){var j=c[v][1];if(j.anchor.constructor==Ot){j.paint({elementWithPrecedence:n}),a(d,c[v][0],(function(t){return t.id==c[v][0].id}));for(var T=0;T<j.connections.length;T++)j.connections[T]!==c[v][0]&&a(d,j.connections[T],(function(t){return t.id==j.connections[T].id}))}else j.anchor.constructor==It&&a(d,c[v][0],(function(t){return t.id==c[v][0].id}))}for((i=z[n])&&i.paint({timestamp:o,recalc:!1,elId:n}),v=0;v<d.length;v++)d[v].paint({elId:n,timestamp:o,recalc:!1})},this.rehomeEndpoint=function(e,i){for(var r=t[e]||[],o=E.getId(i),a=0;a<r.length;a++)n.add(r[a],o);r.splice(0,r.length)}},E.continuousAnchorFactory={get:function(t){var e=Nt[t.elementId];return e||(Nt[t.elementId]=e={type:"Continuous",compute:function(t){return zt[t.element.id]||[0,0]},getCurrentLocation:function(t){return zt[t.id]||[0,0]},getOrientation:function(t){return Rt[t.id]||[0,0]},isDynamic:!0,isContinuous:!0}),e}},E.dragManager=new function(){var t={},e=[],n={},i={};this.register=function(r){var o=C.CurrentLibrary;r=o.getElementObject(r);var a=E.getId(r),s=o.getDOMElement(r);t[a]||(t[a]=r,e.push(r),n[a]={}),function(t){for(var e,r,s=o.getElementObject(t),l=o.getOffset(s),u=0;u<t.childNodes.length;u++)3!=t.childNodes[u].nodeType&&(r=o.getElementObject(t.childNodes[u]),(e=E.getId(r,null,!0))&&i[e]&&0<i[e]&&(r=o.getOffset(r),n[a][e]={id:e,offset:{left:r.left-l.left,top:r.top-l.top}}))}(s)},this.endpointAdded=function(e){var r=C.CurrentLibrary,o=document.body,a=E.getId(e),s=r.getDOMElement(e).parentNode;for(i[a]=i[a]?i[a]+1:1;s!=o;){var l=E.getId(s);if(t[l]){var u=r.getElementObject(s),c=r.getOffset(u);null==n[l][a]&&(u=C.CurrentLibrary.getOffset(e),n[l][a]={id:a,offset:{left:u.left-c.left,top:u.top-c.top}});break}s=s.parentNode}},this.endpointDeleted=function(t){if(i[t.elementId]&&(i[t.elementId]--,i[t.elementId]<=0))for(var e in n)delete n[e][t.elementId]},this.getElementsForDraggable=function(t){return n[t]},this.reset=function(){t={},e=[],n={},i={}}};var qt=function(t){var e=this,n=!0;e.idPrefix="_jsplumb_c_",e.defaultLabelLocation=.5,e.defaultOverlayKeys=["Overlays","ConnectionOverlays"],this.parent=t.parent,f.apply(this,arguments),this.isVisible=function(){return n},this.setVisible=function(t){e[(n=t)?"showOverlays":"hideOverlays"](),e.connector&&e.connector.canvas&&(e.connector.canvas.style.display=t?"block":"none")},this.source=v(t.source),this.target=v(t.target),t.sourceEndpoint&&(this.source=t.sourceEndpoint.endpointWillMoveTo||t.sourceEndpoint.getElement()),t.targetEndpoint&&(this.target=t.targetEndpoint.getElement()),e.previousConnection=t.previousConnection;var i=t.cost;e.getCost=function(){return i};var r=!(e.setCost=function(t){i=t})!==t.bidirectional;function o(t,n,i,r,o,s,l){if(!t){i.endpoints||(i.endpoints=[null,null]);var u=i.endpoints[n]||i.endpoint||E.Defaults.Endpoints[n]||C.Defaults.Endpoints[n]||E.Defaults.Endpoint||C.Defaults.Endpoint;i.endpointStyles||(i.endpointStyles=[null,null]),i.endpointHoverStyles||(i.endpointHoverStyles=[null,null]);var c=i.endpointStyles[n]||i.endpointStyle||E.Defaults.EndpointStyles[n]||C.Defaults.EndpointStyles[n]||E.Defaults.EndpointStyle||C.Defaults.EndpointStyle;return null==c.fillStyle&&null!=s&&(c.fillStyle=s.strokeStyle),null==c.outlineColor&&null!=s&&(c.outlineColor=s.outlineColor),null==c.outlineWidth&&null!=s&&(c.outlineWidth=s.outlineWidth),s=i.endpointHoverStyles[n]||i.endpointHoverStyle||E.Defaults.EndpointHoverStyles[n]||C.Defaults.EndpointHoverStyles[n]||E.Defaults.EndpointHoverStyle||C.Defaults.EndpointHoverStyle,null!=l&&null==(s=null==s?{}:s).fillStyle&&(s.fillStyle=l.strokeStyle),l=i.anchors?i.anchors[n]:i.anchor||a(E.Defaults.Anchors[n],o)||a(C.Defaults.Anchors[n],o)||a(E.Defaults.Anchor,o)||a(C.Defaults.Anchor,o),o=i.uuids?i.uuids[n]:null,r=et({paintStyle:c,hoverPaintStyle:s,endpoint:u,connections:[e],uuid:o,anchor:l,source:r,scope:i.scope,container:i.container,reattach:i.reattach,detachable:i.detachable}),e.endpoints[n]=r,!1===i.drawEndpoints&&r.setVisible(!1,!0,!0),r}(e.endpoints[n]=t).addConnection(e)}e.isBidirectional=function(){return r},this.sourceId=c(this.source,"id"),this.targetId=c(this.target,"id"),this.getAttachedElements=function(){return e.endpoints},this.scope=t.scope,this.endpoints=[],this.endpointStyles=[];var a=function(t,e){if(t)return E.makeAnchor(t,e,E)};(w=o(t.sourceEndpoint,0,t,e.source,e.sourceId,t.paintStyle,t.hoverPaintStyle))&&B(I,this.sourceId,w),(_=o(e.sourceId==e.targetId&&null==t.targetEndpoint?w:t.targetEndpoint,1,t,e.target,e.targetId,t.paintStyle,t.hoverPaintStyle))&&B(I,this.targetId,_),this.scope||(this.scope=this.endpoints[0].scope),t.deleteEndpointsOnDetach&&(e.endpointsToDeleteOnDetach=[w,_]);var u=E.Defaults.ConnectionsDetachable;!1===t.detachable&&(u=!1),!1===e.endpoints[0].connectionsDetachable&&(u=!1),!1===e.endpoints[1].connectionsDetachable&&(u=!1),null==i&&(i=e.endpoints[0].getConnectionCost()),null==t.bidirectional&&(r=e.endpoints[0].areConnectionsBidirectional()),this.isDetachable=function(){return!0===u},this.setDetachable=function(t){u=!0===t};var d=C.extend({},this.endpoints[0].getParameters());C.extend(d,this.endpoints[1].getParameters()),C.extend(d,e.getParameters()),e.setParameters(d);var h=e.setHover;function p(t){e.setHover(t,!1)}e.setHover=function(t){e.connector.setHover.apply(e.connector,arguments),h.apply(e,arguments)},this.setConnector=function(n,i){null!=e.connector&&rt(e.connector.getDisplayElements(),e.parent);var r={_jsPlumb:e._jsPlumb,parent:t.parent,cssClass:t.cssClass,container:t.container,tooltip:e.tooltip};l(n)?this.connector=new C.Connectors[V][n](r):s(n)&&(this.connector=new C.Connectors[V][n[0]](C.extend(n[1],r))),e.canvas=e.connector.canvas,g(e.connector,e,p),i||e.repaint()},e.setConnector(this.endpoints[0].connector||this.endpoints[1].connector||t.connector||E.Defaults.Connector||C.Defaults.Connector,!0),this.setPaintStyle(this.endpoints[0].connectorStyle||this.endpoints[1].connectorStyle||t.paintStyle||E.Defaults.PaintStyle||C.Defaults.PaintStyle,!0),this.setHoverPaintStyle(this.endpoints[0].connectorHoverStyle||this.endpoints[1].connectorHoverStyle||t.hoverPaintStyle||E.Defaults.HoverPaintStyle||C.Defaults.HoverPaintStyle,!0),this.paintStyleInUse=this.getPaintStyle(),this.moveParent=function(t){var n=C.CurrentLibrary,i=n.getParent(e.connector.canvas);e.connector.bgCanvas&&(n.removeElement(e.connector.bgCanvas,i),n.appendElement(e.connector.bgCanvas,t)),n.removeElement(e.connector.canvas,i),n.appendElement(e.connector.canvas,t);for(var r=0;r<e.overlays.length;r++)e.overlays[r].isAppendedAtTopLevel&&(n.removeElement(e.overlays[r].canvas,i),n.appendElement(e.overlays[r].canvas,t),e.overlays[r].reattachListeners&&e.overlays[r].reattachListeners(e.connector));e.connector.reattachListeners&&e.connector.reattachListeners()},ot({elId:this.sourceId}),ot({elId:this.targetId});var m=O[this.sourceId],y=H[this.sourceId],x=O[this.targetId],w=H[this.targetId],_=b();d=this.endpoints[0].anchor.compute({xy:[m.left,m.top],wh:y,element:this.endpoints[0],elementId:this.endpoints[0].elementId,txy:[x.left,x.top],twh:w,tElement:this.endpoints[1],timestamp:_});this.endpoints[0].paint({anchorLoc:d,timestamp:_}),d=this.endpoints[1].anchor.compute({xy:[x.left,x.top],wh:w,element:this.endpoints[1],elementId:this.endpoints[1].elementId,txy:[m.left,m.top],twh:y,tElement:this.endpoints[0],timestamp:_}),this.endpoints[1].paint({anchorLoc:d,timestamp:_}),this.paint=function(t){for(var n=(t=t||{}).elId,i=t.ui,r=t.recalc,o=t.timestamp,a=(t=this.targetId,i=(this.sourceId,ot({elId:n,offset:i,recalc:r,timestamp:o})),r=ot({elId:t,timestamp:o}),t=this.endpoints[0],o=this.endpoints[1],t=t.anchor.getCurrentLocation(t),o=o.anchor.getCurrentLocation(o),0),s=0;s<e.overlays.length;s++)(u=e.overlays[s]).isVisible()&&(a=Math.max(a,u.computeMaxSize(e.connector)));var l=this.connector.compute(t,o,this.endpoints[0],this.endpoints[1],this.endpoints[0].anchor,this.endpoints[1].anchor,e.paintStyleInUse.lineWidth,a,i,r);e.connector.paint(l,e.paintStyleInUse);var u;for(s=0;s<e.overlays.length;s++)(u=e.overlays[s]).isVisible&&(e.overlayPlacements[s]=u.draw(e.connector,e.paintStyleInUse,l))},this.repaint=function(t){var e=!(!1===(t=t||{}).recalc);this.paint({elId:this.sourceId,recalc:e,timestamp:t.timestamp})}},Gt=function(t){var e=!1;return{drag:function(){if(e)return!(e=!1);var n=C.CurrentLibrary.getUIPosition(arguments),i=t.element;i&&(C.CurrentLibrary.setOffset(i,n),Y(v(i),n))},stopDrag:function(){e=!0}}},Yt=function(t,e,n,i,r){return i=new Lt({reference:e,referenceCanvas:i}),et({paintStyle:t,endpoint:n,anchor:i,source:r,scope:"__floating"})},Xt=function(t,e){var n=document.createElement("div");n.style.position="absolute";var i=v(n);W(n,e),e=st(i),ot({elId:e}),t.id=e,t.element=i},Qt=function(t){var e=this;e.idPrefix="_jsplumb_e_",e.defaultLabelLocation=[.5,.5],e.defaultOverlayKeys=["Overlays","EndpointOverlays"],this.parent=t.parent,f.apply(this,arguments);var n=!0,r=!(!1===(t=t||{}).enabled);this.isVisible=function(){return n},this.setVisible=function(t,i,r){if(n=t,e.canvas&&(e.canvas.style.display=t?"block":"none"),e[t?"showOverlays":"hideOverlays"](),!i)for(var o,a=0;a<e.connections.length;a++)e.connections[a].setVisible(t),r||(o=e===e.connections[a].endpoints[0]?1:0,1==e.connections[a].endpoints[o].connections.length&&e.connections[a].endpoints[o].setVisible(t,!0,!0))},this.isEnabled=function(){return r},this.setEnabled=function(t){r=t};var a=t.source,u=t.uuid,h=null,p=null;u&&(L[u]=e);var m=c(a,"id");this.elementId=m,this.element=a;var y=t.connectionCost;this.getConnectionCost=function(){return y};var b=!(this.setConnectionCost=function(t){y=t})!==t.connectionsBidirectional;this.areConnectionsBidirectional=function(){return b},this.setConnectionsBidirectional=function(t){b=t},e.anchor=t.anchor?E.makeAnchor(t.anchor,m,E):t.anchors?E.makeAnchor(t.anchors,m,E):E.makeAnchor("TopCenter",m,E),t._transient||E.anchorManager.add(e,m);var x=null;this.setEndpoint=function(n){var i={_jsPlumb:e._jsPlumb,parent:t.parent,container:t.container,tooltip:t.tooltip,connectorTooltip:t.connectorTooltip,endpoint:e};x=l(n)?new C.Endpoints[V][n](i):s(n)?(i=C.extend(n[1],i),new C.Endpoints[V][n[0]](i)):n.clone();var r=C.extend({},i);x.clone=function(){var t=new Object;return x.constructor.apply(t,[r]),t},e.endpoint=x,e.type=e.endpoint.type},this.setEndpoint(t.endpoint||E.Defaults.Endpoint||C.Defaults.Endpoint||"Dot");var w=e.setHover;e.setHover=function(){e.endpoint.setHover.apply(e.endpoint,arguments),w.apply(e,arguments)},g(e.endpoint,e,(function(t){0<e.connections.length?e.connections[0].setHover(t,!1):e.setHover(t)})),this.setPaintStyle(t.paintStyle||t.style||E.Defaults.EndpointStyle||C.Defaults.EndpointStyle,!0),this.setHoverPaintStyle(t.hoverPaintStyle||E.Defaults.EndpointHoverStyle||C.Defaults.EndpointHoverStyle,!0),this.paintStyleInUse=this.getPaintStyle();var _=this.getPaintStyle();this.connectorStyle=t.connectorStyle,this.connectorHoverStyle=t.connectorHoverStyle,this.connectorOverlays=t.connectorOverlays,this.connector=t.connector,this.connectorTooltip=t.connectorTooltip,this.isSource=t.isSource||!1,this.isTarget=t.isTarget||!1;var M=t.maxConnections||E.Defaults.MaxConnections;this.getAttachedElements=function(){return e.connections},this.canvas=this.endpoint.canvas,this.connections=t.connections||[],this.scope=t.scope||F,this.timestamp=null,e.isReattach=t.reattach||!1,e.connectionsDetachable=E.Defaults.ConnectionsDetachable,!1!==t.connectionsDetachable&&!1!==t.detachable||(e.connectionsDetachable=!1);var D,S,P,j,T,A,N,R,W,$,U,q,G=t.dragAllowedWhenFull||!0;this.computeAnchor=function(t){return e.anchor.compute(t)},this.addConnection=function(t){e.connections.push(t)},this.detach=function(t,n,r,a,s){var l=i(e.connections,(function(e){return e.id==t.id})),u=!1;if(a=!1!==a,0<=l&&(r||t._forceDetach||t.isDetachable()||t.isDetachAllowed(t))){var c=t.endpoints[0]==e?t.endpoints[1]:t.endpoints[0];if(r||t._forceDetach||e.isDetachAllowed(t)){if(e.connections.splice(l,1),!n&&(c.detach(t,!0,r),t.endpointsToDeleteOnDetach))for(var d=0;d<t.endpointsToDeleteOnDetach.length;d++){var h=t.endpointsToDeleteOnDetach[d];h&&0==h.connections.length&&E.deleteEndpoint(h)}rt(t.connector.getDisplayElements(),t.parent),o(k[t.scope],(function(e){return e.id==t.id})),u=!0,ut(t,!n&&a,s)}}return u},this.detachAll=function(t,n){for(;0<e.connections.length;)e.detach(e.connections[0],!1,!0,t,n)},this.detachFrom=function(t,n,i){for(var r=[],o=0;o<e.connections.length;o++)e.connections[o].endpoints[1]!=t&&e.connections[o].endpoints[0]!=t||r.push(e.connections[o]);for(o=0;o<r.length;o++)e.detach(r[o],!1,!0,n,i)&&r[o].setHover(!1,!1)},this.detachFromConnection=function(t){var n=i(e.connections,(function(e){return e.id==t.id}));0<=n&&e.connections.splice(n,1)},this.getElement=function(){return a},this.setElement=function(t,n){var i=st(t);o(I[e.elementId],(function(t){return t.id==e.id})),a=v(t),m=st(a),e.elementId=m;var r=tt({source:i,container:n});n=A.getParent(e.canvas);A.removeElement(e.canvas,n),A.appendElement(e.canvas,r);for(var s=0;s<e.connections.length;s++)e.connections[s].moveParent(r),e.connections[s].sourceId=m,e.connections[s].source=a;B(I,i,e)},this.getUuid=function(){return u},this.makeInPlaceCopy=function(){var t=e.anchor.getCurrentLocation(e),n=e.anchor.getOrientation(e);return et({anchor:{compute:function(){return[t[0],t[1]]},getCurrentLocation:function(){return[t[0],t[1]]},getOrientation:function(){return n}},source:a,paintStyle:this.getPaintStyle(),endpoint:x,_transient:!0,scope:e.scope})},this.isConnectedTo=function(t){var n=!1;if(t)for(var i=0;i<e.connections.length;i++)if(e.connections[i].endpoints[1]==t){n=!0;break}return n},this.isFloating=function(){return null!=h},this.connectorSelector=function(){var t=e.connections[0];return e.isTarget&&t||!(e.connections.length<M||-1==M)?t:null},this.isFull=function(){return!(e.isFloating()||M<1||e.connections.length<M)},this.setDragAllowedWhenFull=function(t){G=t},this.setStyle=e.setPaintStyle,this.equals=function(t){return this.anchor.equals(t.anchor)},this.paint=function(t){var n=(t=t||{}).timestamp,i=!(!1===t.recalc);if(!n||e.timestamp!==n){ot({elId:m,timestamp:n,recalc:i});var r=t.offset||O[m];if(r){var o,a,s=t.anchorPoint,l=t.connectorPaintStyle;null==s&&(a=t.dimensions||H[m],null!=r&&null!=a||(ot({elId:m,timestamp:n}),r=O[m],a=H[m]),o={xy:[r.left,r.top],wh:a,element:e,timestamp:n},i&&e.anchor.isDynamic&&0<e.connections.length&&(i=0==(a=(r=function(t){var n=0;if(null!=t)for(var i=0;i<e.connections.length;i++)if(e.connections[i].sourceId==t||e.connections[i].targetId==t){n=i;break}return e.connections[n]}(t.elementWithPrecedence)).endpoints[0]==e?1:0)?r.sourceId:r.targetId,t=O[i],i=H[i],o.txy=[t.left,t.top],o.twh=i,o.tElement=r.endpoints[a]),s=e.anchor.compute(o));var u=x.compute(s,e.anchor.getOrientation(e),e.paintStyleInUse,l||e.paintStyleInUse);x.paint(u,e.paintStyleInUse,e.anchor),e.timestamp=n;for(var c=0;c<e.overlays.length;c++){var d=e.overlays[c];d.isVisible&&(e.overlayPlacements[c]=d.draw(e.endpoint,e.paintStyleInUse,u))}}}},this.repaint=this.paint,this.removeConnection=this.detach,C.CurrentLibrary.isDragSupported(a)&&(P=!(D={id:null,element:null}),j=S=null,T=Gt(D),A=C.CurrentLibrary,U=t.dragOptions||{},N=C.extend({},A.defaultDragOptions),R=A.dragEvents.start,W=A.dragEvents.stop,$=A.dragEvents.drag,(U=C.extend(N,U)).scope=U.scope||e.scope,U[R]=lt(U[R],(function(){S=e.connectorSelector();var n=!0;if(e.isEnabled()||(n=!1),null!=S||t.isSource||(n=!1),t.isSource&&e.isFull()&&!G&&(n=!1),!1===(n=!(null!=S&&!S.isDetachable())&&n))return C.CurrentLibrary.stopDrag&&C.CurrentLibrary.stopDrag(),T.stopDrag(),!1;S&&!e.isFull()&&t.isSource&&(S=null),ot({elId:m}),(p=e.makeInPlaceCopy()).paint(),Xt(D,e.parent);var i=v(p.canvas),r=C.CurrentLibrary.getOffset(i),o=kt([r.left,r.top],p.canvas);C.CurrentLibrary.setOffset(D.element,{left:o[0],top:o[1]}),e.parentAnchor&&(e.anchor=E.makeAnchor(e.parentAnchor,e.elementId,E)),d(v(e.canvas),"dragId",D.id),d(v(e.canvas),"elId",m),t.proxy&&e.setPaintStyle(t.proxy.paintStyle),h=Yt(e.getPaintStyle(),e.anchor,x,e.canvas,D.element),null==S?(e.anchor.locked=!0,e.setHover(!1,!1),S=K({sourceEndpoint:e,targetEndpoint:h,source:e.endpointWillMoveTo||v(a),target:D.element,anchors:[e.anchor,h.anchor],paintStyle:t.connectorStyle,hoverPaintStyle:t.connectorHoverStyle,connector:t.connector,overlays:t.connectorOverlays})):(P=!0,S.connector.setHover(!1,!1),Y(v(p.canvas),!1,!0),n=S.endpoints[0].id==e.id?0:1,S.floatingAnchorIndex=n,e.detachFromConnection(S),d(i=v(e.canvas),"originalScope",r=C.CurrentLibrary.getDragScope(i)),o=C.CurrentLibrary.getDropScope(i),C.CurrentLibrary.setDragScope(i,o),0==n?(j=[S.source,S.sourceId,q,r],S.source=D.element,S.sourceId=D.id):(j=[S.target,S.targetId,q,r],S.target=D.element,S.targetId=D.id),S.endpoints[0==n?1:0].anchor.locked=!0,S.suspendedEndpoint=S.endpoints[n],S.suspendedEndpoint.setHover(!1),S.endpoints[n]=h,ct(S)),z[D.id]=S,h.addConnection(S),B(I,D.id,h),E.currentlyDragging=!0})),U[$]=lt(U[$],T.drag),U[W]=lt(U[W],(function(){var t=A.getDropEvent(arguments);E.currentlyDragging=!1,o(I[D.id],(function(t){return t.id==h.id})),rt([D.element[0],h.canvas]),it(p.canvas),E.anchorManager.clearFor(D.id);var n=null==S.floatingAnchorIndex?1:S.floatingAnchorIndex;S.endpoints[0==n?1:0].anchor.locked=!1,e.setPaintStyle(_),S.endpoints[n]==h&&(P&&S.suspendedEndpoint?(0==n?(S.source=j[0],S.sourceId=j[1]):(S.target=j[0],S.targetId=j[1]),C.CurrentLibrary.setDragScope(j[2],j[3]),S.endpoints[n]=S.suspendedEndpoint,!e.isReattach&&!S._forceDetach&&S.endpoints[0==n?1:0].detach(S,!1,!1,!0,t)||(S.setHover(!1),S.floatingAnchorIndex=null,S.suspendedEndpoint.addConnection(S),E.repaint(j[1])),S._forceDetach=null):(rt(S.connector.getDisplayElements(),e.parent),e.detachFromConnection(S))),e.anchor.locked=!1,e.paint({recalc:!1}),S.setHover(!1,!1),dt(S),p=S=null,delete I[h.elementId],h.anchor=null,h=null,E.currentlyDragging=!1})),q=v(e.canvas),C.CurrentLibrary.initDraggable(q,U,!0));var Y=function(n,i,r,o){var s,l,u;(t.isTarget||i)&&C.CurrentLibrary.isDropSupported(a)&&(s=t.dropOptions||E.Defaults.DropOptions||C.Defaults.DropOptions,(s=C.extend({},s)).scope=s.scope||e.scope,l=C.CurrentLibrary.dragEvents.drop,u=C.CurrentLibrary.dragEvents.over,i=C.CurrentLibrary.dragEvents.out,s[l]=lt(s[l],(function(){var t=C.CurrentLibrary.getDropEvent(arguments),n=v(C.CurrentLibrary.getDragObject(arguments)),i=c(n,"dragId"),r=(c(n,"elId"),c(n,"originalScope")),a=z[i];if(null!=a){var s=null==a.floatingAnchorIndex?1:a.floatingAnchorIndex;if(r&&C.CurrentLibrary.setDragScope(n,r),n=null==o||o.isEnabled(),!e.isFull()&&(0!=s||e.isSource)&&(1!=s||e.isTarget)&&n){if(r=!0,a.suspendedEndpoint&&a.suspendedEndpoint.id!=e.id&&(0==s?(a.source=a.suspendedEndpoint.element,a.sourceId=a.suspendedEndpoint.elementId):(a.target=a.suspendedEndpoint.element,a.targetId=a.suspendedEndpoint.elementId),a.isDetachAllowed(a)&&a.endpoints[s].isDetachAllowed(a)&&a.suspendedEndpoint.isDetachAllowed(a)&&E.checkCondition("beforeDetach",a)||(r=!1)),0==s?(a.source=e.element,a.sourceId=e.elementId):(a.target=e.element,a.targetId=e.elementId),r=r&&e.isDropAllowed(a.sourceId,a.targetId,a.scope,a,e)){a.endpoints[s].detachFromConnection(a),a.suspendedEndpoint&&a.suspendedEndpoint.detachFromConnection(a),(a.endpoints[s]=e).addConnection(a);var l,u=e.getParameters();for(l in u)a.setParameter(l,u[l]);a.suspendedEndpoint?(n=a.suspendedEndpoint.getElement(),r=a.suspendedEndpoint.elementId,ut({source:0==s?n:a.source,target:1==s?n:a.target,sourceId:0==s?r:a.sourceId,targetId:1==s?r:a.targetId,sourceEndpoint:0==s?a.suspendedEndpoint:a.endpoints[0],targetEndpoint:1==s?a.suspendedEndpoint:a.endpoints[1],connection:a},!0,t)):u.draggable&&C.CurrentLibrary.initDraggable(e.element,U,!0),J(a,null,t)}else a.suspendedEndpoint&&(a.endpoints[s]=a.suspendedEndpoint,a.setHover(!1),a._forceDetach=!0,0==s?(a.source=a.suspendedEndpoint.element,a.sourceId=a.suspendedEndpoint.elementId):(a.target=a.suspendedEndpoint.element,a.targetId=a.suspendedEndpoint.elementId),a.suspendedEndpoint.addConnection(a),a.endpoints[0].repaint(),a.repaint(),E.repaint(a.source.elementId),a._forceDetach=!1);a.floatingAnchorIndex=null}E.currentlyDragging=!1,delete z[i]}})),s[u]=lt(s[u],(function(){var t,n;e.isTarget&&(t=C.CurrentLibrary.getDragObject(arguments),n=c(v(t),"dragId"),null!=(t=z[n])&&(n=null==t.floatingAnchorIndex?1:t.floatingAnchorIndex,t.endpoints[n].anchor.over(e.anchor)))})),s[i]=lt(s[i],(function(){var t,n;e.isTarget&&(t=C.CurrentLibrary.getDragObject(arguments),n=c(v(t),"dragId"),null!=(t=z[n])&&(n=null==t.floatingAnchorIndex?1:t.floatingAnchorIndex,t.endpoints[n].anchor.out()))})),C.CurrentLibrary.initDroppable(n,s,!0,r))};return Y(v(e.canvas),!0,!(t._transient||e.anchor.isFloating),e),e}}window.console||(window.console={time:function(){},timeEnd:function(){},group:function(){},groupEnd:function(){},log:function(){}});var v=function(t){return C.CurrentLibrary.getElementObject(t)},y=jsPlumbUtil.log,b=(jsPlumbUtil.group,jsPlumbUtil.groupEnd,jsPlumbUtil.time,jsPlumbUtil.timeEnd,function(){return""+(new Date).getTime()}),x=function(t){var e=this,n=arguments,i=!1,r=t.parameters||{},o=e.idPrefix+(new Date).getTime(),a=null,s=null;e._jsPlumb=t._jsPlumb,e.getId=function(){return o},e.tooltip=t.tooltip,e.hoverClass=t.hoverClass||e._jsPlumb.Defaults.HoverClass||C.Defaults.HoverClass,jsPlumbUtil.EventGenerator.apply(this),this.clone=function(){var t=new Object;return e.constructor.apply(t,n),t},this.getParameter=function(t){return r[t]},this.getParameters=function(){return r},this.setParameter=function(t,e){r[t]=e},this.setParameters=function(t){r=t},this.overlayPlacements=[];var l=t.beforeDetach;this.isDetachAllowed=function(t){var n=e._jsPlumb.checkCondition("beforeDetach",t);if(l)try{n=l(t)}catch(t){y("jsPlumb: beforeDetach callback failed",t)}return n};var u=t.beforeDrop;function c(){var t;a&&s&&(C.extend(t={},a),C.extend(t,s),delete e.hoverPaintStyle,t.gradient&&a.fillStyle&&delete t.gradient,s=t)}this.isDropAllowed=function(t,n,i,r,o){var a=e._jsPlumb.checkCondition("beforeDrop",{sourceId:t,targetId:n,scope:i,connection:r,dropEndpoint:o});if(u)try{a=u({sourceId:t,targetId:n,scope:i,connection:r,dropEndpoint:o})}catch(t){y("jsPlumb: beforeDrop callback failed",t)}return a},this.setPaintStyle=function(t,n){a=t,e.paintStyleInUse=a,c(),n||e.repaint()},this.getPaintStyle=function(){return a},this.setHoverPaintStyle=function(t,n){s=t,c(),n||e.repaint()},this.getHoverPaintStyle=function(){return s},this.setHover=function(t,n,r){e._jsPlumb.currentlyDragging||e._jsPlumb.isHoverSuspended()||(i=t,null!=e.hoverClass&&null!=e.canvas&&(t?d.addClass(e.canvas,e.hoverClass):d.removeClass(e.canvas,e.hoverClass)),null!=s&&(e.paintStyleInUse=t?s:a,r=r||b(),e.repaint({timestamp:r,recalc:!1})),e.getAttachedElements&&!n&&f(t,b(),e))},this.isHover=function(){return i};var d=C.CurrentLibrary,h=["click","dblclick","mouseenter","mouseout","mousemove","mousedown","mouseup","contextmenu"],p={mouseout:"mouseexit"};this.attachListeners=function(t,e){for(var n=0;n<h.length;n++)!function(t,e,n){var i=p[n]||n;d.bind(t,n,(function(t){e.fire(i,e,t)}))}(t,e,h[n])};var f=function(t,n,i){var r=e.getAttachedElements();if(r)for(var o=0;o<r.length;o++)i&&i==r[o]||r[o].setHover(t,!0,n)};this.reattachListenersForElement=function(t){if(1<arguments.length){for(var n=0;n<h.length;n++)!function(t,e){p[e],d.unbind(t,e)}(t,h[n]);for(n=1;n<arguments.length;n++)e.attachListeners(t,arguments[n])}}},w=0,C=window.jsPlumb=new m;function _(t,e,n,i,r,o){return function(a){var s=(a=a||{}).jsPlumbInstance.makeAnchor([t,e,n,i,0,0],a.elementId,a.jsPlumbInstance);return s.type=r,o&&o(s,a),s}}C.getInstance=function(t){return(t=new m(t)).init(),t},C.Anchors.TopCenter=_(.5,0,0,-1,"TopCenter"),C.Anchors.BottomCenter=_(.5,1,0,1,"BottomCenter"),C.Anchors.LeftMiddle=_(0,.5,-1,0,"LeftMiddle"),C.Anchors.RightMiddle=_(1,.5,1,0,"RightMiddle"),C.Anchors.Center=_(.5,.5,0,0,"Center"),C.Anchors.TopRight=_(1,0,0,-1,"TopRight"),C.Anchors.BottomRight=_(1,1,0,1,"BottomRight"),C.Anchors.TopLeft=_(0,0,0,-1,"TopLeft"),C.Anchors.BottomLeft=_(0,1,0,1,"BottomLeft"),C.Defaults.DynamicAnchors=function(t){return t.jsPlumbInstance.makeAnchors(["TopCenter","RightMiddle","BottomCenter","LeftMiddle"],t.elementId,t.jsPlumbInstance)},C.Anchors.AutoDefault=function(t){return(t=t.jsPlumbInstance.makeDynamicAnchor(C.Defaults.DynamicAnchors(t))).type="AutoDefault",t},C.Anchors.Assign=_(0,0,0,0,"Assign",(function(t,e){var n=e.position||"Fixed";t.positionFinder=n.constructor==String?e.jsPlumbInstance.AnchorPositionFinders[n]:n,t.constructorParams=e})),C.Anchors.Continuous=function(t){return t.jsPlumbInstance.continuousAnchorFactory.get(t)},C.AnchorPositionFinders={Fixed:function(t,e,n,i){return[(t.left-e.left)/n[0],(t.top-e.top)/n[1]]},Grid:function(t,e,n,i){var r=t.left-e.left;t=t.top-e.top,e=n[0]/i.grid[0],i=n[1]/i.grid[1],r=Math.floor(r/e),t=Math.floor(t/i);return[(r*e+e/2)/n[0],(t*i+i/2)/n[1]]}}}(),function(){function t(t){jsPlumb.DOMElementComponent.apply(this,arguments);var e=[];this.getDisplayElements=function(){return e},this.appendDisplayElement=function(t){e.push(t)}}function e(t){var e=!0,n=this;this.isAppendedAtTopLevel=!0,this.component=t.component,this.loc=null==t.location?.5:t.location,this.endpointLoc=null==t.endpointLocation?[.5,.5]:t.endpointLocation,this.setVisible=function(t){e=t,n.component.repaint()},this.isVisible=function(){return e},this.hide=function(){n.setVisible(!1)},this.show=function(){n.setVisible(!0)},this.incrementLocation=function(t){n.loc+=t,n.component.repaint()},this.setLocation=function(t){n.loc=t,n.component.repaint()},this.getLocation=function(){return n.loc}}jsPlumb.DOMElementComponent=function(t){jsPlumb.jsPlumbUIComponent.apply(this,arguments),this.mousemove=this.dblclick=this.click=this.mousedown=this.mouseup=function(t){}},jsPlumb.Connectors.Straight=function(){this.type="Straight";var t,e,n,i,r,o,a,s,l,u,c=this;this.compute=function(c,d,h,p,f,g,m,v){var y=Math.abs(c[0]-d[0]),b=Math.abs(c[1]-d[1]),x=.45*y,w=.45*b;y*=1.9,b*=1.9;var C=Math.min(c[0],d[0])-x,_=Math.min(c[1],d[1])-w;return y<(v=Math.max(2*m,v))&&(C=c[0]+(d[0]-c[0])/2-(y=v)/2,x=(y-Math.abs(c[0]-d[0]))/2),b<v&&(_=c[1]+(d[1]-c[1])/2-(b=v)/2,w=(b-Math.abs(c[1]-d[1]))/2),o=c[0]<d[0]?x:y-x,a=c[1]<d[1]?w:b-w,s=c[0]<d[0]?y-x:x,l=c[1]<d[1]?b-w:w,t=[C,_,y,b,o,a,s,l],i=s-o,r=l-a,e=jsPlumbUtil.gradient({x:o,y:a},{x:s,y:l}),n=-1/e,Math.atan(e),Math.atan(n),u=Math.sqrt(i*i+r*r),t},this.pointOnPath=function(t,e){return 0!=t||e?1!=t||e?(t=e?0<t?t:u+t:t*u,jsPlumbUtil.pointOnLine({x:o,y:a},{x:s,y:l},t)):{x:s,y:l}:{x:o,y:a}},this.gradientAtPoint=function(t){return e},this.pointAlongPathFrom=function(t,e,n){return n=c.pointOnPath(t,n),t=1==t?{x:o+10*(s-o),y:a+10*(a-l)}:{x:s,y:l},jsPlumbUtil.pointOnLine(n,t,e)}},jsPlumb.Connectors.Bezier=function(t){var e,n,i,r,o,a,s,l,u,c,d=this;function h(){return[{x:o,y:a},{x:e[0],y:e[1]},{x:n[0],y:n[1]},{x:i,y:r}]}function p(t,e,n){return n?jsBezier.locationAlongCurveFrom(t,0<e?0:1,e):e}this.majorAnchor=(t=t||{}).curviness||150,this.minorAnchor=10,this.type="Bezier",this._findControlPoint=function(t,e,n,i,r,o,a){var s=o.getOrientation(i),l=a.getOrientation(r);o=s[0]!=l[0]||s[1]==l[1],i=[],a=d.majorAnchor,r=d.minorAnchor;return o?(0==l[0]?i.push(n[0]<e[0]?t[0]+r:t[0]-r):i.push(t[0]+a*l[0]),0==l[1]?i.push(n[1]<e[1]?t[1]+r:t[1]-r):i.push(t[1]+a*s[1])):(0==s[0]?i.push(e[0]<n[0]?t[0]+r:t[0]-r):i.push(t[0]-a*s[0]),0==s[1]?i.push(e[1]<n[1]?t[1]+r:t[1]-r):i.push(t[1]+a*l[1])),i},this.compute=function(t,h,p,f,g,m,v,y){v=v||0,u=Math.abs(t[0]-h[0])+v,c=Math.abs(t[1]-h[1])+v,s=Math.min(t[0],h[0])-v/2,l=Math.min(t[1],h[1])-v/2,o=t[0]<h[0]?u-v/2:v/2,a=t[1]<h[1]?c-v/2:v/2,i=t[0]<h[0]?v/2:u-v/2,r=t[1]<h[1]?v/2:c-v/2,e=d._findControlPoint([o,a],t,h,p,f,g,m),n=d._findControlPoint([i,r],h,t,f,p,m,g),p=Math.min(o,i),m=Math.min(e[0],n[0]),g=Math.min(p,m),p=Math.max(o,i),m=Math.max(e[0],n[0]),m=Math.max(p,m),u<m&&(u=m),g<0&&(s+=g,x=Math.abs(g),u+=x,e[0]+=x,o+=x,i+=x,n[0]+=x);m=Math.min(a,r),g=Math.min(e[1],n[1]);var b,x=Math.min(m,g);m=Math.max(a,r),g=Math.max(e[1],n[1]),g=Math.max(m,g);return c<g&&(c=g),x<0&&(l+=x,x=Math.abs(x),c+=x,e[1]+=x,a+=x,r+=x,n[1]+=x),y&&u<y&&(b=(y-u)/2,u=y,s-=b,o+=b,i+=b,e[0]=e[0]+b,n[0]=n[0]+b),y&&c<y&&(b=(y-c)/2,c=y,l-=b,a+=b,r+=b,e[1]=e[1]+b,n[1]=n[1]+b),[s,l,u,c,o,a,i,r,e[0],e[1],n[0],n[1]]},this.pointOnPath=function(t,e){var n=h();return t=p(n,t,e),jsBezier.pointOnCurve(n,t)},this.gradientAtPoint=function(t,e){var n=h();return t=p(n,t,e),jsBezier.gradientAtPoint(n,t)},this.pointAlongPathFrom=function(t,e,n){var i=h();return t=p(i,t,n),jsBezier.pointAlongCurveFrom(i,t,e)}},jsPlumb.Connectors.Flowchart=function(t){function e(t,e,n,i,r,o){var a=0==c.length?n:c[c.length-1][0],s=0==c.length?i:c[c.length-1][1];n=t==a?1/0:0,i=Math.abs(t==a?e-s:t-a);c.push([t,e,a,s,n,i]),d+=i,g=Math.max(g,t),m=Math.max(m,e),v=Math.min(v,t),y=Math.min(y,e)}function n(t,e){e&&(t=0<t?t/d:(d+t)/d);for(var n=h.length-1,i=1,r=0;r<h.length;r++)if(h[r][1]>=t){i=(t-h[n=r][0])/p[r];break}return{segment:c[n],proportion:i,index:n}}this.type="Flowchart";var i,r,o=this,a=(t=t||{}).stub||t.minStubLength||30,s=jsPlumbUtil.isArray(a)?a[0]:a,l=jsPlumbUtil.isArray(a)?a[1]:a,u=t.gap||0,c=[],d=0,h=[],p=[],f=[],g=-1/0,m=-1/0,v=1/0,y=1/0;this.compute=function(t,n,o,a,b,x,w,C,_,E){c=[],h=[],p=[],g=m=-1/(d=0),v=y=1/0,i=n[0]<t[0],r=n[1]<t[1];var M=w||1,D=M/2+(s+l),S=M/2+(l+s),P=M/2+(s+l),j=M/2+(l+s),T=b.orientation||b.getOrientation(o),A=x.orientation||x.getOrientation(a),k=(i?n:t)[0],I=(r?n:t)[1],L=Math.abs(n[0]-t[0])+D+S,O=Math.abs(n[1]-t[1])+P+j;(0==T[0]&&0==T[1]||0==A[0]&&0==A[1])&&(x=[1,0][M=O<L?0:1],A=[],(T=[])[M]=t[M]>n[M]?-1:1,A[M]=t[M]>n[M]?1:-1,T[x]=0,A[x]=0),L<C&&(D+=(C-L)/2,L=C),O<C&&(P+=(C-O)/2,O=C);var N=i?L-S+u*T[0]:D+u*T[0],z=r?O-j+u*T[1]:P+u*T[1],R=i?D+u*A[0]:L-S+u*A[0],H=r?P+u*A[1]:O-j+u*A[1],F=N+T[0]*s,V=z+T[1]*s,B=R+A[0]*l,W=H+A[1]*l,$=Math.abs(N-R)>s+l,U=Math.abs(z-H)>s+l,q=F+(B-F)/2,G=V+(W-V)/2;j=T[0]*A[0]+T[1]*A[1];f=[k-=D,I-=P,L,O,N,z,R,H];O=0==T[0]?"y":"x",j=-1==j?"opposite":1==j?"orthogonal":"perpendicular";var Y=jsPlumbUtil.segment([N,z],[R,H]);-1==T["x"==O?0:1]&&(Y={x:[null,4,3,2,1],y:[null,2,1,4,3]}[O][Y]),e(F,V,N,z);var X={oppositex:function(){if(o.elementId!=a.elementId)return!$||1!=Y&&2!=Y?[[F,G],[B,G]]:[[q,z],[q,H]];var t=V+(1-b.y)*_.height+Math.max(s,l);return[[F,t],[B,t]]},orthogonalx:function(){return 1==Y||2==Y?[[B,V]]:[[F,W]]},perpendicularx:function(){var t=(H+z)/2;return 1==Y&&1==A[1]||2==Y&&-1==A[1]?Math.abs(R-N)>Math.max(s,l)?[[B,V]]:[[F,V],[F,t],[B,t]]:3==Y&&-1==A[1]||4==Y&&1==A[1]?[[F,t],[B,t]]:3==Y&&1==A[1]||4==Y&&-1==A[1]?[[F,W]]:1==Y&&-1==A[1]||2==Y&&1==A[1]?Math.abs(R-N)>Math.max(s,l)?[[q,V],[q,W]]:[[F,W]]:void 0},oppositey:function(){if(o.elementId!=a.elementId)return!U||2!=Y&&3!=Y?[[q,V],[q,W]]:[[N,G],[R,G]];var t=F+(1-b.x)*_.width+Math.max(s,l);return[[t,V],[t,W]]},orthogonaly:function(){return 2==Y||3==Y?[[F,W]]:[[B,V]]},perpendiculary:function(){var t=(R+N)/2;return 2==Y&&-1==A[0]||3==Y&&1==A[0]?Math.abs(R-N)>Math.max(s,l)?[[F,W]]:[[F,G],[B,G]]:1==Y&&-1==A[0]||4==Y&&1==A[0]?[[t=(R+N)/2,V],[t,W]]:1==Y&&1==A[0]||4==Y&&-1==A[0]?[[B,V]]:2==Y&&1==A[0]||3==Y&&-1==A[0]?Math.abs(H-z)>Math.max(s,l)?[[F,G],[B,G]]:[[B,V]]:void 0}}[j+O]();if(X)for(var Q=0;Q<X.length;Q++)e(X[Q][0],X[Q][1],N,z);return e(B,W,N,z),e(R,H,N,z),function(){f.push(c.length);for(var t=0;t<c.length;t++)f.push(c[t][0]),f.push(c[t][1])}(),function(){for(var t=0,e=0;e<c.length;e++)p[e]=c[e][5]/d,h[e]=[t,t+=c[e][5]/d]}(),m>f[3]&&(f[3]=m+2*w),g>f[2]&&(f[2]=g+2*w),f},this.pointOnPath=function(t,e){return o.pointAlongPathFrom(t,0,e)},this.gradientAtPoint=function(t,e){return c[n(t,e).index][4]},this.pointAlongPathFrom=function(t,e,i){var r=n(t,i),o=r.segment,a=r.proportion;t=c[r.index][5];return{x:(i=c[r.index][4])==1/0?o[2]:o[2]>o[0]?o[0]+(1-a)*t-e:o[2]+a*t+e,y:0==i?o[3]:o[3]>o[1]?o[1]+(1-a)*t-e:o[3]+a*t+e,segmentInfo:r}}},jsPlumb.Endpoints.Dot=function(t){this.type="Dot";var e=this;this.radius=(t=t||{}).radius||10,this.defaultOffset=.5*this.radius,this.defaultInnerRadius=this.radius/3,this.compute=function(t,n,i,r){return i=i.radius||e.radius,[t[0]-i,t[1]-i,2*i,2*i,i]}},jsPlumb.Endpoints.Rectangle=function(t){this.type="Rectangle";var e=this;this.width=(t=t||{}).width||20,this.height=t.height||20,this.compute=function(t,n,i,r){var o=i.width||e.width;i=i.height||e.height;return[t[0]-o/2,t[1]-i/2,o,i]}},jsPlumb.Endpoints.Image=function(e){this.type="Image",t.apply(this,arguments);var n=this,i=!1,r=e.width,o=e.height,a=null,s=e.endpoint;this.img=new Image,n.ready=!1,this.img.onload=function(){n.ready=!0,r=r||n.img.width,o=o||n.img.height,a&&a(n)},s.setImage=function(t,e){t.constructor==String||t.src,a=e,n.img.src=t,null!=n.canvas&&n.canvas.setAttribute("src",t)},s.setImage(e.src||e.url,e.onload),this.compute=function(t,e,i,a){return n.anchorPoint=t,n.ready?[t[0]-r/2,t[1]-o/2,r,o]:[0,0,0,0]},n.canvas=document.createElement("img"),i=!1,n.canvas.style.margin=0,n.canvas.style.padding=0,n.canvas.style.outline=0,n.canvas.style.position="absolute",s=e.cssClass?" "+e.cssClass:"",n.canvas.className=jsPlumb.endpointClass+s,r&&n.canvas.setAttribute("width",r),o&&n.canvas.setAttribute("height",o),jsPlumb.appendElement(n.canvas,e.parent),n.attachListeners(n.canvas,n),this.paint=function(t,e,a){n.ready?function(){i||(n.canvas.setAttribute("src",n.img.src),n.appendDisplayElement(n.canvas),i=!0);var t=n.anchorPoint[0]-r/2,e=n.anchorPoint[1]-o/2;jsPlumb.sizeCanvas(n.canvas,t,e,r,o)}():window.setTimeout((function(){n.paint(t,e,a)}),200)}},jsPlumb.Endpoints.Blank=function(e){var n=this;this.type="Blank",t.apply(this,arguments),this.compute=function(t,e,n,i){return[t[0],t[1],10,0]},n.canvas=document.createElement("div"),n.canvas.style.display="block",n.canvas.style.width="1px",n.canvas.style.height="1px",n.canvas.style.background="transparent",n.canvas.style.position="absolute",n.canvas.className=n._jsPlumb.endpointClass,jsPlumb.appendElement(n.canvas,e.parent),this.paint=function(t,e,i){jsPlumb.sizeCanvas(n.canvas,t[0],t[1],t[2],t[3])}},jsPlumb.Endpoints.Triangle=function(t){this.type="Triangle",(t=t||{}).width=t.width||55,t.height=t.height||55,this.width=t.width,this.height=t.height,this.compute=function(t,e,n,i){var r=n.width||self.width;n=n.height||self.height;return[t[0]-r/2,t[1]-n/2,r,n]}},jsPlumb.Overlays.Arrow=function(t){this.type="Arrow",e.apply(this,arguments),this.isAppendedAtTopLevel=!1;var n=this;this.length=(t=t||{}).length||20,this.width=t.width||20,this.id=t.id;var i=(t.direction||1)<0?-1:1,r=t.paintStyle||{lineWidth:1},o=t.foldback||.623;this.computeMaxSize=function(){return 1.5*n.width},this.cleanup=function(){},this.draw=function(t,e,a){var s;if(t.pointAlongPathFrom){jsPlumbUtil.isString(n.loc)||1<n.loc||n.loc<0?(p=parseInt(n.loc),s=t.pointAlongPathFrom(p,i*n.length/2,!0),f=t.pointOnPath(p,!0),g=jsPlumbUtil.pointOnLine(s,f,n.length)):1==n.loc?(s=t.pointOnPath(n.loc),f=t.pointAlongPathFrom(n.loc,-1),g=jsPlumbUtil.pointOnLine(s,f,n.length)):0==n.loc?(g=t.pointOnPath(n.loc),f=t.pointAlongPathFrom(n.loc,1),s=jsPlumbUtil.pointOnLine(g,f,n.length)):(s=t.pointAlongPathFrom(n.loc,i*n.length/2),f=t.pointOnPath(n.loc),g=jsPlumbUtil.pointOnLine(s,f,n.length));var l=jsPlumbUtil.perpendicularLineTo(s,g,n.width),u=jsPlumbUtil.pointOnLine(s,g,o*n.length),c=Math.min(s.x,l[0].x,l[1].x),d=Math.max(s.x,l[0].x,l[1].x),h=Math.min(s.y,l[0].y,l[1].y),p=Math.max(s.y,l[0].y,l[1].y),f=r.strokeStyle||e.strokeStyle,g=r.fillStyle||e.strokeStyle;e=r.lineWidth||e.lineWidth;return n.paint(t,{hxy:s,tail:l,cxy:u},e,f,g,a),[c,d,h,p]}return[0,0,0,0]}},jsPlumb.Overlays.PlainArrow=function(t){t=t||{},t=jsPlumb.extend(t,{foldback:1}),jsPlumb.Overlays.Arrow.call(this,t),this.type="PlainArrow"},jsPlumb.Overlays.Diamond=function(t){var e=(t=t||{}).length||40;e=jsPlumb.extend(t,{length:e/2,foldback:2});jsPlumb.Overlays.Arrow.call(this,e),this.type="Diamond"},jsPlumb.Overlays.Label=function(t){this.type="Label",jsPlumb.DOMElementComponent.apply(this,arguments),e.apply(this,arguments),this.labelStyle=t.labelStyle||jsPlumb.Defaults.LabelStyle,this.id=t.id,this.cachedDimensions=null;var n=t.label||"",i=this,r=!1,o=document.createElement("div"),a=null;o.style.position="absolute";var s=t._jsPlumb.overlayClass+" "+(i.labelStyle.cssClass||t.cssClass||"");o.className=s,jsPlumb.appendElement(o,t.component.parent),jsPlumb.getId(o),i.attachListeners(o,i),i.canvas=o;var l=i.setVisible;i.setVisible=function(t){l(t),o.style.display=t?"block":"none"},this.getElement=function(){return o},this.cleanup=function(){null!=o&&jsPlumb.CurrentLibrary.removeElement(o)},this.setLabel=function(t){n=t,a=null,i.component.repaint()},this.getLabel=function(){return n},this.paint=function(t,e,n){r||(t.appendDisplayElement(o),i.attachListeners(o,t),r=!0),o.style.left=n[0]+e.minx+"px",o.style.top=n[1]+e.miny+"px"},this.getTextDimensions=function(){"function"==typeof n?(t=n(i),o.innerHTML=t.replace(/\r\n/g,"<br/>")):null==a&&(a=n,o.innerHTML=a.replace(/\r\n/g,"<br/>"));var t=jsPlumb.CurrentLibrary.getElementObject(o);return{width:(t=jsPlumb.CurrentLibrary.getSize(t))[0],height:t[1]}},this.computeMaxSize=function(t){return(t=i.getTextDimensions(t)).width?1.5*Math.max(t.width,t.height):0},this.draw=function(t,e,n){var r=i.getTextDimensions(t);if(null==r.width)return[0,0,0,0];var o,a,s;return s=t.pointOnPath?(o=i.loc,a=!1,(jsPlumbUtil.isString(i.loc)||i.loc<0||1<i.loc)&&(o=parseInt(i.loc),a=!0),t.pointOnPath(o,a)):{x:(a=i.loc.constructor==Array?i.loc:i.endpointLoc)[0]*n[2],y:a[1]*n[3]},minx=s.x-r.width/2,miny=s.y-r.height/2,i.paint(t,{minx,miny,td:r,cxy:s},n),[minx,minx+r.width,miny,miny+r.height]},this.reattachListeners=function(t){o&&i.reattachListenersForElement(o,i,t)}},jsPlumb.Overlays.GuideLines=function(){var t=this;t.length=50,t.lineWidth=5,this.type="GuideLines",e.apply(this,arguments),jsPlumb.jsPlumbUIComponent.apply(this,arguments),this.draw=function(e,n,i){var r=e.pointAlongPathFrom(t.loc,t.length/2),o=e.pointOnPath(t.loc),a=jsPlumbUtil.pointOnLine(r,o,t.length),s=jsPlumbUtil.perpendicularLineTo(r,a,40);o=jsPlumbUtil.perpendicularLineTo(a,r,20);return t.paint(e,[r,a,s,o],t.lineWidth,"red",null,i),[Math.min(r.x,a.x),Math.min(r.y,a.y),Math.max(r.x,a.x),Math.max(r.y,a.y)]},this.computeMaxSize=function(){return 50},this.cleanup=function(){}}}(),jsPlumb.Connectors.StateMachine=function(t){var e,n,i,r,o=null,a=[],s=t.curviness||10,l=t.margin||5,u=t.proximityLimit||80,c=t.orientation&&"clockwise"==t.orientation,d=t.loopbackRadius||25,h=!1,p=!1!==t.showLoopback;function f(){return[{x:i,y:r},{x:a[0],y:a[1]},{x:a[0]+1,y:a[1]+1},{x:e,y:n}]}function g(t,e,n){return n?jsBezier.locationAlongCurveFrom(t,0<e?0:1,e):e}this.type="StateMachine",t=t||{},this.compute=function(t,f,g,m,v,y,b,x){var w=Math.abs(t[0]-f[0]),C=Math.abs(t[1]-f[1]),_=.45*w,E=.45*C;w*=1.9,C*=1.9,b=b||1;var M,D,S,P,j,T=Math.min(t[0],f[0])-_,A=Math.min(t[1],f[1])-E;return o=p&&g.elementId==m.elementId?(h=!0,D=t[0],P=t[0],S=t[1]-l,j=t[1]-l,[T=D-d-b-d,A=(m=S-d)-d-b-d,w=2*b+4*d,C=2*b+4*d,D-T,m-A,d,c,D-T,S-A,P-T,j-A]):(h=!1,e=t[0]<f[0]?_:w-_,n=t[1]<f[1]?E:C-E,i=t[0]<f[0]?w-_:_,r=t[1]<f[1]?C-E:E,0==t[2]&&(e-=l),1==t[2]&&(e+=l),0==t[3]&&(n-=l),1==t[3]&&(n+=l),0==f[2]&&(i-=l),1==f[2]&&(i+=l),0==f[3]&&(r-=l),1==f[3]&&(r+=l),P=-1*(D=(e+i)/2)/(S=(n+r)/2),j=Math.atan(P),P==1/0||P==-1/0||Math.abs(s/2*Math.sin(j)),P==1/0||P==-1/0||Math.abs(s/2*Math.cos(j)),_=n,E=r,j=(P=e)<=(j=i)&&E<=_?1:P<=j&&_<=E?2:j<=P&&_<=E?3:4,P=Math.sqrt(Math.pow(i-e,2)+Math.pow(r-n,2)),_=D,E=S,D=j,S=t,j=f,f=t=s,a=P<=u?[_,E]:1==D?S[3]<=0&&1<=j[3]?[_+(S[2]<.5?-1*t:t),E]:1<=S[2]&&j[2]<=0?[_,E+(S[3]<.5?-1*f:f)]:[_+-1*t,E+-1*f]:2==D?1<=S[3]&&j[3]<=0?[_+(S[2]<.5?-1*t:t),E]:1<=S[2]&&j[2]<=0?[_,E+(S[3]<.5?-1*f:f)]:[_+ +t,E+-1*f]:3==D?1<=S[3]&&j[3]<=0?[_+(S[2]<.5?-1*t:t),E]:S[2]<=0&&1<=j[2]?[_,E+(S[3]<.5?-1*f:f)]:[_+-1*t,E+-1*f]:4==D?S[3]<=0&&1<=j[3]?[_+(S[2]<.5?-1*t:t),E]:S[2]<=0&&1<=j[2]?[_,E+(S[3]<.5?-1*f:f)]:[_+ +t,E+-1*f]:void 0,f=Math.max(3*Math.abs(a[0]-e),3*Math.abs(a[0]-i),Math.abs(i-e),2*b,x),x=Math.max(3*Math.abs(a[1]-n),3*Math.abs(a[1]-r),Math.abs(r-n),2*b,x),w<f&&(T-=(M=f-w)/2,e+=M/2,i+=M/2,w=f,a[0]+=M/2),C<x&&(A-=(M=x-C)/2,n+=M/2,r+=M/2,C=x,a[1]+=M/2),[T,A,w,C,e,n,i,r,a[0],a[1]])},this.pointOnPath=function(t,e){if(h){e&&(t/=2*Math.PI*d);var n=2*(t=0<t&&t<1?1-t:t)*Math.PI+Math.PI/2;return{x:o[4]+o[6]*Math.cos(n),y:o[5]+o[6]*Math.sin(n)}}return t=g(n=f(),t,e),jsBezier.pointOnCurve(n,t)},this.gradientAtPoint=function(t,e){if(h)return e&&(t/=2*Math.PI*d),Math.atan(2*t*Math.PI);var n=f();return t=g(n,t,e),jsBezier.gradientAtPoint(n,t)},this.pointAlongPathFrom=function(t,e,n){if(h){n&&(t/=2*Math.PI*d),0<t&&t<1&&(t=1-t);var i=e/(2*Math.PI*o[6])*2*Math.PI;i=2*t*Math.PI-i+Math.PI/2;return{x:o[4]+o[6]*Math.cos(i),y:o[5]+o[6]*Math.sin(i)}}return t=g(i=f(),t,n),jsBezier.pointAlongCurveFrom(i,t,e)}},jsPlumb.Connectors.canvas.StateMachine=function(t){var e=this;(t=t||{}).avoidSelector,jsPlumb.Connectors.StateMachine.apply(this,arguments),jsPlumb.CanvasConnector.apply(this,arguments),this._paint=function(t){var n,i;10==t.length?(e.ctx.beginPath(),e.ctx.moveTo(t[4],t[5]),e.ctx.bezierCurveTo(t[8],t[9],t[8],t[9],t[6],t[7]),e.ctx.stroke()):(e.ctx.save(),e.ctx.beginPath(),n=2*Math.PI,i=t[7],e.ctx.arc(t[4],t[5],t[6],0,n,i),e.ctx.stroke(),e.ctx.closePath(),e.ctx.restore())},this.createGradient=function(t,e){return e.createLinearGradient(t[4],t[5],t[6],t[7])}},jsPlumb.Connectors.svg.StateMachine=function(){jsPlumb.Connectors.StateMachine.apply(this,arguments),jsPlumb.SvgConnector.apply(this,arguments),this.getPath=function(t){return 10==t.length?"M "+t[4]+" "+t[5]+" C "+t[8]+" "+t[9]+" "+t[8]+" "+t[9]+" "+t[6]+" "+t[7]:"M"+(t[8]+4)+" "+t[9]+" A "+t[6]+" "+t[6]+" 0 1,0 "+(t[8]-4)+" "+t[9]}},jsPlumb.Connectors.vml.StateMachine=function(){jsPlumb.Connectors.StateMachine.apply(this,arguments),jsPlumb.VmlConnector.apply(this,arguments);var t=jsPlumb.vml.convertValue;this.getPath=function(e){if(10==e.length)return"m"+t(e[4])+","+t(e[5])+" c"+t(e[8])+","+t(e[9])+","+t(e[8])+","+t(e[9])+","+t(e[6])+","+t(e[7])+" e";var n=t(e[8]-e[6]),i=t(e[9]-2*e[6]);return"ar "+n+","+i+","+(n+t(2*e[6]))+","+(i+t(2*e[6]))+","+t(e[8])+","+t(e[9])+","+t(e[8])+","+t(e[9])+" e"}},function(){var t={"stroke-linejoin":"joinstyle",joinstyle:"joinstyle",endcap:"endcap",miterlimit:"miterlimit"},e=null;if(document.createStyleSheet&&document.namespaces){for(var n=[".jsplumb_vml","jsplumb\\:textbox","jsplumb\\:oval","jsplumb\\:rect","jsplumb\\:stroke","jsplumb\\:shape","jsplumb\\:group"],i=(e=document.createStyleSheet(),0);i<n.length;i++)e.addRule(n[i],"behavior:url(#default#VML);position:absolute;");document.namespaces.add("jsplumb","urn:schemas-microsoft-com:vml")}function r(t,e,n,i,r){return n=n||{},t=document.createElement("jsplumb:"+t),r.appendElement(t,i),t.className=(n.class?n.class+" ":"")+"jsplumb_vml",c(t,e),u(t,n),t}function o(t,e,n,i){"transparent"===e?i.setOpacity(n,"0.0"):i.setOpacity(n,"1.0")}function a(t,e,n,i){var a,s={};if(e.strokeStyle?(s.stroked="true",a=jsPlumbUtil.convertStyle(e.strokeStyle,!0),s.strokecolor=a,o(0,a,"stroke",n),s.strokeweight=e.lineWidth+"px"):s.stroked="false",e.fillStyle?(s.filled="true",a=jsPlumbUtil.convertStyle(e.fillStyle,!0),s.fillcolor=a,o(0,a,"fill",n)):s.filled="false",e.dashstyle)null==n.strokeNode?n.strokeNode=r("stroke",[0,0,0,0],{dashstyle:e.dashstyle},t,i):n.strokeNode.dashstyle=e.dashstyle;else if(e["stroke-dasharray"]&&e.lineWidth){for(var l=-1==e["stroke-dasharray"].indexOf(",")?" ":",",c=e["stroke-dasharray"].split(l),d="",h=0;h<c.length;h++)d+=Math.floor(c[h]/e.lineWidth)+l;null==n.strokeNode?n.strokeNode=r("stroke",[0,0,0,0],{dashstyle:d},t,i):n.strokeNode.dashstyle=d}u(t,s)}function s(){var t=this;jsPlumb.jsPlumbUIComponent.apply(this,arguments),this.opacityNodes={stroke:null,fill:null},this.initOpacityNodes=function(e){t.opacityNodes.stroke=r("stroke",[0,0,1,1],{opacity:"0.0"},e,t._jsPlumb),t.opacityNodes.fill=r("fill",[0,0,1,1],{opacity:"0.0"},e,t._jsPlumb)},this.setOpacity=function(e,n){(e=t.opacityNodes[e])&&(e.opacity=""+n)};var e=[];this.getDisplayElements=function(){return e},this.appendDisplayElement=function(n,i){i||t.canvas.parentNode.appendChild(n),e.push(n)}}jsPlumb.vml={};var l=1e3,u=function(t,e){for(var n in e)t[n]=e[n]},c=function(t,e){t.style.left=e[0]+"px",t.style.top=e[1]+"px",t.style.width=e[2]+"px",t.style.height=e[3]+"px",t.style.position="absolute"},d=jsPlumb.vml.convertValue=function(t){return Math.floor(t*l)},h=jsPlumb.VmlConnector=function(e){var n=this;n.strokeNode=null,n.canvas=null,s.apply(this,arguments);var i=n._jsPlumb.connectorClass+(e.cssClass?" "+e.cssClass:"");this.paint=function(o,s,d){if(null!=s){var h={path:n.getPath(o)};if(s.outlineColor){var p,f=s.outlineWidth||1,g=(f=s.lineWidth+2*f,{strokeStyle:jsPlumbUtil.convertStyle(s.outlineColor),lineWidth:f});for(p in t)g[p]=s[p];null==n.bgCanvas?(h.class=i,h.coordsize=o[2]*l+","+o[3]*l,n.bgCanvas=r("shape",o,h,e.parent,n._jsPlumb),c(n.bgCanvas,o),n.appendDisplayElement(n.bgCanvas,!0),n.attachListeners(n.bgCanvas,n),n.initOpacityNodes(n.bgCanvas,["stroke"])):(h.coordsize=o[2]*l+","+o[3]*l,c(n.bgCanvas,o),u(n.bgCanvas,h)),a(n.bgCanvas,g,n)}null==n.canvas?(h.class=i,h.coordsize=o[2]*l+","+o[3]*l,n.tooltip&&(h.label=n.tooltip),n.canvas=r("shape",o,h,e.parent,n._jsPlumb),n.appendDisplayElement(n.canvas,!0),n.attachListeners(n.canvas,n),n.initOpacityNodes(n.canvas,["stroke"])):(h.coordsize=o[2]*l+","+o[3]*l,c(n.canvas,o),u(n.canvas,h)),a(n.canvas,s,n,n._jsPlumb)}},this.reattachListeners=function(){n.canvas&&n.reattachListenersForElement(n.canvas,n)}},p=window.VmlEndpoint=function(t){s.apply(this,arguments);var e=null,n=this;n.canvas=document.createElement("div"),n.canvas.style.position="absolute";var i=n._jsPlumb.endpointClass+(t.cssClass?" "+t.cssClass:"");t._jsPlumb.appendElement(n.canvas,t.parent),n.tooltip&&n.canvas.setAttribute("label",n.tooltip),this.paint=function(t,r,o){var s={};jsPlumb.sizeCanvas(n.canvas,t[0],t[1],t[2],t[3]),null==e?(s.class=i,e=n.getVml([0,0,t[2],t[3]],s,o,n.canvas,n._jsPlumb),n.attachListeners(e,n),n.appendDisplayElement(e,!0),n.appendDisplayElement(n.canvas,!0),n.initOpacityNodes(e,["fill"])):(c(e,[0,0,t[2],t[3]]),u(e,s)),a(e,r,n)},this.reattachListeners=function(){e&&n.reattachListenersForElement(e,n)}};function f(t,e){t.apply(this,e),s.apply(this,e);var n=this;n.canvas=null,n.isAppendedAtTopLevel=!0,this.paint=function(t,e,i,o,a,s){var h={};o&&(h.stroked="true",h.strokecolor=jsPlumbUtil.convertStyle(o,!0)),i&&(h.strokeweight=i+"px"),a&&(h.filled="true",h.fillcolor=a);var p=Math.min(e.hxy.x,e.tail[0].x,e.tail[1].x,e.cxy.x);o=Math.min(e.hxy.y,e.tail[0].y,e.tail[1].y,e.cxy.y),i=Math.max(e.hxy.x,e.tail[0].x,e.tail[1].x,e.cxy.x),a=Math.max(e.hxy.y,e.tail[0].y,e.tail[1].y,e.cxy.y),o=[p,o,Math.abs(i-p),Math.abs(a-o)];h.path="m "+d((e=e).hxy.x)+","+d(e.hxy.y)+" l "+d(e.tail[0].x)+","+d(e.tail[0].y)+" "+d(e.cxy.x)+","+d(e.cxy.y)+" "+d(e.tail[1].x)+","+d(e.tail[1].y)+" x e",h.coordsize=s[2]*l+","+s[3]*l,o[0]=s[0],o[1]=s[1],o[2]=s[2],o[3]=s[3],null==n.canvas?(n.canvas=r("shape",o,h,t.canvas.parentNode,t._jsPlumb),t.appendDisplayElement(n.canvas,!0),n.attachListeners(n.canvas,t),n.attachListeners(n.canvas,n)):(c(n.canvas,o),u(n.canvas,h))},this.reattachListeners=function(){n.canvas&&n.reattachListenersForElement(n.canvas,n)},this.cleanup=function(){null!=n.canvas&&jsPlumb.CurrentLibrary.removeElement(n.canvas)}}jsPlumb.Connectors.vml.Bezier=function(){jsPlumb.Connectors.Bezier.apply(this,arguments),h.apply(this,arguments),this.getPath=function(t){return"m"+d(t[4])+","+d(t[5])+" c"+d(t[8])+","+d(t[9])+","+d(t[10])+","+d(t[11])+","+d(t[6])+","+d(t[7])+" e"}},jsPlumb.Connectors.vml.Straight=function(){jsPlumb.Connectors.Straight.apply(this,arguments),h.apply(this,arguments),this.getPath=function(t){return"m"+d(t[4])+","+d(t[5])+" l"+d(t[6])+","+d(t[7])+" e"}},jsPlumb.Connectors.vml.Flowchart=function(){jsPlumb.Connectors.Flowchart.apply(this,arguments),h.apply(this,arguments),this.getPath=function(t){for(var e="m "+d(t[4])+","+d(t[5])+" l",n=0;n<t[8];n++)e=e+" "+d(t[9+2*n])+","+d(t[10+2*n]);return e+" "+d(t[6])+","+d(t[7])+" e"}},jsPlumb.Endpoints.vml.Dot=function(){jsPlumb.Endpoints.Dot.apply(this,arguments),p.apply(this,arguments),this.getVml=function(t,e,n,i,o){return r("oval",t,e,i,o)}},jsPlumb.Endpoints.vml.Rectangle=function(){jsPlumb.Endpoints.Rectangle.apply(this,arguments),p.apply(this,arguments),this.getVml=function(t,e,n,i,o){return r("rect",t,e,i,o)}},jsPlumb.Endpoints.vml.Image=jsPlumb.Endpoints.Image,jsPlumb.Endpoints.vml.Blank=jsPlumb.Endpoints.Blank,jsPlumb.Overlays.vml.Label=jsPlumb.Overlays.Label,jsPlumb.Overlays.vml.Arrow=function(){f.apply(this,[jsPlumb.Overlays.Arrow,arguments])},jsPlumb.Overlays.vml.PlainArrow=function(){f.apply(this,[jsPlumb.Overlays.PlainArrow,arguments])},jsPlumb.Overlays.vml.Diamond=function(){f.apply(this,[jsPlumb.Overlays.Diamond,arguments])}}(),function(){function t(t,e){for(var n in e)t.setAttribute(n,""+e[n])}function e(t){return"position:absolute;left:"+t[0]+"px;top:"+t[1]+"px"}function n(t,e,n,i,m){var v,y,b;for(b in n.gradient?function(t,e,n,i,r){var o;r=p+r._jsPlumb.idstamp();g(t),o=n.gradient.offset?f(l,{id:r}):f(s,{id:r,gradientUnits:"userSpaceOnUse"}),t.appendChild(o);for(var a=0;a<n.gradient.stops.length;a++){var m=a;m=8==i.length?i[4]<i[6]?a:n.gradient.stops.length-1-a:i[4]<i[6]?n.gradient.stops.length-1-a:a,m=jsPlumbUtil.convertStyle(n.gradient.stops[m][1],!0),m=f(c,{offset:Math.floor(100*n.gradient.stops[a][0])+"%","stop-color":m});o.appendChild(m)}t=n.strokeStyle?d:u,e.setAttribute(h,t+":url(#"+r+")")}(t,e,n,i,m):(g(t),e.setAttribute(h,"")),e.setAttribute(u,n.fillStyle?jsPlumbUtil.convertStyle(n.fillStyle,!0):"none"),e.setAttribute(d,n.strokeStyle?jsPlumbUtil.convertStyle(n.strokeStyle,!0):"none"),n.lineWidth&&e.setAttribute("stroke-width",n.lineWidth),n[a]&&n.lineWidth&&!n[o]?(v=-1==n[a].indexOf(",")?" ":",",t=n[a].split(v),y="",t.forEach((function(t){y+=Math.floor(t*n.lineWidth)+v})),e.setAttribute(o,y)):n[o]&&e.setAttribute(o,n[o]),r)n[b]&&e.setAttribute(r[b],n[b])}function i(t,e,n){for(var i,r=n.split(" "),o=t.className.baseVal.split(" "),a=0;a<r.length;a++)e?-1==o.indexOf(r[a])&&o.push(r[a]):-1!=(i=o.indexOf(r[a]))&&o.splice(i,1);t.className.baseVal=o.join(" ")}var r={joinstyle:"stroke-linejoin","stroke-linejoin":"stroke-linejoin","stroke-dashoffset":"stroke-dashoffset","stroke-linecap":"stroke-linecap"},o="stroke-dasharray",a="dashstyle",s="linearGradient",l="radialGradient",u="fill",c="stop",d="stroke",h="style",p="jsplumb_gradient_",f=function(e,n){return e=document.createElementNS("http://www.w3.org/2000/svg",e),(n=n||{}).version="1.1",n.xmlns="http://www.w3.org/1999/xhtml",t(e,n),e},g=function(t){for(var e=0;e<t.childNodes.length;e++)t.childNodes[e].tagName!=s&&t.childNodes[e].tagName!=l||t.removeChild(t.childNodes[e])};function m(n){var i=this,r=n.pointerEventsSpec||"all";jsPlumb.jsPlumbUIComponent.apply(this,n.originalArgs),i.canvas=null,i.path=null,i.svg=null;var o=n.cssClass+" "+(n.originalArgs[0].cssClass||"");r={style:"",width:0,height:0,"pointer-events":r,position:"absolute"};i.tooltip&&(r.title=i.tooltip),i.svg=f("svg",r),n.useDivWrapper?(i.canvas=document.createElement("div"),i.canvas.style.position="absolute",jsPlumb.sizeCanvas(i.canvas,0,0,1,1),i.canvas.className=o,i.tooltip&&i.canvas.setAttribute("title",i.tooltip)):(t(i.svg,{class:o}),i.canvas=i.svg),n._jsPlumb.appendElement(i.canvas,n.originalArgs[0].parent),n.useDivWrapper&&i.canvas.appendChild(i.svg);var a=[i.canvas];this.getDisplayElements=function(){return a},this.appendDisplayElement=function(t){a.push(t)},this.paint=function(r,o,a){var s,l;null!=o&&(s=r[0],l=r[1],n.useDivWrapper&&(jsPlumb.sizeCanvas(i.canvas,r[0],r[1],r[2],r[3]),l=s=0),t(i.svg,{style:e([s,l,r[2],r[3]]),width:r[2],height:r[3]}),i._paint.apply(this,arguments))}}jsPlumbUtil.svg={addClass:function(t,e){i(t,!0,e)},removeClass:function(t,e){i(t,!1,e)},node:f,attr:t,pos:e};var v=jsPlumb.SvgConnector=function(e){var i=this;m.apply(this,[{cssClass:e._jsPlumb.connectorClass,originalArgs:arguments,pointerEventsSpec:"none",tooltip:e.tooltip,_jsPlumb:e._jsPlumb}]),this._paint=function(e,r){var o,a={d:i.getPath(e)},s=null;a["pointer-events"]="all",r.outlineColor&&(o=r.outlineWidth||1,o=r.lineWidth+2*o,(s=jsPlumb.CurrentLibrary.extend({},r)).strokeStyle=jsPlumbUtil.convertStyle(r.outlineColor),s.lineWidth=o,null==i.bgPath?(i.bgPath=f("path",a),i.svg.appendChild(i.bgPath),i.attachListeners(i.bgPath,i)):t(i.bgPath,a),n(i.svg,i.bgPath,s,e,i)),null==i.path?(i.path=f("path",a),i.svg.appendChild(i.path),i.attachListeners(i.path,i)):t(i.path,a),n(i.svg,i.path,r,e,i)},this.reattachListeners=function(){i.bgPath&&i.reattachListenersForElement(i.bgPath,i),i.path&&i.reattachListenersForElement(i.path,i)}};jsPlumb.Connectors.svg.Bezier=function(t){jsPlumb.Connectors.Bezier.apply(this,arguments),v.apply(this,arguments),this.getPath=function(t){return"M "+t[4]+" "+t[5]+" C "+t[8]+" "+t[9]+" "+t[10]+" "+t[11]+" "+t[6]+" "+t[7]}},jsPlumb.Connectors.svg.Straight=function(t){jsPlumb.Connectors.Straight.apply(this,arguments),v.apply(this,arguments),this.getPath=function(t){return"M "+t[4]+" "+t[5]+" L "+t[6]+" "+t[7]}},jsPlumb.Connectors.svg.Flowchart=function(){jsPlumb.Connectors.Flowchart.apply(this,arguments),v.apply(this,arguments),this.getPath=function(t){for(var e="M "+t[4]+","+t[5],n=0;n<t[8];n++)e=e+" L "+t[9+2*n]+" "+t[10+2*n];return e+" "+t[6]+","+t[7]}};var y=window.SvgEndpoint=function(t){var i=this;m.apply(this,[{cssClass:t._jsPlumb.endpointClass,originalArgs:arguments,pointerEventsSpec:"all",useDivWrapper:!0,_jsPlumb:t._jsPlumb}]),this._paint=function(t,r){(r=jsPlumb.extend({},r)).outlineColor&&(r.strokeWidth=r.outlineWidth,r.strokeStyle=jsPlumbUtil.convertStyle(r.outlineColor,!0)),null==i.node&&(i.node=i.makeNode(t,r),i.svg.appendChild(i.node),i.attachListeners(i.node,i)),n(i.svg,i.node,r,t,i),e(i.node)},this.reattachListeners=function(){i.node&&i.reattachListenersForElement(i.node,i)}};function b(e,n){e.apply(this,n),jsPlumb.jsPlumbUIComponent.apply(this,n),this.isAppendedAtTopLevel=!1;var i=this,r=null;this.paint=function(e,a,s,l,u){null==r&&(r=f("path",{"pointer-events":"all"}),e.svg.appendChild(r),i.attachListeners(r,e),i.attachListeners(r,i)),e=n&&1==n.length&&n[0].cssClass||"",t(r,{d:o(a),class:e,stroke:l||null,fill:u||null})};var o=function(t){return"M"+t.hxy.x+","+t.hxy.y+" L"+t.tail[0].x+","+t.tail[0].y+" L"+t.cxy.x+","+t.cxy.y+" L"+t.tail[1].x+","+t.tail[1].y+" L"+t.hxy.x+","+t.hxy.y};this.reattachListeners=function(){r&&i.reattachListenersForElement(r,i)},this.cleanup=function(){null!=r&&jsPlumb.CurrentLibrary.removeElement(r)}}jsPlumb.Endpoints.svg.Dot=function(){jsPlumb.Endpoints.Dot.apply(this,arguments),y.apply(this,arguments),this.makeNode=function(t,e){return f("circle",{cx:t[2]/2,cy:t[3]/2,r:t[2]/2})}},jsPlumb.Endpoints.svg.Rectangle=function(){jsPlumb.Endpoints.Rectangle.apply(this,arguments),y.apply(this,arguments),this.makeNode=function(t,e){return f("rect",{width:t[2],height:t[3]})}},jsPlumb.Endpoints.svg.Image=jsPlumb.Endpoints.Image,jsPlumb.Endpoints.svg.Blank=jsPlumb.Endpoints.Blank,jsPlumb.Overlays.svg.Label=jsPlumb.Overlays.Label,jsPlumb.Overlays.svg.Arrow=function(){b.apply(this,[jsPlumb.Overlays.Arrow,arguments])},jsPlumb.Overlays.svg.PlainArrow=function(){b.apply(this,[jsPlumb.Overlays.PlainArrow,arguments])},jsPlumb.Overlays.svg.Diamond=function(){b.apply(this,[jsPlumb.Overlays.Diamond,arguments])},jsPlumb.Overlays.svg.GuideLines=function(){var e,n,i=null,r=this;jsPlumb.Overlays.GuideLines.apply(this,arguments),this.paint=function(a,s,l,u,c){null==i&&(i=f("path"),a.svg.appendChild(i),r.attachListeners(i,a),r.attachListeners(i,r),e=f("path"),a.svg.appendChild(e),r.attachListeners(e,a),r.attachListeners(e,r),n=f("path"),a.svg.appendChild(n),r.attachListeners(n,a),r.attachListeners(n,r)),t(i,{d:o(s[0],s[1]),stroke:"red",fill:null}),t(e,{d:o(s[2][0],s[2][1]),stroke:"blue",fill:null}),t(n,{d:o(s[3][0],s[3][1]),stroke:"green",fill:null})};var o=function(t,e){return"M "+t.x+","+t.y+" L"+e.x+","+e.y}}}(),function(){function t(){var t=this;function e(t,e){return null!=t&&o(t,e)}t.overlayPlacements=[],jsPlumb.jsPlumbUIComponent.apply(this,arguments),jsPlumbUtil.EventGenerator.apply(this,arguments);var n=!(this._over=function(e){var n=s(a(t.canvas)),i=(e=l(e))[0]-n.left,r=e[1]-n.top;if(0<i&&0<r&&i<t.canvas.width&&r<t.canvas.height){for(var o=0;o<t.overlayPlacements.length;o++){var u=t.overlayPlacements[o];if(u&&u[0]<=i&&u[1]>=i&&u[2]<=r&&u[3]>=r)return!0}return 0!=(n=t.canvas.getContext("2d").getImageData(parseInt(i),parseInt(r),1,1)).data[0]||0!=n.data[1]||0!=n.data[2]||0!=n.data[3]}return!1}),i=!1,c=!1;this.mousemove=function(i){l(i);var o=u(i),a=(o=e(a=document.elementFromPoint(o[0],o[1]),"_jsPlumb_overlay"),null==r&&(e(a,"_jsPlumb_endpoint")||e(a,"_jsPlumb_connector")));if(!n&&a&&t._over(i))return n=!0,t.fire("mouseenter",t,i),!0;!n||t._over(i)&&a||o||(n=!1,t.fire("mouseexit",t,i)),t.fire("mousemove",t,i)},this.click=function(e){n&&t._over(e)&&!c&&t.fire("click",t,e),c=!1},this.dblclick=function(e){n&&t._over(e)&&!c&&t.fire("dblclick",t,e),c=!1},this.mousedown=function(e){t._over(e)&&!i&&(i=!0,s(a(t.canvas)),t.fire("mousedown",t,e))},this.mouseup=function(e){i=!1,t.fire("mouseup",t,e)},this.contextmenu=function(e){n&&t._over(e)&&!c&&t.fire("contextmenu",t,e),c=!1}}function e(t){var e=document.createElement("canvas");return t._jsPlumb.appendElement(e,t.parent),e.style.position="absolute",t.class&&(e.className=t.class),t._jsPlumb.getId(e,t.uuid),t.tooltip&&e.setAttribute("title",t.tooltip),e}function n(e){t.apply(this,arguments);var n=[];this.getDisplayElements=function(){return n},this.appendDisplayElement=function(t){n.push(t)}}function i(t){var i=this;n.apply(this,arguments);var r={class:i._jsPlumb.endpointClass+" "+(t.cssClass||""),_jsPlumb:i._jsPlumb,parent:t.parent,tooltip:i.tooltip};i.canvas=e(r),i.ctx=i.canvas.getContext("2d"),i.appendDisplayElement(i.canvas),this.paint=function(t,e,n){var r;jsPlumb.sizeCanvas(i.canvas,t[0],t[1],t[2],t[3]),null!=e.outlineColor&&(r=e.outlineWidth||1,e.lineWidth+2*r,e.outlineColor),i._paint.apply(this,arguments)}}var r=null,o=function(t,e){return jsPlumb.CurrentLibrary.hasClass(a(t),e)},a=function(t){return jsPlumb.CurrentLibrary.getElementObject(t)},s=function(t){return jsPlumb.CurrentLibrary.getOffset(a(t))},l=function(t){return jsPlumb.CurrentLibrary.getPageXY(t)},u=function(t){return jsPlumb.CurrentLibrary.getClientXY(t)},c=jsPlumb.CanvasConnector=function(t){function i(t,e){if(r.ctx.save(),jsPlumb.extend(r.ctx,e),e.gradient){for(var n=r.createGradient(t,r.ctx),i=0;i<e.gradient.stops.length;i++)n.addColorStop(e.gradient.stops[i][0],e.gradient.stops[i][1]);r.ctx.strokeStyle=n}r._paint(t,e),r.ctx.restore()}n.apply(this,arguments);var r=this,o=r._jsPlumb.connectorClass+" "+(t.cssClass||"");r.canvas=e({class:o,_jsPlumb:r._jsPlumb,parent:t.parent,tooltip:t.tooltip}),r.ctx=r.canvas.getContext("2d"),r.appendDisplayElement(r.canvas),r.paint=function(t,e){var n;null!=e&&(jsPlumb.sizeCanvas(r.canvas,t[0],t[1],t[2],t[3]),null!=e.outlineColor&&(n=e.outlineWidth||1,n=e.lineWidth+2*n,i(t,n={strokeStyle:e.outlineColor,lineWidth:n})),i(t,e))}};function d(t,e){t.apply(this,e),function(){jsPlumb.jsPlumbUIComponent.apply(this,arguments)}.apply(this,e),this.paint=function(t,e,n,i,r){(t=t.ctx).lineWidth=n,t.beginPath(),t.moveTo(e.hxy.x,e.hxy.y),t.lineTo(e.tail[0].x,e.tail[0].y),t.lineTo(e.cxy.x,e.cxy.y),t.lineTo(e.tail[1].x,e.tail[1].y),t.lineTo(e.hxy.x,e.hxy.y),t.closePath(),i&&(t.strokeStyle=i,t.stroke()),r&&(t.fillStyle=r,t.fill())}}jsPlumb.Endpoints.canvas.Dot=function(t){jsPlumb.Endpoints.Dot.apply(this,arguments),i.apply(this,arguments);var e=this,n=function(t){try{return parseInt(t)}catch(e){if("%"==t.substring(t.length-1))return parseInt(t.substring(0,t-1))}};this._paint=function(t,i,r){if(null!=i){var o=e.canvas.getContext("2d"),a=r.getOrientation(e);if(jsPlumb.extend(o,i),i.gradient){for(var s=(s=i.gradient,c=e.defaultOffset,r=e.defaultInnerRadius,[c=s.offset?n(s.offset):c,r=s.innerRadius?n(s.innerRadius):r]),l=(r=1==a[1]?-1*s[0]:s[0],a=1==a[0]?-1*s[0]:s[0],o.createRadialGradient(t[4],t[4],t[4],t[4]+a,t[4]+r,s[1])),u=0;u<i.gradient.stops.length;u++)l.addColorStop(i.gradient.stops[u][0],i.gradient.stops[u][1]);o.fillStyle=l}o.beginPath(),o.arc(t[4],t[4],t[4],0,2*Math.PI,!0),o.closePath(),(i.fillStyle||i.gradient)&&o.fill(),i.strokeStyle&&o.stroke()}var c}},jsPlumb.Endpoints.canvas.Rectangle=function(t){var e=this;jsPlumb.Endpoints.Rectangle.apply(this,arguments),i.apply(this,arguments),this._paint=function(t,n,i){var r=e.canvas.getContext("2d"),o=i.getOrientation(e);if(jsPlumb.extend(r,n),n.gradient){for(var a=1==o[1]?t[3]:0==o[1]?t[3]/2:0,s=-1==o[1]?t[3]:0==o[1]?t[3]/2:0,l=(i=1==o[0]?t[2]:0==o[0]?t[2]/2:0,o=-1==o[0]?t[2]:0==o[0]?t[2]/2:0,r.createLinearGradient(i,a,o,s)),u=0;u<n.gradient.stops.length;u++)l.addColorStop(n.gradient.stops[u][0],n.gradient.stops[u][1]);r.fillStyle=l}r.beginPath(),r.rect(0,0,t[2],t[3]),r.closePath(),(n.fillStyle||n.gradient)&&r.fill(),n.strokeStyle&&r.stroke()}},jsPlumb.Endpoints.canvas.Triangle=function(t){var e=this;jsPlumb.Endpoints.Triangle.apply(this,arguments),i.apply(this,arguments),this._paint=function(t,n,i){var r=t[2],o=t[3],a=(t[0],t[1],e.canvas.getContext("2d")),s=0,l=0;t=0;1==(i=i.getOrientation(e))[0]&&(s=r,l=o,t=180),-1==i[1]&&(s=r,t=90),1==i[1]&&(l=o,t=-90),a.fillStyle=n.fillStyle,a.translate(s,l),a.rotate(t*Math.PI/180),a.beginPath(),a.moveTo(0,0),a.lineTo(r/2,o/2),a.lineTo(0,o),a.closePath(),(n.fillStyle||n.gradient)&&a.fill(),n.strokeStyle&&a.stroke()}},jsPlumb.Endpoints.canvas.Image=jsPlumb.Endpoints.Image,jsPlumb.Endpoints.canvas.Blank=jsPlumb.Endpoints.Blank,jsPlumb.Connectors.canvas.Bezier=function(){var t=this;jsPlumb.Connectors.Bezier.apply(this,arguments),c.apply(this,arguments),this._paint=function(e,n){t.ctx.beginPath(),t.ctx.moveTo(e[4],e[5]),t.ctx.bezierCurveTo(e[8],e[9],e[10],e[11],e[6],e[7]),t.ctx.stroke()},this.createGradient=function(e,n,i){return t.ctx.createLinearGradient(e[6],e[7],e[4],e[5])}},jsPlumb.Connectors.canvas.Straight=function(){var t=this,e=[null,[1,-1],[1,1],[-1,1],[-1,-1]];jsPlumb.Connectors.Straight.apply(this,arguments),c.apply(this,arguments),this._paint=function(n,i){if(t.ctx.beginPath(),i.dashstyle&&2==i.dashstyle.split(" ").length){for(var r=[(o=2!=(o=i.dashstyle.split(" ")).length?[2,2]:o)[0]*i.lineWidth,o[1]*i.lineWidth],o=(n[6]-n[4])/(n[7]-n[5]),a=(i=jsPlumbUtil.segment([n[4],n[5]],[n[6],n[7]]),e[i]),s=Math.atan(o),l=(o=Math.sqrt(Math.pow(n[6]-n[4],2)+Math.pow(n[7]-n[5],2)),Math.floor(o/(r[0]+r[1]))),u=[n[4],n[5]],c=0;c<l;c++){t.ctx.moveTo(u[0],u[1]);var d=u[0]+Math.abs(Math.sin(s)*r[0])*a[0],h=u[1]+Math.abs(Math.cos(s)*r[0])*a[1],p=u[0]+Math.abs(Math.sin(s)*(r[0]+r[1]))*a[0],f=u[1]+Math.abs(Math.cos(s)*(r[0]+r[1]))*a[1];t.ctx.lineTo(d,h),u=[p,f]}t.ctx.moveTo(u[0],u[1]),t.ctx.lineTo(n[6],n[7])}else t.ctx.moveTo(n[4],n[5]),t.ctx.lineTo(n[6],n[7]);t.ctx.stroke()},this.createGradient=function(t,e){return e.createLinearGradient(t[4],t[5],t[6],t[7])}},jsPlumb.Connectors.canvas.Flowchart=function(){var t=this;jsPlumb.Connectors.Flowchart.apply(this,arguments),c.apply(this,arguments),this._paint=function(e,n){t.ctx.beginPath(),t.ctx.moveTo(e[4],e[5]);for(var i=0;i<e[8];i++)t.ctx.lineTo(e[9+2*i],e[10+2*i]);t.ctx.lineTo(e[6],e[7]),t.ctx.stroke()},this.createGradient=function(t,e){return e.createLinearGradient(t[4],t[5],t[6],t[7])}},jsPlumb.Overlays.canvas.Label=jsPlumb.Overlays.Label,jsPlumb.Overlays.canvas.Arrow=function(){d.apply(this,[jsPlumb.Overlays.Arrow,arguments])},jsPlumb.Overlays.canvas.PlainArrow=function(){d.apply(this,[jsPlumb.Overlays.PlainArrow,arguments])},jsPlumb.Overlays.canvas.Diamond=function(){d.apply(this,[jsPlumb.Overlays.Diamond,arguments])}}(),function(t){jsPlumb.CurrentLibrary={addClass:function(t,e){t=jsPlumb.CurrentLibrary.getElementObject(t);try{t[0].className.constructor==SVGAnimatedString&&jsPlumb.util.svg.addClass(t[0],e)}catch(t){}t.addClass(e)},animate:function(t,e,n){t.animate(e,n)},appendElement:function(t,e){jsPlumb.CurrentLibrary.getElementObject(e).append(t)},ajax:function(e){(e=e||{}).type=e.type||"get",t.ajax(e)},bind:function(t,e,n){(t=jsPlumb.CurrentLibrary.getElementObject(t)).bind(e,n)},dragEvents:{start:"start",stop:"stop",drag:"drag",step:"step",over:"over",out:"out",drop:"drop",complete:"complete"},extend:function(e,n){return t.extend(e,n)},getAttribute:function(t,e){return t.attr(e)},getClientXY:function(t){return[t.clientX,t.clientY]},getDocumentElement:function(){return document},getDragObject:function(t){return t[1].draggable},getDragScope:function(t){return t.draggable("option","scope")},getDropEvent:function(t){return t[0]},getDropScope:function(t){return t.droppable("option","scope")},getDOMElement:function(t){return"string"==typeof t?document.getElementById(t):t.context?t[0]:t},getElementObject:function(e){return t("string"==typeof e?"#"+e:e)},getOffset:function(t){return t.offset()},getOriginalEvent:function(t){return t.originalEvent},getPageXY:function(t){return[t.pageX,t.pageY]},getParent:function(t){return jsPlumb.CurrentLibrary.getElementObject(t).parent()},getScrollLeft:function(t){return t.scrollLeft()},getScrollTop:function(t){return t.scrollTop()},getSelector:function(e){return t(e)},getSize:function(t){return[t.outerWidth(),t.outerHeight()]},getTagName:function(t){return 0<(t=jsPlumb.CurrentLibrary.getElementObject(t)).length?t[0].tagName:null},getUIPosition:function(t){return ret=1==t.length?{left:t[0].pageX,top:t[0].pageY}:(t=t[1]).offset||t.absolutePosition,ret},hasClass:function(t,e){return t.hasClass(e)},initDraggable:function(t,e,n){(e=e||{}).helper=null,n&&(e.scope=e.scope||jsPlumb.Defaults.Scope),t.draggable(e)},initDroppable:function(t,e){e.scope=e.scope||jsPlumb.Defaults.Scope,t.droppable(e)},isAlreadyDraggable:function(t){return(t=jsPlumb.CurrentLibrary.getElementObject(t)).hasClass("ui-draggable")},isDragSupported:function(t,e){return t.draggable},isDropSupported:function(t,e){return t.droppable},removeClass:function(t,e){t=jsPlumb.CurrentLibrary.getElementObject(t);try{t[0].className.constructor==SVGAnimatedString&&jsPlumb.util.svg.removeClass(t[0],e)}catch(t){}t.removeClass(e)},removeElement:function(t,e){jsPlumb.CurrentLibrary.getElementObject(t).remove()},setAttribute:function(t,e,n){t.attr(e,n)},setDraggable:function(t,e){t.draggable("option","disabled",!e)},setDragScope:function(t,e){t.draggable("option","scope",e)},setOffset:function(t,e){jsPlumb.CurrentLibrary.getElementObject(t).offset(e)},trigger:function(t,e,n){jQuery._data(jsPlumb.CurrentLibrary.getElementObject(t)[0],"handle")(n)},unbind:function(t,e,n){(t=jsPlumb.CurrentLibrary.getElementObject(t)).unbind(e,n)}},t(document).ready(jsPlumb.init)}(jQuery),function(){function t(t,e){for(var n=[],i=e.length-1,l=2*i-1,d=[],h=[],p=[],f=[],g=[[1,.6,.3,.1],[.4,.6,.6,.4],[.1,.3,.6,1]],m=0;m<=i;m++)d[m]=r(e[m],t);for(m=0;m<=i-1;m++)h[m]=r(e[m+1],e[m]),h[m]=s(h[m],3);for(m=0;m<=i-1;m++)for(var v=0;v<=i;v++)p[m]||(p[m]=[]),p[m][v]=o(h[m],d[v]);for(m=0;m<=l;m++)f[m]||(f[m]=[]),f[m].y=0,f[m].x=parseFloat(m)/l;for(l=i-1,d=0;d<=i+l;d++)for(m=Math.max(0,d-l),h=Math.min(d,i);m<=h;m++)j=d-m,f[m+j].y=f[m+j].y+p[j][m]*g[j][m];for(i=e.length-1,f=u(f,2*i-1,n,0),l=r(t,e[0]),p=a(l),m=g=0;m<f;m++)l=r(t,c(e,i,n[m],null,null)),(l=a(l))<p&&(p=l,g=n[m]);return l=r(t,e[i]),(l=a(l))<p&&(p=l,g=1),{location:g,distance:p}}function e(t,e){for(var n=h(t.length-1),i=0,r=0,o=0;o<t.length;o++)i+=t[o].x*n[o](e),r+=t[o].y*n[o](e);return{x:i,y:r}}function n(t,n,i){for(var r=e(t,n),o=0,a=0<i?1:-1,s=null;o<Math.abs(i);)s=e(t,n+=.005*a),o+=Math.sqrt(Math.pow(s.x-r.x,2)+Math.pow(s.y-r.y,2)),r=s;return{point:s,location:n}}function i(t,n){var i=e(t,n);n=(t=e(t.slice(0,t.length-1),n)).y-i.y,i=t.x-i.x;return 0==n?1/0:Math.atan(n/i)}void 0===Math.sgn&&(Math.sgn=function(t){return 0==t?0:0<t?1:-1});var r=function(t,e){return{x:t.x-e.x,y:t.y-e.y}},o=function(t,e){return t.x*e.x+t.y*e.y},a=function(t){return Math.sqrt(t.x*t.x+t.y*t.y)},s=function(t,e){return{x:t.x*e,y:t.y*e}},l=Math.pow(2,-65),u=function(t,e,n,i){var r=[],o=[],a=[],s=[],d=0;p=Math.sgn(t[0].y);for(var h=1;h<=e;h++)(f=Math.sgn(t[h].y))!=p&&d++,p=f;switch(d){case 0:return 0;case 1:if(64<=i)return n[0]=(t[0].x+t[e].x)/2,1;d=t[0].y-t[e].y;for(var p=t[e].x-t[0].x,f=(h=t[0].x*t[e].y-t[e].x*t[0].y,max_distance_below=0),g=1;g<e;g++){var m=d*t[g].x+p*t[g].y+h;f<m?f=m:m<max_distance_below&&(max_distance_below=m)}if(f=1/(0*(g=p)-+d)*(h-f-0*g),d=1/(0*(g=p)-+d)*(+(p=h-max_distance_below)-0*g),p=Math.min(f,d),Math.max(f,d)-p<l)return a=t[e].x-t[0].x,s=t[e].y-t[0].y,n[0]=0+(a*+t[0].y-s*+t[0].x)*(1/(0*a-+s)),1}for(c(t,e,.5,r,o),t=u(r,e,a,i+1),e=u(o,e,s,i+1),i=0;i<t;i++)n[i]=a[i];for(i=0;i<e;i++)n[i+t]=s[i];return t+e},c=function(t,e,n,i,r){for(var o=[[]],a=0;a<=e;a++)o[0][a]=t[a];for(t=1;t<=e;t++)for(a=0;a<=e-t;a++)o[t]||(o[t]=[]),o[t][a]||(o[t][a]={}),o[t][a].x=(1-n)*o[t-1][a].x+n*o[t-1][a+1].x,o[t][a].y=(1-n)*o[t-1][a].y+n*o[t-1][a+1].y;if(null!=i)for(a=0;a<=e;a++)i[a]=o[a][0];if(null!=r)for(a=0;a<=e;a++)r[a]=o[e-a][a];return o[e][0]},d={},h=function(t){if(!(o=d[t])){function e(t){return function(){return t}}function n(){return function(t){return t}}function i(){return function(t){return 1-t}}function r(t){return function(e){for(var n=1,i=0;i<t.length;i++)n*=t[i](e);return n}}var o;(o=[]).push(new function(){return function(e){return Math.pow(e,t)}});for(var a=1;a<t;a++){for(var s=[new e(t)],l=0;l<t-a;l++)s.push(new n);for(l=0;l<a;l++)s.push(new i);o.push(new r(s))}o.push(new function(){return function(e){return Math.pow(1-e,t)}}),d[t]=o}return o};window.jsBezier={distanceFromCurve:t,gradientAtPoint:i,gradientAtPointAlongCurveFrom:function(t,e,r){return 1<(e=n(t,e,r)).location&&(e.location=1),e.location<0&&(e.location=0),i(t,e.location)},nearestPointOnCurve:function(e,n){return e=t(e,n),{point:c(n,n.length-1,e.location,null,null),location:e.location}},pointOnCurve:e,pointAlongCurveFrom:function(t,e,i){return n(t,e,i).point},perpendicularToCurveAt:function(t,e,r,o){return t=i(t,(e=n(t,e,null==o?0:o)).location),o=Math.atan(-1/t),t=r/2*Math.sin(o),r=r/2*Math.cos(o),[{x:e.point.x+r,y:e.point.y+t},{x:e.point.x-r,y:e.point.y-t}]},locationAlongCurveFrom:function(t,e,i){return n(t,e,i).location}}}(),function(t,e){function n(e,n){if("area"!==(r=e.nodeName.toLowerCase()))return(/input|select|textarea|button|object/.test(r)?!e.disabled:"a"==r&&e.href||n)&&i(e);var r;n=(r=e.parentNode).name;return!(!e.href||!n||"map"!==r.nodeName.toLowerCase())&&!!(n=t("img[usemap=#"+n+"]")[0])&&i(n)}function i(e){return!t(e).parents().andSelf().filter((function(){return"hidden"===t.curCSS(this,"visibility")||t.expr.filters.hidden(this)})).length}t.ui=t.ui||{},t.ui.version||(t.extend(t.ui,{version:"1.8.24",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}}),t.fn.extend({propAttr:t.fn.prop||t.fn.attr,_focus:t.fn.focus,focus:function(e,n){return"number"==typeof e?this.each((function(){var i=this;setTimeout((function(){t(i).focus(),n&&n.call(i)}),e)})):this._focus.apply(this,arguments)},scrollParent:function(){var e=(t.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter((function(){return/(relative|absolute|fixed)/.test(t.curCSS(this,"position",1))&&/(auto|scroll)/.test(t.curCSS(this,"overflow",1)+t.curCSS(this,"overflow-y",1)+t.curCSS(this,"overflow-x",1))})):this.parents().filter((function(){return/(auto|scroll)/.test(t.curCSS(this,"overflow",1)+t.curCSS(this,"overflow-y",1)+t.curCSS(this,"overflow-x",1))}))).eq(0);return/fixed/.test(this.css("position"))||!e.length?t(document):e},zIndex:function(n){if(n!==e)return this.css("zIndex",n);if(this.length)for(var i,r,o=t(this[0]);o.length&&o[0]!==document;){if(("absolute"===(i=o.css("position"))||"relative"===i||"fixed"===i)&&(r=parseInt(o.css("zIndex"),10),!isNaN(r)&&0!==r))return r;o=o.parent()}return 0},disableSelection:function(){return this.bind((t.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",(function(t){t.preventDefault()}))},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),t("<a>").outerWidth(1).jquery||t.each(["Width","Height"],(function(n,i){function r(e,n,i,r){return t.each(o,(function(){n-=parseFloat(t.curCSS(e,"padding"+this,!0))||0,i&&(n-=parseFloat(t.curCSS(e,"border"+this+"Width",!0))||0),r&&(n-=parseFloat(t.curCSS(e,"margin"+this,!0))||0)})),n}var o="Width"===i?["Left","Right"]:["Top","Bottom"],a=i.toLowerCase(),s={innerWidth:t.fn.innerWidth,innerHeight:t.fn.innerHeight,outerWidth:t.fn.outerWidth,outerHeight:t.fn.outerHeight};t.fn["inner"+i]=function(n){return n===e?s["inner"+i].call(this):this.each((function(){t(this).css(a,r(this,n)+"px")}))},t.fn["outer"+i]=function(e,n){return"number"!=typeof e?s["outer"+i].call(this,e):this.each((function(){t(this).css(a,r(this,e,!0,n)+"px")}))}})),t.extend(t.expr[":"],{data:t.expr.createPseudo?t.expr.createPseudo((function(e){return function(n){return!!t.data(n,e)}})):function(e,n,i){return!!t.data(e,i[3])},focusable:function(e){return n(e,!isNaN(t.attr(e,"tabindex")))},tabbable:function(e){var i=t.attr(e,"tabindex"),r=isNaN(i);return(r||0<=i)&&n(e,!r)}}),t((function(){var e=document.body,n=e.appendChild(document.createElement("div"));n.offsetHeight,t.extend(n.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0}),t.support.minHeight=100===n.offsetHeight,t.support.selectstart="onselectstart"in n,e.removeChild(n).style.display="none"})),t.curCSS||(t.curCSS=t.css),t.extend(t.ui,{plugin:{add:function(e,n,i){var r,o=t.ui[e].prototype;for(r in i)o.plugins[r]=o.plugins[r]||[],o.plugins[r].push([n,i[r]])},call:function(t,e,n){var i=t.plugins[e];if(i&&t.element[0].parentNode)for(var r=0;r<i.length;r++)t.options[i[r][0]]&&i[r][1].apply(t.element,n)}},contains:function(t,e){return document.compareDocumentPosition?16&t.compareDocumentPosition(e):t!==e&&t.contains(e)},hasScroll:function(e,n){if("hidden"===t(e).css("overflow"))return!1;var i=n&&"left"===n?"scrollLeft":"scrollTop";return 0<e[i]||(e[i]=1,n=0<e[i],e[i]=0,n)},isOverAxis:function(t,e,n){return e<t&&t<e+n},isOver:function(e,n,i,r,o,a){return t.ui.isOverAxis(e,i,o)&&t.ui.isOverAxis(n,r,a)}}))}(jQuery),function(t){var e,n;t.cleanData?(e=t.cleanData,t.cleanData=function(n){for(var i,r=0;null!=(i=n[r]);r++)try{t(i).triggerHandler("remove")}catch(n){}e(n)}):(n=t.fn.remove,t.fn.remove=function(e,i){return this.each((function(){return i||e&&!t.filter(e,[this]).length||t("*",this).add([this]).each((function(){try{t(this).triggerHandler("remove")}catch(t){}})),n.call(t(this),e,i)}))}),t.widget=function(e,n,i){var r=e.split(".")[0],o=r+"-"+(e=e.split(".")[1]);i||(i=n,n=t.Widget),t.expr[":"][o]=function(n){return!!t.data(n,e)},t[r]=t[r]||{},t[r][e]=function(t,e){arguments.length&&this._createWidget(t,e)},(n=new n).options=t.extend(!0,{},n.options),t[r][e].prototype=t.extend(!0,n,{namespace:r,widgetName:e,widgetEventPrefix:t[r][e].prototype.widgetEventPrefix||e,widgetBaseClass:o},i),t.widget.bridge(e,t[r][e])},t.widget.bridge=function(e,n){t.fn[e]=function(i){var r="string"==typeof i,o=Array.prototype.slice.call(arguments,1),a=this;return i=!r&&o.length?t.extend.apply(null,[!0,i].concat(o)):i,r&&"_"===i.charAt(0)||(r?this.each((function(){var n=t.data(this,e),r=n&&t.isFunction(n[i])?n[i].apply(n,o):n;if(r!==n&&void 0!==r)return a=r,!1})):this.each((function(){var r=t.data(this,e);r?r.option(i||{})._init():t.data(this,e,new n(i,this))}))),a}},t.Widget=function(t,e){arguments.length&&this._createWidget(t,e)},t.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:!1},_createWidget:function(e,n){t.data(n,this.widgetName,this),this.element=t(n),this.options=t.extend(!0,{},this.options,this._getCreateOptions(),e);var i=this;this.element.bind("remove."+this.widgetName,(function(){i.destroy()})),this._create(),this._trigger("create"),this._init()},_getCreateOptions:function(){return t.metadata&&t.metadata.get(this.element[0])[this.widgetName]},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName),this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled ui-state-disabled")},widget:function(){return this.element},option:function(e,n){var i=e;if(0===arguments.length)return t.extend({},this.options);if("string"==typeof e){if(void 0===n)return this.options[e];(i={})[e]=n}return this._setOptions(i),this},_setOptions:function(e){var n=this;return t.each(e,(function(t,e){n._setOption(t,e)})),this},_setOption:function(t,e){return this.options[t]=e,"disabled"===t&&this.widget()[e?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",e),this},enable:function(){return this._setOption("disabled",!1)},disable:function(){return this._setOption("disabled",!0)},_trigger:function(e,n,i){var r,o,a=this.options[e];if(i=i||{},(n=t.Event(n)).type=(e===this.widgetEventPrefix?e:this.widgetEventPrefix+e).toLowerCase(),n.target=this.element[0],o=n.originalEvent)for(r in o)r in n||(n[r]=o[r]);return this.element.trigger(n,i),!(t.isFunction(a)&&!1===a.call(this.element[0],n,i)||n.isDefaultPrevented())}}}(jQuery),function(t){var e=!1;t(document).mouseup((function(t){e=!1})),t.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var e=this;this.element.bind("mousedown."+this.widgetName,(function(t){return e._mouseDown(t)})).bind("click."+this.widgetName,(function(n){if(!0===t.data(n.target,e.widgetName+".preventClickEvent"))return t.removeData(n.target,e.widgetName+".preventClickEvent"),n.stopImmediatePropagation(),!1})),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),this._mouseMoveDelegate&&t(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(n){if(!e){this._mouseStarted&&this._mouseUp(n),this._mouseDownEvent=n;var i=this,r=1==n.which,o=!("string"!=typeof this.options.cancel||!n.target.nodeName)&&t(n.target).closest(this.options.cancel).length;return!(r&&!o&&this._mouseCapture(n))||(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout((function(){i.mouseDelayMet=!0}),this.options.delay)),this._mouseDistanceMet(n)&&this._mouseDelayMet(n)&&(this._mouseStarted=!1!==this._mouseStart(n),!this._mouseStarted)?n.preventDefault():(!0===t.data(n.target,this.widgetName+".preventClickEvent")&&t.removeData(n.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(t){return i._mouseMove(t)},this._mouseUpDelegate=function(t){return i._mouseUp(t)},t(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),n.preventDefault(),e=!0),!0)}},_mouseMove:function(e){return!t.browser.msie||9<=document.documentMode||e.button?this._mouseStarted?(this._mouseDrag(e),e.preventDefault()):(this._mouseDistanceMet(e)&&this._mouseDelayMet(e)&&(this._mouseStarted=!1!==this._mouseStart(this._mouseDownEvent,e),this._mouseStarted?this._mouseDrag(e):this._mouseUp(e)),!this._mouseStarted):this._mouseUp(e)},_mouseUp:function(e){return t(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,e.target==this._mouseDownEvent.target&&t.data(e.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(e)),!1},_mouseDistanceMet:function(t){return Math.max(Math.abs(this._mouseDownEvent.pageX-t.pageX),Math.abs(this._mouseDownEvent.pageY-t.pageY))>=this.options.distance},_mouseDelayMet:function(t){return this.mouseDelayMet},_mouseStart:function(t){},_mouseDrag:function(t){},_mouseStop:function(t){},_mouseCapture:function(t){return!0}})}(jQuery),function(t){t.ui=t.ui||{};var e=/left|center|right/,n=/top|center|bottom/,i="center",r={},o=t.fn.position,a=t.fn.offset;t.fn.position=function(a){if(!a||!a.of)return o.apply(this,arguments);a=t.extend({},a);var s,l,u=t(a.of),c=u[0],d=(a.collision||"flip").split(" "),h=a.offset?a.offset.split(" "):[0,0],p=9===c.nodeType?(s=u.width(),l=u.height(),{top:0,left:0}):c.setTimeout?(s=u.width(),l=u.height(),{top:u.scrollTop(),left:u.scrollLeft()}):c.preventDefault?(a.at="left top",s=l=0,{top:a.of.pageY,left:a.of.pageX}):(s=u.outerWidth(),l=u.outerHeight(),u.offset());return t.each(["my","at"],(function(){var t=(a[this]||"").split(" ");(t=1===t.length?e.test(t[0])?t.concat([i]):n.test(t[0])?[i].concat(t):[i,i]:t)[0]=e.test(t[0])?t[0]:i,t[1]=n.test(t[1])?t[1]:i,a[this]=t})),1===d.length&&(d[1]=d[0]),h[0]=parseInt(h[0],10)||0,1===h.length&&(h[1]=h[0]),h[1]=parseInt(h[1],10)||0,"right"===a.at[0]?p.left+=s:a.at[0]===i&&(p.left+=s/2),"bottom"===a.at[1]?p.top+=l:a.at[1]===i&&(p.top+=l/2),p.left+=h[0],p.top+=h[1],this.each((function(){var e,n=t(this),o=n.outerWidth(),u=n.outerHeight(),c=parseInt(t.curCSS(this,"marginLeft",!0))||0,f=parseInt(t.curCSS(this,"marginTop",!0))||0,g=o+c+(parseInt(t.curCSS(this,"marginRight",!0))||0),m=u+f+(parseInt(t.curCSS(this,"marginBottom",!0))||0),v=t.extend({},p);"right"===a.my[0]?v.left-=o:a.my[0]===i&&(v.left-=o/2),"bottom"===a.my[1]?v.top-=u:a.my[1]===i&&(v.top-=u/2),r.fractions||(v.left=Math.round(v.left),v.top=Math.round(v.top)),e={left:v.left-c,top:v.top-f},t.each(["left","top"],(function(n,i){t.ui.position[d[n]]&&t.ui.position[d[n]][i](v,{targetWidth:s,targetHeight:l,elemWidth:o,elemHeight:u,collisionPosition:e,collisionWidth:g,collisionHeight:m,offset:h,my:a.my,at:a.at})})),t.fn.bgiframe&&n.bgiframe(),n.offset(t.extend(v,{using:a.using}))}))},t.ui.position={fit:{left:function(e,n){var i=t(window);i=n.collisionPosition.left+n.collisionWidth-i.width()-i.scrollLeft();e.left=0<i?e.left-i:Math.max(e.left-n.collisionPosition.left,e.left)},top:function(e,n){var i=t(window);i=n.collisionPosition.top+n.collisionHeight-i.height()-i.scrollTop();e.top=0<i?e.top-i:Math.max(e.top-n.collisionPosition.top,e.top)}},flip:{left:function(e,n){var r,o,a,s;n.at[0]!==i&&(s=t(window),r=n.collisionPosition.left+n.collisionWidth-s.width()-s.scrollLeft(),o="left"===n.my[0]?-n.elemWidth:"right"===n.my[0]?n.elemWidth:0,a="left"===n.at[0]?n.targetWidth:-n.targetWidth,s=-2*n.offset[0],e.left+=n.collisionPosition.left<0||0<r?o+a+s:0)},top:function(e,n){var r,o,a,s;n.at[1]!==i&&(s=t(window),r=n.collisionPosition.top+n.collisionHeight-s.height()-s.scrollTop(),o="top"===n.my[1]?-n.elemHeight:"bottom"===n.my[1]?n.elemHeight:0,a="top"===n.at[1]?n.targetHeight:-n.targetHeight,s=-2*n.offset[1],e.top+=n.collisionPosition.top<0||0<r?o+a+s:0)}}},t.offset.setOffset||(t.offset.setOffset=function(e,n){/static/.test(t.curCSS(e,"position"))&&(e.style.position="relative");var i=t(e),r=i.offset(),o=parseInt(t.curCSS(e,"top",!0),10)||0,a=parseInt(t.curCSS(e,"left",!0),10)||0;a={top:n.top-r.top+o,left:n.left-r.left+a};"using"in n?n.using.call(e,a):i.css(a)},t.fn.offset=function(e){var n=this[0];return n&&n.ownerDocument?e?t.isFunction(e)?this.each((function(n){t(this).offset(e.call(this,n,t(this).offset()))})):this.each((function(){t.offset.setOffset(this,e)})):a.call(this):null}),t.curCSS||(t.curCSS=t.css),function(){var e,n,i=document.getElementsByTagName("body")[0],o=document.createElement("div"),a=document.createElement(i?"div":"body"),s={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"};for(n in i&&t.extend(s,{position:"absolute",left:"-1000px",top:"-1000px"}),s)a.style[n]=s[n];a.appendChild(o),(e=i||document.documentElement).insertBefore(a,e.firstChild),o.style.cssText="position: absolute; left: 10.7432222px; top: 10.432325px; height: 30px; width: 201px;",o=t(o).offset((function(t,e){return e})).offset(),a.innerHTML="",e.removeChild(a),i=o.top+o.left+(i?2e3:0),r.fractions=21<i&&i<22}()}(jQuery),function(t){t.widget("ui.resizable",t.ui.mouse,{widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1e3},_create:function(){var e=this,n=this.options;if(this.element.addClass("ui-resizable"),t.extend(this,{_aspectRatio:!!n.aspectRatio,aspectRatio:n.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:n.helper||n.ghost||n.animate?n.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)&&(this.element.wrap(t('<div class="ui-wrapper" style="overflow: hidden;"></div>').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("resizable",this.element.data("resizable")),this.elementIsWrapper=!0,this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")}),this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0}),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css({margin:this.originalElement.css("margin")}),this._proportionallyResize()),this.handles=n.handles||(t(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this.handles.constructor==String){"all"==this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw");var i=this.handles.split(",");this.handles={};for(var r=0;r<i.length;r++){var o=t.trim(i[r]),a=t('<div class="ui-resizable-handle ui-resizable-'+o+'"></div>');a.css({zIndex:n.zIndex}),"se"==o&&a.addClass("ui-icon ui-icon-gripsmall-diagonal-se"),this.handles[o]=".ui-resizable-"+o,this.element.append(a)}}this._renderAxis=function(e){for(var n in e=e||this.element,this.handles){var i,r;this.handles[n].constructor==String&&(this.handles[n]=t(this.handles[n],this.element).show()),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)&&(r=t(this.handles[n],this.element),0,i=/sw|ne|nw|se|n|s/.test(n)?r.outerHeight():r.outerWidth(),r=["padding",/ne|nw|n/.test(n)?"Top":/se|sw|s/.test(n)?"Bottom":/^e$/.test(n)?"Right":"Left"].join(""),e.css(r,i),this._proportionallyResize()),t(this.handles[n]).length}},this._renderAxis(this.element),this._handles=t(".ui-resizable-handle",this.element).disableSelection(),this._handles.mouseover((function(){var t;e.resizing||(this.className&&(t=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),e.axis=t&&t[1]?t[1]:"se")})),n.autoHide&&(this._handles.hide(),t(this.element).addClass("ui-resizable-autohide").hover((function(){n.disabled||(t(this).removeClass("ui-resizable-autohide"),e._handles.show())}),(function(){n.disabled||e.resizing||(t(this).addClass("ui-resizable-autohide"),e._handles.hide())}))),this._mouseInit()},destroy:function(){function e(e){t(e).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()}var n;return this._mouseDestroy(),this.elementIsWrapper&&(e(this.element),(n=this.element).after(this.originalElement.css({position:n.css("position"),width:n.outerWidth(),height:n.outerHeight(),top:n.css("top"),left:n.css("left")})).remove()),this.originalElement.css("resize",this.originalResizeStyle),e(this.originalElement),this},_mouseCapture:function(e){var n,i=!1;for(n in this.handles)t(this.handles[n])[0]==e.target&&(i=!0);return!this.options.disabled&&i},_mouseStart:function(n){var i=this.options,r=this.element.position(),o=this.element;this.resizing=!0,this.documentScroll={top:t(document).scrollTop(),left:t(document).scrollLeft()},(o.is(".ui-draggable")||/absolute/.test(o.css("position")))&&o.css({position:"absolute",top:r.top,left:r.left}),this._renderProxy();var a=e(this.helper.css("left"));r=e(this.helper.css("top"));return i.containment&&(a+=t(i.containment).scrollLeft()||0,r+=t(i.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:a,top:r},this.size=this._helper?{width:o.outerWidth(),height:o.outerHeight()}:{width:o.width(),height:o.height()},this.originalSize=this._helper?{width:o.outerWidth(),height:o.outerHeight()}:{width:o.width(),height:o.height()},this.originalPosition={left:a,top:r},this.sizeDiff={width:o.outerWidth()-o.width(),height:o.outerHeight()-o.height()},this.originalMousePosition={left:n.pageX,top:n.pageY},this.aspectRatio="number"==typeof i.aspectRatio?i.aspectRatio:this.originalSize.width/this.originalSize.height||1,i=t(".ui-resizable-"+this.axis).css("cursor"),t("body").css("cursor","auto"==i?this.axis+"-resize":i),o.addClass("ui-resizable-resizing"),this._propagate("start",n),!0},_mouseDrag:function(e){var n=this.helper,i=(this.options,this.originalMousePosition),r=this.axis,o=e.pageX-i.left||0;i=e.pageY-i.top||0;return!!(r=this._change[r])&&(i=r.apply(this,[e,o,i]),t.browser.msie&&t.browser.version,this.sizeDiff,this._updateVirtualBoundaries(e.shiftKey),(this._aspectRatio||e.shiftKey)&&(i=this._updateRatio(i,e)),i=this._respectSize(i,e),this._propagate("resize",e),n.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"}),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),this._updateCache(i),this._trigger("resize",e,this.ui()),!1)},_mouseStop:function(e){this.resizing=!1;var n,i,r,o=this.options,a=this;return this._helper&&(r=(n=(i=this._proportionallyResizeElements).length&&/textarea/i.test(i[0].nodeName))&&t.ui.hasScroll(i[0],"left")?0:a.sizeDiff.height,i=n?0:a.sizeDiff.width,n={width:a.helper.width()-i,height:a.helper.height()-r},i=parseInt(a.element.css("left"),10)+(a.position.left-a.originalPosition.left)||null,r=parseInt(a.element.css("top"),10)+(a.position.top-a.originalPosition.top)||null,o.animate||this.element.css(t.extend(n,{top:r,left:i})),a.helper.height(a.size.height),a.helper.width(a.size.width),this._helper&&!o.animate&&this._proportionallyResize()),t("body").css("cursor","auto"),this.element.removeClass("ui-resizable-resizing"),this._propagate("stop",e),this._helper&&this.helper.remove(),!1},_updateVirtualBoundaries:function(t){var e,i,r=this.options,o={minWidth:n(r.minWidth)?r.minWidth:0,maxWidth:n(r.maxWidth)?r.maxWidth:1/0,minHeight:n(r.minHeight)?r.minHeight:0,maxHeight:n(r.maxHeight)?r.maxHeight:1/0};(this._aspectRatio||t)&&(e=o.minHeight*this.aspectRatio,i=o.minWidth/this.aspectRatio,r=o.maxHeight*this.aspectRatio,t=o.maxWidth/this.aspectRatio,e>o.minWidth&&(o.minWidth=e),i>o.minHeight&&(o.minHeight=i),r<o.maxWidth&&(o.maxWidth=r),t<o.maxHeight&&(o.maxHeight=t)),this._vBoundaries=o},_updateCache:function(t){this.options,this.offset=this.helper.offset(),n(t.left)&&(this.position.left=t.left),n(t.top)&&(this.position.top=t.top),n(t.height)&&(this.size.height=t.height),n(t.width)&&(this.size.width=t.width)},_updateRatio:function(t,e){this.options;var i=this.position,r=this.size,o=this.axis;return n(t.height)?t.width=t.height*this.aspectRatio:n(t.width)&&(t.height=t.width/this.aspectRatio),"sw"==o&&(t.left=i.left+(r.width-t.width),t.top=null),"nw"==o&&(t.top=i.top+(r.height-t.height),t.left=i.left+(r.width-t.width)),t},_respectSize:function(t,e){this.helper;var i=this._vBoundaries,r=(this._aspectRatio||e.shiftKey,this.axis),o=n(t.width)&&i.maxWidth&&i.maxWidth<t.width,a=n(t.height)&&i.maxHeight&&i.maxHeight<t.height,s=n(t.width)&&i.minWidth&&i.minWidth>t.width,l=n(t.height)&&i.minHeight&&i.minHeight>t.height;s&&(t.width=i.minWidth),l&&(t.height=i.minHeight),o&&(t.width=i.maxWidth),a&&(t.height=i.maxHeight);var u=this.originalPosition.left+this.originalSize.width,c=this.position.top+this.size.height;e=/sw|nw|w/.test(r),r=/nw|ne|n/.test(r);return s&&e&&(t.left=u-i.minWidth),o&&e&&(t.left=u-i.maxWidth),l&&r&&(t.top=c-i.minHeight),a&&r&&(t.top=c-i.maxHeight),(i=!t.width&&!t.height)&&!t.left&&t.top?t.top=null:i&&!t.top&&t.left&&(t.left=null),t},_proportionallyResize:function(){if(this.options,this._proportionallyResizeElements.length)for(var e=this.helper||this.element,n=0;n<this._proportionallyResizeElements.length;n++){var i,r,o=this._proportionallyResizeElements[n];this.borderDif||(i=[o.css("borderTopWidth"),o.css("borderRightWidth"),o.css("borderBottomWidth"),o.css("borderLeftWidth")],r=[o.css("paddingTop"),o.css("paddingRight"),o.css("paddingBottom"),o.css("paddingLeft")],this.borderDif=t.map(i,(function(t,e){return(parseInt(t,10)||0)+(parseInt(r[e],10)||0)}))),t.browser.msie&&(t(e).is(":hidden")||t(e).parents(":hidden").length)||o.css({height:e.height()-this.borderDif[0]-this.borderDif[2]||0,width:e.width()-this.borderDif[1]-this.borderDif[3]||0})}},_renderProxy:function(){var e,n=this.element,i=this.options;this.elementOffset=n.offset(),this._helper?(this.helper=this.helper||t('<div style="overflow:hidden;"></div>'),n=(e=t.browser.msie&&t.browser.version<7)?1:0,e=e?2:-1,this.helper.addClass(this._helper).css({width:this.element.outerWidth()+e,height:this.element.outerHeight()+e,position:"absolute",left:this.elementOffset.left-n+"px",top:this.elementOffset.top-n+"px",zIndex:++i.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(t,e,n){return{width:this.originalSize.width+e}},w:function(t,e,n){this.options;var i=this.originalSize;return{left:this.originalPosition.left+e,width:i.width-e}},n:function(t,e,n){this.options;var i=this.originalSize;return{top:this.originalPosition.top+n,height:i.height-n}},s:function(t,e,n){return{height:this.originalSize.height+n}},se:function(e,n,i){return t.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[e,n,i]))},sw:function(e,n,i){return t.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[e,n,i]))},ne:function(e,n,i){return t.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[e,n,i]))},nw:function(e,n,i){return t.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[e,n,i]))}},_propagate:function(e,n){t.ui.plugin.call(this,e,[n,this.ui()]),"resize"!=e&&this._trigger(e,n,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),t.extend(t.ui.resizable,{version:"1.8.24"}),t.ui.plugin.add("resizable","alsoResize",{start:function(e,n){function i(e){t(e).each((function(){var e=t(this);e.data("resizable-alsoresize",{width:parseInt(e.width(),10),height:parseInt(e.height(),10),left:parseInt(e.css("left"),10),top:parseInt(e.css("top"),10)})}))}var r=t(this).data("resizable").options;"object"!=typeof r.alsoResize||r.alsoResize.parentNode?i(r.alsoResize):r.alsoResize.length?(r.alsoResize=r.alsoResize[0],i(r.alsoResize)):t.each(r.alsoResize,(function(t){i(t)}))},resize:function(e,n){function i(e,i){t(e).each((function(){var e=t(this),r=t(this).data("resizable-alsoresize"),o={},a=i&&i.length?i:e.parents(n.originalElement[0]).length?["width","height"]:["width","height","top","left"];t.each(a,(function(t,e){var n=(r[e]||0)+(l[e]||0);n&&0<=n&&(o[e]=n||null)})),e.css(o)}))}var r=t(this).data("resizable"),o=r.options,a=r.originalSize,s=r.originalPosition,l={height:r.size.height-a.height||0,width:r.size.width-a.width||0,top:r.position.top-s.top||0,left:r.position.left-s.left||0};"object"!=typeof o.alsoResize||o.alsoResize.nodeType?i(o.alsoResize):t.each(o.alsoResize,(function(t,e){i(t,e)}))},stop:function(e,n){t(this).removeData("resizable-alsoresize")}}),t.ui.plugin.add("resizable","animate",{stop:function(e,n){var i=t(this).data("resizable"),r=i.options,o=i._proportionallyResizeElements,a=(l=o.length&&/textarea/i.test(o[0].nodeName))&&t.ui.hasScroll(o[0],"left")?0:i.sizeDiff.height,s=l?0:i.sizeDiff.width,l={width:i.size.width-s,height:i.size.height-a};s=parseInt(i.element.css("left"),10)+(i.position.left-i.originalPosition.left)||null,a=parseInt(i.element.css("top"),10)+(i.position.top-i.originalPosition.top)||null;i.element.animate(t.extend(l,a&&s?{top:a,left:s}:{}),{duration:r.animateDuration,easing:r.animateEasing,step:function(){var n={width:parseInt(i.element.css("width"),10),height:parseInt(i.element.css("height"),10),top:parseInt(i.element.css("top"),10),left:parseInt(i.element.css("left"),10)};o&&o.length&&t(o[0]).css({width:n.width,height:n.height}),i._updateCache(n),i._propagate("resize",e)}})}}),t.ui.plugin.add("resizable","containment",{start:function(n,i){var r,o,a=t(this).data("resizable"),s=a.options,l=a.element,u=s.containment,c=u instanceof t?u.get(0):/parent/.test(u)?l.parent().get(0):u;c&&(a.containerElement=t(c),/document/.test(u)||u==document?(a.containerOffset={left:0,top:0},a.containerPosition={left:0,top:0},a.parentData={element:t(document),left:0,top:0,width:t(document).width(),height:t(document).height()||document.body.parentNode.scrollHeight}):(r=t(c),o=[],t(["Top","Right","Left","Bottom"]).each((function(t,n){o[t]=e(r.css("padding"+n))})),a.containerOffset=r.offset(),a.containerPosition=r.position(),a.containerSize={height:r.innerHeight()-o[3],width:r.innerWidth()-o[1]},s=a.containerOffset,l=a.containerSize.height,u=a.containerSize.width,u=t.ui.hasScroll(c,"left")?c.scrollWidth:u,l=t.ui.hasScroll(c)?c.scrollHeight:l,a.parentData={element:c,left:s.left,top:s.top,width:u,height:l}))},resize:function(e,n){var i=t(this).data("resizable"),r=i.options,o=(i.containerSize,i.containerOffset),a=(i.size,i.position),s=i._aspectRatio||e.shiftKey,l={top:0,left:0};(e=i.containerElement)[0]!=document&&/static/.test(e.css("position"))&&(l=o),a.left<(i._helper?o.left:0)&&(i.size.width=i.size.width+(i._helper?i.position.left-o.left:i.position.left-l.left),s&&(i.size.height=i.size.width/i.aspectRatio),i.position.left=r.helper?o.left:0),a.top<(i._helper?o.top:0)&&(i.size.height=i.size.height+(i._helper?i.position.top-o.top:i.position.top),s&&(i.size.width=i.size.height*i.aspectRatio),i.position.top=i._helper?o.top:0),i.offset.left=i.parentData.left+i.position.left,i.offset.top=i.parentData.top+i.position.top,r=Math.abs((i._helper,i.offset.left-l.left+i.sizeDiff.width)),a=Math.abs((i._helper?i.offset.top-l.top:i.offset.top-o.top)+i.sizeDiff.height),l=i.containerElement.get(0)==i.element.parent().get(0),o=/relative|absolute/.test(i.containerElement.css("position")),l&&o&&(r-=i.parentData.left),r+i.size.width>=i.parentData.width&&(i.size.width=i.parentData.width-r,s&&(i.size.height=i.size.width/i.aspectRatio)),a+i.size.height>=i.parentData.height&&(i.size.height=i.parentData.height-a,s&&(i.size.width=i.size.height*i.aspectRatio))},stop:function(e,n){var i=t(this).data("resizable"),r=i.options,o=(i.position,i.containerOffset),a=i.containerPosition,s=i.containerElement,l=(c=t(i.helper)).offset(),u=c.outerWidth()-i.sizeDiff.width,c=c.outerHeight()-i.sizeDiff.height;i._helper&&!r.animate&&/relative/.test(s.css("position"))&&t(this).css({left:l.left-a.left-o.left,width:u,height:c}),i._helper&&!r.animate&&/static/.test(s.css("position"))&&t(this).css({left:l.left-a.left-o.left,width:u,height:c})}}),t.ui.plugin.add("resizable","ghost",{start:function(e,n){var i=t(this).data("resizable"),r=i.options,o=i.size;i.ghost=i.originalElement.clone(),i.ghost.css({opacity:.25,display:"block",position:"relative",height:o.height,width:o.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass("string"==typeof r.ghost?r.ghost:""),i.ghost.appendTo(i.helper)},resize:function(e,n){var i=t(this).data("resizable");i.options,i.ghost&&i.ghost.css({position:"relative",height:i.size.height,width:i.size.width})},stop:function(e,n){var i=t(this).data("resizable");i.options,i.ghost&&i.helper&&i.helper.get(0).removeChild(i.ghost.get(0))}}),t.ui.plugin.add("resizable","grid",{resize:function(e,n){var i=t(this).data("resizable"),r=i.options,o=i.size,a=i.originalSize,s=i.originalPosition,l=i.axis;r._aspectRatio||e.shiftKey,r.grid="number"==typeof r.grid?[r.grid,r.grid]:r.grid,e=Math.round((o.width-a.width)/(r.grid[0]||1))*(r.grid[0]||1),r=Math.round((o.height-a.height)/(r.grid[1]||1))*(r.grid[1]||1),/^(se|s|e)$/.test(l)?(i.size.width=a.width+e,i.size.height=a.height+r):/^(ne)$/.test(l)?(i.size.width=a.width+e,i.size.height=a.height+r,i.position.top=s.top-r):(/^(sw)$/.test(l)?(i.size.width=a.width+e,i.size.height=a.height+r):(i.size.width=a.width+e,i.size.height=a.height+r,i.position.top=s.top-r),i.position.left=s.left-e)}});var e=function(t){return parseInt(t,10)||0},n=function(t){return!isNaN(parseInt(t,10))}}(jQuery),function(t){t.widget("ui.slider",t.ui.mouse,{widgetEventPrefix:"slide",options:{animate:!1,distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null},_create:function(){var e=this,n=this.options,i=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),r=n.values&&n.values.length||1,o=[];this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget ui-widget-content ui-corner-all"+(n.disabled?" ui-slider-disabled ui-disabled":"")),this.range=t([]),n.range&&(!0===n.range&&(n.values||(n.values=[this._valueMin(),this._valueMin()]),n.values.length&&2!==n.values.length&&(n.values=[n.values[0],n.values[0]])),this.range=t("<div></div>").appendTo(this.element).addClass("ui-slider-range ui-widget-header"+("min"===n.range||"max"===n.range?" ui-slider-range-"+n.range:"")));for(var a=i.length;a<r;a+=1)o.push("<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>");this.handles=i.add(t(o.join("")).appendTo(e.element)),this.handle=this.handles.eq(0),this.handles.add(this.range).filter("a").click((function(t){t.preventDefault()})).hover((function(){n.disabled||t(this).addClass("ui-state-hover")}),(function(){t(this).removeClass("ui-state-hover")})).focus((function(){n.disabled?t(this).blur():(t(".ui-slider .ui-state-focus").removeClass("ui-state-focus"),t(this).addClass("ui-state-focus"))})).blur((function(){t(this).removeClass("ui-state-focus")})),this.handles.each((function(e){t(this).data("index.ui-slider-handle",e)})),this.handles.keydown((function(n){var i,r,o,a=t(this).data("index.ui-slider-handle");if(!e.options.disabled){switch(n.keyCode){case t.ui.keyCode.HOME:case t.ui.keyCode.END:case t.ui.keyCode.PAGE_UP:case t.ui.keyCode.PAGE_DOWN:case t.ui.keyCode.UP:case t.ui.keyCode.RIGHT:case t.ui.keyCode.DOWN:case t.ui.keyCode.LEFT:if(n.preventDefault(),!e._keySliding&&(e._keySliding=!0,t(this).addClass("ui-state-active"),!1===e._start(n,a)))return}switch(o=e.options.step,i=r=e.options.values&&e.options.values.length?e.values(a):e.value(),n.keyCode){case t.ui.keyCode.HOME:r=e._valueMin();break;case t.ui.keyCode.END:r=e._valueMax();break;case t.ui.keyCode.PAGE_UP:r=e._trimAlignValue(i+(e._valueMax()-e._valueMin())/5);break;case t.ui.keyCode.PAGE_DOWN:r=e._trimAlignValue(i-(e._valueMax()-e._valueMin())/5);break;case t.ui.keyCode.UP:case t.ui.keyCode.RIGHT:if(i===e._valueMax())return;r=e._trimAlignValue(i+o);break;case t.ui.keyCode.DOWN:case t.ui.keyCode.LEFT:if(i===e._valueMin())return;r=e._trimAlignValue(i-o)}e._slide(n,a,r)}})).keyup((function(n){var i=t(this).data("index.ui-slider-handle");e._keySliding&&(e._keySliding=!1,e._stop(n,i),e._change(n,i),t(this).removeClass("ui-state-active"))})),this._refreshValue(),this._animateOff=!1},destroy:function(){return this.handles.remove(),this.range.remove(),this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all").removeData("slider").unbind(".slider"),this._mouseDestroy(),this},_mouseCapture:function(e){var n,i,r,o,a,s,l=this.options;return!l.disabled&&(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),s={x:e.pageX,y:e.pageY},n=this._normValueFromMouse(s),i=this._valueMax()-this._valueMin()+1,(o=this).handles.each((function(e){var s=Math.abs(n-o.values(e));s<i&&(i=s,r=t(this),a=e)})),!0===l.range&&this.values(1)===l.min&&(a+=1,r=t(this.handles[a])),!1!==this._start(e,a)&&(this._mouseSliding=!0,o._handleIndex=a,r.addClass("ui-state-active").focus(),s=r.offset(),l=!t(e.target).parents().andSelf().is(".ui-slider-handle"),this._clickOffset=l?{left:0,top:0}:{left:e.pageX-s.left-r.width()/2,top:e.pageY-s.top-r.height()/2-(parseInt(r.css("borderTopWidth"),10)||0)-(parseInt(r.css("borderBottomWidth"),10)||0)+(parseInt(r.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(e,a,n),this._animateOff=!0))},_mouseStart:function(t){return!0},_mouseDrag:function(t){var e={x:t.pageX,y:t.pageY};e=this._normValueFromMouse(e);return this._slide(t,this._handleIndex,e),!1},_mouseStop:function(t){return this.handles.removeClass("ui-state-active"),this._mouseSliding=!1,this._stop(t,this._handleIndex),this._change(t,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1},_detectOrientation:function(){this.orientation="vertical"===this.options.orientation?"vertical":"horizontal"},_normValueFromMouse:function(t){var e;return(t=1<(t=(t="horizontal"===this.orientation?(e=this.elementSize.width,t.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(e=this.elementSize.height,t.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)))/e)?1:t)<0&&(t=0),"vertical"===this.orientation&&(t=1-t),e=this._valueMax()-this._valueMin(),e=this._valueMin()+t*e,this._trimAlignValue(e)},_start:function(t,e){var n={handle:this.handles[e],value:this.value()};return this.options.values&&this.options.values.length&&(n.value=this.values(e),n.values=this.values()),this._trigger("start",t,n)},_slide:function(t,e,n){var i,r;this.options.values&&this.options.values.length?(i=this.values(e?0:1),(n=2===this.options.values.length&&!0===this.options.range&&(0===e&&i<n||1===e&&n<i)?i:n)!==this.values(e)&&((r=this.values())[e]=n,r=this._trigger("slide",t,{handle:this.handles[e],value:n,values:r}),i=this.values(e?0:1),!1!==r&&this.values(e,n,!0))):n===this.value()||!1!==(r=this._trigger("slide",t,{handle:this.handles[e],value:n}))&&this.value(n)},_stop:function(t,e){var n={handle:this.handles[e],value:this.value()};this.options.values&&this.options.values.length&&(n.value=this.values(e),n.values=this.values()),this._trigger("stop",t,n)},_change:function(t,e){var n;this._keySliding||this._mouseSliding||(n={handle:this.handles[e],value:this.value()},this.options.values&&this.options.values.length&&(n.value=this.values(e),n.values=this.values()),this._trigger("change",t,n))},value:function(t){return arguments.length?(this.options.value=this._trimAlignValue(t),this._refreshValue(),void this._change(null,0)):this._value()},values:function(e,n){var i,r,o;if(1<arguments.length)return this.options.values[e]=this._trimAlignValue(n),this._refreshValue(),void this._change(null,e);if(!arguments.length)return this._values();if(!t.isArray(e))return this.options.values&&this.options.values.length?this._values(e):this.value();for(i=this.options.values,r=e,o=0;o<i.length;o+=1)i[o]=this._trimAlignValue(r[o]),this._change(null,o);this._refreshValue()},_setOption:function(e,n){var i,r=0;switch(t.isArray(this.options.values)&&(r=this.options.values.length),t.Widget.prototype._setOption.apply(this,arguments),e){case"disabled":n?(this.handles.filter(".ui-state-focus").blur(),this.handles.removeClass("ui-state-hover"),this.handles.propAttr("disabled",!0),this.element.addClass("ui-disabled")):(this.handles.propAttr("disabled",!1),this.element.removeClass("ui-disabled"));break;case"orientation":this._detectOrientation(),this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation),this._refreshValue();break;case"value":this._animateOff=!0,this._refreshValue(),this._change(null,0),this._animateOff=!1;break;case"values":for(this._animateOff=!0,this._refreshValue(),i=0;i<r;i+=1)this._change(null,i);this._animateOff=!1}},_value:function(){var t=this.options.value;return this._trimAlignValue(t)},_values:function(t){var e,n,i;if(arguments.length)return e=this.options.values[t],this._trimAlignValue(e);for(n=this.options.values.slice(),i=0;i<n.length;i+=1)n[i]=this._trimAlignValue(n[i]);return n},_trimAlignValue:function(t){if(t<=this._valueMin())return this._valueMin();if(t>=this._valueMax())return this._valueMax();var e=0<this.options.step?this.options.step:1,n=(t-this._valueMin())%e;t-=n;return 2*Math.abs(n)>=e&&(t+=0<n?e:-e),parseFloat(t.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var e,n,i,r,o,a=this.options.range,s=this.options,l=this,u=!this._animateOff&&s.animate,c={};this.options.values&&this.options.values.length?this.handles.each((function(i,r){e=(l.values(i)-l._valueMin())/(l._valueMax()-l._valueMin())*100,c["horizontal"===l.orientation?"left":"bottom"]=e+"%",t(this).stop(1,1)[u?"animate":"css"](c,s.animate),!0===l.options.range&&("horizontal"===l.orientation?(0===i&&l.range.stop(1,1)[u?"animate":"css"]({left:e+"%"},s.animate),1===i&&l.range[u?"animate":"css"]({width:e-n+"%"},{queue:!1,duration:s.animate})):(0===i&&l.range.stop(1,1)[u?"animate":"css"]({bottom:e+"%"},s.animate),1===i&&l.range[u?"animate":"css"]({height:e-n+"%"},{queue:!1,duration:s.animate}))),n=e})):(i=this.value(),r=this._valueMin(),o=this._valueMax(),e=o!==r?(i-r)/(o-r)*100:0,c["horizontal"===l.orientation?"left":"bottom"]=e+"%",this.handle.stop(1,1)[u?"animate":"css"](c,s.animate),"min"===a&&"horizontal"===this.orientation&&this.range.stop(1,1)[u?"animate":"css"]({width:e+"%"},s.animate),"max"===a&&"horizontal"===this.orientation&&this.range[u?"animate":"css"]({width:100-e+"%"},{queue:!1,duration:s.animate}),"min"===a&&"vertical"===this.orientation&&this.range.stop(1,1)[u?"animate":"css"]({height:e+"%"},s.animate),"max"===a&&"vertical"===this.orientation&&this.range[u?"animate":"css"]({height:100-e+"%"},{queue:!1,duration:s.animate}))}}),t.extend(t.ui.slider,{version:"1.8.24"})}(jQuery);var SVG_ARROW_POLYGON="0,3 12,3 12,0 18,5 12,10 12,7 0,7",SVG_ARROW_HEIGHT=10,curVisualizerID=1;function ExecutionVisualizer(t,e,n){this.curInputCode=e.code.rtrim(),this.curTrace=e.trace,this.DEFAULT_EMBEDDED_CODE_DIV_WIDTH=350,this.DEFAULT_EMBEDDED_CODE_DIV_HEIGHT=400,0<this.curTrace.length&&("raw_input"==(r=this.curTrace[this.curTrace.length-1]).event?(this.promptForUserInput=!0,this.userInputPromptStr=htmlspecialchars(r.prompt),this.curTrace.pop()):"mouse_input"==r.event&&(this.promptForMouseInput=!0,this.userInputPromptStr=htmlspecialchars(r.prompt),this.curTrace.pop())),this.curInstr=0,this.params=n,this.params||(this.params={});var i,r=void 0!==this.params.arrowLines;n=void 0!==this.params.highlightLines;r||n?r&&n||(r?this.params.highlightLines=!this.params.arrowLines:this.params.arrowLines=!this.params.highlightLines):(this.params.highlightLines=!1,this.params.arrowLines=!0),this.compactFuncLabels=this.params.compactFuncLabels,this.params.pyCrazyMode&&(this.params.arrowLines=this.params.highlightLines=!1),this.params.visualizerIdOverride?this.visualizerID=this.params.visualizerIdOverride:(this.visualizerID=curVisualizerID,curVisualizerID++),this.leftGutterSvgInitialized=!1,this.arrowOffsetY=void 0,this.codeRowHeight=void 0,this.disableHeapNesting=1==this.params.disableHeapNesting,this.drawParentPointers=1==this.params.drawParentPointers,this.textualMemoryLabels=1==this.params.textualMemoryLabels,this.showOnlyOutputs=1==this.params.showOnlyOutputs,this.tabularView=1==this.params.tabularView,this.showAllFrameLabels=1==this.params.showAllFrameLabels,this.executeCodeWithRawInputFunc=this.params.executeCodeWithRawInputFunc,this.jsPlumbInstance=jsPlumb.getInstance({Endpoint:["Dot",{radius:3}],EndpointStyles:[{fillStyle:connectorBaseColor},{fillstyle:null}],Anchors:["RightMiddle","LeftMiddle"],PaintStyle:{lineWidth:1,strokeStyle:connectorBaseColor},Connector:["StateMachine"],Overlays:[["Arrow",{length:10,width:7,foldback:.55,location:1}]],EndpointHoverStyles:[{fillStyle:connectorHighlightColor},{fillstyle:null}],HoverPaintStyle:{lineWidth:1,strokeStyle:connectorHighlightColor}}),this.domRoot=$("#"+t),this.domRoot.data("vis",this),this.domRootD3=d3.select("#"+t),this.domRoot.html('<div class="ExecutionVisualizer"></div>'),this.domRoot=this.domRoot.find("div.ExecutionVisualizer"),this.domRootD3=this.domRootD3.select("div.ExecutionVisualizer"),this.codeOutputLines=null,this.breakpoints=null,this.sortedBreakpointsList=[],this.classAttrsHidden={},this.pytutor_hooks={},"java"===this.params.lang&&this.activateJavaFrontend(),this.numStdoutLines=0;for(var o=this.curTrace.length-1;0<=o&&!(i=this.curTrace[o].stdout);o--);i&&(this.numStdoutLines=i.rtrim().split("\n").length),this.try_hook("end_constructor",{myViz:this}),this.hasRendered=!1,this.render()}function htmlWithHighlight(t,e,n,i){var r="";0<e&&(r=t.slice(0,e));var o=t.slice(e,e+n),a="";return e+n<t.length&&(a=t.slice(e+n,t.length)),htmlspecialchars(r)+'<span class="'+i+'">'+htmlspecialchars(o)+"</span>"+htmlspecialchars(a)}ExecutionVisualizer.prototype.add_pytutor_hook=function(t,e){this.pytutor_hooks[t]?this.pytutor_hooks[t].push(e):this.pytutor_hooks[t]=[e]},ExecutionVisualizer.prototype.try_hook=function(t,e){if(this.pytutor_hooks[t])for(var n=0;n<this.pytutor_hooks[t].length;n++){var i=this.pytutor_hooks[t][n].apply(null,[e]);if(i&&i[0])return i}return[!1]},ExecutionVisualizer.prototype.resetJsPlumbManager=function(){this.jsPlumbManager={heap_pointer_src_id:1,connectionEndpointIDs:d3.map(),heapConnectionEndpointIDs:d3.map(),parentPointerConnectionEndpointIDs:d3.map(),renderedHeapObjectIDs:d3.map()}},ExecutionVisualizer.prototype.generateID=function(t){return"v"+this.visualizerID+"__"+t},ExecutionVisualizer.prototype.generateHeapObjID=function(t,e){return this.generateID("heap_object_"+t+"_s"+e)},ExecutionVisualizer.prototype.render=function(){if(this.hasRendered)alert("ERROR: You should only call render() ONCE on an ExecutionVisualizer object.");else{var t=this,e='<div id="codeDisplayDiv"> <div id="langDisplayDiv"></div> <div id="pyCodeOutputDiv"/> <div id="editCodeLinkDiv"><a id="editBtn">Edit code</a> <span id="liveModeSpan" style="display: none;">| <a id="editLiveModeBtn" href="#">Live programming</a></a> </div> <div id="legendDiv"/> <div id="executionSliderDocs"></div> <div id="executionSlider"/> <div id="executionSliderFooter"/> <div id="vcrControls"> <button id="jmpFirstInstr", type="button">&lt;&lt; First</button> <button id="jmpStepBack", type="button">&lt; Back</button> <span id="curInstr">Step ? of ?</span> <button id="jmpStepFwd", type="button">Forward &gt;</button> <button id="jmpLastInstr", type="button">Last &gt;&gt;</button> </div> <div id="rawUserInputDiv"> <span id="userInputPromptStr"/> <input type="text" id="raw_input_textbox" size="30"/> <button id="raw_input_submit_btn">Submit</button> </div> <div id="errorOutput"/> <div id="stepAnnotationDiv"> <textarea class="annotationText" id="stepAnnotationEditor" cols="60" rows="3"></textarea> <div class="annotationText" id="stepAnnotationViewer"></div> </div> <div id="annotateLinkDiv"><button id="annotateBtn" type="button">Annotate this step</button></div> </div>',n='<div id="htmlOutputDiv"></div> <div id="progOutputs"> <div id="printOutputDocs">Print output (drag lower right corner to resize)</div>\n <textarea id="pyStdout" cols="40" rows="5" wrap="off" readonly></textarea> </div>',i='<div id="dataViz"> <table id="stackHeapTable"> <tr> <td id="stack_td"> <div id="globals_area"> <div id="stackHeader">Frames</div> </div> <div id="stack"></div> </td> <td id="heap_td"> <div id="heap"> <div id="heapHeader">Objects</div> </div> </td> </tr> </table> </div>';t.tabularView&&(i='<div id="optTabularView"></div>');var r,o='<div id="vizHeader"> <textarea class="vizTitleText" id="vizTitleEditor" cols="60" rows="1"></textarea> <div class="vizTitleText" id="vizTitleViewer"></div> <textarea class="vizDescriptionText" id="vizDescriptionEditor" cols="75" rows="2"></textarea> <div class="vizDescriptionText" id="vizDescriptionViewer"></div> </div>';this.params.verticalStack?this.domRoot.html(o+'<table border="0" class="visualizer"><tr><td class="vizLayoutTd" id="vizLayoutTdFirst"">'+e+'</td></tr><tr><td class="vizLayoutTd" id="vizLayoutTdSecond">'+i+"</td></tr></table>"):this.domRoot.html(o+'<table border="0" class="visualizer"><tr><td class="vizLayoutTd" id="vizLayoutTdFirst">'+e+'</td><td class="vizLayoutTd" id="vizLayoutTdSecond">'+i+"</td></tr></table>"),this.showOnlyOutputs?(t.domRoot.find("#dataViz").hide(),this.domRoot.find("#vizLayoutTdSecond").append(n),this.params.verticalStack?this.domRoot.find("#vizLayoutTdSecond").css("padding-top","25px"):this.domRoot.find("#vizLayoutTdSecond").css("padding-left","25px")):(i="75px",this.numStdoutLines<=3&&(i=18*this.numStdoutLines+"px"),this.params.embeddedMode&&(i="45px"),this.domRoot.find("#vizLayoutTdSecond").prepend(n),this.domRoot.find("#pyStdout").width("350px").height(i).resizable()),this.params.arrowLines?(this.domRoot.find("#legendDiv").append('<svg id="prevLegendArrowSVG"/> line that has just executed').append('<p style="margin-top: 4px"><svg id="curLegendArrowSVG"/> next line to execute</p>'),t.domRootD3.select("svg#prevLegendArrowSVG").append("polygon").attr("points",SVG_ARROW_POLYGON).attr("fill",lightArrowColor),t.domRootD3.select("svg#curLegendArrowSVG").append("polygon").attr("points",SVG_ARROW_POLYGON).attr("fill",darkArrowColor)):this.params.highlightLines?t.domRoot.find("#legendDiv").append('<span class="highlight-legend highlight-prev">line that has just executed</span> ').append('<span class="highlight-legend highlight-cur">next line to execute</span>'):this.params.pyCrazyMode&&t.domRoot.find("#legendDiv").append('<a href="https://github.com/pgbovine/Py2crazy">Py2crazy</a> mode!').append(" Stepping through (roughly) each executed expression. Color codes:<p/>").append('<span class="pycrazy-highlight-prev">expression that just executed</span><br/>').append('<span class="pycrazy-highlight-cur">next expression to execute</span>'),this.params.editCodeBaseURL?(a="2","js"===this.params.lang?a="js":"ts"===this.params.lang?a="ts":"java"===this.params.lang?a="java":"py3"===this.params.lang?a="3":"c"===this.params.lang?a="c":"cpp"===this.params.lang&&(a="cpp"),a=$.param.fragment(this.params.editCodeBaseURL,{code:this.curInputCode,py:a},2),this.domRoot.find("#editBtn").attr("href",a)):(this.domRoot.find("#editCodeLinkDiv").hide(),this.domRoot.find("#editBtn").attr("href","#"),this.domRoot.find("#editBtn").click((function(){return!1}))),void 0!==this.params.lang&&("js"===this.params.lang?this.domRoot.find("#langDisplayDiv").html("JavaScript"):"ts"===this.params.lang?this.domRoot.find("#langDisplayDiv").html("TypeScript"):"ruby"===this.params.lang?this.domRoot.find("#langDisplayDiv").html("Ruby"):"java"===this.params.lang?this.domRoot.find("#langDisplayDiv").html("Java"):"py2"===this.params.lang?this.domRoot.find("#langDisplayDiv").html("Python 2.7"):"py3"===this.params.lang?this.domRoot.find("#langDisplayDiv").html("Python 3.3"):"c"===this.params.lang?this.domRoot.find("#langDisplayDiv").html('C (gcc 4.8, C11) <font color="#e93f34">EXPERIMENTAL!</font><br/>see <a href="https://github.com/pgbovine/opt-cpp-backend/issues" target="_blank">known bugs</a> and report to philip@pgbovine.net'):"cpp"===this.params.lang?this.domRoot.find("#langDisplayDiv").html('C++ (gcc 4.8, C++11) <font color="#e93f34">EXPERIMENTAL!</font><br/>see <a href="https://github.com/pgbovine/opt-cpp-backend/issues" target="_blank">known bugs</a> and report to philip@pgbovine.net'):this.domRoot.find("#langDisplayDiv").hide()),void 0!==this.params.allowEditAnnotations?this.allowEditAnnotations=this.params.allowEditAnnotations:this.allowEditAnnotations=!1,void 0!==this.params.pyCrazyMode?this.pyCrazyMode=this.params.pyCrazyMode:this.pyCrazyMode=!1,this.domRoot.find("#stepAnnotationEditor").hide(),this.params.embeddedMode&&(this.embeddedMode=!0,void 0===this.params.codeDivWidth&&(this.params.codeDivWidth=this.DEFAULT_EMBEDDED_CODE_DIV_WIDTH),void 0===this.params.codeDivHeight&&(this.params.codeDivHeight=this.DEFAULT_EMBEDDED_CODE_DIV_HEIGHT),this.allowEditAnnotations=!1,this.domRoot.find("#codeDisplayDiv").append('<div style="font-size: 8pt; margin-bottom: 20px;">Visualized using <a href="http://pythontutor.com" target="_blank" style="color: #3D58A2;">Online Python Tutor</a> by <a href="http://www.pgbovine.net/" target="_blank" style="color: #3D58A2;">Philip Guo</a></div>'),t.domRoot.find("#executionSliderDocs").hide()),t.editAnnotationMode=!1,this.allowEditAnnotations?(r=this.domRoot.find("#annotateBtn")).click((function(){t.editAnnotationMode?(t.enterViewAnnotationsMode(),t.domRoot.find("#jmpFirstInstr,#jmpLastInstr,#jmpStepBack,#jmpStepFwd,#executionSlider,#editCodeLinkDiv,#stepAnnotationViewer").show(),t.domRoot.find("#stepAnnotationEditor").hide(),r.html("Annotate this step")):(t.enterEditAnnotationsMode(),t.domRoot.find("#jmpFirstInstr,#jmpLastInstr,#jmpStepBack,#jmpStepFwd,#executionSlider,#editCodeLinkDiv,#stepAnnotationViewer").hide(),t.domRoot.find("#stepAnnotationEditor").show(),r.html("Done annotating"))})):this.domRoot.find("#annotateBtn").hide(),this.params.codeDivWidth&&this.params.codeDivWidth<470&&(this.domRoot.find("#jmpFirstInstr").hide(),this.domRoot.find("#jmpLastInstr").hide()),this.params.codeDivWidth&&this.domRoot.find("#codeDisplayDiv").width(this.params.codeDivWidth),this.domRoot.find("#codeDisplayDiv").resizable({handles:"e",minWidth:100,resize:function(e,n){t.domRoot.find("#codeDisplayDiv").css("height","auto"),t.renderSliderBreakpoints(),t.params.updateOutputCallback&&t.params.updateOutputCallback(this)}}),this.params.codeDivHeight&&this.domRoot.find("#pyCodeOutputDiv").css("max-height",this.params.codeDivHeight+"px"),this.domRoot.find("#globals_area").append('<div class="stackFrame" id="'+t.generateID("globals")+'"><div id="'+t.generateID("globals_header")+'" class="stackFrameHeader">'+this.getRealLabel("Global frame")+'</div><table class="stackFrameVarTable" id="'+t.generateID("global_table")+'"></table></div>'),this.params.hideOutput&&this.domRoot.find("#progOutputs").hide(),this.domRoot.find("#jmpFirstInstr").click((function(){t.renderStep(0)})),this.domRoot.find("#jmpLastInstr").click((function(){t.renderStep(t.curTrace.length-1)})),this.domRoot.find("#jmpStepBack").click((function(){t.stepBack()})),this.domRoot.find("#jmpStepFwd").click((function(){t.stepForward()})),this.domRoot.find("#vcrControls #jmpFirstInstr").attr("disabled",!0),this.domRoot.find("#vcrControls #jmpStepBack").attr("disabled",!0),this.domRoot.find("#vcrControls #jmpStepFwd").attr("disabled",!0),this.domRoot.find("#vcrControls #jmpLastInstr").attr("disabled",!0);var a=this.curTrace[this.curTrace.length-1];this.instrLimitReached="instruction_limit_reached"==a.event,this.instrLimitReached&&(this.curTrace.pop(),s=a.exception_msg,this.instrLimitReachedWarningMsg=s,t.domRoot.find("#errorOutput").html(htmlspecialchars(s)),t.domRoot.find("#errorOutput").show());var s=this.domRoot.find("#executionSlider");if(s.slider({min:0,max:this.curTrace.length-1,step:1}),s.find(".ui-slider-handle").unbind("keydown"),s.find(".ui-slider-handle").css("width","0.8em"),s.find(".ui-slider-handle").css("height","1.4em"),this.domRoot.find(".ui-widget-content").css("font-size","0.9em"),this.domRoot.find("#executionSlider").bind("slide",(function(e,n){e.originalEvent&&t.renderStep(n.value)})),this.params.startingInstruction&&(this.params.jumpToEnd=!1,this.params.startingInstruction==this.curTrace.length&&this.params.startingInstruction--,this.params.startingInstruction<0&&(this.params.startingInstruction=0),this.params.startingInstruction>=this.curTrace.length&&(this.params.startingInstruction=this.curTrace.length-1),assert(0<=this.params.startingInstruction&&this.params.startingInstruction<this.curTrace.length),this.curInstr=this.params.startingInstruction),this.params.jumpToEnd){for(var l=-1,u=0;u<this.curTrace.length;u++){var c=this.curTrace[u];if("exception"==c.event||"uncaught_exception"==c.event){l=u;break}}this.curInstr=0<=l?l:this.curTrace.length-1}this.params.hideCode&&this.domRoot.find("#vizLayoutTdFirst").hide(),this.try_hook("end_render",{myViz:this}),this.precomputeCurTraceLayouts(),this.params.hideCode||this.renderPyCodeOutput(),this.tabularView&&(this.renderTabularView(),$(window).scroll((function(){var e=t.domRoot.find("#vizLayoutTdFirst"),n=$(document).scrollTop(),i=e.offset().top,r=n-i;r<0&&(r=0),r-i<(n=t.domRoot.find("#optTabularView")).height()+n.offset().top-t.domRoot.find("#codeDisplayDiv").height()&&e.css("padding-top",r)})));var d=t.domRoot.find("#rawUserInputDiv");d.find("#userInputPromptStr").html(t.userInputPromptStr),d.find("#raw_input_submit_btn").click((function(){var e=d.find("#raw_input_textbox").val();t.executeCodeWithRawInputFunc(e,t.curInstr+1)})),this.updateOutput(),this.hasRendered=!0}},ExecutionVisualizer.prototype.showVizHeaderViewMode=function(){var t=this.domRoot.find("#vizTitleEditor").val().trim(),e=this.domRoot.find("#vizDescriptionEditor").val().trim();this.domRoot.find("#vizTitleEditor,#vizDescriptionEditor").hide(),t||e?(this.domRoot.find("#vizHeader,#vizTitleViewer,#vizDescriptionViewer").show(),t&&this.domRoot.find("#vizTitleViewer").html(htmlsanitize(t)),e&&this.domRoot.find("#vizDescriptionViewer").html(htmlsanitize(e))):this.domRoot.find("#vizHeader").hide()},ExecutionVisualizer.prototype.showVizHeaderEditMode=function(){this.domRoot.find("#vizHeader").show(),this.domRoot.find("#vizTitleViewer,#vizDescriptionViewer").hide(),this.domRoot.find("#vizTitleEditor,#vizDescriptionEditor").show()},ExecutionVisualizer.prototype.destroyAllAnnotationBubbles=function(){var t=this;t.allAnnotationBubbles&&$.each(t.allAnnotationBubbles,(function(t,e){e.destroyQTip()})),this.domRoot.find("#pyCodeOutputDiv").unbind("scroll"),t.allAnnotationBubbles=null},ExecutionVisualizer.prototype.initStepAnnotation=function(){var t=this.curTrace[this.curInstr];t.stepAnnotation?(this.domRoot.find("#stepAnnotationViewer").html(htmlsanitize(t.stepAnnotation)),this.domRoot.find("#stepAnnotationEditor").val(t.stepAnnotation)):(this.domRoot.find("#stepAnnotationViewer").html(""),this.domRoot.find("#stepAnnotationEditor").val(""))},ExecutionVisualizer.prototype.initAllAnnotationBubbles=function(){var t=this;t.destroyAllAnnotationBubbles();var e=[];$.each(this.domRoot.find("#pyCodeOutput .cod"),(function(t,n){e.push($(n).attr("id"))}));var n=[];$.each(this.domRoot.find(".heapObject"),(function(t,e){n.push($(e).attr("id"))}));var i=[];$.each(this.domRoot.find(".variableTr"),(function(t,e){i.push($(e).attr("id"))}));var r=[];$.each(this.domRoot.find(".stackFrame"),(function(t,e){r.push($(e).attr("id"))})),t.allAnnotationBubbles=[],$.each(e,(function(e,n){t.allAnnotationBubbles.push(new AnnotationBubble(t,"codeline",n))})),$.each(n,(function(e,n){t.allAnnotationBubbles.push(new AnnotationBubble(t,"object",n))})),$.each(i,(function(e,n){t.allAnnotationBubbles.push(new AnnotationBubble(t,"variable",n))})),$.each(r,(function(e,n){t.allAnnotationBubbles.push(new AnnotationBubble(t,"frame",n))})),this.domRoot.find("#pyCodeOutputDiv").scroll((function(){$.each(t.allAnnotationBubbles,(function(t,e){"codeline"==e.type&&e.redrawCodelineBubble()}))}))},ExecutionVisualizer.prototype.enterViewAnnotationsMode=function(){this.editAnnotationMode=!1;var t,e=this.curTrace[this.curInstr],n=this;n.allAnnotationBubbles||e.bubbleAnnotations&&(n.initAllAnnotationBubbles(),$.each(n.allAnnotationBubbles,(function(t,n){var i=e.bubbleAnnotations[n.domID];i&&n.preseedText(i)}))),n.allAnnotationBubbles&&(t={},$.each(n.allAnnotationBubbles,(function(e,n){n.enterViewMode(),n.text&&(t[n.domID]=n.text)})),e.bubbleAnnotations=t);var i=n.domRoot.find("#stepAnnotationEditor").val().trim();i?e.stepAnnotation=i:delete e.stepAnnotation,n.initStepAnnotation(),n.showVizHeaderViewMode(),n.redrawConnectors(),n.redrawAllAnnotationBubbles()},ExecutionVisualizer.prototype.enterEditAnnotationsMode=function(){this.editAnnotationMode=!0;var t=this,e=this.curTrace[this.curInstr];t.allAnnotationBubbles||t.initAllAnnotationBubbles(),$.each(t.allAnnotationBubbles,(function(t,e){e.enterEditMode()})),e.stepAnnotation?t.domRoot.find("#stepAnnotationEditor").val(e.stepAnnotation):t.domRoot.find("#stepAnnotationEditor").val(""),t.showVizHeaderEditMode(),t.redrawConnectors(),t.redrawAllAnnotationBubbles()},ExecutionVisualizer.prototype.redrawAllAnnotationBubbles=function(){this.allAnnotationBubbles&&$.each(this.allAnnotationBubbles,(function(t,e){e.redrawBubble()}))},ExecutionVisualizer.prototype.findPrevBreakpoint=function(){var t=this,e=t.curInstr;if(0==t.sortedBreakpointsList.length)return-1;for(var n=1;n<t.sortedBreakpointsList.length;n++){var i=t.sortedBreakpointsList[n-1],r=t.sortedBreakpointsList[n];if(e<=i)return-1;if(e<=r)return i}var o=t.sortedBreakpointsList[t.sortedBreakpointsList.length-1];return o<e?o:-1},ExecutionVisualizer.prototype.findNextBreakpoint=function(){var t=this,e=t.curInstr;if(0==t.sortedBreakpointsList.length)return-1;if(0<=$.inArray(e,t.sortedBreakpointsList))return e+1;for(var n=0;n<t.sortedBreakpointsList.length-1;n++){var i=t.sortedBreakpointsList[n],r=t.sortedBreakpointsList[n+1];if(e<i)return i;if(i<=e&&e<r)return r}var o=t.sortedBreakpointsList[t.sortedBreakpointsList.length-1];return e<o?o:-1},ExecutionVisualizer.prototype.stepForward=function(){var t,e=this;if(!e.editAnnotationMode)return e.curInstr<e.curTrace.length-1&&(0<e.sortedBreakpointsList.length&&-1!=(t=e.findNextBreakpoint())?e.curInstr=t:e.curInstr+=1,e.updateOutput(!0),!0)},ExecutionVisualizer.prototype.stepBack=function(){var t,e=this;if(!e.editAnnotationMode)return 0<e.curInstr&&(0<e.sortedBreakpointsList.length&&-1!=(t=e.findPrevBreakpoint())?e.curInstr=t:--e.curInstr,e.updateOutput(),!0)},ExecutionVisualizer.prototype.renderSliderBreakpoints=function(){var t=this;t.domRoot.find("#executionSliderFooter").empty();var e=t.domRoot.find("#executionSlider").width(),n=t.domRootD3.select("#executionSliderFooter").append("svg").attr("id","sliderOverlay").attr("width",e).attr("height",12),i=d3.scale.linear().domain([0,t.curTrace.length-1]).range([0,e]);n.selectAll("rect").data(t.sortedBreakpointsList).enter().append("rect").attr("x",(function(t,e){return 0===t?0:i(t)-1})).attr("y",0).attr("width",2).attr("height",12).style("fill",(function(t){return breakpointColor}))},ExecutionVisualizer.prototype.renderPyCodeOutput=function(){var t=this;function e(){var e=[];return t.breakpoints.forEach((function(t,n){e.push(Number(t))})),e.sort((function(t,e){return t-e})),e}function n(n){$.each(n,(function(e,n){t.breakpoints.set(n,1)})),t.sortedBreakpointsList=e()}function i(n,i){i=i.executionPoints,$.each(i,(function(e,n){t.breakpoints.remove(n)})),t.sortedBreakpointsList=e(),d3.select(n.parentNode).select("td.lineNo").style("color",""),d3.select(n.parentNode).select("td.lineNo").style("font-weight",""),d3.select(n.parentNode).select("td.cod").style("color",""),t.renderSliderBreakpoints()}this.breakpoints=d3.map(),this.sortedBreakpointsList=[],this.codeOutputLines=[];for(var r=this.curInputCode.split("\n"),o=0;o<r.length;o++){var a=r[o],s={};s.text=a,s.lineNumber=o+1,s.executionPoints=[],s.breakpointHere=!1,$.each(this.curTrace,(function(t,e){e.line==s.lineNumber&&s.executionPoints.push(t)}));for(var l=!1,u=a.split("#"),c=1;c<u.length;c++)-1!=u[c].indexOf("breakpoint")&&(l=!0);l&&0<s.executionPoints.length&&(s.breakpointHere=!0,n(s.executionPoints)),this.codeOutputLines.push(s)}t.domRoot.find("#pyCodeOutputDiv").empty();var d=this.domRootD3.select("#pyCodeOutputDiv").append("table").attr("id","pyCodeOutput").selectAll("tr").data(this.codeOutputLines).enter().append("tr").selectAll("td").data((function(t,e){return[t,t]})).enter().append("td").attr("class",(function(t,e){return 0==e?"lineNo":"cod"})).attr("id",(function(e,n){return 0==n?"lineNo"+e.lineNumber:t.generateID("cod"+e.lineNumber)})).html((function(t,e){return 0==e?t.lineNumber:htmlspecialchars(t.text)}));t.params.arrowLines&&(t.domRoot.find("#pyCodeOutput tr:first").prepend('<td id="gutterTD" valign="top" rowspan="'+this.codeOutputLines.length+'"><svg id="leftCodeGutterSVG"/></td>'),t.domRootD3.select("svg#leftCodeGutterSVG").append("polygon").attr("id","prevLineArrow").attr("points",SVG_ARROW_POLYGON).attr("fill",lightArrowColor),t.domRootD3.select("svg#leftCodeGutterSVG").append("polygon").attr("id","curLineArrow").attr("points",SVG_ARROW_POLYGON).attr("fill",darkArrowColor)),d.style("cursor",(function(t,e){if((t=t.executionPoints)&&0!=t.length)return"pointer"})).on("click",(function(e,r){var o=e.executionPoints;o&&0!=o.length&&(e.breakpointHere=!e.breakpointHere,e.breakpointHere?(o=this,n(e.executionPoints),d3.select(o.parentNode).select("td.lineNo").style("color",breakpointColor),d3.select(o.parentNode).select("td.lineNo").style("font-weight","bold"),d3.select(o.parentNode).select("td.cod").style("color",breakpointColor),t.renderSliderBreakpoints()):i(this,e))}))},ExecutionVisualizer.prototype.renderStdout=function(){var t,e,n=this.curTrace[this.curInstr];!this.params.hideOutput&&0<this.numStdoutLines?(this.domRoot.find("#progOutputs").show(),e=(t=this.domRoot.find("#pyStdout")).scrollLeft(),t.val(n.stdout.rtrim()),t.scrollLeft(e),t.scrollTop(t[0].scrollHeight)):this.domRoot.find("#progOutputs").hide()},ExecutionVisualizer.prototype.updateCurPrevLines=function(){var t=this,e=t.curTrace.length,n=t.curInstr===e-1,i=!t.instrLimitReached&&n,r=null,o=null,a=t.curTrace[t.curInstr],s=!1,l="return"==a.event;e=!1;if(0<t.curInstr&&(o=t.curTrace[t.curInstr-1].line,e="return"==t.curTrace[t.curInstr-1].event)){var u=t.curInstr-1;assert(0<(n=t.curTrace[u].stack_to_render).length);for(var c=n[n.length-1].frame_id;0<=u;){var d=t.curTrace[u];if("call"==d.event&&d.stack_to_render&&d.stack_to_render[d.stack_to_render.length-1].frame_id==c)break;u--}0<u&&(o=t.curTrace[u-1].line,e=!1)}"exception"!=a.event&&"uncaught_exception"!=a.event||(assert(a.exception_msg),s=!0,t.curLineExceptionMsg=a.exception_msg),r=a.line,t.curLineNumber=r=i&&!s&&o==r?null:r,t.prevLineNumber=o,t.curLineIsReturn=l,t.prevLineIsReturn=e},ExecutionVisualizer.prototype.updateOutput=function(t){this.params.hideCode?this.updateOutputMini():this.updateOutputFull(t),this.renderStdout(),this.try_hook("end_updateOutput",{myViz:this})},ExecutionVisualizer.prototype.updateOutputFull=function(t){assert(this.curTrace),assert(!this.params.hideCode);var e,n,i,r,o,a,s,l=this;l.domRoot.is(":visible")&&(l.curLineNumber=void 0,l.prevLineNumber=void 0,l.curLineIsReturn=void 0,l.prevLineIsReturn=void 0,l.curLineExceptionMsg=void 0,l.codeHorizontalOverflow=l.domRoot.find("#pyCodeOutput").width()-l.domRoot.find("#pyCodeOutputDiv").width(),l.codeHorizontalOverflow<0&&(l.codeHorizontalOverflow=0),s=l.domRoot.find("#dataViz").height(),e=l.domRoot.find("svg#leftCodeGutterSVG"),!l.leftGutterSvgInitialized&&l.params.arrowLines&&(e.height(e.parent().height()),i=l.domRoot.find("table#pyCodeOutput tr:first").offset().top,l.codeRowHeight=l.domRoot.find("table#pyCodeOutput td.cod:first").height(),this.codeOutputLines&&1<this.codeOutputLines.length&&(a=l.domRoot.find("table#pyCodeOutput tr:nth-child(2)").offset().top,l.codeRowHeight=a-i),assert(0<l.codeRowHeight),a=e.offset().top-i,l.arrowOffsetY=Math.floor(l.codeRowHeight/2-SVG_ARROW_HEIGHT/2)-a,l.leftGutterSvgInitialized=!0),l.params.arrowLines&&(assert(void 0!==l.arrowOffsetY),assert(void 0!==l.codeRowHeight),assert(0<=l.arrowOffsetY&&l.arrowOffsetY<=l.codeRowHeight)),this.params.updateOutputCallback&&this.params.updateOutputCallback(this),o=this.curTrace[this.curInstr],n=!1,o.question&&$("#"+o.question.div).modal({position:["25%","50%"]}),l.params.debugMode&&(console.log("updateOutputFull",o),l.debugMode=!0),i=this.curTrace.length,r=this.curInstr==i-1,a=l.domRoot.find("#vcrControls"),r?this.promptForUserInput||this.promptForMouseInput?a.find("#curInstr").html('<b><font color="'+brightRed+'">Enter user input below:</font></b>'):this.instrLimitReached?a.find("#curInstr").html("Instruction limit reached"):a.find("#curInstr").html("Program terminated"):a.find("#curInstr").html("Step "+String(this.curInstr+1)+" of "+String(i-1)),a.find("#jmpFirstInstr").attr("disabled",!1),a.find("#jmpStepBack").attr("disabled",!1),a.find("#jmpStepFwd").attr("disabled",!1),a.find("#jmpLastInstr").attr("disabled",!1),0==this.curInstr&&(a.find("#jmpFirstInstr").attr("disabled",!0),a.find("#jmpStepBack").attr("disabled",!0)),r&&(a.find("#jmpLastInstr").attr("disabled",!0),a.find("#jmpStepFwd").attr("disabled",!0)),l.domRoot.find("#executionSlider").slider("value",this.curInstr),"exception"==o.event||"uncaught_exception"==o.event?(assert(o.exception_msg),"Unknown error"==o.exception_msg?l.domRoot.find("#errorOutput").html("Unknown error: Please email a bug report to philip@pgbovine.net"):l.domRoot.find("#errorOutput").html(htmlspecialchars(o.exception_msg)),l.domRoot.find("#errorOutput").show(),n=!0,l.curLineExceptionMsg=o.exception_msg):this.instrLimitReached||l.domRoot.find("#errorOutput").hide(),o.line&&function(){var i=!l.instrLimitReached&&r,a=l.domRoot.find("#pyCodeOutputDiv"),s=null,u=null,c=void 0,d=void 0,h="return"==o.event,p=!1;if(0<l.curInstr){if(u=l.curTrace[l.curInstr-1].line,p="return"==l.curTrace[l.curInstr-1].event){var f=l.curInstr-1,g=l.curTrace[f].stack_to_render;assert(0<g.length);for(var m=g[g.length-1].frame_id;0<=f;){var v=l.curTrace[f];if("call"==v.event&&v.stack_to_render&&v.stack_to_render[v.stack_to_render.length-1].frame_id==m)break;f--}0<f&&(u=l.curTrace[f-1].line,t=p=!1)}l.pyCrazyMode&&((g=l.curTrace[l.curInstr-1]).column,c=void 0!==g.expr_start_col?g.expr_start_col:g.column,d=void 0!==g.expr_width?g.expr_width:1)}if(s=o.line,l.pyCrazyMode){var y=o.column,b=void 0!==o.expr_start_col?o.expr_start_col:y,x=void 0!==o.expr_width?o.expr_width:1;assert((y=l.codeOutputLines[s-1]).lineNumber==s);var w=y.text;if($.each(l.codeOutputLines,(function(t,e){var n=l.generateID("cod"+e.lineNumber);l.domRoot.find("#"+n).html(htmlspecialchars(e.text))})),u==s){for(var C="",_=0;_<w.length;_++){var E=b<=_&&_<b+x,M=c<=_&&_<c+d,D=htmlspecialchars(w[_]);C+=E&&M?'<span class="pycrazy-highlight-prev-and-cur">'+D+"</span>":M?'<span class="pycrazy-highlight-prev">'+D+"</span>":E?'<span class="pycrazy-highlight-cur">'+D+"</span>":D}assert(C),l.domRoot.find("#"+l.generateID("cod"+s)).html(C)}else u&&(A=htmlWithHighlight(l.codeOutputLines[u-1].text,c,d,"pycrazy-highlight-prev"),l.domRoot.find("#"+l.generateID("cod"+u)).html(A)),C=htmlWithHighlight(w,b,x,"pycrazy-highlight-cur"),l.domRoot.find("#"+l.generateID("cod"+s)).html(C)}y=p?Math.floor(l.codeRowHeight/3):0;var S,P,j,T,A=h?Math.floor(l.codeRowHeight/3):0;i&&!n&&(u==s?s=null:A-=2),l.params.arrowLines&&(u?(S=l.domRootD3.select("#prevLineArrow"),P="translate(0, "+((u-1)*l.codeRowHeight+l.arrowOffsetY+y)+")",t?S.transition().duration(200).attr("fill","white").each("end",(function(){S.attr("transform",P).attr("fill",lightArrowColor),e.find("#prevLineArrow").show()})):(S.attr("transform",P),e.find("#prevLineArrow").show())):e.find("#prevLineArrow").hide(),s?(T=l.domRootD3.select("#curLineArrow"),j="translate(0, "+((s-1)*l.codeRowHeight+l.arrowOffsetY+A)+")",(t?T.transition().delay(200).duration(250):T).attr("transform",j),e.find("#curLineArrow").show()):e.find("#curLineArrow").hide()),l.domRootD3.selectAll("#pyCodeOutputDiv td.cod").style("border-top",(function(t){return n&&t.lineNumber==o.line?"1px solid "+errorColor:""})).style("border-bottom",(function(t){return n&&t.lineNumber==o.line?"1px solid "+errorColor:""})),l.params.highlightLines&&(l.domRoot.find("#pyCodeOutputDiv td.cod").removeClass("highlight-prev"),l.domRoot.find("#pyCodeOutputDiv td.cod").removeClass("highlight-cur"),s&&l.domRoot.find("#"+l.generateID("cod"+s)).addClass("highlight-cur"),u&&l.domRoot.find("#"+l.generateID("cod"+u)).addClass("highlight-prev")),y=o.line,A=l.domRoot.find("#lineNo"+y).offset().top,T=a.offset().top,a.scrollTop(),y=a.height(),T<=A&&A<T+y-30||(j=o.line,A=l.domRoot.find("#lineNo"+j).offset().top,T=a.offset().top,y=a.scrollTop(),j=a.height(),a.stop(),a.animate({scrollTop:y+(A-T-Math.round(j/2))},300)),l.curLineNumber=s,l.prevLineNumber=u,l.curLineIsReturn=h,l.prevLineIsReturn=p}(),l.domRoot.find("#htmlOutputDiv").empty(),o.html_output&&(o.css_output&&l.domRoot.find("#htmlOutputDiv").append('<style type="text/css">'+o.css_output+"</style>"),l.domRoot.find("#htmlOutputDiv").append(o.html_output),o.js_output&&l.domRoot.find("#htmlOutputDiv").append('<script type="text/javascript">'+o.js_output+"<\/script>")),o=this.curTrace[this.curInstr],a=this.curTraceLayouts[this.curInstr],this.renderDataStructures(o,a),this.enterViewAnnotationsMode(),l.domRoot.find("#dataViz").height()!=s&&this.params.heightChangeCallback&&this.params.heightChangeCallback(this),(s=l.domRoot.find("#rawUserInputDiv")).hide(),r&&l.executeCodeWithRawInputFunc&&l.promptForUserInput&&s.show())},ExecutionVisualizer.prototype.updateOutputMini=function(){assert(this.params.hideCode);var t=this.curTrace[this.curInstr],e=this.curTraceLayouts[this.curInstr];this.renderDataStructures(t,e),this.enterViewAnnotationsMode()},ExecutionVisualizer.prototype.renderStep=function(t){assert(0<=t),assert(t<this.curTrace.length),this.curInstr!=t&&(this.curInstr=t,this.updateOutput())},ExecutionVisualizer.prototype.isCppMode=function(){return"c"===this.params.lang||"cpp"===this.params.lang},ExecutionVisualizer.prototype.precomputeCurTraceLayouts=function(){this.curTraceLayouts=[],this.curTraceLayouts.push([]);var t=this;assert(0<this.curTrace.length),$.each(this.curTrace,(function(e,n){var i=t.curTraceLayouts[t.curTraceLayouts.length-1],r=$.extend(!0,[],i),o=d3.map();$.each(r,(function(t,e){for(var n=1;n<e.length;n++)o.set(e[n],1)}));var a=d3.map();function s(e,i,r){var o,a=n.heap[e];if(t.isCppMode()){if(!a)return}else assert(a);o=a,((e=t.try_hook("isLinearObj",{heapObj:o}))[0]?e[1]:"LIST"==o[0]||"TUPLE"==o[0]||"SET"==o[0])?$.each(a,(function(e,n){e<1||t.isPrimitiveType(n)||(n=getRefID(n),t.disableHeapNesting?l(n,[],[]):l(n,i,r))})):"DICT"==a[0]?$.each(a,(function(e,o){e<1||(t.disableHeapNesting&&(e=o[0],t.isPrimitiveType(e)||l(getRefID(e),[],[])),o=o[1],t.isPrimitiveType(o)||(o=getRefID(o),t.structurallyEquivalent(a,n.heap[o])?l(o,i,r):t.disableHeapNesting&&l(o,[],[])))})):"INSTANCE"==a[0]||"CLASS"==a[0]?jQuery.each(a,(function(e,o){e<("INSTANCE"==a[0]?2:3)||(t.disableHeapNesting&&(e=o[0],t.isPrimitiveType(e)||l(getRefID(e),[],[])),o=o[1],t.isPrimitiveType(o)||(o=getRefID(o),t.structurallyEquivalent(a,n.heap[o])?l(o,i,r):t.disableHeapNesting&&l(o,[],[])))})):"C_ARRAY"!=a[0]&&"C_STRUCT"!=a[0]||u(a)}function l(t,e,n){if(!a.has(t)){var i=function(t){for(var e=0;e<r.length;e++){var n=r[e],i=n.indexOf(t);if(0<i)return{row:n,index:i}}return null}(t),l=a.has(t);if(a.set(t,1),i){var u=i.row;i=i.index;if(o.remove(t),!l&&1<n.length){for(var c=[i,0],d=1;d<n.length;d++)c.push(n[d]),o.remove(n[d]);u.splice.apply(u,c),n.splice(0,n.length)}s(t,u,[])}else if(0==n.length&&n.push("row"+t),n.push(t),s(t,e,n),0<n.length){if(e&&0<e.length)for(d=1;d<n.length;d++)e.push(n[d]);else r.push($.extend(!0,[],n));for(d=1;d<n.length;d++)o.remove(n[d]);n.splice(0,n.length)}}}function u(t){t&&(isHeapRef(t,n.heap)&&l(getRefID(t),null,[]),"C_ARRAY"===(t=t)[0]?$.each(t,(function(t,e){t<2||u(e)})):"C_STRUCT"===t[0]&&$.each(t,(function(t,e){t<3||u(e[1])})))}$.each(n.ordered_globals,(function(e,i){void 0!==(i=n.globals[i])&&(t.isCppMode()?u(i):t.isPrimitiveType(i)||l(getRefID(i),null,[]))})),$.each(n.stack_to_render,(function(e,n){$.each(n.ordered_varnames,(function(e,i){i=n.encoded_locals[i],t.isCppMode()?u(i):t.isPrimitiveType(i)||l(getRefID(i),null,[])}))})),o.forEach((function(t,e){t=Number(t),$.each(r,(function(e,n){var i=n.indexOf(t);0<i&&n.splice(i,1)}))})),r=r.filter((function(t){return 1<t.length})),t.curTraceLayouts.push(r)})),this.curTraceLayouts.splice(0,1),assert(this.curTrace.length==this.curTraceLayouts.length)};var heapPtrSrcRE=/__heap_pointer_src_/,rightwardNudgeHack=!0;ExecutionVisualizer.prototype.renderDataStructures=function(t,e){var n,i,r,o,a,s,l,u,c=this;function d(t,e){!c.isCppMode()||c.domRoot.find("#"+e).length?c.jsPlumbInstance.connect({source:t,target:e,scope:"varValuePointer"}):c.domRoot.find("#"+t).html("💩")}function h(t,e){0!=c.domRoot.find("#"+t).length&&0!=c.domRoot.find("#"+e).length&&c.jsPlumbInstance.connect({source:t,target:e,anchors:["LeftMiddle","LeftMiddle"],connector:["Bezier",{curviness:45}],endpoint:["Dot",{radius:4}],scope:"frameParentPointer"})}function p(t){c.jsPlumbInstance.select().each((function(e){var n=e.source.closest(".stackFrame");n.attr("id")==t?(e.setPaintStyle({lineWidth:1,strokeStyle:connectorBaseColor}),e.endpoints[0].setPaintStyle({fillStyle:connectorBaseColor}),$(e.canvas).css("z-index",1e3)):c.jsPlumbManager.heapConnectionEndpointIDs.has(e.endpoints[0].elementId)||0<n.length&&(e.setPaintStyle({lineWidth:1,strokeStyle:connectorInactiveColor}),e.endpoints[0].setPaintStyle({fillStyle:connectorInactiveColor}),$(e.canvas).css("z-index",0))})),c.domRoot.find(".stackFrame").removeClass("highlightedStackFrame"),c.domRoot.find("#"+t).addClass("highlightedStackFrame")}c.tabularView||(c.resetJsPlumbManager(),n=d3.map(),c.jsPlumbInstance.select({scope:"varValuePointer"}).each((function(t){t.sourceId.match(heapPtrSrcRE)||n.set(t.sourceId,t.targetId)})),i=d3.map(),c.jsPlumbInstance.select({scope:"frameParentPointer"}).each((function(t){i.set(t.sourceId,t.targetId)})),$.each(e,(function(t,e){for(var n=0;n<e.length;n++){var i=e[n];i=c.generateHeapObjID(i,c.curInstr);c.jsPlumbManager.renderedHeapObjectIDs.set(i,1)}})),c.domRoot.find("#heap").empty().html('<div id="heapHeader">Objects</div>'),(a=c.domRootD3.select("#heap").selectAll("table.heapRow").attr("id",(function(t,e){return"heapRow"+e})).data(e,(function(t){return t[0]}))).enter().append("table").attr("id",(function(t,e){return"heapRow"+e})).attr("class","heapRow"),a.exit().each((function(t,e){$(this).empty()})).remove(),(s=a.selectAll("td.toplevelHeapObject").data((function(t,e){return t.slice(1,t.length)}),(function(t){return t}))).enter().append("td").attr("class","toplevelHeapObject").attr("id",(function(t,e){return"toplevel_heap_object_"+t})),s.order().each((function(e,n){$(this).empty(),c.isCppMode()&&void 0===t.heap[e]||c.renderCompoundObject(e,c.curInstr,$(this),!0)})),s.exit().each((function(t,e){$(this).empty()})).remove(),r=[],$.each(t.ordered_globals,(function(e,n){void 0!==t.globals[n]&&r.push(n)})),o=c.generateID("globals"),e=c.generateID("global_table"),(a=c.domRootD3.select("#"+e).selectAll("tr").data(r,(function(t){return t}))).enter().append("tr").attr("class","variableTr").attr("id",(function(t,e){return c.generateID(varnameToCssID("global__"+t+"_tr"))})),(s=a.selectAll("td.stackFrameVar,td.stackFrameValue").data((function(t,e){return[t,t]}))).enter().append("td").attr("class",(function(t,e){return 0==e?"stackFrameVar":"stackFrameValue"})),s.order().each((function(e,i){var r,o;0==i?$(this).html(e):($(this).empty(),i=c.generateID("global__"+varnameToCssID(e)),n.remove(i),e=t.globals[e],c.isPrimitiveType(e)?c.renderPrimitiveObject(e,$(this)):"C_STRUCT"===e[0]||"C_ARRAY"===e[0]?c.renderCStructArray(e,c.curInstr,$(this)):(r=c.generateHeapObjID(getRefID(e),c.curInstr),c.textualMemoryLabels?(o=i+"_text_label",$(this).append('<div class="objectIdLabel" id="'+o+'">id'+getRefID(e)+"</div>"),$(this).find("div#"+o).hover((function(){c.jsPlumbInstance.connect({source:o,target:r,scope:"varValuePointer"})}),(function(){c.jsPlumbInstance.select({source:o}).detach()}))):($(this).append('<div class="stack_pointer" id="'+i+'">&nbsp;</div>'),assert(!c.jsPlumbManager.connectionEndpointIDs.has(i)),c.jsPlumbManager.connectionEndpointIDs.set(i,r))))})),s.exit().each((function(t,e){$(this).empty()})).remove(),a.exit().each((function(t,e){$(this).find(".stack_pointer").each((function(t,e){n.remove($(e).attr("id"))})),$(this).empty()})).remove(),0==t.ordered_globals.length?this.domRoot.find("#"+o).hide():this.domRoot.find("#"+o).show(),(s=(e=c.domRootD3.select("#stack").selectAll("div.stackFrame,div.zombieStackFrame").data(t.stack_to_render,(function(t){return t.unique_hash}))).enter().append("div").attr("class",(function(t,e){return t.is_zombie?"zombieStackFrame":"stackFrame"})).attr("id",(function(t,e){return t.is_zombie?c.generateID("zombie_stack"+e):c.generateID("stack"+e)})).attr("data-frame_id",(function(t,e){return t.frame_id})).attr("data-parent_frame_id",(function(t,e){return 0<t.parent_frame_id_list.length?t.parent_frame_id_list[0]:null})).each((function(e,n){var i,r;c.drawParentPointers&&(i=$(this).attr("id"),0<e.parent_frame_id_list.length?(r=e.parent_frame_id_list[0],c.domRoot.find("div#stack [data-frame_id="+r+"]").each((function(t,e){var n=$(this).attr("id");c.jsPlumbManager.parentPointerConnectionEndpointIDs.set(i,n)}))):0<t.ordered_globals.length&&c.jsPlumbManager.parentPointerConnectionEndpointIDs.set(i,o),e=e.frame_id,c.domRoot.find("div#stack [data-parent_frame_id="+e+"]").each((function(t,e){var n=$(this).attr("id");c.jsPlumbManager.parentPointerConnectionEndpointIDs.set(n,i)})))}))).append("div").attr("class","stackFrameHeader").html((function(t,e){var n=htmlspecialchars(t.func_name).replace("&lt;lambda&gt;","λ").replace("\n","<br/>");return(t.is_parent||c.showAllFrameLabels)&&(n="f"+t.frame_id+": "+n),0<t.parent_frame_id_list.length?n=n+" [parent=f"+t.parent_frame_id_list[0]+"]":c.showAllFrameLabels&&(n+=" [parent=Global]"),n})),s.append("table").attr("class","stackFrameVarTable"),(a=e.order().select("table").selectAll("tr").data((function(t){return t.ordered_varnames.map((function(e){return{varname:e,frame:t}}))}),(function(t){if(t)return t.varname}))).enter().append("tr").attr("class","variableTr").attr("id",(function(t,e){return c.generateID(varnameToCssID(t.frame.unique_hash+"__"+t.varname+"_tr"))})),(s=a.selectAll("td.stackFrameVar,td.stackFrameValue").data((function(t,e){return[t,t]}))).enter().append("td").attr("class",(function(t,e){return 0==e?"stackFrameVar":"stackFrameValue"})),s.order().each((function(t,e){var i,r,o=t.varname;t=t.frame;0==e?"__return__"==o?$(this).html('<span class="retval">Return<br/>value</span>'):$(this).html(o):($(this).empty(),e=c.generateID(varnameToCssID(t.unique_hash+"__"+o)),n.remove(e),o=t.encoded_locals[o],c.isPrimitiveType(o)?c.renderPrimitiveObject(o,$(this)):"C_STRUCT"===o[0]||"C_ARRAY"===o[0]?c.renderCStructArray(o,c.curInstr,$(this)):(i=c.generateHeapObjID(getRefID(o),c.curInstr),c.textualMemoryLabels?(r=e+"_text_label",$(this).append('<div class="objectIdLabel" id="'+r+'">id'+getRefID(o)+"</div>"),$(this).find("div#"+r).hover((function(){c.jsPlumbInstance.connect({source:r,target:i,scope:"varValuePointer"})}),(function(){c.jsPlumbInstance.select({source:r}).detach()}))):($(this).append('<div class="stack_pointer" id="'+e+'">&nbsp;</div>'),assert(!c.jsPlumbManager.connectionEndpointIDs.has(e)),c.jsPlumbManager.connectionEndpointIDs.set(e,i))))})),s.exit().each((function(t,e){$(this).empty()})).remove(),a.exit().each((function(t,e){$(this).find(".stack_pointer").each((function(t,e){n.remove($(e).attr("id"))})),$(this).empty()})).remove(),e.exit().each((function(t,e){$(this).find(".stack_pointer").each((function(t,e){n.remove($(e).attr("id"))}));var r=$(this).attr("id");i.forEach((function(t,e){t!=r&&e!=r||i.remove(t)})),$(this).empty()})).remove(),rightwardNudgeHack&&(l={},(e=c.jsPlumbManager.heapConnectionEndpointIDs.keys()).sort(),$.each(e,(function(t,e){var n=c.jsPlumbManager.heapConnectionEndpointIDs.get(e),i=c.domRoot.find("#"+e),r=i.closest(".heapObject"),o=c.domRoot.find("#"+n);assert("heapObject"==o.attr("class"));e=r.closest(".heapRow"),n=o.closest(".heapRow");var a,s,u=e.attr("id");n=n.attr("id");u!=n&&(i=i.offset().left,r.offset().left,(r=o.offset().left)<i&&(o.css("margin-left","+="+(a=i-r+32)),void 0===(s=l[u])&&(s=d3.map(),l[u]=s),s.set(n,1),(n=l[n])&&n.forEach((function(t,e){t!=u&&(c.domRoot.find("#"+t).css("margin-left","+="+a),s.set(t,1))}))))}))),c.jsPlumbInstance.reset(),c.textualMemoryLabels||(c.isCppMode()||n.forEach(d),c.jsPlumbManager.connectionEndpointIDs.forEach(d)),c.drawParentPointers&&(i.forEach(h),c.jsPlumbManager.parentPointerConnectionEndpointIDs.forEach(h)),u=!1,$.each(t.stack_to_render,(function(t,e){e.is_highlighted&&(p(c.generateID("stack"+t)),u=!0)})),u||p(c.generateID("globals")),c.try_hook("end_renderDataStructures",{myViz:c}))},ExecutionVisualizer.prototype.renderTabularView=function(){var t=this;t.resetJsPlumbManager();var e=[],n={},i=[];$.each(t.curTrace,(function(t,r){$.each(r.ordered_globals,(function(t,n){-1===$.inArray(n,e)&&e.push(n)})),$.each(r.stack_to_render,(function(t,e){var r=n[e.func_name];void 0===r&&(r=[],n[e.func_name]=r,i.push(e.func_name)),$.each(e.ordered_varnames,(function(t,e){-1===$.inArray(e,r)&&"__return__"!==e&&r.push(e)}))}))}));var r=["Step"];$.each(e,(function(t,e){r.push(e)})),$.each(i,(function(t,e){$.each(n[e],(function(t,n){r.push(e+":"+n)}))}));var o=t.domRootD3.select("#optTabularView").append("table");o.attr("id","optTable");var a=o.append("thead").attr("class","stepTableThead").append("tr");a.attr("class","stepTableTr"),a.selectAll("thead td").data(r).enter().append("td").attr("class","stepTableTd").html((function(t){return t})),(o=o.append("tbody")).attr("class","stepTableTbody");var s=[];$.each(t.curTrace,(function(t,e){s.push([t,e])})),o.selectAll("tbody tr").data(s).enter().append("tr").attr("step",(function(t,e){return e})).attr("class","stepTableTr").selectAll("td").data((function(t){return function(t){var r=[""];$.each(e,(function(e,n){r.push(t.globals[n])}));var o=null;return $.each(t.stack_to_render,(function(t,e){e.is_highlighted&&(o=e)})),$.each(i,(function(t,e){$.each(n[e],(function(t,n){var i=!1;!o||e!=o.func_name||(n=o.encoded_locals[n])&&(r.push(n),i=!0),i||r.push(void 0)}))})),r}(t[1])})).enter().append("td").attr("class","stepTableTd").each((function(e,n){$(this).empty();var i=parseInt($(this).closest("tr").attr("step"));0==n?$(this).html(i+1):void 0===e||t.renderNestedObject(e,i,$(this),"tabular")})),t.jsPlumbInstance.reset(),t.jsPlumbManager.connectionEndpointIDs.forEach((function(e,n){t.jsPlumbInstance.connect({source:e,target:n,scope:"varValuePointer",anchors:["TopCenter","LeftMiddle"]})}))},ExecutionVisualizer.prototype.renderPrimitiveObject=function(t,e){var n,i,r,o,a,s,l,u=this;this.try_hook("renderPrimitiveObject",{obj:t,d3DomElement:e})[0]||(a=typeof t,null==t?e.append('<span class="nullObj">'+this.getRealLabel("None")+"</span>"):"number"==a?e.append('<span class="numberObj">'+t+"</span>"):"boolean"==a?t?e.append('<span class="boolObj">'+this.getRealLabel("True")+"</span>"):e.append('<span class="boolObj">'+this.getRealLabel("False")+"</span>"):"string"==a?(s=(s=(s=htmlspecialchars(t)).replace(new RegExp("\n","g"),"<br/>")).replace(new RegExp('"',"g"),'\\"'),e.append('<span class="stringObj">'+(s='"'+s+'"')+"</span>")):"object"==a?"C_DATA"==t[0]?("short int"===(l=t[2])?l="short":"short unsigned int"===l?l="unsigned short":"long int"===l?l="long":"long long int"===l?l="long long":"long unsigned int"===l?l="unsigned long":"long long unsigned int"===l&&(l="unsigned long long int"),r="pointer"===l&&"<UNINITIALIZED>"!==t[3]&&"<UNALLOCATED>"!==t[3],o=t[1],n="",u.debugMode&&(n=o+"<br/>"),i=u.generateHeapObjID("cdata_"+o,u.curInstr),r?(e.append('<div id="'+i+'" class="cdataHeader">'+n+l+"</div>"),a=t[3],r=u.generateHeapObjID("ptrSrc_"+o,u.curInstr),o=u.generateHeapObjID("cdata_"+a,u.curInstr),a="",u.debugMode&&(a=o),e.append('<div style="width: 10px;" id="'+r+'" class="cdataElt">&nbsp;'+a+"</div>"),assert(!u.jsPlumbManager.connectionEndpointIDs.has(r)),u.jsPlumbManager.connectionEndpointIDs.set(r,o)):(e.append('<div class="cdataHeader">'+n+l+"</div>"),l="",l="string"==typeof t[3]?"<UNINITIALIZED>"===(s=t[3])?'<span class="cdataUninit">?</span>':"<UNALLOCATED>"==s?"💀":htmlspecialchars(s="'"+(s=(s=(s=s.replace(new RegExp("\n","g"),"\\n")).replace(new RegExp("\t","g"),"\\t")).replace(new RegExp('"',"g"),'\\"'))+"'"):htmlspecialchars(t[3]),e.append('<div id="'+i+'" class="cdataElt">'+l+"</div>"))):(assert("SPECIAL_FLOAT"==t[0]||"JS_SPECIAL_VAL"==t[0]),e.append('<span class="numberObj">'+t[1]+"</span>")):assert(!1))},ExecutionVisualizer.prototype.renderNestedObject=function(t,e,n){this.isPrimitiveType(t)?this.renderPrimitiveObject(t,n):"REF"===t[0]?this.renderCompoundObject(getRefID(t),e,n,!1):(assert("C_STRUCT"===t[0]||"C_ARRAY"===t[0]),this.renderCStructArray(t,e,n))},ExecutionVisualizer.prototype.renderCompoundObject=function(t,e,n,i){var r,o,a,s,l,u,c,d,h,p,f,g,m,v,y,b,x,w,C=this,_=C.generateHeapObjID(t,e);i||!C.jsPlumbManager.renderedHeapObjectIDs.has(_)?(n.append('<div class="heapObject" id="'+_+'"></div>'),n=C.domRoot.find("#"+_),C.jsPlumbManager.renderedHeapObjectIDs.set(_,1),r=C.curTrace[e].heap[t],assert($.isArray(r)),o="",C.textualMemoryLabels&&(o="id"+t+":"),C.try_hook("renderCompoundObject",{objID:t,d3DomElement:n,isTopLevel:i,obj:r,typeLabelPrefix:o,stepNum:e,myViz:C})[0]||("LIST"==r[0]||"TUPLE"==r[0]||"SET"==r[0]||"DICT"==r[0]?(a=r[0].toLowerCase(),assert(1<=r.length),1==r.length?n.append('<div class="typeLabel">'+o+" empty "+C.getRealLabel(a)+"</div>"):(n.append('<div class="typeLabel">'+o+C.getRealLabel(a)+"</div>"),n.append('<table class="'+a+'Tbl"></table>'),m=n.children("table"),"LIST"==r[0]||"TUPLE"==r[0]?(m.append("<tr></tr><tr></tr>"),s=m.find("tr:first"),l=m.find("tr:last"),$.each(r,(function(t,n){t<1||(s.append('<td class="'+a+'Header"></td>'),s.find("td:last").append(t-1),l.append('<td class="'+a+'Elt"></td>'),C.renderNestedObject(n,e,l.find("td:last")))}))):"SET"==r[0]?(i=r.length-1,3<(d=Math.round(Math.sqrt(i)))&&--d,u=Math.round(i/d),i%d&&(u+=1),jQuery.each(r,(function(t,n){t<1||((t-1)%u==0&&m.append("<tr></tr>"),(t=m.find("tr:last")).append('<td class="setElt"></td>'),C.renderNestedObject(n,e,t.find("td:last")))}))):"DICT"==r[0]&&$.each(r,(function(t,n){var i,r;t<1||(m.append('<tr class="dictEntry"><td class="dictKey"></td><td class="dictVal"></td></tr>'),i=(r=m.find("tr:last")).find("td:first"),t=r.find("td:last"),r=n[0],n=n[1],C.renderNestedObject(r,e,i),C.renderNestedObject(n,e,t))})))):"INSTANCE"==r[0]||"CLASS"==r[0]?(p="INSTANCE"==r[0],assert(r.length>=(c=p?2:3)),p?n.append('<div class="typeLabel">'+o+r[1]+" "+C.getRealLabel("instance")+"</div>"):(d="",0<r[2].length&&(d+="[extends "+r[2].join(", ")+"] "),n.append('<div class="typeLabel">'+o+r[1]+" class "+d+'<br/><a href="#" id="attrToggleLink">hide attributes</a></div>')),r.length>c&&(n.append('<table class="'+(h=p?"inst":"class")+'Tbl"></table>'),m=n.children("table"),$.each(r,(function(t,n){var i,r;t<c||(m.append('<tr class="'+h+'Entry"><td class="'+h+'Key"></td><td class="'+h+'Val"></td></tr>'),i=(r=m.find("tr:last")).find("td:first"),t=r.find("td:last"),"string"==typeof n[0]?(r=htmlspecialchars(n[0]),i.append('<span class="keyObj">'+r+"</span>")):C.renderNestedObject(n[0],e,i),C.renderNestedObject(n[1],e,t))}))),p||($(n.selector+" .typeLabel #attrToggleLink").click((function(){var t=$(n.selector+" .classTbl");return t.toggle(),$(this).html((t.is(":visible")?"hide":"show")+" attributes"),t.is(":visible")?(C.classAttrsHidden[n.selector]=!1,$(this).html("hide attributes")):(C.classAttrsHidden[n.selector]=!0,$(this).html("show attributes")),C.redrawConnectors(),!1})),C.classAttrsHidden[n.selector]&&($(n.selector+" .classTbl").hide(),$(n.selector+" .typeLabel #attrToggleLink").html("show attributes")))):"INSTANCE_PPRINT"==r[0]?(n.append('<div class="typeLabel">'+o+r[1]+" instance</div>"),b=htmlspecialchars(r[2]),n.append('<table class="customObjTbl"><tr><td class="customObjElt">'+b+"</td></tr></table>")):"FUNCTION"==r[0]?(assert(3==r.length),f=htmlspecialchars(r[1]).replace("&lt;lambda&gt;","λ"),g=r[2],C.compactFuncLabels||n.append('<div class="typeLabel">'+o+C.getRealLabel("function")+"</div>"),p=C.compactFuncLabels?"func":"",g?n.append('<div class="funcObj">'+p+" "+f+" [parent=f"+g+"]</div>"):C.showAllFrameLabels?n.append('<div class="funcObj">'+p+" "+f+" [parent=Global]</div>"):n.append('<div class="funcObj">'+p+" "+f+"</div>")):"JS_FUNCTION"==r[0]?(assert(5==r.length),f=htmlspecialchars(r[1]),v=o+htmlspecialchars(r[2]),f=r[3],g=r[4],f||g||C.showAllFrameLabels?(n.append('<table class="classTbl"></table>'),(m=n.children("table")).append('<tr><td class="funcCod" colspan="2"><pre class="funcCode">'+v+"</pre></td></tr>"),f&&(assert(0<f.length),$.each(f,(function(t,n){m.append('<tr class="classEntry"><td class="classKey"></td><td class="classVal"></td></tr>');var i=(r=m.find("tr:last")).find("td:first"),r=r.find("td:last");i.append('<span class="keyObj">'+htmlspecialchars(n[0])+"</span>"),C.renderNestedObject(n[1],e,r)}))),g?m.append('<tr class="classEntry"><td class="classKey">parent</td><td class="classVal">f'+g+"</td></tr>"):C.showAllFrameLabels&&m.append('<tr class="classEntry"><td class="classKey">parent</td><td class="classVal">global</td></tr>')):n.append('<pre class="funcCode">'+v+"</pre>")):"HEAP_PRIMITIVE"==r[0]?(assert(3==r.length),y=r[1],v=r[2],n.append('<div class="heapPrimitive"></div>'),n.find("div.heapPrimitive").append('<div class="typeLabel">'+o+y+"</div>"),C.renderPrimitiveObject(v,n.find("div.heapPrimitive"))):"C_STRUCT"==r[0]||"C_ARRAY"==r[0]?C.renderCStructArray(r,e,n):(assert(2==r.length),y=r[0],b=htmlspecialchars(b=r[1]),n.append('<div class="typeLabel">'+o+y+"</div>"),n.append('<table class="customObjTbl"><tr><td class="customObjElt">'+b+"</td></tr></table>")))):(b=C.generateID("heap_pointer_src_"+C.jsPlumbManager.heap_pointer_src_id),C.jsPlumbManager.heap_pointer_src_id++,x=_,C.textualMemoryLabels?(n.append('<div class="objectIdLabel" id="'+(w=b+"_text_label")+'">id'+t+"</div>"),C.domRoot.find("div#"+w).hover((function(){C.jsPlumbInstance.connect({source:w,target:x,scope:"varValuePointer"})}),(function(){C.jsPlumbInstance.select({source:w}).detach()}))):(n.append('<div id="'+b+'">&nbsp;</div>'),assert(!C.jsPlumbManager.connectionEndpointIDs.has(b)),C.jsPlumbManager.connectionEndpointIDs.set(b,x),assert(!C.jsPlumbManager.heapConnectionEndpointIDs.has(b)),C.jsPlumbManager.heapConnectionEndpointIDs.set(b,x)))},ExecutionVisualizer.prototype.renderCStructArray=function(t,e,n){var i,r,o,a,s,l,u=this;"C_STRUCT"==t[0]?(assert(3<=t.length),r=t[1],i=t[2],o="",u.debugMode&&(o=r+"<br/>"),"cpp"===u.params.lang?n.append('<div class="typeLabel">'+o+"object "+i+"</div>"):n.append('<div class="typeLabel">'+o+"struct "+i+"</div>"),3<t.length&&(n.append('<table class="instTbl"></table>'),a=n.children("table"),$.each(t,(function(t,n){var i,r;t<3||(a.append('<tr class="instEntry"><td class="instKey"></td><td class="instVal"></td></tr>'),i=(r=a.find("tr:last")).find("td:first"),t=r.find("td:last"),assert("string"==typeof n[0]),r=htmlspecialchars(n[0]),i.append('<span class="keyObj">'+r+"</span>"),u.renderNestedObject(n[1],e,t))})))):(assert("C_ARRAY"==t[0]),assert(2<=t.length),r=t[1],o="",u.debugMode&&(o=r+"<br/>"),n.append('<div class="typeLabel">'+o+"array</div>"),n.append('<table class="cArrayTbl"></table>'),(a=n.children("table")).append("<tr></tr><tr></tr>"),s=a.find("tr:first"),l=a.find("tr:last"),$.each(t,(function(t,n){t<2||(s.append('<td class="cArrayHeader"></td>'),s.find("td:last").append(t-2),l.append('<td class="cArrayElt"></td>'),u.renderNestedObject(n,e,l.find("td:last")))})))},ExecutionVisualizer.prototype.redrawConnectors=function(){this.jsPlumbInstance.repaintEverything()},ExecutionVisualizer.prototype.getRealLabel=function(t){if("js"===this.params.lang||"ts"===this.params.lang||"ruby"===this.params.lang){if("list"===t)return"array";if("instance"===t)return"object";if("True"===t)return"true";if("False"===t)return"false"}if("js"===this.params.lang){if("dict"===t)return"Map";if("set"===t)return"Set"}if("ruby"===this.params.lang){if("dict"===t)return"hash";if("set"===t)return"Set";if("function"===t)return"method";if("None"===t)return"nil";if("Global frame"===t)return"Global Object"}return t};var highlightedLineColor="#e4faeb",highlightedLineBorderColor="#005583",highlightedLineLighterColor="#e8fff0",funcCallLineColor="#a2eebd",brightRed="#e93f34",connectorBaseColor="#005583",connectorHighlightColor=brightRed,connectorInactiveColor="#cccccc",errorColor=brightRed,breakpointColor=brightRed,darkArrowColor=brightRed,lightArrowColor="#c9e6ca";function assert(t){if(!t)throw alert("Assertion Failure (see console log for backtrace)"),"Assertion Failure"}function htmlspecialchars(t){return"string"==typeof t?(t=(t=(t=(t=t.replace(/&/g,"&amp;")).replace(/</g,"&lt;")).replace(/>/g,"&gt;")).replace(/ /g,"&nbsp;")).replace(/\t/g,"&nbsp;&nbsp;&nbsp;&nbsp;"):t}function htmlsanitize(t){return"string"==typeof t?(t=(t=t.replace(/&/g,"&amp;")).replace(/</g,"&lt;")).replace(/>/g,"&gt;"):t}String.prototype.rtrim=function(){return this.replace(/\s*$/g,"")};var lbRE=new RegExp("\\[|{|\\(|<","g"),rbRE=new RegExp("\\]|}|\\)|>","g");function varnameToCssID(t){return t.replace(lbRE,"LeftB_").replace(rbRE,"_RightB").replace(/[!]/g,"_BANG_").replace(/[?]/g,"_QUES_").replace(/[:]/g,"_COLON_").replace(/[=]/g,"_EQ_").replace(/[.]/g,"_DOT_").replace(/ /g,"_")}function isHeapRef(t,e){return"REF"===t[0]?void 0!==e[t[1]]:"C_DATA"===t[0]&&"pointer"===t[2]&&"<UNINITIALIZED>"!=t[3]&&"<UNALLOCATED>"!=t[3]&&void 0!==e[t[3]]}function getRefID(t){return"REF"==t[0]?t[1]:(assert("C_DATA"===t[0]&&"pointer"===t[2]),assert("<UNINITIALIZED>"!=t[3]&&"<UNALLOCATED>"!=t[3]),t[3])}ExecutionVisualizer.prototype.structurallyEquivalent=function(t,e){if(this.isPrimitiveType(t)||this.isPrimitiveType(e))return!1;if(t[0]!=e[0])return!1;if(t.length!=e.length)return!1;if("LIST"==t[0]||"TUPLE"==t[0])return!0;var n=-1;if("DICT"==t[0])n=2;else{if("INSTANCE"!=t[0])return!1;n=3}for(var i=d3.map(),r=n;r<t.length;r++)i.set(t[r][0],1);for(r=n;r<e.length;r++)if(!i.has(e[r][0]))return!1;return!0},ExecutionVisualizer.prototype.isPrimitiveType=function(t){var e=this.try_hook("isPrimitiveType",{obj:t});return e[0]?e[1]:null===t||"object"!=typeof t||"SPECIAL_FLOAT"==t[0]||"JS_SPECIAL_VAL"==t[0]||"C_DATA"==t[0]};var qtipShared={show:{ready:!0,delay:0,event:null,effect:function(){$(this).show()}},hide:{fixed:!0,event:null,effect:function(){$(this).hide()}},style:{classes:"ui-tooltip-pgbootstrap"}};function AnnotationBubble(t,e,n){this.parentViz=t,this.domID=n,this.hashID="#"+n,"codeline"==(this.type=e)?(this.my="left center",this.at="right center"):"frame"==e||"variable"==e?(this.my="right center",this.at="left center"):"object"==e?(this.my="bottom left",this.at="top center"):assert(!1),this.state="invisible",this.text="",this.qtipHidden=!1}function isOutputLineVisibleForBubbles(t){var e=$("#pyCodeOutputDiv"),n=$("#"+t).offset().top;t=e.offset().top,e.scrollTop(),e=e.height();return t<=n&&n<t+e-25}function traceQCheckMe(t,e,n){var i,r=$("#"+e).data("vis"),o=r.curInstr,a=r.curTrace[o+1],s=(t=$("#"+t).val(),n.split(".")),l=a;for(i in s)l=l[s[i]];e=$("#"+e+"_feedbacktext"),0<t.length&&t==l?e.html("Correct"):e.html(r.curTrace[o].question.feedback)}function closeModal(t){$.modal.close(),$("#"+t).data("vis").stepForward()}AnnotationBubble.prototype.showStub=function(){assert("invisible"==this.state||"edit"==this.state),assert(""==this.text);var t=this;this.destroyQTip(),$(this.hashID).qtip($.extend({},qtipShared,{content:" ",id:this.domID,position:{my:this.my,at:this.at,adjust:{x:"codeline"==t.type?-6:0},effect:null},style:{classes:"ui-tooltip-pgbootstrap ui-tooltip-pgbootstrap-stub"}})),$(this.qTipID()).unbind("click").click((function(){t.showEditor()})),this.state="stub"},AnnotationBubble.prototype.showEditor=function(){assert("stub"==this.state||"view"==this.state||"minimized"==this.state);var t=this,e='<textarea class="bubbleInputText">'+this.text+"</textarea>";this.destroyQTip(),$(this.hashID).qtip($.extend({},qtipShared,{content:e,id:this.domID,position:{my:this.my,at:this.at,adjust:{x:"codeline"==t.type?-6:0},effect:null}})),$(this.qTipContentID()).find("textarea.bubbleInputText").blur((function(){t.text=$(this).val().trim(),t.text?t.showViewer():t.showStub()})).focus(),this.state="edit"},AnnotationBubble.prototype.bindViewerClickHandler=function(){var t=this;$(this.qTipID()).unbind("click").click((function(){t.parentViz.editAnnotationMode?t.showEditor():t.minimizeViewer()}))},AnnotationBubble.prototype.showViewer=function(){assert("edit"==this.state||"invisible"==this.state),assert(this.text),this.destroyQTip(),$(this.hashID).qtip($.extend({},qtipShared,{content:htmlsanitize(this.text),id:this.domID,position:{my:this.my,at:this.at,adjust:{x:"codeline"==this.type?-6:0},effect:null}})),this.bindViewerClickHandler(),this.state="view"},AnnotationBubble.prototype.minimizeViewer=function(){assert("view"==this.state);var t=this;$(this.hashID).qtip("option","content.text"," "),$(this.qTipID()).unbind("click").click((function(){t.parentViz.editAnnotationMode?t.showEditor():t.restoreViewer()})),this.state="minimized"},AnnotationBubble.prototype.restoreViewer=function(){assert("minimized"==this.state),$(this.hashID).qtip("option","content.text",htmlsanitize(this.text)),this.bindViewerClickHandler(),this.state="view"},AnnotationBubble.prototype.makeInvisible=function(){assert("stub"==this.state||"edit"==this.state),this.destroyQTip(),this.state="invisible"},AnnotationBubble.prototype.destroyQTip=function(){$(this.hashID).qtip("destroy")},AnnotationBubble.prototype.qTipContentID=function(){return"#ui-tooltip-"+this.domID+"-content"},AnnotationBubble.prototype.qTipID=function(){return"#ui-tooltip-"+this.domID},AnnotationBubble.prototype.enterEditMode=function(){assert(this.parentViz.editAnnotationMode),"invisible"==this.state&&(this.showStub(),"codeline"==this.type&&this.redrawCodelineBubble())},AnnotationBubble.prototype.enterViewMode=function(){assert(!this.parentViz.editAnnotationMode),"stub"==this.state?this.makeInvisible():"edit"==this.state?(this.text=$(this.qTipContentID()).find("textarea.bubbleInputText").val().trim(),this.text?(this.showViewer(),"codeline"==this.type&&this.redrawCodelineBubble()):this.makeInvisible()):"invisible"==this.state&&this.text&&(this.showViewer(),"codeline"==this.type&&this.redrawCodelineBubble())},AnnotationBubble.prototype.preseedText=function(t){assert("invisible"==this.state),this.text=t},AnnotationBubble.prototype.redrawCodelineBubble=function(){assert("codeline"==this.type),isOutputLineVisibleForBubbles(this.domID)?(this.qtipHidden?$(this.hashID).qtip("show"):$(this.hashID).qtip("reposition"),this.qtipHidden=!1):($(this.hashID).qtip("hide"),this.qtipHidden=!0)},AnnotationBubble.prototype.redrawBubble=function(){$(this.hashID).qtip("reposition")},ExecutionVisualizer.prototype.activateJavaFrontend=function(){var t=null;this.curTrace.forEach((function(e,n){"exception"!==e.event||e.line||(e.line=t),void 0!==e.stack_to_render&&e.stack_to_render.reverse(),t=e.line})),this.add_pytutor_hook("renderPrimitiveObject",(function(t){var e=t.obj,n=t.d3DomElement;t=typeof e;if(null==e)n.append('<span class="nullObj">null</span>');else if("number"==t)n.append('<span class="numberObj">'+e+"</span>");else if("boolean"==t)e?n.append('<span class="boolObj">true</span>'):n.append('<span class="boolObj">false</span>');else if(e instanceof Array&&"VOID"==e[0])n.append('<span class="voidObj">void</span>');else if(e instanceof Array&&"NUMBER-LITERAL"==e[0])n.append('<span class="numberObj">'+e[1]+"</span>");else{if(!(e instanceof Array&&"CHAR-LITERAL"==e[0]))return[!1];t=e[1].charCodeAt(0),e=e[1];for(var i=t.toString(16);i.length<4;)i="0"+i;i="\\u"+i,"\n"==e?i="\\n":"\r"==e?i="\\r":"\t"==e?i="\\t":"\b"==e?i="\\b":"\f"==e?i="\\f":"'"==e?i="\\'":'"'==e?i='\\"':"\\"==e?i="\\\\":32<=t&&(i=e),n.append('<span class="stringObj">\''+i+"'</span>")}return[!0]})),this.add_pytutor_hook("isPrimitiveType",(function(t){return(t=t.obj)instanceof Array&&"VOID"==t[0]||t instanceof Array&&"NUMBER-LITERAL"==t[0]||t instanceof Array&&"CHAR-LITERAL"==t[0]||t instanceof Array&&"ELIDE"==t[0]?[!0,!0]:[!1]})),this.add_pytutor_hook("end_updateOutput",(function(t){var e=t.myViz;t=e.curTrace[e.curInstr];return e.params.stdin&&""!=e.params.stdin&&(t=t.stdinPosition||0,t='<span style="color:lightgray;text-decoration: line-through">'+i(e.params.stdin.substr(0,t))+"</span>"+i(e.params.stdin.substr(t)),e.domRoot.find("#stdinShow").html(t)),[!1]})),this.add_pytutor_hook("end_constructor",(function(t){var e=t.myViz;if(0<e.curTrace.length&&e.curTrace[e.curTrace.length-1]&&e.curTrace[e.curTrace.length-1].stdout?(e.hasStdout=!0,e.stdoutLines=e.curTrace[e.curTrace.length-1].stdout.split("\n").length):1<e.curTrace.length&&e.curTrace[e.curTrace.length-2]&&e.curTrace[e.curTrace.length-2].stdout?(e.hasStdout=!0,e.stdoutLines=e.curTrace[e.curTrace.length-2].stdout.split("\n").length):e.stdoutLines=-1,e.hasStdout)for(var n=0;n<e.curTrace.length;n++)e.curTrace[n].stdout||(e.curTrace[n].stdout=" ")})),this.add_pytutor_hook("end_render",(function(t){(t=t.myViz).params.stdin&&""!=t.params.stdin&&t.domRoot.find("#dataViz").append('<div id="stdinWrap">stdin:<pre id="stdinShow" style="border:1px solid gray"></pre></div>'),t.domRoot.find("#"+t.generateID("globals_header")).html("Static fields")})),this.add_pytutor_hook("isLinearObject",(function(t){return"STACK"==(t=t.heapObj)[0]||"QUEUE"==t[0]?["true","true"]:["false"]})),this.add_pytutor_hook("renderCompoundObject",(function(t){t.objID;var e=t.d3DomElement,n=t.obj,i=t.typeLabelPrefix,r=t.myViz,o=t.stepNum;if("LIST"!=n[0]&&"QUEUE"!=n[0]&&"STACK"!=n[0])return[!1];var a=n[0].toLowerCase();t={list:"array",queue:"queue",stack:"stack"}[a];if(1==n.length)return e.append('<div class="typeLabel">'+i+"empty "+t+"</div>"),[!0];if(e.append('<div class="typeLabel">'+i+t+"</div>"),e.append('<table class="'+a+'Tbl"></table>'),e=e.children("table"),"LIST"==n[0]){e.append("<tr></tr><tr></tr>");for(var s=e.find("tr:first"),l=e.find("tr:last"),u=1,c=0;u<n.length;u++){var d=n[u],h=d instanceof Array&&"ELIDE"==d[0];s.append('<td class="'+a+'Header"></td>'),s.find("td:last").append(h?"&hellip;":c),l.append('<td class="'+a+'Elt"></td>'),h?(l.find("td:last").append("&hellip;"),c+=d[1]):(r.renderNestedObject(d,o,l.find("td:last")),c++)}}return"STACK"==n[0]&&(e.append("<tr></tr><tr></tr>"),(l=e.find("tr:last")).append('<td class="'+a+'FElt"><span class="stringObj symbolic">&#8596;</span></td>'),$.each(n,(function(t,e){t<1||(l.append('<td class="'+a+'Elt"></td>'),r.renderNestedObject(e,o,l.find("td:last")))})),l.append('<td class="'+a+'LElt"></td>')),"QUEUE"==n[0]&&(e.append("<tr></tr><tr></tr>"),(l=e.find("tr:last")).append('<td class="'+a+'FElt"><span class="stringObj symbolic">&#8592;</span></td>'),$.each(n,(function(t,e){t<1||(l.append('<td class="'+a+'Elt"></td>'),r.renderNestedObject(e,o,l.find("td:last")))})),l.append('<td class="'+a+'LElt"><span class="stringObj symbolic">&#8592;</span></td>')),[!0]})),this.add_pytutor_hook("end_renderDataStructures",(function(t){(t=t.myViz).domRoot.find("td.instKey:contains('___NO_LABEL!___')").hide(),t.domRoot.find(".typeLabel:contains('dict')").each((function(t){"dict"==$(this).html()&&$(this).html("symbol table"),"empty dict"==$(this).html()&&$(this).html("empty symbol table")}))}));var e=ExecutionVisualizer.prototype.generateID.bind(this);this.generateID=function(t){return t=t.replace(/[^0-9a-zA-Z_]/g,(function(t){return"-"+t.charCodeAt(0)+"-"})),e(t)};var n={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"},i=function(t){return String(t).replace(/[&<>"'\/]/g,(function(t){return n[t]}))}};