metamaps--metamaps/public/assets/application-1e86b001d3bcaabff0c76f1492b0dc1e.js

36 lines
732 KiB
JavaScript
Raw Normal View History

2014-02-10 08:02:17 +00:00
/*!
* jQuery JavaScript Library v1.8.1
* http://jquery.com/
*
* Includes Sizzle.js
* http://sizzlejs.com/
*
* Copyright 2012 jQuery Foundation and other contributors
* Released under the MIT license
* http://jquery.org/license
*
* Date: Thu Aug 30 2012 17:17:22 GMT-0400 (Eastern Daylight Time)
*/
function BestInPlaceEditor(e){this.element=e,this.initOptions(),this.bindForm(),this.initNil(),jQuery(this.activator).bind("click",{editor:this},this.clickHandler)}function switchVisible(e,t){categoryVisible[e]==1?hideCategory(e,t):categoryVisible[e]==0&&showCategory(e,t)}function hideCategory(e,t){t==null&&(t=500),Mconsole.graph.eachNode(function(t){t.getData("metacode")==e&&(t.setData("alpha",.4,"end"),t.eachAdjacency(function(e){e.setData("alpha",.4,"end")}))}),Mconsole.fx.animate({modes:["node-property:alpha","edge-property:alpha"],duration:t})}function showCategory(e,t){t==null&&(t=500),Mconsole.graph.eachNode(function(t){t.getData("metacode")==e&&(t.setData("alpha",1,"end"),t.eachAdjacency(function(e){e.setData("alpha",1,"end")}))}),Mconsole.fx.animate({modes:["node-property:alpha","edge-property:alpha"],duration:t})}function hideAll(e){e==null&&(e=500),Mconsole.graph.eachNode(function(e){e.setData("alpha",.4,"end"),e.eachAdjacency(function(e){e.setData("alpha",.2,"end")})}),Mconsole.fx.animate({modes:["node-property:alpha","edge-property:alpha"],duration:e})}function showAll(e){e==null&&(e=500),Mconsole.graph.eachNode(function(e){e.setData("alpha",1,"end"),e.eachAdjacency(function(e){e.setData("alpha",.4,"end")})}),Mconsole.fx.animate({modes:["node-property:alpha","edge-property:alpha"],duration:e})}function filterTopicsByMap(e){Mconsole.graph.eachNode(function(t){t.getData("inmaps").indexOf(parseInt(e))!==-1?t.setData("alpha",1,"end"):t.setData("alpha",.4,"end"),Mconsole.fx.animate({modes:["node-property:alpha","edge-property:alpha"],duration:500})})}function filterTopicsByMapper(e){Mconsole.graph.eachNode(function(t){t.getData("userid").toString()==e?t.setData("alpha",1,"end"):t.setData("alpha",.4,"end"),Mconsole.fx.animate({modes:["node-property:alpha","edge-property:alpha"],duration:500})})}function filterTopicsByName(e){Mconsole.graph.eachNode(function(t){nodeName=t.name.toLowerCase(),nodeName.indexOf(e)!==-1&&e!=""?t.setData("alpha",1,"end"):t.setData("alpha",.4,"end"),Mconsole.fx.animate({modes:["node-property:alpha","edge-property:alpha"],duration:500})})}function clearCanvas(){Mconsole.graph.eachNode(function(e){Mconsole.graph.removeNode(e.id)}),Mconsole.plot()}function clearCanvasExceptRoot(){var e=new Array;Mconsole.graph.eachNode(function(t){e.push(t.id)});var t=Mconsole.graph.nodes[Mconsole.root];e.forEach(function(e,n){e!=t.id&&Mconsole.graph.removeNode(e)}),fetchRelatives(t)}function selectEdgeOnClickHandler(e,t){if(Mconsole.busy)return;if(synapseWasDoubleClicked()){synapseDoubleClickHandler(e,t);return}var n=MetamapsModel.selectedEdges.indexOf(e);n==-1?n=!1:n!=-1&&(n=!0),n&&t.shiftKey?deselectEdge(e):!n&&t.shiftKey?selectEdge(e):n&&!t.shiftKey?deselectAllEdges():!n&&!t.shiftKey&&(deselectAllEdges(),selectEdge(e)),Mconsole.plot()}function synapseDoubleClickHandler(e,t){editEdge(e,t)}function synapseWasDoubleClicked(){var e=MetamapsModel.lastSynapseClick,t=Date.now();return MetamapsModel.lastSynapseClick=t,t-e<MetamapsModel.DOUBLE_CLICK_TOLERANCE?!0:!1}function nodeDoubleClickHandler(e,t){openNodeShowcard(e)}function enterKeyHandler(e){}function escKeyHandler(){deselectAllEdges(),deselectAllNodes()}function keepFromCommons(e,t){if(userid==null)return;return $("#topic_addSynapse").val("false"),$("#topic_x").val(0),$("#topic_y").val(0),$("#topic_grabTopic").val(t),$(".new_topic").submit(),e.preventDefault(),e.stopPropagation(),!1}function nodeWasDoubleClicked(){var e=MetamapsModel.lastNodeClick,t=Date.now();return MetamapsModel.lastNodeClick=t,t-e<MetamapsModel.DOUBLE_CLICK_TOLERANCE?!0:!1}function selectNodeOnClickHandler(e,t){if(Mconsole.busy)return;if(nodeWasDoubleClicked()){nodeDoubleClickHandler(e,t);return}t.shiftKey||Mconsole.graph.eachNode(function(t){t.id!=e.id&&deselectNode(t)}),e.selected?deselectNode(e):selectNode(e),Mconsole.fx.animate({modes:["edge-property:lineWidth:color:alpha"],duration:500}),Mconsole.plot()}function selectNodeOnRightClickHandler(e,t){t.preventDefault(),t.stopPropagation();if(Mconsole.busy)return;selectNode(e),$(".rightclickmenu").remove();var n=document.createElement
(){var e=MetamapsModel.selectedEdges.length;for(var t=e-1;t>=0;t-=1){if(mapid!=null){var n=MetamapsModel.selectedEdges[t],r=n.getData("id");$.ajax({type:"POST",url:"/synapses/"+mapid+"/"+r+"/removefrommap"})}hideEdge(n)}MetamapsModel.selectedEdges=new Array}function deleteSelectedEdges(){var e=MetamapsModel.selectedEdges.length;for(var t=e-1;t>=0;t-=1){var n=MetamapsModel.selectedEdges[t],r=n.getData("id");$.ajax({type:"DELETE",url:"/synapses/"+r}),hideEdge(n)}MetamapsModel.selectedEdges=new Array}function selectNode(e){if(MetamapsModel.selectedNodes.indexOf(e)!=-1)return;e.selected=!0,e.setData("dim",30,"current"),e.setData("whiteCircle",!0),e.eachAdjacency(function(e){selectEdge(e)}),MetamapsModel.selectedNodes.push(e)}function deselectNode(e){delete e.selected,e.setData("whiteCircle",!1),e.eachAdjacency(function(e){deselectEdge(e)}),e.setData("dim",25,"current"),MetamapsModel.selectedNodes.splice(MetamapsModel.selectedNodes.indexOf(e),1)}function selectEdge(e){if(MetamapsModel.selectedEdges.indexOf(e)!=-1)return;e.setData("showDesc",!0,"current"),MetamapsModel.embed?MetamapsModel.embed&&e.setDataset("end",{lineWidth:4,color:"#999",alpha:1}):e.setDataset("end",{lineWidth:4,color:"#FFFFFF",alpha:1}),Mconsole.fx.animate({modes:["edge-property:lineWidth:color:alpha"],duration:100}),MetamapsModel.selectedEdges.push(e)}function deselectEdge(e){e.setData("showDesc",!1,"current"),e.setDataset("end",{lineWidth:2,color:"#222222",alpha:.4}),MetamapsModel.edgeHoveringOver==e&&(e.setData("showDesc",!0,"current"),e.setDataset("end",{lineWidth:4,color:"#222222",alpha:1})),Mconsole.fx.animate({modes:["edge-property:lineWidth:color:alpha"],duration:100}),MetamapsModel.selectedEdges.splice(MetamapsModel.selectedEdges.indexOf(e),1)}function hideNode(e){var t=Mconsole.graph.getNode(e);if(e==Mconsole.root&&gType=="centered"){alert("You can't hide this topic, it is the root of your graph.");return}deselectNode(t),t.setData("alpha",0,"end"),t.eachAdjacency(function(e){e.setData("alpha",0,"end")}),Mconsole.fx.animate({modes:["node-property:alpha","edge-property:alpha"],duration:1e3}),Mconsole.graph.removeNode(e)}function hideSelectedNodes(){var e=MetamapsModel.selectedNodes.length;for(var t=e-1;t>=0;t-=1){var n=MetamapsModel.selectedNodes[t];hideNode(n.id)}}function removeNode(e){var t=Mconsole.graph.getNode(e);deselectNode(t),mapperm&&$.ajax({type:"POST",url:"/topics/"+mapid+"/"+e+"/removefrommap"})}function removeSelectedNodes(){if(mapperm){var e=MetamapsModel.selectedNodes.length;for(var t=e-1;t>=0;t-=1){var n=MetamapsModel.selectedNodes[t];removeNode(n.id)}}}function deleteNode(e){if(e==Mconsole.root&&gType=="centered"){alert("You can't delete this topic, it is the root of your graph.");return}$.ajax({type:"DELETE",url:"/topics/"+e})}function deleteSelectedNodes(){var e=MetamapsModel.selectedNodes.length;for(var t=e-1;t>=0;t-=1){var n=MetamapsModel.selectedNodes[t];deleteNode(n.id)}}function addHoverForSettings(){$(".permActivator").unbind("mouseover"),$(".permActivator").unbind("mouseout");var e=!1,t,n;$(".permActivator").bind("mouseover",function(){clearTimeout(n),that=this,t=setTimeout(function(){e||(e=!0,$(that).animate({width:"203px",height:"37px"},300,function(){e=!1}))},300)}),$(".permActivator").bind("mouseout",function(){clearTimeout(t),that=this,n=setTimeout(function(){e||(e=!0,$(that).animate({height:"16px",width:"16px"},300,function(){e=!1}))},800)}),$(".best_in_place_permission").unbind("ajax:success"),$(".best_in_place_permission").bind("ajax:success",function(){var e=$(this).html(),t=$(this).parents(".cardSettings").find(".mapPerm");t.attr("title",e),e=="commons"?t.html("co"):e=="public"?t.html("pu"):e=="private"&&t.html("pr")})}function saveLayoutAll(){$(".wandSaveLayout").html("Saving...");var e="";if(gType=="arranged"||gType=="chaotic")Mconsole.graph.eachNode(function(t){e=e+t.getData("mappingid")+"/"+t.pos.x+"/"+t.pos.y+","}),e=e.slice(0,-1),$("#map_coordinates").val(e),$("#saveMapLayout").submit()}function saveLayout(e){var t=Mconsole.graph.getNode(e);$("#map_coordinates").val(t.getData("mappingid")+"/"+t.pos.x+"/"+t
setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,n){var r,i=1,s=v.Deferred(),o=this,u=this.length,a=function(){--i||s.resolveWith(o,[o])};typeof e!="string"&&(n=e,e=t),e=e||"fx";while(u--)r=v._data(o[u],e+"queueHooks"),r&&r.empty&&(i++,r.empty.add(a));return a(),s.promise(n)}});var j,F,I,q=/[\t\r\n]/g,R=/\r/g,U=/^(?:button|input)$/i,z=/^(?:button|input|object|select|textarea)$/i,W=/^a(?:rea|)$/i,X=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,V=v.support.getSetAttribute;v.fn.extend({attr:function(e,t){return v.access(this,v.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){v.removeAttr(this,e)})},prop:function(e,t){return v.access(this,v.prop,e,t,arguments.length>1)},removeProp:function(e){return e=v.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,s,o,u;if(v.isFunction(e))return this.each(function(t){v(this).addClass(e.call(this,t,this.className))});if(e&&typeof e=="string"){t=e.split(y);for(n=0,r=this.length;n<r;n++){i=this[n];if(i.nodeType===1)if(!i.className&&t.length===1)i.className=e;else{s=" "+i.className+" ";for(o=0,u=t.length;o<u;o++)~s.indexOf(" "+t[o]+" ")||(s+=t[o]+" ");i.className=v.trim(s)}}}return this},removeClass:function(e){var n,r,i,s,o,u,a;if(v.isFunction(e))return this.each(function(t){v(this).removeClass(e.call(this,t,this.className))});if(e&&typeof e=="string"||e===t){n=(e||"").split(y);for(u=0,a=this.length;u<a;u++){i=this[u];if(i.nodeType===1&&i.className){r=(" "+i.className+" ").replace(q," ");for(s=0,o=n.length;s<o;s++)while(r.indexOf(" "+n[s]+" ")>-1)r=r.replace(" "+n[s]+" "," ");i.className=e?v.trim(r):""}}}return this},toggleClass:function(e,t){var n=typeof e,r=typeof t=="boolean";return v.isFunction(e)?this.each(function(n){v(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if(n==="string"){var i,s=0,o=v(this),u=t,a=e.split(y);while(i=a[s++])u=r?u:!o.hasClass(i),o[u?"addClass":"removeClass"](i)}else if(n==="undefined"||n==="boolean")this.className&&v._data(this,"__className__",this.className),this.className=this.className||e===!1?"":v._data(this,"__className__")||""})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;n<r;n++)if(this[n].nodeType===1&&(" "+this[n].className+" ").replace(q," ").indexOf(t)>-1)return!0;return!1},val:function(e){var n,r,i,s=this[0];if(!arguments.length){if(s)return n=v.valHooks[s.type]||v.valHooks[s.nodeName.toLowerCase()],n&&"get"in n&&(r=n.get(s,"value"))!==t?r:(r=s.value,typeof r=="string"?r.replace(R,""):r==null?"":r);return}return i=v.isFunction(e),this.each(function(r){var s,o=v(this);if(this.nodeType!==1)return;i?s=e.call(this,r,o.val()):s=e,s==null?s="":typeof s=="number"?s+="":v.isArray(s)&&(s=v.map(s,function(e){return e==null?"":e+""})),n=v.valHooks[this.type]||v.valHooks[this.nodeName.toLowerCase()];if(!n||!("set"in n)||n.set(this,s,"value")===t)this.value=s})}}),v.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){var t,n,r,i,s=e.selectedIndex,o=[],u=e.options,a=e.type==="select-one";if(s<0)return null;n=a?s:0,r=a?s+1:u.length;for(;n<r;n++){i=u[n];if(i.selected&&(v.support.optDisabled?!i.disabled:i.getAttribute("disabled")===null)&&(!i.parentNode.disabled||!v.nodeName(i.parentNode,"optgroup"))){t=v(i).val();if(a)return t;o.push(t)}}return a&&!o.length&&u.length?v(u[s]).val():o},set:function(e,t){var n=v.makeArray(t);return v(e).find("option").each(function(){this.selected=v.inArray(v(this).val(),n)>=0}),n.length||(e.selectedIndex=-1),n}}},attrFn:{},attr:function(e,n,r,i){var s,o,u,a=e.nodeType;if(!e||a===3||a===8||a===2)return;if(i&&v.isFunction(v.fn[n]))return v(e)[n](r);if(typeof e.getAttribute=="undefined")return v.prop(e,n,r);u=a!==1||!v.isXMLDoc(e),u&&(n=n.toLowerCase(),o=v.attrHooks[n]||(X.test(n)?F:j));if(r!==t){if(r===null){v.removeAttr(e,n);return}return o&&"set"in o&&u&&(s=o.set
webkitMatchesSelector||g.oMatchesSelector||g.msMatchesSelector;X(function(e){e.innerHTML="<select><option selected=''></option></select>",e.querySelectorAll("[selected]").length||i.push("\\["+C+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),e.querySelectorAll(":checked").length||i.push(":checked")}),X(function(e){e.innerHTML="<p test=''></p>",e.querySelectorAll("[test^='']").length&&i.push("[*^$]="+C+"*(?:\"\"|'')"),e.innerHTML="<input type='hidden'/>",e.querySelectorAll(":enabled").length||i.push(":enabled",":disabled")}),i=i.length&&new RegExp(i.join("|")),lt=function(e,r,s,o,u){if(!o&&!u&&(!i||!i.test(e)))if(r.nodeType===9)try{return w.apply(s,b.call(r.querySelectorAll(e),0)),s}catch(a){}else if(r.nodeType===1&&r.nodeName.toLowerCase()!=="object"){var f,l,c,h=r.getAttribute("id"),p=h||d,v=I.test(e)&&r.parentNode||r;h?p=p.replace(n,"\\$&"):r.setAttribute("id",p),f=nt(e,r,u),p="[id='"+p+"']";for(l=0,c=f.length;l<c;l++)f[l]=p+f[l].selector;try{return w.apply(s,b.call(v.querySelectorAll(f.join(",")),0)),s}catch(a){}finally{h||r.removeAttribute("id")}}return t(e,r,s,o,u)},o&&(X(function(t){e=o.call(t,"div");try{o.call(t,"[test!='']:sizzle"),s.push(W.PSEUDO.source,W.POS.source,"!=")}catch(n){}}),s=new RegExp(s.join("|")),Y.matchesSelector=function(t,n){n=n.replace(r,"='$1']");if(!u(t)&&!s.test(n)&&(!i||!i.test(n)))try{var a=o.call(t,n);if(a||e||t.document&&t.document.nodeType!==11)return a}catch(f){}return Y(n,null,null,[t]).length>0})}(),s.setFilters.nth=s.setFilters.eq,s.filters=s.pseudos,Y.attr=v.attr,v.find=Y,v.expr=Y.selectors,v.expr[":"]=v.expr.pseudos,v.unique=Y.uniqueSort,v.text=Y.getText,v.isXMLDoc=Y.isXML,v.contains=Y.contains}(e);var nt=/Until$/,rt=/^(?:parents|prev(?:Until|All))/,it=/^.[^:#\[\.,]*$/,st=v.expr.match.needsContext,ot={children:!0,contents:!0,next:!0,prev:!0};v.fn.extend({find:function(e){var t,n,r,i,s,o,u=this;if(typeof e!="string")return v(e).filter(function(){for(t=0,n=u.length;t<n;t++)if(v.contains(u[t],this))return!0});o=this.pushStack("","find",e);for(t=0,n=this.length;t<n;t++){r=o.length,v.find(e,this[t],o);if(t>0)for(i=r;i<o.length;i++)for(s=0;s<r;s++)if(o[s]===o[i]){o.splice(i--,1);break}}return o},has:function(e){var t,n=v(e,this),r=n.length;return this.filter(function(){for(t=0;t<r;t++)if(v.contains(this,n[t]))return!0})},not:function(e){return this.pushStack(ft(this,e,!1),"not",e)},filter:function(e){return this.pushStack(ft(this,e,!0),"filter",e)},is:function(e){return!!e&&(typeof e=="string"?st.test(e)?v(e,this.context).index(this[0])>=0:v.filter(e,this).length>0:this.filter(e).length>0)},closest:function(e,t){var n,r=0,i=this.length,s=[],o=st.test(e)||typeof e!="string"?v(e,t||this.context):0;for(;r<i;r++){n=this[r];while(n&&n.ownerDocument&&n!==t&&n.nodeType!==11){if(o?o.index(n)>-1:v.find.matchesSelector(n,e)){s.push(n);break}n=n.parentNode}}return s=s.length>1?v.unique(s):s,this.pushStack(s,"closest",e)},index:function(e){return e?typeof e=="string"?v.inArray(this[0],v(e)):v.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(e,t){var n=typeof e=="string"?v(e,t):v.makeArray(e&&e.nodeType?[e]:e),r=v.merge(this.get(),n);return this.pushStack(ut(n[0])||ut(r[0])?r:v.unique(r))},addBack:function(e){return this.add(e==null?this.prevObject:this.prevObject.filter(e))}}),v.fn.andSelf=v.fn.addBack,v.each({parent:function(e){var t=e.parentNode;return t&&t.nodeType!==11?t:null},parents:function(e){return v.dir(e,"parentNode")},parentsUntil:function(e,t,n){return v.dir(e,"parentNode",n)},next:function(e){return at(e,"nextSibling")},prev:function(e){return at(e,"previousSibling")},nextAll:function(e){return v.dir(e,"nextSibling")},prevAll:function(e){return v.dir(e,"previousSibling")},nextUntil:function(e,t,n){return v.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return v.dir(e,"previousSibling",n)},siblings:function(e){return v.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return v.sibling(e.firstChild)},contents:function(e){return v.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:v.merge([],e.
this.offsetParent||i.body;while(e&&!er.test(e.nodeName)&&v.css(e,"position")==="static")e=e.offsetParent;return e||i.body})}}),v.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r=/Y/.test(n);v.fn[e]=function(i){return v.access(this,function(e,i,s){var o=tr(e);if(s===t)return o?n in o?o[n]:o.document.documentElement[i]:e[i];o?o.scrollTo(r?v(o).scrollLeft():s,r?s:v(o).scrollTop()):e[i]=s},e,i,arguments.length,null)}}),v.each({Height:"height",Width:"width"},function(e,n){v.each({padding:"inner"+e,content:n,"":"outer"+e},function(r,i){v.fn[i]=function(i,s){var o=arguments.length&&(r||typeof i!="boolean"),u=r||(i===!0||s===!0?"margin":"border");return v.access(this,function(n,r,i){var s;return v.isWindow(n)?n.document.documentElement["client"+e]:n.nodeType===9?(s=n.documentElement,Math.max(n.body["scroll"+e],s["scroll"+e],n.body["offset"+e],s["offset"+e],s["client"+e])):i===t?v.css(n,r,i,u):v.style(n,r,i,u)},n,o?i:t,o,null)}})}),e.jQuery=e.$=v,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return v})})(window),function(e,t){function n(t,n){var i=t.nodeName.toLowerCase();if("area"===i){var s=t.parentNode,o=s.name,u;return!t.href||!o||s.nodeName.toLowerCase()!=="map"?!1:(u=e("img[usemap=#"+o+"]")[0],!!u&&r(u))}return(/input|select|textarea|button|object/.test(i)?!t.disabled:"a"==i?t.href||n:n)&&r(t)}function r(t){return!e(t).parents().andSelf().filter(function(){return e.curCSS(this,"visibility")==="hidden"||e.expr.filters.hidden(this)}).length}e.ui=e.ui||{};if(e.ui.version)return;e.extend(e.ui,{version:"1.8.23",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}}),e.fn.extend({propAttr:e.fn.prop||e.fn.attr,_focus:e.fn.focus,focus:function(t,n){return typeof t=="number"?this.each(function(){var r=this;setTimeout(function(){e(r).focus(),n&&n.call(r)},t)}):this._focus.apply(this,arguments)},scrollParent:function(){var t;return e.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?t=this.parents().filter(function(){return/(relative|absolute|fixed)/.test(e.curCSS(this,"position",1))&&/(auto|scroll)/.test(e.curCSS(this,"overflow",1)+e.curCSS(this,"overflow-y",1)+e.curCSS(this,"overflow-x",1))}).eq(0):t=this.parents().filter(function(){return/(auto|scroll)/.test(e.curCSS(this,"overflow",1)+e.curCSS(this,"overflow-y",1)+e.curCSS(this,"overflow-x",1))}).eq(0),/fixed/.test(this.css("position"))||!t.length?e(document):t},zIndex:function(n){if(n!==t)return this.css("zIndex",n);if(this.length){var r=e(this[0]),i,s;while(r.length&&r[0]!==document){i=r.css("position");if(i==="absolute"||i==="relative"||i==="fixed"){s=parseInt(r.css("zIndex"),10);if(!isNaN(s)&&s!==0)return s}r=r.parent()}}return 0},disableSelection:function(){return this.bind((e.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(e){e.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),e("<a>").outerWidth(1).jquery||e.each(["Width","Height"],function(n,r){function u(t,n,r,s){return e.each(i,function(){n-=parseFloat(e.curCSS(t,"padding"+this,!0))||0,r&&(n-=parseFloat(e.curCSS(t,"border"+this+"Width",!0))||0),s&&(n-=parseFloat(e.curCSS(t,"margin"+this,!0))||0)}),n}var i=r==="Width"?["Left","Right"]:["Top","Bottom"],s=r.toLowerCase(),o={innerWidth:e.fn.innerWidth,innerHeight:e.fn.innerHeight,outerWidth:e.fn.outerWidth,outerHeight:e.fn.outerHeight};e.fn["inner"+r]=function(n){return n===t?o["inner"+r].call(this):this.each(function(){e(this).css(s,u(this,n)+"px")})},e.fn["outer"+r]=function(t,n){return typeof t!="number"?o["outer"+r].call(this,t):this.each(function(){e(this).css(s,u(this,t,!0,n)+"px")})}}),e.extend(e.expr[":"],{data:e.expr.createPseudo?e.expr.createPseudo(functio
.width/2&&s-t.helperProportions.width/2<f&&l<o+t.helperProportions.height/2&&u-t.helperProportions.height/2<c;case"pointer":var h=(t.positionAbs||t.position.absolute).left+(t.clickOffset||t.offset.click).left,p=(t.positionAbs||t.position.absolute).top+(t.clickOffset||t.offset.click).top,d=e.ui.isOver(p,h,l,a,n.proportions.height,n.proportions.width);return d;case"touch":return(o>=l&&o<=c||u>=l&&u<=c||o<l&&u>c)&&(i>=a&&i<=f||s>=a&&s<=f||i<a&&s>f);default:return!1}},e.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(t,n){var r=e.ui.ddmanager.droppables[t.options.scope]||[],i=n?n.type:null,s=(t.currentItem||t.element).find(":data(droppable)").andSelf();e:for(var o=0;o<r.length;o++){if(r[o].options.disabled||t&&!r[o].accept.call(r[o].element[0],t.currentItem||t.element))continue;for(var u=0;u<s.length;u++)if(s[u]==r[o].element[0]){r[o].proportions.height=0;continue e}r[o].visible=r[o].element.css("display")!="none";if(!r[o].visible)continue;i=="mousedown"&&r[o]._activate.call(r[o],n),r[o].offset=r[o].element.offset(),r[o].proportions={width:r[o].element[0].offsetWidth,height:r[o].element[0].offsetHeight}}},drop:function(t,n){var r=!1;return e.each(e.ui.ddmanager.droppables[t.options.scope]||[],function(){if(!this.options)return;!this.options.disabled&&this.visible&&e.ui.intersect(t,this,this.options.tolerance)&&(r=this._drop.call(this,n)||r),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],t.currentItem||t.element)&&(this.isout=1,this.isover=0,this._deactivate.call(this,n))}),r},dragStart:function(t,n){t.element.parents(":not(body,html)").bind("scroll.droppable",function(){t.options.refreshPositions||e.ui.ddmanager.prepareOffsets(t,n)})},drag:function(t,n){t.options.refreshPositions&&e.ui.ddmanager.prepareOffsets(t,n),e.each(e.ui.ddmanager.droppables[t.options.scope]||[],function(){if(this.options.disabled||this.greedyChild||!this.visible)return;var r=e.ui.intersect(t,this,this.options.tolerance),i=!r&&this.isover==1?"isout":r&&this.isover==0?"isover":null;if(!i)return;var s;if(this.options.greedy){var o=this.element.parents(":data(droppable):eq(0)");o.length&&(s=e.data(o[0],"droppable"),s.greedyChild=i=="isover"?1:0)}s&&i=="isover"&&(s.isover=0,s.isout=1,s._out.call(s,n)),this[i]=1,this[i=="isout"?"isover":"isout"]=0,this[i=="isover"?"_over":"_out"].call(this,n),s&&i=="isout"&&(s.isout=0,s.isover=1,s._over.call(s,n))})},dragStop:function(t,n){t.element.parents(":not(body,html)").unbind("scroll.droppable"),t.options.refreshPositions||e.ui.ddmanager.prepareOffsets(t,n)}}}(jQuery),function(e,t){e.widget("ui.resizable",e.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 t=this,n=this.options;this.element.addClass("ui-resizable"),e.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(e('<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
{var n=e.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,t.top+t.height/2,t.height),r=e.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,t.left+t.width/2,t.width),i=this._getDragVerticalDirection(),s=this._getDragHorizontalDirection();return this.floating&&s?s=="right"&&r||s=="left"&&!r:i&&(i=="down"&&n||i=="up"&&!n)},_getDragVerticalDirection:function(){var e=this.positionAbs.top-this.lastPositionAbs.top;return e!=0&&(e>0?"down":"up")},_getDragHorizontalDirection:function(){var e=this.positionAbs.left-this.lastPositionAbs.left;return e!=0&&(e>0?"right":"left")},refresh:function(e){return this._refreshItems(e),this.refreshPositions(),this},_connectWith:function(){var e=this.options;return e.connectWith.constructor==String?[e.connectWith]:e.connectWith},_getItemsAsjQuery:function(t){var n=this,r=[],i=[],s=this._connectWith();if(s&&t)for(var o=s.length-1;o>=0;o--){var u=e(s[o]);for(var a=u.length-1;a>=0;a--){var f=e.data(u[a],this.widgetName);f&&f!=this&&!f.options.disabled&&i.push([e.isFunction(f.options.items)?f.options.items.call(f.element):e(f.options.items,f.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),f])}}i.push([e.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):e(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]);for(var o=i.length-1;o>=0;o--)i[o][0].each(function(){r.push(this)});return e(r)},_removeCurrentsFromItems:function(){var e=this.currentItem.find(":data("+this.widgetName+"-item)");for(var t=0;t<this.items.length;t++)for(var n=0;n<e.length;n++)e[n]==this.items[t].item[0]&&this.items.splice(t,1)},_refreshItems:function(t){this.items=[],this.containers=[this];var n=this.items,r=this,i=[[e.isFunction(this.options.items)?this.options.items.call(this.element[0],t,{item:this.currentItem}):e(this.options.items,this.element),this]],s=this._connectWith();if(s&&this.ready)for(var o=s.length-1;o>=0;o--){var u=e(s[o]);for(var a=u.length-1;a>=0;a--){var f=e.data(u[a],this.widgetName);f&&f!=this&&!f.options.disabled&&(i.push([e.isFunction(f.options.items)?f.options.items.call(f.element[0],t,{item:this.currentItem}):e(f.options.items,f.element),f]),this.containers.push(f))}}for(var o=i.length-1;o>=0;o--){var l=i[o][1],c=i[o][0];for(var a=0,h=c.length;a<h;a++){var p=e(c[a]);p.data(this.widgetName+"-item",l),n.push({item:p,instance:l,width:0,height:0,left:0,top:0})}}},refreshPositions:function(t){this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());for(var n=this.items.length-1;n>=0;n--){var r=this.items[n];if(r.instance!=this.currentContainer&&this.currentContainer&&r.item[0]!=this.currentItem[0])continue;var i=this.options.toleranceElement?e(this.options.toleranceElement,r.item):r.item;t||(r.width=i.outerWidth(),r.height=i.outerHeight());var s=i.offset();r.left=s.left,r.top=s.top}if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(var n=this.containers.length-1;n>=0;n--){var s=this.containers[n].element.offset();this.containers[n].containerCache.left=s.left,this.containers[n].containerCache.top=s.top,this.containers[n].containerCache.width=this.containers[n].element.outerWidth(),this.containers[n].containerCache.height=this.containers[n].element.outerHeight()}return this},_createPlaceholder:function(t){var n=t||this,r=n.options;if(!r.placeholder||r.placeholder.constructor==String){var i=r.placeholder;r.placeholder={element:function(){var t=e(document.createElement(n.currentItem[0].nodeName)).addClass(i||n.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];return i||(t.style.visibility="hidden"),t},update:function(e,t){if(i&&!r.forcePlaceholderSize)return;t.height()||t.height(n.currentItem.innerHeight()-parseInt(n.currentItem.css("paddingTop")||0,10)-parseInt(n.currentItem.css("paddingBottom")||0,10)),t.width()||t.width(n.currentItem.innerWidth()-parseInt(n.currentItem.css("paddingLeft")||0,10)-parseInt(n.currentItem.css("paddingRight
);c&&e.effects.save(n,s);var r={height:n.height(),width:n.width()};n.from={height:r.height*m.from.y,width:r.width*m.from.x},n.to={height:r.height*m.to.y,width:r.width*m.to.x},m.from.y!=m.to.y&&(n.from=e.effects.setTransition(n,a,m.from.y,n.from),n.to=e.effects.setTransition(n,a,m.to.y,n.to)),m.from.x!=m.to.x&&(n.from=e.effects.setTransition(n,f,m.from.x,n.from),n.to=e.effects.setTransition(n,f,m.to.x,n.to)),n.css(n.from),n.animate(n.to,t.duration,t.options.easing,function(){c&&e.effects.restore(n,s)})});n.animate(n.to,{queue:!1,duration:t.duration,easing:t.options.easing,complete:function(){n.to.opacity===0&&n.css("opacity",n.from.opacity),l=="hide"&&n.hide(),e.effects.restore(n,c?r:i),e.effects.removeWrapper(n),t.callback&&t.callback.apply(this,arguments),n.dequeue()}})})}}(jQuery),function(e,t){e.effects.shake=function(t){return this.queue(function(){var n=e(this),r=["position","top","bottom","left","right"],i=e.effects.setMode(n,t.options.mode||"effect"),s=t.options.direction||"left",u=t.options.distance||20,a=t.options.times||3,f=t.duration||t.options.duration||140;e.effects.save(n,r),n.show(),e.effects.createWrapper(n);var l=s=="up"||s=="down"?"top":"left",c=s=="up"||s=="left"?"pos":"neg",h={},p={},d={};h[l]=(c=="pos"?"-=":"+=")+u,p[l]=(c=="pos"?"+=":"-=")+u*2,d[l]=(c=="pos"?"-=":"+=")+u*2,n.animate(h,f,t.options.easing);for(var v=1;v<a;v++)n.animate(p,f,t.options.easing).animate(d,f,t.options.easing);n.animate(p,f,t.options.easing).animate(h,f/2,t.options.easing,function(){e.effects.restore(n,r),e.effects.removeWrapper(n),t.callback&&t.callback.apply(this,arguments)}),n.queue("fx",function(){n.dequeue()}),n.dequeue()})}}(jQuery),function(e,t){e.effects.slide=function(t){return this.queue(function(){var n=e(this),r=["position","top","bottom","left","right"],i=e.effects.setMode(n,t.options.mode||"show"),s=t.options.direction||"left";e.effects.save(n,r),n.show(),e.effects.createWrapper(n).css({overflow:"hidden"});var u=s=="up"||s=="down"?"top":"left",a=s=="up"||s=="left"?"pos":"neg",f=t.options.distance||(u=="top"?n.outerHeight(!0):n.outerWidth(!0));i=="show"&&n.css(u,a=="pos"?isNaN(f)?"-"+f:-f:f);var l={};l[u]=(i=="show"?a=="pos"?"+=":"-=":a=="pos"?"-=":"+=")+f,n.animate(l,{queue:!1,duration:t.duration,easing:t.options.easing,complete:function(){i=="hide"&&n.hide(),e.effects.restore(n,r),e.effects.removeWrapper(n),t.callback&&t.callback.apply(this,arguments),n.dequeue()}})})}}(jQuery),function(e,t){e.effects.transfer=function(t){return this.queue(function(){var n=e(this),r=e(t.options.to),i=r.offset(),s={top:i.top,left:i.left,height:r.innerHeight(),width:r.innerWidth()},u=n.offset(),a=e('<div class="ui-effects-transfer"></div>').appendTo(document.body).addClass(t.options.className).css({top:u.top,left:u.left,height:n.innerHeight(),width:n.innerWidth(),position:"absolute"}).animate(s,t.duration,t.options.easing,function(){a.remove(),t.callback&&t.callback.apply(n[0],arguments),n.dequeue()})})}}(jQuery),function(e,t){e.widget("ui.accordion",{options:{active:0,animated:"slide",autoHeight:!0,clearStyle:!1,collapsible:!1,event:"click",fillSpace:!1,header:"> li > :first-child,> :not(li):even",icons:{header:"ui-icon-triangle-1-e",headerSelected:"ui-icon-triangle-1-s"},navigation:!1,navigationFilter:function(){return this.href.toLowerCase()===location.href.toLowerCase()}},_create:function(){var t=this,n=t.options;t.running=0,t.element.addClass("ui-accordion ui-widget ui-helper-reset").children("li").addClass("ui-accordion-li-fix"),t.headers=t.element.find(n.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all").bind("mouseenter.accordion",function(){if(n.disabled)return;e(this).addClass("ui-state-hover")}).bind("mouseleave.accordion",function(){if(n.disabled)return;e(this).removeClass("ui-state-hover")}).bind("focus.accordion",function(){if(n.disabled)return;e(this).addClass("ui-state-focus")}).bind("blur.accordion",function(){if(n.disabled)return;e(this).removeClass("ui-state-focus")}),t.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom");if(n.n
)?$("<img/>").addClass(this._triggerClass).attr({src:o,alt:s,title:s}):$('<button type="button"></button>').addClass(this._triggerClass).html(o==""?s:$("<img/>").attr({src:o,alt:s,title:s}))),e[r?"before":"after"](t.trigger),t.trigger.click(function(){return $.datepicker._datepickerShowing&&$.datepicker._lastInput==e[0]?$.datepicker._hideDatepicker():$.datepicker._datepickerShowing&&$.datepicker._lastInput!=e[0]?($.datepicker._hideDatepicker(),$.datepicker._showDatepicker(e[0])):$.datepicker._showDatepicker(e[0]),!1})}},_autoSize:function(e){if(this._get(e,"autoSize")&&!e.inline){var t=new Date(2009,11,20),n=this._get(e,"dateFormat");if(n.match(/[DM]/)){var r=function(e){var t=0,n=0;for(var r=0;r<e.length;r++)e[r].length>t&&(t=e[r].length,n=r);return n};t.setMonth(r(this._get(e,n.match(/MM/)?"monthNames":"monthNamesShort"))),t.setDate(r(this._get(e,n.match(/DD/)?"dayNames":"dayNamesShort"))+20-t.getDay())}e.input.attr("size",this._formatDate(e,t).length)}},_inlineDatepicker:function(e,t){var n=$(e);if(n.hasClass(this.markerClassName))return;n.addClass(this.markerClassName).append(t.dpDiv).bind("setData.datepicker",function(e,n,r){t.settings[n]=r}).bind("getData.datepicker",function(e,n){return this._get(t,n)}),$.data(e,PROP_NAME,t),this._setDate(t,this._getDefaultDate(t),!0),this._updateDatepicker(t),this._updateAlternate(t),t.settings.disabled&&this._disableDatepicker(e),t.dpDiv.css("display","block")},_dialogDatepicker:function(e,t,n,r,i){var s=this._dialogInst;if(!s){this.uuid+=1;var o="dp"+this.uuid;this._dialogInput=$('<input type="text" id="'+o+'" style="position: absolute; top: -100px; width: 0px;"/>'),this._dialogInput.keydown(this._doKeyDown),$("body").append(this._dialogInput),s=this._dialogInst=this._newInst(this._dialogInput,!1),s.settings={},$.data(this._dialogInput[0],PROP_NAME,s)}extendRemove(s.settings,r||{}),t=t&&t.constructor==Date?this._formatDate(s,t):t,this._dialogInput.val(t),this._pos=i?i.length?i:[i.pageX,i.pageY]:null;if(!this._pos){var u=document.documentElement.clientWidth,a=document.documentElement.clientHeight,f=document.documentElement.scrollLeft||document.body.scrollLeft,l=document.documentElement.scrollTop||document.body.scrollTop;this._pos=[u/2-100+f,a/2-150+l]}return this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),s.settings.onSelect=n,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),$.blockUI&&$.blockUI(this.dpDiv),$.data(this._dialogInput[0],PROP_NAME,s),this},_destroyDatepicker:function(e){var t=$(e),n=$.data(e,PROP_NAME);if(!t.hasClass(this.markerClassName))return;var r=e.nodeName.toLowerCase();$.removeData(e,PROP_NAME),r=="input"?(n.append.remove(),n.trigger.remove(),t.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)):(r=="div"||r=="span")&&t.removeClass(this.markerClassName).empty()},_enableDatepicker:function(e){var t=$(e),n=$.data(e,PROP_NAME);if(!t.hasClass(this.markerClassName))return;var r=e.nodeName.toLowerCase();if(r=="input")e.disabled=!1,n.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""});else if(r=="div"||r=="span"){var i=t.children("."+this._inlineClass);i.children().removeClass("ui-state-disabled"),i.find("select.ui-datepicker-month, select.ui-datepicker-year").removeAttr("disabled")}this._disabledInputs=$.map(this._disabledInputs,function(t){return t==e?null:t})},_disableDatepicker:function(e){var t=$(e),n=$.data(e,PROP_NAME);if(!t.hasClass(this.markerClassName))return;var r=e.nodeName.toLowerCase();if(r=="input")e.disabled=!0,n.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"});else if(r=="div"||r=="span"){var i=t.children("."+this._inlineClass);i.children().addClass("ui-state-disabled"),i.find("select.ui-datepicker-month, select.ui-datepicker-year").attr("disabled","disabled")}this._disabledInputs=$.map(this._disabledInputs,function(t){ret
,minWidth:150,modal:!1,position:{my:"center",at:"center",collision:"fit",using:function(t){var n=e(this).css(t).offset().top;n<0&&e(this).css("top",t.top-n)}},resizable:!0,show:null,stack:!0,title:"",width:300,zIndex:1e3},_create:function(){this.originalTitle=this.element.attr("title"),typeof this.originalTitle!="string"&&(this.originalTitle=""),this.options.title=this.options.title||this.originalTitle;var t=this,r=t.options,i=r.title||"&#160;",s=e.ui.dialog.getTitleId(t.element),o=(t.uiDialog=e("<div></div>")).appendTo(document.body).hide().addClass(n+r.dialogClass).css({zIndex:r.zIndex}).attr("tabIndex",-1).css("outline",0).keydown(function(n){r.closeOnEscape&&!n.isDefaultPrevented()&&n.keyCode&&n.keyCode===e.ui.keyCode.ESCAPE&&(t.close(n),n.preventDefault())}).attr({role:"dialog","aria-labelledby":s}).mousedown(function(e){t.moveToTop(!1,e)}),u=t.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(o),a=(t.uiDialogTitlebar=e("<div></div>")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(o),f=e('<a href="#"></a>').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").hover(function(){f.addClass("ui-state-hover")},function(){f.removeClass("ui-state-hover")}).focus(function(){f.addClass("ui-state-focus")}).blur(function(){f.removeClass("ui-state-focus")}).click(function(e){return t.close(e),!1}).appendTo(a),l=(t.uiDialogTitlebarCloseText=e("<span></span>")).addClass("ui-icon ui-icon-closethick").text(r.closeText).appendTo(f),c=e("<span></span>").addClass("ui-dialog-title").attr("id",s).html(i).prependTo(a);e.isFunction(r.beforeclose)&&!e.isFunction(r.beforeClose)&&(r.beforeClose=r.beforeclose),a.find("*").add(a).disableSelection(),r.draggable&&e.fn.draggable&&t._makeDraggable(),r.resizable&&e.fn.resizable&&t._makeResizable(),t._createButtons(r.buttons),t._isOpen=!1,e.fn.bgiframe&&o.bgiframe()},_init:function(){this.options.autoOpen&&this.open()},destroy:function(){var e=this;return e.overlay&&e.overlay.destroy(),e.uiDialog.hide(),e.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body"),e.uiDialog.remove(),e.originalTitle&&e.element.attr("title",e.originalTitle),e},widget:function(){return this.uiDialog},close:function(t){var n=this,r,i;if(!1===n._trigger("beforeClose",t))return;return n.overlay&&n.overlay.destroy(),n.uiDialog.unbind("keypress.ui-dialog"),n._isOpen=!1,n.options.hide?n.uiDialog.hide(n.options.hide,function(){n._trigger("close",t)}):(n.uiDialog.hide(),n._trigger("close",t)),e.ui.dialog.overlay.resize(),n.options.modal&&(r=0,e(".ui-dialog").each(function(){this!==n.uiDialog[0]&&(i=e(this).css("z-index"),isNaN(i)||(r=Math.max(r,i)))}),e.ui.dialog.maxZ=r),n},isOpen:function(){return this._isOpen},moveToTop:function(t,n){var r=this,i=r.options,s;return i.modal&&!t||!i.stack&&!i.modal?r._trigger("focus",n):(i.zIndex>e.ui.dialog.maxZ&&(e.ui.dialog.maxZ=i.zIndex),r.overlay&&(e.ui.dialog.maxZ+=1,r.overlay.$el.css("z-index",e.ui.dialog.overlay.maxZ=e.ui.dialog.maxZ)),s={scrollTop:r.element.scrollTop(),scrollLeft:r.element.scrollLeft()},e.ui.dialog.maxZ+=1,r.uiDialog.css("z-index",e.ui.dialog.maxZ),r.element.attr(s),r._trigger("focus",n),r)},open:function(){if(this._isOpen)return;var t=this,n=t.options,r=t.uiDialog;return t.overlay=n.modal?new e.ui.dialog.overlay(t):null,t._size(),t._position(n.position),r.show(n.show),t.moveToTop(!0),n.modal&&r.bind("keydown.ui-dialog",function(t){if(t.keyCode!==e.ui.keyCode.TAB)return;var n=e(":tabbable",this),r=n.filter(":first"),i=n.filter(":last");if(t.target===i[0]&&!t.shiftKey)return r.focus(1),!1;if(t.target===r[0]&&t.shiftKey)return i.focus(1),!1}),e(t.element.find(":tabbable").get().concat(r.find(".ui-dialog-buttonpane :tabbable").get().concat(r.get()))).eq(0).focus(),t._isOpen=!0,t._trigger("open"),t},_createButtons:function(t){var n=this,r=!1,i=e("<div></div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),s=e("<div></div>").addClass("ui-dialog-buttonset").appendTo(i);n.uiDialog.fi
)})}),this.lis.unbind(".tabs").add(this.panels).each(function(){e.data(this,"destroy.tabs")?e(this).remove():e(this).removeClass(["ui-state-default","ui-corner-top","ui-tabs-selected","ui-state-active","ui-state-hover","ui-state-focus","ui-state-disabled","ui-tabs-panel","ui-widget-content","ui-corner-bottom","ui-tabs-hide"].join(" "))}),t.cookie&&this._cookie(null,t.cookie),this},add:function(n,r,i){i===t&&(i=this.anchors.length);var s=this,o=this.options,u=e(o.tabTemplate.replace(/#\{href\}/g,n).replace(/#\{label\}/g,r)),a=n.indexOf("#")?this._tabId(e("a",u)[0]):n.replace("#","");u.addClass("ui-state-default ui-corner-top").data("destroy.tabs",!0);var f=s.element.find("#"+a);return f.length||(f=e(o.panelTemplate).attr("id",a).data("destroy.tabs",!0)),f.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide"),i>=this.lis.length?(u.appendTo(this.list),f.appendTo(this.list[0].parentNode)):(u.insertBefore(this.lis[i]),f.insertBefore(this.panels[i])),o.disabled=e.map(o.disabled,function(e,t){return e>=i?++e:e}),this._tabify(),this.anchors.length==1&&(o.selected=0,u.addClass("ui-tabs-selected ui-state-active"),f.removeClass("ui-tabs-hide"),this.element.queue("tabs",function(){s._trigger("show",null,s._ui(s.anchors[0],s.panels[0]))}),this.load(0)),this._trigger("add",null,this._ui(this.anchors[i],this.panels[i])),this},remove:function(t){t=this._getIndex(t);var n=this.options,r=this.lis.eq(t).remove(),i=this.panels.eq(t).remove();return r.hasClass("ui-tabs-selected")&&this.anchors.length>1&&this.select(t+(t+1<this.anchors.length?1:-1)),n.disabled=e.map(e.grep(n.disabled,function(e,n){return e!=t}),function(e,n){return e>=t?--e:e}),this._tabify(),this._trigger("remove",null,this._ui(r.find("a")[0],i[0])),this},enable:function(t){t=this._getIndex(t);var n=this.options;if(e.inArray(t,n.disabled)==-1)return;return this.lis.eq(t).removeClass("ui-state-disabled"),n.disabled=e.grep(n.disabled,function(e,n){return e!=t}),this._trigger("enable",null,this._ui(this.anchors[t],this.panels[t])),this},disable:function(e){e=this._getIndex(e);var t=this,n=this.options;return e!=n.selected&&(this.lis.eq(e).addClass("ui-state-disabled"),n.disabled.push(e),n.disabled.sort(),this._trigger("disable",null,this._ui(this.anchors[e],this.panels[e]))),this},select:function(e){e=this._getIndex(e);if(e==-1){if(!this.options.collapsible||this.options.selected==-1)return this;e=this.options.selected}return this.anchors.eq(e).trigger(this.options.event+".tabs"),this},load:function(t){t=this._getIndex(t);var n=this,r=this.options,i=this.anchors.eq(t)[0],s=e.data(i,"load.tabs");this.abort();if(!s||this.element.queue("tabs").length!==0&&e.data(i,"cache.tabs")){this.element.dequeue("tabs");return}this.lis.eq(t).addClass("ui-state-processing");if(r.spinner){var o=e("span",i);o.data("label.tabs",o.html()).html(r.spinner)}return this.xhr=e.ajax(e.extend({},r.ajaxOptions,{url:s,success:function(s,o){n.element.find(n._sanitizeSelector(i.hash)).html(s),n._cleanup(),r.cache&&e.data(i,"cache.tabs",!0),n._trigger("load",null,n._ui(n.anchors[t],n.panels[t]));try{r.ajaxOptions.success(s,o)}catch(u){}},error:function(e,s,o){n._cleanup(),n._trigger("load",null,n._ui(n.anchors[t],n.panels[t]));try{r.ajaxOptions.error(e,s,t,i)}catch(o){}}})),n.element.dequeue("tabs"),this},abort:function(){return this.element.queue([]),this.panels.stop(!1,!0),this.element.queue("tabs",this.element.queue("tabs").splice(-2,2)),this.xhr&&(this.xhr.abort(),delete this.xhr),this._cleanup(),this},url:function(e,t){return this.anchors.eq(e).removeData("cache.tabs").data("load.tabs",t),this},length:function(){return this.anchors.length}}),e.extend(e.ui.tabs,{version:"1.8.23"}),e.extend(e.ui.tabs.prototype,{rotation:null,rotate:function(e,t){var n=this,r=this.options,i=n._rotate||(n._rotate=function(t){clearTimeout(n.rotation),n.rotation=setTimeout(function(){var e=r.selected;n.select(++e<n.anchors.length?e:0)},e),t&&t.stopPropagation()}),s=n._unrotate||(n._unrotate=t?function(e){i()}:function(e){e.clientX&&n.rotate(null)});return e?(this.element.bind("tabsshow",i),this.anchors.bind
:"#F0FFFF",beige:"#F5F5DC",bisque:"#FFE4C4",black:"#000000",blanchedalmond:"#FFEBCD",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",gainsboro:"#DCDCDC",ghostwhite:"#F8F8FF",gold:"#FFD700",goldenrod:"#DAA520",grey:"#808080",greenyellow:"#ADFF2F",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",lightgreen:"#90EE90",lightgrey:"#D3D3D3",lightpink:"#FFB6C1",lightsalmon:"#FFA07A",lightseagreen:"#20B2AA",lightskyblue:"#87CEFA",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#B0C4DE",lightyellow:"#FFFFE0",limegreen:"#32CD32",linen:"#FAF0E6",magenta:"#FF00FF",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",oldlace:"#FDF5E6",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",rosybrown:"#BC8F8F",royalblue:"#4169E1",saddlebrown:"#8B4513",salmon:"#FA8072",sandybrown:"#F4A460",seagreen:"#2E8B57",seashell:"#FFF5EE",sienna:"#A0522D",skyblue:"#87CEEB",slateblue:"#6A5ACD",slategray:"#708090",slategrey:"#708090",snow:"#FFFAFA",springgreen:"#00FF7F",steelblue:"#4682B4",tan:"#D2B48C",thistle:"#D8BFD8",tomato:"#FF6347",turquoise:"#40E0D0",violet:"#EE82EE",wheat:"#F5DEB3",whitesmoke:"#F5F5F5",yellowgreen:"#9ACD32"},O={},_={style:"normal",variant:"normal",weight:"normal",size:10,family:"sans-serif"},D={},j={butt:"flat",round:"round"},q=I.prototype;q.clearRect=function(){this.textMeasureEl_&&(this.textMeasureEl_.removeNode(!0),this.textMeasureEl_=null),this.element_.innerHTML=""},q.beginPath=function(){this.currentPath_=[]},q.moveTo=function(e,t){var n=W(this,e,t);this.currentPath_.push({type:"moveTo",x:n.x,y:n.y}),this.currentX_=n.x,this.currentY_=n.y},q.lineTo=function(e,t){var n=W(this,e,t);this.currentPath_.push({type:"lineTo",x:n.x,y:n.y}),this.currentX_=n.x,this.currentY_=n.y},q.bezierCurveTo=function(e,t,n,r,i,s){var o=W(this,i,s),u=W(this,e,t),a=W(this,n,r);R(this,u,a,o)},q.quadraticCurveTo=function(e,t,n,r){var i=W(this,e,t),s=W(this,n,r),o={x:this.currentX_+2/3*(i.x-this.currentX_),y:this.currentY_+2/3*(i.y-this.currentY_)},u={x:o.x+(s.x-this.currentX_)/3,y:o.y+(s.y-this.currentY_)/3};R(this,o,u,s)},q.arc=function(e,t,i,s,a,f){i*=o;var l=f?"at":"wa",c=e+r(s)*i-u,h=t+n(s)*i-u,p=e+r(a)*i-u,d=t+n(a)*i-u;c==p&&!f&&(c+=.125);var v=W(this,e,t),m=W(this,c,h),g=W(this,p,d);this.currentPath_.push({type:l,x:v.x,y:v.y,radius:i,xStart:m.x,yStart:m.y,xEnd:g.x,yEnd:g.y})},q.rect=function(e,t,n,r){this.moveTo(e,t),this.lineTo(e+n,t),this.lineTo(e+n,t+r),this.lineTo(e,t+r),this.closePath()},q.strokeRect=function(e,t,n,r){var i=this.currentPath_;this.beginPath(),this.moveTo(e,t),this.lineTo(e+n,t),this.lineTo(e+n,t+r),this.lineTo(e,t+r),this.closePath(),this.stroke(),this.currentPath_=i},q.
this.move||this.onClick(n.getNode()),this.down=this.move=!1},getRestoredStyles:function(e,t){var n={},r=this["nodeStylesOn"+t];for(var i in r)n[i]=e.styles["$"+i];return n},toggleStylesOnHover:function(e,t){this.nodeStylesOnHover&&this.toggleStylesOn("Hover",e,t)},toggleStylesOnClick:function(e,t){this.nodeStylesOnClick&&this.toggleStylesOn("Click",e,t)},toggleStylesOn:function(t,r,i){var s=this.viz,o=this.nStyles;if(i){var u=this;r.styles||(r.styles=e.merge(r.data,{}));for(var a in this["nodeStylesOn"+t]){var f="$"+a;f in r.styles||(r.styles[f]=r.getData(a))}s.fx.nodeFx(e.extend({elements:{id:r.id,properties:u["nodeStylesOn"+t]},transition:n.Quart.easeOut,duration:300,fps:40},this.config))}else{var l=this.getRestoredStyles(r,t);s.fx.nodeFx(e.extend({elements:{id:r.id,properties:l},transition:n.Quart.easeOut,duration:300,fps:40},this.config))}},onClick:function(e){if(!e)return;var t=this.nodeStylesOnClick;if(!t)return;e.selected?(this.toggleStylesOnClick(e,!1),delete e.selected):(this.viz.graph.eachNode(function(e){if(e.selected){for(var n in t)e.setData(n,e.styles["$"+n],"end");delete e.selected}}),this.toggleStylesOnClick(e,!0),e.selected=!0,delete e.hovered,this.hoveredNode=!1)},onMouseMove:function(e,t,n){this.down&&(this.move=!0);if(this.dom&&this.isLabel(e,t))return;var r=this.nodeStylesOnHover;if(!r)return;if(!this.dom){if(this.hoveredNode){var i=this.types[this.hoveredNode.getData("type")],s=i&&i.contains&&i.contains.call(this.fx,this.hoveredNode,n.getPos());if(s)return}var o=n.getNode();if(!this.hoveredNode&&!o)return;if(o.hovered)return;o&&!o.selected?(this.fx.nodeFxAnimation.stopTimer(),this.viz.graph.eachNode(function(e){if(e.hovered&&!e.selected){for(var t in r)e.setData(t,e.styles["$"+t],"end");delete e.hovered}}),o.hovered=!0,this.hoveredNode=o,this.toggleStylesOnHover(o,!0)):this.hoveredNode&&!this.hoveredNode.selected&&(this.fx.nodeFxAnimation.stopTimer(),this.toggleStylesOnHover(this.hoveredNode,!1),delete this.hoveredNode.hovered,this.hoveredNode=!1)}}}),a.Classes.Navigation=new t({Implements:[s,o],initializePost:function(){this.pos=!1,this.pressed=!1},onMouseWheel:function(t,n,r){if(!this.config.zooming)return;e.event.stop(e.event.get(t,n));var i=this.config.zooming/1e3,s=1+r*i;this.canvas.scale(s,s)},onMouseDown:function(e,t,n){if(!this.config.panning)return;if(this.config.panning=="avoid nodes"&&n.getNode())return;this.pressed=!0,this.pos=n.getPos();var r=this.canvas,i=r.translateOffsetX,s=r.translateOffsetY,o=r.scaleOffsetX,u=r.scaleOffsetY;this.pos.x*=o,this.pos.x+=i,this.pos.y*=u,this.pos.y+=s},onMouseMove:function(e,t,n){if(!this.config.panning)return;if(!this.pressed)return;if(this.config.panning=="avoid nodes"&&n.getNode())return;var r=this.pos,i=n.getPos(),s=this.canvas,o=s.translateOffsetX,u=s.translateOffsetY,a=s.scaleOffsetX,f=s.scaleOffsetY;i.x*=a,i.y*=f,i.x+=o,i.y+=u;var l=i.x-r.x,c=i.y-r.y;this.pos=i,this.canvas.translate(l*1/a,c*1/f)},onMouseUp:function(e,t,n,r){if(!this.config.panning)return;this.pressed=!1}});var f;(function(){function i(t,n){var i=document.createElement(t);for(var s in n)typeof n[s]=="object"?e.extend(i[s],n[s]):i[s]=n[s];return t=="canvas"&&!r&&G_vmlCanvasManager&&(i=G_vmlCanvasManager.initElement(document.body.appendChild(i))),i}var n=typeof HTMLCanvasElement,r=n=="object"||n=="function";$jit.Canvas=f=new t({canvases:[],pos:!1,element:!1,labelContainer:!1,translateOffsetX:0,translateOffsetY:0,scaleOffsetX:1,scaleOffsetY:1,initialize:function(t,n){this.viz=t,this.opt=n;var r=e.type(n.injectInto)=="string"?n.injectInto:n.injectInto.id,s=r+"-label",o=e(r),u=n.width||o.offsetWidth,a=n.height||o.offsetHeight;this.id=r;var l={injectInto:r,width:u,height:a};this.element=i("div",{id:r+"-canvaswidget",style:{position:"relative",width:u+"px",height:a+"px"}}),this.labelContainer=this.createLabelContainer(n.Label.type,s,l),this.canvases.push(new f.Base({config:e.extend({idSuffix:"-canvas"},l),plot:function(e){t.fx.plot()},resize:function(){t.refresh()}}));var c=n.background;if(c){var h=new f.Background[c.type](t,e.extend(c,l));this.canvases.push(new f.Base(h))}var p=this.can
(),!t&&e.onAfterPlotLine(s))}),u.save(),n.drawn&&(!t&&e.onBeforePlotNode(n),o.plotNode(n,i,t),!t&&e.onAfterPlotNode(n)),!o.labelsHidden&&e.withLabels&&(n.drawn&&r>=.95?o.labels.plotLabel(i,n,e):o.labels.hideLabel(n,!1)),u.restore(),n.visited=!l})},plotTree:function(e,t,n){var r=this,i=this.viz,s=i.canvas,o=this.config,u=s.getCtx(),a=e.getData("alpha");e.eachSubnode(function(i){if(t.plotSubtree(e,i)&&i.exist&&i.drawn){var o=e.getAdjacency(i.id);!n&&t.onBeforePlotLine(o),u.globalAlpha=Math.min(a,i.getData("alpha")),r.plotLine(o,s,n),!n&&t.onAfterPlotLine(o),r.plotTree(i,t,n)}}),e.drawn?(!n&&t.onBeforePlotNode(e),this.plotNode(e,s,n),!n&&t.onAfterPlotNode(e),!t.hideLabels&&t.withLabels&&a>=.95?this.labels.plotLabel(s,e,t):this.labels.hideLabel(e,!1)):this.labels.hideLabel(e,!0)},plotNode:function(e,t,n){var r=e.getData("type"),i=this.node.CanvasStyles;if(r!="none"){var s=e.getData("lineWidth"),o=e.getData("color"),u=e.getData("alpha"),a=t.getCtx();a.lineWidth=s,a.fillStyle=a.strokeStyle=o,a.globalAlpha=u;for(var f in i)a[f]=e.getCanvasStyle(f);this.nodeTypes[r].render.call(this,e,t,n)}},plotLine:function(e,t,n){var r=e.getData("type"),i=this.edge.CanvasStyles;if(r!="none"){var s=e.getData("lineWidth"),o=e.getData("color"),u=t.getCtx();u.lineWidth=s,u.fillStyle=u.strokeStyle=o;for(var a in i)u[a]=e.getCanvasStyle(a);this.edgeTypes[r].render.call(this,e,t,n)}}},d.Label={},d.Label.Native=new t({plotLabel:function(e,t,n){var r=e.getCtx(),i=t.pos.getc(!0);r.font=t.getLabelData("style")+" "+t.getLabelData("size")+"px "+t.getLabelData("family"),r.textAlign=t.getLabelData("textAlign"),r.fillStyle=r.strokeStyle=t.getLabelData("color"),r.textBaseline=t.getLabelData("textBaseline"),this.renderLabel(e,t,n)},renderLabel:function(e,t,n){var r=e.getCtx(),i=t.pos.getc(!0);r.fillText(t.name,i.x,i.y+t.getData("height")/2)},hideLabel:e.empty,hideLabels:e.empty}),d.Label.DOM=new t({labelsHidden:!1,labelContainer:!1,labels:{},getLabelContainer:function(){return this.labelContainer?this.labelContainer:this.labelContainer=document.getElementById(this.viz.config.labelContainer)},getLabel:function(e){return e in this.labels&&this.labels[e]!=null?this.labels[e]:this.labels[e]=document.getElementById(e)},hideLabels:function(e){var t=this.getLabelContainer();e?t.style.display="none":t.style.display="",this.labelsHidden=e},clearLabels:function(e){for(var t in this.labels)if(e||!this.viz.graph.hasNode(t))this.disposeLabel(t),delete this.labels[t]},disposeLabel:function(e){var t=this.getLabel(e);t&&t.parentNode&&t.parentNode.removeChild(t)},hideLabel:function(t,n){t=e.splat(t);var r=n?"":"none",i,s=this;e.each(t,function(e){var t=s.getLabel(e.id);t&&(t.style.display=r)})},fitsInCanvas:function(e,t){var n=t.getSize();return e.x>=n.width||e.x<0||e.y>=n.height||e.y<0?!1:!0}}),d.Label.HTML=new t({Implements:d.Label.DOM,plotLabel:function(e,t,n){var r=t.id,i=this.getLabel(r);if(!i&&!(i=document.getElementById(r))){i=document.createElement("div");var s=this.getLabelContainer();i.id=r,i.className="node",i.style.position="absolute",n.onCreateLabel(i,t),s.appendChild(i),this.labels[t.id]=i}this.placeLabel(i,t,n)}}),d.Label.SVG=new t({Implements:d.Label.DOM,plotLabel:function(e,t,n){var r=t.id,i=this.getLabel(r);if(!i&&!(i=document.getElementById(r))){var s="http://www.w3.org/2000/svg";i=document.createElementNS(s,"svg:text");var o=document.createElementNS(s,"svg:tspan");i.appendChild(o);var u=this.getLabelContainer();i.setAttribute("id",r),i.setAttribute("class","node"),u.appendChild(i),n.onCreateLabel(i,t),this.labels[t.id]=i}this.placeLabel(i,t,n)}}),d.Geom=new t({initialize:function(e){this.viz=e,this.config=e.config,this.node=e.config.Node,this.edge=e.config.Edge},translate:function(t,n){n=e.splat(n),this.viz.graph.eachNode(function(r){e.each(n,function(e){r.getPos(e).$add(t)})})},setRightLevelToShow:function(t,n,r){var i=this.getRightLevelToShow(t,n),s=this.viz.labels,o=e.merge({execShow:!0,execHide:!0,onHide:e.empty,onShow:e.empty},r||{});t.eachLevel(0,this.config.levelsToShow,function(e){var n=e._depth-t._depth;n>i?(o.onHide(e),o.execHide&&(e.drawn=!1,e.e
.busy=!0;var r=this.st,i=r.graph,s=t.label&&e.splat(t.label),o=t.values,u=this.config.animate,a=this;e.each(o,function(t){var n=i.getByName(t.label);if(n){t.values=e.splat(t.values);var r=n.getData("stringArray"),o=n.getData("valueArray");e.each(o,function(e,n){e[0]=t.values[n],s&&(r[n]=s[n])}),n.setData("valueArray",o);var u=n.getData("prev"),a=n.getData("next"),f=i.getByName(a);if(u){var l=i.getByName(u);if(l){var o=l.getData("valueArray");e.each(o,function(e,n){e[1]=t.values[n]})}}if(!f){var o=n.getData("valueArray");e.each(o,function(e,n){e[1]=t.values[n]})}}}),this.normalizeDims(),r.compute(),r.select(r.root),u&&r.fx.animate({modes:["node-property:height:dimArray"],duration:1500,onComplete:function(){a.busy=!1,n&&n.onComplete()}})},filter:function(){if(this.busy)return;this.busy=!0,this.config.Tips.enable&&this.st.tips.hide(),this.select(!1,!1,!1);var t=Array.prototype.slice.call(arguments),n=this.st.graph.getNode(this.st.root),r=this;n.eachAdjacency(function(n){var r=n.nodeTo,i=r.getData("dimArray"),s=r.getData("stringArray");r.setData("dimArray",e.map(i,function(n,r){return e.indexOf(t,s[r])>-1?n:[0,0]}),"end")}),this.st.fx.animate({modes:["node-property:dimArray"],duration:1500,onComplete:function(){r.busy=!1}})},restore:function(){if(this.busy)return;this.busy=!0,this.config.Tips.enable&&this.st.tips.hide(),this.select(!1,!1,!1),this.normalizeDims();var e=this;this.st.fx.animate({modes:["node-property:height:dimArray"],duration:1500,onComplete:function(){e.busy=!1}})},select:function(e,t,n){if(!this.config.selectOnHover)return;var r=this.selected;if(r.id!=e||r.name!=t||r.index!=n){r.id=e,r.name=t,r.index=n,this.st.graph.eachNode(function(e){e.setData("border",!1)});if(e){var i=this.st.graph.getNode(e);i.setData("border",r);var s=n===0?"prev":"next";s=i.getData(s),s&&(i=this.st.graph.getByName(s),i&&i.setData("border",{name:t,index:1-n}))}this.st.plot()}},getLegend:function(){var t={},n;this.st.graph.getNode(this.st.root).eachAdjacency(function(e){n=e.nodeTo});var r=n.getData("colorArray"),i=r.length;return e.each(n.getData("stringArray"),function(e,n){t[e]=r[n%i]}),t},getMaxValue:function(){var t=0;return this.st.graph.eachNode(function(n){var r=n.getData("valueArray"),i=0,s=0;e.each(r,function(e){i+=+e[0],s+=+e[1]});var o=s>i?s:i;t=t>o?t:o}),t},normalizeDims:function(){var t=this.st.graph.getNode(this.st.root),n=0;t.eachAdjacency(function(){n++});var r=this.getMaxValue()||1,i=this.st.canvas.getSize(),s=this.config,o=s.Margin,u=s.labelOffset+s.Label.size,a=(i.width-(o.left+o.right))/n,f=s.animate,l=i.height-(o.top+o.bottom)-(s.showAggregates&&u)-(s.showLabels&&u);this.st.graph.eachNode(function(t){var n=0,i=0,s=[];e.each(t.getData("valueArray"),function(e){n+=+e[0],i+=+e[1],s.push([0,0])});var o=i>n?i:n;t.setData("width",a);if(f){t.setData("height",o*l/r,"end"),t.setData("dimArray",e.map(t.getData("valueArray"),function(e){return[e[0]*l/r,e[1]*l/r]}),"end");var u=t.getData("dimArray");u||t.setData("dimArray",s)}else t.setData("height",o*l/r),t.setData("dimArray",e.map(t.getData("valueArray"),function(e){return[e[0]*l/r,e[1]*l/r]}))})}}),i.BarChart={$extend:!0,animate:!0,type:"stacked",labelOffset:3,barsOffset:0,hoveredColor:"#9fd4ff",orientation:"horizontal",showAggregates:!0,showLabels:!0,Tips:{enable:!1,onShow:e.empty,onHide:e.empty},Events:{enable:!1,onClick:e.empty}},$jit.ST.Plot.NodeTypes.implement({"barchart-stacked":{render:function(t,n){var r=t.pos.getc(!0),i=t.getData("width"),s=t.getData("height"),o=this.getAlignedPos(r,i,s),u=o.x,a=o.y,f=t.getData("dimArray"),l=t.getData("valueArray"),c=t.getData("colorArray"),h=c.length,p=t.getData("stringArray"),d=n.getCtx(),v={},m=t.getData("border"),g=t.getData("gradient"),y=t.getData("config"),b=y.orientation=="horizontal",w=y.showAggregates,E=y.showLabels,S=y.Label;if(c&&f&&p){for(var x=0,T=f.length,N=0,C=0;x<T;x++){d.fillStyle=d.strokeStyle=c[x%h];if(g){var k;b?k=d.createLinearGradient(u+N+f[x]/2,a,u+N+f[x]/2,a+s):k=d.createLinearGradient(u,a-N-f[x]/2,u+i,a-N-f[x]/2);var L=e.rgbToHex(e.map(e.hexToRgb(c[x%h].slice(1)),function(e){return e*.5>>0}));k.addColorSto
this.layoutV(e,t,n,r):this.layoutH(e,t,n,r)},layoutV:function(t,n,r,i){var s=0,o=function(e){return e};e.each(t,function(e){s+=e._area});var u=o(s/n),a=0;for(var f=0,l=t.length;f<l;f++){var c=o(t[f]._area/u),h=t[f];h.getPos(i).setc(r.left,r.top+a),h.setData("width",u,i),h.setData("height",c,i),a+=c}var p={height:r.height,width:r.width-u,top:r.top,left:r.left+u};return p.dim=Math.min(p.width,p.height),p.dim!=p.height&&this.layout.change(),p},layoutH:function(t,n,r,i){var s=0;e.each(t,function(e){s+=e._area});var o=s/n,u=r.top,a=0;for(var f=0,l=t.length;f<l;f++){var c=t[f],n=c._area/o;c.getPos(i).setc(r.left+a,u),c.setData("width",n,i),c.setData("height",o,i),a+=n}var h={height:r.height-o,width:r.width,top:r.top+o,left:r.left};return h.dim=Math.min(h.width,h.height),h.dim!=h.width&&this.layout.change(),h}}),b.TM.Strip=new t({Implements:b.TM.Area,computePositions:function(e,t,n){var r=e.getSubnodes([1,1],"ignore"),i=this.config;if(r.length>0){this.processChildrenLayout(e,r,t,n);for(var s=0,o=r.length;s<o;s++){var u=r[s],a=i.offset,f=u.getData("height",n)-a-i.titleHeight,l=u.getData("width",n)-a,c=u.getPos(n);t={width:l,height:f,top:c.y+i.titleHeight,left:c.x},this.computePositions(u,t,n)}}},processChildrenLayout:function(e,t,n,r){var i=n.width*n.height,s,o=t.length,u=0,a=[];for(s=0;s<o;s++)a[s]=+t[s].getData("area",r),u+=a[s];for(s=0;s<o;s++)t[s]._area=i*a[s]/u;var f=this.layout.horizontal()?n.width:n.height,l=[t[0]],c=t.slice(1);this.stripify(c,l,f,n,r)},stripify:function(e,t,n,r,i){this.computeDim(e,t,n,r,this.avgAspectRatio,i)},layoutRow:function(e,t,n,r){return this.layout.horizontal()?this.layoutH(e,t,n,r):this.layoutV(e,t,n,r)},layoutV:function(t,n,r,i){var s=0;e.each(t,function(e){s+=e._area});var o=s/n,u=0;for(var a=0,f=t.length;a<f;a++){var l=t[a],c=l._area/o;l.getPos(i).setc(r.left,r.top+(n-c-u)),l.setData("width",o,i),l.setData("height",c,i),u+=c}return{height:r.height,width:r.width-o,top:r.top,left:r.left+o,dim:n}},layoutH:function(t,n,r,i){var s=0;e.each(t,function(e){s+=e._area});var o=s/n,u=r.height-o,a=0;for(var f=0,l=t.length;f<l;f++){var c=t[f],h=c._area/o;c.getPos(i).setc(r.left+a,r.top+u),c.setData("width",h,i),c.setData("height",o,i),a+=h}return{height:r.height-o,width:r.width,top:r.top,left:r.left,dim:n}}}),b.Icicle=new t({compute:function(e){e=e||"current";var t=this.graph.getNode(this.root),n=this.config,r=this.canvas.getSize(),i=r.width,s=r.height,o=n.offset,u=n.constrained?n.levelsToShow:Number.MAX_VALUE;this.controller.onBeforeCompute(t),d.Util.computeLevels(this.graph,t.id,0,"ignore");var a=0;d.Util.eachLevel(t,0,!1,function(e,t){t>a&&(a=t)});var f=this.graph.getNode(this.clickedNode&&this.clickedNode.id||t.id),l=Math.min(a,u-1),c=f._depth;this.layout.horizontal()?this.computeSubtree(f,-i/2,-s/2,i/(l+1),s,c,l,e):this.computeSubtree(f,-i/2,-s/2,i,s/(l+1),c,l,e)},computeSubtree:function(t,n,r,i,s,o,u,a){t.getPos(a).setc(n,r),t.setData("width",i,a),t.setData("height",s,a);var f,l=0,c=0,h=d.Util.getSubnodes(t,[1,1]);if(!h.length)return;e.each(h,function(e){c+=e.getData("dim")});for(var p=0,v=h.length;p<v;p++)this.layout.horizontal()?(f=s*h[p].getData("dim")/c,this.computeSubtree(h[p],n+i,r,i,f,o,u,a),r+=f):(f=i*h[p].getData("dim")/c,this.computeSubtree(h[p],n,r+s,f,s,o,u,a),n+=f)}}),$jit.Icicle=new t({Implements:[y,a,b.Icicle],layout:{orientation:"h",vertical:function(){return this.orientation=="v"},horizontal:function(){return this.orientation=="h"},change:function(){this.orientation=this.vertical()?"h":"v"}},initialize:function(t){var n={animate:!1,orientation:"h",offset:2,levelsToShow:Number.MAX_VALUE,constrained:!1,Node:{type:"rectangle",overridable:!0},Edge:{type:"none"},Label:{type:"Native"},duration:700,fps:45},r=i("Canvas","Node","Edge","Fx","Tips","NodeStyles","Events","Navigation","Controller","Label");this.controller=this.config=e.merge(r,n,t),this.layout.orientation=this.config.orientation;var s=this.config;s.useCanvas?(this.canvas=s.useCanvas,this.config.labelContainer=this.canvas.id+"-label"):(this.canvas=new f(this,s),this.config.labelContainer=(typeof s.injectInto=="string"?s.injectI
:function(e,t){var n=e.pos.getc().$scale(e.scale),r=e.getData("width"),i=e.getData("height");this.nodeHelper.ellipse.render("fill",n,r,i,t)},contains:function(e,t){var n=e.getData("width"),r=e.getData("height"),i=e.pos.getc().$scale(e.scale);return this.nodeHelper.circle.contains(i,t,n,r)}},square:{render:function(e,t){var n=this.node,r=e.getData("dim"),i=e.pos.getc();r=n.transform?r*(1-i.squaredNorm()):r,i.$scale(e.scale),r>.2&&this.nodeHelper.square.render("fill",i,r,t)},contains:function(e,t){var n=e.getData("dim"),r=e.pos.getc().$scale(e.scale);return this.nodeHelper.square.contains(r,t,n)}},rectangle:{render:function(e,t){var n=this.node,r=e.getData("width"),i=e.getData("height"),s=e.pos.getc();r=n.transform?r*(1-s.squaredNorm()):r,i=n.transform?i*(1-s.squaredNorm()):i,s.$scale(e.scale),r>.2&&i>.2&&this.nodeHelper.rectangle.render("fill",s,r,i,t)},contains:function(e,t){var n=e.getData("width"),r=e.getData("height"),i=e.pos.getc().$scale(e.scale);return this.nodeHelper.square.contains(i,t,n,r)}},triangle:{render:function(e,t){var n=this.node,r=e.getData("dim"),i=e.pos.getc();r=n.transform?r*(1-i.squaredNorm()):r,i.$scale(e.scale),r>.2&&this.nodeHelper.triangle.render("fill",i,r,t)},contains:function(e,t){var n=e.getData("dim"),r=e.pos.getc().$scale(e.scale);return this.nodeHelper.triangle.contains(r,t,n)}},star:{render:function(e,t){var n=this.node,r=e.getData("dim"),i=e.pos.getc();r=n.transform?r*(1-i.squaredNorm()):r,i.$scale(e.scale),r>.2&&this.nodeHelper.star.render("fill",i,r,t)},contains:function(e,t){var n=e.getData("dim"),r=e.pos.getc().$scale(e.scale);return this.nodeHelper.star.contains(r,t,n)}}}),n.Plot.EdgeTypes=new t({none:e.empty,line:{render:function(e,t){var n=e.nodeFrom.pos.getc(!0),r=e.nodeTo.pos.getc(!0),i=e.nodeFrom.scale;this.edgeHelper.line.render({x:n.x*i,y:n.y*i},{x:r.x*i,y:r.y*i},t)},contains:function(e,t){var n=e.nodeFrom.pos.getc(!0),r=e.nodeTo.pos.getc(!0),i=e.nodeFrom.scale;this.edgeHelper.line.contains({x:n.x*i,y:n.y*i},{x:r.x*i,y:r.y*i},t,this.edge.epsilon)}},arrow:{render:function(e,t){var n=e.nodeFrom.pos.getc(!0),r=e.nodeTo.pos.getc(!0),i=e.nodeFrom.scale,s=e.getData("dim"),o=e.data.$direction,u=o&&o.length>1&&o[0]!=e.nodeFrom.id;this.edgeHelper.arrow.render({x:n.x*i,y:n.y*i},{x:r.x*i,y:r.y*i},s,u,t)},contains:function(e,t){var n=e.nodeFrom.pos.getc(!0),r=e.nodeTo.pos.getc(!0),i=e.nodeFrom.scale;this.edgeHelper.arrow.contains({x:n.x*i,y:n.y*i},{x:r.x*i,y:r.y*i},t,this.edge.epsilon)}},hyperline:{render:function(e,t){var n=e.nodeFrom.pos.getc(),r=e.nodeTo.pos.getc(),i=this.viz.getRadius();this.edgeHelper.hyperline.render(n,r,i,t)},contains:e.lambda(!1)}})}($jit.Hypertree)})(),function(){window.$jit=function(e){e=e||window;for(var t in $jit)$jit[t].$extend&&(e[t]=$jit[t])},$jit.version="2.0.0b";var e=function(e){return document.getElementById(e)};e.empty=function(){},e.extend=function(e,t){for(var n in t||{})e[n]=t[n];return e},e.lambda=function(e){return typeof e=="function"?e:function(){return e}},e.time=Date.now||function(){return+(new Date)},e.splat=function(t){var n=e.type(t);return n?n!="array"?[t]:t:[]},e.type=function(t){var n=e.type.s.call(t).match(/^\[object\s(.*)\]$/)[1].toLowerCase();return n!="object"?n:t&&t.$$family?t.$$family:t&&t.nodeName&&t.nodeType==1?"element":n},e.type.s=Object.prototype.toString,e.each=function(t,n){var r=e.type(t);if(r=="object")for(var i in t)n(t[i],i);else for(var s=0,o=t.length;s<o;s++)n(t[s],s)},e.indexOf=function(e,t){if(Array.indexOf)return e.indexOf(t);for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},e.map=function(t,n){var r=[];return e.each(t,function(e,t){r.push(n(e,t))}),r},e.reduce=function(e,t,n){var r=e.length;if(r==0)return n;var i=arguments.length==3?n:e[--r];while(r--)i=t(i,e[r]);return i},e.merge=function(){var t={};for(var n=0,r=arguments.length;n<r;n++){var i=arguments[n];if(e.type(i)!="object")continue;for(var s in i){var o=i[s],u=t[s];t[s]=u&&e.type(o)=="object"&&e.type(u)=="object"?e.merge(u,o):e.unlink(o)}}return t},e.unlink=function(t){var n;switch(e.type(t)){case"object":n={};for(var r in t)n[r]=e.unlink(t[r
var r=this.edges[e.id]=this.edges[e.id]||{},i=this.edges[t.id]=this.edges[t.id]||{};return r[t.id]=i[e.id]=new d.Adjacence(e,t,n,this.Edge,this.Label),r[t.id]}return this.edges[e.id][t.id]},removeNode:function(e){if(this.hasNode(e)){delete this.nodes[e];var t=this.edges[e];for(var n in t)delete this.edges[n][e];delete this.edges[e]}},removeAdjacence:function(e,t){delete this.edges[e][t],delete this.edges[t][e]},hasNode:function(e){return e in this.nodes},empty:function(){this.nodes={},this.edges={}}});var d=$jit.Graph,v;(function(){var t=function(e,t,n,r,i){var s;n=n||"current",e="$"+(e?e+"-":""),n=="current"?s=this.data:n=="start"?s=this.startData:n=="end"&&(s=this.endData);var o=e+t;return r?s[o]:this.Config.overridable?o in s?s[o]:o in this.data?this.data[o]:i[t]||0:i[t]||0},n=function(e,t,n,r){r=r||"current",e="$"+(e?e+"-":"");var i;r=="current"?i=this.data:r=="start"?i=this.startData:r=="end"&&(i=this.endData),i[e+t]=n},r=function(t,n){t="$"+(t?t+"-":"");var r=this;e.each(n,function(e){var n=t+e;delete r.data[n],delete r.endData[n],delete r.startData[n]})};v={getData:function(e,n,r){return t.call(this,"",e,n,r,this.Config)},setData:function(e,t,r){n.call(this,"",e,t,r)},setDataset:function(t,n){t=e.splat(t);for(var r in n)for(var i=0,s=e.splat(n[r]),o=t.length;i<o;i++)this.setData(r,s[i],t[i])},removeData:function(){r.call(this,"",Array.prototype.slice.call(arguments))},getCanvasStyle:function(e,n,r){return t.call(this,"canvas",e,n,r,this.Config.CanvasStyles)},setCanvasStyle:function(e,t,r){n.call(this,"canvas",e,t,r)},setCanvasStyles:function(t,n){t=e.splat(t);for(var r in n)for(var i=0,s=e.splat(n[r]),o=t.length;i<o;i++)this.setCanvasStyle(r,s[i],t[i])},removeCanvasStyle:function(){r.call(this,"canvas",Array.prototype.slice.call(arguments))},getLabelData:function(e,n,r){return t.call(this,"label",e,n,r,this.Label)},setLabelData:function(e,t,r){n.call(this,"label",e,t,r)},setLabelDataset:function(t,n){t=e.splat(t);for(var r in n)for(var i=0,s=e.splat(n[r]),o=t.length;i<o;i++)this.setLabelData(r,s[i],t[i])},removeLabelData:function(){r.call(this,"label",Array.prototype.slice.call(arguments))}}})(),d.Node=new t({initialize:function(t,n,r,i,s){var o={id:"",name:"",data:{},startData:{},endData:{},adjacencies:{},selected:!1,drawn:!1,exist:!1,angleSpan:{begin:0,end:0},pos:n&&p(0,0)||c(0,0),startPos:n&&p(0,0)||c(0,0),endPos:n&&p(0,0)||c(0,0)};e.extend(this,e.extend(o,t)),this.Config=this.Node=r,this.Edge=i,this.Label=s},adjacentTo:function(e){return e.id in this.adjacencies},getAdjacency:function(e){return this.adjacencies[e]},getPos:function(e){e=e||"current";if(e=="current")return this.pos;if(e=="end")return this.endPos;if(e=="start")return this.startPos},setPos:function(e,t){t=t||"current";var n;t=="current"?n=this.pos:t=="end"?n=this.endPos:t=="start"&&(n=this.startPos),n.set(e)}}),d.Node.implement(v),d.Adjacence=new t({initialize:function(e,t,n,r,i){this.nodeFrom=e,this.nodeTo=t,this.data=n||{},this.startData={},this.endData={},this.Config=this.Edge=r,this.Label=i}}),d.Adjacence.implement(v),d.Util={filter:function(t){if(!t||e.type(t)!="string")return function(){return!0};var n=t.split(" ");return function(e){for(var t=0;t<n.length;t++)if(e[n[t]])return!1;return!0}},getNode:function(e,t){return e.nodes[t]},eachNode:function(e,t,n){var r=this.filter(n);for(var i in e.nodes)r(e.nodes[i])&&t(e.nodes[i])},eachAdjacency:function(e,t,n){var r=e.adjacencies,i=this.filter(n);for(var s in r){var o=r[s];if(i(o)){if(o.nodeFrom!=e){var u=o.nodeFrom;o.nodeFrom=o.nodeTo,o.nodeTo=u}t(o,s)}}},computeLevels:function(e,t,n,r){n=n||0;var i=this.filter(r);this.eachNode(e,function(e){e._flag=!1,e._depth=-1},r);var s=e.getNode(t);s._depth=n;var o=[s];while(o.length!=0){var u=o.pop();u._flag=!0,this.eachAdjacency(u,function(e){var t=e.nodeTo;t._flag==0&&i(t)&&(t._depth<0&&(t._depth=u._depth+1+n),o.unshift(t))},r)}},eachBFS:function(e,t,n,r){var i=this.filter(r);this.clean(e);var s=[e.getNode(t)];while(s.length!=0){var o=s.pop();o._flag=!0,n(o,o._depth),this.eachAdjacency(o,function(e){var t=e.nodeTo;t._flag==0&&i(t)&&(t._flag=!0,s.unshift
(e);o.x=t.x-s.x,o.y=t.y-s.y;var u=o.norm()||1;i.disp[e].$add(o.$scale(n.nodef(u)/u))})})});var u=!!r.getNode(this.root).visited;r.eachNode(function(r){r.eachAdjacency(function(i){var s=i.nodeTo;!!s.visited===u&&e.each(t,function(e){var t=r.getPos(e),i=s.getPos(e);o.x=t.x-i.x,o.y=t.y-i.y;var u=o.norm()||1;r.disp[e].$add(o.$scale(-n.edgef(u)/u)),s.disp[e].$add(o.$scale(-1))})}),r.visited=!u});var a=n.t,f=n.width/2,l=n.height/2;r.eachNode(function(n){e.each(t,function(e){var t=n.disp[e],r=t.norm()||1,e=n.getPos(e);e.$add(p(t.x*i(Math.abs(t.x),a)/r,t.y*i(Math.abs(t.y),a)/r)),e.x=i(f,s(-f,e.x)),e.y=i(l,s(-l,e.y))})})}}),b.Radial=new t({compute:function(t){var n=e.splat(t||["current","start","end"]);w.compute(this.graph,n,this.config),this.graph.computeLevels(this.root,0,"ignore");var r=this.createLevelDistanceFunc();this.computeAngularWidths(n),this.computePositions(n,r)},computePositions:function(e,t){var n=e,r=this.graph,i=r.getNode(this.root),s=this.parent,o=this.config;for(var u=0,a=n.length;u<a;u++){var f=n[u];i.setPos(c(0,0),f),i.setData("span",Math.PI*2,f)}i.angleSpan={begin:0,end:2*Math.PI},r.eachBFS(this.root,function(e){var r=e.angleSpan.end-e.angleSpan.begin,i=e.angleSpan.begin,o=t(e),u=0,a=[],f={};e.eachSubnode(function(e){u+=e._treeAngularWidth;for(var t=0,r=n.length;t<r;t++){var i=n[t],s=e.getData("dim",i);f[i]=i in f?s>f[i]?s:f[i]:s}a.push(e)},"ignore"),s&&s.id==e.id&&a.length>0&&a[0].dist&&a.sort(function(e,t){return(e.dist>=t.dist)-(e.dist<=t.dist)});for(var l=0,h=a.length;l<h;l++){var p=a[l];if(!p._flag){var d=p._treeAngularWidth/u*r,v=i+d/2;for(var m=0,g=n.length;m<g;m++){var y=n[m];p.setPos(c(v,o),y),p.setData("span",d,y),p.setData("dim-quotient",p.getData("dim",y)/f[y],y)}p.angleSpan={begin:i,end:i+d},i+=d}}},"ignore")},setAngularWidthForNodes:function(e){this.graph.eachBFS(this.root,function(t,n){var r=t.getData("angularWidth",e[0])||5;t._angularWidth=r/n},"ignore")},setSubtreesAngularWidth:function(){var e=this;this.graph.eachNode(function(t){e.setSubtreeAngularWidth(t)},"ignore")},setSubtreeAngularWidth:function(e){var t=this,n=e._angularWidth,r=0;e.eachSubnode(function(e){t.setSubtreeAngularWidth(e),r+=e._treeAngularWidth},"ignore"),e._treeAngularWidth=Math.max(n,r)},computeAngularWidths:function(e){this.setAngularWidthForNodes(e),this.setSubtreesAngularWidth()}}),$jit.ForceDirected=new t({Implements:[y,a,b.ForceDirected],initialize:function(t){var n=$jit.ForceDirected,r={iterations:50,levelDistance:50};this.controller=this.config=e.merge(i("Canvas","Node","Edge","Fx","Tips","NodeStyles","Events","Navigation","Controller","Label"),r,t);var s=this.config;s.useCanvas?(this.canvas=s.useCanvas,this.config.labelContainer=this.canvas.id+"-label"):(s.background&&(s.background=e.merge({type:"Circles"},s.background)),this.canvas=new f(this,s),this.config.labelContainer=(typeof s.injectInto=="string"?s.injectInto:s.injectInto.id)+"-label"),this.graphOptions={complex:!0,Node:{selected:!1,exist:!0,drawn:!0}},this.graph=new d(this.graphOptions,this.config.Node,this.config.Edge),this.labels=new n.Label[s.Label.type](this),this.fx=new n.Plot(this,n),this.op=new n.Op(this),this.json=null,this.busy=!1,this.initializeExtras()},refresh:function(){this.compute(),this.plot()},reposition:function(){this.compute("end")},computeIncremental:function(t){t=e.merge({iter:20,property:"end",onStep:e.empty,onComplete:e.empty},t||{}),this.config.onBeforeCompute(this.graph.getNode(this.root)),this.compute(t.property,t)},plot:function(){this.fx.plot()},animate:function(t){this.fx.animate(e.merge({modes:["linear"]},t||{}))}}),$jit.ForceDirected.$extend=!0,function(n){n.Op=new t({Implements:d.Op}),n.Plot=new t({Implements:d.Plot}),n.Label={},n.Label.Native=new t({Implements:d.Label.Native}),n.Label.SVG=new t({Implements:d.Label.SVG,initialize:function(e){this.viz=e},placeLabel:function(e,t,n){var r=t.pos.getc(!0),i=this.viz.canvas,s=i.translateOffsetX,o=i.translateOffsetY,u=i.scaleOffsetX,a=i.scaleOffsetY,f=i.getSize(),l={x:Math.round(r.x*u+s+f.width/2),y:Math.round(r.y*a+o+f.height/2)};e.setAttribute("x",l.x),e.setAttribute("y",l.y),n
("."+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(n,r){var i=n;if(arguments.length===0)return e.extend({},this.options);if(typeof n=="string"){if(r===t)return this.options[n];i={},i[n]=r}return this._setOptions(i),this},_setOptions:function(t){var n=this;return e.each(t,function(e,t){n._setOption(e,t)}),this},_setOption:function(e,t){return this.options[e]=t,e==="disabled"&&this.widget()[t?"addClass":"removeClass"](this.widgetBaseClass+"-disabled"+" "+"ui-state-disabled").attr("aria-disabled",t),this},enable:function(){return this._setOption("disabled",!1)},disable:function(){return this._setOption("disabled",!0)},_trigger:function(t,n,r){var i,s,o=this.options[t];r=r||{},n=e.Event(n),n.type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),n.target=this.element[0],s=n.originalEvent;if(s)for(i in s)i in n||(n[i]=s[i]);return this.element.trigger(n,r),!(e.isFunction(o)&&o.call(this.element[0],n,r)===!1||n.isDefaultPrevented())}}}(jQuery),function(e,t){var n=!1;e(document).mouseup(function(e){n=!1}),e.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var t=this;this.element.bind("mousedown."+this.widgetName,function(e){return t._mouseDown(e)}).bind("click."+this.widgetName,function(n){if(!0===e.data(n.target,t.widgetName+".preventClickEvent"))return e.removeData(n.target,t.widgetName+".preventClickEvent"),n.stopImmediatePropagation(),!1}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),this._mouseMoveDelegate&&e(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(t){if(n)return;this._mouseStarted&&this._mouseUp(t),this._mouseDownEvent=t;var r=this,i=t.which==1,s=typeof this.options.cancel=="string"&&t.target.nodeName?e(t.target).closest(this.options.cancel).length:!1;if(!i||s||!this._mouseCapture(t))return!0;this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){r.mouseDelayMet=!0},this.options.delay));if(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)){this._mouseStarted=this._mouseStart(t)!==!1;if(!this._mouseStarted)return t.preventDefault(),!0}return!0===e.data(t.target,this.widgetName+".preventClickEvent")&&e.removeData(t.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(e){return r._mouseMove(e)},this._mouseUpDelegate=function(e){return r._mouseUp(e)},e(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),t.preventDefault(),n=!0,!0},_mouseMove:function(t){return!e.browser.msie||document.documentMode>=9||!!t.button?this._mouseStarted?(this._mouseDrag(t),t.preventDefault()):(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,t)!==!1,this._mouseStarted?this._mouseDrag(t):this._mouseUp(t)),!this._mouseStarted):this._mouseUp(t)},_mouseUp:function(t){return e(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,t.target==this._mouseDownEvent.target&&e.data(t.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(t)),!1},_mouseDistanceMet:function(e){return Math.max(Math.abs(this._mouseDownEvent.pageX-e.pageX),Math.abs(this._mouseDownEvent.pageY-e.pageY))>=this.options.distance},_mouseDelayMet:function(e){return this.mouseDelayMet},_mouseStart:function(e){},_mouseDrag:function(e){},_mouseStop:function(e){},_mouseCapture:function(e){return!0}})}(jQuery),function(e,t){e.ui=e.ui||{};var n=/left|center|right/,r=/top|center|bottom/,i="center",s={},o=e.fn.position,u=e.fn.offset;e.fn.position=function(t){if(!t||!t.of)return o.apply(this,arguments);t=e.extend({},t);var u=e(t.of),l=u[0],h=(t.collision||"flip").split(" "),p
:s[3]},a=o.options.mode,f=e.effects[t];return e.fx.off||!f?a?this[a](o.duration,o.callback):this.each(function(){o.callback&&o.callback.call(this)}):f.call(this,o)},_show:e.fn.show,show:function(e){if(a(e))return this._show.apply(this,arguments);var t=u.apply(this,arguments);return t[1].mode="show",this.effect.apply(this,t)},_hide:e.fn.hide,hide:function(e){if(a(e))return this._hide.apply(this,arguments);var t=u.apply(this,arguments);return t[1].mode="hide",this.effect.apply(this,t)},__toggle:e.fn.toggle,toggle:function(t){if(a(t)||typeof t=="boolean"||e.isFunction(t))return this.__toggle.apply(this,arguments);var n=u.apply(this,arguments);return n[1].mode="toggle",this.effect.apply(this,n)},cssUnit:function(t){var n=this.css(t),r=[];return e.each(["em","px","%","pt"],function(e,t){n.indexOf(t)>0&&(r=[parseFloat(n),t])}),r}});var h={};e.each(["Quad","Cubic","Quart","Quint","Expo"],function(e,t){h[t]=function(t){return Math.pow(t,e+2)}}),e.extend(h,{Sine:function(e){return 1-Math.cos(e*Math.PI/2)},Circ:function(e){return 1-Math.sqrt(1-e*e)},Elastic:function(e){return e===0||e===1?e:-Math.pow(2,8*(e-1))*Math.sin(((e-1)*80-7.5)*Math.PI/15)},Back:function(e){return e*e*(3*e-2)},Bounce:function(e){var t,n=4;while(e<((t=Math.pow(2,--n))-1)/11);return 1/Math.pow(4,3-n)-7.5625*Math.pow((t*3-2)/22-e,2)}}),e.each(h,function(t,n){e.easing["easeIn"+t]=n,e.easing["easeOut"+t]=function(e){return 1-n(1-e)},e.easing["easeInOut"+t]=function(e){return e<.5?n(e*2)/2:n(e*-2+2)/-2+1}})}(jQuery),function(e){var t={init:function(t){function r(){return"ontouchstart"in window?1:0}var n={set_width:!1,set_height:!1,horizontalScroll:!1,scrollInertia:550,scrollEasing:"easeOutCirc",mouseWheel:"auto",autoDraggerLength:!0,scrollButtons:{enable:!1,scrollType:"continuous",scrollSpeed:20,scrollAmount:40},advanced:{updateOnBrowserResize:!0,updateOnContentResize:!1,autoExpandHorizontalScroll:!1},callbacks:{onScroll:function(){},onTotalScroll:function(){},onTotalScrollOffset:0}},t=e.extend(!0,n,t);return e(document).data("mCS-is-touch-device",!1),r()&&e(document).data("mCS-is-touch-device",!0),this.each(function(){var n=e(this);t.set_width&&n.css("width",t.set_width),t.set_height&&n.css("height",t.set_height);if(!e(document).data("mCustomScrollbar-index"))e(document).data("mCustomScrollbar-index","1");else{var i=parseInt(e(document).data("mCustomScrollbar-index"));e(document).data("mCustomScrollbar-index",i+1)}n.wrapInner("<div class='mCustomScrollBox' id='mCSB_"+e(document).data("mCustomScrollbar-index")+"' style='position:relative; height:100%; overflow:hidden; max-width:100%;' />").addClass("mCustomScrollbar _mCS_"+e(document).data("mCustomScrollbar-index"));var s=n.children(".mCustomScrollBox");if(t.horizontalScroll){s.addClass("mCSB_horizontal").wrapInner("<div class='mCSB_h_wrapper' style='position:relative; left:0; width:999999px;' />");var o=s.children(".mCSB_h_wrapper");o.wrapInner("<div class='mCSB_container' style='position:absolute; left:0;' />").children(".mCSB_container").css({width:o.children().outerWidth(),position:"relative"}).unwrap()}else s.wrapInner("<div class='mCSB_container' style='position:relative; top:0;' />");var u=s.children(".mCSB_container");if(!e(document).data("mCS-is-touch-device")){u.after("<div class='mCSB_scrollTools' style='position:absolute;'><div class='mCSB_draggerContainer' style='position:relative;'><div class='mCSB_dragger' style='position:absolute;'><div class='mCSB_dragger_bar' style='position:relative;'></div></div><div class='mCSB_draggerRail'></div></div></div>");var a=s.children(".mCSB_scrollTools"),f=a.children(".mCSB_draggerContainer"),l=f.children(".mCSB_dragger");t.horizontalScroll?l.data("minDraggerWidth",l.width()):l.data("minDraggerHeight",l.height()),t.scrollButtons.enable&&(t.horizontalScroll?a.prepend("<a class='mCSB_buttonLeft' style='display:block; position:relative;'></a>").append("<a class='mCSB_buttonRight' style='display:block; position:relative;'></a>"):a.prepend("<a class='mCSB_buttonUp' style='display:block; position:relative;'></a>").append("<a class='mCSB_buttonDown' style='display:block;
publish("connect_failed")}}},n.options["connect timeout"]))})}n.sessionid=r,n.closeTimeout=s*1e3,n.heartbeatTimeout=i*1e3,n.transports||(n.transports=n.origTransports=o?t.util.intersect(o.split(","),n.options.transports):n.options.transports),n.setHeartbeatTimeout(),u(n.transports),n.once("connect",function(){clearTimeout(n.connectTimeoutTimer),e&&typeof e=="function"&&e()})}),this},r.prototype.setHeartbeatTimeout=function(){clearTimeout(this.heartbeatTimeoutTimer);if(this.transport&&!this.transport.heartbeats())return;var e=this;this.heartbeatTimeoutTimer=setTimeout(function(){e.transport.onClose()},this.heartbeatTimeout)},r.prototype.packet=function(e){return this.connected&&!this.doBuffer?this.transport.packet(e):this.buffer.push(e),this},r.prototype.setBuffer=function(e){this.doBuffer=e,!e&&this.connected&&this.buffer.length&&(this.options.manualFlush||this.flushBuffer())},r.prototype.flushBuffer=function(){this.transport.payload(this.buffer),this.buffer=[]},r.prototype.disconnect=function(){if(this.connected||this.connecting)this.open&&this.of("").packet({type:"disconnect"}),this.onDisconnect("booted");return this},r.prototype.disconnectSync=function(){var e=t.util.request(),n=["http"+(this.options.secure?"s":"")+":/",this.options.host+":"+this.options.port,this.options.resource,t.protocol,"",this.sessionid].join("/")+"/?disconnect=1";e.open("GET",n,!1),e.send(null),this.onDisconnect("booted")},r.prototype.isXDomain=function(){var e=n.location.port||("https:"==n.location.protocol?443:80);return this.options.host!==n.location.hostname||this.options.port!=e},r.prototype.onConnect=function(){this.connected||(this.connected=!0,this.connecting=!1,this.doBuffer||this.setBuffer(!1),this.emit("connect"))},r.prototype.onOpen=function(){this.open=!0},r.prototype.onClose=function(){this.open=!1,clearTimeout(this.heartbeatTimeoutTimer)},r.prototype.onPacket=function(e){this.of(e.endpoint).onPacket(e)},r.prototype.onError=function(e){e&&e.advice&&e.advice==="reconnect"&&(this.connected||this.connecting)&&(this.disconnect(),this.options.reconnect&&this.reconnect()),this.publish("error",e&&e.reason?e.reason:e)},r.prototype.onDisconnect=function(e){var t=this.connected,n=this.connecting;this.connected=!1,this.connecting=!1,this.open=!1;if(t||n)this.transport.close(),this.transport.clearTimeouts(),t&&(this.publish("disconnect",e),"booted"!=e&&this.options.reconnect&&!this.reconnecting&&this.reconnect())},r.prototype.reconnect=function(){function i(){if(e.connected){for(var t in e.namespaces)e.namespaces.hasOwnProperty(t)&&""!==t&&e.namespaces[t].packet({type:"connect"});e.publish("reconnect",e.transport.name,e.reconnectionAttempts)}clearTimeout(e.reconnectionTimer),e.removeListener("connect_failed",s),e.removeListener("connect",s),e.reconnecting=!1,delete e.reconnectionAttempts,delete e.reconnectionDelay,delete e.reconnectionTimer,delete e.redoTransports,e.options["try multiple transports"]=n}function s(){if(!e.reconnecting)return;if(e.connected)return i();if(e.connecting&&e.reconnecting)return e.reconnectionTimer=setTimeout(s,1e3);e.reconnectionAttempts++>=t?e.redoTransports?(e.publish("reconnect_failed"),i()):(e.on("connect_failed",s),e.options["try multiple transports"]=!0,e.transports=e.origTransports,e.transport=e.getTransport(),e.redoTransports=!0,e.connect()):(e.reconnectionDelay<r&&(e.reconnectionDelay*=2),e.connect(),e.publish("reconnecting",e.reconnectionDelay,e.reconnectionAttempts),e.reconnectionTimer=setTimeout(s,e.reconnectionDelay))}this.reconnecting=!0,this.reconnectionAttempts=0,this.reconnectionDelay=this.options["reconnection delay"];var e=this,t=this.options["max reconnection attempts"],n=this.options["try multiple transports"],r=this.options["reconnection limit"];this.options["try multiple transports"]=!1,this.reconnectionTimer=setTimeout(s,this.reconnectionDelay),this.on("connect",s)}}("undefined"!=typeof io?io:module.exports,"undefined"!=typeof io?io:module.parent.exports,this),function(e,t){function n(e,t){this.socket=e,this.name=t||"",this.flags={},this.json=new r(this,"json"),this.ackPackets=0,this.acks={}
(t)))},set:function(t,r,i){return n.isNumber(i)?e.setItem(this._ttlKey(t),o(s()+i)):e.removeItem(this._ttlKey(t)),e.setItem(this._prefix(t),o(r))},remove:function(t){return e.removeItem(this._ttlKey(t)),e.removeItem(this._prefix(t)),this},clear:function(){var t,n,r=[],i=e.length;for(t=0;t<i;t++)(n=e.key(t)).match(this.keyMatcher)&&r.push(n.replace(this.keyMatcher,""));for(t=r.length;t--;)this.remove(r[t]);return this},isExpired:function(t){var r=u(e.getItem(this._ttlKey(t)));return n.isNumber(r)&&s()>r?!0:!1}}:t={get:n.noop,set:n.noop,remove:n.noop,clear:n.noop,isExpired:n.noop},n.mixin(i.prototype,t),i}(),o=function(){function e(e){n.bindAll(this),e=e||{},this.sizeLimit=e.sizeLimit||10,this.cache={},this.cachedKeysByAge=[]}return n.mixin(e.prototype,{get:function(e){return this.cache[e]},set:function(e,t){var n;this.cachedKeysByAge.length===this.sizeLimit&&(n=this.cachedKeysByAge.shift(),delete this.cache[n]),this.cache[e]=t,this.cachedKeysByAge.push(e)}}),e}(),u=function(){function u(e){n.bindAll(this),e=n.isString(e)?{url:e}:e,s=s||new o,i=n.isNumber(e.maxParallelRequests)?e.maxParallelRequests:i||6,this.url=e.url,this.wildcard=e.wildcard||"%QUERY",this.filter=e.filter,this.replace=e.replace,this.ajaxSettings={type:"get",cache:e.cache,timeout:e.timeout,dataType:e.dataType||"json",beforeSend:e.beforeSend},this._get=(/^throttle$/i.test(e.rateLimitFn)?n.throttle:n.debounce)(this._get,e.rateLimitWait||300)}function a(){t++}function f(){t--}function l(){return t<i}var t=0,r={},i,s;return n.mixin(u.prototype,{_get:function(e,t){function r(r){var i=n.filter?n.filter(r):r;t&&t(i),s.set(e,r)}var n=this;l()?this._sendRequest(e).done(r):this.onDeckRequestArgs=[].slice.call(arguments,0)},_sendRequest:function(t){function s(){f(),r[t]=null,n.onDeckRequestArgs&&(n._get.apply(n,n.onDeckRequestArgs),n.onDeckRequestArgs=null)}var n=this,i=r[t];return i||(a(),i=r[t]=e.ajax(t,this.ajaxSettings).always(s)),i},get:function(e,t){var r=this,i=encodeURIComponent(e||""),o,u;return t=t||n.noop,o=this.replace?this.replace(this.url,i):this.url.replace(this.wildcard,i),(u=s.get(o))?n.defer(function(){t(r.filter?r.filter(u):u)}):this._get(o,t),!!u}}),u}(),a=function(){function i(t){n.bindAll(this),n.isString(t.template)&&!t.engine&&e.error("no template engine specified"),!t.local&&!t.prefetch&&!t.remote&&e.error("one of local, prefetch, or remote is required"),this.name=t.name||n.getUniqueId(),this.limit=t.limit||5,this.minLength=t.minLength||1,this.header=t.header,this.footer=t.footer,this.valueKey=t.valueKey||"value",this.template=o(t.template,t.engine,this.valueKey),this.local=t.local,this.prefetch=t.prefetch,this.remote=t.remote,this.itemHash={},this.adjacencyList={},this.storage=t.name?new s(t.name):null}function o(e,t,r){var i,s;return n.isFunction(e)?i=e:n.isString(e)?(s=t.compile(e),i=n.bind(s.render,s)):i=function(e){return"<p>"+e[r]+"</p>"},i}var r={thumbprint:"thumbprint",protocol:"protocol",itemHash:"itemHash",adjacencyList:"adjacencyList"};return n.mixin(i.prototype,{_processLocalData:function(e){this._mergeProcessedData(this._processData(e))},_loadPrefetchData:function(i){function p(e){var t=i.filter?i.filter(e):e,u=s._processData(t),a=u.itemHash,f=u.adjacencyList;s.storage&&(s.storage.set(r.itemHash,a,i.ttl),s.storage.set(r.adjacencyList,f,i.ttl),s.storage.set(r.thumbprint,o,i.ttl),s.storage.set(r.protocol,n.getProtocol(),i.ttl)),s._mergeProcessedData(u)}var s=this,o=t+(i.thumbprint||""),u,a,f,l,c,h;return this.storage&&(u=this.storage.get(r.thumbprint),a=this.storage.get(r.protocol),f=this.storage.get(r.itemHash),l=this.storage.get(r.adjacencyList)),c=u!==o||a!==n.getProtocol(),i=n.isString(i)?{url:i}:i,i.ttl=n.isNumber(i.ttl)?i.ttl:864e5,f&&l&&!c?(this._mergeProcessedData({itemHash:f,adjacencyList:l}),h=e.Deferred().resolve()):h=e.getJSON(i.url).done(p),h},_transformDatum:function(e){var t=n.isString(e)?e:e[this.valueKey],r=e.tokens||n.tokenizeText(t),i={value:t,tokens:r};return n.isString(e)?(i.datum={},i.datum[this.valueKey]=e):i.datum=e,i.tokens=n.filter(i.tokens,function(e){return!n.isBlankString(e)}),i.tokens=n.map(i.tokens,