Files
galaxy/config/plugins/visualizations/drawrna/static/script.js
T
2018-02-11 14:36:39 -05:00

94 lines
490 KiB
JavaScript

require=function(r,e,n){function t(n,o){function i(r){return t(i.resolve(r))}function f(e){return r[n][1][e]||e}if(!e[n]){if(!r[n]){var c="function"==typeof require&&require;if(!o&&c)return c(n,!0);if(u)return u(n,!0);var l=new Error("Cannot find module '"+n+"'");throw l.code="MODULE_NOT_FOUND",l}i.resolve=f;var a=e[n]=new t.Module;r[n][0].call(a.exports,i,a,a.exports)}return e[n].exports}function o(){this.bundle=t,this.exports={}}var u="function"==typeof require&&require;t.Module=o,t.modules=r,t.cache=e,t.parent=u;for(var i=0;i<n.length;i++)t(n[i]);return t}({7:[function(require,module,exports) {
(function(){var n=this,r=n._,t=Array.prototype,e=Object.prototype,u=Function.prototype,i=t.push,o=t.slice,a=e.toString,c=e.hasOwnProperty,f=Array.isArray,l=Object.keys,s=u.bind,p=Object.create,h=function(){},v=function(n){return n instanceof v?n:this instanceof v?void(this._wrapped=n):new v(n)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=v),exports._=v):n._=v,v.VERSION="1.8.3";var y=function(n,r,t){if(void 0===r)return n;switch(null==t?3:t){case 1:return function(t){return n.call(r,t)};case 2:return function(t,e){return n.call(r,t,e)};case 3:return function(t,e,u){return n.call(r,t,e,u)};case 4:return function(t,e,u,i){return n.call(r,t,e,u,i)}}return function(){return n.apply(r,arguments)}},d=function(n,r,t){return null==n?v.identity:v.isFunction(n)?y(n,r,t):v.isObject(n)?v.matcher(n):v.property(n)};v.iteratee=function(n,r){return d(n,r,1/0)};var g=function(n,r){return function(t){var e=arguments.length;if(e<2||null==t)return t;for(var u=1;u<e;u++)for(var i=arguments[u],o=n(i),a=o.length,c=0;c<a;c++){var f=o[c];r&&void 0!==t[f]||(t[f]=i[f])}return t}},m=function(n){if(!v.isObject(n))return{};if(p)return p(n);h.prototype=n;var r=new h;return h.prototype=null,r},b=function(n){return function(r){return null==r?void 0:r[n]}},x=Math.pow(2,53)-1,_=b("length"),j=function(n){var r=_(n);return"number"==typeof r&&r>=0&&r<=x};function w(n){return function(r,t,e,u){t=y(t,u,4);var i=!j(r)&&v.keys(r),o=(i||r).length,a=n>0?0:o-1;return arguments.length<3&&(e=r[i?i[a]:a],a+=n),function(r,t,e,u,i,o){for(;i>=0&&i<o;i+=n){var a=u?u[i]:i;e=t(e,r[a],a,r)}return e}(r,t,e,i,a,o)}}v.each=v.forEach=function(n,r,t){var e,u;if(r=y(r,t),j(n))for(e=0,u=n.length;e<u;e++)r(n[e],e,n);else{var i=v.keys(n);for(e=0,u=i.length;e<u;e++)r(n[i[e]],i[e],n)}return n},v.map=v.collect=function(n,r,t){r=d(r,t);for(var e=!j(n)&&v.keys(n),u=(e||n).length,i=Array(u),o=0;o<u;o++){var a=e?e[o]:o;i[o]=r(n[a],a,n)}return i},v.reduce=v.foldl=v.inject=w(1),v.reduceRight=v.foldr=w(-1),v.find=v.detect=function(n,r,t){var e;if(void 0!==(e=j(n)?v.findIndex(n,r,t):v.findKey(n,r,t))&&-1!==e)return n[e]},v.filter=v.select=function(n,r,t){var e=[];return r=d(r,t),v.each(n,function(n,t,u){r(n,t,u)&&e.push(n)}),e},v.reject=function(n,r,t){return v.filter(n,v.negate(d(r)),t)},v.every=v.all=function(n,r,t){r=d(r,t);for(var e=!j(n)&&v.keys(n),u=(e||n).length,i=0;i<u;i++){var o=e?e[i]:i;if(!r(n[o],o,n))return!1}return!0},v.some=v.any=function(n,r,t){r=d(r,t);for(var e=!j(n)&&v.keys(n),u=(e||n).length,i=0;i<u;i++){var o=e?e[i]:i;if(r(n[o],o,n))return!0}return!1},v.contains=v.includes=v.include=function(n,r,t,e){return j(n)||(n=v.values(n)),("number"!=typeof t||e)&&(t=0),v.indexOf(n,r,t)>=0},v.invoke=function(n,r){var t=o.call(arguments,2),e=v.isFunction(r);return v.map(n,function(n){var u=e?r:n[r];return null==u?u:u.apply(n,t)})},v.pluck=function(n,r){return v.map(n,v.property(r))},v.where=function(n,r){return v.filter(n,v.matcher(r))},v.findWhere=function(n,r){return v.find(n,v.matcher(r))},v.max=function(n,r,t){var e,u,i=-1/0,o=-1/0;if(null==r&&null!=n)for(var a=0,c=(n=j(n)?n:v.values(n)).length;a<c;a++)(e=n[a])>i&&(i=e);else r=d(r,t),v.each(n,function(n,t,e){((u=r(n,t,e))>o||u===-1/0&&i===-1/0)&&(i=n,o=u)});return i},v.min=function(n,r,t){var e,u,i=1/0,o=1/0;if(null==r&&null!=n)for(var a=0,c=(n=j(n)?n:v.values(n)).length;a<c;a++)(e=n[a])<i&&(i=e);else r=d(r,t),v.each(n,function(n,t,e){((u=r(n,t,e))<o||u===1/0&&i===1/0)&&(i=n,o=u)});return i},v.shuffle=function(n){for(var r,t=j(n)?n:v.values(n),e=t.length,u=Array(e),i=0;i<e;i++)(r=v.random(0,i))!==i&&(u[i]=u[r]),u[r]=t[i];return u},v.sample=function(n,r,t){return null==r||t?(j(n)||(n=v.values(n)),n[v.random(n.length-1)]):v.shuffle(n).slice(0,Math.max(0,r))},v.sortBy=function(n,r,t){return r=d(r,t),v.pluck(v.map(n,function(n,t,e){return{value:n,index:t,criteria:r(n,t,e)}}).sort(function(n,r){var t=n.criteria,e=r.criteria;if(t!==e){if(t>e||void 0===t)return 1;if(t<e||void 0===e)return-1}return n.index-r.index}),"value")};var A=function(n){return function(r,t,e){var u={};return t=d(t,e),v.each(r,function(e,i){var o=t(e,i,r);n(u,e,o)}),u}};v.groupBy=A(function(n,r,t){v.has(n,t)?n[t].push(r):n[t]=[r]}),v.indexBy=A(function(n,r,t){n[t]=r}),v.countBy=A(function(n,r,t){v.has(n,t)?n[t]++:n[t]=1}),v.toArray=function(n){return n?v.isArray(n)?o.call(n):j(n)?v.map(n,v.identity):v.values(n):[]},v.size=function(n){return null==n?0:j(n)?n.length:v.keys(n).length},v.partition=function(n,r,t){r=d(r,t);var e=[],u=[];return v.each(n,function(n,t,i){(r(n,t,i)?e:u).push(n)}),[e,u]},v.first=v.head=v.take=function(n,r,t){if(null!=n)return null==r||t?n[0]:v.initial(n,n.length-r)},v.initial=function(n,r,t){return o.call(n,0,Math.max(0,n.length-(null==r||t?1:r)))},v.last=function(n,r,t){if(null!=n)return null==r||t?n[n.length-1]:v.rest(n,Math.max(0,n.length-r))},v.rest=v.tail=v.drop=function(n,r,t){return o.call(n,null==r||t?1:r)},v.compact=function(n){return v.filter(n,v.identity)};var O=function(n,r,t,e){for(var u=[],i=0,o=e||0,a=_(n);o<a;o++){var c=n[o];if(j(c)&&(v.isArray(c)||v.isArguments(c))){r||(c=O(c,r,t));var f=0,l=c.length;for(u.length+=l;f<l;)u[i++]=c[f++]}else t||(u[i++]=c)}return u};function k(n){return function(r,t,e){t=d(t,e);for(var u=_(r),i=n>0?0:u-1;i>=0&&i<u;i+=n)if(t(r[i],i,r))return i;return-1}}function F(n,r,t){return function(e,u,i){var a=0,c=_(e);if("number"==typeof i)n>0?a=i>=0?i:Math.max(i+c,a):c=i>=0?Math.min(i+1,c):i+c+1;else if(t&&i&&c)return e[i=t(e,u)]===u?i:-1;if(u!=u)return(i=r(o.call(e,a,c),v.isNaN))>=0?i+a:-1;for(i=n>0?a:c-1;i>=0&&i<c;i+=n)if(e[i]===u)return i;return-1}}v.flatten=function(n,r){return O(n,r,!1)},v.without=function(n){return v.difference(n,o.call(arguments,1))},v.uniq=v.unique=function(n,r,t,e){v.isBoolean(r)||(e=t,t=r,r=!1),null!=t&&(t=d(t,e));for(var u=[],i=[],o=0,a=_(n);o<a;o++){var c=n[o],f=t?t(c,o,n):c;r?(o&&i===f||u.push(c),i=f):t?v.contains(i,f)||(i.push(f),u.push(c)):v.contains(u,c)||u.push(c)}return u},v.union=function(){return v.uniq(O(arguments,!0,!0))},v.intersection=function(n){for(var r=[],t=arguments.length,e=0,u=_(n);e<u;e++){var i=n[e];if(!v.contains(r,i)){for(var o=1;o<t&&v.contains(arguments[o],i);o++);o===t&&r.push(i)}}return r},v.difference=function(n){var r=O(arguments,!0,!0,1);return v.filter(n,function(n){return!v.contains(r,n)})},v.zip=function(){return v.unzip(arguments)},v.unzip=function(n){for(var r=n&&v.max(n,_).length||0,t=Array(r),e=0;e<r;e++)t[e]=v.pluck(n,e);return t},v.object=function(n,r){for(var t={},e=0,u=_(n);e<u;e++)r?t[n[e]]=r[e]:t[n[e][0]]=n[e][1];return t},v.findIndex=k(1),v.findLastIndex=k(-1),v.sortedIndex=function(n,r,t,e){for(var u=(t=d(t,e,1))(r),i=0,o=_(n);i<o;){var a=Math.floor((i+o)/2);t(n[a])<u?i=a+1:o=a}return i},v.indexOf=F(1,v.findIndex,v.sortedIndex),v.lastIndexOf=F(-1,v.findLastIndex),v.range=function(n,r,t){null==r&&(r=n||0,n=0),t=t||1;for(var e=Math.max(Math.ceil((r-n)/t),0),u=Array(e),i=0;i<e;i++,n+=t)u[i]=n;return u};var S=function(n,r,t,e,u){if(!(e instanceof r))return n.apply(t,u);var i=m(n.prototype),o=n.apply(i,u);return v.isObject(o)?o:i};v.bind=function(n,r){if(s&&n.bind===s)return s.apply(n,o.call(arguments,1));if(!v.isFunction(n))throw new TypeError("Bind must be called on a function");var t=o.call(arguments,2),e=function(){return S(n,e,r,this,t.concat(o.call(arguments)))};return e},v.partial=function(n){var r=o.call(arguments,1),t=function(){for(var e=0,u=r.length,i=Array(u),o=0;o<u;o++)i[o]=r[o]===v?arguments[e++]:r[o];for(;e<arguments.length;)i.push(arguments[e++]);return S(n,t,this,this,i)};return t},v.bindAll=function(n){var r,t,e=arguments.length;if(e<=1)throw new Error("bindAll must be passed function names");for(r=1;r<e;r++)n[t=arguments[r]]=v.bind(n[t],n);return n},v.memoize=function(n,r){var t=function(e){var u=t.cache,i=""+(r?r.apply(this,arguments):e);return v.has(u,i)||(u[i]=n.apply(this,arguments)),u[i]};return t.cache={},t},v.delay=function(n,r){var t=o.call(arguments,2);return setTimeout(function(){return n.apply(null,t)},r)},v.defer=v.partial(v.delay,v,1),v.throttle=function(n,r,t){var e,u,i,o=null,a=0;t||(t={});var c=function(){a=!1===t.leading?0:v.now(),o=null,i=n.apply(e,u),o||(e=u=null)};return function(){var f=v.now();a||!1!==t.leading||(a=f);var l=r-(f-a);return e=this,u=arguments,l<=0||l>r?(o&&(clearTimeout(o),o=null),a=f,i=n.apply(e,u),o||(e=u=null)):o||!1===t.trailing||(o=setTimeout(c,l)),i}},v.debounce=function(n,r,t){var e,u,i,o,a,c=function(){var f=v.now()-o;f<r&&f>=0?e=setTimeout(c,r-f):(e=null,t||(a=n.apply(i,u),e||(i=u=null)))};return function(){i=this,u=arguments,o=v.now();var f=t&&!e;return e||(e=setTimeout(c,r)),f&&(a=n.apply(i,u),i=u=null),a}},v.wrap=function(n,r){return v.partial(r,n)},v.negate=function(n){return function(){return!n.apply(this,arguments)}},v.compose=function(){var n=arguments,r=n.length-1;return function(){for(var t=r,e=n[r].apply(this,arguments);t--;)e=n[t].call(this,e);return e}},v.after=function(n,r){return function(){if(--n<1)return r.apply(this,arguments)}},v.before=function(n,r){var t;return function(){return--n>0&&(t=r.apply(this,arguments)),n<=1&&(r=null),t}},v.once=v.partial(v.before,2);var E=!{toString:null}.propertyIsEnumerable("toString"),M=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];function I(n,r){var t=M.length,u=n.constructor,i=v.isFunction(u)&&u.prototype||e,o="constructor";for(v.has(n,o)&&!v.contains(r,o)&&r.push(o);t--;)(o=M[t])in n&&n[o]!==i[o]&&!v.contains(r,o)&&r.push(o)}v.keys=function(n){if(!v.isObject(n))return[];if(l)return l(n);var r=[];for(var t in n)v.has(n,t)&&r.push(t);return E&&I(n,r),r},v.allKeys=function(n){if(!v.isObject(n))return[];var r=[];for(var t in n)r.push(t);return E&&I(n,r),r},v.values=function(n){for(var r=v.keys(n),t=r.length,e=Array(t),u=0;u<t;u++)e[u]=n[r[u]];return e},v.mapObject=function(n,r,t){r=d(r,t);for(var e,u=v.keys(n),i=u.length,o={},a=0;a<i;a++)o[e=u[a]]=r(n[e],e,n);return o},v.pairs=function(n){for(var r=v.keys(n),t=r.length,e=Array(t),u=0;u<t;u++)e[u]=[r[u],n[r[u]]];return e},v.invert=function(n){for(var r={},t=v.keys(n),e=0,u=t.length;e<u;e++)r[n[t[e]]]=t[e];return r},v.functions=v.methods=function(n){var r=[];for(var t in n)v.isFunction(n[t])&&r.push(t);return r.sort()},v.extend=g(v.allKeys),v.extendOwn=v.assign=g(v.keys),v.findKey=function(n,r,t){r=d(r,t);for(var e,u=v.keys(n),i=0,o=u.length;i<o;i++)if(r(n[e=u[i]],e,n))return e},v.pick=function(n,r,t){var e,u,i={},o=n;if(null==o)return i;v.isFunction(r)?(u=v.allKeys(o),e=y(r,t)):(u=O(arguments,!1,!1,1),e=function(n,r,t){return r in t},o=Object(o));for(var a=0,c=u.length;a<c;a++){var f=u[a],l=o[f];e(l,f,o)&&(i[f]=l)}return i},v.omit=function(n,r,t){if(v.isFunction(r))r=v.negate(r);else{var e=v.map(O(arguments,!1,!1,1),String);r=function(n,r){return!v.contains(e,r)}}return v.pick(n,r,t)},v.defaults=g(v.allKeys,!0),v.create=function(n,r){var t=m(n);return r&&v.extendOwn(t,r),t},v.clone=function(n){return v.isObject(n)?v.isArray(n)?n.slice():v.extend({},n):n},v.tap=function(n,r){return r(n),n},v.isMatch=function(n,r){var t=v.keys(r),e=t.length;if(null==n)return!e;for(var u=Object(n),i=0;i<e;i++){var o=t[i];if(r[o]!==u[o]||!(o in u))return!1}return!0};var N=function(n,r,t,e){if(n===r)return 0!==n||1/n==1/r;if(null==n||null==r)return n===r;n instanceof v&&(n=n._wrapped),r instanceof v&&(r=r._wrapped);var u=a.call(n);if(u!==a.call(r))return!1;switch(u){case"[object RegExp]":case"[object String]":return""+n==""+r;case"[object Number]":return+n!=+n?+r!=+r:0==+n?1/+n==1/r:+n==+r;case"[object Date]":case"[object Boolean]":return+n==+r}var i="[object Array]"===u;if(!i){if("object"!=typeof n||"object"!=typeof r)return!1;var o=n.constructor,c=r.constructor;if(o!==c&&!(v.isFunction(o)&&o instanceof o&&v.isFunction(c)&&c instanceof c)&&"constructor"in n&&"constructor"in r)return!1}t=t||[],e=e||[];for(var f=t.length;f--;)if(t[f]===n)return e[f]===r;if(t.push(n),e.push(r),i){if((f=n.length)!==r.length)return!1;for(;f--;)if(!N(n[f],r[f],t,e))return!1}else{var l,s=v.keys(n);if(f=s.length,v.keys(r).length!==f)return!1;for(;f--;)if(l=s[f],!v.has(r,l)||!N(n[l],r[l],t,e))return!1}return t.pop(),e.pop(),!0};v.isEqual=function(n,r){return N(n,r)},v.isEmpty=function(n){return null==n||(j(n)&&(v.isArray(n)||v.isString(n)||v.isArguments(n))?0===n.length:0===v.keys(n).length)},v.isElement=function(n){return!(!n||1!==n.nodeType)},v.isArray=f||function(n){return"[object Array]"===a.call(n)},v.isObject=function(n){var r=typeof n;return"function"===r||"object"===r&&!!n},v.each(["Arguments","Function","String","Number","Date","RegExp","Error"],function(n){v["is"+n]=function(r){return a.call(r)==="[object "+n+"]"}}),v.isArguments(arguments)||(v.isArguments=function(n){return v.has(n,"callee")}),"function"!=typeof/./&&"object"!=typeof Int8Array&&(v.isFunction=function(n){return"function"==typeof n||!1}),v.isFinite=function(n){return isFinite(n)&&!isNaN(parseFloat(n))},v.isNaN=function(n){return v.isNumber(n)&&n!==+n},v.isBoolean=function(n){return!0===n||!1===n||"[object Boolean]"===a.call(n)},v.isNull=function(n){return null===n},v.isUndefined=function(n){return void 0===n},v.has=function(n,r){return null!=n&&c.call(n,r)},v.noConflict=function(){return n._=r,this},v.identity=function(n){return n},v.constant=function(n){return function(){return n}},v.noop=function(){},v.property=b,v.propertyOf=function(n){return null==n?function(){}:function(r){return n[r]}},v.matcher=v.matches=function(n){return n=v.extendOwn({},n),function(r){return v.isMatch(r,n)}},v.times=function(n,r,t){var e=Array(Math.max(0,n));r=y(r,t,1);for(var u=0;u<n;u++)e[u]=r(u);return e},v.random=function(n,r){return null==r&&(r=n,n=0),n+Math.floor(Math.random()*(r-n+1))},v.now=Date.now||function(){return(new Date).getTime()};var B={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},T=v.invert(B),R=function(n){var r=function(r){return n[r]},t="(?:"+v.keys(n).join("|")+")",e=RegExp(t),u=RegExp(t,"g");return function(n){return n=null==n?"":""+n,e.test(n)?n.replace(u,r):n}};v.escape=R(B),v.unescape=R(T),v.result=function(n,r,t){var e=null==n?void 0:n[r];return void 0===e&&(e=t),v.isFunction(e)?e.call(n):e};var q=0;v.uniqueId=function(n){var r=++q+"";return n?n+r:r},v.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var K=/(.)^/,z={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},D=/\\|'|\r|\n|\u2028|\u2029/g,L=function(n){return"\\"+z[n]};v.template=function(n,r,t){!r&&t&&(r=t),r=v.defaults({},r,v.templateSettings);var e=RegExp([(r.escape||K).source,(r.interpolate||K).source,(r.evaluate||K).source].join("|")+"|$","g"),u=0,i="__p+='";n.replace(e,function(r,t,e,o,a){return i+=n.slice(u,a).replace(D,L),u=a+r.length,t?i+="'+\n((__t=("+t+"))==null?'':_.escape(__t))+\n'":e?i+="'+\n((__t=("+e+"))==null?'':__t)+\n'":o&&(i+="';\n"+o+"\n__p+='"),r}),i+="';\n",r.variable||(i="with(obj||{}){\n"+i+"}\n"),i="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+i+"return __p;\n";try{var o=new Function(r.variable||"obj","_",i)}catch(n){throw n.source=i,n}var a=function(n){return o.call(this,n,v)},c=r.variable||"obj";return a.source="function("+c+"){\n"+i+"}",a},v.chain=function(n){var r=v(n);return r._chain=!0,r};var P=function(n,r){return n._chain?v(r).chain():r};v.mixin=function(n){v.each(v.functions(n),function(r){var t=v[r]=n[r];v.prototype[r]=function(){var n=[this._wrapped];return i.apply(n,arguments),P(this,t.apply(v,n))}})},v.mixin(v),v.each(["pop","push","reverse","shift","sort","splice","unshift"],function(n){var r=t[n];v.prototype[n]=function(){var t=this._wrapped;return r.apply(t,arguments),"shift"!==n&&"splice"!==n||0!==t.length||delete t[0],P(this,t)}}),v.each(["concat","join","slice"],function(n){var r=t[n];v.prototype[n]=function(){return P(this,r.apply(this._wrapped,arguments))}}),v.prototype.value=function(){return this._wrapped},v.prototype.valueOf=v.prototype.toJSON=v.prototype.value,v.prototype.toString=function(){return""+this._wrapped},"function"==typeof define&&define.amd&&define("underscore",[],function(){return v})}).call(this);
},{}],8:[function(require,module,exports) {
var t,e,n=module.exports={};function r(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function i(e){if(t===setTimeout)return setTimeout(e,0);if((t===r||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}function u(t){if(e===clearTimeout)return clearTimeout(t);if((e===o||!e)&&clearTimeout)return e=clearTimeout,clearTimeout(t);try{return e(t)}catch(n){try{return e.call(null,t)}catch(n){return e.call(this,t)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:r}catch(e){t=r}try{e="function"==typeof clearTimeout?clearTimeout:o}catch(t){e=o}}();var c,s=[],l=!1,a=-1;function f(){l&&c&&(l=!1,c.length?s=c.concat(s):a=-1,s.length&&h())}function h(){if(!l){var t=i(f);l=!0;for(var e=s.length;e;){for(c=s,s=[];++a<e;)c&&c[a].run();a=-1,e=s.length}c=null,l=!1,u(t)}}function m(t,e){this.fun=t,this.array=e}function p(){}n.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];s.push(new m(t,e)),1!==s.length||l||i(h)},m.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=p,n.addListener=p,n.once=p,n.off=p,n.removeListener=p,n.removeAllListeners=p,n.emit=p,n.prependListener=p,n.prependOnceListener=p,n.listeners=function(t){return[]},n.binding=function(t){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(t){throw new Error("process.chdir is not supported")},n.umask=function(){return 0};
},{}],6:[function(require,module,exports) {
var global = (1,eval)("this");
var process = require("process");
var e=(0,eval)("this"),t=require("process");!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(e,t){"use strict";var n=[],r=e.document,i=Object.getPrototypeOf,o=n.slice,a=n.concat,s=n.push,u=n.indexOf,l={},c=l.toString,f=l.hasOwnProperty,p=f.toString,d=p.call(Object),h={},g=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},v=function(e){return null!=e&&e===e.window},y={type:!0,src:!0,noModule:!0};function m(e,t,n){var i,o=(t=t||r).createElement("script");if(o.text=e,n)for(i in y)n[i]&&(o[i]=n[i]);t.head.appendChild(o).parentNode.removeChild(o)}function x(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?l[c.call(e)]||"object":typeof e}var b=function(e,t){return new b.fn.init(e,t)},w=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;function T(e){var t=!!e&&"length"in e&&e.length,n=x(e);return!g(e)&&!v(e)&&("array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e)}b.fn=b.prototype={jquery:"3.3.1",constructor:b,length:0,toArray:function(){return o.call(this)},get:function(e){return null==e?o.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=b.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return b.each(this,e)},map:function(e){return this.pushStack(b.map(this,function(t,n){return e.call(t,n,t)}))},slice:function(){return this.pushStack(o.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(n>=0&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:s,sort:n.sort,splice:n.splice},b.extend=b.fn.extend=function(){var e,t,n,r,i,o,a=arguments[0]||{},s=1,u=arguments.length,l=!1;for("boolean"==typeof a&&(l=a,a=arguments[s]||{},s++),"object"==typeof a||g(a)||(a={}),s===u&&(a=this,s--);s<u;s++)if(null!=(e=arguments[s]))for(t in e)n=a[t],a!==(r=e[t])&&(l&&r&&(b.isPlainObject(r)||(i=Array.isArray(r)))?(i?(i=!1,o=n&&Array.isArray(n)?n:[]):o=n&&b.isPlainObject(n)?n:{},a[t]=b.extend(l,o,r)):void 0!==r&&(a[t]=r));return a},b.extend({expando:"jQuery"+("3.3.1"+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,n;return!(!e||"[object Object]"!==c.call(e))&&(!(t=i(e))||"function"==typeof(n=f.call(t,"constructor")&&t.constructor)&&p.call(n)===d)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e){m(e)},each:function(e,t){var n,r=0;if(T(e))for(n=e.length;r<n&&!1!==t.call(e[r],r,e[r]);r++);else for(r in e)if(!1===t.call(e[r],r,e[r]))break;return e},trim:function(e){return null==e?"":(e+"").replace(w,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(T(Object(e))?b.merge(n,"string"==typeof e?[e]:e):s.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:u.call(t,e,n)},merge:function(e,t){for(var n=+t.length,r=0,i=e.length;r<n;r++)e[i++]=t[r];return e.length=i,e},grep:function(e,t,n){for(var r=[],i=0,o=e.length,a=!n;i<o;i++)!t(e[i],i)!==a&&r.push(e[i]);return r},map:function(e,t,n){var r,i,o=0,s=[];if(T(e))for(r=e.length;o<r;o++)null!=(i=t(e[o],o,n))&&s.push(i);else for(o in e)null!=(i=t(e[o],o,n))&&s.push(i);return a.apply([],s)},guid:1,support:h}),"function"==typeof Symbol&&(b.fn[Symbol.iterator]=n[Symbol.iterator]),b.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){l["[object "+t+"]"]=t.toLowerCase()});var C=function(e){var t,n,r,i,o,a,s,u,l,c,f,p,d,h,g,v,y,m,x,b="sizzle"+1*new Date,w=e.document,T=0,C=0,E=ae(),k=ae(),S=ae(),D=function(e,t){return e===t&&(f=!0),0},N={}.hasOwnProperty,A=[],j=A.pop,q=A.push,L=A.push,H=A.slice,O=function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},P="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",R="(?:\\\\.|[\\w-]|[^\0-\\xa0])+",I="\\["+M+"*("+R+")(?:"+M+"*([*^$|!~]?=)"+M+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+R+"))|)"+M+"*\\]",W=":("+R+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+I+")*)|.*)\\)|)",$=new RegExp(M+"+","g"),B=new RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),F=new RegExp("^"+M+"*,"+M+"*"),_=new RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),z=new RegExp("="+M+"*([^\\]'\"]*?)"+M+"*\\]","g"),X=new RegExp(W),U=new RegExp("^"+R+"$"),V={ID:new RegExp("^#("+R+")"),CLASS:new RegExp("^\\.("+R+")"),TAG:new RegExp("^("+R+"|[*])"),ATTR:new RegExp("^"+I),PSEUDO:new RegExp("^"+W),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+P+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},G=/^(?:input|select|textarea|button)$/i,Y=/^h\d$/i,Q=/^[^{]+\{\s*\[native \w/,J=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,K=/[+~]/,Z=new RegExp("\\\\([\\da-f]{1,6}"+M+"?|("+M+")|.)","ig"),ee=function(e,t,n){var r="0x"+t-65536;return r!=r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},te=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ne=function(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},re=function(){p()},ie=me(function(e){return!0===e.disabled&&("form"in e||"label"in e)},{dir:"parentNode",next:"legend"});try{L.apply(A=H.call(w.childNodes),w.childNodes),A[w.childNodes.length].nodeType}catch(e){L={apply:A.length?function(e,t){q.apply(e,H.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}function oe(e,t,r,i){var o,s,l,c,f,h,y,m=t&&t.ownerDocument,T=t?t.nodeType:9;if(r=r||[],"string"!=typeof e||!e||1!==T&&9!==T&&11!==T)return r;if(!i&&((t?t.ownerDocument||t:w)!==d&&p(t),t=t||d,g)){if(11!==T&&(f=J.exec(e)))if(o=f[1]){if(9===T){if(!(l=t.getElementById(o)))return r;if(l.id===o)return r.push(l),r}else if(m&&(l=m.getElementById(o))&&x(t,l)&&l.id===o)return r.push(l),r}else{if(f[2])return L.apply(r,t.getElementsByTagName(e)),r;if((o=f[3])&&n.getElementsByClassName&&t.getElementsByClassName)return L.apply(r,t.getElementsByClassName(o)),r}if(n.qsa&&!S[e+" "]&&(!v||!v.test(e))){if(1!==T)m=t,y=e;else if("object"!==t.nodeName.toLowerCase()){for((c=t.getAttribute("id"))?c=c.replace(te,ne):t.setAttribute("id",c=b),s=(h=a(e)).length;s--;)h[s]="#"+c+" "+ye(h[s]);y=h.join(","),m=K.test(e)&&ge(t.parentNode)||t}if(y)try{return L.apply(r,m.querySelectorAll(y)),r}catch(e){}finally{c===b&&t.removeAttribute("id")}}}return u(e.replace(B,"$1"),t,r,i)}function ae(){var e=[];return function t(n,i){return e.push(n+" ")>r.cacheLength&&delete t[e.shift()],t[n+" "]=i}}function se(e){return e[b]=!0,e}function ue(e){var t=d.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function le(e,t){for(var n=e.split("|"),i=n.length;i--;)r.attrHandle[n[i]]=t}function ce(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function fe(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function pe(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function de(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&ie(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function he(e){return se(function(t){return t=+t,se(function(n,r){for(var i,o=e([],n.length,t),a=o.length;a--;)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}function ge(e){return e&&void 0!==e.getElementsByTagName&&e}for(t in n=oe.support={},o=oe.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},p=oe.setDocument=function(e){var t,i,a=e?e.ownerDocument||e:w;return a!==d&&9===a.nodeType&&a.documentElement?(h=(d=a).documentElement,g=!o(d),w!==d&&(i=d.defaultView)&&i.top!==i&&(i.addEventListener?i.addEventListener("unload",re,!1):i.attachEvent&&i.attachEvent("onunload",re)),n.attributes=ue(function(e){return e.className="i",!e.getAttribute("className")}),n.getElementsByTagName=ue(function(e){return e.appendChild(d.createComment("")),!e.getElementsByTagName("*").length}),n.getElementsByClassName=Q.test(d.getElementsByClassName),n.getById=ue(function(e){return h.appendChild(e).id=b,!d.getElementsByName||!d.getElementsByName(b).length}),n.getById?(r.filter.ID=function(e){var t=e.replace(Z,ee);return function(e){return e.getAttribute("id")===t}},r.find.ID=function(e,t){if(void 0!==t.getElementById&&g){var n=t.getElementById(e);return n?[n]:[]}}):(r.filter.ID=function(e){var t=e.replace(Z,ee);return function(e){var n=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},r.find.ID=function(e,t){if(void 0!==t.getElementById&&g){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];for(i=t.getElementsByName(e),r=0;o=i[r++];)if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),r.find.TAG=n.getElementsByTagName?function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):n.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o},r.find.CLASS=n.getElementsByClassName&&function(e,t){if(void 0!==t.getElementsByClassName&&g)return t.getElementsByClassName(e)},y=[],v=[],(n.qsa=Q.test(d.querySelectorAll))&&(ue(function(e){h.appendChild(e).innerHTML="<a id='"+b+"'></a><select id='"+b+"-\r\\' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+P+")"),e.querySelectorAll("[id~="+b+"-]").length||v.push("~="),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+b+"+*").length||v.push(".#.+[+~]")}),ue(function(e){e.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var t=d.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),h.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(n.matchesSelector=Q.test(m=h.matches||h.webkitMatchesSelector||h.mozMatchesSelector||h.oMatchesSelector||h.msMatchesSelector))&&ue(function(e){n.disconnectedMatch=m.call(e,"*"),m.call(e,"[s!='']:x"),y.push("!=",W)}),v=v.length&&new RegExp(v.join("|")),y=y.length&&new RegExp(y.join("|")),t=Q.test(h.compareDocumentPosition),x=t||Q.test(h.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},D=t?function(e,t){if(e===t)return f=!0,0;var r=!e.compareDocumentPosition-!t.compareDocumentPosition;return r||(1&(r=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!n.sortDetached&&t.compareDocumentPosition(e)===r?e===d||e.ownerDocument===w&&x(w,e)?-1:t===d||t.ownerDocument===w&&x(w,t)?1:c?O(c,e)-O(c,t):0:4&r?-1:1)}:function(e,t){if(e===t)return f=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e===d?-1:t===d?1:i?-1:o?1:c?O(c,e)-O(c,t):0;if(i===o)return ce(e,t);for(n=e;n=n.parentNode;)a.unshift(n);for(n=t;n=n.parentNode;)s.unshift(n);for(;a[r]===s[r];)r++;return r?ce(a[r],s[r]):a[r]===w?-1:s[r]===w?1:0},d):d},oe.matches=function(e,t){return oe(e,null,null,t)},oe.matchesSelector=function(e,t){if((e.ownerDocument||e)!==d&&p(e),t=t.replace(z,"='$1']"),n.matchesSelector&&g&&!S[t+" "]&&(!y||!y.test(t))&&(!v||!v.test(t)))try{var r=m.call(e,t);if(r||n.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(e){}return oe(t,d,null,[e]).length>0},oe.contains=function(e,t){return(e.ownerDocument||e)!==d&&p(e),x(e,t)},oe.attr=function(e,t){(e.ownerDocument||e)!==d&&p(e);var i=r.attrHandle[t.toLowerCase()],o=i&&N.call(r.attrHandle,t.toLowerCase())?i(e,t,!g):void 0;return void 0!==o?o:n.attributes||!g?e.getAttribute(t):(o=e.getAttributeNode(t))&&o.specified?o.value:null},oe.escape=function(e){return(e+"").replace(te,ne)},oe.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},oe.uniqueSort=function(e){var t,r=[],i=0,o=0;if(f=!n.detectDuplicates,c=!n.sortStable&&e.slice(0),e.sort(D),f){for(;t=e[o++];)t===e[o]&&(i=r.push(o));for(;i--;)e.splice(r[i],1)}return c=null,e},i=oe.getText=function(e){var t,n="",r=0,o=e.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=i(e)}else if(3===o||4===o)return e.nodeValue}else for(;t=e[r++];)n+=i(t);return n},(r=oe.selectors={cacheLength:50,createPseudo:se,match:V,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(Z,ee),e[3]=(e[3]||e[4]||e[5]||"").replace(Z,ee),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||oe.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&oe.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return V.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=a(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(Z,ee).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=E[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&E(e,function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=oe.attr(r,e);return null==i?"!="===t:!t||(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i.replace($," ")+" ").indexOf(n)>-1:"|="===t&&(i===n||i.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,u){var l,c,f,p,d,h,g=o!==a?"nextSibling":"previousSibling",v=t.parentNode,y=s&&t.nodeName.toLowerCase(),m=!u&&!s,x=!1;if(v){if(o){for(;g;){for(p=t;p=p[g];)if(s?p.nodeName.toLowerCase()===y:1===p.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?v.firstChild:v.lastChild],a&&m){for(x=(d=(l=(c=(f=(p=v)[b]||(p[b]={}))[p.uniqueID]||(f[p.uniqueID]={}))[e]||[])[0]===T&&l[1])&&l[2],p=d&&v.childNodes[d];p=++d&&p&&p[g]||(x=d=0)||h.pop();)if(1===p.nodeType&&++x&&p===t){c[e]=[T,d,x];break}}else if(m&&(x=d=(l=(c=(f=(p=t)[b]||(p[b]={}))[p.uniqueID]||(f[p.uniqueID]={}))[e]||[])[0]===T&&l[1]),!1===x)for(;(p=++d&&p&&p[g]||(x=d=0)||h.pop())&&((s?p.nodeName.toLowerCase()!==y:1!==p.nodeType)||!++x||(m&&((c=(f=p[b]||(p[b]={}))[p.uniqueID]||(f[p.uniqueID]={}))[e]=[T,x]),p!==t)););return(x-=i)===r||x%r==0&&x/r>=0}}},PSEUDO:function(e,t){var n,i=r.pseudos[e]||r.setFilters[e.toLowerCase()]||oe.error("unsupported pseudo: "+e);return i[b]?i(t):i.length>1?(n=[e,e,"",t],r.setFilters.hasOwnProperty(e.toLowerCase())?se(function(e,n){for(var r,o=i(e,t),a=o.length;a--;)e[r=O(e,o[a])]=!(n[r]=o[a])}):function(e){return i(e,0,n)}):i}},pseudos:{not:se(function(e){var t=[],n=[],r=s(e.replace(B,"$1"));return r[b]?se(function(e,t,n,i){for(var o,a=r(e,null,i,[]),s=e.length;s--;)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),t[0]=null,!n.pop()}}),has:se(function(e){return function(t){return oe(e,t).length>0}}),contains:se(function(e){return e=e.replace(Z,ee),function(t){return(t.textContent||t.innerText||i(t)).indexOf(e)>-1}}),lang:se(function(e){return U.test(e||"")||oe.error("unsupported lang: "+e),e=e.replace(Z,ee).toLowerCase(),function(t){var n;do{if(n=g?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===h},focus:function(e){return e===d.activeElement&&(!d.hasFocus||d.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:de(!1),disabled:de(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!r.pseudos.empty(e)},header:function(e){return Y.test(e.nodeName)},input:function(e){return G.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:he(function(){return[0]}),last:he(function(e,t){return[t-1]}),eq:he(function(e,t,n){return[n<0?n+t:n]}),even:he(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:he(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:he(function(e,t,n){for(var r=n<0?n+t:n;--r>=0;)e.push(r);return e}),gt:he(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}}).pseudos.nth=r.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})r.pseudos[t]=fe(t);for(t in{submit:!0,reset:!0})r.pseudos[t]=pe(t);function ve(){}function ye(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function me(e,t,n){var r=t.dir,i=t.next,o=i||r,a=n&&"parentNode"===o,s=C++;return t.first?function(t,n,i){for(;t=t[r];)if(1===t.nodeType||a)return e(t,n,i);return!1}:function(t,n,u){var l,c,f,p=[T,s];if(u){for(;t=t[r];)if((1===t.nodeType||a)&&e(t,n,u))return!0}else for(;t=t[r];)if(1===t.nodeType||a)if(c=(f=t[b]||(t[b]={}))[t.uniqueID]||(f[t.uniqueID]={}),i&&i===t.nodeName.toLowerCase())t=t[r]||t;else{if((l=c[o])&&l[0]===T&&l[1]===s)return p[2]=l[2];if(c[o]=p,p[2]=e(t,n,u))return!0}return!1}}function xe(e){return e.length>1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function be(e,t,n,r,i){for(var o,a=[],s=0,u=e.length,l=null!=t;s<u;s++)(o=e[s])&&(n&&!n(o,r,i)||(a.push(o),l&&t.push(s)));return a}function we(e,t,n,r,i,o){return r&&!r[b]&&(r=we(r)),i&&!i[b]&&(i=we(i,o)),se(function(o,a,s,u){var l,c,f,p=[],d=[],h=a.length,g=o||function(e,t,n){for(var r=0,i=t.length;r<i;r++)oe(e,t[r],n);return n}(t||"*",s.nodeType?[s]:s,[]),v=!e||!o&&t?g:be(g,p,e,s,u),y=n?i||(o?e:h||r)?[]:a:v;if(n&&n(v,y,s,u),r)for(l=be(y,d),r(l,[],s,u),c=l.length;c--;)(f=l[c])&&(y[d[c]]=!(v[d[c]]=f));if(o){if(i||e){if(i){for(l=[],c=y.length;c--;)(f=y[c])&&l.push(v[c]=f);i(null,y=[],l,u)}for(c=y.length;c--;)(f=y[c])&&(l=i?O(o,f):p[c])>-1&&(o[l]=!(a[l]=f))}}else y=be(y===a?y.splice(h,y.length):y),i?i(null,a,y,u):L.apply(a,y)})}function Te(e){for(var t,n,i,o=e.length,a=r.relative[e[0].type],s=a||r.relative[" "],u=a?1:0,c=me(function(e){return e===t},s,!0),f=me(function(e){return O(t,e)>-1},s,!0),p=[function(e,n,r){var i=!a&&(r||n!==l)||((t=n).nodeType?c(e,n,r):f(e,n,r));return t=null,i}];u<o;u++)if(n=r.relative[e[u].type])p=[me(xe(p),n)];else{if((n=r.filter[e[u].type].apply(null,e[u].matches))[b]){for(i=++u;i<o&&!r.relative[e[i].type];i++);return we(u>1&&xe(p),u>1&&ye(e.slice(0,u-1).concat({value:" "===e[u-2].type?"*":""})).replace(B,"$1"),n,u<i&&Te(e.slice(u,i)),i<o&&Te(e=e.slice(i)),i<o&&ye(e))}p.push(n)}return xe(p)}return ve.prototype=r.filters=r.pseudos,r.setFilters=new ve,a=oe.tokenize=function(e,t){var n,i,o,a,s,u,l,c=k[e+" "];if(c)return t?0:c.slice(0);for(s=e,u=[],l=r.preFilter;s;){for(a in n&&!(i=F.exec(s))||(i&&(s=s.slice(i[0].length)||s),u.push(o=[])),n=!1,(i=_.exec(s))&&(n=i.shift(),o.push({value:n,type:i[0].replace(B," ")}),s=s.slice(n.length)),r.filter)!(i=V[a].exec(s))||l[a]&&!(i=l[a](i))||(n=i.shift(),o.push({value:n,type:a,matches:i}),s=s.slice(n.length));if(!n)break}return t?s.length:s?oe.error(e):k(e,u).slice(0)},s=oe.compile=function(e,t){var n,i=[],o=[],s=S[e+" "];if(!s){for(t||(t=a(e)),n=t.length;n--;)(s=Te(t[n]))[b]?i.push(s):o.push(s);(s=S(e,function(e,t){var n=t.length>0,i=e.length>0,o=function(o,a,s,u,c){var f,h,v,y=0,m="0",x=o&&[],b=[],w=l,C=o||i&&r.find.TAG("*",c),E=T+=null==w?1:Math.random()||.1,k=C.length;for(c&&(l=a===d||a||c);m!==k&&null!=(f=C[m]);m++){if(i&&f){for(h=0,a||f.ownerDocument===d||(p(f),s=!g);v=e[h++];)if(v(f,a||d,s)){u.push(f);break}c&&(T=E)}n&&((f=!v&&f)&&y--,o&&x.push(f))}if(y+=m,n&&m!==y){for(h=0;v=t[h++];)v(x,b,a,s);if(o){if(y>0)for(;m--;)x[m]||b[m]||(b[m]=j.call(u));b=be(b)}L.apply(u,b),c&&!o&&b.length>0&&y+t.length>1&&oe.uniqueSort(u)}return c&&(T=E,l=w),x};return n?se(o):o}(o,i))).selector=e}return s},u=oe.select=function(e,t,n,i){var o,u,l,c,f,p="function"==typeof e&&e,d=!i&&a(e=p.selector||e);if(n=n||[],1===d.length){if((u=d[0]=d[0].slice(0)).length>2&&"ID"===(l=u[0]).type&&9===t.nodeType&&g&&r.relative[u[1].type]){if(!(t=(r.find.ID(l.matches[0].replace(Z,ee),t)||[])[0]))return n;p&&(t=t.parentNode),e=e.slice(u.shift().value.length)}for(o=V.needsContext.test(e)?0:u.length;o--&&(l=u[o],!r.relative[c=l.type]);)if((f=r.find[c])&&(i=f(l.matches[0].replace(Z,ee),K.test(u[0].type)&&ge(t.parentNode)||t))){if(u.splice(o,1),!(e=i.length&&ye(u)))return L.apply(n,i),n;break}}return(p||s(e,d))(i,t,!g,n,!t||K.test(e)&&ge(t.parentNode)||t),n},n.sortStable=b.split("").sort(D).join("")===b,n.detectDuplicates=!!f,p(),n.sortDetached=ue(function(e){return 1&e.compareDocumentPosition(d.createElement("fieldset"))}),ue(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||le("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),n.attributes&&ue(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||le("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),ue(function(e){return null==e.getAttribute("disabled")})||le(P,function(e,t,n){var r;if(!n)return!0===e[t]?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),oe}(e);b.find=C,b.expr=C.selectors,b.expr[":"]=b.expr.pseudos,b.uniqueSort=b.unique=C.uniqueSort,b.text=C.getText,b.isXMLDoc=C.isXML,b.contains=C.contains,b.escapeSelector=C.escape;var E=function(e,t,n){for(var r=[],i=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(i&&b(e).is(n))break;r.push(e)}return r},k=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},S=b.expr.match.needsContext;function D(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var N=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function A(e,t,n){return g(t)?b.grep(e,function(e,r){return!!t.call(e,r,e)!==n}):t.nodeType?b.grep(e,function(e){return e===t!==n}):"string"!=typeof t?b.grep(e,function(e){return u.call(t,e)>-1!==n}):b.filter(t,e,n)}b.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?b.find.matchesSelector(r,e)?[r]:[]:b.find.matches(e,b.grep(t,function(e){return 1===e.nodeType}))},b.fn.extend({find:function(e){var t,n,r=this.length,i=this;if("string"!=typeof e)return this.pushStack(b(e).filter(function(){for(t=0;t<r;t++)if(b.contains(i[t],this))return!0}));for(n=this.pushStack([]),t=0;t<r;t++)b.find(e,i[t],n);return r>1?b.uniqueSort(n):n},filter:function(e){return this.pushStack(A(this,e||[],!1))},not:function(e){return this.pushStack(A(this,e||[],!0))},is:function(e){return!!A(this,"string"==typeof e&&S.test(e)?b(e):e||[],!1).length}});var j,q=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(b.fn.init=function(e,t,n){var i,o;if(!e)return this;if(n=n||j,"string"==typeof e){if(!(i="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:q.exec(e))||!i[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(i[1]){if(t=t instanceof b?t[0]:t,b.merge(this,b.parseHTML(i[1],t&&t.nodeType?t.ownerDocument||t:r,!0)),N.test(i[1])&&b.isPlainObject(t))for(i in t)g(this[i])?this[i](t[i]):this.attr(i,t[i]);return this}return(o=r.getElementById(i[2]))&&(this[0]=o,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):g(e)?void 0!==n.ready?n.ready(e):e(b):b.makeArray(e,this)}).prototype=b.fn,j=b(r);var L=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}b.fn.extend({has:function(e){var t=b(e,this),n=t.length;return this.filter(function(){for(var e=0;e<n;e++)if(b.contains(this,t[e]))return!0})},closest:function(e,t){var n,r=0,i=this.length,o=[],a="string"!=typeof e&&b(e);if(!S.test(e))for(;r<i;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(a?a.index(n)>-1:1===n.nodeType&&b.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(o.length>1?b.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?u.call(b(e),this[0]):u.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(b.uniqueSort(b.merge(this.get(),b(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),b.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return E(e,"parentNode")},parentsUntil:function(e,t,n){return E(e,"parentNode",n)},next:function(e){return O(e,"nextSibling")},prev:function(e){return O(e,"previousSibling")},nextAll:function(e){return E(e,"nextSibling")},prevAll:function(e){return E(e,"previousSibling")},nextUntil:function(e,t,n){return E(e,"nextSibling",n)},prevUntil:function(e,t,n){return E(e,"previousSibling",n)},siblings:function(e){return k((e.parentNode||{}).firstChild,e)},children:function(e){return k(e.firstChild)},contents:function(e){return D(e,"iframe")?e.contentDocument:(D(e,"template")&&(e=e.content||e),b.merge([],e.childNodes))}},function(e,t){b.fn[e]=function(n,r){var i=b.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=b.filter(r,i)),this.length>1&&(H[e]||b.uniqueSort(i),L.test(e)&&i.reverse()),this.pushStack(i)}});var P=/[^\x20\t\r\n\f]+/g;function M(e){return e}function R(e){throw e}function I(e,t,n,r){var i;try{e&&g(i=e.promise)?i.call(e).done(t).fail(n):e&&g(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}b.Callbacks=function(e){e="string"==typeof e?function(e){var t={};return b.each(e.match(P)||[],function(e,n){t[n]=!0}),t}(e):b.extend({},e);var t,n,r,i,o=[],a=[],s=-1,u=function(){for(i=i||e.once,r=t=!0;a.length;s=-1)for(n=a.shift();++s<o.length;)!1===o[s].apply(n[0],n[1])&&e.stopOnFalse&&(s=o.length,n=!1);e.memory||(n=!1),t=!1,i&&(o=n?[]:"")},l={add:function(){return o&&(n&&!t&&(s=o.length-1,a.push(n)),function t(n){b.each(n,function(n,r){g(r)?e.unique&&l.has(r)||o.push(r):r&&r.length&&"string"!==x(r)&&t(r)})}(arguments),n&&!t&&u()),this},remove:function(){return b.each(arguments,function(e,t){for(var n;(n=b.inArray(t,o,n))>-1;)o.splice(n,1),n<=s&&s--}),this},has:function(e){return e?b.inArray(e,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return i=a=[],o=n="",this},disabled:function(){return!o},lock:function(){return i=a=[],n||t||(o=n=""),this},locked:function(){return!!i},fireWith:function(e,n){return i||(n=[e,(n=n||[]).slice?n.slice():n],a.push(n),t||u()),this},fire:function(){return l.fireWith(this,arguments),this},fired:function(){return!!r}};return l},b.extend({Deferred:function(t){var n=[["notify","progress",b.Callbacks("memory"),b.Callbacks("memory"),2],["resolve","done",b.Callbacks("once memory"),b.Callbacks("once memory"),0,"resolved"],["reject","fail",b.Callbacks("once memory"),b.Callbacks("once memory"),1,"rejected"]],r="pending",i={state:function(){return r},always:function(){return o.done(arguments).fail(arguments),this},catch:function(e){return i.then(null,e)},pipe:function(){var e=arguments;return b.Deferred(function(t){b.each(n,function(n,r){var i=g(e[r[4]])&&e[r[4]];o[r[1]](function(){var e=i&&i.apply(this,arguments);e&&g(e.promise)?e.promise().progress(t.notify).done(t.resolve).fail(t.reject):t[r[0]+"With"](this,i?[e]:arguments)})}),e=null}).promise()},then:function(t,r,i){var o=0;function a(t,n,r,i){return function(){var s=this,u=arguments,l=function(){var e,l;if(!(t<o)){if((e=r.apply(s,u))===n.promise())throw new TypeError("Thenable self-resolution");l=e&&("object"==typeof e||"function"==typeof e)&&e.then,g(l)?i?l.call(e,a(o,n,M,i),a(o,n,R,i)):(o++,l.call(e,a(o,n,M,i),a(o,n,R,i),a(o,n,M,n.notifyWith))):(r!==M&&(s=void 0,u=[e]),(i||n.resolveWith)(s,u))}},c=i?l:function(){try{l()}catch(e){b.Deferred.exceptionHook&&b.Deferred.exceptionHook(e,c.stackTrace),t+1>=o&&(r!==R&&(s=void 0,u=[e]),n.rejectWith(s,u))}};t?c():(b.Deferred.getStackHook&&(c.stackTrace=b.Deferred.getStackHook()),e.setTimeout(c))}}return b.Deferred(function(e){n[0][3].add(a(0,e,g(i)?i:M,e.notifyWith)),n[1][3].add(a(0,e,g(t)?t:M)),n[2][3].add(a(0,e,g(r)?r:R))}).promise()},promise:function(e){return null!=e?b.extend(e,i):i}},o={};return b.each(n,function(e,t){var a=t[2],s=t[5];i[t[1]]=a.add,s&&a.add(function(){r=s},n[3-e][2].disable,n[3-e][3].disable,n[0][2].lock,n[0][3].lock),a.add(t[3].fire),o[t[0]]=function(){return o[t[0]+"With"](this===o?void 0:this,arguments),this},o[t[0]+"With"]=a.fireWith}),i.promise(o),t&&t.call(o,o),o},when:function(e){var t=arguments.length,n=t,r=Array(n),i=o.call(arguments),a=b.Deferred(),s=function(e){return function(n){r[e]=this,i[e]=arguments.length>1?o.call(arguments):n,--t||a.resolveWith(r,i)}};if(t<=1&&(I(e,a.done(s(n)).resolve,a.reject,!t),"pending"===a.state()||g(i[n]&&i[n].then)))return a.then();for(;n--;)I(i[n],s(n),a.reject);return a.promise()}});var W=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;b.Deferred.exceptionHook=function(t,n){e.console&&e.console.warn&&t&&W.test(t.name)&&e.console.warn("jQuery.Deferred exception: "+t.message,t.stack,n)},b.readyException=function(t){e.setTimeout(function(){throw t})};var $=b.Deferred();function B(){r.removeEventListener("DOMContentLoaded",B),e.removeEventListener("load",B),b.ready()}b.fn.ready=function(e){return $.then(e).catch(function(e){b.readyException(e)}),this},b.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--b.readyWait:b.isReady)||(b.isReady=!0,!0!==e&&--b.readyWait>0||$.resolveWith(r,[b]))}}),b.ready.then=$.then,"complete"===r.readyState||"loading"!==r.readyState&&!r.documentElement.doScroll?e.setTimeout(b.ready):(r.addEventListener("DOMContentLoaded",B),e.addEventListener("load",B));var F=function(e,t,n,r,i,o,a){var s=0,u=e.length,l=null==n;if("object"===x(n))for(s in i=!0,n)F(e,t,s,n[s],!0,o,a);else if(void 0!==r&&(i=!0,g(r)||(a=!0),l&&(a?(t.call(e,r),t=null):(l=t,t=function(e,t,n){return l.call(b(e),n)})),t))for(;s<u;s++)t(e[s],n,a?r:r.call(e[s],s,t(e[s],n)));return i?e:l?t.call(e):u?t(e[0],n):o},_=/^-ms-/,z=/-([a-z])/g;function X(e,t){return t.toUpperCase()}function U(e){return e.replace(_,"ms-").replace(z,X)}var V=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};function G(){this.expando=b.expando+G.uid++}G.uid=1,G.prototype={cache:function(e){var t=e[this.expando];return t||(t={},V(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,n){var r,i=this.cache(e);if("string"==typeof t)i[U(t)]=n;else for(r in t)i[U(r)]=t[r];return i},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][U(t)]},access:function(e,t,n){return void 0===t||t&&"string"==typeof t&&void 0===n?this.get(e,t):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,r=e[this.expando];if(void 0!==r){if(void 0!==t){n=(t=Array.isArray(t)?t.map(U):(t=U(t))in r?[t]:t.match(P)||[]).length;for(;n--;)delete r[t[n]]}(void 0===t||b.isEmptyObject(r))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!b.isEmptyObject(t)}};var Y=new G,Q=new G,J=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,K=/[A-Z]/g;function Z(e,t,n){var r;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace(K,"-$&").toLowerCase(),"string"==typeof(n=e.getAttribute(r))){try{n=function(e){return"true"===e||"false"!==e&&("null"===e?null:e===+e+""?+e:J.test(e)?JSON.parse(e):e)}(n)}catch(e){}Q.set(e,t,n)}else n=void 0;return n}b.extend({hasData:function(e){return Q.hasData(e)||Y.hasData(e)},data:function(e,t,n){return Q.access(e,t,n)},removeData:function(e,t){Q.remove(e,t)},_data:function(e,t,n){return Y.access(e,t,n)},_removeData:function(e,t){Y.remove(e,t)}}),b.fn.extend({data:function(e,t){var n,r,i,o=this[0],a=o&&o.attributes;if(void 0===e){if(this.length&&(i=Q.get(o),1===o.nodeType&&!Y.get(o,"hasDataAttrs"))){for(n=a.length;n--;)a[n]&&0===(r=a[n].name).indexOf("data-")&&(r=U(r.slice(5)),Z(o,r,i[r]));Y.set(o,"hasDataAttrs",!0)}return i}return"object"==typeof e?this.each(function(){Q.set(this,e)}):F(this,function(t){var n;if(o&&void 0===t)return void 0!==(n=Q.get(o,e))?n:void 0!==(n=Z(o,e))?n:void 0;this.each(function(){Q.set(this,e,t)})},null,t,arguments.length>1,null,!0)},removeData:function(e){return this.each(function(){Q.remove(this,e)})}}),b.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=Y.get(e,t),n&&(!r||Array.isArray(n)?r=Y.access(e,t,b.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=b.queue(e,t),r=n.length,i=n.shift(),o=b._queueHooks(e,t);"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,function(){b.dequeue(e,t)},o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return Y.get(e,n)||Y.access(e,n,{empty:b.Callbacks("once memory").add(function(){Y.remove(e,[t+"queue",n])})})}}),b.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length<n?b.queue(this[0],e):void 0===t?this:this.each(function(){var n=b.queue(this,e,t);b._queueHooks(this,e),"fx"===e&&"inprogress"!==n[0]&&b.dequeue(this,e)})},dequeue:function(e){return this.each(function(){b.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,i=b.Deferred(),o=this,a=this.length,s=function(){--r||i.resolveWith(o,[o])};for("string"!=typeof e&&(t=e,e=void 0),e=e||"fx";a--;)(n=Y.get(o[a],e+"queueHooks"))&&n.empty&&(r++,n.empty.add(s));return s(),i.promise(t)}});var ee=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,te=new RegExp("^(?:([+-])=|)("+ee+")([a-z%]*)$","i"),ne=["Top","Right","Bottom","Left"],re=function(e,t){return"none"===(e=t||e).style.display||""===e.style.display&&b.contains(e.ownerDocument,e)&&"none"===b.css(e,"display")},ie=function(e,t,n,r){var i,o,a={};for(o in t)a[o]=e.style[o],e.style[o]=t[o];for(o in i=n.apply(e,r||[]),t)e.style[o]=a[o];return i};function oe(e,t,n,r){var i,o,a=20,s=r?function(){return r.cur()}:function(){return b.css(e,t,"")},u=s(),l=n&&n[3]||(b.cssNumber[t]?"":"px"),c=(b.cssNumber[t]||"px"!==l&&+u)&&te.exec(b.css(e,t));if(c&&c[3]!==l){for(u/=2,l=l||c[3],c=+u||1;a--;)b.style(e,t,c+l),(1-o)*(1-(o=s()/u||.5))<=0&&(a=0),c/=o;c*=2,b.style(e,t,c+l),n=n||[]}return n&&(c=+c||+u||0,i=n[1]?c+(n[1]+1)*n[2]:+n[2],r&&(r.unit=l,r.start=c,r.end=i)),i}var ae={};function se(e){var t,n=e.ownerDocument,r=e.nodeName,i=ae[r];return i||(t=n.body.appendChild(n.createElement(r)),i=b.css(t,"display"),t.parentNode.removeChild(t),"none"===i&&(i="block"),ae[r]=i,i)}function ue(e,t){for(var n,r,i=[],o=0,a=e.length;o<a;o++)(r=e[o]).style&&(n=r.style.display,t?("none"===n&&(i[o]=Y.get(r,"display")||null,i[o]||(r.style.display="")),""===r.style.display&&re(r)&&(i[o]=se(r))):"none"!==n&&(i[o]="none",Y.set(r,"display",n)));for(o=0;o<a;o++)null!=i[o]&&(e[o].style.display=i[o]);return e}b.fn.extend({show:function(){return ue(this,!0)},hide:function(){return ue(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){re(this)?b(this).show():b(this).hide()})}});var le=/^(?:checkbox|radio)$/i,ce=/<([a-z][^\/\0>\x20\t\r\n\f]+)/i,fe=/^$|^module$|\/(?:java|ecma)script/i,pe={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};function de(e,t){var n;return n=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&D(e,t)?b.merge([e],n):n}function he(e,t){for(var n=0,r=e.length;n<r;n++)Y.set(e[n],"globalEval",!t||Y.get(t[n],"globalEval"))}pe.optgroup=pe.option,pe.tbody=pe.tfoot=pe.colgroup=pe.caption=pe.thead,pe.th=pe.td;var ge,ve,ye=/<|&#?\w+;/;function me(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d<h;d++)if((o=e[d])||0===o)if("object"===x(o))b.merge(p,o.nodeType?[o]:o);else if(ye.test(o)){for(a=a||f.appendChild(t.createElement("div")),s=(ce.exec(o)||["",""])[1].toLowerCase(),u=pe[s]||pe._default,a.innerHTML=u[1]+b.htmlPrefilter(o)+u[2],c=u[0];c--;)a=a.lastChild;b.merge(p,a.childNodes),(a=f.firstChild).textContent=""}else p.push(t.createTextNode(o));for(f.textContent="",d=0;o=p[d++];)if(r&&b.inArray(o,r)>-1)i&&i.push(o);else if(l=b.contains(o.ownerDocument,o),a=de(f.appendChild(o),"script"),l&&he(a),n)for(c=0;o=a[c++];)fe.test(o.type||"")&&n.push(o);return f}ge=r.createDocumentFragment().appendChild(r.createElement("div")),(ve=r.createElement("input")).setAttribute("type","radio"),ve.setAttribute("checked","checked"),ve.setAttribute("name","t"),ge.appendChild(ve),h.checkClone=ge.cloneNode(!0).cloneNode(!0).lastChild.checked,ge.innerHTML="<textarea>x</textarea>",h.noCloneChecked=!!ge.cloneNode(!0).lastChild.defaultValue;var xe=r.documentElement,be=/^key/,we=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Te=/^([^.]*)(?:\.(.+)|)/;function Ce(){return!0}function Ee(){return!1}function ke(){try{return r.activeElement}catch(e){}}function Se(e,t,n,r,i,o){var a,s;if("object"==typeof t){for(s in"string"!=typeof n&&(r=r||n,n=void 0),t)Se(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=Ee;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return b().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=b.guid++)),e.each(function(){b.event.add(this,t,i,r,n)})}b.event={global:{},add:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Y.get(e);if(v)for(n.handler&&(n=(o=n).handler,i=o.selector),i&&b.find.matchesSelector(xe,i),n.guid||(n.guid=b.guid++),(u=v.events)||(u=v.events={}),(a=v.handle)||(a=v.handle=function(t){return void 0!==b&&b.event.triggered!==t.type?b.event.dispatch.apply(e,arguments):void 0}),l=(t=(t||"").match(P)||[""]).length;l--;)d=g=(s=Te.exec(t[l])||[])[1],h=(s[2]||"").split(".").sort(),d&&(f=b.event.special[d]||{},d=(i?f.delegateType:f.bindType)||d,f=b.event.special[d]||{},c=b.extend({type:d,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&b.expr.match.needsContext.test(i),namespace:h.join(".")},o),(p=u[d])||((p=u[d]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(e,r,h,a)||e.addEventListener&&e.addEventListener(d,a)),f.add&&(f.add.call(e,c),c.handler.guid||(c.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,c):p.push(c),b.event.global[d]=!0)},remove:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Y.hasData(e)&&Y.get(e);if(v&&(u=v.events)){for(l=(t=(t||"").match(P)||[""]).length;l--;)if(d=g=(s=Te.exec(t[l])||[])[1],h=(s[2]||"").split(".").sort(),d){for(f=b.event.special[d]||{},p=u[d=(r?f.delegateType:f.bindType)||d]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;o--;)c=p[o],!i&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,f.remove&&f.remove.call(e,c));a&&!p.length&&(f.teardown&&!1!==f.teardown.call(e,h,v.handle)||b.removeEvent(e,d,v.handle),delete u[d])}else for(d in u)b.event.remove(e,d+t[l],n,r,!0);b.isEmptyObject(u)&&Y.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,a,s=b.event.fix(e),u=new Array(arguments.length),l=(Y.get(this,"events")||{})[s.type]||[],c=b.event.special[s.type]||{};for(u[0]=s,t=1;t<arguments.length;t++)u[t]=arguments[t];if(s.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,s)){for(a=b.event.handlers.call(this,s,l),t=0;(i=a[t++])&&!s.isPropagationStopped();)for(s.currentTarget=i.elem,n=0;(o=i.handlers[n++])&&!s.isImmediatePropagationStopped();)s.rnamespace&&!s.rnamespace.test(o.namespace)||(s.handleObj=o,s.data=o.data,void 0!==(r=((b.event.special[o.origType]||{}).handle||o.handler).apply(i.elem,u))&&!1===(s.result=r)&&(s.preventDefault(),s.stopPropagation()));return c.postDispatch&&c.postDispatch.call(this,s),s.result}},handlers:function(e,t){var n,r,i,o,a,s=[],u=t.delegateCount,l=e.target;if(u&&l.nodeType&&!("click"===e.type&&e.button>=1))for(;l!==this;l=l.parentNode||this)if(1===l.nodeType&&("click"!==e.type||!0!==l.disabled)){for(o=[],a={},n=0;n<u;n++)void 0===a[i=(r=t[n]).selector+" "]&&(a[i]=r.needsContext?b(i,this).index(l)>-1:b.find(i,this,null,[l]).length),a[i]&&o.push(r);o.length&&s.push({elem:l,handlers:o})}return l=this,u<t.length&&s.push({elem:l,handlers:t.slice(u)}),s},addProp:function(e,t){Object.defineProperty(b.Event.prototype,e,{enumerable:!0,configurable:!0,get:g(t)?function(){if(this.originalEvent)return t(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[e]},set:function(t){Object.defineProperty(this,e,{enumerable:!0,configurable:!0,writable:!0,value:t})}})},fix:function(e){return e[b.expando]?e:new b.Event(e)},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==ke()&&this.focus)return this.focus(),!1},delegateType:"focusin"},blur:{trigger:function(){if(this===ke()&&this.blur)return this.blur(),!1},delegateType:"focusout"},click:{trigger:function(){if("checkbox"===this.type&&this.click&&D(this,"input"))return this.click(),!1},_default:function(e){return D(e.target,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},b.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},b.Event=function(e,t){if(!(this instanceof b.Event))return new b.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?Ce:Ee,this.target=e.target&&3===e.target.nodeType?e.target.parentNode:e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget):this.type=e,t&&b.extend(this,t),this.timeStamp=e&&e.timeStamp||Date.now(),this[b.expando]=!0},b.Event.prototype={constructor:b.Event,isDefaultPrevented:Ee,isPropagationStopped:Ee,isImmediatePropagationStopped:Ee,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=Ce,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=Ce,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=Ce,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},b.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,char:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:function(e){var t=e.button;return null==e.which&&be.test(e.type)?null!=e.charCode?e.charCode:e.keyCode:!e.which&&void 0!==t&&we.test(e.type)?1&t?1:2&t?3:4&t?2:0:e.which}},b.event.addProp),b.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,t){b.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=e.relatedTarget,i=e.handleObj;return r&&(r===this||b.contains(this,r))||(e.type=i.origType,n=i.handler.apply(this,arguments),e.type=t),n}}}),b.fn.extend({on:function(e,t,n,r){return Se(this,e,t,n,r)},one:function(e,t,n,r){return Se(this,e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,b(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof e){for(i in e)this.off(i,t,e[i]);return this}return!1!==t&&"function"!=typeof t||(n=t,t=void 0),!1===n&&(n=Ee),this.each(function(){b.event.remove(this,e,n,t)})}});var De=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,Ne=/<script|<style|<link/i,Ae=/checked\s*(?:[^=]|=\s*.checked.)/i,je=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function qe(e,t){return D(e,"table")&&D(11!==t.nodeType?t:t.firstChild,"tr")&&b(e).children("tbody")[0]||e}function Le(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function He(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Oe(e,t){var n,r,i,o,a,s,u,l;if(1===t.nodeType){if(Y.hasData(e)&&(o=Y.access(e),a=Y.set(t,o),l=o.events))for(i in delete a.handle,a.events={},l)for(n=0,r=l[i].length;n<r;n++)b.event.add(t,i,l[i][n]);Q.hasData(e)&&(s=Q.access(e),u=b.extend({},s),Q.set(t,u))}}function Pe(e,t,n,r){t=a.apply([],t);var i,o,s,u,l,c,f=0,p=e.length,d=p-1,v=t[0],y=g(v);if(y||p>1&&"string"==typeof v&&!h.checkClone&&Ae.test(v))return e.each(function(i){var o=e.eq(i);y&&(t[0]=v.call(this,i,o.html())),Pe(o,t,n,r)});if(p&&(o=(i=me(t,e[0].ownerDocument,!1,e,r)).firstChild,1===i.childNodes.length&&(i=o),o||r)){for(u=(s=b.map(de(i,"script"),Le)).length;f<p;f++)l=i,f!==d&&(l=b.clone(l,!0,!0),u&&b.merge(s,de(l,"script"))),n.call(e[f],l,f);if(u)for(c=s[s.length-1].ownerDocument,b.map(s,He),f=0;f<u;f++)l=s[f],fe.test(l.type||"")&&!Y.access(l,"globalEval")&&b.contains(c,l)&&(l.src&&"module"!==(l.type||"").toLowerCase()?b._evalUrl&&b._evalUrl(l.src):m(l.textContent.replace(je,""),c,l))}return e}function Me(e,t,n){for(var r,i=t?b.filter(t,e):e,o=0;null!=(r=i[o]);o++)n||1!==r.nodeType||b.cleanData(de(r)),r.parentNode&&(n&&b.contains(r.ownerDocument,r)&&he(de(r,"script")),r.parentNode.removeChild(r));return e}b.extend({htmlPrefilter:function(e){return e.replace(De,"<$1></$2>")},clone:function(e,t,n){var r,i,o,a,s,u,l,c=e.cloneNode(!0),f=b.contains(e.ownerDocument,e);if(!(h.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||b.isXMLDoc(e)))for(a=de(c),r=0,i=(o=de(e)).length;r<i;r++)s=o[r],u=a[r],void 0,"input"===(l=u.nodeName.toLowerCase())&&le.test(s.type)?u.checked=s.checked:"input"!==l&&"textarea"!==l||(u.defaultValue=s.defaultValue);if(t)if(n)for(o=o||de(e),a=a||de(c),r=0,i=o.length;r<i;r++)Oe(o[r],a[r]);else Oe(e,c);return(a=de(c,"script")).length>0&&he(a,!f&&de(e,"script")),c},cleanData:function(e){for(var t,n,r,i=b.event.special,o=0;void 0!==(n=e[o]);o++)if(V(n)){if(t=n[Y.expando]){if(t.events)for(r in t.events)i[r]?b.event.remove(n,r):b.removeEvent(n,r,t.handle);n[Y.expando]=void 0}n[Q.expando]&&(n[Q.expando]=void 0)}}}),b.fn.extend({detach:function(e){return Me(this,e,!0)},remove:function(e){return Me(this,e)},text:function(e){return F(this,function(e){return void 0===e?b.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return Pe(this,arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||qe(this,e).appendChild(e)})},prepend:function(){return Pe(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=qe(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return Pe(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return Pe(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(b.cleanData(de(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return b.clone(this,e,t)})},html:function(e){return F(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!Ne.test(e)&&!pe[(ce.exec(e)||["",""])[1].toLowerCase()]){e=b.htmlPrefilter(e);try{for(;n<r;n++)1===(t=this[n]||{}).nodeType&&(b.cleanData(de(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=[];return Pe(this,arguments,function(t){var n=this.parentNode;b.inArray(this,e)<0&&(b.cleanData(de(this)),n&&n.replaceChild(t,this))},e)}}),b.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){b.fn[e]=function(e){for(var n,r=[],i=b(e),o=i.length-1,a=0;a<=o;a++)n=a===o?this:this.clone(!0),b(i[a])[t](n),s.apply(r,n.get());return this.pushStack(r)}});var Re=new RegExp("^("+ee+")(?!px)[a-z%]+$","i"),Ie=function(t){var n=t.ownerDocument.defaultView;return n&&n.opener||(n=e),n.getComputedStyle(t)},We=new RegExp(ne.join("|"),"i");function $e(e,t,n){var r,i,o,a,s=e.style;return(n=n||Ie(e))&&(""!==(a=n.getPropertyValue(t)||n[t])||b.contains(e.ownerDocument,e)||(a=b.style(e,t)),!h.pixelBoxStyles()&&Re.test(a)&&We.test(t)&&(r=s.width,i=s.minWidth,o=s.maxWidth,s.minWidth=s.maxWidth=s.width=a,a=n.width,s.width=r,s.minWidth=i,s.maxWidth=o)),void 0!==a?a+"":a}function Be(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}!function(){function t(){if(c){l.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",c.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",xe.appendChild(l).appendChild(c);var t=e.getComputedStyle(c);i="1%"!==t.top,u=12===n(t.marginLeft),c.style.right="60%",s=36===n(t.right),o=36===n(t.width),c.style.position="absolute",a=36===c.offsetWidth||"absolute",xe.removeChild(l),c=null}}function n(e){return Math.round(parseFloat(e))}var i,o,a,s,u,l=r.createElement("div"),c=r.createElement("div");c.style&&(c.style.backgroundClip="content-box",c.cloneNode(!0).style.backgroundClip="",h.clearCloneStyle="content-box"===c.style.backgroundClip,b.extend(h,{boxSizingReliable:function(){return t(),o},pixelBoxStyles:function(){return t(),s},pixelPosition:function(){return t(),i},reliableMarginLeft:function(){return t(),u},scrollboxSize:function(){return t(),a}}))}();var Fe=/^(none|table(?!-c[ea]).+)/,_e=/^--/,ze={position:"absolute",visibility:"hidden",display:"block"},Xe={letterSpacing:"0",fontWeight:"400"},Ue=["Webkit","Moz","ms"],Ve=r.createElement("div").style;function Ge(e){var t=b.cssProps[e];return t||(t=b.cssProps[e]=function(e){if(e in Ve)return e;for(var t=e[0].toUpperCase()+e.slice(1),n=Ue.length;n--;)if((e=Ue[n]+t)in Ve)return e}(e)||e),t}function Ye(e,t,n){var r=te.exec(t);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):t}function Qe(e,t,n,r,i,o){var a="width"===t?1:0,s=0,u=0;if(n===(r?"border":"content"))return 0;for(;a<4;a+=2)"margin"===n&&(u+=b.css(e,n+ne[a],!0,i)),r?("content"===n&&(u-=b.css(e,"padding"+ne[a],!0,i)),"margin"!==n&&(u-=b.css(e,"border"+ne[a]+"Width",!0,i))):(u+=b.css(e,"padding"+ne[a],!0,i),"padding"!==n?u+=b.css(e,"border"+ne[a]+"Width",!0,i):s+=b.css(e,"border"+ne[a]+"Width",!0,i));return!r&&o>=0&&(u+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-o-u-s-.5))),u}function Je(e,t,n){var r=Ie(e),i=$e(e,t,r),o="border-box"===b.css(e,"boxSizing",!1,r),a=o;if(Re.test(i)){if(!n)return i;i="auto"}return a=a&&(h.boxSizingReliable()||i===e.style[t]),("auto"===i||!parseFloat(i)&&"inline"===b.css(e,"display",!1,r))&&(i=e["offset"+t[0].toUpperCase()+t.slice(1)],a=!0),(i=parseFloat(i)||0)+Qe(e,t,n||(o?"border":"content"),a,r,i)+"px"}function Ke(e,t,n,r,i){return new Ke.prototype.init(e,t,n,r,i)}b.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=$e(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,s=U(t),u=_e.test(t),l=e.style;if(u||(t=Ge(s)),a=b.cssHooks[t]||b.cssHooks[s],void 0===n)return a&&"get"in a&&void 0!==(i=a.get(e,!1,r))?i:l[t];"string"===(o=typeof n)&&(i=te.exec(n))&&i[1]&&(n=oe(e,t,i),o="number"),null!=n&&n==n&&("number"===o&&(n+=i&&i[3]||(b.cssNumber[s]?"":"px")),h.clearCloneStyle||""!==n||0!==t.indexOf("background")||(l[t]="inherit"),a&&"set"in a&&void 0===(n=a.set(e,n,r))||(u?l.setProperty(t,n):l[t]=n))}},css:function(e,t,n,r){var i,o,a,s=U(t);return _e.test(t)||(t=Ge(s)),(a=b.cssHooks[t]||b.cssHooks[s])&&"get"in a&&(i=a.get(e,!0,n)),void 0===i&&(i=$e(e,t,r)),"normal"===i&&t in Xe&&(i=Xe[t]),""===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),b.each(["height","width"],function(e,t){b.cssHooks[t]={get:function(e,n,r){if(n)return!Fe.test(b.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?Je(e,t,r):ie(e,ze,function(){return Je(e,t,r)})},set:function(e,n,r){var i,o=Ie(e),a="border-box"===b.css(e,"boxSizing",!1,o),s=r&&Qe(e,t,r,a,o);return a&&h.scrollboxSize()===o.position&&(s-=Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-parseFloat(o[t])-Qe(e,t,"border",!1,o)-.5)),s&&(i=te.exec(n))&&"px"!==(i[3]||"px")&&(e.style[t]=n,n=b.css(e,t)),Ye(0,n,s)}}}),b.cssHooks.marginLeft=Be(h.reliableMarginLeft,function(e,t){if(t)return(parseFloat($e(e,"marginLeft"))||e.getBoundingClientRect().left-ie(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px"}),b.each({margin:"",padding:"",border:"Width"},function(e,t){b.cssHooks[e+t]={expand:function(n){for(var r=0,i={},o="string"==typeof n?n.split(" "):[n];r<4;r++)i[e+ne[r]+t]=o[r]||o[r-2]||o[0];return i}},"margin"!==e&&(b.cssHooks[e+t].set=Ye)}),b.fn.extend({css:function(e,t){return F(this,function(e,t,n){var r,i,o={},a=0;if(Array.isArray(t)){for(r=Ie(e),i=t.length;a<i;a++)o[t[a]]=b.css(e,t[a],!1,r);return o}return void 0!==n?b.style(e,t,n):b.css(e,t)},e,t,arguments.length>1)}}),b.Tween=Ke,Ke.prototype={constructor:Ke,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||b.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(b.cssNumber[n]?"":"px")},cur:function(){var e=Ke.propHooks[this.prop];return e&&e.get?e.get(this):Ke.propHooks._default.get(this)},run:function(e){var t,n=Ke.propHooks[this.prop];return this.options.duration?this.pos=t=b.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):Ke.propHooks._default.set(this),this}},Ke.prototype.init.prototype=Ke.prototype,Ke.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=b.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){b.fx.step[e.prop]?b.fx.step[e.prop](e):1!==e.elem.nodeType||null==e.elem.style[b.cssProps[e.prop]]&&!b.cssHooks[e.prop]?e.elem[e.prop]=e.now:b.style(e.elem,e.prop,e.now+e.unit)}}},Ke.propHooks.scrollTop=Ke.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},b.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},b.fx=Ke.prototype.init,b.fx.step={};var Ze,et,tt=/^(?:toggle|show|hide)$/,nt=/queueHooks$/;function rt(){et&&(!1===r.hidden&&e.requestAnimationFrame?e.requestAnimationFrame(rt):e.setTimeout(rt,b.fx.interval),b.fx.tick())}function it(){return e.setTimeout(function(){Ze=void 0}),Ze=Date.now()}function ot(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)i["margin"+(n=ne[r])]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function at(e,t,n){for(var r,i=(st.tweeners[t]||[]).concat(st.tweeners["*"]),o=0,a=i.length;o<a;o++)if(r=i[o].call(n,t,e))return r}function st(e,t,n){var r,i,o=0,a=st.prefilters.length,s=b.Deferred().always(function(){delete u.elem}),u=function(){if(i)return!1;for(var t=Ze||it(),n=Math.max(0,l.startTime+l.duration-t),r=1-(n/l.duration||0),o=0,a=l.tweens.length;o<a;o++)l.tweens[o].run(r);return s.notifyWith(e,[l,r,n]),r<1&&a?n:(a||s.notifyWith(e,[l,1,0]),s.resolveWith(e,[l]),!1)},l=s.promise({elem:e,props:b.extend({},t),opts:b.extend(!0,{specialEasing:{},easing:b.easing._default},n),originalProperties:t,originalOptions:n,startTime:Ze||it(),duration:n.duration,tweens:[],createTween:function(t,n){var r=b.Tween(e,l.opts,t,n,l.opts.specialEasing[t]||l.opts.easing);return l.tweens.push(r),r},stop:function(t){var n=0,r=t?l.tweens.length:0;if(i)return this;for(i=!0;n<r;n++)l.tweens[n].run(1);return t?(s.notifyWith(e,[l,1,0]),s.resolveWith(e,[l,t])):s.rejectWith(e,[l,t]),this}}),c=l.props;for(!function(e,t){var n,r,i,o,a;for(n in e)if(i=t[r=U(n)],o=e[n],Array.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),(a=b.cssHooks[r])&&"expand"in a)for(n in o=a.expand(o),delete e[r],o)n in e||(e[n]=o[n],t[n]=i);else t[r]=i}(c,l.opts.specialEasing);o<a;o++)if(r=st.prefilters[o].call(l,e,c,l.opts))return g(r.stop)&&(b._queueHooks(l.elem,l.opts.queue).stop=r.stop.bind(r)),r;return b.map(c,at,l),g(l.opts.start)&&l.opts.start.call(e,l),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always),b.fx.timer(b.extend(u,{elem:e,anim:l,queue:l.opts.queue})),l}b.Animation=b.extend(st,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return oe(n.elem,e,te.exec(t),n),n}]},tweener:function(e,t){g(e)?(t=e,e=["*"]):e=e.match(P);for(var n,r=0,i=e.length;r<i;r++)n=e[r],st.tweeners[n]=st.tweeners[n]||[],st.tweeners[n].unshift(t)},prefilters:[function(e,t,n){var r,i,o,a,s,u,l,c,f="width"in t||"height"in t,p=this,d={},h=e.style,g=e.nodeType&&re(e),v=Y.get(e,"fxshow");for(r in n.queue||(null==(a=b._queueHooks(e,"fx")).unqueued&&(a.unqueued=0,s=a.empty.fire,a.empty.fire=function(){a.unqueued||s()}),a.unqueued++,p.always(function(){p.always(function(){a.unqueued--,b.queue(e,"fx").length||a.empty.fire()})})),t)if(i=t[r],tt.test(i)){if(delete t[r],o=o||"toggle"===i,i===(g?"hide":"show")){if("show"!==i||!v||void 0===v[r])continue;g=!0}d[r]=v&&v[r]||b.style(e,r)}if((u=!b.isEmptyObject(t))||!b.isEmptyObject(d))for(r in f&&1===e.nodeType&&(n.overflow=[h.overflow,h.overflowX,h.overflowY],null==(l=v&&v.display)&&(l=Y.get(e,"display")),"none"===(c=b.css(e,"display"))&&(l?c=l:(ue([e],!0),l=e.style.display||l,c=b.css(e,"display"),ue([e]))),("inline"===c||"inline-block"===c&&null!=l)&&"none"===b.css(e,"float")&&(u||(p.done(function(){h.display=l}),null==l&&(c=h.display,l="none"===c?"":c)),h.display="inline-block")),n.overflow&&(h.overflow="hidden",p.always(function(){h.overflow=n.overflow[0],h.overflowX=n.overflow[1],h.overflowY=n.overflow[2]})),u=!1,d)u||(v?"hidden"in v&&(g=v.hidden):v=Y.access(e,"fxshow",{display:l}),o&&(v.hidden=!g),g&&ue([e],!0),p.done(function(){for(r in g||ue([e]),Y.remove(e,"fxshow"),d)b.style(e,r,d[r])})),u=at(g?v[r]:0,r,p),r in v||(v[r]=u.start,g&&(u.end=u.start,u.start=0))}],prefilter:function(e,t){t?st.prefilters.unshift(e):st.prefilters.push(e)}}),b.speed=function(e,t,n){var r=e&&"object"==typeof e?b.extend({},e):{complete:n||!n&&t||g(e)&&e,duration:e,easing:n&&t||t&&!g(t)&&t};return b.fx.off?r.duration=0:"number"!=typeof r.duration&&(r.duration in b.fx.speeds?r.duration=b.fx.speeds[r.duration]:r.duration=b.fx.speeds._default),null!=r.queue&&!0!==r.queue||(r.queue="fx"),r.old=r.complete,r.complete=function(){g(r.old)&&r.old.call(this),r.queue&&b.dequeue(this,r.queue)},r},b.fn.extend({fadeTo:function(e,t,n,r){return this.filter(re).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=b.isEmptyObject(e),o=b.speed(t,n,r),a=function(){var t=st(this,b.extend({},e),o);(i||Y.get(this,"finish"))&&t.stop(!0)};return a.finish=a,i||!1===o.queue?this.each(a):this.queue(o.queue,a)},stop:function(e,t,n){var r=function(e){var t=e.stop;delete e.stop,t(n)};return"string"!=typeof e&&(n=t,t=e,e=void 0),t&&!1!==e&&this.queue(e||"fx",[]),this.each(function(){var t=!0,i=null!=e&&e+"queueHooks",o=b.timers,a=Y.get(this);if(i)a[i]&&a[i].stop&&r(a[i]);else for(i in a)a[i]&&a[i].stop&&nt.test(i)&&r(a[i]);for(i=o.length;i--;)o[i].elem!==this||null!=e&&o[i].queue!==e||(o[i].anim.stop(n),t=!1,o.splice(i,1));!t&&n||b.dequeue(this,e)})},finish:function(e){return!1!==e&&(e=e||"fx"),this.each(function(){var t,n=Y.get(this),r=n[e+"queue"],i=n[e+"queueHooks"],o=b.timers,a=r?r.length:0;for(n.finish=!0,b.queue(this,e,[]),i&&i.stop&&i.stop.call(this,!0),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;t<a;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish})}}),b.each(["toggle","show","hide"],function(e,t){var n=b.fn[t];b.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(ot(t,!0),e,r,i)}}),b.each({slideDown:ot("show"),slideUp:ot("hide"),slideToggle:ot("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){b.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),b.timers=[],b.fx.tick=function(){var e,t=0,n=b.timers;for(Ze=Date.now();t<n.length;t++)(e=n[t])()||n[t]!==e||n.splice(t--,1);n.length||b.fx.stop(),Ze=void 0},b.fx.timer=function(e){b.timers.push(e),b.fx.start()},b.fx.interval=13,b.fx.start=function(){et||(et=!0,rt())},b.fx.stop=function(){et=null},b.fx.speeds={slow:600,fast:200,_default:400},b.fn.delay=function(t,n){return t=b.fx&&b.fx.speeds[t]||t,n=n||"fx",this.queue(n,function(n,r){var i=e.setTimeout(n,t);r.stop=function(){e.clearTimeout(i)}})},function(){var e=r.createElement("input"),t=r.createElement("select").appendChild(r.createElement("option"));e.type="checkbox",h.checkOn=""!==e.value,h.optSelected=t.selected,(e=r.createElement("input")).value="t",e.type="radio",h.radioValue="t"===e.value}();var ut,lt=b.expr.attrHandle;b.fn.extend({attr:function(e,t){return F(this,b.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){b.removeAttr(this,e)})}}),b.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return void 0===e.getAttribute?b.prop(e,t,n):(1===o&&b.isXMLDoc(e)||(i=b.attrHooks[t.toLowerCase()]||(b.expr.match.bool.test(t)?ut:void 0)),void 0!==n?null===n?void b.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:null==(r=b.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!h.radioValue&&"radio"===t&&D(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,i=t&&t.match(P);if(i&&1===e.nodeType)for(;n=i[r++];)e.removeAttribute(n)}}),ut={set:function(e,t,n){return!1===t?b.removeAttr(e,n):e.setAttribute(n,n),n}},b.each(b.expr.match.bool.source.match(/\w+/g),function(e,t){var n=lt[t]||b.find.attr;lt[t]=function(e,t,r){var i,o,a=t.toLowerCase();return r||(o=lt[a],lt[a]=i,i=null!=n(e,t,r)?a:null,lt[a]=o),i}});var ct=/^(?:input|select|textarea|button)$/i,ft=/^(?:a|area)$/i;function pt(e){return(e.match(P)||[]).join(" ")}function dt(e){return e.getAttribute&&e.getAttribute("class")||""}function ht(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(P)||[]}b.fn.extend({prop:function(e,t){return F(this,b.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each(function(){delete this[b.propFix[e]||e]})}}),b.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&b.isXMLDoc(e)||(t=b.propFix[t]||t,i=b.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=b.find.attr(e,"tabindex");return t?parseInt(t,10):ct.test(e.nodeName)||ft.test(e.nodeName)&&e.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),h.optSelected||(b.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),b.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){b.propFix[this.toLowerCase()]=this}),b.fn.extend({addClass:function(e){var t,n,r,i,o,a,s,u=0;if(g(e))return this.each(function(t){b(this).addClass(e.call(this,t,dt(this)))});if((t=ht(e)).length)for(;n=this[u++];)if(i=dt(n),r=1===n.nodeType&&" "+pt(i)+" "){for(a=0;o=t[a++];)r.indexOf(" "+o+" ")<0&&(r+=o+" ");i!==(s=pt(r))&&n.setAttribute("class",s)}return this},removeClass:function(e){var t,n,r,i,o,a,s,u=0;if(g(e))return this.each(function(t){b(this).removeClass(e.call(this,t,dt(this)))});if(!arguments.length)return this.attr("class","");if((t=ht(e)).length)for(;n=this[u++];)if(i=dt(n),r=1===n.nodeType&&" "+pt(i)+" "){for(a=0;o=t[a++];)for(;r.indexOf(" "+o+" ")>-1;)r=r.replace(" "+o+" "," ");i!==(s=pt(r))&&n.setAttribute("class",s)}return this},toggleClass:function(e,t){var n=typeof e,r="string"===n||Array.isArray(e);return"boolean"==typeof t&&r?t?this.addClass(e):this.removeClass(e):g(e)?this.each(function(n){b(this).toggleClass(e.call(this,n,dt(this),t),t)}):this.each(function(){var t,i,o,a;if(r)for(i=0,o=b(this),a=ht(e);t=a[i++];)o.hasClass(t)?o.removeClass(t):o.addClass(t);else void 0!==e&&"boolean"!==n||((t=dt(this))&&Y.set(this,"__className__",t),this.setAttribute&&this.setAttribute("class",t||!1===e?"":Y.get(this,"__className__")||""))})},hasClass:function(e){var t,n,r=0;for(t=" "+e+" ";n=this[r++];)if(1===n.nodeType&&(" "+pt(dt(n))+" ").indexOf(t)>-1)return!0;return!1}});var gt=/\r/g;b.fn.extend({val:function(e){var t,n,r,i=this[0];return arguments.length?(r=g(e),this.each(function(n){var i;1===this.nodeType&&(null==(i=r?e.call(this,n,b(this).val()):e)?i="":"number"==typeof i?i+="":Array.isArray(i)&&(i=b.map(i,function(e){return null==e?"":e+""})),(t=b.valHooks[this.type]||b.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))})):i?(t=b.valHooks[i.type]||b.valHooks[i.nodeName.toLowerCase()])&&"get"in t&&void 0!==(n=t.get(i,"value"))?n:"string"==typeof(n=i.value)?n.replace(gt,""):null==n?"":n:void 0}}),b.extend({valHooks:{option:{get:function(e){var t=b.find.attr(e,"value");return null!=t?t:pt(b.text(e))}},select:{get:function(e){var t,n,r,i=e.options,o=e.selectedIndex,a="select-one"===e.type,s=a?null:[],u=a?o+1:i.length;for(r=o<0?u:a?o:0;r<u;r++)if(((n=i[r]).selected||r===o)&&!n.disabled&&(!n.parentNode.disabled||!D(n.parentNode,"optgroup"))){if(t=b(n).val(),a)return t;s.push(t)}return s},set:function(e,t){for(var n,r,i=e.options,o=b.makeArray(t),a=i.length;a--;)((r=i[a]).selected=b.inArray(b.valHooks.option.get(r),o)>-1)&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),b.each(["radio","checkbox"],function(){b.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=b.inArray(b(e).val(),t)>-1}},h.checkOn||(b.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}),h.focusin="onfocusin"in e;var vt=/^(?:focusinfocus|focusoutblur)$/,yt=function(e){e.stopPropagation()};b.extend(b.event,{trigger:function(t,n,i,o){var a,s,u,l,c,p,d,h,y=[i||r],m=f.call(t,"type")?t.type:t,x=f.call(t,"namespace")?t.namespace.split("."):[];if(s=h=u=i=i||r,3!==i.nodeType&&8!==i.nodeType&&!vt.test(m+b.event.triggered)&&(m.indexOf(".")>-1&&(m=(x=m.split(".")).shift(),x.sort()),c=m.indexOf(":")<0&&"on"+m,(t=t[b.expando]?t:new b.Event(m,"object"==typeof t&&t)).isTrigger=o?2:3,t.namespace=x.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+x.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=i),n=null==n?[t]:b.makeArray(n,[t]),d=b.event.special[m]||{},o||!d.trigger||!1!==d.trigger.apply(i,n))){if(!o&&!d.noBubble&&!v(i)){for(l=d.delegateType||m,vt.test(l+m)||(s=s.parentNode);s;s=s.parentNode)y.push(s),u=s;u===(i.ownerDocument||r)&&y.push(u.defaultView||u.parentWindow||e)}for(a=0;(s=y[a++])&&!t.isPropagationStopped();)h=s,t.type=a>1?l:d.bindType||m,(p=(Y.get(s,"events")||{})[t.type]&&Y.get(s,"handle"))&&p.apply(s,n),(p=c&&s[c])&&p.apply&&V(s)&&(t.result=p.apply(s,n),!1===t.result&&t.preventDefault());return t.type=m,o||t.isDefaultPrevented()||d._default&&!1!==d._default.apply(y.pop(),n)||!V(i)||c&&g(i[m])&&!v(i)&&((u=i[c])&&(i[c]=null),b.event.triggered=m,t.isPropagationStopped()&&h.addEventListener(m,yt),i[m](),t.isPropagationStopped()&&h.removeEventListener(m,yt),b.event.triggered=void 0,u&&(i[c]=u)),t.result}},simulate:function(e,t,n){var r=b.extend(new b.Event,n,{type:e,isSimulated:!0});b.event.trigger(r,null,t)}}),b.fn.extend({trigger:function(e,t){return this.each(function(){b.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return b.event.trigger(e,t,n,!0)}}),h.focusin||b.each({focus:"focusin",blur:"focusout"},function(e,t){var n=function(e){b.event.simulate(t,e.target,b.event.fix(e))};b.event.special[t]={setup:function(){var r=this.ownerDocument||this,i=Y.access(r,t);i||r.addEventListener(e,n,!0),Y.access(r,t,(i||0)+1)},teardown:function(){var r=this.ownerDocument||this,i=Y.access(r,t)-1;i?Y.access(r,t,i):(r.removeEventListener(e,n,!0),Y.remove(r,t))}}});var mt=e.location,xt=Date.now(),bt=/\?/;b.parseXML=function(t){var n;if(!t||"string"!=typeof t)return null;try{n=(new e.DOMParser).parseFromString(t,"text/xml")}catch(e){n=void 0}return n&&!n.getElementsByTagName("parsererror").length||b.error("Invalid XML: "+t),n};var wt=/\[\]$/,Tt=/\r?\n/g,Ct=/^(?:submit|button|image|reset|file)$/i,Et=/^(?:input|select|textarea|keygen)/i;function kt(e,t,n,r){var i;if(Array.isArray(t))b.each(t,function(t,i){n||wt.test(e)?r(e,i):kt(e+"["+("object"==typeof i&&null!=i?t:"")+"]",i,n,r)});else if(n||"object"!==x(t))r(e,t);else for(i in t)kt(e+"["+i+"]",t[i],n,r)}b.param=function(e,t){var n,r=[],i=function(e,t){var n=g(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(Array.isArray(e)||e.jquery&&!b.isPlainObject(e))b.each(e,function(){i(this.name,this.value)});else for(n in e)kt(n,e[n],t,i);return r.join("&")},b.fn.extend({serialize:function(){return b.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=b.prop(this,"elements");return e?b.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!b(this).is(":disabled")&&Et.test(this.nodeName)&&!Ct.test(e)&&(this.checked||!le.test(e))}).map(function(e,t){var n=b(this).val();return null==n?null:Array.isArray(n)?b.map(n,function(e){return{name:t.name,value:e.replace(Tt,"\r\n")}}):{name:t.name,value:n.replace(Tt,"\r\n")}}).get()}});var St=/%20/g,Dt=/#.*$/,Nt=/([?&])_=[^&]*/,At=/^(.*?):[ \t]*([^\r\n]*)$/gm,jt=/^(?:GET|HEAD)$/,qt=/^\/\//,Lt={},Ht={},Ot="*/".concat("*"),Pt=r.createElement("a");function Mt(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(P)||[];if(g(n))for(;r=o[i++];)"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function Rt(e,t,n,r){var i={},o=e===Ht;function a(s){var u;return i[s]=!0,b.each(e[s]||[],function(e,s){var l=s(t,n,r);return"string"!=typeof l||o||i[l]?o?!(u=l):void 0:(t.dataTypes.unshift(l),a(l),!1)}),u}return a(t.dataTypes[0])||!i["*"]&&a("*")}function It(e,t){var n,r,i=b.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&b.extend(!0,e,r),e}Pt.href=mt.href,b.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:mt.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(mt.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Ot,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":b.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?It(It(e,b.ajaxSettings),t):It(b.ajaxSettings,e)},ajaxPrefilter:Mt(Lt),ajaxTransport:Mt(Ht),ajax:function(t,n){"object"==typeof t&&(n=t,t=void 0),n=n||{};var i,o,a,s,u,l,c,f,p,d,h=b.ajaxSetup({},n),g=h.context||h,v=h.context&&(g.nodeType||g.jquery)?b(g):b.event,y=b.Deferred(),m=b.Callbacks("once memory"),x=h.statusCode||{},w={},T={},C="canceled",E={readyState:0,getResponseHeader:function(e){var t;if(c){if(!s)for(s={};t=At.exec(a);)s[t[1].toLowerCase()]=t[2];t=s[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return c?a:null},setRequestHeader:function(e,t){return null==c&&(e=T[e.toLowerCase()]=T[e.toLowerCase()]||e,w[e]=t),this},overrideMimeType:function(e){return null==c&&(h.mimeType=e),this},statusCode:function(e){var t;if(e)if(c)E.always(e[E.status]);else for(t in e)x[t]=[x[t],e[t]];return this},abort:function(e){var t=e||C;return i&&i.abort(t),k(0,t),this}};if(y.promise(E),h.url=((t||h.url||mt.href)+"").replace(qt,mt.protocol+"//"),h.type=n.method||n.type||h.method||h.type,h.dataTypes=(h.dataType||"*").toLowerCase().match(P)||[""],null==h.crossDomain){l=r.createElement("a");try{l.href=h.url,l.href=l.href,h.crossDomain=Pt.protocol+"//"+Pt.host!=l.protocol+"//"+l.host}catch(e){h.crossDomain=!0}}if(h.data&&h.processData&&"string"!=typeof h.data&&(h.data=b.param(h.data,h.traditional)),Rt(Lt,h,n,E),c)return E;for(p in(f=b.event&&h.global)&&0==b.active++&&b.event.trigger("ajaxStart"),h.type=h.type.toUpperCase(),h.hasContent=!jt.test(h.type),o=h.url.replace(Dt,""),h.hasContent?h.data&&h.processData&&0===(h.contentType||"").indexOf("application/x-www-form-urlencoded")&&(h.data=h.data.replace(St,"+")):(d=h.url.slice(o.length),h.data&&(h.processData||"string"==typeof h.data)&&(o+=(bt.test(o)?"&":"?")+h.data,delete h.data),!1===h.cache&&(o=o.replace(Nt,"$1"),d=(bt.test(o)?"&":"?")+"_="+xt+++d),h.url=o+d),h.ifModified&&(b.lastModified[o]&&E.setRequestHeader("If-Modified-Since",b.lastModified[o]),b.etag[o]&&E.setRequestHeader("If-None-Match",b.etag[o])),(h.data&&h.hasContent&&!1!==h.contentType||n.contentType)&&E.setRequestHeader("Content-Type",h.contentType),E.setRequestHeader("Accept",h.dataTypes[0]&&h.accepts[h.dataTypes[0]]?h.accepts[h.dataTypes[0]]+("*"!==h.dataTypes[0]?", "+Ot+"; q=0.01":""):h.accepts["*"]),h.headers)E.setRequestHeader(p,h.headers[p]);if(h.beforeSend&&(!1===h.beforeSend.call(g,E,h)||c))return E.abort();if(C="abort",m.add(h.complete),E.done(h.success),E.fail(h.error),i=Rt(Ht,h,n,E)){if(E.readyState=1,f&&v.trigger("ajaxSend",[E,h]),c)return E;h.async&&h.timeout>0&&(u=e.setTimeout(function(){E.abort("timeout")},h.timeout));try{c=!1,i.send(w,k)}catch(e){if(c)throw e;k(-1,e)}}else k(-1,"No Transport");function k(t,n,r,s){var l,p,d,w,T,C=n;c||(c=!0,u&&e.clearTimeout(u),i=void 0,a=s||"",E.readyState=t>0?4:0,l=t>=200&&t<300||304===t,r&&(w=function(e,t,n){for(var r,i,o,a,s=e.contents,u=e.dataTypes;"*"===u[0];)u.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in s)if(s[i]&&s[i].test(r)){u.unshift(i);break}if(u[0]in n)o=u[0];else{for(i in n){if(!u[0]||e.converters[i+" "+u[0]]){o=i;break}a||(a=i)}o=o||a}if(o)return o!==u[0]&&u.unshift(o),n[o]}(h,E,r)),w=function(e,t,n,r){var i,o,a,s,u,l={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)l[a.toLowerCase()]=e.converters[a];for(o=c.shift();o;)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!u&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u=o,o=c.shift())if("*"===o)o=u;else if("*"!==u&&u!==o){if(!(a=l[u+" "+o]||l["* "+o]))for(i in l)if((s=i.split(" "))[1]===o&&(a=l[u+" "+s[0]]||l["* "+s[0]])){!0===a?a=l[i]:!0!==l[i]&&(o=s[0],c.unshift(s[1]));break}if(!0!==a)if(a&&e.throws)t=a(t);else try{t=a(t)}catch(e){return{state:"parsererror",error:a?e:"No conversion from "+u+" to "+o}}}return{state:"success",data:t}}(h,w,E,l),l?(h.ifModified&&((T=E.getResponseHeader("Last-Modified"))&&(b.lastModified[o]=T),(T=E.getResponseHeader("etag"))&&(b.etag[o]=T)),204===t||"HEAD"===h.type?C="nocontent":304===t?C="notmodified":(C=w.state,p=w.data,l=!(d=w.error))):(d=C,!t&&C||(C="error",t<0&&(t=0))),E.status=t,E.statusText=(n||C)+"",l?y.resolveWith(g,[p,C,E]):y.rejectWith(g,[E,C,d]),E.statusCode(x),x=void 0,f&&v.trigger(l?"ajaxSuccess":"ajaxError",[E,h,l?p:d]),m.fireWith(g,[E,C]),f&&(v.trigger("ajaxComplete",[E,h]),--b.active||b.event.trigger("ajaxStop")))}return E},getJSON:function(e,t,n){return b.get(e,t,n,"json")},getScript:function(e,t){return b.get(e,void 0,t,"script")}}),b.each(["get","post"],function(e,t){b[t]=function(e,n,r,i){return g(n)&&(i=i||r,r=n,n=void 0),b.ajax(b.extend({url:e,type:t,dataType:i,data:n,success:r},b.isPlainObject(e)&&e))}}),b._evalUrl=function(e){return b.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,throws:!0})},b.fn.extend({wrapAll:function(e){var t;return this[0]&&(g(e)&&(e=e.call(this[0])),t=b(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(e){return g(e)?this.each(function(t){b(this).wrapInner(e.call(this,t))}):this.each(function(){var t=b(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=g(e);return this.each(function(n){b(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(e){return this.parent(e).not("body").each(function(){b(this).replaceWith(this.childNodes)}),this}}),b.expr.pseudos.hidden=function(e){return!b.expr.pseudos.visible(e)},b.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},b.ajaxSettings.xhr=function(){try{return new e.XMLHttpRequest}catch(e){}};var Wt={0:200,1223:204},$t=b.ajaxSettings.xhr();h.cors=!!$t&&"withCredentials"in $t,h.ajax=$t=!!$t,b.ajaxTransport(function(t){var n,r;if(h.cors||$t&&!t.crossDomain)return{send:function(i,o){var a,s=t.xhr();if(s.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(a in t.xhrFields)s[a]=t.xhrFields[a];for(a in t.mimeType&&s.overrideMimeType&&s.overrideMimeType(t.mimeType),t.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest"),i)s.setRequestHeader(a,i[a]);n=function(e){return function(){n&&(n=r=s.onload=s.onerror=s.onabort=s.ontimeout=s.onreadystatechange=null,"abort"===e?s.abort():"error"===e?"number"!=typeof s.status?o(0,"error"):o(s.status,s.statusText):o(Wt[s.status]||s.status,s.statusText,"text"!==(s.responseType||"text")||"string"!=typeof s.responseText?{binary:s.response}:{text:s.responseText},s.getAllResponseHeaders()))}},s.onload=n(),r=s.onerror=s.ontimeout=n("error"),void 0!==s.onabort?s.onabort=r:s.onreadystatechange=function(){4===s.readyState&&e.setTimeout(function(){n&&r()})},n=n("abort");try{s.send(t.hasContent&&t.data||null)}catch(e){if(n)throw e}},abort:function(){n&&n()}}}),b.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),b.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return b.globalEval(e),e}}}),b.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),b.ajaxTransport("script",function(e){var t,n;if(e.crossDomain)return{send:function(i,o){t=b("<script>").prop({charset:e.scriptCharset,src:e.url}).on("load error",n=function(e){t.remove(),n=null,e&&o("error"===e.type?404:200,e.type)}),r.head.appendChild(t[0])},abort:function(){n&&n()}}});var Bt,Ft=[],_t=/(=)\?(?=&|$)|\?\?/;b.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Ft.pop()||b.expando+"_"+xt++;return this[e]=!0,e}}),b.ajaxPrefilter("json jsonp",function(t,n,r){var i,o,a,s=!1!==t.jsonp&&(_t.test(t.url)?"url":"string"==typeof t.data&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&_t.test(t.data)&&"data");if(s||"jsonp"===t.dataTypes[0])return i=t.jsonpCallback=g(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,s?t[s]=t[s].replace(_t,"$1"+i):!1!==t.jsonp&&(t.url+=(bt.test(t.url)?"&":"?")+t.jsonp+"="+i),t.converters["script json"]=function(){return a||b.error(i+" was not called"),a[0]},t.dataTypes[0]="json",o=e[i],e[i]=function(){a=arguments},r.always(function(){void 0===o?b(e).removeProp(i):e[i]=o,t[i]&&(t.jsonpCallback=n.jsonpCallback,Ft.push(i)),a&&g(o)&&o(a[0]),a=o=void 0}),"script"}),h.createHTMLDocument=((Bt=r.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===Bt.childNodes.length),b.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(h.createHTMLDocument?((i=(t=r.implementation.createHTMLDocument("")).createElement("base")).href=r.location.href,t.head.appendChild(i)):t=r),o=N.exec(e),a=!n&&[],o?[t.createElement(o[1])]:(o=me([e],t,a),a&&a.length&&b(a).remove(),b.merge([],o.childNodes)));var i,o,a},b.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return s>-1&&(r=pt(e.slice(s)),e=e.slice(0,s)),g(t)?(n=t,t=void 0):t&&"object"==typeof t&&(i="POST"),a.length>0&&b.ajax({url:e,type:i||"GET",dataType:"html",data:t}).done(function(e){o=arguments,a.html(r?b("<div>").append(b.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},b.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){b.fn[t]=function(e){return this.on(t,e)}}),b.expr.pseudos.animated=function(e){return b.grep(b.timers,function(t){return e===t.elem}).length},b.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=b.css(e,"position"),c=b(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=b.css(e,"top"),u=b.css(e,"left"),("absolute"===l||"fixed"===l)&&(o+u).indexOf("auto")>-1?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),g(t)&&(t=t.call(e,n,b.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},b.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each(function(t){b.offset.setOffset(this,e,t)});var t,n,r=this[0];return r?r.getClientRects().length?(t=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:t.top+n.pageYOffset,left:t.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===b.css(r,"position"))t=r.getBoundingClientRect();else{for(t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;e&&(e===n.body||e===n.documentElement)&&"static"===b.css(e,"position");)e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=b(e).offset()).top+=b.css(e,"borderTopWidth",!0),i.left+=b.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-b.css(r,"marginTop",!0),left:t.left-i.left-b.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent;e&&"static"===b.css(e,"position");)e=e.offsetParent;return e||xe})}}),b.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,t){var n="pageYOffset"===t;b.fn[e]=function(r){return F(this,function(e,r,i){var o;if(v(e)?o=e:9===e.nodeType&&(o=e.defaultView),void 0===i)return o?o[t]:e[r];o?o.scrollTo(n?o.pageXOffset:i,n?i:o.pageYOffset):e[r]=i},e,r,arguments.length)}}),b.each(["top","left"],function(e,t){b.cssHooks[t]=Be(h.pixelPosition,function(e,n){if(n)return n=$e(e,t),Re.test(n)?b(e).position()[t]+"px":n})}),b.each({Height:"height",Width:"width"},function(e,t){b.each({padding:"inner"+e,content:t,"":"outer"+e},function(n,r){b.fn[r]=function(i,o){var a=arguments.length&&(n||"boolean"!=typeof i),s=n||(!0===i||!0===o?"margin":"border");return F(this,function(t,n,i){var o;return v(t)?0===r.indexOf("outer")?t["inner"+e]:t.document.documentElement["client"+e]:9===t.nodeType?(o=t.documentElement,Math.max(t.body["scroll"+e],o["scroll"+e],t.body["offset"+e],o["offset"+e],o["client"+e])):void 0===i?b.css(t,n,s):b.style(t,n,i,s)},t,a?i:void 0,a)}})}),b.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,t){b.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),b.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),b.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)}}),b.proxy=function(e,t){var n,r,i;if("string"==typeof t&&(n=e[t],t=e,e=n),g(e))return r=o.call(arguments,2),(i=function(){return e.apply(t||this,r.concat(o.call(arguments)))}).guid=e.guid=e.guid||b.guid++,i},b.holdReady=function(e){e?b.readyWait++:b.ready(!0)},b.isArray=Array.isArray,b.parseJSON=JSON.parse,b.nodeName=D,b.isFunction=g,b.isWindow=v,b.camelCase=U,b.type=x,b.now=Date.now,b.isNumeric=function(e){var t=b.type(e);return("number"===t||"string"===t)&&!isNaN(e-parseFloat(e))},"function"==typeof define&&define.amd&&define("jquery",[],function(){return b});var zt=e.jQuery,Xt=e.$;return b.noConflict=function(t){return e.$===b&&(e.$=Xt),t&&e.jQuery===b&&(e.jQuery=zt),b},t||(e.jQuery=e.$=b),b});
},{"process":8}],5:[function(require,module,exports) {
var global = (1,eval)("this");
var t=(0,eval)("this");!function(e){var i="object"==typeof self&&self.self===self&&self||"object"==typeof t&&t.global===t&&t;if("function"==typeof define&&define.amd)define(["underscore","jquery","exports"],function(t,n,s){i.Backbone=e(i,s,t,n)});else if("undefined"!=typeof exports){var n,s=require("underscore");try{n=require("jquery")}catch(t){}e(i,exports,s,n)}else i.Backbone=e(i,{},i._,i.jQuery||i.Zepto||i.ender||i.$)}(function(t,e,i,n){var s=t.Backbone,r=Array.prototype.slice;e.VERSION="1.3.3",e.$=n,e.noConflict=function(){return t.Backbone=s,this},e.emulateHTTP=!1,e.emulateJSON=!1;var a=function(t,e,n){i.each(e,function(e,s){i[s]&&(t.prototype[s]=function(t,e,n){switch(t){case 1:return function(){return i[e](this[n])};case 2:return function(t){return i[e](this[n],t)};case 3:return function(t,s){return i[e](this[n],h(t,this),s)};case 4:return function(t,s,r){return i[e](this[n],h(t,this),s,r)};default:return function(){var t=r.call(arguments);return t.unshift(this[n]),i[e].apply(i,t)}}}(e,s,n))})},h=function(t,e){return i.isFunction(t)?t:i.isObject(t)&&!e._isModel(t)?o(t):i.isString(t)?function(e){return e.get(t)}:t},o=function(t){var e=i.matches(t);return function(t){return e(t.attributes)}},u=e.Events={},c=/\s+/,l=function(t,e,n,s,r){var a,h=0;if(n&&"object"==typeof n){void 0!==s&&"context"in r&&void 0===r.context&&(r.context=s);for(a=i.keys(n);h<a.length;h++)e=l(t,e,a[h],n[a[h]],r)}else if(n&&c.test(n))for(a=n.split(c);h<a.length;h++)e=t(e,a[h],s,r);else e=t(e,n,s,r);return e};u.on=function(t,e,i){return d(this,t,e,i)};var d=function(t,e,i,n,s){(t._events=l(f,t._events||{},e,i,{context:n,ctx:t,listening:s}),s)&&((t._listeners||(t._listeners={}))[s.id]=s);return t};u.listenTo=function(t,e,n){if(!t)return this;var s=t._listenId||(t._listenId=i.uniqueId("l")),r=this._listeningTo||(this._listeningTo={}),a=r[s];if(!a){var h=this._listenId||(this._listenId=i.uniqueId("l"));a=r[s]={obj:t,objId:s,id:h,listeningTo:r,count:0}}return d(t,e,n,this,a),this};var f=function(t,e,i,n){if(i){var s=t[e]||(t[e]=[]),r=n.context,a=n.ctx,h=n.listening;h&&h.count++,s.push({callback:i,context:r,ctx:r||a,listening:h})}return t};u.off=function(t,e,i){return this._events?(this._events=l(g,this._events,t,e,{context:i,listeners:this._listeners}),this):this},u.stopListening=function(t,e,n){var s=this._listeningTo;if(!s)return this;for(var r=t?[t._listenId]:i.keys(s),a=0;a<r.length;a++){var h=s[r[a]];if(!h)break;h.obj.off(e,n,this)}return this};var g=function(t,e,n,s){if(t){var r,a=0,h=s.context,o=s.listeners;if(e||n||h){for(var u=e?[e]:i.keys(t);a<u.length;a++){var c=t[e=u[a]];if(!c)break;for(var l=[],d=0;d<c.length;d++){var f=c[d];n&&n!==f.callback&&n!==f.callback._callback||h&&h!==f.context?l.push(f):(r=f.listening)&&0==--r.count&&(delete o[r.id],delete r.listeningTo[r.objId])}l.length?t[e]=l:delete t[e]}return t}for(var g=i.keys(o);a<g.length;a++)delete o[(r=o[g[a]]).id],delete r.listeningTo[r.objId]}};u.once=function(t,e,n){var s=l(p,{},t,e,i.bind(this.off,this));return"string"==typeof t&&null==n&&(e=void 0),this.on(s,e,n)},u.listenToOnce=function(t,e,n){var s=l(p,{},e,n,i.bind(this.stopListening,this,t));return this.listenTo(t,s)};var p=function(t,e,n,s){if(n){var r=t[e]=i.once(function(){s(e,r),n.apply(this,arguments)});r._callback=n}return t};u.trigger=function(t){if(!this._events)return this;for(var e=Math.max(0,arguments.length-1),i=Array(e),n=0;n<e;n++)i[n]=arguments[n+1];return l(v,this._events,t,void 0,i),this};var v=function(t,e,i,n){if(t){var s=t[e],r=t.all;s&&r&&(r=r.slice()),s&&m(s,n),r&&m(r,[e].concat(n))}return t},m=function(t,e){var i,n=-1,s=t.length,r=e[0],a=e[1],h=e[2];switch(e.length){case 0:for(;++n<s;)(i=t[n]).callback.call(i.ctx);return;case 1:for(;++n<s;)(i=t[n]).callback.call(i.ctx,r);return;case 2:for(;++n<s;)(i=t[n]).callback.call(i.ctx,r,a);return;case 3:for(;++n<s;)(i=t[n]).callback.call(i.ctx,r,a,h);return;default:for(;++n<s;)(i=t[n]).callback.apply(i.ctx,e);return}};u.bind=u.on,u.unbind=u.off,i.extend(e,u);var _=e.Model=function(t,e){var n=t||{};e||(e={}),this.cid=i.uniqueId(this.cidPrefix),this.attributes={},e.collection&&(this.collection=e.collection),e.parse&&(n=this.parse(n,e)||{});var s=i.result(this,"defaults");n=i.defaults(i.extend({},s,n),s),this.set(n,e),this.changed={},this.initialize.apply(this,arguments)};i.extend(_.prototype,u,{changed:null,validationError:null,idAttribute:"id",cidPrefix:"c",initialize:function(){},toJSON:function(t){return i.clone(this.attributes)},sync:function(){return e.sync.apply(this,arguments)},get:function(t){return this.attributes[t]},escape:function(t){return i.escape(this.get(t))},has:function(t){return null!=this.get(t)},matches:function(t){return!!i.iteratee(t,this)(this.attributes)},set:function(t,e,n){if(null==t)return this;var s;if("object"==typeof t?(s=t,n=e):(s={})[t]=e,n||(n={}),!this._validate(s,n))return!1;var r=n.unset,a=n.silent,h=[],o=this._changing;this._changing=!0,o||(this._previousAttributes=i.clone(this.attributes),this.changed={});var u=this.attributes,c=this.changed,l=this._previousAttributes;for(var d in s)e=s[d],i.isEqual(u[d],e)||h.push(d),i.isEqual(l[d],e)?delete c[d]:c[d]=e,r?delete u[d]:u[d]=e;if(this.idAttribute in s&&(this.id=this.get(this.idAttribute)),!a){h.length&&(this._pending=n);for(var f=0;f<h.length;f++)this.trigger("change:"+h[f],this,u[h[f]],n)}if(o)return this;if(!a)for(;this._pending;)n=this._pending,this._pending=!1,this.trigger("change",this,n);return this._pending=!1,this._changing=!1,this},unset:function(t,e){return this.set(t,void 0,i.extend({},e,{unset:!0}))},clear:function(t){var e={};for(var n in this.attributes)e[n]=void 0;return this.set(e,i.extend({},t,{unset:!0}))},hasChanged:function(t){return null==t?!i.isEmpty(this.changed):i.has(this.changed,t)},changedAttributes:function(t){if(!t)return!!this.hasChanged()&&i.clone(this.changed);var e=this._changing?this._previousAttributes:this.attributes,n={};for(var s in t){var r=t[s];i.isEqual(e[s],r)||(n[s]=r)}return!!i.size(n)&&n},previous:function(t){return null!=t&&this._previousAttributes?this._previousAttributes[t]:null},previousAttributes:function(){return i.clone(this._previousAttributes)},fetch:function(t){var e=this,n=(t=i.extend({parse:!0},t)).success;return t.success=function(i){var s=t.parse?e.parse(i,t):i;if(!e.set(s,t))return!1;n&&n.call(t.context,e,i,t),e.trigger("sync",e,i,t)},O(this,t),this.sync("read",this,t)},save:function(t,e,n){var s;null==t||"object"==typeof t?(s=t,n=e):(s={})[t]=e;var r=(n=i.extend({validate:!0,parse:!0},n)).wait;if(s&&!r){if(!this.set(s,n))return!1}else if(!this._validate(s,n))return!1;var a=this,h=n.success,o=this.attributes;n.success=function(t){a.attributes=o;var e=n.parse?a.parse(t,n):t;if(r&&(e=i.extend({},s,e)),e&&!a.set(e,n))return!1;h&&h.call(n.context,a,t,n),a.trigger("sync",a,t,n)},O(this,n),s&&r&&(this.attributes=i.extend({},o,s));var u=this.isNew()?"create":n.patch?"patch":"update";"patch"!==u||n.attrs||(n.attrs=s);var c=this.sync(u,this,n);return this.attributes=o,c},destroy:function(t){var e=this,n=(t=t?i.clone(t):{}).success,s=t.wait,r=function(){e.stopListening(),e.trigger("destroy",e,e.collection,t)};t.success=function(i){s&&r(),n&&n.call(t.context,e,i,t),e.isNew()||e.trigger("sync",e,i,t)};var a=!1;return this.isNew()?i.defer(t.success):(O(this,t),a=this.sync("delete",this,t)),s||r(),a},url:function(){var t=i.result(this,"urlRoot")||i.result(this.collection,"url")||M();if(this.isNew())return t;var e=this.get(this.idAttribute);return t.replace(/[^\/]$/,"$&/")+encodeURIComponent(e)},parse:function(t,e){return t},clone:function(){return new this.constructor(this.attributes)},isNew:function(){return!this.has(this.idAttribute)},isValid:function(t){return this._validate({},i.extend({},t,{validate:!0}))},_validate:function(t,e){if(!e.validate||!this.validate)return!0;t=i.extend({},this.attributes,t);var n=this.validationError=this.validate(t,e)||null;return!n||(this.trigger("invalid",this,n,i.extend(e,{validationError:n})),!1)}});a(_,{keys:1,values:1,pairs:1,invert:1,pick:0,omit:0,chain:1,isEmpty:1},"attributes");var y=e.Collection=function(t,e){e||(e={}),e.model&&(this.model=e.model),void 0!==e.comparator&&(this.comparator=e.comparator),this._reset(),this.initialize.apply(this,arguments),t&&this.reset(t,i.extend({silent:!0},e))},b={add:!0,remove:!0,merge:!0},x={add:!0,remove:!1},w=function(t,e,i){i=Math.min(Math.max(i,0),t.length);var n,s=Array(t.length-i),r=e.length;for(n=0;n<s.length;n++)s[n]=t[n+i];for(n=0;n<r;n++)t[n+i]=e[n];for(n=0;n<s.length;n++)t[n+r+i]=s[n]};i.extend(y.prototype,u,{model:_,initialize:function(){},toJSON:function(t){return this.map(function(e){return e.toJSON(t)})},sync:function(){return e.sync.apply(this,arguments)},add:function(t,e){return this.set(t,i.extend({merge:!1},e,x))},remove:function(t,e){e=i.extend({},e);var n=!i.isArray(t);t=n?[t]:t.slice();var s=this._removeModels(t,e);return!e.silent&&s.length&&(e.changes={added:[],merged:[],removed:s},this.trigger("update",this,e)),n?s[0]:s},set:function(t,e){if(null!=t){(e=i.extend({},b,e)).parse&&!this._isModel(t)&&(t=this.parse(t,e)||[]);var n=!i.isArray(t);t=n?[t]:t.slice();var s=e.at;null!=s&&(s=+s),s>this.length&&(s=this.length),s<0&&(s+=this.length+1);var r,a,h=[],o=[],u=[],c=[],l={},d=e.add,f=e.merge,g=e.remove,p=!1,v=this.comparator&&null==s&&!1!==e.sort,m=i.isString(this.comparator)?this.comparator:null;for(a=0;a<t.length;a++){r=t[a];var _=this.get(r);if(_){if(f&&r!==_){var y=this._isModel(r)?r.attributes:r;e.parse&&(y=_.parse(y,e)),_.set(y,e),u.push(_),v&&!p&&(p=_.hasChanged(m))}l[_.cid]||(l[_.cid]=!0,h.push(_)),t[a]=_}else d&&(r=t[a]=this._prepareModel(r,e))&&(o.push(r),this._addReference(r,e),l[r.cid]=!0,h.push(r))}if(g){for(a=0;a<this.length;a++)l[(r=this.models[a]).cid]||c.push(r);c.length&&this._removeModels(c,e)}var x=!1,E=!v&&d&&g;if(h.length&&E?(x=this.length!==h.length||i.some(this.models,function(t,e){return t!==h[e]}),this.models.length=0,w(this.models,h,0),this.length=this.models.length):o.length&&(v&&(p=!0),w(this.models,o,null==s?this.length:s),this.length=this.models.length),p&&this.sort({silent:!0}),!e.silent){for(a=0;a<o.length;a++)null!=s&&(e.index=s+a),(r=o[a]).trigger("add",r,this,e);(p||x)&&this.trigger("sort",this,e),(o.length||c.length||u.length)&&(e.changes={added:o,removed:c,merged:u},this.trigger("update",this,e))}return n?t[0]:t}},reset:function(t,e){e=e?i.clone(e):{};for(var n=0;n<this.models.length;n++)this._removeReference(this.models[n],e);return e.previousModels=this.models,this._reset(),t=this.add(t,i.extend({silent:!0},e)),e.silent||this.trigger("reset",this,e),t},push:function(t,e){return this.add(t,i.extend({at:this.length},e))},pop:function(t){var e=this.at(this.length-1);return this.remove(e,t)},unshift:function(t,e){return this.add(t,i.extend({at:0},e))},shift:function(t){var e=this.at(0);return this.remove(e,t)},slice:function(){return r.apply(this.models,arguments)},get:function(t){if(null!=t)return this._byId[t]||this._byId[this.modelId(t.attributes||t)]||t.cid&&this._byId[t.cid]},has:function(t){return null!=this.get(t)},at:function(t){return t<0&&(t+=this.length),this.models[t]},where:function(t,e){return this[e?"find":"filter"](t)},findWhere:function(t){return this.where(t,!0)},sort:function(t){var e=this.comparator;if(!e)throw new Error("Cannot sort a set without a comparator");t||(t={});var n=e.length;return i.isFunction(e)&&(e=i.bind(e,this)),1===n||i.isString(e)?this.models=this.sortBy(e):this.models.sort(e),t.silent||this.trigger("sort",this,t),this},pluck:function(t){return this.map(t+"")},fetch:function(t){var e=(t=i.extend({parse:!0},t)).success,n=this;return t.success=function(i){var s=t.reset?"reset":"set";n[s](i,t),e&&e.call(t.context,n,i,t),n.trigger("sync",n,i,t)},O(this,t),this.sync("read",this,t)},create:function(t,e){var n=(e=e?i.clone(e):{}).wait;if(!(t=this._prepareModel(t,e)))return!1;n||this.add(t,e);var s=this,r=e.success;return e.success=function(t,e,i){n&&s.add(t,i),r&&r.call(i.context,t,e,i)},t.save(null,e),t},parse:function(t,e){return t},clone:function(){return new this.constructor(this.models,{model:this.model,comparator:this.comparator})},modelId:function(t){return t[this.model.prototype.idAttribute||"id"]},_reset:function(){this.length=0,this.models=[],this._byId={}},_prepareModel:function(t,e){if(this._isModel(t))return t.collection||(t.collection=this),t;(e=e?i.clone(e):{}).collection=this;var n=new this.model(t,e);return n.validationError?(this.trigger("invalid",this,n.validationError,e),!1):n},_removeModels:function(t,e){for(var i=[],n=0;n<t.length;n++){var s=this.get(t[n]);if(s){var r=this.indexOf(s);this.models.splice(r,1),this.length--,delete this._byId[s.cid];var a=this.modelId(s.attributes);null!=a&&delete this._byId[a],e.silent||(e.index=r,s.trigger("remove",s,this,e)),i.push(s),this._removeReference(s,e)}}return i},_isModel:function(t){return t instanceof _},_addReference:function(t,e){this._byId[t.cid]=t;var i=this.modelId(t.attributes);null!=i&&(this._byId[i]=t),t.on("all",this._onModelEvent,this)},_removeReference:function(t,e){delete this._byId[t.cid];var i=this.modelId(t.attributes);null!=i&&delete this._byId[i],this===t.collection&&delete t.collection,t.off("all",this._onModelEvent,this)},_onModelEvent:function(t,e,i,n){if(e){if(("add"===t||"remove"===t)&&i!==this)return;if("destroy"===t&&this.remove(e,n),"change"===t){var s=this.modelId(e.previousAttributes()),r=this.modelId(e.attributes);s!==r&&(null!=s&&delete this._byId[s],null!=r&&(this._byId[r]=e))}}this.trigger.apply(this,arguments)}});a(y,{forEach:3,each:3,map:3,collect:3,reduce:0,foldl:0,inject:0,reduceRight:0,foldr:0,find:3,detect:3,filter:3,select:3,reject:3,every:3,all:3,some:3,any:3,include:3,includes:3,contains:3,invoke:0,max:3,min:3,toArray:1,size:1,first:3,head:3,take:3,initial:3,rest:3,tail:3,drop:3,last:3,without:0,difference:0,indexOf:3,shuffle:1,lastIndexOf:3,isEmpty:1,chain:1,sample:3,partition:3,groupBy:3,countBy:3,sortBy:3,indexBy:3,findIndex:3,findLastIndex:3},"models");var E=e.View=function(t){this.cid=i.uniqueId("view"),i.extend(this,i.pick(t,S)),this._ensureElement(),this.initialize.apply(this,arguments)},I=/^(\S+)\s*(.*)$/,S=["model","collection","el","id","attributes","className","tagName","events"];i.extend(E.prototype,u,{tagName:"div",$:function(t){return this.$el.find(t)},initialize:function(){},render:function(){return this},remove:function(){return this._removeElement(),this.stopListening(),this},_removeElement:function(){this.$el.remove()},setElement:function(t){return this.undelegateEvents(),this._setElement(t),this.delegateEvents(),this},_setElement:function(t){this.$el=t instanceof e.$?t:e.$(t),this.el=this.$el[0]},delegateEvents:function(t){if(t||(t=i.result(this,"events")),!t)return this;for(var e in this.undelegateEvents(),t){var n=t[e];if(i.isFunction(n)||(n=this[n]),n){var s=e.match(I);this.delegate(s[1],s[2],i.bind(n,this))}}return this},delegate:function(t,e,i){return this.$el.on(t+".delegateEvents"+this.cid,e,i),this},undelegateEvents:function(){return this.$el&&this.$el.off(".delegateEvents"+this.cid),this},undelegate:function(t,e,i){return this.$el.off(t+".delegateEvents"+this.cid,e,i),this},_createElement:function(t){return document.createElement(t)},_ensureElement:function(){if(this.el)this.setElement(i.result(this,"el"));else{var t=i.extend({},i.result(this,"attributes"));this.id&&(t.id=i.result(this,"id")),this.className&&(t.class=i.result(this,"className")),this.setElement(this._createElement(i.result(this,"tagName"))),this._setAttributes(t)}},_setAttributes:function(t){this.$el.attr(t)}}),e.sync=function(t,n,s){var r=k[t];i.defaults(s||(s={}),{emulateHTTP:e.emulateHTTP,emulateJSON:e.emulateJSON});var a={type:r,dataType:"json"};if(s.url||(a.url=i.result(n,"url")||M()),null!=s.data||!n||"create"!==t&&"update"!==t&&"patch"!==t||(a.contentType="application/json",a.data=JSON.stringify(s.attrs||n.toJSON(s))),s.emulateJSON&&(a.contentType="application/x-www-form-urlencoded",a.data=a.data?{model:a.data}:{}),s.emulateHTTP&&("PUT"===r||"DELETE"===r||"PATCH"===r)){a.type="POST",s.emulateJSON&&(a.data._method=r);var h=s.beforeSend;s.beforeSend=function(t){if(t.setRequestHeader("X-HTTP-Method-Override",r),h)return h.apply(this,arguments)}}"GET"===a.type||s.emulateJSON||(a.processData=!1);var o=s.error;s.error=function(t,e,i){s.textStatus=e,s.errorThrown=i,o&&o.call(s.context,t,e,i)};var u=s.xhr=e.ajax(i.extend(a,s));return n.trigger("request",n,u,s),u};var k={create:"POST",update:"PUT",patch:"PATCH",delete:"DELETE",read:"GET"};e.ajax=function(){return e.$.ajax.apply(e.$,arguments)};var T=e.Router=function(t){t||(t={}),t.routes&&(this.routes=t.routes),this._bindRoutes(),this.initialize.apply(this,arguments)},P=/\((.*?)\)/g,H=/(\(\?)?:\w+/g,$=/\*\w+/g,A=/[\-{}\[\]+?.,\\\^$|#\s]/g;i.extend(T.prototype,u,{initialize:function(){},route:function(t,n,s){i.isRegExp(t)||(t=this._routeToRegExp(t)),i.isFunction(n)&&(s=n,n=""),s||(s=this[n]);var r=this;return e.history.route(t,function(i){var a=r._extractParameters(t,i);!1!==r.execute(s,a,n)&&(r.trigger.apply(r,["route:"+n].concat(a)),r.trigger("route",n,a),e.history.trigger("route",r,n,a))}),this},execute:function(t,e,i){t&&t.apply(this,e)},navigate:function(t,i){return e.history.navigate(t,i),this},_bindRoutes:function(){if(this.routes){this.routes=i.result(this,"routes");for(var t,e=i.keys(this.routes);null!=(t=e.pop());)this.route(t,this.routes[t])}},_routeToRegExp:function(t){return t=t.replace(A,"\\$&").replace(P,"(?:$1)?").replace(H,function(t,e){return e?t:"([^/?]+)"}).replace($,"([^?]*?)"),new RegExp("^"+t+"(?:\\?([\\s\\S]*))?$")},_extractParameters:function(t,e){var n=t.exec(e).slice(1);return i.map(n,function(t,e){return e===n.length-1?t||null:t?decodeURIComponent(t):null})}});var C=e.History=function(){this.handlers=[],this.checkUrl=i.bind(this.checkUrl,this),"undefined"!=typeof window&&(this.location=window.location,this.history=window.history)},R=/^[#\/]|\s+$/g,j=/^\/+|\/+$/g,N=/#.*$/;C.started=!1,i.extend(C.prototype,u,{interval:50,atRoot:function(){return this.location.pathname.replace(/[^\/]$/,"$&/")===this.root&&!this.getSearch()},matchRoot:function(){return this.decodeFragment(this.location.pathname).slice(0,this.root.length-1)+"/"===this.root},decodeFragment:function(t){return decodeURI(t.replace(/%25/g,"%2525"))},getSearch:function(){var t=this.location.href.replace(/#.*/,"").match(/\?.+/);return t?t[0]:""},getHash:function(t){var e=(t||this).location.href.match(/#(.*)$/);return e?e[1]:""},getPath:function(){var t=this.decodeFragment(this.location.pathname+this.getSearch()).slice(this.root.length-1);return"/"===t.charAt(0)?t.slice(1):t},getFragment:function(t){return null==t&&(t=this._usePushState||!this._wantsHashChange?this.getPath():this.getHash()),t.replace(R,"")},start:function(t){if(C.started)throw new Error("Backbone.history has already been started");if(C.started=!0,this.options=i.extend({root:"/"},this.options,t),this.root=this.options.root,this._wantsHashChange=!1!==this.options.hashChange,this._hasHashChange="onhashchange"in window&&(void 0===document.documentMode||document.documentMode>7),this._useHashChange=this._wantsHashChange&&this._hasHashChange,this._wantsPushState=!!this.options.pushState,this._hasPushState=!(!this.history||!this.history.pushState),this._usePushState=this._wantsPushState&&this._hasPushState,this.fragment=this.getFragment(),this.root=("/"+this.root+"/").replace(j,"/"),this._wantsHashChange&&this._wantsPushState){if(!this._hasPushState&&!this.atRoot()){var e=this.root.slice(0,-1)||"/";return this.location.replace(e+"#"+this.getPath()),!0}this._hasPushState&&this.atRoot()&&this.navigate(this.getHash(),{replace:!0})}if(!this._hasHashChange&&this._wantsHashChange&&!this._usePushState){this.iframe=document.createElement("iframe"),this.iframe.src="javascript:0",this.iframe.style.display="none",this.iframe.tabIndex=-1;var n=document.body,s=n.insertBefore(this.iframe,n.firstChild).contentWindow;s.document.open(),s.document.close(),s.location.hash="#"+this.fragment}var r=window.addEventListener||function(t,e){return attachEvent("on"+t,e)};if(this._usePushState?r("popstate",this.checkUrl,!1):this._useHashChange&&!this.iframe?r("hashchange",this.checkUrl,!1):this._wantsHashChange&&(this._checkUrlInterval=setInterval(this.checkUrl,this.interval)),!this.options.silent)return this.loadUrl()},stop:function(){var t=window.removeEventListener||function(t,e){return detachEvent("on"+t,e)};this._usePushState?t("popstate",this.checkUrl,!1):this._useHashChange&&!this.iframe&&t("hashchange",this.checkUrl,!1),this.iframe&&(document.body.removeChild(this.iframe),this.iframe=null),this._checkUrlInterval&&clearInterval(this._checkUrlInterval),C.started=!1},route:function(t,e){this.handlers.unshift({route:t,callback:e})},checkUrl:function(t){var e=this.getFragment();if(e===this.fragment&&this.iframe&&(e=this.getHash(this.iframe.contentWindow)),e===this.fragment)return!1;this.iframe&&this.navigate(e),this.loadUrl()},loadUrl:function(t){return!!this.matchRoot()&&(t=this.fragment=this.getFragment(t),i.some(this.handlers,function(e){if(e.route.test(t))return e.callback(t),!0}))},navigate:function(t,e){if(!C.started)return!1;e&&!0!==e||(e={trigger:!!e}),t=this.getFragment(t||"");var i=this.root;""!==t&&"?"!==t.charAt(0)||(i=i.slice(0,-1)||"/");var n=i+t;if(t=this.decodeFragment(t.replace(N,"")),this.fragment!==t){if(this.fragment=t,this._usePushState)this.history[e.replace?"replaceState":"pushState"]({},document.title,n);else{if(!this._wantsHashChange)return this.location.assign(n);if(this._updateHash(this.location,t,e.replace),this.iframe&&t!==this.getHash(this.iframe.contentWindow)){var s=this.iframe.contentWindow;e.replace||(s.document.open(),s.document.close()),this._updateHash(s.location,t,e.replace)}}return e.trigger?this.loadUrl(t):void 0}},_updateHash:function(t,e,i){if(i){var n=t.href.replace(/(javascript:|#).*$/,"");t.replace(n+"#"+e)}else t.hash="#"+e}}),e.history=new C;_.extend=y.extend=T.extend=E.extend=C.extend=function(t,e){var n,s=this;return n=t&&i.has(t,"constructor")?t.constructor:function(){return s.apply(this,arguments)},i.extend(n,s,e),n.prototype=i.create(s.prototype,t),n.prototype.constructor=n,n.__super__=s.prototype,n};var M=function(){throw new Error('A "url" property or function must be specified')},O=function(t,e){var i=e.error;e.error=function(n){i&&i.call(e.context,t,n,e),t.trigger("error",t,n,e)}};return e});
},{"underscore":7,"jquery":6}],10:[function(require,module,exports) {
var e={parseDbr:function(r,t){for(var s,o,n=[],p=[],a=[],u=0;u<r.length;u++)switch(p.push({name:r[u].toUpperCase()}),u>0&&a.push({source:u-1,target:u,type:"phosphodiester"}),t[u]){case"(":n.push(u);break;case")":s=n.pop(),o=e.getType(e.isWatsonCrick(r[s],r[u])),a.push({source:s,target:u,type:o})}return{nodes:p,links:a}},isWatsonCrick:function(e,r){var t=!1;return("G"===e&&"C"===r||"C"===e&&"G"===r||"A"===e&&"U"===r||"U"===e&&"A"===r||"A"===e&&"T"===r||"T"===e&&"A"===r)&&(t=!0),t},getType:function(e){return e?"hbond":"violation"}};module.exports=e;
},{}],16:[function(require,module,exports) {
var a=module.exports=function(t,a,r){for(var n=[],M=[],o=[],l=-1,s=0;s<t.length;s++)n[s]={x:0,y:0},M[s]={x:0,y:0};l+=1-Math.PI/2;s=0;for(var i=0,f=0,u=-Math.sin(l),x=Math.cos(l);s<t.length;){n[s].x=i,n[s].y=f,M[s].x=i+65*x,M[s].y=f-65*u;var I=h(s,r);I>s&&(e(s,I,i+65*u/2,f+65*x/2,l,n,M,o,t,r),M[s].x=n[s].x+65*x,M[s].y=f-65*u,i+=65*u,f+=65*x,M[s=I].x=n[s].x+65*x,M[s].y=f-65*u),i+=35*u,f+=35*x,s+=1}return n};function h(t,a){for(var h=-1,e=0;e<a.length;e++)if("phosphodiester"==a[e].type);else{if(a[e].source===t){h=a[e].target;break}if(a[e].target===t){h=a[e].source;break}}return h}function e(t,a,n,o,s,i,f,u,x,I){if(!(t>a))if(h(t,I)===a){var P=Math.PI/2;f[t]={x:n,y:o},f[a]={x:n,y:o},i[t].x=n+65*Math.cos(s-P)/2,i[t].y=o+65*Math.sin(s-P)/2,i[a].x=n+65*Math.cos(s+P)/2,i[a].y=o+65*Math.sin(s+P)/2,e(t+1,a-1,n+40*Math.cos(s),o+40*Math.sin(s),s,i,f,u,x,I)}else{for(var c,v=t,g=[],y=[];v<=a;)(c=h(v,I))>v?(g.push(v),g.push(c),y.push(v),v=c+1):(g.push(v),v++);var p,m,b,d=g.length+2,k=y.length+1;d>3?(p=r(k,d-k,(35*(d-k)+65*k)/(2*Math.PI),65,35),m=-2*Math.asin(35/(2*p)),b=-2*Math.asin(65/(2*p))):(p=35,b=-2*Math.asin(65/(2*p)),m=(-2*Math.PI-b)/2);var w,z,A=Math.sqrt(Math.max(Math.pow(p,2)-Math.pow(32.5,2),0))-40,q={x:n+A*Math.cos(s),y:o+A*Math.sin(s)},j=s+Math.PI+.5*b+1*m,B=[],C={el1:0,el2:j-1*m},D=[];for(v=g.length-1;v>=0;v--){f[c=g[v]]=q;var E=-1!=h(t,I),F=E&&h(t,I)<c,G=E&&!F;F?(j=M(j+b/2)-b/2,C.el1=j,D.push({el1:B,el2:C}),C={el1:-1,el2:-1},B=[]):G?C.el2=j:B.push(c),u[c]=j,j+=F?b:m}C.el1=s-Math.PI-.5*b,D.push({el1:B,el2:C});for(var H=0;H<D.length;H++)for(var J=D[H].el2.el1,K=l(D[H].el2.el2,J),L=0;L<D[H].el1.length;L++){var N=(1+L)/(1+D[H].el1.length);u[D[H].el1[L]]=J+(1-N)*(K-J)}for(v=g.length-1;v>=0;v--)i[c=g[v]].x=q.x+p*Math.cos(u[c]),i[c].y=q.y+p*Math.sin(u[c]);for(v=0;v<y.length;v++)L=h(z=y[v],I),w=(u[z]+u[L])/2,e(z+1,L-1,40*Math.cos(w)+(i[z].x+i[L].x)/2,40*Math.sin(w)+(i[z].y+i[L].y)/2,w,i,f,u,x,I)}}function r(t,a,h,e,r){for(var M=e/2,o=3*r+1,l=(M+o)/2,s=1e4,i=-1e3,f=1e3,u=0;Math.abs(s)>1e-5&&u<1e4;)s=n(t,a,l=(M+o)/2,e,r),i=n(t,a,o,e,r),f=n(t,a,M,e,r),i>0?o+=o-M:s<=0&&f>0?o=l:s>=0&&i<0?M=l:f<0&&(M=Math.max(M-(l-M),Math.max(e/2,r/2)),o=l),u++;return l}function n(t,a,h,e,r){return 2*t*Math.asin(e/(2*h))+2*a*Math.asin(r/(2*h))-2*Math.PI}function M(a){for(var h=[0,Math.PI/4,Math.PI/2,3*Math.PI/4,Math.PI,5*Math.PI/4,3*Math.PI/2,7*Math.PI/4],e=o(a),r=0;r<h.length;r++){var n=h[r];Math.abs(t.normalizeAngle(n-e,-Math.PI))<.15&&(e=n)}return e}function o(a){return t.normalizeAngle(a,0)}function l(t,a){for(var h=a+2*Math.PI,e=t;e<a;)e+=2*Math.PI;for(;e>=h;)e-=2*Math.PI;return e}
},{}],40:[function(require,module,exports) {
var t=module.exports=function(){this._start1=null,this._end1=null,this._start2=null,this._end2=null};t.prototype.getStart1=function(){return this._start1},t.prototype.setStart1=function(t){this._start1=t},t.prototype.getEnd1=function(){return this._end1},t.prototype.setEnd1=function(t){this._end1=t},t.prototype.getStart2=function(){return this._start2},t.prototype.setStart2=function(t){this._start2=t},t.prototype.getEnd2=function(){return this._end2},t.prototype.setEnd2=function(t){this._end2=t};
},{}],41:[function(require,module,exports) {
var t=require("./loop"),o=require("./region"),e=module.exports=function(){this.loop=new t,this.region=new o,this.start=null,this.end=null,this.xrad=null,this.yrad=null,this.angle=null,this.extruded=null,this.broken=null,this._isNull=!1};e.prototype.isNull=function(){return this._isNull},e.prototype.setNull=function(t){this._isNull=t},e.prototype.getLoop=function(){return this.loop},e.prototype.setLoop=function(t){this.loop=t},e.prototype.getRegion=function(){return this.region},e.prototype.setRegion=function(t){this.region=t},e.prototype.getStart=function(){return this.start},e.prototype.setStart=function(t){this.start=t},e.prototype.getEnd=function(){return this.end},e.prototype.setEnd=function(t){this.end=t},e.prototype.getXrad=function(){return this.xrad},e.prototype.setXrad=function(t){this.xrad=t},e.prototype.getYrad=function(){return this.yrad},e.prototype.setYrad=function(t){this.yrad=t},e.prototype.getAngle=function(){return this.angle},e.prototype.setAngle=function(t){this.angle=t},e.prototype.isExtruded=function(){return this.extruded},e.prototype.setExtruded=function(t){this.extruded=t},e.prototype.isBroken=function(){return this.broken},e.prototype.setBroken=function(t){this.broken=t};
},{"./loop":39,"./region":40}],39:[function(require,module,exports) {
var t=module.exports=function(){this.nconnection=null,this.connections=[],this._connections=[],this.number=null,this.depth=null,this.mark=null,this.x=null,this.y=null,this.radius=null};t.prototype.getNconnection=function(){return this.nconnection},t.prototype.setNconnection=function(t){this.nconnection=t},t.prototype.setConnection=function(t,n){var o=require("./connection");null!=n?this._connections[t]=n:(this._connections[t]||(this._connections[t]=new o),this._connections[t].setNull(!0))},t.prototype.getConnection=function(t){var n=require("./connection");this._connections[t]||(this._connections[t]=new n);var o=this._connections[t];return o.isNull()?null:o},t.prototype.addConnection=function(t,n){this._connections.push(n)},t.prototype.getNumber=function(){return this.number},t.prototype.setNumber=function(t){this.number=t},t.prototype.getDepth=function(){return this.depth},t.prototype.setDepth=function(t){this.depth=t},t.prototype.isMark=function(){return this.mark},t.prototype.setMark=function(t){this.mark=t},t.prototype.getX=function(){return this.x},t.prototype.setX=function(t){this.x=t},t.prototype.getY=function(){return this.y},t.prototype.setY=function(t){this.y=t},t.prototype.getRadius=function(){return this.radius},t.prototype.setRadius=function(t){this.radius=t};
},{"./connection":41}],42:[function(require,module,exports) {
var t=require("./region"),e=module.exports=function(){this.mate=null,this.x=null,this.y=null,this.extracted=null,this.region=new t};e.prototype.getMate=function(){return this.mate},e.prototype.setMate=function(t){this.mate=t},e.prototype.getX=function(){return this.x},e.prototype.setX=function(t){this.x=t},e.prototype.getY=function(){return this.y},e.prototype.setY=function(t){this.y=t},e.prototype.isExtracted=function(){return this.extracted},e.prototype.setExtracted=function(t){this.extracted=t},e.prototype.getRegion=function(){return this.region},e.prototype.setRegion=function(t){this.region=t};
},{"./region":40}],43:[function(require,module,exports) {
var t=module.exports=function(){this.radius=null,this.loopnumber=null,this.next=null,this.prev=null};t.prototype.getRadius=function(){return this.radius},t.prototype.setRadius=function(t){this.radius=t},t.prototype.getLoopnumber=function(){return this.loopnumber},t.prototype.setLoopnumber=function(t){this.loopnumber=t},t.prototype.getNext=function(){return this.next},t.prototype.setNext=function(t){this.next=t},t.prototype.getPrev=function(){return this.prev},t.prototype.setPrev=function(t){this.prev=t};
},{}],24:[function(require,module,exports) {
var t=require("./loop"),e=require("./base"),s=require("./region"),n=require("./connection"),i=require("./radloop"),a=module.exports=function(){this.ANUM=9999,this.MAXITER=500,this.bases=[],this.nbase=null,this.nregion=null,this.loop_count=null,this.root=new t,this.loops=[],this.regions=[],this.rlphead=new i,this.lencut=.8,this.RADIUS_REDUCTION_FACTOR=1.4,this.angleinc=null,this._h=null,this.HELIX_FACTOR=.6,this.BACKBONE_DISTANCE=27};function o(){var e=new t,s=null,n=null;for(s=0;s<this.loop_count;s++){for(e=this.loops[s],n=0;n<this.loop_count;n++)this.loops[n].setMark(!1);e.setDepth(h(e))}}function h(t){var e=null,s=null,n=null;if(t.getNconnection()<=1)return 0;if(t.isMark())return-1;t.setMark(!0),e=0,s=0;for(var i=0;null!=t.getConnection(i);i++)(n=h(t.getConnection(i).getLoop()))>=0&&(1==++e?s=n:s>n&&(s=n));return t.setMark(!1),s+1}a.prototype.naview_xy_coordinates=function(n){var i,a=[],o=[];if(0===n.length)return 0;var h=[];h.push(n.length);for(var g=0;g<n.length;g++)h.push(n[g]+1);this.nbase=h[0],this.bases=[];for(var r=0;r<this.nbase+1;r++)this.bases.push(new e);this.regions=[];for(r=0;r<this.nbase+1;r++)this.regions.push(new s);this.read_in_bases(h),this.rlphead=null,this.find_regions(),this.loop_count=0,this.loops=[];for(r=0;r<this.nbase+1;r++)this.loops.push(new t);for(this.construct_loop(0),this.find_central_loop(),this.traverse_loop(this.root,null),i=0;i<this.nbase;i++)a.push(100+this.BACKBONE_DISTANCE*this.bases[i+1].getX()),o.push(100+this.BACKBONE_DISTANCE*this.bases[i+1].getY());return{nbase:this.nbase,x:a,y:o}},a.prototype.read_in_bases=function(t){var s=null,n=null;for(this.bases.push(new e),this.bases[0].setMate(0),this.bases[0].setExtracted(!1),this.bases[0].setX(this.ANUM),this.bases[0].setY(this.ANUM),n=0,s=1;s<=this.nbase;s++)this.bases.push(new e),this.bases[s].setExtracted(!1),this.bases[s].setX(this.ANUM),this.bases[s].setY(this.ANUM),this.bases[s].setMate(t[s]),t[s]>s&&n++;0==n&&(this.bases[1].setMate(this.nbase),this.bases[this.nbase].setMate(1))},a.prototype.find_regions=function(){var t,e=null,s=null;t=this.nbase+1;var n=[];for(e=0;e<t;e++)n.push(!1);for(this.nregion=0,e=0;e<=this.nbase;e++)if(0!=(s=this.bases[e].getMate())&&!n[e]){for(this.regions[this.nregion].setStart1(e),this.regions[this.nregion].setEnd2(s),n[e]=!0,n[s]=!0,this.bases[e].setRegion(this.regions[this.nregion]),this.bases[s].setRegion(this.regions[this.nregion]),e++,s--;e<s&&this.bases[e].getMate()==s;e++,s--)n[s]=!0,n[e]=!0,this.bases[e].setRegion(this.regions[this.nregion]),this.bases[s].setRegion(this.regions[this.nregion]);this.regions[this.nregion].setEnd1(--e),this.regions[this.nregion].setStart2(s+1),this.nregion++}},a.prototype.construct_loop=function(e){var a=null,o=null,h=new t,g=new t,r=new n,c=new s,b=new i;for((h=this.loops[this.loop_count++]).setNconnection(0),h.setDepth(0),h.setNumber(this.loop_count),h.setRadius(0),b=this.rlphead;null!=b;b=b.getNext())b.getLoopnumber()==this.loop_count&&h.setRadius(b.getRadius());a=e;do{0!=(o=this.bases[a].getMate())&&(c=this.bases[a].getRegion(),this.bases[c.getStart1()].isExtracted()||(a==c.getStart1()?(this.bases[c.getStart1()].setExtracted(!0),this.bases[c.getEnd1()].setExtracted(!0),this.bases[c.getStart2()].setExtracted(!0),this.bases[c.getEnd2()].setExtracted(!0),g=this.construct_loop(c.getEnd1()<this.nbase?c.getEnd1()+1:0)):a==c.getStart2()&&(this.bases[c.getStart2()].setExtracted(!0),this.bases[c.getEnd2()].setExtracted(!0),this.bases[c.getStart1()].setExtracted(!0),this.bases[c.getEnd1()].setExtracted(!0),g=this.construct_loop(c.getEnd2()<this.nbase?c.getEnd2()+1:0)),h.setNconnection(h.getNconnection()+1),r=new n,h.setConnection(h.getNconnection()-1,r),h.setConnection(h.getNconnection(),null),r.setLoop(g),r.setRegion(c),a==c.getStart1()?(r.setStart(c.getStart1()),r.setEnd(c.getEnd2())):(r.setStart(c.getStart2()),r.setEnd(c.getEnd1())),r.setExtruded(!1),r.setBroken(!1),g.setNconnection(g.getNconnection()+1),r=new n,g.setConnection(g.getNconnection()-1,r),g.setConnection(g.getNconnection(),null),r.setLoop(h),r.setRegion(c),a==c.getStart1()?(r.setStart(c.getStart2()),r.setEnd(c.getEnd1())):(r.setStart(c.getStart1()),r.setEnd(c.getEnd2())),r.setExtruded(!1),r.setBroken(!1)),a=o),++a>this.nbase&&(a=0)}while(a!=e);return h},a.prototype.find_central_loop=function(){var e=new t,s=null,n=null,i=null;for(o(),s=0,n=-1,i=0;i<this.loop_count;i++)(e=this.loops[i]).getNconnection()>s?(n=e.getDepth(),s=e.getNconnection(),this.root=e):e.getDepth()>n&&e.getNconnection()==s&&(n=e.getDepth(),this.root=e)},a.prototype.traverse_loop=function(t,e){var s,n,i,a,o,h,g,r,c,b,l,d,u,M,E,f,p,X,_,Y,S,A,N,I,C,x,P,R,v,w,y,m,q,T,D,O,U,L,k,B,F,H,K,j,z,G,J,Q,V,W,Z,$,tt,et,st,nt,it,at,ot,ht,gt,rt,ct,bt,lt,dt,ut,Mt,Et,ft=0;h=2*Math.PI/(this.nbase+1),X=null,w=-1;var pt=0;for(N=0;null!=(f=t.getConnection(pt));pt++,N++)s=-Math.sin(h*f.getStart()),n=Math.cos(h*f.getStart()),i=-Math.sin(h*f.getEnd()),a=Math.cos(h*f.getEnd())-n,o=s-i,g=Math.sqrt(a*a+o*o),f.setXrad(a/g),f.setYrad(o/g),f.setAngle(Math.atan2(o,a)),f.getAngle()<0&&f.setAngle(f.getAngle()+2*Math.PI),null!=e&&e.getRegion()==f.getRegion()&&(X=f,w=N);t:for(;;){this.determine_radius(t,this.lencut),r=t.getRadius()/this.RADIUS_REDUCTION_FACTOR,null==e?c=b=0:(l=(this.bases[X.getStart()].getX()+this.bases[X.getEnd()].getX())/2,d=(this.bases[X.getStart()].getY()+this.bases[X.getEnd()].getY())/2,c=l-r*X.getXrad(),b=d-r*X.getYrad()),P=-1==w?0:w,f=t.getConnection(P),x=0,y=!1;do{if((S=P-1)<0&&(S=t.getNconnection()-1),_=t.getConnection(S),this.connected_connection(_,f)?(P=S,f=_):y=!0,++x>t.getNconnection()){for(C=-1,N=0;N<t.getNconnection();N++)(S=N+1)>=t.getNconnection()&&(S=0),f=t.getConnection(N),(lt=(p=t.getConnection(S)).getAngle()-f.getAngle())<0&&(lt+=2*Math.PI),lt>C&&(C=lt,ft=N);R=ft,(P=ft+1)>=t.getNconnection()&&(P=0),(f=t.getConnection(R)).setBroken(!0),y=!0}}while(!y);for(m=!1,G=P;!m;){for(x=0,y=!1,R=P,q=!1;!y;)if(f=t.getConnection(R),R==w&&(q=!0),(S=R+1)>=t.getNconnection()&&(S=0),p=t.getConnection(S),this.connected_connection(f,p)){if(++x>=t.getNconnection())break;R=S}else y=!0;for(N=J=Q=v=this.find_ic_middle(P,R,e,X,t),y=!1,W=0;!y;)(N=W<0?J:0==W?v:Q)>=0&&(f=t.getConnection(N),null!=e&&X==f||(0==W?(u=f.getAngle()-Math.asin(.5/r),M=f.getAngle()+Math.asin(.5/r),this.bases[f.getStart()].setX(c+r*Math.cos(u)),this.bases[f.getStart()].setY(b+r*Math.sin(u)),this.bases[f.getEnd()].setX(c+r*Math.cos(M)),this.bases[f.getEnd()].setY(b+r*Math.sin(M))):W<0?((S=N+1)>=t.getNconnection()&&(S=0),f=t.getConnection(N),p=t.getConnection(S),st=f.getXrad(),nt=f.getYrad(),lt=(f.getAngle()+p.getAngle())/2,f.getAngle()>p.getAngle()&&(lt-=Math.PI),ot=Math.cos(lt),rt=Math.sin(lt),ct=-ot,(I=p.getAngle()-f.getAngle())<0&&(I+=2*Math.PI),bt=f.isExtruded()?I<=Math.PI/2?2:1.5:1,this.bases[f.getEnd()].setX(this.bases[p.getStart()].getX()+bt*rt),this.bases[f.getEnd()].setY(this.bases[p.getStart()].getY()+bt*ct),this.bases[f.getStart()].setX(this.bases[f.getEnd()].getX()+nt),this.bases[f.getStart()].setY(this.bases[f.getEnd()].getY()-st)):((S=N-1)<0&&(S=t.getNconnection()-1),f=t.getConnection(S),it=(p=t.getConnection(N)).getXrad(),at=p.getYrad(),lt=(f.getAngle()+p.getAngle())/2,f.getAngle()>p.getAngle()&&(lt-=Math.PI),ot=Math.cos(lt),rt=-Math.sin(lt),ct=ot,(I=p.getAngle()-f.getAngle())<0&&(I+=2*Math.PI),bt=f.isExtruded()?I<=Math.PI/2?2:1.5:1,this.bases[p.getStart()].setX(this.bases[f.getEnd()].getX()+bt*rt),this.bases[p.getStart()].setY(this.bases[f.getEnd()].getY()+bt*ct),this.bases[p.getEnd()].setX(this.bases[p.getStart()].getX()-at),this.bases[p.getEnd()].setY(this.bases[p.getStart()].getY()+it)))),W<0?(Q==R?Q=-1:Q>=0&&++Q>=t.getNconnection()&&(Q=0),W=1):(J==P?J=-1:J>=0&&--J<0&&(J=t.getNconnection()-1),W=-1),y=-1==J&&-1==Q;if((V=R+1)>=t.getNconnection()&&(V=0),R!=P&&(P!=G||V!=G))if(f=t.getConnection(P),p=t.getConnection(R),$=this.bases[p.getEnd()].getX()-this.bases[f.getStart()].getX(),tt=this.bases[p.getEnd()].getY()-this.bases[f.getStart()].getY(),D=this.bases[f.getStart()].getX()+$/2,O=this.bases[f.getStart()].getY()+tt/2,k=$/(et=Math.sqrt($*$+tt*tt)),B=tt/et,F=c-D,H=b-O,U=(K=(F/=et=Math.sqrt($*$+tt*tt))*k+(H/=et)*B)*k-F,L=K*B-H,U/=et=Math.sqrt(U*U+L*L),L/=et,$=this.bases[f.getStart()].getX()-c,tt=this.bases[f.getStart()].getY()-b,(lt=Math.atan2(tt,$))<0&&(lt+=2*Math.PI),$=this.bases[p.getEnd()].getX()-c,tt=this.bases[p.getEnd()].getY()-b,(dt=Math.atan2(tt,$))<0&&(dt+=2*Math.PI),dt<lt&&(dt+=2*Math.PI),j=c+(T=dt-lt>Math.PI?-1:1)*r*U,z=b+T*r*L,q)c-=j-D,b-=z-O;else for(N=P;Y=(f=t.getConnection(N)).getStart(),this.bases[Y].setX(this.bases[Y].getX()+j-D),this.bases[Y].setY(this.bases[Y].getY()+z-O),Y=f.getEnd(),this.bases[Y].setX(this.bases[Y].getX()+j-D),this.bases[Y].setY(this.bases[Y].getY()+z-O),N!=R;)++N>=t.getNconnection()&&(N=0);m=(P=V)==G}for(N=0;N<t.getNconnection();N++){if(f=t.getConnection(N),(S=N+1)>=t.getNconnection()&&(S=0),p=t.getConnection(S),$=this.bases[f.getEnd()].getX()-c,tt=this.bases[f.getEnd()].getY()-b,gt=Math.sqrt($*$+tt*tt),(lt=Math.atan2(tt,$))<0&&(lt+=2*Math.PI),$=this.bases[p.getStart()].getX()-c,tt=this.bases[p.getStart()].getY()-b,ht=Math.sqrt($*$+tt*tt),(dt=Math.atan2(tt,$))<0&&(dt+=2*Math.PI),dt<lt&&(dt+=2*Math.PI),Z=dt-lt,(Et=p.getAngle()-f.getAngle())<=0&&(Et+=2*Math.PI),Math.abs(Z-Et)>Math.PI)if(f.isExtruded());else if(p.getStart()-f.getEnd()!=1){f.setExtruded(!0);continue t}if(f.isExtruded())this.construct_extruded_segment(f,p);else for((A=p.getStart()-f.getEnd())<0&&(A+=this.nbase+1),h=Z/A,S=1;S<A;S++)(Y=f.getEnd()+S)>this.nbase&&(Y-=this.nbase+1),et=gt+(ht-gt)*((E=lt+S*h)-lt)/Z,this.bases[Y].setX(c+et*Math.cos(E)),this.bases[Y].setY(b+et*Math.sin(E))}break}for(N=0;N<t.getNconnection();N++)w!=N&&(f=t.getConnection(N),this.generate_region(f),this.traverse_loop(f.getLoop(),f));for(A=0,ut=0,Mt=0,N=0;N<t.getNconnection();N++)if((S=N+1)>=t.getNconnection()&&(S=0),f=t.getConnection(N),p=t.getConnection(S),A+=2,ut+=this.bases[f.getStart()].getX()+this.bases[f.getEnd()].getX(),Mt+=this.bases[f.getStart()].getY()+this.bases[f.getEnd()].getY(),!f.isExtruded())for(S=f.getEnd()+1;S!=p.getStart();S++)S>this.nbase&&(S-=this.nbase+1),A++,ut+=this.bases[S].getX(),Mt+=this.bases[S].getY();t.setX(ut/A),t.setY(Mt/A)},a.prototype.determine_radius=function(t,e){var s,i,a,o,h,g,r,c,b,l,d,u=0,M=new n,E=new n;do{for(s=1e10,h=0,o=0,c=0;c<t.getNconnection();c++)M=t.getConnection(c),(b=c+1)>=t.getNconnection()&&(b=0),E=t.getConnection(b),l=M.getEnd(),(d=E.getStart())<l&&(d+=this.nbase+1),(a=E.getAngle()-M.getAngle())<=0&&(a+=2*Math.PI),o+=a*(1/(i=M.isExtruded()?a<=Math.PI/2?2:1.5:d-l)+1),h+=a*a/i,(r=a/i)<s&&!M.isExtruded()&&i>1&&(s=r,u=c);(g=o/h)<.7071068&&(g=.7071068),s*g<e&&t.getConnection(u).setExtruded(!0)}while(s*g<e);t.getRadius()>0?g=t.getRadius():t.setRadius(g)},a.prototype.find_ic_middle=function(t,e,s,n,i){var a,o,h,g,r;for(a=0,o=-1,h=t,r=!1;!r;)a++,i.getNconnection(),null!=s&&i.getConnection(h)==n&&(o=h),r=h==e,++h>=i.getNconnection()&&(h=0);if(-1==o){for(g=1,h=t;g<(a+1)/2;g++)++h>=i.getNconnection()&&(h=0);o=h}return o},a.prototype.construct_extruded_segment=function(t,e){var s,n,i,a,o,h,g,r,c,b,l,d,u,M,E,f,p,X;if(s=t.getAngle(),(i=n=e.getAngle())<s&&(i+=2*Math.PI),a=(s+i)/2,u=t.getEnd(),(E=(M=e.getStart())-u)<0&&(E+=this.nbase+1),(l=e.getAngle()-t.getAngle())<0&&(l+=2*Math.PI),2==E)this.construct_circle_segment(u,M);else{o=this.bases[M].getX()-this.bases[u].getX(),h=this.bases[M].getY()-this.bases[u].getY(),o/=b=Math.sqrt(o*o+h*h),h/=b,b>=1.5&&l<=Math.PI/2&&((f=u+1)>this.nbase&&(f-=this.nbase+1),(p=M-1)<0&&(p+=this.nbase+1),this.bases[f].setX(this.bases[u].getX()+.5*o),this.bases[f].setY(this.bases[u].getY()+.5*h),this.bases[p].setX(this.bases[M].getX()-.5*o),this.bases[p].setY(this.bases[M].getY()-.5*h),u=f,M=p);do{X=!1,this.construct_circle_segment(u,M),(f=u+1)>this.nbase&&(f-=this.nbase+1),o=this.bases[f].getX()-this.bases[u].getX(),h=this.bases[f].getY()-this.bases[u].getY(),(g=Math.atan2(h,o))<0&&(g+=2*Math.PI),(d=g-s)<0&&(d+=2*Math.PI),d>Math.PI&&(X=!0),(p=M-1)<0&&(p+=this.nbase+1),o=this.bases[p].getX()-this.bases[M].getX(),h=this.bases[p].getY()-this.bases[M].getY(),(r=Math.atan2(h,o))<0&&(r+=2*Math.PI),(d=n-r)<0&&(d+=2*Math.PI),d>Math.PI&&(X=!0),X&&(c=this.minf2(a,s+.5),this.bases[f].setX(this.bases[u].getX()+Math.cos(c)),this.bases[f].setY(this.bases[u].getY()+Math.sin(c)),u=f,c=this.maxf2(a,i-.5),this.bases[p].setX(this.bases[M].getX()+Math.cos(c)),this.bases[p].setY(this.bases[M].getY()+Math.sin(c)),M=p,E-=2)}while(X&&E>1)}},a.prototype.construct_circle_segment=function(t,e){var s,n,i,a,o,h,g,r,c,b,l,d,u,M,E;if(s=this.bases[e].getX()-this.bases[t].getX(),n=this.bases[e].getY()-this.bases[t].getY(),i=Math.sqrt(s*s+n*n),(u=e-t)<0&&(u+=this.nbase+1),i>=u)for(s/=i,n/=i,M=1;M<u;M++)(E=t+M)>this.nbase&&(E-=this.nbase+1),this.bases[E].setX(this.bases[t].getX()+s*M/u),this.bases[E].setY(this.bases[t].getY()+n*M/u);else for(this.find_center_for_arc(u-1,i),s/=i,n/=i,a=this.bases[t].getX()+s*i/2,o=this.bases[t].getY()+n*i/2,h=n,g=-s,r=a+this._h*h,c=o+this._h*g,b=this.bases[t].getX()-r,l=this.bases[t].getY()-c,i=Math.sqrt(b*b+l*l),d=Math.atan2(l,b),M=1;M<u;M++)(E=t+M)>this.nbase&&(E-=this.nbase+1),this.bases[E].setX(r+i*Math.cos(d+M*this.angleinc)),this.bases[E].setY(c+i*Math.sin(d+M*this.angleinc))},a.prototype.find_center_for_arc=function(t,e){var s,n,i,a,o,h,g,r;i=-(n=(t+1)/Math.PI)-e/(t+1.000001-e),e<1&&(i=0),r=0;do{s=(n+i)/2,o=1-.5/((a=Math.sqrt(s*s+e*e/4))*a),Math.abs(o),(g=(h=Math.acos(o))*(t+1)+2*Math.acos(s/a)-2*Math.PI)>0?i=s:n=s}while(Math.abs(g)>1e-4&&++r<this.MAXITER);r>=this.MAXITER&&(noIterationFailureYet&&(noIterationFailureYet=!1),s=0,h=0),this._h=s,this.angleinc=h},a.prototype.generate_region=function(t){var e,s,n,i,a,o;for(o=t.getRegion(),e=0,t.getStart()==o.getStart1()?(s=o.getStart1(),n=o.getEnd1()):(s=o.getStart2(),n=o.getEnd2()),this.bases[t.getStart()].getX()>this.ANUM-100||(this.bases[t.getEnd()].getX(),this.ANUM),i=s+1;i<=n;i++)e++,this.bases[i].setX(this.bases[t.getStart()].getX()+this.HELIX_FACTOR*e*t.getXrad()),this.bases[i].setY(this.bases[t.getStart()].getY()+this.HELIX_FACTOR*e*t.getYrad()),a=this.bases[i].getMate(),this.bases[a].setX(this.bases[t.getEnd()].getX()+this.HELIX_FACTOR*e*t.getXrad()),this.bases[a].setY(this.bases[t.getEnd()].getY()+this.HELIX_FACTOR*e*t.getYrad())},a.prototype.minf2=function(t,e){return t<e?t:e},a.prototype.maxf2=function(t,e){return t>e?t:e},a.prototype.connected_connection=function(t,e){return!!t.isExtruded()||t.getEnd()+1==e.getStart()};
},{"./loop":39,"./base":42,"./region":40,"./connection":41,"./radloop":43}],17:[function(require,module,exports) {
var e=require("./naview");function r(e,r){for(var t=-1,o=0;o<r.length;o++)if("phosphodiester"===r[o].type||"index"===r[o].type);else{if(r[o].source===e){t=r[o].target;break}if(r[o].target===e){t=r[o].source;break}}return t}getCoordsNAVIEW=module.exports=function(t,o){for(var n=[],a=0;a<t.length;a++)n.push(r(a,o));var u=(new e).naview_xy_coordinates(n),i=[];for(a=0;a<t.length;a++)i.push({x:Math.round(2.5*u.x[a]),y:Math.round(2.5*u.y[a])});return i};
},{"./naview":24}],9:[function(require,module,exports) {
var t=require("./radiate/getradiate"),i=require("./naview/getnaview"),e=function(t,i,e){this.layout=t,this.nodes=i,this.links=e};e.prototype.getCoords=function(){var e=null;if("radiate"===this.layout)e=t(this.nodes,this.links);else{if("naview"!==this.layout)throw new Error("Invalid layout");e=i(this.nodes,this.links)}return e},module.exports=e;
},{"./radiate/getradiate":16,"./naview/getnaview":17}],21:[function(require,module,exports) {
var process = require("process");
var r=require("process");function t(r,t){for(var e=0,n=r.length-1;n>=0;n--){var s=r[n];"."===s?r.splice(n,1):".."===s?(r.splice(n,1),e++):e&&(r.splice(n,1),e--)}if(t)for(;e--;e)r.unshift("..");return r}var e=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,n=function(r){return e.exec(r).slice(1)};function s(r,t){if(r.filter)return r.filter(t);for(var e=[],n=0;n<r.length;n++)t(r[n],n,r)&&e.push(r[n]);return e}exports.resolve=function(){for(var e="",n=!1,o=arguments.length-1;o>=-1&&!n;o--){var i=o>=0?arguments[o]:r.cwd();if("string"!=typeof i)throw new TypeError("Arguments to path.resolve must be strings");i&&(e=i+"/"+e,n="/"===i.charAt(0))}return e=t(s(e.split("/"),function(r){return!!r}),!n).join("/"),(n?"/":"")+e||"."},exports.normalize=function(r){var e=exports.isAbsolute(r),n="/"===o(r,-1);return(r=t(s(r.split("/"),function(r){return!!r}),!e).join("/"))||e||(r="."),r&&n&&(r+="/"),(e?"/":"")+r},exports.isAbsolute=function(r){return"/"===r.charAt(0)},exports.join=function(){var r=Array.prototype.slice.call(arguments,0);return exports.normalize(s(r,function(r,t){if("string"!=typeof r)throw new TypeError("Arguments to path.join must be strings");return r}).join("/"))},exports.relative=function(r,t){function e(r){for(var t=0;t<r.length&&""===r[t];t++);for(var e=r.length-1;e>=0&&""===r[e];e--);return t>e?[]:r.slice(t,e-t+1)}r=exports.resolve(r).substr(1),t=exports.resolve(t).substr(1);for(var n=e(r.split("/")),s=e(t.split("/")),o=Math.min(n.length,s.length),i=o,u=0;u<o;u++)if(n[u]!==s[u]){i=u;break}var l=[];for(u=i;u<n.length;u++)l.push("..");return(l=l.concat(s.slice(i))).join("/")},exports.sep="/",exports.delimiter=":",exports.dirname=function(r){var t=n(r),e=t[0],s=t[1];return e||s?(s&&(s=s.substr(0,s.length-1)),e+s):"."},exports.basename=function(r,t){var e=n(r)[2];return t&&e.substr(-1*t.length)===t&&(e=e.substr(0,e.length-t.length)),e},exports.extname=function(r){return n(r)[3]};var o="b"==="ab".substr(-1)?function(r,t,e){return r.substr(t,e)}:function(r,t,e){return t<0&&(t=r.length+t),r.substr(t,e)};
},{"process":8}],23:[function(require,module,exports) {
},{}],22:[function(require,module,exports) {
exports.endianness=function(){return"LE"},exports.hostname=function(){return"undefined"!=typeof location?location.hostname:""},exports.loadavg=function(){return[]},exports.uptime=function(){return 0},exports.freemem=function(){return Number.MAX_VALUE},exports.totalmem=function(){return Number.MAX_VALUE},exports.cpus=function(){return[]},exports.type=function(){return"Browser"},exports.release=function(){return"undefined"!=typeof navigator?navigator.appVersion:""},exports.networkInterfaces=exports.getNetworkInterfaces=function(){return{}},exports.arch=function(){return"javascript"},exports.platform=function(){return"browser"},exports.tmpdir=exports.tmpDir=function(){return"/tmp"},exports.EOL="\n",exports.homedir=function(){return"/"};
},{}],20:[function(require,module,exports) {
var process = require("process");
var __dirname = "/Users/guerler/galaxy/config/plugins/visualizations/drawrna/node_modules/cytoscape/dist";
var process=require("process"),__dirname="/Users/guerler/galaxy/config/plugins/visualizations/drawrna/node_modules/cytoscape/dist",cytoscape;!function(e){"use strict";var t=cytoscape=function(){return cytoscape.init.apply(cytoscape,arguments)};t.version="2.4.6",t.init=function(e){return void 0===e&&(e={}),t.is.plainObject(e)?new t.Core(e):t.is.string(e)?t.extension.apply(t.extension,arguments):void 0},t.fn={},"undefined"!=typeof module&&module.exports&&(module.exports=cytoscape),"undefined"!=typeof define&&define.amd&&define("cytoscape",function(){return cytoscape}),e&&(e.cytoscape=cytoscape)}("undefined"==typeof window?null:window),this.cytoscape=cytoscape,function(e){"use strict";var t=function(e){if(!(this instanceof t))return new t(e);this.id="Thenable/1.0.7",this.state=0,this.fulfillValue=void 0,this.rejectReason=void 0,this.onFulfilled=[],this.onRejected=[],this.proxy={then:this.then.bind(this)},"function"==typeof e&&e.call(this,this.fulfill.bind(this),this.reject.bind(this))};t.prototype={fulfill:function(e){return i(this,1,"fulfillValue",e)},reject:function(e){return i(this,2,"rejectReason",e)},then:function(e,i){var n=new t;return this.onFulfilled.push(a(e,n,"fulfill")),this.onRejected.push(a(i,n,"reject")),r(this),n.proxy}};var i=function(e,t,i,n){return 0===e.state&&(e.state=t,e[i]=n,r(e)),e},r=function(e){1===e.state?n(e,"onFulfilled",e.fulfillValue):2===e.state&&n(e,"onRejected",e.rejectReason)},n=function(e,t,i){if(0!==e[t].length){var r=e[t];e[t]=[];var n=function(){for(var e=0;e<r.length;e++)r[e](i)};"object"==typeof process&&"function"==typeof process.nextTick?process.nextTick(n):"function"==typeof setImmediate?setImmediate(n):setTimeout(n,0)}},a=function(e,t,i){return function(r){if("function"!=typeof e)t[i].call(t,r);else{var n;try{n=e(r)}catch(e){return void t.reject(e)}o(t,n)}}},o=function(e,t){if(e!==t&&e.proxy!==t){var i;if("object"==typeof t&&null!==t||"function"==typeof t)try{i=t.then}catch(t){return void e.reject(t)}if("function"!=typeof i)e.fulfill(t);else{var r=!1;try{i.call(t,function(i){r||(r=!0,i===t?e.reject(new TypeError("circular thenable chain")):o(e,i))},function(t){r||(r=!0,e.reject(t))})}catch(t){r||e.reject(t)}}}else e.reject(new TypeError("cannot resolve promise with itself"))};e.Promise="undefined"==typeof Promise?t:Promise,e.Promise.all=e.Promise.all||function(t){return new e.Promise(function(e,i){for(var r=new Array(t.length),n=0,a=function(i,a){r[i]=a,++n===t.length&&e(r)},o=0;o<t.length;o++)!function(e){var r=t[e];null!=r.then?r.then(function(t){a(e,t)},function(e){i(e)}):a(e,r)}(o)})}}(cytoscape),function(e,t){"use strict";var i=typeof{};e.is={defined:function(e){return null!=e},string:function(e){return null!=e&&"string"==typeof e},fn:function(e){return null!=e&&"function"==typeof e},array:function(e){return Array.isArray?Array.isArray(e):null!=e&&e instanceof Array},plainObject:function(t){return null!=t&&typeof t===i&&!e.is.array(t)&&t.constructor===Object},object:function(e){return null!=e&&typeof e===i},number:function(e){return null!=e&&"number"==typeof e&&!isNaN(e)},integer:function(t){return e.is.number(t)&&Math.floor(t)===t},color:function(e){return null!=e&&"string"==typeof e&&""!==$.Color(e).toString()},bool:function(e){return null!=e&&typeof e==typeof!0},elementOrCollection:function(t){return e.is.element(t)||e.is.collection(t)},element:function(t){return t instanceof e.Element&&t._private.single},collection:function(t){return t instanceof e.Collection&&!t._private.single},core:function(t){return t instanceof e.Core},style:function(t){return t instanceof e.Style},stylesheet:function(t){return t instanceof e.Stylesheet},event:function(t){return t instanceof e.Event},thread:function(t){return t instanceof e.Thread},fabric:function(t){return t instanceof e.Fabric},emptyString:function(t){return!t||!(!e.is.string(t)||""!==t&&!t.match(/^\s+$/))},nonemptyString:function(t){return!(!t||!e.is.string(t)||""===t||t.match(/^\s+$/))},domElement:function(e){return"undefined"!=typeof HTMLElement&&e instanceof HTMLElement},boundingBox:function(t){return e.is.plainObject(t)&&e.is.number(t.x1)&&e.is.number(t.x2)&&e.is.number(t.y1)&&e.is.number(t.y2)},promise:function(t){return e.is.object(t)&&e.is.fn(t.then)},touch:function(){return t&&("ontouchstart"in t||t.DocumentTouch&&document instanceof DocumentTouch)},gecko:function(){return"undefined"!=typeof InstallTrigger||"MozAppearance"in document.documentElement.style},webkit:function(){return"undefined"!=typeof webkitURL||"WebkitAppearance"in document.documentElement.style},chromium:function(){return"undefined"!=typeof chrome},khtml:function(){return navigator.vendor.match(/kde/i)},khtmlEtc:function(){return e.is.khtml()||e.is.webkit()||e.is.chromium()},trident:function(){return"undefined"!=typeof ActiveXObject||!1},windows:function(){return"undefined"!=typeof navigator&&navigator.appVersion.match(/Win/i)},mac:function(){return"undefined"!=typeof navigator&&navigator.appVersion.match(/Mac/i)},linux:function(){return"undefined"!=typeof navigator&&navigator.appVersion.match(/Linux/i)},unix:function(){return"undefined"!=typeof navigator&&navigator.appVersion.match(/X11/i)}}}(cytoscape,"undefined"==typeof window?null:window),function(e,t){"use strict";e.util={extend:function(){var t,i,r,n,a,o,s=arguments[0]||{},l=1,u=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},l=2),"object"==typeof s||e.is.fn(s)||(s={}),u===l&&(s=this,--l);l<u;l++)if(null!=(t=arguments[l]))for(i in t)r=s[i],s!==(n=t[i])&&(c&&n&&(e.is.plainObject(n)||(a=e.is.array(n)))?(a?(a=!1,o=r&&e.is.array(r)?r:[]):o=r&&e.is.plainObject(r)?r:{},s[i]=e.util.extend(c,o,n)):void 0!==n&&(s[i]=n));return s},require:function(i,r,n){var a;n=e.util.extend({msgIfNotFound:!0},n);var o,s=!1,l=function(e){s=!0,r(e)},u=function(e){if("undefined"!=typeof module&&module.exports&&require)try{a=require(i)}catch(e){}void 0!==a&&l(a),e&&e()},c=function(){s||d(h)},d=function(e){"undefined"!=typeof define&&define.amd&&require&&require([i],function(t){void 0!==(a=t)&&l(a),e&&e()},function(t){e&&e()})},h=function(){!s&&n.msgIfNotFound&&e.util.error("Cytoscape.js tried to pull in dependency `"+i+"` but no module (i.e. CommonJS, AMD, or window) was found")};o=function(){s||u(c)},t&&(a=t[i]),void 0!==a&&l(a),o&&o()},requires:function(t,i){for(var r=[],n=[],a=function(){for(var e=0;e<t.length;e++)if(!n[e])return;i.apply(i,r)},o=0;o<t.length;o++)!function(){var i=t[o],s=o;e.util.require(i,function(e){r[s]=e,n[s]=!0,a()})}()},throttle:function(t,i,r){var n=!0,a=!0;return!1===r?n=!1:e.is.plainObject(r)&&(n="leading"in r?r.leading:n,a="trailing"in r?r.trailing:a),(r=r||{}).leading=n,r.maxWait=i,r.trailing=a,e.util.debounce(t,i,r)},now:function(){return+new Date},debounce:function(t,i,r){var n,a,o,s,l,u,c,d=0,h=!1,p=!0;if(e.is.fn(t)){if(i=Math.max(0,i)||0,!0===r){var f=!0;p=!1}else e.is.plainObject(r)&&(f=r.leading,h="maxWait"in r&&(Math.max(i,r.maxWait)||0),p="trailing"in r?r.trailing:p);var g=function(){var r=i-(e.util.now()-s);if(r<=0){a&&clearTimeout(a);var h=c;a=u=c=void 0,h&&(d=e.util.now(),o=t.apply(l,n),u||a||(n=l=null))}else u=setTimeout(g,r)},v=function(){u&&clearTimeout(u),a=u=c=void 0,(p||h!==i)&&(d=e.util.now(),o=t.apply(l,n),u||a||(n=l=null))};return function(){if(n=arguments,s=e.util.now(),l=this,c=p&&(u||!f),!1===h)var r=f&&!u;else{a||f||(d=s);var y=h-(s-d),m=y<=0;m?(a&&(a=clearTimeout(a)),d=s,o=t.apply(l,n)):a||(a=setTimeout(v,y))}return m&&u?u=clearTimeout(u):u||i===h||(u=setTimeout(g,i)),r&&(m=!0,o=t.apply(l,n)),!m||u||a||(n=l=null),o}}},error:function(e){if(!console)throw e;if(console.error);else if(!console.log)throw e},clone:function(e){var t={};for(var i in e)t[i]=e[i];return t},copy:function(t){return null==t?t:e.is.array(t)?t.slice():e.is.plainObject(t)?e.util.clone(t):t},makeBoundingBox:function(e){if(null!=e.x1&&null!=e.y1){if(null!=e.x2&&null!=e.y2&&e.x2>=e.x1&&e.y2>=e.y1)return{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,w:e.x2-e.x1,h:e.y2-e.y1};if(null!=e.w&&null!=e.h&&e.w>=0&&e.h>=0)return{x1:e.x1,y1:e.y1,x2:e.x1+e.w,y2:e.y1+e.h,w:e.w,h:e.h}}},mapEmpty:function(e){var t=!0;if(null!=e)for(var i in e){t=!1;break}return t},pushMap:function(t){var i=e.util.getMap(t);null==i?e.util.setMap($.extend({},t,{value:[t.value]})):i.push(t.value)},setMap:function(t){for(var i=t.map,r=t.keys,n=r.length,a=0;a<n;a++){var o=r[a];e.is.plainObject(o)&&e.util.error("Tried to set map with object key"),a<r.length-1?(null==i[o]&&(i[o]={}),i=i[o]):i[o]=t.value}},getMap:function(t){for(var i=t.map,r=t.keys,n=r.length,a=0;a<n;a++){var o=r[a];if(e.is.plainObject(o)&&e.util.error("Tried to get map with object key"),null==(i=i[o]))return i}return i},deleteMap:function(t){for(var i=t.map,r=t.keys,n=r.length,a=t.keepChildren,o=0;o<n;o++){var s=r[o];if(e.is.plainObject(s)&&e.util.error("Tried to delete map with object key"),o===t.keys.length-1)if(a)for(var l in i)a[l]||(i[l]=void 0);else i[s]=void 0;else i=i[s]}},capitalize:function(t){return e.is.emptyString(t)?t:t.charAt(0).toUpperCase()+t.substring(1)},trim:function(e){var t,i;for(t=0;t<e.length&&" "===e[t];t++);for(i=e.length-1;i>t&&" "===e[i];i--);return e.substring(t,i+1)},hex2tuple:function(e){if((4===e.length||7===e.length)&&"#"===e[0]){var t,i,r;return 4===e.length?(t=parseInt(e[1]+e[1],16),i=parseInt(e[2]+e[2],16),r=parseInt(e[3]+e[3],16)):(t=parseInt(e[1]+e[2],16),i=parseInt(e[3]+e[4],16),r=parseInt(e[5]+e[6],16)),[t,i,r]}},hsl2tuple:function(t){var i,r,n,a,o,s,l,u;function c(e,t,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?e+6*(t-e)*i:i<.5?t:i<2/3?e+(t-e)*(2/3-i)*6:e}var d=new RegExp("^"+e.util.regex.hsla+"$").exec(t);if(d){if((r=parseInt(d[1]))<0?r=(360- -1*r%360)%360:r>360&&(r%=360),r/=360,(n=parseFloat(d[2]))<0||n>100)return;if(n/=100,(a=parseFloat(d[3]))<0||a>100)return;if(a/=100,void 0!==(o=d[4])&&((o=parseFloat(o))<0||o>1))return;if(0===n)s=l=u=Math.round(255*a);else{var h=a<.5?a*(1+n):a+n-a*n,p=2*a-h;s=Math.round(255*c(p,h,r+1/3)),l=Math.round(255*c(p,h,r)),u=Math.round(255*c(p,h,r-1/3))}i=[s,l,u,o]}return i},rgb2tuple:function(t){var i,r=new RegExp("^"+e.util.regex.rgba+"$").exec(t);if(r){i=[];for(var n=[],a=1;a<=3;a++){var o=r[a];if("%"===o[o.length-1]&&(n[a]=!0),o=parseFloat(o),n[a]&&(o=o/100*255),o<0||o>255)return;i.push(Math.floor(o))}var s=n[1]||n[2]||n[3],l=n[1]&&n[2]&&n[3];if(s&&!l)return;var u=r[4];if(void 0!==u){if((u=parseFloat(u))<0||u>1)return;i.push(u)}}return i},colorname2tuple:function(t){return e.util.colors[t.toLowerCase()]},color2tuple:function(t){return(e.is.array(t)?t:null)||e.util.colorname2tuple(t)||e.util.hex2tuple(t)||e.util.rgb2tuple(t)||e.util.hsl2tuple(t)},tuple2hex:function(e){var t=e[0],i=e[1],r=e[2];function n(e){var t=e.toString(16);return 1===t.length&&(t="0"+t),t}return"#"+n(t)+n(i)+n(r)},colors:{transparent:[0,0,0,0],aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],grey:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},memoize:function(e,t){var i=this,r={};return t||(t=function(){if(1===arguments.length)return arguments[0];for(var e=[],t=0;t<arguments.length;t++)e.push(arguments[t]);return e.join("$")}),function(){var n,a=arguments,o=t.apply(i,a);return(n=r[o])||(n=r[o]=e.apply(i,a)),n}}},e.util.camel2dash=e.util.memoize(function(e){for(var t=[],i=0;i<e.length;i++){var r=e[i],n=r.toLowerCase();r!==n?(t.push("-"),t.push(n)):t.push(r)}return t.length===e.length?e:t.join("")}),e.util.dash2camel=e.util.memoize(function(e){for(var t=[],i=!1,r=0;r<e.length;r++){var n=e[r];"-"===n?i=!0:(i?t.push(n.toUpperCase()):t.push(n),i=!1)}return t.join("")}),e.util.regex={},e.util.regex.number="(?:[-]?\\d*\\.\\d+|[-]?\\d+|[-]?\\d*\\.\\d+[eE]\\d+)",e.util.regex.rgba="rgb[a]?\\(("+e.util.regex.number+"[%]?)\\s*,\\s*("+e.util.regex.number+"[%]?)\\s*,\\s*("+e.util.regex.number+"[%]?)(?:\\s*,\\s*("+e.util.regex.number+"))?\\)",e.util.regex.rgbaNoBackRefs="rgb[a]?\\((?:"+e.util.regex.number+"[%]?)\\s*,\\s*(?:"+e.util.regex.number+"[%]?)\\s*,\\s*(?:"+e.util.regex.number+"[%]?)(?:\\s*,\\s*(?:"+e.util.regex.number+"))?\\)",e.util.regex.hsla="hsl[a]?\\(("+e.util.regex.number+")\\s*,\\s*("+e.util.regex.number+"[%])\\s*,\\s*("+e.util.regex.number+"[%])(?:\\s*,\\s*("+e.util.regex.number+"))?\\)",e.util.regex.hslaNoBackRefs="hsl[a]?\\((?:"+e.util.regex.number+")\\s*,\\s*(?:"+e.util.regex.number+"[%])\\s*,\\s*(?:"+e.util.regex.number+"[%])(?:\\s*,\\s*(?:"+e.util.regex.number+"))?\\)",e.util.regex.hex3="\\#[0-9a-fA-F]{3}",e.util.regex.hex6="\\#[0-9a-fA-F]{6}";var i=t?t.requestAnimationFrame||t.mozRequestAnimationFrame||t.webkitRequestAnimationFrame||t.msRequestAnimationFrame:null;i=i||function(e){e&&setTimeout(e,1e3/60)},e.util.requestAnimationFrame=function(e){i(e)}}(cytoscape,"undefined"==typeof window?null:window),function(e){"use strict";e.math={},e.math.signum=function(e){return e>0?1:e<0?-1:0},e.math.distance=function(e,t){var i=t.x-e.x,r=t.y-e.y;return Math.sqrt(i*i+r*r)},e.math.qbezierAt=function(e,t,i,r){return(1-r)*(1-r)*e+2*(1-r)*r*t+r*r*i},e.math.qbezierPtAt=function(t,i,r,n){return{x:e.math.qbezierAt(t.x,i.x,r.x,n),y:e.math.qbezierAt(t.y,i.y,r.y,n)}},e.math.boundingBoxesIntersect=function(e,t){return!(e.x1>t.x2)&&(!(t.x1>e.x2)&&(!(e.x2<t.x1)&&(!(t.x2<e.x1)&&(!(e.y2<t.y1)&&(!(t.y2<e.y1)&&(!(e.y1>t.y2)&&!(t.y1>e.y2)))))))},e.math.inBoundingBox=function(e,t,i){return e.x1<=t&&t<=e.x2&&e.y1<=i&&i<=e.y2},e.math.pointInBoundingBox=function(e,t){return this.inBoundingBox(e,t.x,t.y)},e.math.roundRectangleIntersectLine=function(e,t,i,r,n,a,o){var s,l=this.getRoundRectangleRadius(n,a),u=n/2,c=a/2,d=i-u+l-o,h=r-c-o,p=i+u-l+o,f=h;if((s=this.finiteLinesIntersect(e,t,i,r,d,h,p,f,!1)).length>0)return s;var g=i+u+o,v=r-c+l-o,y=g,m=r+c-l+o;if((s=this.finiteLinesIntersect(e,t,i,r,g,v,y,m,!1)).length>0)return s;var x=i-u+l-o,b=r+c+o,w=i+u-l+o,_=b;if((s=this.finiteLinesIntersect(e,t,i,r,x,b,w,_,!1)).length>0)return s;var E,S=i-u-o,D=r-c+l-o,k=S,P=r+c-l+o;if((s=this.finiteLinesIntersect(e,t,i,r,S,D,k,P,!1)).length>0)return s;var T=i-u+l,C=r-c+l;if((E=this.intersectLineCircle(e,t,i,r,T,C,l+o)).length>0&&E[0]<=T&&E[1]<=C)return[E[0],E[1]];var M=i+u-l,B=r-c+l;if((E=this.intersectLineCircle(e,t,i,r,M,B,l+o)).length>0&&E[0]>=M&&E[1]<=B)return[E[0],E[1]];var N=i+u-l,I=r+c-l;if((E=this.intersectLineCircle(e,t,i,r,N,I,l+o)).length>0&&E[0]>=N&&E[1]>=I)return[E[0],E[1]];var O=i-u+l,z=r+c-l;return(E=this.intersectLineCircle(e,t,i,r,O,z,l+o)).length>0&&E[0]<=O&&E[1]>=z?[E[0],E[1]]:[]},e.math.roundRectangleIntersectBox=function(e,t,i,r,n,a,o,s,l){var u=this.getRoundRectangleRadius(n,a),c=o-n/2-l,d=s-a/2+u-l,h=o+n/2+l,p=s+a/2-u+l,f=o-n/2+u-l,g=s-a/2-l,v=o+n/2-u+l,y=s+a/2+l,m=Math.min(e,i),x=Math.max(e,i),b=Math.min(t,r),w=Math.max(t,r);return!(x<c)&&(!(m>h)&&(!(w<g)&&(!(b>y)&&(c>=m&&c<=x&&d>=b&&d<=w||(h>=m&&h<=x&&d>=b&&d<=w||(h>=m&&h<=x&&p>=b&&p<=w||(c>=m&&c<=x&&p>=b&&p<=w||(m>=c&&m<=h&&b>=d&&b<=p||(x>=c&&x<=h&&b>=d&&b<=p||(x>=c&&x<=h&&w>=d&&w<=p||(m>=c&&m<=h&&w>=d&&w<=p||(f>=m&&f<=x&&g>=b&&g<=w||(v>=m&&v<=x&&g>=b&&g<=w||(v>=m&&v<=x&&y>=b&&y<=w||(f>=m&&f<=x&&y>=b&&y<=w||(m>=f&&m<=v&&b>=g&&b<=y||(x>=f&&x<=v&&b>=g&&b<=y||(x>=f&&x<=v&&w>=g&&w<=y||(m>=f&&m<=v&&w>=g&&w<=y||(!!this.boxIntersectEllipse(m,b,x,w,l,2*u,2*u,f+l,d+l)||(!!this.boxIntersectEllipse(m,b,x,w,l,2*u,2*u,v-l,d+l)||(!!this.boxIntersectEllipse(m,b,x,w,l,2*u,2*u,v-l,p-l)||!!this.boxIntersectEllipse(m,b,x,w,l,2*u,2*u,f+l,p-l)))))))))))))))))))))))},e.math.checkInBoundingCircle=function(e,t,i,r,n,a,o,s){return(e=(e-o)/(n+r))*e+(t=(t-s)/(a+r))*t<=i},e.math.boxInBezierVicinity=function(e,t,i,r,n,a,o,s,l,u,c){var d=.25*n+.5*o+.25*l,h=.25*a+.5*s+.25*u,p=Math.min(e,i)-c,f=Math.min(t,r)-c,g=Math.max(e,i)+c,v=Math.max(t,r)+c;if(n>=p&&n<=g&&a>=f&&a<=v)return 1;if(l>=p&&l<=g&&u>=f&&u<=v)return 1;if(d>=p&&d<=g&&h>=f&&h<=v)return 1;if(o>=p&&o<=g&&s>=f&&s<=v)return 1;var y=Math.min(n,d,l),m=Math.min(a,h,u),x=Math.max(n,d,l),b=Math.max(a,h,u);return y>g||x<p||m>v||b<f?0:1},e.math.checkBezierInBox=function(t,i,r,n,a,o,s,l,u,c,d){function h(d){var h=e.math.qbezierAt(a,s,u,d),p=e.math.qbezierAt(o,l,c,d);return t<=h&&h<=r&&i<=p&&p<=n}for(var p=0;p<=1;p+=.25)if(!h(p))return!1;return!0},e.math.checkStraightEdgeInBox=function(e,t,i,r,n,a,o,s,l){return e<=n&&n<=i&&e<=o&&o<=i&&t<=a&&a<=r&&t<=s&&s<=r},e.math.checkStraightEdgeCrossesBox=function(e,t,i,r,n,a,o,s,l){var u,c,d=Math.min(e,i)-l,h=Math.min(t,r)-l,p=Math.max(e,i)+l,f=Math.max(t,r)+l,g=o-n,v=n,y=s-a,m=a;if(Math.abs(g)<1e-4)return n>=d&&n<=p&&Math.min(a,s)<=h&&Math.max(a,s)>=f;var x=(d-v)/g;if(x>0&&x<=1&&(u=y*x+m)>=h&&u<=f)return!0;var b=(p-v)/g;if(b>0&&b<=1&&(u=y*b+m)>=h&&u<=f)return!0;var w=(h-m)/y;if(w>0&&w<=1&&(c=g*w+v)>=d&&c<=p)return!0;var _=(f-m)/y;return _>0&&_<=1&&(c=g*_+v)>=d&&c<=p},e.math.checkBezierCrossesBox=function(e,t,i,r,n,a,o,s,l,u,c){var d=Math.min(e,i)-c,h=Math.min(t,r)-c,p=Math.max(e,i)+c,f=Math.max(t,r)+c;if(n>=d&&n<=p&&a>=h&&a<=f)return!0;if(l>=d&&l<=p&&u>=h&&u<=f)return!0;var g=n-2*o+l,v=-2*n+2*o,y=n,m=[];if(Math.abs(g)<1e-4){var x=(d-n)/v,b=(p-n)/v;m.push(x,b)}else{var w,_,E=v*v-4*g*(y-d);if(E>0)w=(-v+(V=Math.sqrt(E)))/(2*g),_=(-v-V)/(2*g),m.push(w,_);var S,D,k=v*v-4*g*(y-p);if(k>0)S=(-v+(V=Math.sqrt(k)))/(2*g),D=(-v-V)/(2*g),m.push(S,D)}m.sort(function(e,t){return e-t});var P=a-2*s+u,T=-2*a+2*s,C=a,M=[];if(Math.abs(P)<1e-4){var B=(h-a)/T,N=(f-a)/T;M.push(B,N)}else{var I,O,z=T*T-4*P*(C-h);if(z>0)I=(-T+(V=Math.sqrt(z)))/(2*P),O=(-T-V)/(2*P),M.push(I,O);var L,R,V,A=T*T-4*P*(C-f);if(A>0)L=(-T+(V=Math.sqrt(A)))/(2*P),R=(-T-V)/(2*P),M.push(L,R)}M.sort(function(e,t){return e-t});for(var X=0;X<m.length;X+=2)for(var F=1;F<M.length;F+=2)if(m[X]<M[F]&&M[F]>=0&&m[X]<=1&&m[X+1]>M[F-1]&&M[F-1]<=1&&m[X+1]>=0)return!0;return!1},e.math.inLineVicinity=function(e,t,i,r,n,a,o){var s=o,l=Math.min(i,n),u=Math.max(i,n),c=Math.min(r,a),d=Math.max(r,a);return l-s<=e&&e<=u+s&&c-s<=t&&t<=d+s},e.math.inBezierVicinity=function(e,t,i,r,n,a,o,s,l){var u=Math.min(i,o,n),c=Math.max(i,o,n),d=Math.min(r,s,a),h=Math.max(r,s,a);return!(e<u||e>c||t<d||t>h)},e.math.solveCubic=function(e,t,i,r,n){var a,o,s,l,u,c,d,h;return s=-27*(r/=e)+(t/=e)*(9*(i/=e)-t*t*2),a=(o=(3*i-t*t)/9)*o*o+(s/=54)*s,n[1]=0,d=t/3,a>0?(u=(u=s+Math.sqrt(a))<0?-Math.pow(-u,1/3):Math.pow(u,1/3),c=(c=s-Math.sqrt(a))<0?-Math.pow(-c,1/3):Math.pow(c,1/3),n[0]=-d+u+c,d+=(u+c)/2,n[4]=n[2]=-d,d=Math.sqrt(3)*(-c+u)/2,n[3]=d,void(n[5]=-d)):(n[5]=n[3]=0,0===a?(h=s<0?-Math.pow(-s,1/3):Math.pow(s,1/3),n[0]=2*h-d,void(n[4]=n[2]=-(h+d))):(l=(o=-o)*o*o,l=Math.acos(s/Math.sqrt(l)),h=2*Math.sqrt(o),n[0]=-d+h*Math.cos(l/3),n[2]=-d+h*Math.cos((l+2*Math.PI)/3),void(n[4]=-d+h*Math.cos((l+4*Math.PI)/3))))},e.math.sqDistanceToQuadraticBezier=function(e,t,i,r,n,a,o,s){var l=1*i*i-4*i*n+2*i*o+4*n*n-4*n*o+o*o+r*r-4*r*a+2*r*s+4*a*a-4*a*s+s*s,u=9*i*n-3*i*i-3*i*o-6*n*n+3*n*o+9*r*a-3*r*r-3*r*s-6*a*a+3*a*s,c=3*i*i-6*i*n+i*o-i*e+2*n*n+2*n*e-o*e+3*r*r-6*r*a+r*s-r*t+2*a*a+2*a*t-s*t,d=1*i*n-i*i+i*e-n*e+r*a-r*r+r*t-a*t,h=[];this.solveCubic(l,u,c,d,h);for(var p=[],f=0;f<6;f+=2)Math.abs(h[f+1])<1e-7&&h[f]>=0&&h[f]<=1&&p.push(h[f]);p.push(1),p.push(0);for(var g,v,y,m=-1,x=0;x<p.length;x++)g=Math.pow(1-p[x],2)*i+2*(1-p[x])*p[x]*n+p[x]*p[x]*o,v=Math.pow(1-p[x],2)*r+2*(1-p[x])*p[x]*a+p[x]*p[x]*s,y=Math.pow(g-e,2)+Math.pow(v-t,2),m>=0?y<m&&(m=y,p[x]):(m=y,p[x]);return m},e.math.sqDistanceToFiniteLine=function(e,t,i,r,n,a){var o=[e-i,t-r],s=[n-i,a-r],l=s[0]*s[0]+s[1]*s[1],u=o[0]*o[0]+o[1]*o[1],c=o[0]*s[0]+o[1]*s[1],d=c*c/l;return c<0?u:d>l?(e-n)*(e-n)+(t-a)*(t-a):u-d},e.math.pointInsidePolygon=function(e,t,i,r,n,a,o,s,l){var u=new Array(i.length),c=Math.asin(s[1]/Math.sqrt(s[0]*s[0]+s[1]*s[1]));s[0]<0?c+=Math.PI/2:c=-c-Math.PI/2;for(var d,h,p,f,g,v,y=Math.cos(-c),m=Math.sin(-c),x=0;x<u.length/2;x++)u[2*x]=a/2*(i[2*x]*y-i[2*x+1]*m),u[2*x+1]=o/2*(i[2*x+1]*y+i[2*x]*m),u[2*x]+=r,u[2*x+1]+=n;if(l>0){var b=this.expandPolygon(u,-l);d=this.joinLines(b)}else d=u;var w=0;for(x=0;x<d.length/2;x++)if(h=d[2*x],p=d[2*x+1],x+1<d.length/2?(f=d[2*(x+1)],g=d[2*(x+1)+1]):(f=d[2*(x+1-d.length/2)],g=d[2*(x+1-d.length/2)+1]),h==e&&f==e);else{if(!(h>=e&&e>=f||h<=e&&e<=f))continue;(v=(e-h)/(f-h)*(g-p)+p)>t&&w++,v<t&&0}return w%2!=0},e.math.joinLines=function(e){for(var t,i,r,n,a,o,s,l,u=new Array(e.length/2),c=0;c<e.length/4;c++){t=e[4*c],i=e[4*c+1],r=e[4*c+2],n=e[4*c+3],c<e.length/4-1?(a=e[4*(c+1)],o=e[4*(c+1)+1],s=e[4*(c+1)+2],l=e[4*(c+1)+3]):(a=e[0],o=e[1],s=e[2],l=e[3]);var d=this.finiteLinesIntersect(t,i,r,n,a,o,s,l,!0);u[2*c]=d[0],u[2*c+1]=d[1]}return u},e.math.expandPolygon=function(e,t){for(var i,r,n,a,o=new Array(2*e.length),s=0;s<e.length/2;s++){i=e[2*s],r=e[2*s+1],s<e.length/2-1?(n=e[2*(s+1)],a=e[2*(s+1)+1]):(n=e[0],a=e[1]);var l=a-r,u=-(n-i),c=Math.sqrt(l*l+u*u),d=l/c,h=u/c;o[4*s]=i+d*t,o[4*s+1]=r+h*t,o[4*s+2]=n+d*t,o[4*s+3]=a+h*t}return o},e.math.intersectLineEllipse=function(e,t,i,r,n,a){var o=i-e,s=r-t;o/=n,s/=a;var l=Math.sqrt(o*o+s*s),u=l-1;if(u<0)return[];var c=u/l;return[(i-e)*c+e,(r-t)*c+t]},e.math.dotProduct=function(e,t){if(2!=e.length||2!=t.length)throw"dot product: arguments are not vectors";return e[0]*t[0]+e[1]*t[1]},e.math.intersectLineCircle=function(e,t,i,r,n,a,o){var s=[i-e,r-t],l=[e-n,t-a],u=s[0]*s[0]+s[1]*s[1],c=2*(l[0]*s[0]+l[1]*s[1]),d=c*c-4*u*(l[0]*l[0]+l[1]*l[1]-o*o);if(d<0)return[];var h=(-c+Math.sqrt(d))/(2*u),p=(-c-Math.sqrt(d))/(2*u),f=Math.min(h,p),g=Math.max(h,p),v=[];if(f>=0&&f<=1&&v.push(f),g>=0&&g<=1&&v.push(g),0===v.length)return[];var y=v[0]*s[0]+e,m=v[0]*s[1]+t;return v.length>1?v[0]==v[1]?[y,m]:[y,m,v[1]*s[0]+e,v[1]*s[1]+t]:[y,m]},e.math.findCircleNearPoint=function(e,t,i,r,n){var a=r-e,o=n-t,s=Math.sqrt(a*a+o*o);return[e+a/s*i,t+o/s*i]},e.math.findMaxSqDistanceToOrigin=function(e){for(var t,i=1e-6,r=0;r<e.length/2;r++)(t=e[2*r]*e[2*r]+e[2*r+1]*e[2*r+1])>i&&(i=t);return i},e.math.finiteLinesIntersect=function(e,t,i,r,n,a,o,s,l){var u=(o-n)*(t-a)-(s-a)*(e-n),c=(i-e)*(t-a)-(r-t)*(e-n),d=(s-a)*(i-e)-(o-n)*(r-t);if(0!==d){var h=u/d,p=c/d;return 0<=h&&h<=1&&0<=p&&p<=1?[e+h*(i-e),t+h*(r-t)]:l?[e+h*(i-e),t+h*(r-t)]:[]}return 0===u||0===c?[e,i,o].sort()[1]===o?[o,s]:[e,i,n].sort()[1]===n?[n,a]:[n,o,i].sort()[1]===i?[i,r]:[]:[]},e.math.boxIntersectEllipse=function(e,t,i,r,n,a,o,s,l){if(i<e){var u=e;e=i,i=u}if(r<t){var c=t;t=r,r=c}var d=[s-a/2-n,l],h=[s+a/2+n,l],p=[s,l-o/2-n],f=[s,l+o/2+n];return!(i<d[0])&&(!(e>h[0])&&(!(t>f[1])&&(!(r<p[1])&&(e<=h[0]&&h[0]<=i&&t<=h[1]&&h[1]<=r||(e<=d[0]&&d[0]<=i&&t<=d[1]&&d[1]<=r||(e<=p[0]&&p[0]<=i&&t<=p[1]&&p[1]<=r||(e<=f[0]&&f[0]<=i&&t<=f[1]&&f[1]<=r||(i=(i-s)/(a/2+n),r=(r-l)/(o/2+n),(e=(e-s)/(a/2+n))*e+(t=(t-l)/(o/2+n))*t<=1||(i*i+t*t<=1||(i*i+r*r<=1||e*e+r*r<=1))))))))))},e.math.boxIntersectPolygon=function(t,i,r,n,a,o,s,l,u,c,d){if(r<t){var h=t;t=r,r=h}if(n<i){var p=i;i=n,n=p}var f=new Array(a.length),g=Math.asin(c[1]/Math.sqrt(c[0]*c[0]+c[1]*c[1]));c[0]<0?g+=Math.PI/2:g=-g-Math.PI/2;for(var v=Math.cos(-g),y=Math.sin(-g),m=0;m<f.length/2;m++)f[2*m]=o/2*(a[2*m]*v-a[2*m+1]*y),f[2*m+1]=s/2*(a[2*m+1]*v+a[2*m]*y),f[2*m]+=l,f[2*m+1]+=u;var x,b=f[0],w=f[0],_=f[1],E=f[1];for(m=1;m<f.length/2;m++)f[2*m]>w&&(w=f[2*m]),f[2*m]<b&&(b=f[2*m]),f[2*m+1]>E&&(E=f[2*m+1]),f[2*m+1]<_&&(_=f[2*m+1]);if(r<b-d)return!1;if(t>w+d)return!1;if(n<_-d)return!1;if(i>E+d)return!1;if(d>0){var S=e.math.expandPolygon(f,-d);x=e.math.joinLines(S)}else x=f;for(m=0;m<f.length/2;m++)if(t<=f[2*m]&&f[2*m]<=r&&i<=f[2*m+1]&&f[2*m+1]<=n)return!0;for(m=0;m<x.length/2;m++){var D,k,P=x[2*m],T=x[2*m+1];if(m<x.length/2-1?(D=x[2*(m+1)],k=x[2*(m+1)+1]):(D=x[0],k=x[1]),e.math.finiteLinesIntersect(P,T,D,k,t,i,r,i,!1).length>0)return!0;if(e.math.finiteLinesIntersect(P,T,D,k,t,n,r,n,!1).length>0)return!0;if(e.math.finiteLinesIntersect(P,T,D,k,t,i,t,n,!1).length>0)return!0;if(e.math.finiteLinesIntersect(P,T,D,k,r,i,r,n,!1).length>0)return!0}return!1},e.math.polygonIntersectLine=function(t,i,r,n,a,o,s,l){for(var u,c,d,h,p,f,g=[],v=new Array(r.length),y=0;y<v.length/2;y++)v[2*y]=r[2*y]*o+n,v[2*y+1]=r[2*y+1]*s+a;if(l>0){var m=e.math.expandPolygon(v,-l);c=e.math.joinLines(m)}else c=v;for(y=0;y<c.length/2;y++)d=c[2*y],h=c[2*y+1],y<c.length/2-1?(p=c[2*(y+1)],f=c[2*(y+1)+1]):(p=c[0],f=c[1]),0!==(u=this.finiteLinesIntersect(t,i,n,a,d,h,p,f)).length&&g.push(u[0],u[1]);return g},e.math.shortenIntersection=function(e,t,i){var r=[e[0]-t[0],e[1]-t[1]],n=Math.sqrt(r[0]*r[0]+r[1]*r[1]),a=(n-i)/n;return a<0&&(a=1e-5),[t[0]+a*r[0],t[1]+a*r[1]]},e.math.generateUnitNgonPointsFitToSquare=function(t,i){var r=e.math.generateUnitNgonPoints(t,i);return r=e.math.fitPolygonToSquare(r)},e.math.fitPolygonToSquare=function(e){for(var t,i,r=e.length/2,n=1/0,a=1/0,o=-1/0,s=-1/0,l=0;l<r;l++)t=e[2*l],i=e[2*l+1],n=Math.min(n,t),o=Math.max(o,t),a=Math.min(a,i),s=Math.max(s,i);var u=2/(o-n),c=2/(s-a);for(l=0;l<r;l++)t=e[2*l]=e[2*l]*u,i=e[2*l+1]=e[2*l+1]*c,n=Math.min(n,t),o=Math.max(o,t),a=Math.min(a,i),s=Math.max(s,i);if(a<-1)for(l=0;l<r;l++)i=e[2*l+1]=e[2*l+1]+(-1-a);return e},e.math.generateUnitNgonPoints=function(e,t){var i=1/e*2*Math.PI,r=e%2==0?Math.PI/2+i/2:Math.PI/2;r+=t;for(var n,a=new Array(2*e),o=0;o<e;o++)n=o*i+r,a[2*o]=Math.cos(n),a[2*o+1]=Math.sin(-n);return a},e.math.getRoundRectangleRadius=function(e,t){return Math.min(e/4,t/4,8)}}(cytoscape),function(e){"use strict";var t={};e.extensions=t;var i={};e.modules=i,e.extension=function(){return 2==arguments.length?function(i,r){return e.util.getMap({map:t,keys:[i,r]})}.apply(this,arguments):3==arguments.length?function(i,r,n){var a={};switch(a[r]=n,i){case"core":case"collection":e.fn[i](a)}if("layout"===i){for(var o=n.prototype,s=[],l=0;l<s.length;l++){var u=s[l];o[u]=o[u]||function(){return this}}o.start&&!o.run?o.run=function(){return this.start(),this}:!o.start&&o.run&&(o.start=function(){return this.run(),this}),o.stop||(o.stop=function(){var e=this.options;return e&&e.animate&&e.eles.stop(),this}),o.on=e.define.on({layout:!0}),o.one=e.define.on({layout:!0,unbindSelfOnTrigger:!0}),o.once=e.define.on({layout:!0,unbindAllBindersOnTrigger:!0}),o.off=e.define.off({layout:!0}),o.trigger=e.define.trigger({layout:!0}),e.define.eventAliasesOn(o)}return e.util.setMap({map:t,keys:[i,r],value:n})}.apply(this,arguments):4==arguments.length?function(t,r,n,a){return e.util.getMap({map:i,keys:[t,r,n,a]})}.apply(this,arguments):5==arguments.length?function(t,r,n,a,o){return e.util.setMap({map:i,keys:[t,r,n,a],value:o})}.apply(this,arguments):void e.util.error("Invalid extension access syntax")}}(cytoscape),function(e,t){"use strict";var i=function(e){return e[0]._cyreg=e[0]._cyreg||{}};t.registerJquery=function(e){e&&(e.fn.cytoscape||(e.fn.cytoscape=function(r){var n=e(this);if("get"===r)return i(n).cy;if(t.is.fn(r)){var a=r,o=i(n).cy;if(o&&o.isReady())o.trigger("ready",[],a);else{var s=i(n);(s.readies=s.readies||[]).push(a)}}else if(t.is.plainObject(r))return n.each(function(){var t=e.extend({},r,{container:e(this)[0]});cytoscape(t)})},e.cytoscape=cytoscape,null==e.fn.cy&&null==e.cy&&(e.fn.cy=e.fn.cytoscape,e.cy=e.cytoscape)))},t.registerJquery(e),t.util.require("jquery",function(e){t.registerJquery(e)})}("undefined"!=typeof jQuery?jQuery:null,cytoscape),function(e){"use strict";function t(){return!1}function i(){return!0}e.Event=function(r,n){if(!(this instanceof e.Event))return new e.Event(r,n);r&&r.type?(this.originalEvent=r,this.type=r.type,this.isDefaultPrevented=r.defaultPrevented?i:t):this.type=r,n&&(this.type=void 0!==n.type?n.type:this.type,this.cy=n.cy,this.cyTarget=n.cyTarget,this.cyPosition=n.cyPosition,this.cyRenderedPosition=n.cyRenderedPosition,this.namespace=n.namespace,this.layout=n.layout,this.data=n.data,this.message=n.message),this.timeStamp=r&&r.timeStamp||+new Date},e.Event.prototype={preventDefault:function(){this.isDefaultPrevented=i;var e=this.originalEvent;e&&e.preventDefault&&e.preventDefault()},stopPropagation:function(){this.isPropagationStopped=i;var e=this.originalEvent;e&&e.stopPropagation&&e.stopPropagation()},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=i,this.stopPropagation()},isDefaultPrevented:t,isPropagationStopped:t,isImmediatePropagationStopped:t}}(cytoscape),function(e){"use strict";e.define={data:function(t){return t=e.util.extend({},{field:"data",bindingEvent:"data",allowBinding:!1,allowSetting:!1,allowGetting:!1,settingEvent:"data",settingTriggersEvent:!1,triggerFnName:"trigger",immutableKeys:{},updateStyle:!1,onSet:function(e){},canSet:function(e){return!0}},t),function(i,r){var n=t,a=void 0!==this.length,o=a?this:[this],s=a?this[0]:this;if(e.is.string(i)){if(n.allowGetting&&void 0===r)return s&&(f=s._private[n.field][i]),f;if(n.allowSetting&&void 0!==r&&!n.immutableKeys[i]){for(var l=0,u=o.length;l<u;l++)n.canSet(o[l])&&(o[l]._private[n.field][i]=r);n.updateStyle&&this.updateStyle(),n.onSet(this),n.settingTriggersEvent&&this[n.triggerFnName](n.settingEvent)}}else if(n.allowSetting&&e.is.plainObject(i)){var c,d,h=i;for(c in h){if(d=h[c],!n.immutableKeys[c])for(l=0,u=o.length;l<u;l++)n.canSet(o[l])&&(o[l]._private[n.field][c]=d)}n.updateStyle&&this.updateStyle(),n.onSet(this),n.settingTriggersEvent&&this[n.triggerFnName](n.settingEvent)}else if(n.allowBinding&&e.is.fn(i)){var p=i;this.bind(n.bindingEvent,p)}else if(n.allowGetting&&void 0===i){var f;return s&&(f=s._private[n.field]),f}return this}},removeData:function(t){return t=e.util.extend({},{field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!1,immutableKeys:{}},t),function(i){var r=t,n=void 0!==this.length?this:[this];if(e.is.string(i)){for(var a=i.split(/\s+/),o=a.length,s=0;s<o;s++){var l=a[s];if(!e.is.emptyString(l))if(!r.immutableKeys[l])for(var u=0,c=n.length;u<c;u++)n[u]._private[r.field][l]=void 0}r.triggerEvent&&this[r.triggerFnName](r.event)}else if(void 0===i){for(u=0,c=n.length;u<c;u++){var d=n[u]._private[r.field];for(var l in d){!r.immutableKeys[l]&&(d[l]=void 0)}}r.triggerEvent&&this[r.triggerFnName](r.event)}return this}},event:{regex:/(\w+)(\.\w+)?/,optionalTypeRegex:/(\w+)?(\.\w+)?/,falseCallback:function(){return!1}},on:function(t){return t=e.util.extend({},{unbindSelfOnTrigger:!1,unbindAllBindersOnTrigger:!1},t),function(i,r,n,a){var o=void 0!==this.length?this:[this],s=e.is.string(i),l=t;if(e.is.plainObject(r)?(a=n,n=r,r=void 0):(e.is.fn(r)||!1===r)&&(a=r,n=void 0,r=void 0),(e.is.fn(n)||!1===n)&&(a=n,n=void 0),!e.is.fn(a)&&!1!==a&&s)return this;if(s){var u={};u[i]=a,i=u}for(var c in i)if(!1===(a=i[c])&&(a=e.define.event.falseCallback),e.is.fn(a)){c=c.split(/\s+/);for(var d=0;d<c.length;d++){var h=c[d];if(!e.is.emptyString(h)){var p=h.match(e.define.event.regex);if(p)for(var f=p[1],g=p[2]?p[2]:void 0,v={callback:a,data:n,delegated:!!r,selector:r,selObj:new e.Selector(r),type:f,namespace:g,unbindSelfOnTrigger:l.unbindSelfOnTrigger,unbindAllBindersOnTrigger:l.unbindAllBindersOnTrigger,binders:o},y=0;y<o.length;y++){var m=o[y]._private;m.listeners=m.listeners||[],m.listeners.push(v)}}}}return this}},eventAliasesOn:function(t){var i=t;i.addListener=i.listen=i.bind=i.on,i.removeListener=i.unlisten=i.unbind=i.off,i.emit=i.trigger,i.pon=i.promiseOn=function(t,i){var r=this,n=Array.prototype.slice.call(arguments,0);return new e.Promise(function(e,t){var i=n.concat([function(t){r.off.apply(r,a),e(t)}]),a=i.concat([]);r.on.apply(r,i)})}},off:function(t){return t=e.util.extend({},{},t),function(t,i,r){var n=void 0!==this.length?this:[this],a=e.is.string(t);if(0===arguments.length){for(var o=0;o<n.length;o++)n[o]._private.listeners=[];return this}if((e.is.fn(i)||!1===i)&&(r=i,i=void 0),a){var s={};s[t]=r,t=s}for(var l in t){!1===(r=t[l])&&(r=e.define.event.falseCallback),l=l.split(/\s+/);for(var u=0;u<l.length;u++){var c=l[u];if(!e.is.emptyString(c)){var d=c.match(e.define.event.optionalTypeRegex);if(d){var h=d[1]?d[1]:void 0,p=d[2]?d[2]:void 0;for(o=0;o<n.length;o++)for(var f=n[o]._private.listeners=n[o]._private.listeners||[],g=0;g<f.length;g++){var v=f[g],y=!p||p===v.namespace,m=!h||v.type===h,x=!r||r===v.callback;y&&m&&x&&(f.splice(g,1),g--)}}}}}return this}},trigger:function(t){return t=e.util.extend({},{},t),function(i,r,n){var a=void 0!==this.length?this:[this],o=e.is.string(i),s=e.is.plainObject(i),l=e.is.event(i),u=this._private.cy||(e.is.core(this)?this:null),c=!!u&&u.hasCompoundNodes();if(o){var d=i.split(/\s+/);i=[];for(var h=0;h<d.length;h++){var p=d[h];if(!e.is.emptyString(p)){var f=p.match(e.define.event.regex),g=f[1],v=f[2]?f[2]:void 0;i.push({type:g,namespace:v})}}}else if(s){i=[i]}r?e.is.array(r)||(r=[r]):r=[];for(h=0;h<i.length;h++)for(var y=i[h],m=0;m<a.length;m++){var x=a[m],b=x._private.listeners=x._private.listeners||[],w=e.is.element(x)||t.layout;if(l?((p=y).cyTarget=p.cyTarget||x,p.cy=p.cy||u):p=new e.Event(y,{cyTarget:x,cy:u,namespace:y.namespace}),y.layout&&(p.layout=y.layout),t.layout&&(p.layout=x),p.cyPosition){var _=p.cyPosition,E=u.zoom(),S=u.pan();p.cyRenderedPosition={x:_.x*E+S.x,y:_.y*E+S.y}}n&&(b=[{namespace:p.namespace,type:p.type,callback:n}]);for(var D=0;D<b.length;D++){var k=b[D],P=!k.namespace||k.namespace===p.namespace,T=k.type===p.type,C=!k.delegated||x!==p.cyTarget&&e.is.element(p.cyTarget)&&k.selObj.matches(p.cyTarget);if(P&&T&&C){var M=[p];if(M=M.concat(r),k.data?p.data=k.data:p.data=void 0,(k.unbindSelfOnTrigger||k.unbindAllBindersOnTrigger)&&(b.splice(D,1),D--),k.unbindAllBindersOnTrigger)for(var B=k.binders,N=0;N<B.length;N++){var I=B[N];if(I&&I!==x)for(var O=I._private.listeners,z=0;z<O.length;z++){O[z]===k&&(O.splice(z,1),z--)}}var L=k.delegated?p.cyTarget:x,R=k.callback.apply(L,M);(!1===R||p.isPropagationStopped())&&(w=!1,!1===R&&(p.stopPropagation(),p.preventDefault()))}}if(w){var V=c?x._private.parent:null;null!=V&&0!==V.length?(V=V[0]).trigger(p):u.trigger(p)}}return this}},animated:function(t){return t=e.util.extend({},{},t),function(){var e=void 0!==this.length?this:[this];if(!(this._private.cy||this).styleEnabled())return!1;var t=e[0];return t?t._private.animation.current.length>0:void 0}},clearQueue:function(t){return t=e.util.extend({},{},t),function(){var e=void 0!==this.length?this:[this];if(!(this._private.cy||this).styleEnabled())return this;for(var t=0;t<e.length;t++){e[t]._private.animation.queue=[]}return this}},delay:function(t){return t=e.util.extend({},{},t),function(e,t){return(this._private.cy||this).styleEnabled()?(this.animate({delay:e},{duration:e,complete:t}),this):this}},animate:function(t){return t=e.util.extend({},{},t),function(e,t){var i=void 0!==this.length,r=i?this:[this],n=this._private.cy||this,a=!i,o=!a;if(!n.styleEnabled())return this;var s=+new Date,l=n.style();switch(void 0===t&&(t={}),void 0===t.duration&&(t.duration=400),t.duration){case"slow":t.duration=600;break;case"fast":t.duration=200}var u=!0;if(e)for(var c in e){u=!1;break}if(u)return this;if(e.css&&o&&(e.css=l.getPropsList(e.css)),e.renderedPosition&&o){var d=e.renderedPosition,h=n.pan(),p=n.zoom();e.position={x:(d.x-h.x)/p,y:(d.y-h.y)/p}}if(e.panBy&&a){var f=e.panBy,g=n.pan();e.pan={x:g.x+f.x,y:g.y+f.y}}var v=e.center||e.centre;if(v&&a){var y=n.getCenterPan(v.eles,e.zoom);y&&(e.pan=y)}if(e.fit&&a){var m=e.fit,x=n.getFitViewport(m.eles||m.boundingBox,m.padding);x&&(e.pan=x.pan,e.zoom=x.zoom)}for(c=0;c<r.length;c++){var b=r[c];(b.animated()&&(void 0===t.queue||t.queue)?b._private.animation.queue:b._private.animation.current).push({properties:e,duration:t.duration,params:t,callTime:s})}return o&&n.addToAnimationPool(this),this}},stop:function(t){return t=e.util.extend({},{},t),function(e,t){var i=void 0!==this.length?this:[this],r=this._private.cy||this;if(!r.styleEnabled())return this;for(var n=0;n<i.length;n++){for(var a=i[n],o=a._private.animation.current,s=0;s<o.length;s++){var l=o[s];t&&(l.duration=0)}e&&(a._private.animation.queue=[]),t||(a._private.animation.current=[])}return r.notify({collection:this,type:"draw"}),this}}}}(cytoscape),function(e){"use strict";e.fn.selector=function(t,i){for(var r in t){var n=t[r];e.Selector.prototype[r]=n}},e.Selector=function(t,i){if(!(this instanceof e.Selector))return new e.Selector(t,i);void 0===i&&void 0!==t&&(i=t,t=void 0);var r=this;if(r._private={selectorText:null,invalid:!0},!i||e.is.string(i)&&i.match(/^\s*$/))null==t?r.length=0:(r[0]=o(),r[0].group=t,r.length=1);else if(e.is.element(i)){var n=new e.Collection(r.cy(),[i]);r[0]=o(),r[0].collection=n,r.length=1}else if(e.is.collection(i))r[0]=o(),r[0].collection=i,r.length=1;else if(e.is.fn(i))r[0]=o(),r[0].filter=i,r.length=1;else{if(!e.is.string(i))return void e.util.error("A selector must be created from a string; found "+i);var a=null,o=function(){return{classes:[],colonSelectors:[],data:[],group:null,ids:[],meta:[],collection:null,filter:null,parent:null,ancestor:null,subject:null,child:null,descendant:null}},s={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:'"(?:\\\\"|[^"])+"|'+"'(?:\\\\'|[^'])+'",number:e.util.regex.number,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$"};s.variable="(?:[\\w-]|(?:\\\\"+s.metaChar+"))+",s.value=s.string+"|"+s.number,s.className=s.variable,s.id=s.variable;for(var l=function(e){return e.replace(new RegExp("\\\\("+s.metaChar+")","g"),function(e,t,i,r){return t})},u=s.comparatorOp.split("|"),c=0;c<u.length;c++){var d=u[c];s.comparatorOp+="|@"+d}for(u=s.comparatorOp.split("|"),c=0;c<u.length;c++){(d=u[c]).indexOf("!")>=0||"="!==d&&(s.comparatorOp+="|\\!"+d)}var h={group:{query:!0,regex:"(node|edge|\\*)",populate:function(e){this.group="*"==e?e:e+"s"}},state:{query:!0,regex:"(:selected|:unselected|:locked|:unlocked|:visible|:hidden|:transparent|:grabbed|:free|:removed|:inside|:grabbable|:ungrabbable|:animated|:unanimated|:selectable|:unselectable|:orphan|:nonorphan|:parent|:child|:loop|:simple|:active|:inactive|:touch|:backgrounding|:nonbackgrounding)",populate:function(e){this.colonSelectors.push(e)}},id:{query:!0,regex:"\\#("+s.id+")",populate:function(e){this.ids.push(l(e))}},className:{query:!0,regex:"\\.("+s.className+")",populate:function(e){this.classes.push(l(e))}},dataExists:{query:!0,regex:"\\[\\s*("+s.variable+")\\s*\\]",populate:function(e){this.data.push({field:l(e)})}},dataCompare:{query:!0,regex:"\\[\\s*("+s.variable+")\\s*("+s.comparatorOp+")\\s*("+s.value+")\\s*\\]",populate:function(e,t,i){i=null!=new RegExp("^"+s.string+"$").exec(i)?i.substring(1,i.length-1):parseFloat(i),this.data.push({field:l(e),operator:t,value:i})}},dataBool:{query:!0,regex:"\\[\\s*("+s.boolOp+")\\s*("+s.variable+")\\s*\\]",populate:function(e,t){this.data.push({field:l(t),operator:e})}},metaCompare:{query:!0,regex:"\\[\\[\\s*("+s.meta+")\\s*("+s.comparatorOp+")\\s*("+s.number+")\\s*\\]\\]",populate:function(e,t,i){this.meta.push({field:l(e),operator:t,value:parseFloat(i)})}},nextQuery:{separator:!0,regex:s.separator,populate:function(){r[++c]=o(),a=null}},child:{separator:!0,regex:s.child,populate:function(){var e=o();e.parent=this,e.subject=a,r[c]=e}},descendant:{separator:!0,regex:s.descendant,populate:function(){var e=o();e.ancestor=this,e.subject=a,r[c]=e}},subject:{modifier:!0,regex:s.subject,populate:function(){if(null!=a&&this.subject!=this)return e.util.error("Redefinition of subject in selector `"+i+"`"),!1;a=this,this.subject=this}}},p=0;for(var f in h)h[p]=h[f],h[p].name=f,p++;h.length=p,r._private.selectorText=i;var g=i,v=(c=0,function(t){for(var i,r,n,a=0;a<h.length;a++){var o=h[a],s=o.name;if(!e.is.fn(t)||t(s,o)){var l=g.match(new RegExp("^"+o.regex));if(null!=l){r=l,i=o,n=s;var u=l[0];g=g.substring(u.length);break}}}return{expr:i,match:r,name:n}});for(r[0]=o(),function(){var e=g.match(/^\s+/);if(e){var t=e[0];g=g.substring(t.length)}}();;){var y=v();if(null==y.expr)return void e.util.error("The selector `"+i+"`is invalid");var m=[];for(p=1;p<y.match.length;p++)m.push(y.match[p]);if(!1===y.expr.populate.apply(r[c],m))return;if(g.match(/^\s*$/))break}for(r.length=c+1,p=0;p<r.length;p++){var x=r[p];if(null!=x.subject){for(;x.subject!=x;)if(null!=x.parent){var b=x.parent,w=x;w.parent=null,b.child=w,x=b}else{if(null==x.ancestor){e.util.error("When adjusting references for the selector `"+x+"`, neither parent nor ancestor was found");break}var _=x.ancestor,E=x;E.ancestor=null,_.descendant=E,x=_}r[p]=x.subject}}if(null!=t)for(p=0;p<r.length;p++){if(null!=r[p].group&&r[p].group!=t)return void e.util.error("Group `"+r[p].group+"` conflicts with implicit group `"+t+"` in selector `"+i+"`");r[p].group=t}}r._private.invalid=!1},e.selfn=e.Selector.prototype,e.selfn.size=function(){return this.length},e.selfn.eq=function(e){return this[e]},e.selfn.find=function(){};var t=function(i,r){if(null!=i.group&&"*"!=i.group&&i.group!=r._private.group)return!1;for(var n=r.cy(),a=!0,o=0;o<i.colonSelectors.length;o++){switch(i.colonSelectors[o]){case":selected":a=r.selected();break;case":unselected":a=!r.selected();break;case":selectable":a=r.selectable();break;case":unselectable":a=!r.selectable();break;case":locked":a=r.locked();break;case":unlocked":a=!r.locked();break;case":visible":a=r.visible();break;case":hidden":a=!r.visible();break;case":transparent":a=r.transparent();break;case":grabbed":a=r.grabbed();break;case":free":a=!r.grabbed();break;case":removed":a=r.removed();break;case":inside":a=!r.removed();break;case":grabbable":a=r.grabbable();break;case":ungrabbable":a=!r.grabbable();break;case":animated":a=r.animated();break;case":unanimated":a=!r.animated();break;case":parent":a=r.isNode()&&r.children().nonempty();break;case":child":case":nonorphan":a=r.isNode()&&r.parent().nonempty();break;case":orphan":a=r.isNode()&&r.parent().empty();break;case":loop":a=r.isEdge()&&r.data("source")===r.data("target");break;case":simple":a=r.isEdge()&&r.data("source")!==r.data("target");break;case":active":a=r.active();break;case":inactive":a=!r.active();break;case":touch":a=e.is.touch();break;case":backgrounding":a=r.backgrounding();break;case":nonbackgrounding":a=!r.backgrounding()}if(!a)break}if(!a)return!1;var s=!0;for(o=0;o<i.ids.length;o++){var l=i.ids[o],u=r._private.data.id;if(!(s=s&&l==u))break}if(!s)return!1;var c=!0;for(o=0;o<i.classes.length;o++){var d=i.classes[o];if(!(c=c&&r.hasClass(d)))break}if(!c)return!1;var h=function(t){for(var r=!0,n=0;n<i[t.name].length;n++){var a,o=i[t.name][n],s=o.operator,l=o.value,u=o.field;if(null!=s&&null!=l){var c=t.fieldValue(u),d=e.is.string(c)||e.is.number(c)?""+c:"",h=""+l,p=!1;s.indexOf("@")>=0&&(d=d.toLowerCase(),h=h.toLowerCase(),s=s.replace("@",""),p=!0);var f=!1,g=!1;switch(s.indexOf("!")>=0&&(s=s.replace("!",""),f=!0),p&&(l=h.toLowerCase(),c=d.toLowerCase()),s){case"*=":a=d.search(h)>=0;break;case"$=":a=null!=new RegExp(h+"$").exec(d);break;case"^=":a=null!=new RegExp("^"+h).exec(d);break;case"=":a=c===l;break;case"!=":a=c!==l;break;case">":a=f?c<=l:c>l,g=!0;break;case">=":a=f?c<l:c>=l,g=!0;break;case"<":a=f?c>=l:c<l,g=!0;break;case"<=":a=f?c>l:c<=l,g=!0;break;default:a=!1}}else if(null!=s)switch(s){case"?":a=t.fieldTruthy(u);break;case"!":a=!t.fieldTruthy(u);break;case"^":a=t.fieldUndefined(u)}else a=!t.fieldUndefined(u);if(f&&!g&&(a=!a,g=!0),!a){r=!1;break}}return r};if(!h({name:"data",fieldValue:function(e){return r._private.data[e]},fieldRef:function(e){return"element._private.data."+e},fieldUndefined:function(e){return void 0===r._private.data[e]},fieldTruthy:function(e){return!!r._private.data[e]}}))return!1;if(!h({name:"meta",fieldValue:function(e){return r[e]()},fieldRef:function(e){return"element."+e+"()"},fieldUndefined:function(e){return null==r[e]()},fieldTruthy:function(e){return!!r[e]()}}))return!1;if(null!=i.collection&&!(null!=i.collection._private.ids[r.id()]))return!1;if(null!=i.filter&&0===r.collection().filter(i.filter).size())return!1;var p=function(e,i){if(null!=e){var r=!1;if(!n.hasCompoundNodes())return!1;i=i();for(var a=0;a<i.length;a++)if(t(e,i[a])){r=!0;break}return r}return!0};return!!p(i.parent,function(){return r.parent()})&&(!!p(i.ancestor,function(){return r.parents()})&&(!!p(i.child,function(){return r.children()})&&!!p(i.descendant,function(){return r.descendants()})))};e.selfn.filter=function(i){var r=this,n=i.cy();if(r._private.invalid)return new e.Collection(n);var a=function(e,i){for(var n=0;n<r.length;n++){var a=r[n];if(t(a,i))return!0}return!1};return null==r._private.selectorText&&(a=function(){return!0}),i.filter(a)},e.selfn.matches=function(e){if(this._private.invalid)return!1;for(var i=0;i<this.length;i++){var r=this[i];if(t(r,e))return!0}return!1},e.selfn.toString=e.selfn.selector=function(){for(var t="",i=function(t,i){return e.is.string(t)?i?'"'+t+'"':t:""},r=function(e){var t="";e.subject===e&&(t+="$");var a=i(e.group);t+=a.substring(0,a.length-1);for(var o=0;o<e.data.length;o++){var s=e.data[o];s.value?t+="["+s.field+i(s.operator)+i(s.value,!0)+"]":t+="["+i(s.operator)+s.field+"]"}for(o=0;o<e.meta.length;o++){var l=e.meta[o];t+="[["+l.field+i(l.operator)+i(l.value,!0)+"]]"}for(o=0;o<e.colonSelectors.length;o++){t+=e.colonSelectors[n]}for(o=0;o<e.ids.length;o++){t+="#"+e.ids[n]}for(o=0;o<e.classes.length;o++){t+="."+e.classes[n]}return null!=e.parent&&(t=r(e.parent)+" > "+t),null!=e.ancestor&&(t=r(e.ancestor)+" "+t),null!=e.child&&(t+=" > "+r(e.child)),null!=e.descendant&&(t+=" "+r(e.descendant)),t},n=0;n<this.length;n++){var a=this[n];t+=r(a),this.length>1&&n<this.length-1&&(t+=", ")}return t}}(cytoscape),function(e){"use strict";e.Style=function(t){if(!(this instanceof e.Style))return new e.Style(t);e.is.core(t)?(this._private={cy:t,coreStyle:{},newStyle:!0},this.length=0,this.addDefaultStylesheet()):e.util.error("A style must have a core reference")},e.style=e.Style,e.styfn=e.Style.prototype,e.fn.style=function(t,i){for(var r in t){var n=t[r];e.Style.prototype=n}},function(){var t=e.util.regex.number,i=e.util.regex.rgbaNoBackRefs,r=e.util.regex.hslaNoBackRefs,n=e.util.regex.hex3,a=e.util.regex.hex6,o=function(e){return"^"+e+"\\s*\\(\\s*([\\w\\.]+)\\s*\\)$"},s=function(e){return"^"+e+"\\s*\\(([\\w\\.]+)\\s*\\,\\s*("+t+")\\s*\\,\\s*("+t+")\\s*,\\s*("+t+"|\\w+|"+i+"|"+r+"|"+n+"|"+a+")\\s*\\,\\s*("+t+"|\\w+|"+i+"|"+r+"|"+n+"|"+a+")\\)$"};e.style.types={time:{number:!0,min:0,units:"s|ms",implicitUnits:"ms"},percent:{number:!0,min:0,max:100,units:"%"},zeroOneNumber:{number:!0,min:0,max:1,unitless:!0},nOneOneNumber:{number:!0,min:-1,max:1,unitless:!0},nonNegativeInt:{number:!0,min:0,integer:!0,unitless:!0},position:{enums:["parent","origin"]},autoSize:{number:!0,min:0,enums:["auto"]},number:{number:!0},size:{number:!0,min:0},bgSize:{number:!0,min:0,allowPercent:!0},bgWH:{number:!0,min:0,allowPercent:!0,enums:["auto"]},bgPos:{number:!0,allowPercent:!0},bgRepeat:{enums:["repeat","repeat-x","repeat-y","no-repeat"]},bgFit:{enums:["none","contain","cover"]},bgClip:{enums:["none","node"]},color:{color:!0},lineStyle:{enums:["solid","dotted","dashed"]},borderStyle:{enums:["solid","dotted","dashed","double"]},curveStyle:{enums:["bezier","unbundled-bezier","haystack"]},fontFamily:{regex:'^([\\w- \\"]+(?:\\s*,\\s*[\\w- \\"]+)*)$'},fontVariant:{enums:["small-caps","normal"]},fontStyle:{enums:["italic","normal","oblique"]},fontWeight:{enums:["normal","bold","bolder","lighter","100","200","300","400","500","600","800","900",100,200,300,400,500,600,700,800,900]},textDecoration:{enums:["none","underline","overline","line-through"]},textTransform:{enums:["none","uppercase","lowercase"]},textWrap:{enums:["none","wrap"]},textBackgroundShape:{enums:["rectangle","roundrectangle"]},nodeShape:{enums:["rectangle","roundrectangle","ellipse","triangle","square","pentagon","hexagon","heptagon","octagon","star","diamond","vee","rhomboid"]},compoundIncludeLabels:{enums:["include","exclude"]},arrowShape:{enums:["tee","triangle","triangle-tee","triangle-backcurve","half-triangle-overshot","square","circle","diamond","none"]},arrowFill:{enums:["filled","hollow"]},display:{enums:["element","none"]},visibility:{enums:["hidden","visible"]},valign:{enums:["top","center","bottom"]},halign:{enums:["left","center","right"]},text:{string:!0},data:{mapping:!0,regex:o("data")},layoutData:{mapping:!0,regex:o("layoutData")},scratch:{mapping:!0,regex:o("scratch")},mapData:{mapping:!0,regex:s("mapData")},mapLayoutData:{mapping:!0,regex:s("mapLayoutData")},mapScratch:{mapping:!0,regex:s("mapScratch")},fn:{mapping:!0,fn:!0},url:{regex:"^url\\s*\\(\\s*([^\\s]+)\\s*\\s*\\)|none|(.+)$"},propList:{propList:!0},angle:{number:!0,units:"deg|rad"},textRotation:{enums:["none","autorotate"]}};var l=e.style.types,u=e.style.properties=[{name:"text-valign",type:l.valign},{name:"text-halign",type:l.halign},{name:"color",type:l.color},{name:"content",type:l.text},{name:"text-outline-color",type:l.color},{name:"text-outline-width",type:l.size},{name:"text-outline-opacity",type:l.zeroOneNumber},{name:"text-opacity",type:l.zeroOneNumber},{name:"text-background-color",type:l.color},{name:"text-background-opacity",type:l.zeroOneNumber},{name:"text-border-opacity",type:l.zeroOneNumber},{name:"text-border-color",type:l.color},{name:"text-border-width",type:l.size},{name:"text-border-style",type:l.borderStyle},{name:"text-background-shape",type:l.textBackgroundShape},{name:"text-transform",type:l.textTransform},{name:"text-wrap",type:l.textWrap},{name:"text-max-width",type:l.size},{name:"font-family",type:l.fontFamily},{name:"font-style",type:l.fontStyle},{name:"font-weight",type:l.fontWeight},{name:"font-size",type:l.size},{name:"min-zoomed-font-size",type:l.size},{name:"edge-text-rotation",type:l.textRotation},{name:"display",type:l.display},{name:"visibility",type:l.visibility},{name:"opacity",type:l.zeroOneNumber},{name:"z-index",type:l.nonNegativeInt},{name:"overlay-padding",type:l.size},{name:"overlay-color",type:l.color},{name:"overlay-opacity",type:l.zeroOneNumber},{name:"shadow-blur",type:l.size},{name:"shadow-color",type:l.color},{name:"shadow-opacity",type:l.zeroOneNumber},{name:"shadow-offset-x",type:l.number},{name:"shadow-offset-y",type:l.number},{name:"text-shadow-blur",type:l.size},{name:"text-shadow-color",type:l.color},{name:"text-shadow-opacity",type:l.zeroOneNumber},{name:"text-shadow-offset-x",type:l.number},{name:"text-shadow-offset-y",type:l.number},{name:"transition-property",type:l.propList},{name:"transition-duration",type:l.time},{name:"transition-delay",type:l.time},{name:"height",type:l.autoSize},{name:"width",type:l.autoSize},{name:"shape",type:l.nodeShape},{name:"background-color",type:l.color},{name:"background-opacity",type:l.zeroOneNumber},{name:"background-blacken",type:l.nOneOneNumber},{name:"border-color",type:l.color},{name:"border-opacity",type:l.zeroOneNumber},{name:"border-width",type:l.size},{name:"border-style",type:l.borderStyle},{name:"background-image",type:l.url},{name:"background-image-opacity",type:l.zeroOneNumber},{name:"background-position-x",type:l.bgPos},{name:"background-position-y",type:l.bgPos},{name:"background-repeat",type:l.bgRepeat},{name:"background-fit",type:l.bgFit},{name:"background-clip",type:l.bgClip},{name:"background-width",type:l.bgWH},{name:"background-height",type:l.bgWH},{name:"padding-left",type:l.size},{name:"padding-right",type:l.size},{name:"padding-top",type:l.size},{name:"padding-bottom",type:l.size},{name:"position",type:l.position},{name:"compound-sizing-wrt-labels",type:l.compoundIncludeLabels},{name:"line-style",type:l.lineStyle},{name:"line-color",type:l.color},{name:"control-point-step-size",type:l.size},{name:"control-point-distance",type:l.number},{name:"control-point-weight",type:l.zeroOneNumber},{name:"curve-style",type:l.curveStyle},{name:"haystack-radius",type:l.zeroOneNumber},{name:"source-arrow-shape",type:l.arrowShape},{name:"target-arrow-shape",type:l.arrowShape},{name:"mid-source-arrow-shape",type:l.arrowShape},{name:"mid-target-arrow-shape",type:l.arrowShape},{name:"source-arrow-color",type:l.color},{name:"target-arrow-color",type:l.color},{name:"mid-source-arrow-color",type:l.color},{name:"mid-target-arrow-color",type:l.color},{name:"source-arrow-fill",type:l.arrowFill},{name:"target-arrow-fill",type:l.arrowFill},{name:"mid-source-arrow-fill",type:l.arrowFill},{name:"mid-target-arrow-fill",type:l.arrowFill},{name:"selection-box-color",type:l.color},{name:"selection-box-opacity",type:l.zeroOneNumber},{name:"selection-box-border-color",type:l.color},{name:"selection-box-border-width",type:l.size},{name:"active-bg-color",type:l.color},{name:"active-bg-opacity",type:l.zeroOneNumber},{name:"active-bg-size",type:l.size},{name:"outside-texture-bg-color",type:l.color},{name:"outside-texture-bg-opacity",type:l.zeroOneNumber}];e.style.pieBackgroundN=16,u.push({name:"pie-size",type:l.bgSize});for(var c=1;c<=e.style.pieBackgroundN;c++)u.push({name:"pie-"+c+"-background-color",type:l.color}),u.push({name:"pie-"+c+"-background-size",type:l.percent}),u.push({name:"pie-"+c+"-background-opacity",type:l.zeroOneNumber});for(c=0;c<u.length;c++){var d=u[c];u[d.name]=d}}(),e.styfn.addDefaultStylesheet=function(){this.selector("node, edge").css({"text-valign":"top","text-halign":"center",color:"#000","text-outline-color":"#000","text-outline-width":0,"text-outline-opacity":1,"text-opacity":1,"text-decoration":"none","text-transform":"none","text-wrap":"none","text-max-width":9999,"text-background-color":"#000","text-background-opacity":0,"text-border-opacity":0,"text-border-width":0,"text-border-style":"solid","text-border-color":"#000","text-background-shape":"rectangle","font-family":"Helvetica","font-style":"normal","font-weight":"normal","font-size":16,"min-zoomed-font-size":0,"edge-text-rotation":"none",visibility:"visible",display:"element",opacity:1,"z-index":0,content:"","overlay-opacity":0,"overlay-color":"#000","overlay-padding":10,"shadow-opacity":0,"shadow-color":"#000","shadow-blur":10,"shadow-offset-x":0,"shadow-offset-y":0,"text-shadow-opacity":0,"text-shadow-color":"#000","text-shadow-blur":5,"text-shadow-offset-x":0,"text-shadow-offset-y":0,"transition-property":"none","transition-duration":0,"transition-delay":0,"background-blacken":0,"background-color":"#888","background-opacity":1,"background-image":"none","background-image-opacity":1,"background-position-x":"50%","background-position-y":"50%","background-repeat":"no-repeat","background-fit":"none","background-clip":"node","background-width":"auto","background-height":"auto","border-color":"#000","border-opacity":1,"border-width":0,"border-style":"solid",height:30,width:30,shape:"ellipse","padding-top":0,"padding-bottom":0,"padding-left":0,"padding-right":0,position:"origin","compound-sizing-wrt-labels":"include","pie-size":"100%","pie-1-background-color":"black","pie-2-background-color":"black","pie-3-background-color":"black","pie-4-background-color":"black","pie-5-background-color":"black","pie-6-background-color":"black","pie-7-background-color":"black","pie-8-background-color":"black","pie-9-background-color":"black","pie-10-background-color":"black","pie-11-background-color":"black","pie-12-background-color":"black","pie-13-background-color":"black","pie-14-background-color":"black","pie-15-background-color":"black","pie-16-background-color":"black","pie-1-background-size":"0%","pie-2-background-size":"0%","pie-3-background-size":"0%","pie-4-background-size":"0%","pie-5-background-size":"0%","pie-6-background-size":"0%","pie-7-background-size":"0%","pie-8-background-size":"0%","pie-9-background-size":"0%","pie-10-background-size":"0%","pie-11-background-size":"0%","pie-12-background-size":"0%","pie-13-background-size":"0%","pie-14-background-size":"0%","pie-15-background-size":"0%","pie-16-background-size":"0%","pie-1-background-opacity":1,"pie-2-background-opacity":1,"pie-3-background-opacity":1,"pie-4-background-opacity":1,"pie-5-background-opacity":1,"pie-6-background-opacity":1,"pie-7-background-opacity":1,"pie-8-background-opacity":1,"pie-9-background-opacity":1,"pie-10-background-opacity":1,"pie-11-background-opacity":1,"pie-12-background-opacity":1,"pie-13-background-opacity":1,"pie-14-background-opacity":1,"pie-15-background-opacity":1,"pie-16-background-opacity":1,"source-arrow-shape":"none","mid-source-arrow-shape":"none","target-arrow-shape":"none","mid-target-arrow-shape":"none","source-arrow-color":"#ddd","mid-source-arrow-color":"#ddd","target-arrow-color":"#ddd","mid-target-arrow-color":"#ddd","source-arrow-fill":"filled","mid-source-arrow-fill":"filled","target-arrow-fill":"filled","mid-target-arrow-fill":"filled","line-style":"solid","line-color":"#ddd","control-point-step-size":40,"control-point-weight":.5,"curve-style":"bezier","haystack-radius":.8}).selector("$node > node").css({width:"auto",height:"auto",shape:"rectangle","background-opacity":.5,"padding-top":10,"padding-right":10,"padding-left":10,"padding-bottom":10}).selector("edge").css({width:1}).selector(":active").css({"overlay-color":"black","overlay-padding":10,"overlay-opacity":.25}).selector("core").css({"selection-box-color":"#ddd","selection-box-opacity":.65,"selection-box-border-color":"#aaa","selection-box-border-width":1,"active-bg-color":"black","active-bg-opacity":.15,"active-bg-size":30,"outside-texture-bg-color":"#000","outside-texture-bg-opacity":.125}),this.defaultLength=this.length},e.styfn.clear=function(){for(var e=0;e<this.length;e++)this[e]=void 0;return this.length=0,this._private.newStyle=!0,this},e.styfn.resetToDefault=function(){return this.clear(),this.addDefaultStylesheet(),this},e.styfn.core=function(){return this._private.coreStyle},e.styfn.parse=function(t,i,r,n){var a,o=[t,i,r,n].join("$"),s=this.propCache=this.propCache||{};return(a=s[o])||(a=s[o]=this.parseImpl(t,i,r,n)),e.util.copy(a)},e.styfn.parseImpl=function(t,i,r,n){t=e.util.camel2dash(t);var a=e.style.properties[t],o=i,s=e.style.types;if(!a)return null;if(void 0===i||null===i)return null;var l=e.is.string(i);l&&(i=e.util.trim(i));var u=a.type;if(!u)return null;if(r&&(""===i||null===i))return{name:t,value:i,bypass:!0,deleteBypass:!0};var c,d,h,p,f,g,v=t.match(/pie-(\d+)-background-size/);if(e.is.fn(i))return{name:t,value:i,strValue:"fn",mapped:s.fn,bypass:r,hasPie:v};if(!l||n);else if((c=new RegExp(s.data.regex).exec(i))||(h=new RegExp(s.layoutData.regex).exec(i))||(f=new RegExp(s.scratch.regex).exec(i))){return!r&&(y=c?s.data:h?s.layoutData:s.scratch,{name:t,value:c=c||h||f,strValue:""+i,mapped:y,field:c[1],bypass:r,hasPie:v})}else if((d=new RegExp(s.mapData.regex).exec(i))||(p=new RegExp(s.mapLayoutData.regex).exec(i))||(g=new RegExp(s.mapScratch.regex).exec(i))){if(r)return!1;var y;if(y=d?s.mapData:p?s.mapLayoutData:s.mapScratch,d=d||p||g,!u.color&&!u.number)return!1;var m=this.parse(t,d[4]);if(!m||m.mapped)return!1;var x=this.parse(t,d[5]);if(!x||x.mapped)return!1;if(m.value===x.value)return!1;if(u.color){var b=m.value,w=x.value;if(!(b[0]!==w[0]||b[1]!==w[1]||b[2]!==w[2]||b[3]!==w[3]&&(null!=b[3]&&1!==b[3]||null!=w[3]&&1!==w[3])))return!1}return{name:t,value:d,strValue:""+i,mapped:y,field:d[1],fieldMin:parseFloat(d[2]),fieldMax:parseFloat(d[3]),valueMin:m.value,valueMax:x.value,bypass:r,hasPie:v}}if(u.number){var _,E="px";if(u.units&&(_=u.units),u.implicitUnits&&(E=u.implicitUnits),!u.unitless)if(l){var S="px|em"+(u.allowPercent?"|\\%":"");_&&(S=_);var D=i.match("^("+e.util.regex.number+")("+S+")?$");D&&(i=D[1],_=D[2]||E)}else _&&!u.implicitUnits||(_=E);if(i=parseFloat(i),isNaN(i)&&void 0===u.enums)return null;if(isNaN(i)&&void 0!==u.enums){i=o;for(var k=0;k<u.enums.length;k++){if(u.enums[k]===i)return{name:t,value:i,strValue:""+i,bypass:r}}return null}if(u.integer&&!e.is.integer(i))return null;if(void 0!==u.min&&i<u.min||void 0!==u.max&&i>u.max)return null;var P={name:t,value:i,strValue:""+i+(_||""),units:_,bypass:r,hasPie:v&&null!=i&&0!==i&&""!==i};return u.unitless||"px"!==_&&"em"!==_||(P.pxValue="px"!==_&&_?this.getEmSizeInPixels()*i:i),"ms"!==_&&"s"!==_||(P.msValue="ms"===_?i:1e3*i),P}if(u.propList){var T=[],C=""+i;if("none"===C);else{var M=C.split(",");for(k=0;k<M.length;k++){var B=e.util.trim(M[k]);e.style.properties[B]&&T.push(B)}if(0===T.length)return null}return{name:t,value:T,strValue:0===T.length?"none":T.join(", "),bypass:r}}if(u.color){var N=e.util.color2tuple(i);return N?{name:t,value:N,strValue:""+i,bypass:r}:null}if(u.enums){for(k=0;k<u.enums.length;k++){if(u.enums[k]===i)return{name:t,value:i,strValue:""+i,bypass:r}}return null}if(u.regex){var I=new RegExp(u.regex).exec(i);return I?{name:t,value:I,strValue:""+i,bypass:r}:null}return u.string?{name:t,value:i,strValue:""+i,bypass:r}:null},e.styfn.selector=function(t){var i="core"===t?null:new e.Selector(t),r=this.length++;return this[r]={selector:i,properties:[],mappedProperties:[],index:r},this},e.styfn.css=function(){var t=arguments;switch(t.length){case 1:for(var i=t[0],r=0;r<e.style.properties.length;r++){var n=e.style.properties[r],a=i[n.name];void 0===a&&(a=i[e.util.dash2camel(n.name)]),void 0!==a&&this.cssRule(n.name,a)}break;case 2:this.cssRule(t[0],t[1])}return this},e.styfn.style=e.styfn.css,e.styfn.cssRule=function(e,t){var i=this.parse(e,t);if(i){var r=this.length-1;this[r].properties.push(i),this[r].properties[i.name]=i,i.hasPie&&(this._private.hasPie=!0),i.mapped&&this[r].mappedProperties.push(i),!this[r].selector&&(this._private.coreStyle[i.name]=i)}return this}}(cytoscape),function(e){"use strict";e.styfn.apply=function(e){this._private.newStyle&&(this._private.contextStyles={},this._private.propDiffs={});for(var t=0;t<e.length;t++){var i=e[t],r=this.getContextMeta(i),n=this.getContextStyle(r),a=this.applyContextStyle(r,n,i);this.updateTransitions(i,a.diffProps),this.updateStyleHints(i)}this._private.newStyle=!1},e.styfn.getPropertiesDiff=function(e,t){var i=this._private.propDiffs=this._private.propDiffs||{},r=e+"-"+t,n=i[r];if(n)return n;for(var a=[],o={},s=0;s<this.length;s++){var l=this[s],u="t"===e[s]!==("t"===t[s]),c=l.mappedProperties.length>0;if(u||c){var d;u&&c?d=l.properties:u?d=l.properties:c&&(d=l.mappedProperties);for(var h=0;h<d.length;h++){for(var p=d[h],f=p.name,g=!1,v=s+1;v<this.length;v++){var y=this[v];if("t"===t[v]&&(g=null!=y.properties[p.name]))break}o[f]||g||(o[f]=!0,a.push(f))}}}return i[r]=a,a},e.styfn.getContextMeta=function(e){var t,i="",r=e._private.styleCxtKey||"";this._private.newStyle&&(r="");for(var n=0;n<this.length;n++){var a=this[n];i+=a.selector&&a.selector.matches(e)?"t":"f"}return t=this.getPropertiesDiff(r,i),e._private.styleCxtKey=i,{key:i,diffPropNames:t}},e.styfn.getContextStyle=function(e){var t=e.key,i=this._private.contextStyles=this._private.contextStyles||{};if(i[t])return i[t];for(var r={_private:{key:t}},n=0;n<this.length;n++){var a=this[n];if("t"===t[n])for(var o=0;o<a.properties.length;o++){var s=a.properties[o];(r[s.name]=s).context=a}}return i[t]=r,r},e.styfn.applyContextStyle=function(e,t,i){for(var r=e.diffPropNames,n={},a=0;a<r.length;a++){var o=r[a],s=t[o],l=i._private.style[o];if(s&&l!==s){var u=n[o]={prev:l};this.applyParsedProperty(i,s),u.next=i._private.style[o],u.next&&u.next.bypass&&(u.next=u.next.bypassed)}}return{diffProps:n}},e.styfn.updateStyleHints=function(t){var i=t._private,r=i.style,n=!1;if("nodes"===i.group&&this._private.hasPie)for(var a=1;a<=e.style.pieBackgroundN;a++){if((u=i.style["pie-"+a+"-background-size"].value)>0){n=!0;break}}i.hasPie=n;var o=r["text-transform"].strValue,s=r.content.strValue,l=r["font-style"].strValue,u=r["font-size"].pxValue+"px",c=r["font-family"].strValue,d=r["font-weight"].strValue,h=r["text-valign"].strValue,p=r["text-valign"].strValue,f=r["text-outline-width"].pxValue,g=r["text-wrap"].strValue,v=r["text-max-width"].pxValue;i.labelKey=l+"$"+u+"$"+c+"$"+d+"$"+s+"$"+o+"$"+h+"$"+p+"$"+f+"$"+g+"$"+v,i.fontKey=l+"$"+d+"$"+u+"$"+c;var y=r.width.pxValue,m=r.height.pxValue,x=r["border-width"].pxValue;if(i.boundingBoxKey=y+"$"+m+"$"+x,"edges"===t._private.group){var b=r["control-point-step-size"].pxValue,w=r["control-point-distance"]?r["control-point-distance"].pxValue:void 0,_=r["control-point-weight"].value,E=r["curve-style"].strValue;i.boundingBoxKey+="$"+b+"$"+w+"$"+_+"$"+E}i.styleKey=Date.now()},e.styfn.applyParsedProperty=function(t,i){var r,n=i,a=t._private.style,o=e.style.types,s=e.style.properties[n.name].type,l=n.bypass,u=a[n.name],c=u&&u.bypass,d=t._private;if(("height"===i.name||"width"===i.name)&&t.isNode()){if("auto"===i.value&&!t.isParent())return!1;"auto"!==i.value&&t.isParent()&&(n=i=this.parse(i.name,"auto",l))}if(l&&n.deleteBypass){var h=a[n.name];return!h||!(!h.bypass||!h.bypassed)&&(a[n.name]=h.bypassed,!0)}var p=function(){e.util.error("Do not assign mappings to elements without corresponding data (e.g. ele `"+t.id()+"` for property `"+n.name+"` with data field `"+n.field+"`); try a `["+n.field+"]` selector to limit scope to elements with `"+n.field+"` defined")};switch(n.mapped){case o.mapData:case o.mapLayoutData:case o.mapScratch:var f,g=n.mapped===o.mapLayoutData,v=n.mapped===o.mapScratch,y=n.field.split(".");C=v||g?d.scratch:d.data;for(var m=0;m<y.length&&C;m++){C=C[y[m]]}if((f=e.is.number(C)?(C-n.fieldMin)/(n.fieldMax-n.fieldMin):0)<0?f=0:f>1&&(f=1),s.color){var x=n.valueMin[0],b=n.valueMax[0],w=n.valueMin[1],_=n.valueMax[1],E=n.valueMin[2],S=n.valueMax[2],D=null==n.valueMin[3]?1:n.valueMin[3],k=null==n.valueMax[3]?1:n.valueMax[3],P=[Math.round(x+(b-x)*f),Math.round(w+(_-w)*f),Math.round(E+(S-E)*f),Math.round(D+(k-D)*f)];r={bypass:n.bypass,name:n.name,value:P,strValue:"rgb("+P[0]+", "+P[1]+", "+P[2]+")"}}else{if(!s.number)return!1;var T=n.valueMin+(n.valueMax-n.valueMin)*f;r=this.parse(n.name,T,n.bypass,!0)}r||(r=this.parse(n.name,u.strValue,n.bypass,!0)),r||p(),r.mapping=n,n=r;break;case o.data:case o.layoutData:case o.scratch:var C;g=n.mapped===o.layoutData,v=n.mapped===o.scratch,y=n.field.split(".");if(C=v||g?d.scratch:d.data)for(m=0;m<y.length;m++){C=C[y[m]]}if(!(r=this.parse(n.name,C,n.bypass,!0))){var M=u?u.strValue:"";r=this.parse(n.name,M,n.bypass,!0)}r||p(),r.mapping=n,n=r;break;case o.fn:var B=(0,n.value)(t);(r=this.parse(n.name,B,n.bypass,!0)).mapping=n,n=r;break;case void 0:break;default:return!1}return l?(n.bypassed=c?u.bypassed:u,a[n.name]=n):c?u.bypassed=n:a[n.name]=n,!0},e.styfn.update=function(){this._private.cy.elements().updateStyle()},e.styfn.updateMappers=function(t){for(var i=0;i<t.length;i++){for(var r=t[i],n=r._private.style,a=0;a<e.style.properties.length;a++){var o=n[e.style.properties[a].name];if(o&&o.mapping){var s=o.mapping;this.applyParsedProperty(r,s)}}this.updateStyleHints(r)}},e.styfn.updateTransitions=function(t,i,r){var n=this,a=t._private.style,o=a["transition-property"].value,s=a["transition-duration"].msValue,l=a["transition-delay"].msValue,u={};if(o.length>0&&s>0){for(var c=!1,d=0;d<o.length;d++){var h=o[d],p=a[h],f=i[h];if(f){var g,v=f.prev,y=null!=f.next?f.next:p,m=!1;v&&(e.is.number(v.pxValue)&&e.is.number(y.pxValue)?(m=y.pxValue-v.pxValue,g=v.pxValue+1e-6*m):e.is.number(v.value)&&e.is.number(y.value)?(m=y.value-v.value,g=v.value+1e-6*m):e.is.array(v.value)&&e.is.array(y.value)&&(m=v.value[0]!==y.value[0]||v.value[1]!==y.value[1]||v.value[2]!==y.value[2],g=v.strValue),m&&(u[h]=y.strValue,this.applyBypass(t,h,g),c=!0))}}if(!c)return;t._private.transitioning=!0,t.stop(),l>0&&t.delay(l),t.animate({css:u},{duration:s,queue:!1,complete:function(){r||n.removeBypasses(t,o),t._private.transitioning=!1}})}else t._private.transitioning&&(t.stop(),this.removeBypasses(t,o),t._private.transitioning=!1)}}(cytoscape),function(e){"use strict";e.styfn.applyBypass=function(t,i,r,n){var a=[];if("*"===i||"**"===i){if(void 0!==r)for(var o=0;o<e.style.properties.length;o++){i=(g=e.style.properties[o]).name;(l=this.parse(i,r,!0))&&a.push(l)}}else if(e.is.string(i)){(l=this.parse(i,r,!0))&&a.push(l)}else{if(!e.is.plainObject(i))return!1;var s=i;n=r;for(o=0;o<e.style.properties.length;o++){var l;if(void 0===(r=s[i=(g=e.style.properties[o]).name])&&(r=s[e.util.dash2camel(i)]),void 0!==r)(l=this.parse(i,r,!0))&&a.push(l)}}if(0===a.length)return!1;var u=!1;for(o=0;o<t.length;o++){for(var c,d=t[o],h=d._private.style,p={},f=0;f<a.length;f++){var g=a[f];if(n){var v=h[g.name];c=p[g.name]={prev:v}}u=this.applyParsedProperty(d,g)||u,n&&(c.next=h[g.name])}n&&this.updateTransitions(d,p,!0)}return u},e.styfn.overrideBypass=function(t,i,r){for(var n=0;n<t.length;n++){var a=t[n],o=a._private.style[e.util.camel2dash(i)];o.bypass?(o.value=r,o.pxValue=r):this.applyBypass(a,i,r)}},e.styfn.removeAllBypasses=function(t,i){for(var r=0;r<t.length;r++){for(var n=t[r],a={},o=n._private.style,s=0;s<e.style.properties.length;s++){var l=e.style.properties[s],u=l.name,c=this.parse(u,"",!0),d=o[l.name],h=a[l.name]={prev:d};this.applyParsedProperty(n,c),h.next=o[l.name]}i&&this.updateTransitions(n,a,!0)}},e.styfn.removeBypasses=function(t,i,r){for(var n=0;n<t.length;n++){for(var a=t[n],o={},s=a._private.style,l=0;l<i.length;l++){var u=i[l],c=e.style.properties[u],d=this.parse(u,"",!0),h=s[c.name],p=o[c.name]={prev:h};this.applyParsedProperty(a,d),p.next=s[c.name]}r&&this.updateTransitions(a,o,!0)}}}(cytoscape),function(e,t){"use strict";e.styfn.getEmSizeInPixels=function(){var e=this._private.cy.container();if(t&&e&&t.getComputedStyle){var i=t.getComputedStyle(e).getPropertyValue("font-size");return parseFloat(i)}return 1},e.styfn.containerCss=function(e){var i=this._private.cy.container();if(t&&i&&t.getComputedStyle)return t.getComputedStyle(i).getPropertyValue(e)},e.styfn.containerProperty=function(e){var t=this.containerCss(e);return this.parse(e,t)},e.styfn.containerPropertyAsString=function(e){var t=this.containerProperty(e);if(t)return t.strValue}}(cytoscape,"undefined"==typeof window?null:window),function(e){"use strict";e.styfn.getRenderedStyle=function(t){if(t=t[0]){for(var i={},r=t._private.style,n=this._private.cy.zoom(),a=0;a<e.style.properties.length;a++){var o=e.style.properties[a],s=r[o.name];if(s){var l=s.unitless?s.strValue:s.pxValue*n+"px";i[o.name]=l,i[e.util.dash2camel(o.name)]=l}}return i}},e.styfn.getRawStyle=function(t){if(t=t[0]){for(var i={},r=t._private.style,n=0;n<e.style.properties.length;n++){var a=e.style.properties[n],o=r[a.name];o&&(i[a.name]=o.strValue,i[e.util.dash2camel(a.name)]=o.strValue)}return i}},e.styfn.getValueStyle=function(t){var i,r={};if(i=e.is.element(t)?t._private.style:t)for(var n=0;n<e.style.properties.length;n++){var a=e.style.properties[n],o=i[a.name]||i[e.util.dash2camel(a.name)];void 0===o||e.is.plainObject(o)||(o=this.parse(a.name,o)),o&&(r[a.name]=o,r[e.util.dash2camel(a.name)]=o)}return r},e.styfn.getPropsList=function(t){var i=[],r=t,n=e.style.properties;if(r)for(var a in r){var o=r[a],s=n[a]||n[e.util.camel2dash(a)],l=this.parse(s.name,o);i.push(l)}return i}}(cytoscape),function(e){"use strict";e.style.applyFromJson=function(e,t){for(var i=0;i<t.length;i++){var r=t[i],n=r.selector,a=r.style||r.css;for(var o in e.selector(n),a){var s=a[o];e.css(o,s)}}return e},e.style.fromJson=function(t,i){var r=new e.Style(t);return e.style.applyFromJson(r,i),r},e.styfn.fromJson=function(t){return this.resetToDefault(),e.style.applyFromJson(this,t),this},e.styfn.json=function(){for(var e=[],t=this.defaultLength;t<this.length;t++){for(var i=this[t],r=i.selector,n=i.properties,a={},o=0;o<n.length;o++){var s=n[o];a[s.name]=s.strValue}e.push({selector:r?r.toString():"core",style:a})}return e}}(cytoscape),function(e){"use strict";e.style.applyFromString=function(t,i){var r,n,a,o=""+i;function s(){o=o.length>r.length?o.substr(r.length):""}function l(){n=n.length>a.length?n.substr(a.length):""}for(o=o.replace(/[/][*](\s|.)+?[*][/]/g,"");;){if(o.match(/^\s*$/))break;var u=o.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!u){e.util.error("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+o);break}r=u[0];var c=u[1];if("core"!==c)if(new e.Selector(c)._private.invalid){e.util.error("Skipping parsing of block: Invalid selector found in string stylesheet: "+c),s();continue}var d=u[2],h=!1;n=d;for(var p=[];;){if(n.match(/^\s*$/))break;var f=n.match(/^\s*(.+?)\s*:\s*(.+?)\s*;/);if(!f){e.util.error("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+d),h=!0;break}a=f[0];var g=f[1],v=f[2];if(m=e.style.properties[g])t.parse(g,v)?(p.push({name:g,val:v}),l()):(e.util.error("Skipping property: Invalid property definition in: "+a),l());else e.util.error("Skipping property: Invalid property name in: "+a),l()}if(h){s();break}t.selector(c);for(var y=0;y<p.length;y++){var m=p[y];t.css(m.name,m.val)}s()}return t},e.style.fromString=function(t,i){var r=new e.Style(t);return e.style.applyFromString(r,i),r},e.styfn.fromString=function(t){return this.resetToDefault(),e.style.applyFromString(this,t),this}}(cytoscape),function(e){"use strict";e.stylesheet=e.Stylesheet=function(){if(!(this instanceof e.Stylesheet))return new e.Stylesheet;this.length=0},e.sheetfn=e.Stylesheet.prototype,e.sheetfn.selector=function(e){return this[this.length++]={selector:e,properties:[]},this},e.sheetfn.css=function(t,i){var r=this.length-1;if(e.is.string(t))this[r].properties.push({name:t,value:i});else if(e.is.plainObject(t))for(var n=t,a=0;a<e.style.properties.length;a++){var o=e.style.properties[a],s=n[o.name];if(void 0===s&&(s=n[e.util.dash2camel(o.name)]),void 0!==s){t=o.name,i=s;this[r].properties.push({name:t,value:i})}}return this},e.sheetfn.style=e.sheetfn.css,e.sheetfn.generateStyle=function(t){for(var i=new e.Style(t),r=0;r<this.length;r++){var n=this[r],a=n.selector,o=n.properties;i.selector(a);for(var s=0;s<o.length;s++){var l=o[s];i.css(l.name,l.value)}}return i}}(cytoscape),function(e,t){"use strict";e.Thread=function(t){if(!(this instanceof e.Thread))return new e.Thread(t);this._private={requires:[],files:[],queue:null,pass:[]},t&&this.run(t)},e.thread=e.Thread,e.thdfn=e.Thread.prototype,e.fn.thread=function(t,i){for(var r in t){var n=t[r];e.Thread.prototype[r]=n}};var i=function(t){return e.is.fn(t)?t.toString():'JSON.parse("'+JSON.stringify(t)+'")'},r=function(t){var a,o;e.is.object(t)&&t.fn?(a=n(t.fn,t.name),o=t.name,t=t.fn):e.is.fn(t)?(a=t.toString(),o=t.name):e.is.string(t)?a=t:e.is.object(t)&&(a=t.proto?"":t.name+" = {};",o=t.name,t=t.obj),a+="\n";var s=function(e,t){if(e.prototype){var i=!1;for(var n in e.prototype){i=!0;break}i&&(a+=r({name:t,obj:e,proto:!0},e))}};if(t.prototype&&null!=o)for(var l in t.prototype){var u="",c=t.prototype[l],d=i(c);(u+=(p=o+".prototype."+l)+" = "+d+";\n")&&(a+=u),s(c,p)}if(!e.is.string(t))for(var l in t){var h="";if(t.hasOwnProperty(l)){var p;c=t[l],d=i(c);h+=(p=o+'["'+l+'"]')+" = "+d+";\n"}h&&(a+=h),s(c,p)}return a};e.fn.thread({require:function(t,i){return r=t,e.is.string(r)&&r.match(/\.js$/)?(this._private.files.push(t),this):(i&&(t=e.is.fn(t)?{name:i=i||t.name,fn:t}:{name:i,obj:t}),this._private.requires.push(t),this);var r},pass:function(e){return this._private.pass.push(e),this},run:function(i,n){var a=this,o=this._private;if(n=n||o.pass.shift(),!o.stopped){if(o.running)return o.queue=o.queue.then(function(){return a.run(i,n)});var s=null!=t,l="undefined"!=typeof module;a.trigger("run");var u=new e.Promise(function(u,c){o.running=!0;var d=o.ran,h=e.is.string(i)?i:i.toString(),p="\n"+o.requires.map(function(e){return r(e)}).concat(o.files.map(function(e){if(s){return'importScripts("'+((i=e).match(/^\.\//)||i.match(/^\.\./)?t.location.origin+t.location.pathname+i:i.match(/^\//)?t.location.origin+"/"+i:i)+'");'}if(l)return'eval( require("fs").readFileSync("'+e+'", { encoding: "utf8" }) );';var i})).concat(["( function(){","var ret = ("+h+")("+JSON.stringify(n)+");","if( ret !== undefined ){ resolve(ret); }","} )()\n"]).join("\n");if(o.requires=[],o.files=[],s){var f,g;if(!d){var v=p+"";p=["function broadcast(m){ return message(m); };","function message(m){ postMessage(m); };","function listen(fn){",' self.addEventListener("message", function(m){ ',' if( typeof m === "object" && (m.data.$$eval || m.data === "$$start") ){'," } else { "," fn( m.data );"," }"," });","};",'self.addEventListener("message", function(m){ if( m.data.$$eval ){ eval( m.data.$$eval ); } });',"function resolve(v){ postMessage({ $$resolve: v }); };","function reject(v){ postMessage({ $$reject: v }); };"].join("\n"),p+=v,f=new Blob([p],{type:"application/javascript"}),g=t.URL.createObjectURL(f)}var y=o.webworker=o.webworker||new Worker(g);d&&y.postMessage({$$eval:p}),y.addEventListener("message",m=function(t){var i=e.is.object(t)&&e.is.object(t.data);i&&"$$resolve"in t.data?(y.removeEventListener("message",m),u(t.data.$$resolve)):i&&"$$reject"in t.data?(y.removeEventListener("message",m),c(t.data.$$reject)):a.trigger(new e.Event(t,{type:"message",message:t.data}))},!1),d||y.postMessage("$$start")}else if(l){var m,x=require("path"),b=require("child_process"),w=o.child=o.child||b.fork(x.join(__dirname,"thread-node-fork"));w.on("message",m=function(t){e.is.object(t)&&"$$resolve"in t?(w.removeListener("message",m),u(t.$$resolve)):e.is.object(t)&&"$$reject"in t?(w.removeListener("message",m),c(t.$$reject)):a.trigger(new e.Event({},{type:"message",message:t}))}),w.send({$$eval:p})}else e.error("Tried to create thread but no underlying tech found!")}).then(function(e){return o.running=!1,o.ran=!0,a.trigger("ran"),e});return null==o.queue&&(o.queue=u),u}e.util.error("Attempted to run a stopped thread! Start a new thread or do not stop the existing thread and reuse it.")},message:function(e){var t=this._private;return t.webworker&&t.webworker.postMessage(e),t.child&&t.child.send(e),this},stop:function(){var e=this._private;return e.webworker&&e.webworker.terminate(),e.child&&e.child.kill(),e.stopped=!0,this.trigger("stop")},stopped:function(){return this._private.stopped}});var n=function(e,t){var i=e.toString();return i=i.replace(/function.*\(/,"function "+t+"(")},a=function(e){return e=e||{},function(t,i){var r=n(t,"_$_$_"+e.name);return this.require(r),this.run(["function( data ){"," var origResolve = resolve;"," var res = [];"," "," resolve = function( val ){"," res.push( val );"," };"," "," var ret = data."+e.name+"( _$_$_"+e.name+(arguments.length>1?", "+JSON.stringify(i):"")+" );"," "," resolve = origResolve;"," resolve( res.length > 0 ? res : ret );","}"].join("\n"))}};e.fn.thread({reduce:a({name:"reduce"}),reduceRight:a({name:"reduceRight"}),map:a({name:"map"})});var o=e.thdfn;o.promise=o.run,o.terminate=o.halt=o.stop,o.include=o.require,e.worker=e.Worker=e.Thread,e.fn.thread({on:e.define.on(),one:e.define.on({unbindSelfOnTrigger:!0}),off:e.define.off(),trigger:e.define.trigger()}),e.define.eventAliasesOn(e.thdfn)}(cytoscape,"undefined"==typeof window?null:window),function(e,t){"use strict";e.Fabric=function(t){if(!(this instanceof e.Fabric))return new e.Fabric(t);this._private={pass:[]};e.is.number(t),t="undefined"!=typeof navigator&&null!=navigator.hardwareConcurrency?navigator.hardwareConcurrency:"undefined"!=typeof module?require("os").cpus().length:4;for(var i=0;i<t;i++)this[i]=e.Thread();this.length=t},e.fabric=e.Fabric,e.fabfn=e.Fabric.prototype,e.fn.fabric=function(t,i){for(var r in t){var n=t[r];e.Fabric.prototype[r]=n}},e.fn.fabric({require:function(e,t){for(var i=0;i<this.length;i++){this[i].require(e,t)}return this},random:function(){return this[Math.round((this.length-1)*Math.random())]},run:function(e){var t=this._private.pass.shift();return this.random().pass(t).run(e)},message:function(e){return this.random().message(e)},broadcast:function(e){for(var t=0;t<this.length;t++){this[t].message(e)}return this},stop:function(){for(var e=0;e<this.length;e++){this[e].stop()}return this},pass:function(t){var i=this._private.pass;return e.is.array(t)?i.push(t):e.util.error("Only arrays or collections may be used with fabric.pass()"),this},spreadSize:function(){var e=Math.ceil(this._private.pass[0].length/this.length);return e=Math.max(1,e)},spread:function(t){for(var i=this._private,r=this.spreadSize(),n=i.pass.shift().concat([]),a=[],o=0;o<this.length;o++){var s=this[o],l=n.splice(0,r),u=s.pass(l).run(t);if(a.push(u),0===n.length)break}return e.Promise.all(a).then(function(e){for(var t=[],i=0,r=0;r<e.length;r++)for(var n=e[r],a=0;a<n.length;a++){var o=n[a];t[i++]=o}return t})},map:function(e){return this.require(e,"_$_$_fabmap"),this.spread(function(e){var t=[],i=resolve;resolve=function(e){t.push(e)};for(var r=0;r<e.length;r++){var n=t.length,a=_$_$_fabmap(e[r]);n===t.length&&t.push(a)}return resolve=i,t})},filter:function(e){var t=this._private.pass[0];return this.map(e).then(function(e){for(var i=[],r=0;r<t.length;r++){var n=t[r];e[r]&&i.push(n)}return i})},sort:function(e){var t=this._private.pass[0].length,i=this.spreadSize();return e=e||function(e,t){return e<t?-1:e>t?1:0},this.require(e,"_$_$_cmp"),this.spread(function(e){var t=e.sort(_$_$_cmp);resolve(t)}).then(function(r){for(var n=function(i,n,a){n=Math.min(n,t),a=Math.min(a,t);for(var o=i,s=n,l=[],u=o;u<a;u++){var c=r[i],d=r[n];i<s&&(n>=a||e(c,d)<=0)?(l.push(c),i++):(l.push(d),n++)}for(u=0;u<l.length;u++){r[o+u]=l[u]}},a=i;a<t;a*=2)for(var o=0;o<t;o+=2*a)n(o,o+a,o+2*a);return r})}});var i=function(e){return e=e||{},function(t,i){var r=this._private.pass.shift();return this.random().pass(r)[e.threadFn](t,i)}};e.fn.fabric({randomMap:i({threadFn:"map"}),reduce:i({threadFn:"reduce"}),reduceRight:i({threadFn:"reduceRight"})});var r=e.fabfn;r.promise=r.run,r.terminate=r.halt=r.stop,r.include=r.require,e.fn.fabric({on:e.define.on(),one:e.define.on({unbindSelfOnTrigger:!0}),off:e.define.off(),trigger:e.define.trigger()}),e.define.eventAliasesOn(e.fabfn)}(cytoscape,"undefined"==typeof window||window),function(e,t){"use strict";var i={},r=e.util.copy(i);e.defaults=function(t){i=e.util.extend({},r,t)},e.fn.core=function(t,i){for(var r in t){var n=t[r];e.Core.prototype[r]=n}},e.Core=function(r){if(!(this instanceof e.Core))return new e.Core(r);var n=this,a=(r=e.util.extend({},i,r)).container,o=a?a._cyreg:null;if((o=o||{})&&o.cy){if(a)for(;a.firstChild;)a.removeChild(a.firstChild);o.cy.notify({type:"destroy"}),o={}}var s=o.readies=o.readies||[];a&&(a._cyreg=o),o.cy=n;var l=void 0!==t&&void 0!==a&&!r.headless,u=r;u.layout=e.util.extend({name:l?"grid":"null"},u.layout),u.renderer=e.util.extend({name:l?"canvas":"null"},u.renderer);var c=function(e,t,i){return void 0!==t?t:void 0!==i?i:e},d=this._private={container:u.container,ready:!1,initrender:!1,options:u,elements:[],id2index:{},listeners:[],onRenders:[],aniEles:e.Collection(this),scratch:{},layout:null,renderer:null,notificationsEnabled:!0,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:c(!0,u.zoomingEnabled),userZoomingEnabled:c(!0,u.userZoomingEnabled),panningEnabled:c(!0,u.panningEnabled),userPanningEnabled:c(!0,u.userPanningEnabled),boxSelectionEnabled:c(!1,u.boxSelectionEnabled),autolock:c(!1,u.autolock,u.autolockNodes),autoungrabify:c(!1,u.autoungrabify,u.autoungrabifyNodes),autounselectify:c(!1,u.autounselectify),styleEnabled:void 0===u.styleEnabled?l:u.styleEnabled,zoom:e.is.number(u.zoom)?u.zoom:1,pan:{x:e.is.plainObject(u.pan)&&e.is.number(u.pan.x)?u.pan.x:0,y:e.is.plainObject(u.pan)&&e.is.number(u.pan.y)?u.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1,deferredExecQueue:[]},h=u.selectionType;d.selectionType=void 0===h||"additive"!==h&&"single"!==h?"single":h,e.is.number(u.minZoom)&&e.is.number(u.maxZoom)&&u.minZoom<u.maxZoom?(d.minZoom=u.minZoom,d.maxZoom=u.maxZoom):e.is.number(u.minZoom)&&void 0===u.maxZoom?d.minZoom=u.minZoom:e.is.number(u.maxZoom)&&void 0===u.minZoom&&(d.maxZoom=u.maxZoom);var p=[u.style,u.elements];!function(t){for(var i=!1,r=0;r<p.length;r++){var n=p[r];if(e.is.promise(n)){i=!0;break}}if(i)return e.Promise.all(p).then(t);t(p)}(function(t){var i=t[0],r=t[1];d.styleEnabled&&n.setStyle(i),n.initRenderer(e.util.extend({hideEdgesOnViewport:u.hideEdgesOnViewport,hideLabelsOnViewport:u.hideLabelsOnViewport,textureOnViewport:u.textureOnViewport,wheelSensitivity:e.is.number(u.wheelSensitivity)&&u.wheelSensitivity>0?u.wheelSensitivity:1,motionBlur:void 0===u.motionBlur||u.motionBlur,motionBlurOpacity:void 0===u.motionBlurOpacity?.05:u.motionBlurOpacity,pixelRatio:e.is.number(u.pixelRatio)&&u.pixelRatio>0?u.pixelRatio:"auto"===u.pixelRatio?void 0:1,desktopTapThreshold:void 0===u.desktopTapThreshold?4:u.desktopTapThreshold,touchTapThreshold:void 0===u.touchTapThreshold?8:u.touchTapThreshold},u.renderer)),u.initrender&&(n.on("initrender",u.initrender),n.on("initrender",function(){n._private.initrender=!0})),n.load(r,function(){n.startAnimationLoop(),n._private.ready=!0,e.is.fn(u.ready)&&n.on("ready",u.ready);for(var t=0;t<s.length;t++){var i=s[t];n.on("ready",i)}o&&(o.readies=[]),n.trigger("ready")},u.done)})},e.corefn=e.Core.prototype,e.fn.core({isReady:function(){return this._private.ready},ready:function(e){this.isReady()?this.trigger("ready",[],e):this.on("ready",e)},initrender:function(){return this._private.initrender},destroy:function(){this.notify({type:"destroy"});var e=this.container(),t=e.parentNode;if(t)try{t.removeChild(e)}catch(e){}return this},getElementById:function(t){var i=this._private.id2index[t];return void 0!==i?this._private.elements[i]:new e.Collection(this)},selectionType:function(){return this._private.selectionType},hasCompoundNodes:function(){return this._private.hasCompoundNodes},styleEnabled:function(){return this._private.styleEnabled},addToPool:function(e){for(var t=this._private.elements,i=this._private.id2index,r=0;r<e.length;r++){var n=e[r],a=n._private.data.id,o=i[a];void 0!==o||(o=t.length,t.push(n),i[a]=o,n._private.index=o)}return this},removeFromPool:function(e){for(var t=this._private.elements,i=this._private.id2index,r=0;r<e.length;r++){var n=e[r]._private.data.id,a=i[n];if(void 0!==a){this._private.id2index[n]=void 0,t.splice(a,1);for(var o=a;o<t.length;o++){i[t[o]._private.data.id]--,t[o]._private.index--}}}},container:function(){return this._private.container},options:function(){return e.util.copy(this._private.options)},json:function(e){var t={},i=this;return t.elements={},i.elements().each(function(e,i){var r=i.group();t.elements[r]||(t.elements[r]=[]),t.elements[r].push(i.json())}),this._private.styleEnabled&&(t.style=i.style().json()),t.zoomingEnabled=i._private.zoomingEnabled,t.userZoomingEnabled=i._private.userZoomingEnabled,t.zoom=i._private.zoom,t.minZoom=i._private.minZoom,t.maxZoom=i._private.maxZoom,t.panningEnabled=i._private.panningEnabled,t.userPanningEnabled=i._private.userPanningEnabled,t.pan=i._private.pan,t.boxSelectionEnabled=i._private.boxSelectionEnabled,t.layout=i._private.options.layout,t.renderer=i._private.options.renderer,t.hideEdgesOnViewport=i._private.options.hideEdgesOnViewport,t.hideLabelsOnViewport=i._private.options.hideLabelsOnViewport,t.textureOnViewport=i._private.options.textureOnViewport,t.wheelSensitivity=i._private.options.wheelSensitivity,t.motionBlur=i._private.options.motionBlur,t},defer:function(e){var t=this._private,i=t.deferredExecQueue;i.push(e),t.deferredTimeout||(t.deferredTimeout=setTimeout(function(){for(;i.length>0;)i.shift()();t.deferredTimeout=null},0))}})}(cytoscape,"undefined"==typeof window?null:window),function(e,t){"use strict";function i(e){var t=!document||"interactive"!==document.readyState&&"complete"!==document.readyState?i:e;setTimeout(t,9,e)}e.fn.core({add:function(t){var i,r=this;if(e.is.elementOrCollection(t)){var n=t;if(n._private.cy===r)i=n.restore();else{for(var a=[],o=0;o<n.length;o++){var s=n[o];a.push(s.json())}i=new e.Collection(r,a)}}else if(e.is.array(t)){a=t;i=new e.Collection(r,a)}else if(e.is.plainObject(t)&&(e.is.array(t.nodes)||e.is.array(t.edges))){for(var l=t,u=(a=[],["nodes","edges"]),c=(o=0,u.length);o<c;o++){var d=u[o],h=l[d];if(e.is.array(h))for(var p=0,f=h.length;p<f;p++){(g=h[p]).group=d,a.push(g)}}i=new e.Collection(r,a)}else{var g=t;i=new e.Element(r,g).collection()}return i},remove:function(t){if(e.is.elementOrCollection(t))t=t;else if(e.is.string(t)){var i=t;t=this.$(i)}return t.remove()},load:function(r,n,a){var o=this;o.notifications(!1);var s=o.elements();function l(){o.one("layoutready",function(e){o.notifications(!0),o.trigger(e),o.notify({type:"load",collection:o.elements()}),o.one("load",n),o.trigger("load")}).one("layoutstop",function(){o.one("done",a),o.trigger("done")});var t=e.util.extend({},o._private.options.layout);t.eles=o.$(),o.layout(t)}return s.length>0&&s.remove(),null!=r&&(e.is.plainObject(r)||e.is.array(r))&&o.add(r),t?i(l):l(),this}})}(cytoscape,"undefined"==typeof window?null:window),function(e,t){"use strict";e.fn.core({animated:e.define.animated(),clearQueue:e.define.clearQueue(),delay:e.define.delay(),animate:e.define.animate(),stop:e.define.stop(),addToAnimationPool:function(e){this.styleEnabled()&&this._private.aniEles.merge(e)},startAnimationLoop:function(){var i=this;function r(t,r){var n=e.is.core(t),a=!n,o=t,s=i._private.style;if(a)var l=o._private.position,u={x:l.x,y:l.y},c=s.getValueStyle(o);if(n)var d=i._private.pan,h={x:d.x,y:d.y},p=i._private.zoom;r.started=!0,r.startTime=Date.now(),r.startPosition=u,r.startStyle=c,r.startPan=h,r.startZoom=p}function n(t,r,n,s){var l,u=i._private.style,c=r.properties,d=r.params,h=r.startTime,p=!s;if((l=0===r.duration?1:Math.min(1,(n-h)/r.duration))<0?l=0:l>1&&(l=1),null==c.delay){var f=r.startPosition,g=c.position,v=t._private.position;g&&p&&(a(f.x,g.x)&&(v.x=o(f.x,g.x,l)),a(f.y,g.y)&&(v.y=o(f.y,g.y,l)));var y=r.startPan,m=c.pan,x=t._private.pan,b=null!=m&&s;b&&(a(y.x,m.x)&&(x.x=o(y.x,m.x,l)),a(y.y,m.y)&&(x.y=o(y.y,m.y,l)),t.trigger("pan"));var w=r.startZoom,_=c.zoom,E=null!=_&&s;E&&(a(w,_)&&(t._private.zoom=o(w,_,l)),t.trigger("zoom")),(b||E)&&t.trigger("viewport");var S=c.style||c.css;if(S&&p)for(var D=0;D<S.length;D++){var k=S[D].name,P=S[D],T=o(r.startStyle[k],P,l);u.overrideBypass(t,k,T)}}return e.is.fn(d.step)&&d.step.apply(t,[n]),l>=1&&(r.done=!0),l}function a(t,i){return null!=t&&null!=i&&(!(!e.is.number(t)||!e.is.number(i))||!(!t||!i))}function o(t,i,r){var n,a;if(r<0?r=0:r>1&&(r=1),n=null!=t.pxValue||null!=t.value?null!=t.pxValue?t.pxValue:t.value:t,a=null!=i.pxValue||null!=i.value?null!=i.pxValue?i.pxValue:i.value:i,e.is.number(n)&&e.is.number(a))return n+(a-n)*r;if(e.is.number(n[0])&&e.is.number(a[0])){var o=n,s=a,l=function(e,t){var i=t-e,n=e;return Math.round(r*i+n)};return[l(o[0],s[0]),l(o[1],s[1]),l(o[2],s[2])]}}i.styleEnabled()&&t&&function t(){e.util.requestAnimationFrame(function(a){!function(t){t=+new Date;var a=i._private.aniEles,o=[],s=!1;function l(i,a){var l=i._private.animation.current,u=i._private.animation.queue,c=!1;if(0===l.length){var d=u.length>0?u.shift():null;d&&(d.callTime=t,l.push(d))}for(var h=[],p=l.length-1;p>=0;p--){var f=l[p];f.started||(r(i,f),s=!0),n(i,f,t,a),f.done&&(h.push(f),l.splice(p,1)),c=!0}for(var p=0;p<h.length;p++){var f=h[p],g=f.params.complete;e.is.fn(g)&&g.apply(i,[t])}return a||0!==l.length||0!==u.length||o.push(i),c}for(var u=0;u<a.length;u++){var c=a[u];l(c)}var d=l(i,!0);if(a.length>0||d){var h;if(a.length>0){var p=a.updateCompoundBounds();h=p.length>0?a.add(p):a}i.notify({type:s?"style":"draw",collection:h})}a.unmerge(o)}(a),t()})}()}})}(cytoscape,"undefined"==typeof window?null:window),function(e){"use strict";e.fn.core({data:e.define.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0}),removeData:e.define.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0}),scratch:e.define.data({field:"scratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeScratch:e.define.removeData({field:"scratch",triggerEvent:!1})})}(cytoscape),function(e){"use strict";e.fn.core({on:e.define.on(),one:e.define.on({unbindSelfOnTrigger:!0}),once:e.define.on({unbindAllBindersOnTrigger:!0}),off:e.define.off(),trigger:e.define.trigger()}),e.define.eventAliasesOn(e.corefn)}(cytoscape),function(e){"use strict";e.fn.core({png:function(e){var t=this._private.renderer;return e=e||{},t.png(e)},jpg:function(e){var t=this._private.renderer;return(e=e||{}).bg=e.bg||"#fff",t.jpg(e)}}),e.corefn.jpeg=e.corefn.jpg}(cytoscape),function(e){"use strict";e.fn.core({layout:function(t){return null==t&&((t=e.util.extend({},this._private.options.layout)).eles=this.$()),this.initLayout(t).run(),this},makeLayout:function(e){return this.initLayout(e)},initLayout:function(t){if(null!=t)if(null!=t.name){var i=t.name,r=e.extension("layout",i);if(null!=r){t.eles=null!=t.eles?t.eles:this.$(),e.is.string(t.eles)&&(t.eles=this.$(t.eles));var n=new r(e.util.extend({},t,{cy:this}));return e.is.plainObject(n._private)||(n._private={}),n._private.cy=this,n._private.listeners=[],n}e.util.error("Can not apply layout: No such layout `"+i+"` found; did you include its JS file?")}else e.util.error("A `name` must be specified to make a layout");else e.util.error("Layout options must be specified to make a layout")}}),e.corefn.createLayout=e.corefn.makeLayout}(cytoscape),function(e){"use strict";e.fn.core({notify:function(e){if(this._private.batchingNotify){var t=this._private.batchNotifyEles,i=this._private.batchNotifyTypes;if(e.collection)for(var r=0;r<e.collection.length;r++){var n=e.collection[r];t.ids[n._private.id]||t.push(n)}i.ids[e.type]||i.push(e.type)}else{if(this._private.notificationsEnabled)this.renderer().notify(e)}},notifications:function(e){var t=this._private;if(void 0===e)return t.notificationsEnabled;t.notificationsEnabled=!!e},noNotifications:function(e){this.notifications(!1),e(),this.notifications(!0)},startBatch:function(){var e=this._private;return e.batchingStyle=e.batchingNotify=!0,e.batchStyleEles=[],e.batchNotifyEles=[],e.batchNotifyTypes=[],e.batchStyleEles.ids={},e.batchNotifyEles.ids={},e.batchNotifyTypes.ids={},this},endBatch:function(){var t=this._private;return t.batchingStyle=!1,new e.Collection(this,t.batchStyleEles).updateStyle(),t.batchingNotify=!1,this.notify({type:t.batchNotifyTypes,collection:t.batchNotifyEles}),this},batch:function(e){return this.startBatch(),e(),this.endBatch(),this},batchData:function(e){var t=this;return this.batch(function(){for(var i in e){var r=e[i];t.getElementById(i).data(r)}})}})}(cytoscape),function(e){"use strict";e.fn.core({renderTo:function(e,t,i,r){return this._private.renderer.renderTo(e,t,i,r),this},renderer:function(){return this._private.renderer},forceRender:function(){return this.notify({type:"draw"}),this},resize:function(){return this.notify({type:"resize"}),this.trigger("resize"),this},initRenderer:function(t){var i=e.extension("renderer",t.name);null!=i?this._private.renderer=new i(e.util.extend({},t,{cy:this,style:this._private.style})):e.util.error("Can not initialise: No such renderer `%s` found; did you include its JS file?",t.name)},triggerOnRender:function(){for(var e=this._private.onRenders,t=0;t<e.length;t++){(0,e[t])()}return this},onRender:function(e){return this._private.onRenders.push(e),this},offRender:function(e){var t=this._private.onRenders;if(null==e)return this._private.onRenders=[],this;for(var i=0;i<t.length;i++){if(e===t[i]){t.splice(i,1);break}}return this}})}(cytoscape),function(e){"use strict";e.fn.core({collection:function(t){return e.is.string(t)?this.$(t):e.is.elementOrCollection(t)?t.collection():e.is.array(t)?new e.Collection(this,t):new e.Collection(this)},nodes:function(e){var t=this.$(function(){return this.isNode()});return e?t.filter(e):t},edges:function(e){var t=this.$(function(){return this.isEdge()});return e?t.filter(e):t},$:function(t){var i=new e.Collection(this,this._private.elements);return t?i.filter(t):i}}),e.corefn.elements=e.corefn.filter=e.corefn.$}(cytoscape),function(e){"use strict";e.fn.core({style:function(e){e&&this.setStyle(e).update();return this._private.style},setStyle:function(t){var i=this._private;return e.is.stylesheet(t)?i.style=t.generateStyle(this):e.is.array(t)?i.style=e.style.fromJson(this,t):e.is.string(t)?i.style=e.style.fromString(this,t):i.style=new e.Style(this),i.style}})}(cytoscape),function(e){"use strict";e.fn.core({autolock:function(e){return void 0===e?this._private.autolock:(this._private.autolock=!!e,this)},autoungrabify:function(e){return void 0===e?this._private.autoungrabify:(this._private.autoungrabify=!!e,this)},autounselectify:function(e){return void 0===e?this._private.autounselectify:(this._private.autounselectify=!!e,this)},panningEnabled:function(e){return void 0===e?this._private.panningEnabled:(this._private.panningEnabled=!!e,this)},userPanningEnabled:function(e){return void 0===e?this._private.userPanningEnabled:(this._private.userPanningEnabled=!!e,this)},zoomingEnabled:function(e){return void 0===e?this._private.zoomingEnabled:(this._private.zoomingEnabled=!!e,this)},userZoomingEnabled:function(e){return void 0===e?this._private.userZoomingEnabled:(this._private.userZoomingEnabled=!!e,this)},boxSelectionEnabled:function(e){return void 0===e?this._private.boxSelectionEnabled:(this._private.boxSelectionEnabled=!!e,this)},pan:function(){var t,i,r,n,a,o=arguments,s=this._private.pan;switch(o.length){case 0:return s;case 1:if(e.is.string(o[0]))return s[t=o[0]];if(e.is.plainObject(o[0])){if(!this._private.panningEnabled)return this;n=(r=o[0]).x,a=r.y,e.is.number(n)&&(s.x=n),e.is.number(a)&&(s.y=a),this.trigger("pan viewport")}break;case 2:if(!this._private.panningEnabled)return this;t=o[0],i=o[1],"x"!==t&&"y"!==t||!e.is.number(i)||(s[t]=i),this.trigger("pan viewport")}return this.notify({type:"viewport"}),this},panBy:function(t){var i,r,n,a,o,s=arguments,l=this._private.pan;if(!this._private.panningEnabled)return this;switch(s.length){case 1:e.is.plainObject(s[0])&&(a=(n=s[0]).x,o=n.y,e.is.number(a)&&(l.x+=a),e.is.number(o)&&(l.y+=o),this.trigger("pan viewport"));break;case 2:i=s[0],r=s[1],"x"!==i&&"y"!==i||!e.is.number(r)||(l[i]+=r),this.trigger("pan viewport")}return this.notify({type:"viewport"}),this},fit:function(e,t){var i=this.getFitViewport(e,t);if(i){var r=this._private;r.zoom=i.zoom,r.pan=i.pan,this.trigger("pan zoom viewport"),this.notify({type:"viewport"})}return this},getFitViewport:function(t,i){if(e.is.number(t)&&void 0===i&&(i=t,t=void 0),this._private.panningEnabled&&this._private.zoomingEnabled){var r;if(e.is.string(t)){var n=t;t=this.$(n)}else if(e.is.boundingBox(t)){var a=t;(r={x1:a.x1,y1:a.y1,x2:a.x2,y2:a.y2}).w=r.x2-r.x1,r.h=r.y2-r.y1}else e.is.elementOrCollection(t)||(t=this.elements());r=r||t.boundingBox();var o,s=this.width(),l=this.height();if(i=e.is.number(i)?i:0,!isNaN(s)&&!isNaN(l)&&s>0&&l>0&&!isNaN(r.w)&&!isNaN(r.h)&&r.w>0&&r.h>0)return{zoom:o=(o=(o=Math.min((s-2*i)/r.w,(l-2*i)/r.h))>this._private.maxZoom?this._private.maxZoom:o)<this._private.minZoom?this._private.minZoom:o,pan:{x:(s-o*(r.x1+r.x2))/2,y:(l-o*(r.y1+r.y2))/2}}}},minZoom:function(t){return void 0===t?this._private.minZoom:(e.is.number(t)&&(this._private.minZoom=t),this)},maxZoom:function(t){return void 0===t?this._private.maxZoom:(e.is.number(t)&&(this._private.maxZoom=t),this)},zoom:function(t){var i,r;if(void 0===t)return this._private.zoom;if(e.is.number(t))r=t;else if(e.is.plainObject(t)){if(r=t.level,t.position){var n=t.position,a=this._private.pan,o=this._private.zoom;i={x:n.x*o+a.x,y:n.y*o+a.y}}else t.renderedPosition&&(i=t.renderedPosition);if(i&&!this._private.panningEnabled)return this}if(!this._private.zoomingEnabled)return this;if(!e.is.number(r)||i&&(!e.is.number(i.x)||!e.is.number(i.y)))return this;if(r=(r=r>this._private.maxZoom?this._private.maxZoom:r)<this._private.minZoom?this._private.minZoom:r,i){var s=this._private.pan,l=this._private.zoom,u=r,c={x:-u/l*(i.x-s.x)+i.x,y:-u/l*(i.y-s.y)+i.y};this._private.zoom=r,this._private.pan=c;var d=s.x!==c.x||s.y!==c.y;this.trigger(" zoom "+(d?" pan ":"")+" viewport ")}else this._private.zoom=r,this.trigger("zoom viewport");return this.notify({type:"viewport"}),this},viewport:function(t){var i=this._private,r=!0,n=!0,a=[],o=!1,s=!1;if(!t)return this;if(e.is.number(t.zoom)||(r=!1),e.is.plainObject(t.pan)||(n=!1),!r&&!n)return this;if(r){var l=t.zoom;l<i.minZoom||l>i.maxZoom||!i.zoomingEnabled?o=!0:(i.zoom=l,a.push("zoom"))}if(n&&(!o||!t.cancelOnFailedZoom)&&i.panningEnabled){var u=t.pan;e.is.number(u.x)&&(i.pan.x=u.x,s=!1),e.is.number(u.y)&&(i.pan.y=u.y,s=!1),s||a.push("pan")}return a.length>0&&(a.push("viewport"),this.trigger(a.join(" ")),this.notify({type:"viewport"})),this},center:function(e){var t=this.getCenterPan(e);return t&&(this._private.pan=t,this.trigger("pan viewport"),this.notify({type:"viewport"})),this},getCenterPan:function(t,i){if(this._private.panningEnabled){if(e.is.string(t)){var r=t;t=this.elements(r)}else e.is.elementOrCollection(t)||(t=this.elements());var n=t.boundingBox(),a=this.width(),o=this.height();return{x:(a-(i=void 0===i?this._private.zoom:i)*(n.x1+n.x2))/2,y:(o-i*(n.y1+n.y2))/2}}},reset:function(){return this._private.panningEnabled&&this._private.zoomingEnabled?(this.viewport({pan:{x:0,y:0},zoom:1}),this):this},width:function(){var e=this._private.container;return e?e.clientWidth:1},height:function(){var e=this._private.container;return e?e.clientHeight:1},extent:function(){var e=this._private.pan,t=this._private.zoom,i=this.renderedExtent(),r={x1:(i.x1-e.x)/t,x2:(i.x2-e.x)/t,y1:(i.y1-e.y)/t,y2:(i.y2-e.y)/t};return r.w=r.x2-r.x1,r.h=r.y2-r.y1,r},renderedExtent:function(){var e=this.width(),t=this.height();return{x1:0,y1:0,x2:e,y2:t,w:e,h:t}}}),e.corefn.centre=e.corefn.center,e.corefn.autolockNodes=e.corefn.autolock,e.corefn.autoungrabifyNodes=e.corefn.autoungrabify}(cytoscape),function(e){"use strict";e.fn.collection=e.fn.eles=function(t,i){for(var r in t){var n=t[r];e.Collection.prototype[r]=n}};var t={prefix:{nodes:"n",edges:"e"},id:{nodes:0,edges:0},generate:function(t,i,r){var n=(e.is.element(i)?i._private:i).group,a=null!=r?r:this.prefix[n]+this.id[n];if(t.getElementById(a).empty())this.id[n]++;else for(;!t.getElementById(a).empty();)a=this.prefix[n]+ ++this.id[n];return a}};e.Element=function(t,i,r){if(!(this instanceof e.Element))return new e.Element(t,i,r);if(r=!(void 0!==r&&!r),void 0!==t&&void 0!==i&&e.is.core(t))if("nodes"===i.group||"edges"===i.group){if(this.length=1,this[0]=this,this._private={cy:t,single:!0,data:i.data||{},position:i.position||{},autoWidth:void 0,autoHeight:void 0,listeners:[],group:i.group,style:{},rstyle:{},styleCxts:[],removed:!0,selected:!!i.selected,selectable:void 0===i.selectable||!!i.selectable,locked:!!i.locked,grabbed:!1,grabbable:void 0===i.grabbable||!!i.grabbable,active:!1,classes:{},animation:{current:[],queue:[]},rscratch:{},scratch:i.scratch||{},edges:[],children:[]},i.renderedPosition){var n=i.renderedPosition,a=t.pan(),o=t.zoom();this._private.position={x:(n.x-a.x)/o,y:(n.y-a.y)/o}}if(e.is.string(i.classes))for(var s=i.classes.split(/\s+/),l=0,u=s.length;l<u;l++){var c=s[l];c&&""!==c&&(this._private.classes[c]=!0)}i.css&&t.style().applyBypass(this,i.css),(void 0===r||r)&&this.restore()}else e.util.error("An element must be of type `nodes` or `edges`; you specified `"+i.group+"`");else e.util.error("An element must have a core reference and parameters set")},e.Collection=function(i,r,n){if(!(this instanceof e.Collection))return new e.Collection(i,r);if(void 0!==i&&e.is.core(i)){var a={},o={},s=!1;if(r){if(r.length>0&&e.is.plainObject(r[0])&&!e.is.element(r[0])){s=!0;for(var l=[],u={},c=0,d=r.length;c<d;c++){var h=r[c];null==h.data&&(h.data={});var p=h.data;if(null==p.id)p.id=t.generate(i,h);else if(0!==i.getElementById(p.id).length||u[p.id])continue;var f=new e.Element(i,h,!1);l.push(f),u[p.id]=!0}r=l}}else r=[];this.length=0;for(c=0,d=r.length;c<d;c++){var g=r[c];if(g){var v=g._private.data.id;(!n||n.unique&&!a[v])&&(a[v]=g,o[v]=this.length,this[this.length]=g,this.length++)}}this._private={cy:i,ids:a,indexes:o},s&&this.restore()}else e.util.error("A collection must have a reference to the core")},e.elefn=e.elesfn=e.Element.prototype=e.Collection.prototype,e.elesfn.cy=function(){return this._private.cy},e.elesfn.element=function(){return this[0]},e.elesfn.collection=function(){return e.is.collection(this)?this:new e.Collection(this._private.cy,[this])},e.elesfn.unique=function(){return new e.Collection(this._private.cy,this,{unique:!0})},e.elesfn.getElementById=function(t){var i=this._private.cy,r=this._private.ids[t];return r||e.Collection(i)},e.elesfn.json=function(){var t=this.element();if(null!=t){var i=t._private,r=e.util.copy({data:i.data,position:i.position,group:i.group,bypass:i.bypass,removed:i.removed,selected:i.selected,selectable:i.selectable,locked:i.locked,grabbed:i.grabbed,grabbable:i.grabbable,classes:""}),n=[];for(var a in i.classes)i.classes[a]&&n.push(a);for(var o=0;o<n.length;o++){a=n[o];r.classes+=a+(o<n.length-1?" ":"")}return r}},e.elesfn.jsons=function(){for(var e=[],t=0;t<this.length;t++){var i=this[t].json();e.push(i)}return e},e.elesfn.clone=function(){for(var t=this.cy(),i=[],r=0;r<this.length;r++){var n=this[r].json(),a=new e.Element(t,n,!1);i.push(a)}return new e.Collection(t,i)},e.elesfn.copy=e.elesfn.clone,e.elesfn.restore=function(i){var r=[],n=this.cy();void 0===i&&(i=!0);for(var a,o=[],s=[],l=0,u=0,c=this.length;u<c;u++){(d=this[u]).isNode()?(o.push(d),l++):(s.push(d),0)}for(u=0,c=(a=o.concat(s)).length;u<c;u++){var d;if((d=a[u]).removed()){var h=d._private;if(void 0===(S=h.data).id)S.id=t.generate(n,d);else{if(e.is.emptyString(S.id)||!e.is.string(S.id)){e.util.error("Can not create element with invalid string ID `"+S.id+"`");continue}if(0!==n.getElementById(S.id).length){e.util.error("Can not create second element with ID `"+S.id+"`");continue}}var p=S.id;if(d.isEdge()){for(var f=d,g=["source","target"],v=g.length,y=!1,m=0;m<v;m++){var x=g[m],b=S[x];null==b||""===b?(e.util.error("Can not create edge `"+p+"` with unspecified "+x),y=!0):n.getElementById(b).empty()&&(e.util.error("Can not create edge `"+p+"` with nonexistant "+x+" `"+b+"`"),y=!0)}if(y)continue;var w=n.getElementById(S.source),_=n.getElementById(S.target);w._private.edges.push(f),_._private.edges.push(f),f._private.source=w,f._private.target=_}h.ids={},h.ids[p]=d,h.removed=!1,n.addToPool(d),r.push(d)}}for(u=0;u<l;u++){var E=a[u],S=E._private.data,D=E._private.data.parent;if(null!=D){var k=n.getElementById(D);if(k.empty())S.parent=void 0;else{for(var P=!1,T=k;!T.empty();){if(E.same(T)){P=!0,S.parent=void 0;break}T=T.parent()}P||(k[0]._private.children.push(E),E._private.parent=k[0],n._private.hasCompoundNodes=!0)}}}(r=new e.Collection(n,r)).length>0&&(r.add(r.connectedNodes()).add(r.parent()).updateStyle(i),i?r.rtrigger("add"):r.trigger("add"));return this},e.elesfn.removed=function(){var e=this[0];return e&&e._private.removed},e.elesfn.inside=function(){var e=this[0];return e&&!e._private.removed},e.elesfn.remove=function(t){var i=[],r=[],n={},a=this._private.cy;function o(e){n[e.id()]||(n[e.id()]=!0,e.isNode()?(r.push(e),function(e){for(var t=e._private.edges,i=0;i<t.length;i++)o(t[i])}(e),function(e){for(var t=e._private.children,i=0;i<t.length;i++)o(t[i])}(e)):r.unshift(e))}void 0===t&&(t=!0);for(var s=0,l=this.length;s<l;s++){o(v=this[s])}function u(e,t){for(var i=e._private.edges,r=0;r<i.length;r++){if(t===i[r]){i.splice(r,1);break}}}function c(e,t){t=t[0];for(var i=(e=e[0])._private.children,r=0;r<i.length;r++)if(i[r][0]===t[0]){i.splice(r,1);break}}for(s=0;s<r.length;s++){if((v=r[s])._private.removed=!0,a.removeFromPool(v),i.push(v),v.isEdge()){var d=v.source()[0],h=v.target()[0];u(d,v),u(h,v)}else{0!==(y=v.parent()).length&&c(y,v)}}var p=a._private.elements;a._private.hasCompoundNodes=!1;for(s=0;s<p.length;s++){if((v=p[s]).isParent()){a._private.hasCompoundNodes=!0;break}}var f=new e.Collection(this.cy(),i);f.size()>0&&(t&&this.cy().notify({type:"remove",collection:f}),f.trigger("remove"));var g={};for(s=0;s<r.length;s++){var v,y,m="nodes"===(v=r[s])._private.group,x=v._private.data.parent;if(m&&void 0!==x&&!g[x])g[x]=!0,(y=a.getElementById(x))&&0!==y.length&&!y._private.removed&&0===y.children().length&&y.updateStyle()}return this},e.elesfn.move=function(e){var t=this._private.cy;if(void 0!==e.source||void 0!==e.target){var i=e.source,r=e.target,n=t.getElementById(i).length>0,a=t.getElementById(r).length>0;if(n||a){var o=this.jsons();this.remove();for(var s=0;s<o.length;s++){"edges"===(d=o[s]).group&&(n&&(d.data.source=i),a&&(d.data.target=r))}return t.add(o)}}else if(void 0!==e.parent){var l=e.parent;if(null===l||t.getElementById(l).length>0){o=this.jsons();var u=this.descendants(),c=u.merge(u.add(this).connectedEdges());this.remove();for(s=0;s<this.length;s++){var d;"nodes"===(d=o[s]).group&&(d.data.parent=null===l?void 0:l)}}return t.add(o).merge(c.restore())}return this}}(cytoscape),function(e){"use strict";e.fn.eles({stdBreadthFirstSearch:function(t){return t=e.util.extend({},t,{std:!0}),this.breadthFirstSearch(t)},breadthFirstSearch:function(t,i,r){var n,a,o;e.is.plainObject(t)&&!e.is.elementOrCollection(t)&&(t=(n=t).roots,i=n.visit,r=n.directed,a=n.std,o=n.thisArg),r=2!==arguments.length||e.is.fn(i)?r:i,i=e.is.fn(i)?i:function(){};for(var s,l=this._private.cy,u=e.is.string(t)?this.filter(t):t,c=[],d=[],h={},p={},f={},g=0,v=this.nodes(),y=this.edges(),m=0;m<u.length;m++)u[m].isNode()&&(c.unshift(u[m]),f[u[m].id()]=!0,d.push(u[m]),p[u[m].id()]=0);for(;0!==c.length;){var x,b=p[(u=c.shift()).id()],w=h[u.id()],_=null==w?void 0:w.connectedNodes().not(u)[0];if(!0===(x=a?i.call(o,u,w,_,g++,b):i.call(u,g++,b,u,w,_))){s=u;break}if(!1===x)break;var E=u.connectedEdges(r?function(){return this.data("source")===u.id()}:void 0).intersect(y);for(m=0;m<E.length;m++){var S=E[m],D=S.connectedNodes(function(){return this.id()!==u.id()}).intersect(v);0===D.length||f[D.id()]||(D=D[0],c.push(D),f[D.id()]=!0,p[D.id()]=p[u.id()]+1,d.push(D),h[D.id()]=S)}}var k=[];for(m=0;m<d.length;m++){var P=d[m],T=h[P.id()];T&&k.push(T),k.push(P)}return{path:new e.Collection(l,k,{unique:!0}),found:new e.Collection(l,s,{unique:!0})}},stdDepthFirstSearch:function(t){return t=e.util.extend({},t,{std:!0}),this.depthFirstSearch(t)},depthFirstSearch:function(t,i,r){var n,a,o;e.is.plainObject(t)&&!e.is.elementOrCollection(t)&&(t=(n=t).roots,i=n.visit,r=n.directed,a=n.std,o=n.thisArg),r=2!==arguments.length||e.is.fn(i)?r:i,i=e.is.fn(i)?i:function(){};for(var s,l=this._private.cy,u=e.is.string(t)?this.filter(t):t,c=[],d=[],h={},p={},f={},g=0,v=this.edges(),y=this.nodes(),m=0;m<u.length;m++)u[m].isNode()&&(c.push(u[m]),d.push(u[m]),p[u[m].id()]=0);for(;0!==c.length;){if(!f[(u=c.pop()).id()]){f[u.id()]=!0;var x,b=p[u.id()],w=h[u.id()],_=null==w?void 0:w.connectedNodes().not(u)[0];if(!0===(x=a?i.call(o,u,w,_,g++,b):i.call(u,g++,b,u,w,_))){s=u;break}if(!1===x)break;var E=u.connectedEdges(r?function(){return this.data("source")===u.id()}:void 0).intersect(v);for(m=0;m<E.length;m++){var S=E[m],D=S.connectedNodes(function(){return this.id()!==u.id()}).intersect(y);0===D.length||f[D.id()]||(D=D[0],c.push(D),p[D.id()]=p[u.id()]+1,d.push(D),h[D.id()]=S)}}}var k=[];for(m=0;m<d.length;m++){var P=d[m],T=h[P.id()];T&&k.push(T),k.push(P)}return{path:new e.Collection(l,k,{unique:!0}),found:new e.Collection(l,s,{unique:!0})}},kruskal:function(t){function i(e){for(var t=0;t<n.length;t++){var i=n[t];if(i.anySame(e))return{eles:i,index:t}}}t=e.is.fn(t)?t:function(){return 1};for(var r=new e.Collection(this._private.cy,[]),n=[],a=this.nodes(),o=0;o<a.length;o++)n.push(a[o].collection());var s=this.edges().toArray().sort(function(e,i){return t.call(e,e)-t.call(i,i)});for(o=0;o<s.length;o++){var l=s[o],u=l.source()[0],c=l.target()[0],d=i(u),h=i(c);d.index!==h.index&&(r=r.add(l),n[d.index]=d.eles.add(h.eles),n.splice(h.index,1))}return a.add(r)},dijkstra:function(t,i,r){var n;e.is.plainObject(t)&&!e.is.elementOrCollection(t)&&(t=(n=t).root,i=n.weight,r=n.directed);var a=this._private.cy;i=e.is.fn(i)?i:function(){return 1};for(var o=e.is.string(t)?this.filter(t)[0]:t[0],s={},l={},u={},c=this.edges().filter(function(){return!this.isLoop()}),d=this.nodes(),h=[],p=0;p<d.length;p++)s[d[p].id()]=d[p].same(o)?0:1/0,h.push(d[p]);h=new e.Collection(a,h);for(var f=e.Minheap(a,h,function(e){return s[e.id()]}),g=function(e,t){for(var n,a=(r?e.edgesTo(t):e.edgesWith(t)).intersect(c),o=1/0,s=0;s<a.length;s++){var l=a[s],u=i.apply(l,[l]);(u<o||!n)&&(o=u,n=l)}return{edge:n,dist:o}};f.size()>0;){var v=f.pop(),y=v.value,m=v.id,x=a.getElementById(m);if(u[m]=y,y===Math.Infinite)break;var b=x.neighborhood().intersect(d);for(p=0;p<b.length;p++){var w=b[p],_=w.id(),E=g(x,w),S=y+E.dist;S<f.getValueById(_)&&(f.edit(_,S),l[_]={node:x,edge:E.edge})}}return{distanceTo:function(t){var i=e.is.string(t)?d.filter(t)[0]:t[0];return u[i.id()]},pathTo:function(t){var i=e.is.string(t)?d.filter(t)[0]:t[0],r=[],n=i;if(i.length>0)for(r.unshift(i);l[n.id()];){var o=l[n.id()];r.unshift(o.edge),r.unshift(o.node),n=o.node}return new e.Collection(a,r)}}}}),e.elesfn.bfs=e.elesfn.breadthFirstSearch,e.elesfn.dfs=e.elesfn.depthFirstSearch,e.elesfn.stdBfs=e.elesfn.stdBreadthFirstSearch,e.elesfn.stdDfs=e.elesfn.stdDepthFirstSearch}(cytoscape),function(e){"use strict";e.fn.eles({aStar:function(t){t=t||{};var i=function(e,t,r,a){if(e==t)return a.push(n.getElementById(t)),a;if(t in r){var o=r[t],s=p[t];return a.push(n.getElementById(t)),a.push(n.getElementById(s)),i(e,o,r,a)}},r=function(e,t){if(0!==e.length){for(var i=0,r=t[e[0]],n=1;n<e.length;n++){var a=t[e[n]];a<r&&(r=a,i=n)}return i}},n=this._private.cy;if(null!=t&&null!=t.root){var a=e.is.string(t.root)?this.filter(t.root)[0]:t.root[0];if(null!=t.goal){var o=e.is.string(t.goal)?this.filter(t.goal)[0]:t.goal[0];if(null!=t.heuristic&&e.is.fn(t.heuristic))var s=t.heuristic;else s=function(){return 0};if(null!=t.weight&&e.is.fn(t.weight))var l=t.weight;else l=function(e){return 1};if(null!=t.directed)var u=t.directed;else u=!1;var c=[],d=[a.id()],h={},p={},f={},g={};f[a.id()]=0,g[a.id()]=s(a);for(var v=this.edges().stdFilter(function(e){return!e.isLoop()}),y=this.nodes(),m=0;d.length>0;){var x=r(d,g),b=n.getElementById(d[x]);if(m++,b.id()==o.id()){var w=i(a.id(),o.id(),h,[]);return w.reverse(),{found:!0,distance:f[b.id()],path:new e.Collection(n,w),steps:m}}c.push(b.id()),d.splice(x,1);var _=b.connectedEdges();u&&(_=_.stdFilter(function(e){return e.data("source")===b.id()})),_=_.intersect(v);for(var E=0;E<_.length;E++){var S=_[E],D=S.connectedNodes().stdFilter(function(e){return e.id()!==b.id()}).intersect(y);if(-1==c.indexOf(D.id())){var k=f[b.id()]+l.apply(S,[S]);-1!=d.indexOf(D.id())?k<f[D.id()]&&(f[D.id()]=k,g[D.id()]=k+s(D),h[D.id()]=b.id()):(f[D.id()]=k,g[D.id()]=k+s(D),d.push(D.id()),h[D.id()]=b.id(),p[D.id()]=S.id())}}}return{found:!1,distance:void 0,path:void 0,steps:m}}}},floydWarshall:function(t){t=t||{};var i=this._private.cy;if(null!=t.weight&&e.is.fn(t.weight))var r=t.weight;else r=function(e){return 1};if(null!=t.directed)var n=t.directed;else n=!1;for(var a=this.edges().stdFilter(function(e){return!e.isLoop()}),o=this.nodes(),s=o.length,l={},u=0;u<s;u++)l[o[u].id()]=u;var c=[];for(u=0;u<s;u++){for(var d=new Array(s),h=0;h<s;h++)d[h]=u==h?0:1/0;c.push(d)}var p=[],f=[],g=function(e){for(var t=0;t<s;t++){for(var i=new Array(s),r=0;r<s;r++)i[r]=void 0;e.push(i)}};g(p),g(f);for(u=0;u<a.length;u++){var v=l[a[u].source().id()],y=l[a[u].target().id()],m=r.apply(a[u],[a[u]]);c[v][y]>m&&(c[v][y]=m,p[v][y]=y,f[v][y]=a[u])}if(!n)for(u=0;u<a.length;u++){v=l[a[u].target().id()],y=l[a[u].source().id()],m=r.apply(a[u],[a[u]]);c[v][y]>m&&(c[v][y]=m,p[v][y]=y,f[v][y]=a[u])}for(var x=0;x<s;x++)for(u=0;u<s;u++)for(h=0;h<s;h++)c[u][x]+c[x][h]<c[u][h]&&(c[u][h]=c[u][x]+c[x][h],p[u][h]=p[u][x]);var b=[];for(u=0;u<s;u++)b.push(o[u].id());return{distance:function(t,r){if(e.is.string(t))var n=i.filter(t)[0].id();else n=t.id();if(e.is.string(r))var a=i.filter(r)[0].id();else a=r.id();return c[l[n]][l[a]]},path:function(t,r){if(e.is.string(t))var n=i.filter(t)[0].id();else n=t.id();if(e.is.string(r))var a=i.filter(r)[0].id();else a=r.id();var o=function(e,t,r,n,a){if(e===t)return i.getElementById(n[e]);if(void 0!==r[e][t]){for(var o=[i.getElementById(n[e])],s=e;e!==t;){s=e,e=r[e][t];var l=a[s][e];o.push(l),o.push(i.getElementById(n[e]))}return o}}(l[n],l[a],p,b,f);return new e.Collection(i,o)}}},bellmanFord:function(t){if(null!=(t=t||{}).weight&&e.is.fn(t.weight))var i=t.weight;else i=function(e){return 1};if(null!=t.directed)var r=t.directed;else r=!1;if(null!=t.root){if(e.is.string(t.root))var n=this.filter(t.root)[0];else n=t.root[0];for(var a=this._private.cy,o=this.edges().stdFilter(function(e){return!e.isLoop()}),s=this.nodes(),l=s.length,u={},c=0;c<l;c++)u[s[c].id()]=c;var d=[],h=[],p=[];for(c=0;c<l;c++)s[c].id()===n.id()?d[c]=0:d[c]=1/0,h[c]=void 0;var f=!1;for(c=1;c<l;c++){f=!1;for(var g=0;g<o.length;g++){var v,y=u[o[g].source().id()],m=u[o[g].target().id()],x=i.apply(o[g],[o[g]]);if((v=d[y]+x)<d[m]&&(d[m]=v,h[m]=y,p[m]=o[g],f=!0),!r)(v=d[m]+x)<d[y]&&(d[y]=v,h[y]=m,p[y]=o[g],f=!0)}if(!f)break}if(f)for(g=0;g<o.length;g++){y=u[o[g].source().id()],m=u[o[g].target().id()],x=i.apply(o[g],[o[g]]);if(d[y]+x<d[m])return e.util.error("Error: graph contains a negative weigth cycle!"),{pathTo:void 0,distanceTo:void 0,hasNegativeWeightCycle:!0}}var b=[];for(c=0;c<l;c++)b.push(s[c].id());return{distanceTo:function(t){if(e.is.string(t))var i=a.filter(t)[0].id();else i=t.id();return d[u[i]]},pathTo:function(t){if(e.is.string(t))var i=a.filter(t)[0].id();else i=t.id();var r=function(e,t,i,r,n,o){for(;;){if(n.push(a.getElementById(r[i])),n.push(o[i]),t===i)return n;var s=e[i];if(void 0===s)return;i=s}}(h,u[n.id()],u[i],b,[],p);return null!=r&&r.reverse(),new e.Collection(a,r)},hasNegativeWeightCycle:!1}}e.util.error("options.root required")},kargerStein:function(t){t=t||{};var i=function(e,t,r,n){if(r<=n)return t;var a=function(e,t,i){for(var r=i[e],n=r[1],a=r[2],o=t[n],s=t[a],l=i.filter(function(e){return!(t[e[1]]===o&&t[e[2]]===s||t[e[1]]===s&&t[e[2]]===o)}),u=0;u<l.length;u++){var c=l[u];c[1]===s?(l[u]=c.slice(0),l[u][1]=o):c[2]===s&&(l[u]=c.slice(0),l[u][2]=o)}for(u=0;u<t.length;u++)t[u]===s&&(t[u]=o);return l}(Math.floor(Math.random()*t.length),e,t);return i(e,a,r-1,n)},r=this._private.cy,n=this.edges().stdFilter(function(e){return!e.isLoop()}),a=this.nodes(),o=a.length,s=n.length,l=Math.ceil(Math.pow(Math.log(o)/Math.LN2,2)),u=Math.floor(o/Math.sqrt(2));if(!(o<2)){for(var c={},d=0;d<o;d++)c[a[d].id()]=d;var h=[];for(d=0;d<s;d++){var p=n[d];h.push([d,c[p.source().id()],c[p.target().id()]])}var f,g=1/0,v=[];for(d=0;d<o;d++)v.push(d);for(var y=0;y<=l;y++){var m=v.slice(0),x=i(m,h,o,u),b=m.slice(0),w=i(m,x,u,2),_=i(b,x,u,2);w.length<=_.length&&w.length<g?(g=w.length,f=[w,m]):_.length<=w.length&&_.length<g&&(g=_.length,f=[_,b])}var E=f[0].map(function(e){return n[e[0]]}),S=[],D=[],k=f[1][0];for(d=0;d<f[1].length;d++){f[1][d]===k?S.push(a[d]):D.push(a[d])}return{cut:new e.Collection(r,E),partition1:new e.Collection(r,S),partition2:new e.Collection(r,D)}}e.util.error("At least 2 nodes are required for KargerSteing algorithm!")},pageRank:function(t){var i=function(e){for(var t=e.length,i=0,r=0;r<t;r++)i+=e[r];for(r=0;r<t;r++)e[r]=e[r]/i};if(null!=(t=t||{})&&null!=t.dampingfactor)var r=t.dampingFactor;else r=.8;if(null!=t&&null!=t.precision)var n=t.precision;else n=1e-6;if(null!=t&&null!=t.iterations)var a=t.iterations;else a=200;if(null!=t&&null!=t.weight&&e.is.fn(t.weight))var o=t.weight;else o=function(e){return 1};for(var s=this._private.cy,l=this.edges().stdFilter(function(e){return!e.isLoop()}),u=this.nodes(),c=u.length,d=l.length,h={},p=0;p<c;p++)h[u[p].id()]=p;var f=[],g=[],v=(1-r)/c;for(p=0;p<c;p++){for(var y=[],m=0;m<c;m++)y.push(0);f.push(y),g.push(0)}for(p=0;p<d;p++){var x=l[p],b=h[x.source().id()],w=h[x.target().id()],_=o.apply(x,[x]);f[w][b]+=_,g[b]+=_}var E=1/c+v;for(m=0;m<c;m++)if(0===g[m])for(p=0;p<c;p++)f[p][m]=E;else for(p=0;p<c;p++)f[p][m]=f[p][m]/g[m]+v;var S,D=[],k=[];for(p=0;p<c;p++)D.push(1),k.push(0);for(var P=0;P<a;P++){var T=k.slice(0);for(p=0;p<c;p++)for(m=0;m<c;m++)T[p]+=f[p][m]*D[m];i(T),S=D,D=T;var C=0;for(p=0;p<c;p++)C+=Math.pow(S[p]-D[p],2);if(C<n)break}return{rank:function(t){if(e.is.string(t))var i=s.filter(t)[0].id();else i=t.id();return D[h[i]]}}},degreeCentralityNormalized:function(t){if(null!=(t=t||{}).directed)var i=t.directed;else i=!1;var r=this.nodes(),n=r.length;if(i){var a={},o={},s=0,l=0;for(d=0;d<n;d++){h=r[d],p=this.degreeCentrality(e.util.extend({},t,{root:h}));s<p.indegree&&(s=p.indegree),l<p.outdegree&&(l=p.outdegree),a[h.id()]=p.indegree,o[h.id()]=p.outdegree}return{indegree:function(t){if(e.is.string(t))t=cy.filter(t)[0].id();else t=t.id();return a[t]/s},outdegree:function(t){if(e.is.string(t))t=cy.filter(t)[0].id();else t=t.id();return o[t]/l}}}for(var u={},c=0,d=0;d<n;d++){var h=r[d],p=this.degreeCentrality(e.util.extend({},t,{root:h}));c<p.degree&&(c=p.degree),u[h.id()]=p.degree}return{degree:function(t){if(e.is.string(t))t=cy.filter(t)[0].id();else t=t.id();return u[t]/c}}},degreeCentrality:function(t){if(null!=(t=t||{})&&null!=t.root){var i=e.is.string(t.root)?this.filter(t.root)[0]:t.root[0];if(null!=t.weight&&e.is.fn(t.weight))var r=t.weight;else r=function(e){return 1};if(null!=t.directed)var n=t.directed;else n=!1;if(null!=t.alpha&&e.is.number(t.alpha))var a=t.alpha;else a=0;if(n){var o=i.connectedEdges('edge[target = "'+i.id()+'"]').intersection(this),s=i.connectedEdges('edge[source = "'+i.id()+'"]').intersection(this),l=o.length,u=s.length,c=0,d=0;for(g=0;g<o.length;g++){v=o[g];c+=r.apply(v,[v])}for(g=0;g<s.length;g++){v=s[g];d+=r.apply(v,[v])}return{indegree:Math.pow(l,1-a)*Math.pow(c,a),outdegree:Math.pow(u,1-a)*Math.pow(d,a)}}for(var h=i.connectedEdges().intersection(this),p=h.length,f=0,g=0;g<h.length;g++){var v=h[g];f+=r.apply(v,[v])}return{degree:Math.pow(p,1-a)*Math.pow(f,a)}}},closenessCentralityNormalized:function(t){var i=(t=t||{}).harmonic;void 0===i&&(i=!0);for(var r={},n=0,a=this.nodes(),o=this.floydWarshall({weight:t.weight,directed:t.directed}),s=0;s<a.length;s++){for(var l=0,u=0;u<a.length;u++)if(s!=u){var c=o.distance(a[s],a[u]);l+=i?1/c:c}i||(l=1/l),n<l&&(n=l),r[a[s].id()]=l}return{closeness:function(t){if(e.is.string(t))t=cy.filter(t)[0].id();else t=t.id();return r[t]/n}}},closenessCentrality:function(t){if(null!=(t=t||{}).root){if(e.is.string(t.root))var i=this.filter(t.root)[0];else i=t.root[0];if(null!=t.weight&&e.is.fn(t.weight))var r=t.weight;else r=function(){return 1};if(null!=t.directed&&e.is.bool(t.directed))var n=t.directed;else n=!1;var a=t.harmonic;void 0===a&&(a=!0);for(var o=this.dijkstra({root:i,weight:r,directed:n}),s=0,l=this.nodes(),u=0;u<l.length;u++)if(l[u].id()!=i.id()){var c=o.distanceTo(l[u]);s+=a?1/c:c}return a?s:1/s}e.util.error("options.root required")},betweennessCentrality:function(t){if(null!=(t=t||{}).weight&&e.is.fn(t.weight))var i=t.weight,r=!0;else r=!1;if(null!=t.directed&&e.is.bool(t.directed))var n=t.directed;else n=!1;for(var a=function(e,t){e.unshift(t);for(var i=0;g[e[i]]<g[e[i+1]]&&i<e.length-1;i++){var r=e[i];e[i]=e[i+1],e[i+1]=r}},o=this._private.cy,s=this.nodes(),l={},u={},c=0;c<s.length;c++)l[s[c].id()]=n?s[c].outgoers("node"):s[c].openNeighborhood("node");for(c=0;c<s.length;c++)u[s[c].id()]=0;for(var d=0;d<s.length;d++){var h=[],p={},f={},g={},v=[];for(c=0;c<s.length;c++)p[s[c].id()]=[],f[s[c].id()]=0,g[s[c].id()]=Number.POSITIVE_INFINITY;for(f[s[d].id()]=1,g[s[d].id()]=0,v.unshift(s[d].id());v.length>0;){var y=v.pop();h.push(y),r?l[y].forEach(function(e){if(o.$("#"+y).edgesTo(e).length>0)var t=o.$("#"+y).edgesTo(e)[0];else t=e.edgesTo("#"+y)[0];var r=i.apply(t,[t]);g[e.id()]>g[y]+r&&(g[e.id()]=g[y]+r,v.indexOf(e.id())<0?a(v,e.id()):(v.splice(v.indexOf(e.id()),1),a(v,e.id())),f[e.id()]=0,p[e.id()]=[]),g[e.id()]==g[y]+r&&(f[e.id()]=f[e.id()]+f[y],p[e.id()].push(y))}):l[y].forEach(function(e){g[e.id()]==Number.POSITIVE_INFINITY&&(v.unshift(e.id()),g[e.id()]=g[y]+1),g[e.id()]==g[y]+1&&(f[e.id()]=f[e.id()]+f[y],p[e.id()].push(y))})}var m={};for(c=0;c<s.length;c++)m[s[c].id()]=0;for(;h.length>0;){var x=h.pop();p[x].forEach(function(e){m[e]=m[e]+f[e]/f[x]*(1+m[x]),x!=s[d].id()&&(u[x]=u[x]+m[x])})}}var b=0;for(var w in u)b<u[w]&&(b=u[w]);var _={betweenness:function(t){if(e.is.string(t))t=o.filter(t)[0].id();else t=t.id();return u[t]},betweennessNormalized:function(t){if(e.is.string(t))t=o.filter(t)[0].id();else t=t.id();return u[t]/b}};return _.betweennessNormalised=_.betweennessNormalized,_}}),e.elesfn.dc=e.elesfn.degreeCentrality,e.elesfn.dcn=e.elesfn.degreeCentralityNormalised=e.elesfn.degreeCentralityNormalized,e.elesfn.cc=e.elesfn.closenessCentrality,e.elesfn.ccn=e.elesfn.closenessCentralityNormalised=e.elesfn.closenessCentralityNormalized,e.elesfn.bc=e.elesfn.betweennessCentrality}(cytoscape),function(e){"use strict";e.fn.eles({animated:e.define.animated(),clearQueue:e.define.clearQueue(),delay:e.define.delay(),animate:e.define.animate(),stop:e.define.stop()})}(cytoscape),function(e){"use strict";e.fn.eles({addClass:function(t){t=t.split(/\s+/);for(var i=[],r=0;r<t.length;r++){var n=t[r];if(!e.is.emptyString(n))for(var a=0;a<this.length;a++){var o=this[a],s=o._private.classes[n];o._private.classes[n]=!0,s||i.push(o)}}return i.length>0&&new e.Collection(this._private.cy,i).updateStyle().trigger("class"),this},hasClass:function(e){var t=this[0];return!(null==t||!t._private.classes[e])},toggleClass:function(t,i){for(var r=t.split(/\s+/),n=[],a=0,o=this.length;a<o;a++)for(var s=this[a],l=0;l<r.length;l++){var u=r[l];if(!e.is.emptyString(u)){var c=s._private.classes[u];i||void 0===i&&!c?(s._private.classes[u]=!0,c||n.push(s)):(s._private.classes[u]=!1,c&&n.push(s))}}return n.length>0&&new e.Collection(this._private.cy,n).updateStyle().trigger("class"),this},removeClass:function(t){t=t.split(/\s+/);for(var i=[],r=0;r<this.length;r++)for(var n=this[r],a=0;a<t.length;a++){var o=t[a];if(o&&""!==o){var s=n._private.classes[o];n._private.classes[o]=void 0,s&&i.push(n)}}return i.length>0&&new e.Collection(this._private.cy,i).updateStyle(),this.trigger("class"),this},flashClass:function(e,t){var i=this;if(null==t)t=250;else if(0===t)return i;return i.addClass(e),setTimeout(function(){i.removeClass(e)},t),i}})}(cytoscape),function(e){"use strict";e.fn.eles({allAre:function(e){return this.filter(e).length===this.length},is:function(e){return this.filter(e).length>0},some:function(e,t){for(var i=0;i<this.length;i++){if(t?e.apply(t,[this[i],i,this]):e(this[i],i,this))return!0}return!1},every:function(e,t){for(var i=0;i<this.length;i++){if(!(t?e.apply(t,[this[i],i,this]):e(this[i],i,this)))return!1}return!0},same:function(e){return e=this.cy().collection(e),this.length===e.length&&this.intersect(e).length===this.length},anySame:function(e){return e=this.cy().collection(e),this.intersect(e).length>0},allAreNeighbors:function(e){return e=this.cy().collection(e),this.neighborhood().intersect(e).length===e.length}}),e.elesfn.allAreNeighbours=e.elesfn.allAreNeighbors}(cytoscape),function(e){"use strict";e.fn.eles({parent:function(t){for(var i=[],r=this._private.cy,n=0;n<this.length;n++){var a=this[n],o=r.getElementById(a._private.data.parent);o.size()>0&&i.push(o)}return new e.Collection(r,i,{unique:!0}).filter(t)},parents:function(t){for(var i=[],r=this.parent();r.nonempty();){for(var n=0;n<r.length;n++){var a=r[n];i.push(a)}r=r.parent()}return new e.Collection(this.cy(),i,{unique:!0}).filter(t)},commonAncestors:function(e){for(var t,i=0;i<this.length;i++){var r=this[i].parents();t=(t=t||r).intersect(r)}return t.filter(e)},orphans:function(e){return this.stdFilter(function(e){return e.isNode()&&e.parent().empty()}).filter(e)},nonorphans:function(e){return this.stdFilter(function(e){return e.isNode()&&e.parent().nonempty()}).filter(e)},children:function(t){for(var i=[],r=0;r<this.length;r++){var n=this[r];i=i.concat(n._private.children)}return new e.Collection(this.cy(),i,{unique:!0}).filter(t)},siblings:function(e){return this.parent().children().not(this).filter(e)},isParent:function(){var e=this[0];if(e)return 0!==e._private.children.length},isChild:function(){var e=this[0];if(e)return void 0!==e._private.data.parent&&0!==e.parent().length},descendants:function(t){var i=[];return function e(t){for(var r=0;r<t.length;r++){var n=t[r];i.push(n),n.children().nonempty()&&e(n.children())}}(this.children()),new e.Collection(this.cy(),i,{unique:!0}).filter(t)}}),e.elesfn.ancestors=e.elesfn.parents}(cytoscape),function(e){"use strict";e.fn.eles({data:e.define.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),removeData:e.define.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:e.define.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:e.define.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:e.define.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:e.define.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var e=this[0];if(e)return e._private.data.id},position:e.define.data({field:"position",bindingEvent:"position",allowBinding:!0,allowSetting:!0,settingEvent:"position",settingTriggersEvent:!0,triggerFnName:"rtrigger",allowGetting:!0,validKeys:["x","y"],onSet:function(e){e.updateCompoundBounds().rtrigger("position")},canSet:function(e){return!e.locked()}}),silentPosition:e.define.data({field:"position",bindingEvent:"position",allowBinding:!1,allowSetting:!0,settingEvent:"position",settingTriggersEvent:!1,triggerFnName:"trigger",allowGetting:!0,validKeys:["x","y"],onSet:function(e){e.updateCompoundBounds()},canSet:function(e){return!e.locked()}}),positions:function(t,i){if(e.is.plainObject(t))this.position(t);else if(e.is.fn(t)){for(var r=t,n=0;n<this.length;n++){var a=this[n];if((t=r.apply(a,[n,a]))&&!a.locked()){var o=a._private.position;o.x=t.x,o.y=t.y}}var s=this.updateCompoundBounds(),l=s.length>0?this.add(s):this;i?l.trigger("position"):l.rtrigger("position")}return this},silentPositions:function(e){return this.positions(e,!0)},updateCompoundBounds:function(){var t=this.cy();if(!t.styleEnabled()||!t.hasCompoundNodes())return t.collection();var i=[];for(var r,n,a,o,s,l,u,c,d,h,p,f=this.parent();f.nonempty();){for(var g=0;g<f.length;g++){var v=f[g];n=void 0,void 0,void 0,void 0,l=void 0,u=void 0,c=void 0,d=void 0,h=void 0,p=void 0,n=(r=v).children(),a=r._private.style,o="include"===a["compound-sizing-wrt-labels"].value,s=n.boundingBox({includeLabels:o,includeEdges:!0}),l=a["padding-top"].pxValue,u=a["padding-bottom"].pxValue,c=a["padding-left"].pxValue,d=a["padding-right"].pxValue,h=r._private.position,p=!1,"auto"===a.width.value&&(r._private.autoWidth=s.w+c+d,h.x=(s.x1+s.x2-c+d)/2,p=!0),"auto"===a.height.value&&(r._private.autoHeight=s.h+l+u,h.y=(s.y1+s.y2-l+u)/2,p=!0),p&&i.push(r)}f=f.parent()}return new e.Collection(t,i)},renderedPosition:function(t,i){var r=this[0],n=this.cy(),a=n.zoom(),o=n.pan(),s=e.is.plainObject(t)?t:void 0,l=void 0!==s||void 0!==i&&e.is.string(t);if(r&&r.isNode()){if(!l){var u=r._private.position;return s={x:u.x*a+o.x,y:u.y*a+o.y},void 0===t?s:s[t]}for(var c=0;c<this.length;c++){r=this[c];void 0!==i?r._private.position[t]=(i-o[t])/a:void 0!==s&&(r._private.position={x:(s.x-o.x)/a,y:(s.y-o.y)/a})}this.rtrigger("position")}else if(!l)return;return this},relativePosition:function(t,i){var r=this[0],n=this.cy(),a=e.is.plainObject(t)?t:void 0,o=void 0!==a||void 0!==i&&e.is.string(t),s=n.hasCompoundNodes();if(r&&r.isNode()){if(!o){var l=r._private.position;h=d=(c=s?r.parent():null)&&c.length>0;d&&(c=c[0]);p=h?c._private.position:{x:0,y:0};return a={x:l.x-p.x,y:l.y-p.y},void 0===t?a:a[t]}for(var u=0;u<this.length;u++){r=this[u];var c,d,h=d=(c=s?r.parent():null)&&c.length>0;d&&(c=c[0]);var p=h?c._private.position:{x:0,y:0};void 0!==i?r._private.position[t]=i+p[t]:void 0!==a&&(r._private.position={x:a.x+p.x,y:a.y+p.y})}this.rtrigger("position")}else if(!o)return;return this},width:function(){var e=this[0],t=e._private.cy._private.styleEnabled;if(e){if(t){var i=e._private.style.width;return"auto"===i.strValue?e._private.autoWidth:i.pxValue}return 1}},outerWidth:function(){var e=this[0],t=e._private.cy._private.styleEnabled;if(e){if(t){var i=e._private.style;return("auto"===i.width.strValue?e._private.autoWidth:i.width.pxValue)+(i["border-width"]?1*i["border-width"].pxValue+0:0)}return 1}},renderedWidth:function(){var e=this[0];if(e)return e.width()*this.cy().zoom()},renderedOuterWidth:function(){var e=this[0];if(e)return e.outerWidth()*this.cy().zoom()},height:function(){var e=this[0],t=e._private.cy._private.styleEnabled;if(e&&"nodes"===e._private.group){if(t){var i=e._private.style.height;return"auto"===i.strValue?e._private.autoHeight:i.pxValue}return 1}},outerHeight:function(){var e=this[0],t=e._private.cy._private.styleEnabled;if(e&&"nodes"===e._private.group){if(!t)return 1;var i=e._private.style;return("auto"===i.height.strValue?e._private.autoHeight:i.height.pxValue)+(i["border-width"]?1*i["border-width"].pxValue+0:0)}},renderedHeight:function(){var e=this[0];if(e&&"nodes"===e._private.group)return e.height()*this.cy().zoom()},renderedOuterHeight:function(){var e=this[0];if(e&&"nodes"===e._private.group)return e.outerHeight()*this.cy().zoom()},renderedBoundingBox:function(e){var t=this.boundingBox(e),i=this.cy(),r=i.zoom(),n=i.pan(),a=t.x1*r+n.x,o=t.x2*r+n.x,s=t.y1*r+n.y,l=t.y2*r+n.y;return{x1:a,x2:o,y1:s,y2:l,w:o-a,h:l-s}},boundingBox:function(e){var t=this._private.cy._private,i=t.styleEnabled,r=void 0===(e=e||{}).includeNodes||e.includeNodes,n=void 0===e.includeEdges||e.includeEdges,a=void 0===e.includeLabels||e.includeLabels;i&&t.renderer.recalculateRenderedStyle(this);for(var o=1/0,s=-1/0,l=1/0,u=-1/0,c=0;c<this.length;c++){var d,h,p,f,g,v,y=this[c],m=y._private,x=m.style,b=i?m.style.display.value:"element",w="nodes"===m.group,_=!1;if("none"!==b){if(w&&r){_=!0;var E=m.position;g=E.x,v=E.y;var S=y.outerWidth()/2,D=y.outerHeight()/2;h=g+S,p=v-D,f=v+D,o=(d=g-S)<o?d:o,s=h>s?h:s,l=p<l?p:l,u=f>u?f:u}else if(y.isEdge()&&n){_=!0;var k=m.source._private.position,P=m.target._private.position,T=m.rstyle||{};if(d=k.x,h=P.x,p=k.y,f=P.y,d>h){var C=d;d=h,h=C}if(p>f){C=p;p=f,f=C}if(o=d<o?d:o,s=h>s?h:s,l=p<l?p:l,u=f>u?f:u,i)for(var M=T.bezierPts||[],B=x.width.pxValue/2,N=0;N<M.length;N++){var I=M[N];d=I.x-B,h=I.x+B,p=I.y-B,f=I.y+B,o=d<o?d:o,s=h>s?h:s,l=p<l?p:l,u=f>u?f:u}if(i&&"haystack"===x["curve-style"].strValue){var O=m.rscratch.haystackPts;if(d=O[0],p=O[1],h=O[2],f=O[3],d>h){C=d;d=h,h=C}if(p>f){C=p;p=f,f=C}o=d<o?d:o,s=h>s?h:s,l=p<l?p:l,u=f>u?f:u}}if(i){x=y._private.style,T=y._private.rstyle;var z=x.content.strValue,L=x["font-size"],R=x["text-halign"],V=x["text-valign"],A=T.labelWidth,X=T.labelHeight,F=T.labelX,Y=T.labelY;if(_&&a&&z&&L&&null!=X&&null!=A&&null!=F&&null!=Y&&R&&V){var q,j,$,W,H=X,Z=A;if(y.isEdge())q=F-Z/2,j=F+Z/2,$=Y-H/2,W=Y+H/2;else{switch(R.value){case"left":q=F-Z,j=F;break;case"center":q=F-Z/2,j=F+Z/2;break;case"right":q=F,j=F+Z}switch(V.value){case"top":$=Y-H,W=Y;break;case"center":$=Y-H/2,W=Y+H/2;break;case"bottom":$=Y,W=Y+H}}o=q<o?q:o,s=j>s?j:s,l=$<l?$:l,u=W>u?W:u}}}}var U=function(e){return e===1/0||e===-1/0?0:e};return{x1:o=U(o),x2:s=U(s),y1:l=U(l),y2:u=U(u),w:s-o,h:u-l}}});var t=e.elesfn;t.attr=t.data,t.removeAttr=t.removeData,t.modelPosition=t.point=t.position,t.modelPositions=t.points=t.positions,t.renderedPoint=t.renderedPosition,t.relativePoint=t.relativePosition,t.boundingbox=t.boundingBox,t.renderedBoundingbox=t.renderedBoundingBox}(cytoscape),function(e){"use strict";function t(e){return function(t){if(void 0===t&&(t=!0),0!==this.length&&this.isNode()&&!this.removed()){for(var i=0,r=this[0],n=r._private.edges,a=0;a<n.length;a++){var o=n[a];!t&&o.isLoop()||(i+=e(r,o))}return i}}}function i(e,t){return function(i){for(var r,n=this.nodes(),a=0;a<n.length;a++){var o=n[a][e](i);void 0===o||void 0!==r&&!t(o,r)||(r=o)}return r}}e.fn.eles({degree:t(function(e,t){return t.source().same(t.target())?2:1}),indegree:t(function(e,t){return t.target().same(e)?1:0}),outdegree:t(function(e,t){return t.source().same(e)?1:0})}),e.fn.eles({minDegree:i("degree",function(e,t){return e<t}),maxDegree:i("degree",function(e,t){return e>t}),minIndegree:i("indegree",function(e,t){return e<t}),maxIndegree:i("indegree",function(e,t){return e>t}),minOutdegree:i("outdegree",function(e,t){return e<t}),maxOutdegree:i("outdegree",function(e,t){return e>t})}),e.fn.eles({totalDegree:function(e){for(var t=0,i=this.nodes(),r=0;r<i.length;r++)t+=i[r].degree(e);return t}})}(cytoscape),function(e){"use strict";e.fn.eles({on:e.define.on(),one:e.define.on({unbindSelfOnTrigger:!0}),once:e.define.on({unbindAllBindersOnTrigger:!0}),off:e.define.off(),trigger:e.define.trigger(),rtrigger:function(e,t){if(0!==this.length)return this.cy().notify({type:e,collection:this}),this.trigger(e,t),this}}),e.define.eventAliasesOn(e.elesfn)}(cytoscape),function(e){"use strict";e.fn.eles({nodes:function(e){return this.filter(function(e,t){return t.isNode()}).filter(e)},edges:function(e){return this.filter(function(e,t){return t.isEdge()}).filter(e)},filter:function(t){var i=this._private.cy;if(e.is.fn(t)){for(var r=[],n=0;n<this.length;n++){var a=this[n];t.apply(a,[n,a])&&r.push(a)}return new e.Collection(i,r)}return e.is.string(t)||e.is.elementOrCollection(t)?new e.Selector(t).filter(this):void 0===t?this:new e.Collection(i)},not:function(t){var i=this._private.cy;if(t){e.is.string(t)&&(t=this.filter(t));for(var r=[],n=0;n<this.length;n++){var a=this[n];t._private.ids[a.id()]||r.push(a)}return new e.Collection(i,r)}return this},absoluteComplement:function(){return this._private.cy.elements().not(this)},intersect:function(t){var i=this._private.cy;if(e.is.string(t)){var r=t;return this.filter(r)}for(var n=[],a=t,o=this.length<t.length,s=o?a._private.ids:this._private.ids,l=o?this:a,u=0;u<l.length;u++){var c=s[l[u]._private.data.id];c&&n.push(c)}return new e.Collection(i,n)},xor:function(t){var i=this._private.cy;e.is.string(t)&&(t=i.$(t));var r=[],n=t,a=function(e,t){for(var i=0;i<e.length;i++){var n=e[i],a=n._private.data.id;t._private.ids[a]||r.push(n)}};return a(this,n),a(n,this),new e.Collection(i,r)},diff:function(t){var i=this._private.cy;e.is.string(t)&&(t=i.$(t));var r=[],n=[],a=[],o=t,s=function(e,t,i){for(var r=0;r<e.length;r++){var n=e[r],o=n._private.data.id;t._private.ids[o]?a.push(n):i.push(n)}};return s(this,o,r),s(o,this,n),{left:new e.Collection(i,r,{unique:!0}),right:new e.Collection(i,n,{unique:!0}),both:new e.Collection(i,a,{unique:!0})}},add:function(t){var i=this._private.cy;if(!t)return this;if(e.is.string(t)){var r=t;t=i.elements(r)}for(var n=[],a=0;a<this.length;a++)n.push(this[a]);for(a=0;a<t.length;a++){!this._private.ids[t[a].id()]&&n.push(t[a])}return new e.Collection(i,n)},merge:function(t){var i=this._private,r=i.cy;if(!t)return this;if(e.is.string(t)){var n=t;t=r.elements(n)}for(var a=0;a<t.length;a++){var o=t[a],s=o.id();if(!i.ids[s]){var l=this.length++;this[l]=o,i.ids[s]=o,i.indexes[s]=l}}return this},unmergeOne:function(e){e=e[0];var t=this._private,i=e.id(),r=t.indexes[i];if(null==r)return this;this[r]=void 0,t.ids[i]=void 0,t.indexes[i]=void 0;var n=r===this.length-1;if(this.length>1&&!n){var a=this.length-1,o=this[a];this[a]=void 0,this[r]=o,t.indexes[o.id()]=r}return this.length--,this},unmerge:function(t){var i=this._private.cy;if(!t)return this;if(e.is.string(t)){var r=t;t=i.elements(r)}for(var n=0;n<t.length;n++)this.unmergeOne(t[n]);return this},map:function(e,t){for(var i=[],r=0;r<this.length;r++){var n=this[r],a=t?e.apply(t,[n,r,this]):e(n,r,this);i.push(a)}return i},stdFilter:function(t,i){for(var r=[],n=this._private.cy,a=0;a<this.length;a++){var o=this[a];(i?t.apply(i,[o,a,this]):t(o,a,this))&&r.push(o)}return new e.Collection(n,r)},max:function(e,t){for(var i,r=-1/0,n=0;n<this.length;n++){var a=this[n],o=t?e.apply(t,[a,n,this]):e(a,n,this);o>r&&(r=o,i=a)}return{value:r,ele:i}},min:function(e,t){for(var i,r=1/0,n=0;n<this.length;n++){var a=this[n],o=t?e.apply(t,[a,n,this]):e(a,n,this);o<r&&(r=o,i=a)}return{value:r,ele:i}}});var t=e.elesfn;t.u=t["|"]=t["+"]=t.union=t.or=t.add,t["\\"]=t["!"]=t["-"]=t.difference=t.relativeComplement=t.not,t.n=t["&"]=t["."]=t.and=t.intersection=t.intersect,t["^"]=t["(+)"]=t["(-)"]=t.symmetricDifference=t.symdiff=t.xor,t.fnFilter=t.filterFn=t.stdFilter,t.complement=t.abscomp=t.absoluteComplement}(cytoscape),function(e){"use strict";cytoscape.fn.eles({isNode:function(){return"nodes"===this.group()},isEdge:function(){return"edges"===this.group()},isLoop:function(){return this.isEdge()&&this.source().id()===this.target().id()},isSimple:function(){return this.isEdge()&&this.source().id()!==this.target().id()},group:function(){var e=this[0];if(e)return e._private.group}})}(),function(e){"use strict";e.fn.eles({each:function(t){if(e.is.fn(t))for(var i=0;i<this.length;i++){var r=this[i];if(!1===t.apply(r,[i,r]))break}return this},forEach:function(t,i){if(e.is.fn(t))for(var r=0;r<this.length;r++){var n=this[r];if(!1===(i?t.apply(i,[n,r,this]):t(n,r,this)))break}return this},toArray:function(){for(var e=[],t=0;t<this.length;t++)e.push(this[t]);return e},slice:function(t,i){var r=[],n=this.length;null==i&&(i=n),null==t&&(t=0),t<0&&(t=n+t),i<0&&(i=n+i);for(var a=t;a>=0&&a<i&&a<n;a++)r.push(this[a]);return new e.Collection(this.cy(),r)},size:function(){return this.length},eq:function(t){return this[t]||new e.Collection(this.cy())},first:function(){return this[0]||new e.Collection(this.cy())},last:function(){return this[this.length-1]||new e.Collection(this.cy())},empty:function(){return 0===this.length},nonempty:function(){return!this.empty()},sort:function(t){if(!e.is.fn(t))return this;var i=this.cy(),r=this.toArray().sort(t);return new e.Collection(i,r)},sortByZIndex:function(){return this.sort(e.Collection.zIndexSort)},zDepth:function(){var e=this[0];if(e){var t=e._private;if("nodes"===t.group){var i=t.data.parent?e.parents().size():0;return e.isParent()?i:Number.MAX_VALUE}var r=t.source,n=t.target,a=r.zDepth(),o=n.zDepth();return Math.max(a,o,0)}}}),e.Collection.zIndexSort=function(e,t){var i=e.cy(),r=e._private,n=t._private,a=r.style["z-index"].value-n.style["z-index"].value,o=0,s=0,l=i.hasCompoundNodes(),u="nodes"===r.group,c="edges"===r.group,d="nodes"===n.group,h="edges"===n.group;l&&(o=e.zDepth(),s=t.zDepth());var p=o-s;return 0===p?u&&h?1:c&&d?-1:0===a?r.index-n.index:a:p}}(cytoscape),function(e){"use strict";e.fn.eles({layoutPositions:function(t,i,r){var n=this.nodes(),a=this.cy();if(t.trigger({type:"layoutstart",layout:t}),i.animate){for(var o=0;o<n.length;o++){var s=n[o],l=o===n.length-1,u=r.call(s,o,s),c=s.position();e.is.number(c.x)&&e.is.number(c.y)||s.silentPosition({x:0,y:0}),s.animate({position:u},{duration:i.animationDuration,step:l?function(){i.fit&&a.fit(i.eles,i.padding)}:void 0,complete:l?function(){null!=i.zoom&&a.zoom(i.zoom),i.pan&&a.pan(i.pan),i.fit&&a.fit(i.eles,i.padding),t.one("layoutstop",i.stop),t.trigger({type:"layoutstop",layout:t})}:void 0})}t.one("layoutready",i.ready),t.trigger({type:"layoutready",layout:t})}else n.positions(r),i.fit&&a.fit(i.eles,i.padding),null!=i.zoom&&a.zoom(i.zoom),i.pan&&a.pan(i.pan),t.one("layoutready",i.ready),t.trigger({type:"layoutready",layout:t}),t.one("layoutstop",i.stop),t.trigger({type:"layoutstop",layout:t});return this},layout:function(t){return this.cy().layout(e.util.extend({},t,{eles:this})),this},makeLayout:function(t){return this.cy().makeLayout(e.util.extend({},t,{eles:this}))}}),e.elesfn.createLayout=e.elesfn.makeLayout}(cytoscape),function(e){"use strict";e.fn.eles({updateStyle:function(e){var t=this._private.cy;if(!t.styleEnabled())return this;if(t._private.batchingStyle){for(var i=t._private.batchStyleEles,r=0;r<this.length;r++){var n=this[r];i.ids[n._private.id]||i.push(n)}return this}var a=t.style();e=!(!e&&void 0!==e),a.apply(this);var o=this.updateCompoundBounds(),s=o.length>0?this.add(o):this;return e?s.rtrigger("style"):s.trigger("style"),this},updateMappers:function(e){var t=this._private.cy,i=t.style();if(e=!(!e&&void 0!==e),!t.styleEnabled())return this;i.updateMappers(this);var r=this.updateCompoundBounds(),n=r.length>0?this.add(r):this;return e?n.rtrigger("style"):n.trigger("style"),this},renderedCss:function(e){if(!this.cy().styleEnabled())return this;var t=this[0];if(t){var i=t.cy().style().getRenderedStyle(t);return void 0===e?i:i[e]}},css:function(t,i){var r=this.cy();if(!r.styleEnabled())return this;var n=r.style();if(e.is.plainObject(t)){var a=t;n.applyBypass(this,a,!1),((o=this.updateCompoundBounds()).length>0?this.add(o):this).rtrigger("style")}else if(e.is.string(t)){var o;if(void 0===i)return(s=this[0])?s._private.style[t].strValue:void 0;n.applyBypass(this,t,i,!1),((o=this.updateCompoundBounds()).length>0?this.add(o):this).rtrigger("style")}else if(void 0===t){var s;return(s=this[0])?n.getRawStyle(s):void 0}return this},removeCss:function(e){var t=this.cy();if(!t.styleEnabled())return this;var i=t.style();if(void 0===e)for(var r=0;r<this.length;r++){var n=this[r];i.removeAllBypasses(n,!1)}else{e=e.split(/\s+/);for(r=0;r<this.length;r++){n=this[r];i.removeBypasses(n,e,!1)}}var a=this.updateCompoundBounds();return(a.length>0?this.add(a):this).rtrigger("style"),this},show:function(){return this.css("display","element"),this},hide:function(){return this.css("display","none"),this},visible:function(){var e=this.cy();if(!e.styleEnabled())return!0;var t=this[0],i=e.hasCompoundNodes();if(t){var r=t._private.style;if("visible"!==r.visibility.value||"element"!==r.display.value)return!1;if("nodes"===t._private.group){if(!i)return!0;var n=t._private.data.parent?t.parents():null;if(n)for(var a=0;a<n.length;a++){var o=n[a]._private.style,s=o.visibility.value,l=o.display.value;if("visible"!==s||"element"!==l)return!1}return!0}var u=t._private.source,c=t._private.target;return u.visible()&&c.visible()}},hidden:function(){var e=this[0];if(e)return!e.visible()},effectiveOpacity:function(){var e=this.cy();if(!e.styleEnabled())return 1;var t=e.hasCompoundNodes(),i=this[0];if(i){var r=i._private,n=r.style.opacity.value;if(!t)return n;var a=r.data.parent?i.parents():null;if(a)for(var o=0;o<a.length;o++){n*=a[o]._private.style.opacity.value}return n}},transparent:function(){if(!this.cy().styleEnabled())return!1;var e=this[0],t=e.cy().hasCompoundNodes();return e?t?0===e.effectiveOpacity():0===e._private.style.opacity.value:void 0},isFullAutoParent:function(){if(!this.cy().styleEnabled())return!1;var e=this[0];if(e){var t="auto"===e._private.style.width.value,i="auto"===e._private.style.height.value;return e.isParent()&&t&&i}},backgrounding:function(){return!!this.cy().styleEnabled()&&!!this[0]._private.backgrounding}}),e.elesfn.bypass=e.elesfn.style=e.elesfn.css,e.elesfn.renderedStyle=e.elesfn.renderedCss,e.elesfn.removeBypass=e.elesfn.removeStyle=e.elesfn.removeCss}(cytoscape),function(e){"use strict";function t(t){return function(){var i=arguments,r=[];if(2===i.length){var n=i[0],a=i[1];this.bind(t.event,n,a)}else if(1===i.length){a=i[0];this.bind(t.event,a)}else if(0===i.length){for(var o=0;o<this.length;o++){var s=this[o],l=!t.ableField||s._private[t.ableField],u=s._private[t.field]!=t.value;if(t.overrideAble){var c=t.overrideAble(s);if(void 0!==c&&(l=c,!c))return this}l&&(s._private[t.field]=t.value,u&&r.push(s))}var d=e.Collection(this.cy(),r);d.updateStyle(),d.trigger(t.event)}return this}}function i(i){e.elesfn[i.field]=function(){var e=this[0];if(e){if(i.overrideField){var t=i.overrideField(e);if(void 0!==t)return t}return e._private[i.field]}},e.elesfn[i.on]=t({event:i.on,field:i.field,ableField:i.ableField,overrideAble:i.overrideAble,value:!0}),e.elesfn[i.off]=t({event:i.off,field:i.field,ableField:i.ableField,overrideAble:i.overrideAble,value:!1})}i({field:"locked",overrideField:function(e){return!!e.cy().autolock()||void 0},on:"lock",off:"unlock"}),i({field:"grabbable",overrideField:function(e){return!e.cy().autoungrabify()&&void 0},on:"grabify",off:"ungrabify"}),i({field:"selected",ableField:"selectable",overrideAble:function(e){return!e.cy().autounselectify()&&void 0},on:"select",off:"unselect"}),i({field:"selectable",overrideField:function(e){return!e.cy().autounselectify()&&void 0},on:"selectify",off:"unselectify"}),e.elesfn.deselect=e.elesfn.unselect,e.elesfn.grabbed=function(){var e=this[0];if(e)return e._private.grabbed},i({field:"active",on:"activate",off:"unactivate"}),e.elesfn.inactive=function(){var e=this[0];if(e)return!e._private.active}}(cytoscape),function(e){"use strict";function t(t){return function(i){for(var r=[],n=this._private.cy,a=0;a<this.length;a++){var o=this[a]._private[t.attr];o&&r.push(o)}return new e.Collection(n,r,{unique:!0}).filter(i)}}function i(t){return function(i){var r=[],n=this._private.cy,a=t||{};e.is.string(i)&&(i=n.$(i));for(var o=this._private.ids,s=i._private.ids,l=0;l<i.length;l++)for(var u=i[l]._private.edges,c=0;c<u.length;c++){var d=u[c],h=d._private.data,p=o[h.source]&&s[h.target],f=s[h.source]&&o[h.target];if(p||f){if(a.thisIs){if("source"===a.thisIs&&!p)continue;if("target"===a.thisIs&&!f)continue}r.push(d)}}return new e.Collection(n,r,{unique:!0})}}function r(t){return t=e.util.extend({},{codirected:!1},t),function(i){for(var r=this._private.cy,n=[],a=this.edges(),o=t,s=0;s<a.length;s++)for(var l=a[s],u=l.source()[0],c=u.id(),d=l.target()[0].id(),h=u._private.edges,p=0;p<h.length;p++){var f=h[p],g=f._private.data,v=g.target,y=g.source,m=v===d&&y===c,x=c===v&&d===y;(o.codirected&&m||!o.codirected&&(m||x))&&n.push(f)}return new e.Collection(r,n,{unique:!0}).filter(i)}}e.fn.eles({roots:function(t){for(var i=[],r=0;r<this.length;r++){var n=this[r];if(n.isNode())n.connectedEdges(function(){return this.data("target")===n.id()&&this.data("source")!==n.id()}).length>0||i.push(n)}return new e.Collection(this._private.cy,i,{unique:!0}).filter(t)},leaves:function(t){for(var i=[],r=0;r<this.length;r++){var n=this[r];if(n.isNode())n.connectedEdges(function(){return this.data("source")===n.id()&&this.data("target")!==n.id()}).length>0||i.push(n)}return new e.Collection(this._private.cy,i,{unique:!0}).filter(t)},outgoers:function(t){for(var i=[],r=0;r<this.length;r++){var n=this[r],a=n.id();if(n.isNode())for(var o=n._private.edges,s=0;s<o.length;s++){var l=o[s],u=l._private.data.source,c=l._private.data.target;u===a&&c!==a&&(i.push(l),i.push(l.target()[0]))}}return new e.Collection(this._private.cy,i,{unique:!0}).filter(t)},successors:function(t){for(var i=this,r=[],n={};;){var a=i.outgoers();if(0===a.length)break;for(var o=!1,s=0;s<a.length;s++){var l=a[s],u=l.id();n[u]||(n[u]=!0,r.push(l),o=!0)}if(!o)break;i=a}return new e.Collection(this._private.cy,r,{unique:!0}).filter(t)},incomers:function(t){for(var i=[],r=0;r<this.length;r++){var n=this[r],a=n.id();if(n.isNode())for(var o=n._private.edges,s=0;s<o.length;s++){var l=o[s],u=l._private.data.source;l._private.data.target===a&&u!==a&&(i.push(l),i.push(l.source()[0]))}}return new e.Collection(this._private.cy,i,{unique:!0}).filter(t)},predecessors:function(t){for(var i=this,r=[],n={};;){var a=i.incomers();if(0===a.length)break;for(var o=!1,s=0;s<a.length;s++){var l=a[s],u=l.id();n[u]||(n[u]=!0,r.push(l),o=!0)}if(!o)break;i=a}return new e.Collection(this._private.cy,r,{unique:!0}).filter(t)}}),e.fn.eles({neighborhood:function(t){for(var i=[],r=this._private.cy,n=this.nodes(),a=0;a<n.length;a++)for(var o=n[a],s=o.connectedEdges(),l=0;l<s.length;l++){var u=s[l],c=u.connectedNodes().not(o);c.length>0&&i.push(c[0]),i.push(u[0])}return new e.Collection(r,i,{unique:!0}).filter(t)},closedNeighborhood:function(e){return this.neighborhood().add(this).filter(e)},openNeighborhood:function(e){return this.neighborhood(e)}}),e.elesfn.neighbourhood=e.elesfn.neighborhood,e.elesfn.closedNeighbourhood=e.elesfn.closedNeighborhood,e.elesfn.openNeighbourhood=e.elesfn.openNeighborhood,e.fn.eles({source:function(e){var t,i=this[0];return i&&(t=i._private.source),t&&e?t.filter(e):t},target:function(e){var t,i=this[0];return i&&(t=i._private.target),t&&e?t.filter(e):t},sources:t({attr:"source"}),targets:t({attr:"target"})}),e.fn.eles({edgesWith:i(),edgesTo:i({thisIs:"source"})}),e.fn.eles({connectedEdges:function(t){for(var i=[],r=this._private.cy,n=0;n<this.length;n++){var a=this[n];if(a.isNode())for(var o=a._private.edges,s=0;s<o.length;s++){var l=o[s];i.push(l)}}return new e.Collection(r,i,{unique:!0}).filter(t)},connectedNodes:function(t){for(var i=[],r=this._private.cy,n=0;n<this.length;n++){var a=this[n];a.isEdge()&&(i.push(a.source()[0]),i.push(a.target()[0]))}return new e.Collection(r,i,{unique:!0}).filter(t)},parallelEdges:r(),codirectedEdges:r({codirected:!0})})}(cytoscape),function(e){"use strict";cytoscape.fn.eles({fit:function(){},center:function(){}})}(),function(e){"use strict";e.Minheap=function(t,i,r){return new e.Heap(t,i,e.Heap.minHeapComparator,r)},e.Maxheap=function(t,i,r){return new e.Heap(t,i,e.Heap.maxHeapComparator,r)},e.Heap=function(t,i,r,n){if(void 0!==r&&void 0!==i){void 0===n&&(n=e.Heap.idFn);var a,o,s,l=[],u={},c=[],d=0;for(s=(i=this.getArgumentAsCollection(i,t)).length,d=0;d<s;d+=1){if(l.push(n.call(t,i[d],d,i)),a=i[d].id(),u.hasOwnProperty(a))throw"ERROR: Multiple items with the same id found: "+a;u[a]=d,c.push(a)}for(this._private={cy:t,heap:l,pointers:u,elements:c,comparator:r,extractor:n,length:s},d=Math.floor(s/2);d>=0;d-=1)o=this.heapify(d);return o}},e.Heap.idFn=function(e){return e.id()},e.Heap.minHeapComparator=function(e,t){return e>=t},e.Heap.maxHeapComparator=function(e,t){return e<=t},e.fn.heap=function(t,i){for(var r in t){var n=t[r];e.Heap.prototype[r]=n}},e.heapfn=e.Heap.prototype,e.heapfn.size=function(){return this._private.length},e.heapfn.getArgumentAsCollection=function(t,i){var r;if(void 0===i&&(i=this._private.cy),e.is.elementOrCollection(t))r=t;else{for(var n=[],a=[].concat.apply([],[t]),o=0;o<a.length;o++){var s=a[o],l=i.getElementById(s);l.length>0&&n.push(l)}r=new e.Collection(i,n)}return r},e.heapfn.isHeap=function(){var e,t,i,r,n,a=this._private.heap,o=a.length,s=this._private.comparator;for(e=0;e<o;e+=1)if(i=(t=2*e+1)+1,r=!(t<o)||s(a[t],a[e]),n=!(i<o)||s(a[i],a[e]),!r||!n)return!1;return!0},e.heapfn.heapSwap=function(e,t){var i=this._private.heap,r=this._private.pointers,n=this._private.elements,a=i[e],o=n[e],s=n[e],l=n[t];i[e]=i[t],n[e]=n[t],r[s]=t,r[l]=e,i[t]=a,n[t]=o},e.heapfn.heapify=function(e,t){var i,r,n,a,o,s,l,u,c=!1;for(void 0===t&&(t=!0),i=(r=this._private.heap).length,l=this._private.comparator,n=e;!c;)t?(o=(a=2*n+1)+1,s=n,a<i&&!l(r[a],r[s])&&(s=a),o<i&&!l(r[o],r[s])&&(s=o),(c=s===n)||(this.heapSwap(s,n),n=s)):(s=n,(c=(u=Math.floor((n-1)/2))<0||l(r[s],r[u]))||(this.heapSwap(s,u),n=u))},e.heapfn.insert=function(e){var t,i,r,n,a,o=this.getArgumentAsCollection(e),s=o.length;for(a=0;a<s;a+=1){if(t=o[a],i=this._private.heap.length,r=this._private.extractor(t),n=t.id(),this._private.pointers.hasOwnProperty(n))throw"ERROR: Multiple items with the same id found: "+n;this._private.heap.push(r),this._private.elements.push(n),this._private.pointers[n]=i,this.heapify(i,!1)}this._private.length=this._private.heap.length},e.heapfn.getValueById=function(e){if(this._private.pointers.hasOwnProperty(e)){var t=this._private.pointers[e];return this._private.heap[t]}},e.heapfn.contains=function(e){for(var t=this.getArgumentAsCollection(e),i=0;i<t.length;i+=1){var r=t[i].id();if(!this._private.pointers.hasOwnProperty(r))return!1}return!0},e.heapfn.top=function(){if(this._private.length>0)return{value:this._private.heap[0],id:this._private.elements[0]}},e.heapfn.pop=function(){if(this._private.length>0){var e,t,i=this.top(),r=this._private.length-1;return this.heapSwap(0,r),e=this._private.elements[r],this._private.heap[r],t=e,this._private.heap.pop(),this._private.elements.pop(),this._private.length=this._private.heap.length,this._private.pointers[t]=void 0,this.heapify(0),i}},e.heapfn.findDirectionHeapify=function(e){var t=Math.floor((e-1)/2),i=this._private.heap,r=t<0||this._private.comparator(i[e],i[t]);this.heapify(e,r)},e.heapfn.edit=function(t,i){for(var r=this.getArgumentAsCollection(t),n=0;n<r.length;n+=1){var a=r[n].id(),o=this._private.pointers[a],s=this._private.heap[o];e.is.number(i)?this._private.heap[o]=i:e.is.fn(i)&&(this._private.heap[o]=i.call(this._private.cy,s,o)),this.findDirectionHeapify(o)}},e.heapfn.remove=function(e){for(var t=this.getArgumentAsCollection(e),i=0;i<t.length;i+=1){var r,n,a,o=t[i].id(),s=this._private.pointers[o],l=this._private.length-1;s!==l&&this.heapSwap(s,l),r=this._private.elements[l],n=this._private.heap[l],a=r,this._private.heap.pop(),this._private.elements.pop(),this._private.length=this._private.heap.length,this._private.pointers[a]=void 0,this.findDirectionHeapify(s)}return n}}(cytoscape),function(e){"use strict";function t(e){this.options=e,this.data={select:[void 0,void 0,void 0,void 0,0],renderer:this,cy:e.cy,container:e.cy.container(),canvases:new Array(t.CANVAS_LAYERS),contexts:new Array(t.CANVAS_LAYERS),canvasNeedsRedraw:new Array(t.CANVAS_LAYERS),bufferCanvases:new Array(t.BUFFER_COUNT),bufferContexts:new Array(t.CANVAS_LAYERS)},this.hoverData={down:null,last:null,downTime:null,triggerMode:null,dragging:!1,initialPan:[null,null],capture:!1},this.timeoutData={panTimeout:null},this.dragData={possibleDragElements:[]},this.touchData={start:null,capture:!1,startPosition:[null,null,null,null,null,null],singleTouchStartTime:null,singleTouchMoved:!0,now:[null,null,null,null,null,null],earlier:[null,null,null,null,null,null]},this.zoomData={freeToZoom:!1,lastPointerX:null},this.redraws=0,this.showFps=e.showFps,this.bindings=[],this.data.canvasContainer=document.createElement("div");var i=this.data.canvasContainer.style;i.position="absolute",i.zIndex="0",i.overflow="hidden",this.data.container.appendChild(this.data.canvasContainer);for(var r=0;r<t.CANVAS_LAYERS;r++)this.data.canvases[r]=document.createElement("canvas"),this.data.contexts[r]=this.data.canvases[r].getContext("2d"),this.data.canvases[r].style.position="absolute",this.data.canvases[r].setAttribute("data-id","layer"+r),this.data.canvases[r].style.zIndex=String(t.CANVAS_LAYERS-r),this.data.canvasContainer.appendChild(this.data.canvases[r]),this.data.canvasNeedsRedraw[r]=!1;this.data.topCanvas=this.data.canvases[0],this.data.canvases[t.NODE].setAttribute("data-id","layer"+t.NODE+"-node"),this.data.canvases[t.SELECT_BOX].setAttribute("data-id","layer"+t.SELECT_BOX+"-selectbox"),this.data.canvases[t.DRAG].setAttribute("data-id","layer"+t.DRAG+"-drag");for(r=0;r<t.BUFFER_COUNT;r++)this.data.bufferCanvases[r]=document.createElement("canvas"),this.data.bufferContexts[r]=this.data.bufferCanvases[r].getContext("2d"),this.data.bufferCanvases[r].style.position="absolute",this.data.bufferCanvases[r].setAttribute("data-id","buffer"+r),this.data.bufferCanvases[r].style.zIndex=String(-r-1),this.data.bufferCanvases[r].style.visibility="hidden";this.hideEdgesOnViewport=e.hideEdgesOnViewport,this.hideLabelsOnViewport=e.hideLabelsOnViewport,this.textureOnViewport=e.textureOnViewport,this.wheelSensitivity=e.wheelSensitivity,this.motionBlurEnabled=e.motionBlur,this.forcedPixelRatio=e.pixelRatio,this.motionBlur=!0,this.motionBlurOpacity=e.motionBlurOpacity,this.motionBlurTransparency=1-this.motionBlurOpacity,this.motionBlurPxRatio=1,this.mbPxRBlurry=1,this.minMbLowQualFrames=4,this.fullQualityMb=!1,this.clearedForMotionBlur=[],this.desktopTapThreshold=e.desktopTapThreshold,this.desktopTapThreshold2=e.desktopTapThreshold*e.desktopTapThreshold,this.touchTapThreshold=e.touchTapThreshold,this.touchTapThreshold2=e.touchTapThreshold*e.touchTapThreshold,this.tapholdDuration=500,this.load()}t.CANVAS_LAYERS=3,t.SELECT_BOX=0,t.DRAG=1,t.NODE=2,t.BUFFER_COUNT=3,t.TEXTURE_BUFFER=0,t.MOTIONBLUR_BUFFER_NODE=1,t.MOTIONBLUR_BUFFER_DRAG=2,t.panOrBoxSelectDelay=400;var i="undefined"!=typeof Path2D;for(var r in t.usePaths=function(){return i},t.prototype.notify=function(i){var r;r=e.is.array(i.type)?i.type:[i.type];for(var n=0;n<r.length;n++){var a=r[n];switch(a){case"destroy":return void this.destroy();case"add":case"remove":case"load":this.updateNodesCache(),this.updateEdgesCache();break;case"viewport":this.data.canvasNeedsRedraw[t.SELECT_BOX]=!0;break;case"style":this.updateCachedZSortedEles()}"load"!==a&&"resize"!==a||(this.invalidateContainerClientCoordsCache(),this.matchCanvasSize(this.data.container))}this.data.canvasNeedsRedraw[t.NODE]=!0,this.data.canvasNeedsRedraw[t.DRAG]=!0,this.redraw()},t.prototype.destroy=function(){this.destroyed=!0;for(var e=0;e<this.bindings.length;e++){var t=this.bindings[e];t.target.removeEventListener(t.event,t.handler,t.useCapture)}if(this.removeObserver&&this.removeObserver.disconnect(),this.labelCalcDiv)try{document.body.removeChild(this.labelCalcDiv)}catch(e){}},e.math)t.prototype[r]=e.math[r];e("renderer","canvas",t)}(cytoscape),function(e){"use strict";var t=e("renderer","canvas"),i=t.prototype,r=t.arrowShapes={};t.arrowShapeHeight=.3;var n=function(e,t,i,r,n,a,o,s){return i-n/2<=e&&e<=i+n/2&&r-a/2<=t&&t<=r+a/2},a=function(e,t,i,r,n){r=-r;var a=e*Math.cos(r)-t*Math.sin(r),o=(e*Math.sin(r)+t*Math.cos(r))*i;return{x:a*i+n.x,y:o+n.y}};r.arrow={_points:[-.15,-.3,0,0,.15,-.3],collide:function(t,i,n,a,o,s,l,u){var c=r.arrow._points;return e.math.pointInsidePolygon(t,i,c,n,a,o,s,l,u)},roughCollide:n,draw:function(e,t,i,n){for(var o=r.arrow._points,s=0;s<o.length/2;s++){var l=a(o[2*s],o[2*s+1],t,i,n);e.lineTo(l.x,l.y)}},spacing:function(e){return 0},gap:function(e){return 2*e._private.style.width.pxValue}},r.triangle=r.arrow,r["triangle-backcurve"]={_ctrlPt:[0,-.15],collide:function(t,i,n,a,o,s,l,u){var c=r.triangle._points;return e.math.pointInsidePolygon(t,i,c,n,a,o,s,l,u)},roughCollide:n,draw:function(e,t,i,n){for(var o,s=r.triangle._points,l=0;l<s.length/2;l++){var u=a(s[2*l],s[2*l+1],t,i,n);0===l&&(o=u),e.lineTo(u.x,u.y)}var c=this._ctrlPt,d=a(c[0],c[1],t,i,n);e.quadraticCurveTo(d.x,d.y,o.x,o.y)},spacing:function(e){return 0},gap:function(e){return 2*e._private.style.width.pxValue}},r["triangle-tee"]={_points:[-.15,-.3,0,0,.15,-.3,-.15,-.3],_pointsTee:[-.15,-.4,-.15,-.5,.15,-.5,.15,-.4],collide:function(t,i,n,a,o,s,l,u){var c=r["triangle-tee"]._points,d=r["triangle-tee"]._pointsTee;return e.math.pointInsidePolygon(t,i,d,n,a,o,s,l,u)||e.math.pointInsidePolygon(t,i,c,n,a,o,s,l,u)},roughCollide:n,draw:function(e,t,i,n){for(var o=r["triangle-tee"]._points,s=0;s<o.length/2;s++){var l=a(o[2*s],o[2*s+1],t,i,n);e.lineTo(l.x,l.y)}var u=r["triangle-tee"]._pointsTee,c=a(u[0],u[1],t,i,n);e.moveTo(c.x,c.y);for(s=0;s<u.length/2;s++){l=a(u[2*s],u[2*s+1],t,i,n);e.lineTo(l.x,l.y)}},spacing:function(e){return 0},gap:function(e){return 2*e._private.style.width.pxValue}},r["half-triangle-overshot"]={_points:[0,-.25,-.5,-.25,.5,.25],leavePathOpen:!0,matchEdgeWidth:!0,collide:function(t,i,r,n,a,o,s,l){var u=this._points;return e.math.pointInsidePolygon(t,i,u,r,n,a,o,s,l)},roughCollide:n,draw:function(e,t,i,r){for(var n=this._points,o=0;o<n.length/2;o++){var s=a(n[2*o],n[2*o+1],t,i,r);e.lineTo(s.x,s.y)}},spacing:function(e){return 0},gap:function(e){return 2*e._private.style.width.pxValue}},r.none={collide:function(e,t,i,r,n,a,o,s){return!1},roughCollide:function(e,t,i,r,n,a,o,s){return!1},draw:function(e){},spacing:function(e){return 0},gap:function(e){return 0}},r.circle={_baseRadius:.15,collide:function(e,t,i,n,a,o,s,l){if(a!=o){var u=(o+l)/(a+l);return t/=u,n/=u,Math.pow(i-e,2)+Math.pow(n-t,2)<=Math.pow((a+l)*r.circle._baseRadius,2)}return Math.pow(i-e,2)+Math.pow(n-t,2)<=Math.pow((a+l)*r.circle._baseRadius,2)},roughCollide:n,draw:function(e,t,i,n){e.arc(n.x,n.y,r.circle._baseRadius*t,0,2*Math.PI,!1)},spacing:function(e){return i.getArrowWidth(e._private.style.width.pxValue)*r.circle._baseRadius},gap:function(e){return 2*e._private.style.width.pxValue}},r.inhibitor={_points:[-.25,0,-.25,-.1,.25,-.1,.25,0],collide:function(t,i,n,a,o,s,l,u){var c=r.inhibitor._points;return e.math.pointInsidePolygon(t,i,c,n,a,o,s,l,u)},roughCollide:n,draw:function(e,t,i,n){for(var o=r.inhibitor._points,s=0;s<o.length/2;s++){var l=a(o[2*s],o[2*s+1],t,i,n);e.lineTo(l.x,l.y)}},spacing:function(e){return 1},gap:function(e){return 1}},r.tee=r.inhibitor,r.square={_points:[-.15,0,.15,0,.15,-.3,-.15,-.3],collide:function(t,i,n,a,o,s,l,u){var c=r.square._points;return e.math.pointInsidePolygon(t,i,c,n,a,o,s,l,u)},roughCollide:n,draw:function(e,t,i,n){for(var o=r.square._points,s=0;s<o.length/2;s++){var l=a(o[2*s],o[2*s+1],t,i,n);e.lineTo(l.x,l.y)}},spacing:function(e){return 0},gap:function(e){return 2*e._private.style.width.pxValue}},r.diamond={_points:[-.15,-.15,0,-.3,.15,-.15,0,0],collide:function(t,i,n,a,o,s,l,u){var c=r.diamond._points;return e.math.pointInsidePolygon(t,i,c,n,a,o,s,l,u)},roughCollide:n,draw:function(e,t,i,n){for(var o=r.diamond._points,s=0;s<o.length/2;s++){var l=a(o[2*s],o[2*s+1],t,i,n);e.lineTo(l.x,l.y)}},spacing:function(e){return 0},gap:function(e){return e._private.style.width.pxValue}}}(cytoscape),function(e){"use strict";var t=cytoscape("renderer","canvas").prototype;t.getCachedNodes=function(){var e=this.data,t=this.data.cy;return null==e.cache&&(e.cache={}),null==e.cache.cachedNodes&&(e.cache.cachedNodes=t.nodes()),e.cache.cachedNodes},t.updateNodesCache=function(){var e=this.data,t=this.data.cy;null==e.cache&&(e.cache={}),e.cache.cachedNodes=t.nodes()},t.getCachedEdges=function(){var e=this.data,t=this.data.cy;return null==e.cache&&(e.cache={}),null==e.cache.cachedEdges&&(e.cache.cachedEdges=t.edges()),e.cache.cachedEdges},t.updateEdgesCache=function(){var e=this.data,t=this.data.cy;null==e.cache&&(e.cache={}),e.cache.cachedEdges=t.edges()}}(),function(e){"use strict";var t=e("renderer","canvas"),i=t.prototype;i.projectIntoViewport=function(e,t){var i=this.findContainerClientCoords(),r=e-i[0],n=t-i[1];return r-=this.data.cy.pan().x,n-=this.data.cy.pan().y,[r/=this.data.cy.zoom(),n/=this.data.cy.zoom()]},i.findContainerClientCoords=function(){var e=this.data.container,t=this.containerBB=this.containerBB||e.getBoundingClientRect();return[t.left,t.top,t.right-t.left,t.bottom-t.top]},i.invalidateContainerClientCoordsCache=function(){this.containerBB=null},i.findNearestElement=function(i,r,n,a){var o=this,s=this.getCachedZSortedEles(),l=[],u=this.data.cy.zoom(),c=this.data.cy.hasCompoundNodes(),d=(a?24:8)/u,h=(a?8:2)/u;function p(e){var a=e.outerWidth()+2*h,s=e.outerHeight()+2*h,u=a/2,c=s/2,d=e._private.position;if(d.x-u<=i&&i<=d.x+u&&d.y-c<=r&&r<=d.y+c){var p=!n||e.visible()&&!e.transparent();if(n&&!p)return;var f=t.nodeShapes[o.getNodeShape(e)];e._private.style["border-width"].pxValue;f.checkPoint(i,r,0,a,s,d.x,d.y)&&l.push(e)}}function f(a){var s,u=a._private.rscratch,h=a._private.style,f=h.width.pxValue/2+d,g=f*f,v=2*f,y=a._private.source,m=a._private.target,x=!1,b=function(){return void 0!==s?s:n?a.visible()&&!a.transparent()?(s=!0,!0):(s=!1,!1):(s=!0,!0)};if("self"===u.edgeType||"compound"===u.edgeType)((x=e.math.inBezierVicinity(i,r,u.startX,u.startY,u.cp2ax,u.cp2ay,u.selfEdgeMidX,u.selfEdgeMidY,g))&&b()&&g>e.math.sqDistanceToQuadraticBezier(i,r,u.startX,u.startY,u.cp2ax,u.cp2ay,u.selfEdgeMidX,u.selfEdgeMidY)||(x=e.math.inBezierVicinity(i,r,u.selfEdgeMidX,u.selfEdgeMidY,u.cp2cx,u.cp2cy,u.endX,u.endY,g))&&b()&&g>e.math.sqDistanceToQuadraticBezier(i,r,u.selfEdgeMidX,u.selfEdgeMidY,u.cp2cx,u.cp2cy,u.endX,u.endY))&&l.push(a);else if("haystack"===u.edgeType){var w=h["haystack-radius"].value/2,_=m._private.position,E=m.width(),S=m.height(),D=y._private.position,k=y.width(),P=y.height(),T=D.x+u.source.x*k*w,C=D.y+u.source.y*P*w,M=_.x+u.target.x*E*w,B=_.y+u.target.y*S*w;(x=e.math.inLineVicinity(i,r,T,C,M,B,v))&&b()&&g>e.math.sqDistanceToFiniteLine(i,r,T,C,M,B)&&l.push(a)}else"straight"===u.edgeType?(x=e.math.inLineVicinity(i,r,u.startX,u.startY,u.endX,u.endY,v))&&b()&&g>e.math.sqDistanceToFiniteLine(i,r,u.startX,u.startY,u.endX,u.endY)&&l.push(a):"bezier"===u.edgeType&&(x=e.math.inBezierVicinity(i,r,u.startX,u.startY,u.cp2x,u.cp2y,u.endX,u.endY,g))&&b()&&g>e.math.sqDistanceToQuadraticBezier(i,r,u.startX,u.startY,u.cp2x,u.cp2y,u.endX,u.endY)&&l.push(a);if(x&&b()&&0===l.length||l[l.length-1]!==a){var N=t.arrowShapes[h["source-arrow-shape"].value],I=t.arrowShapes[h["target-arrow-shape"].value],O=(y=y||a._private.source,_=(m=m||a._private.target)._private.position,D=y._private.position,o.getArrowWidth(h.width.pxValue)),z=o.getArrowHeight(h.width.pxValue),L=O,R=z;(N.roughCollide(i,r,u.arrowStartX,u.arrowStartY,O,z,[u.arrowStartX-D.x,u.arrowStartY-D.y],d)&&N.collide(i,r,u.arrowStartX,u.arrowStartY,O,z,[u.arrowStartX-D.x,u.arrowStartY-D.y],d)||I.roughCollide(i,r,u.arrowEndX,u.arrowEndY,L,R,[u.arrowEndX-_.x,u.arrowEndY-_.y],d)&&I.collide(i,r,u.arrowEndX,u.arrowEndY,L,R,[u.arrowEndX-_.x,u.arrowEndY-_.y],d))&&l.push(a)}c&&l.length>0&&l[l.length-1]===a&&(p(y),p(m))}for(var g=s.length-1;g>=0;g--){var v=s[g];if(l.length>0)break;"nodes"===v._private.group?p(s[g]):f(s[g])}return l.length>0?l[l.length-1]:null},i.getAllInBox=function(i,r,n,a){var o,s=this.getCachedNodes(),l=this.getCachedEdges(),u=[],c=Math.min(i,n),d=Math.max(i,n),h=Math.min(r,a),p=Math.max(r,a);i=c,n=d,r=h,a=p;for(var f=0;f<s.length;f++){var g=s[f]._private.position,v=this.getNodeShape(s[f]),y=this.getNodeWidth(s[f]),m=this.getNodeHeight(s[f]),x=s[f]._private.style["border-width"].pxValue/2;t.nodeShapes[v].intersectBox(i,r,n,a,y,m,g.x,g.y,x)&&u.push(s[f])}for(f=0;f<l.length;f++){var b=l[f]._private.rscratch;if("self"==l[f]._private.rscratch.edgeType&&((o=e.math.boxInBezierVicinity(i,r,n,a,b.startX,b.startY,b.cp2ax,b.cp2ay,b.endX,b.endY,l[f]._private.style.width.pxValue))&&(2==o||1==o&&e.math.checkBezierInBox(i,r,n,a,b.startX,b.startY,b.cp2ax,b.cp2ay,b.endX,b.endY,l[f]._private.style.width.pxValue))||(o=e.math.boxInBezierVicinity(i,r,n,a,b.startX,b.startY,b.cp2cx,b.cp2cy,b.endX,b.endY,l[f]._private.style.width.pxValue))&&(2==o||1==o&&e.math.checkBezierInBox(i,r,n,a,b.startX,b.startY,b.cp2cx,b.cp2cy,b.endX,b.endY,l[f]._private.style.width.pxValue)))&&u.push(l[f]),"bezier"==b.edgeType&&(o=e.math.boxInBezierVicinity(i,r,n,a,b.startX,b.startY,b.cp2x,b.cp2y,b.endX,b.endY,l[f]._private.style.width.pxValue))&&(2==o||1==o&&e.math.checkBezierInBox(i,r,n,a,b.startX,b.startY,b.cp2x,b.cp2y,b.endX,b.endY,l[f]._private.style.width.pxValue))&&u.push(l[f]),"straight"==b.edgeType&&(o=e.math.boxInBezierVicinity(i,r,n,a,b.startX,b.startY,.5*b.startX+.5*b.endX,.5*b.startY+.5*b.endY,b.endX,b.endY,l[f]._private.style.width.pxValue))&&(2==o||1==o&&e.math.checkStraightEdgeInBox(i,r,n,a,b.startX,b.startY,b.endX,b.endY,l[f]._private.style.width.pxValue))&&u.push(l[f]),"haystack"==b.edgeType){var w=l[f].target()[0].position(),_=l[f].source()[0].position(),E=_.x+b.source.x,S=_.y+b.source.y,D=w.x+b.target.x,k=w.y+b.target.y;i<=E&&E<=n&&r<=S&&S<=a&&(i<=D&&D<=n&&r<=k&&k<=a)&&u.push(l[f])}}return u},i.getNodeWidth=function(e){return e.width()},i.getNodeHeight=function(e){return e.height()},i.getNodeShape=function(e){var t=e._private.style.shape.value;return e.isParent()?"rectangle"===t||"roundrectangle"===t?t:"rectangle":t},i.getNodePadding=function(e){var t=e._private.style["padding-left"].pxValue,i=e._private.style["padding-right"].pxValue,r=e._private.style["padding-top"].pxValue,n=e._private.style["padding-bottom"].pxValue;return isNaN(t)&&(t=0),isNaN(i)&&(i=0),isNaN(r)&&(r=0),isNaN(n)&&(n=0),{left:t,right:i,top:r,bottom:n}},i.zOrderSort=e.Collection.zIndexSort,i.updateCachedZSortedEles=function(){this.getCachedZSortedEles(!0)},i.getCachedZSortedEles=function(e){var t=this.lastZOrderCachedNodes,i=this.lastZOrderCachedEdges,r=this.getCachedNodes(),n=this.getCachedEdges(),a=[];if(!e&&t&&i&&t===r&&i===n)a=this.cachedZSortedEles;else{for(var o=0;o<r.length;o++){var s=r[o];(s.animated()||s.visible()&&!s.transparent())&&a.push(s)}for(o=0;o<n.length;o++){var l=n[o];(l.animated()||l.visible()&&!l.transparent())&&a.push(l)}a.sort(this.zOrderSort),this.cachedZSortedEles=a}return this.lastZOrderCachedNodes=r,this.lastZOrderCachedEdges=n,a},i.projectBezier=function(t){var i=e.math.qbezierAt,r=t._private.rscratch,n=t._private.rstyle.bezierPts=[];function a(e){n.push({x:i(e[0],e[2],e[4],.05),y:i(e[1],e[3],e[5],.05)}),n.push({x:i(e[0],e[2],e[4],.25),y:i(e[1],e[3],e[5],.25)}),n.push({x:i(e[0],e[2],e[4],.4),y:i(e[1],e[3],e[5],.4)});var t={x:i(e[0],e[2],e[4],.5),y:i(e[1],e[3],e[5],.5)};n.push(t),"self"===r.edgeType||"compound"===r.edgeType?(r.midX=r.selfEdgeMidX,r.midY=r.selfEdgeMidY):(r.midX=t.x,r.midY=t.y),n.push({x:i(e[0],e[2],e[4],.6),y:i(e[1],e[3],e[5],.6)}),n.push({x:i(e[0],e[2],e[4],.75),y:i(e[1],e[3],e[5],.75)}),n.push({x:i(e[0],e[2],e[4],.95),y:i(e[1],e[3],e[5],.95)})}"self"===r.edgeType?(a([r.startX,r.startY,r.cp2ax,r.cp2ay,r.selfEdgeMidX,r.selfEdgeMidY]),a([r.selfEdgeMidX,r.selfEdgeMidY,r.cp2cx,r.cp2cy,r.endX,r.endY])):"bezier"===r.edgeType&&a([r.startX,r.startY,r.cp2x,r.cp2y,r.endX,r.endY])},i.recalculateNodeLabelProjection=function(e){var t=e._private.style.content.strValue;if(t&&!t.match(/^\s+$/)){var i,r,n=e.outerWidth(),a=e.outerHeight(),o=e._private.position,s=e._private.style["text-halign"].strValue,l=e._private.style["text-valign"].strValue,u=e._private.rscratch,c=e._private.rstyle;switch(s){case"left":i=o.x-n/2;break;case"right":i=o.x+n/2;break;default:i=o.x}switch(l){case"top":r=o.y-a/2;break;case"bottom":r=o.y+a/2;break;default:r=o.y}u.labelX=i,u.labelY=r,c.labelX=i,c.labelY=r,this.applyLabelDimensions(e)}},i.recalculateEdgeLabelProjection=function(t){var i=t._private.style.content.strValue;if(i&&!i.match(/^\s+$/)){var r,n,a,o,s=t._private,l=s.rscratch,u=s.rstyle;if("self"==l.edgeType)a=l.selfEdgeMidX,o=l.selfEdgeMidY;else if("straight"==l.edgeType)a=(l.startX+l.endX)/2,o=(l.startY+l.endY)/2;else if("bezier"==l.edgeType)a=e.math.qbezierAt(l.startX,l.cp2x,l.endX,.5),o=e.math.qbezierAt(l.startY,l.cp2y,l.endY,.5);else if("haystack"==l.edgeType){var c=l.haystackPts;a=(c[0]+c[2])/2,o=(c[1]+c[3])/2}r=a,n=o,l.labelX=r,l.labelY=n,u.labelX=r,u.labelY=n,this.applyLabelDimensions(t)}},i.applyLabelDimensions=function(e){var t=e._private.rscratch,i=e._private.rstyle,r=this.getLabelText(e),n=this.calculateLabelDimensions(e,r);i.labelWidth=n.width,t.labelWidth=n.width,i.labelHeight=n.height,t.labelHeight=n.height},i.getLabelText=function(e){var t=e._private.style,i=e._private.style.content.strValue,r=t["text-transform"].value,n=e._private.rscratch;if("none"==r||("uppercase"==r?i=i.toUpperCase():"lowercase"==r&&(i=i.toLowerCase())),"wrap"===t["text-wrap"].value){if(n.labelWrapKey===n.labelKey)return n.labelWrapCachedText;for(var a=i.split("\n"),o=t["text-max-width"].pxValue,s=[],l=0;l<a.length;l++){var u=a[l];if(this.calculateLabelDimensions(e,u,"line="+u).width>o){for(var c=u.split(/\s+/),d="",h=0;h<c.length;h++){var p=c[h],f=0===d.length?p:d+" "+p;this.calculateLabelDimensions(e,f,"testLine="+f).width<=o?d+=p+" ":(s.push(d),d=p+" ")}d.match(/^\s+$/)||s.push(d)}else s.push(u)}n.labelWrapCachedLines=s,n.labelWrapCachedText=i=s.join("\n"),n.labelWrapKey=n.labelKey}return i},i.calculateLabelDimensions=function(e,t,i){var r=e._private.style,n=r["font-style"].strValue,a=r["font-size"].pxValue+"px",o=r["font-family"].strValue,s=r["font-weight"].strValue,l=e._private.labelKey;i&&(l+="$@$"+i);var u=this.labelDimCache||(this.labelDimCache={});if(u[l])return u[l];var c=this.labelCalcDiv;c||(c=this.labelCalcDiv=document.createElement("div"),document.body.appendChild(c));var d=c.style;return d.fontFamily=o,d.fontStyle=n,d.fontSize=a,d.fontWeight=s,d.position="absolute",d.left="-9999px",d.top="-9999px",d.zIndex="-1",d.visibility="hidden",d.pointerEvents="none",d.padding="0",d.lineHeight="1","wrap"===r["text-wrap"].value?d.whiteSpace="pre":d.whiteSpace="normal",c.textContent=t,u[l]={width:c.clientWidth,height:c.clientHeight},u[l]},i.recalculateRenderedStyle=function(e){for(var t=[],i=[],r={},n=0;n<e.length;n++){var a=e[n],o=a._private,s=o.style,l=o.rscratch,u=o.rstyle,c=o.data.id,d=null!=l.boundingBoxKey&&o.boundingBoxKey===l.boundingBoxKey,h=null!=l.labelKey&&o.labelKey===l.labelKey,p=d&&h;if("nodes"===a._private.group){var f=o.position,g=null!=u.nodeX&&null!=u.nodeY&&f.x===u.nodeX&&f.y===u.nodeY,v=null!=u.nodeW&&u.nodeW===s.width.pxValue,y=null!=u.nodeH&&u.nodeH===s.height.pxValue;g&&p&&v&&y||i.push(a),u.nodeX=f.x,u.nodeY=f.y,u.nodeW=s.width.pxValue,u.nodeH=s.height.pxValue}else{var m=a._private.source._private.position,x=a._private.target._private.position,b=null!=u.srcX&&null!=u.srcY&&m.x===u.srcX&&m.y===u.srcY,w=null!=u.tgtX&&null!=u.tgtY&&x.x===u.tgtX&&x.y===u.tgtY;if(!(b&&w)||!p)if("bezier"===o.style["curve-style"].value){if(!r[c]){t.push(a),r[c]=!0;var _=a.parallelEdges();for(n=0;n<_.length;n++){var E=_[n],S=E._private.data.id;r[S]||(t.push(E),r[S]=!0)}}}else t.push(a);u.srcX=m.x,u.srcY=m.y,u.tgtX=x.x,u.tgtY=x.y}l.boundingBoxKey=o.boundingBoxKey,l.labelKey=o.labelKey}this.recalculateEdgeProjections(t),this.recalculateLabelProjections(i,t)},i.recalculateLabelProjections=function(e,t){for(var i=0;i<e.length;i++)this.recalculateNodeLabelProjection(e[i]);for(i=0;i<t.length;i++)this.recalculateEdgeLabelProjection(t[i])},i.recalculateEdgeProjections=function(e){this.findEdgeControlPoints(e)},i.findEdgeControlPoints=function(i){if(i&&0!==i.length){for(var r,n,a,o,s,l,u,c=this.data.cy.hasCompoundNodes(),d={},h=[],p=[],f=0;f<i.length;f++){var g=(Be=i[f])._private.style,v="unbundled-bezier"===g["curve-style"].value;if("none"!==g.display.value)if("haystack"!==g["curve-style"].value){var y=Be._private.data.source,m=Be._private.data.target;r=y>m?m+"-"+y:y+"-"+m,v&&(r="unbundled"+Be._private.data.id),null==d[r]&&(d[r]=[],h.push(r)),d[r].push(Be),v&&(d[r].hasUnbundled=!0)}else p.push(Be)}for(var x=0;x<h.length;x++){var b=d[r=h[x]];if(b.sort(function(e,t){return e._private.index-t._private.index}),Le=b[0]._private.source,Re=b[0]._private.target,Le._private.data.id>Re._private.data.id){var w=Le;Le=Re,Re=w}if(Ve=Le._private.position,Ae=Re._private.position,Xe=this.getNodeWidth(Le),Ye=this.getNodeHeight(Le),Fe=this.getNodeWidth(Re),qe=this.getNodeHeight(Re),n=t.nodeShapes[this.getNodeShape(Le)],a=t.nodeShapes[this.getNodeShape(Re)],o=Le._private.style["border-width"].pxValue,s=Re._private.style["border-width"].pxValue,u=!1,b.length>1&&Le!==Re||b.hasUnbundled){var _=n.intersectLine(Ve.x,Ve.y,Xe,Ye,Ae.x,Ae.y,o/2),E=a.intersectLine(Ae.x,Ae.y,Fe,qe,Ve.x,Ve.y,s/2),S={x1:_[0],x2:E[0],y1:_[1],y2:E[1]},D=E[1]-_[1],k=E[0]-_[0],P=Math.sqrt(k*k+D*D),T={x:k,y:D},C={x:T.x/P,y:T.y/P};l={x:-C.y,y:C.x},(a.checkPoint(_[0],_[1],s/2,Fe,qe,Ae.x,Ae.y)||n.checkPoint(E[0],E[1],o/2,Xe,Ye,Ve.x,Ve.y))&&(l={},u=!0)}for(f=0;f<b.length;f++){var M=(Oe=(Be=b[f])._private.rscratch).lastEdgeIndex,B=f,N=Oe.lastNumEdges,I=b.length,O=Be._private.style,z=O["control-point-step-size"].pxValue,L=void 0!==O["control-point-distance"]?O["control-point-distance"].pxValue:void 0,R=O["control-point-weight"].value,V=(v="unbundled-bezier"===O["curve-style"].value,Be._private.source!==Le);V&&v&&(L*=-1);var A=Oe.lastSrcCtlPtX,X=Ve.x,F=Oe.lastSrcCtlPtY,Y=Ve.y,q=Oe.lastSrcCtlPtW,j=Le.outerWidth(),$=Oe.lastSrcCtlPtH,W=Le.outerHeight(),H=Oe.lastTgtCtlPtX,Z=Ae.x,U=Oe.lastTgtCtlPtY,G=Ae.y,K=Oe.lastTgtCtlPtW,J=Re.outerWidth(),Q=Oe.lastTgtCtlPtH,ee=Re.outerHeight(),te=Oe.lastW,ie=O["control-point-step-size"].pxValue;if(Oe.badBezier=!!u,A!==X||F!==Y||q!==j||$!==W||H!==Z||U!==G||K!==J||Q!==ee||te!==ie||!(M===B&&N===I||v)){if(Oe.lastSrcCtlPtX=X,Oe.lastSrcCtlPtY=Y,Oe.lastSrcCtlPtW=j,Oe.lastSrcCtlPtH=W,Oe.lastTgtCtlPtX=Z,Oe.lastTgtCtlPtY=G,Oe.lastTgtCtlPtW=J,Oe.lastTgtCtlPtH=ee,Oe.lastEdgeIndex=B,Oe.lastNumEdges=I,Oe.lastWidth=ie,Le===Re){Oe.edgeType="self";var re=f,ne=z;v&&(re=0,ne=L),Oe.cp2ax=Ve.x,Oe.cp2ay=Ve.y-(1+Math.pow(Ye,1.12)/100)*ne*(re/3+1),Oe.cp2cx=Ve.x-(1+Math.pow(Xe,1.12)/100)*ne*(re/3+1),Oe.cp2cy=Ve.y,Oe.selfEdgeMidX=(Oe.cp2ax+Oe.cp2cx)/2,Oe.selfEdgeMidY=(Oe.cp2ay+Oe.cp2cy)/2}else if(c&&(Le.isParent()||Le.isChild()||Re.isParent()||Re.isChild())&&(Le.parents().anySame(Re)||Re.parents().anySame(Le))){Oe.edgeType="compound",Oe.badBezier=!1;re=f,ne=z;v&&(re=0,ne=L);var ae={x:Ve.x-Xe/2,y:Ve.y-Ye/2},oe={x:Ae.x-Fe/2,y:Ae.y-qe/2};Oe.cp2ax=ae.x,Oe.compoundStretchA=Math.max(1,Math.log(.01*Xe)),Oe.cp2ay=ae.y-(1+Math.pow(50,1.12)/100)*ne*(re/3+1)*Oe.compoundStretchA,Oe.compoundStretchB=Math.max(1,Math.log(.01*Fe)),Oe.cp2cx=oe.x-(1+Math.pow(50,1.12)/100)*ne*(re/3+1)*Oe.compoundStretchB,Oe.cp2cy=oe.y,Oe.selfEdgeMidX=(Oe.cp2ax+Oe.cp2cx)/2,Oe.selfEdgeMidY=(Oe.cp2ay+Oe.cp2cy)/2}else if(b.length%2!=1||f!==Math.floor(b.length/2)||v){var se,le=(.5-b.length/2+f)*z,ue=e.math.signum(le),ce=void 0!==(se=v?L:void 0!==L?ue*L:void 0)?se:le,de=1-R,he=R;V&&(de=R,he=1-R);var pe={x:S.x1*de+S.x2*he,y:S.y1*de+S.y2*he};Oe.edgeType="bezier",Oe.cp2x=pe.x+l.x*ce,Oe.cp2y=pe.y+l.y*ce}else Oe.edgeType="straight";this.findEndpoints(Be);var fe=!e.is.number(Oe.startX)||!e.is.number(Oe.startY),ge=!e.is.number(Oe.arrowStartX)||!e.is.number(Oe.arrowStartY),ve=!e.is.number(Oe.endX)||!e.is.number(Oe.endY),ye=!e.is.number(Oe.arrowEndX)||!e.is.number(Oe.arrowEndY),me=3*(this.getArrowWidth(Be._private.style.width.pxValue)*t.arrowShapeHeight),xe=e.math.distance({x:Oe.cp2x,y:Oe.cp2y},{x:Oe.startX,y:Oe.startY}),be=xe<me,we=e.math.distance({x:Oe.cp2x,y:Oe.cp2y},{x:Oe.endX,y:Oe.endY}),_e=we<me;if("bezier"===Oe.edgeType){var Ee=!1;if(fe||ge||be){Ee=!0;var Se={x:Oe.cp2x-Ve.x,y:Oe.cp2y-Ve.y},De=Math.sqrt(Se.x*Se.x+Se.y*Se.y),ke={x:Se.x/De,y:Se.y/De},Pe=Math.max(Xe,Ye),Te={x:Oe.cp2x+2*ke.x*Pe,y:Oe.cp2y+2*ke.y*Pe},Ce=n.intersectLine(Ve.x,Ve.y,Xe,Ye,Te.x,Te.y,o/2);be?(Oe.cp2x=Oe.cp2x+ke.x*(me-xe),Oe.cp2y=Oe.cp2y+ke.y*(me-xe)):(Oe.cp2x=Ce[0]+ke.x*me,Oe.cp2y=Ce[1]+ke.y*me)}if(ve||ye||_e){Ee=!0;Se={x:Oe.cp2x-Ae.x,y:Oe.cp2y-Ae.y},De=Math.sqrt(Se.x*Se.x+Se.y*Se.y),ke={x:Se.x/De,y:Se.y/De},Pe=Math.max(Xe,Ye),Te={x:Oe.cp2x+2*ke.x*Pe,y:Oe.cp2y+2*ke.y*Pe};var Me=a.intersectLine(Ae.x,Ae.y,Fe,qe,Te.x,Te.y,s/2);_e?(Oe.cp2x=Oe.cp2x+ke.x*(me-we),Oe.cp2y=Oe.cp2y+ke.y*(me-we)):(Oe.cp2x=Me[0]+ke.x*me,Oe.cp2y=Me[1]+ke.y*me)}Ee&&this.findEndpoints(Be)}else"straight"===Oe.edgeType&&(Oe.midX=(X+Z)/2,Oe.midY=(Y+G)/2);this.projectBezier(Be),this.recalculateEdgeLabelProjection(Be)}}}for(f=0;f<p.length;f++){var Be,Ne=(Be=p[f])._private,Ie=Ne.rscratch,Oe=Ie;if(!Ie.haystack){var ze=2*Math.random()*Math.PI;Ie.source={x:Math.cos(ze),y:Math.sin(ze)};ze=2*Math.random()*Math.PI;Ie.target={x:Math.cos(ze),y:Math.sin(ze)}}var Le=Ne.source,Re=Ne.target,Ve=Le._private.position,Ae=Re._private.position,Xe=Le.width(),Fe=Re.width(),Ye=Le.height(),qe=Re.height(),je=(Pe=g["haystack-radius"].value)/2;Oe.haystackPts=[Oe.source.x*Xe*je+Ve.x,Oe.source.y*Ye*je+Ve.y,Oe.target.x*Fe*je+Ae.x,Oe.target.y*qe*je+Ae.y],Ie.edgeType="haystack",Ie.haystack=!0,this.recalculateEdgeLabelProjection(Be)}return d}},i.findEndpoints=function(i){var r,n=i.source()[0],a=i.target()[0],o=i._private.style["target-arrow-shape"].value,s=i._private.style["source-arrow-shape"].value,l=a._private.style["border-width"].pxValue,u=n._private.style["border-width"].pxValue,c=i._private.rscratch;if("self"==c.edgeType||"compound"==c.edgeType){var d=[c.cp2cx,c.cp2cy];r=t.nodeShapes[this.getNodeShape(a)].intersectLine(a._private.position.x,a._private.position.y,this.getNodeWidth(a),this.getNodeHeight(a),d[0],d[1],l/2);var h=e.math.shortenIntersection(r,d,t.arrowShapes[o].spacing(i)),p=e.math.shortenIntersection(r,d,t.arrowShapes[o].gap(i));c.endX=p[0],c.endY=p[1],c.arrowEndX=h[0],c.arrowEndY=h[1];d=[c.cp2ax,c.cp2ay];r=t.nodeShapes[this.getNodeShape(n)].intersectLine(n._private.position.x,n._private.position.y,this.getNodeWidth(n),this.getNodeHeight(n),d[0],d[1],u/2);var f=e.math.shortenIntersection(r,d,t.arrowShapes[s].spacing(i)),g=e.math.shortenIntersection(r,d,t.arrowShapes[s].gap(i));c.startX=g[0],c.startY=g[1],c.arrowStartX=f[0],c.arrowStartY=f[1]}else if("straight"==c.edgeType){0===(r=t.nodeShapes[this.getNodeShape(a)].intersectLine(a._private.position.x,a._private.position.y,this.getNodeWidth(a),this.getNodeHeight(a),n.position().x,n.position().y,l/2)).length?c.noArrowPlacement=!0:c.noArrowPlacement=!1;h=e.math.shortenIntersection(r,[n.position().x,n.position().y],t.arrowShapes[o].spacing(i)),p=e.math.shortenIntersection(r,[n.position().x,n.position().y],t.arrowShapes[o].gap(i));c.endX=p[0],c.endY=p[1],c.arrowEndX=h[0],c.arrowEndY=h[1],0===(r=t.nodeShapes[this.getNodeShape(n)].intersectLine(n._private.position.x,n._private.position.y,this.getNodeWidth(n),this.getNodeHeight(n),a.position().x,a.position().y,u/2)).length?c.noArrowPlacement=!0:c.noArrowPlacement=!1;f=e.math.shortenIntersection(r,[a.position().x,a.position().y],t.arrowShapes[s].spacing(i)),g=e.math.shortenIntersection(r,[a.position().x,a.position().y],t.arrowShapes[s].gap(i));c.startX=g[0],c.startY=g[1],c.arrowStartX=f[0],c.arrowStartY=f[1],e.is.number(c.startX)&&e.is.number(c.startY)&&e.is.number(c.endX)&&e.is.number(c.endY)?c.badLine=!1:c.badLine=!0}else if("bezier"==c.edgeType){d=[c.cp2x,c.cp2y];r=t.nodeShapes[this.getNodeShape(a)].intersectLine(a._private.position.x,a._private.position.y,this.getNodeWidth(a),this.getNodeHeight(a),d[0],d[1],l/2);h=e.math.shortenIntersection(r,d,t.arrowShapes[o].spacing(i)),p=e.math.shortenIntersection(r,d,t.arrowShapes[o].gap(i));c.endX=p[0],c.endY=p[1],c.arrowEndX=h[0],c.arrowEndY=h[1],r=t.nodeShapes[this.getNodeShape(n)].intersectLine(n._private.position.x,n._private.position.y,this.getNodeWidth(n),this.getNodeHeight(n),d[0],d[1],u/2);f=e.math.shortenIntersection(r,d,t.arrowShapes[s].spacing(i)),g=e.math.shortenIntersection(r,d,t.arrowShapes[s].gap(i));c.startX=g[0],c.startY=g[1],c.arrowStartX=f[0],c.arrowStartY=f[1]}else if(c.isArcEdge)return},i.findEdges=function(e){for(var t=this.getCachedEdges(),i={},r=[],n=0;n<e.length;n++)i[e[n]._private.data.id]=e[n];for(n=0;n<t.length;n++)(i[t[n]._private.data.source]||i[t[n]._private.data.target])&&r.push(t[n]);return r},i.getArrowWidth=i.getArrowHeight=function(e){var t=this.arrowWidthCache=this.arrowWidthCache||{},i=t[e];return i||(i=Math.max(Math.pow(13.37*e,.9),29),t[e]=i,i)}}(cytoscape),function(e){"use strict";var t=cytoscape("renderer","canvas"),i=t.prototype;i.drawEdge=function(e,i,r){var n=i._private.rscratch,a=t.usePaths();if(!n.badBezier&&("bezier"!==n.edgeType&&"straight"!==n.edgeType||!isNaN(n.startX))){var o=i._private.style;if(!(o.width.pxValue<=0)){var s,l,u=o["overlay-padding"].pxValue,c=o["overlay-opacity"].value,d=o["overlay-color"].value;if(r){if(0===c)return;this.strokeStyle(e,d[0],d[1],d[2],c),e.lineCap="round","self"!=i._private.rscratch.edgeType||a||(e.lineCap="butt")}else{var h=o["line-color"].value;this.strokeStyle(e,h[0],h[1],h[2],o.opacity.value),e.lineCap="butt"}s=i._private.source,l=i._private.target;var p=o.width.pxValue+(r?2*u:0),f=r?"solid":o["line-style"].value;e.lineWidth=p;var g=o["shadow-blur"].pxValue,v=o["shadow-opacity"].value,y=o["shadow-color"].value,m=o["shadow-offset-x"].pxValue,x=o["shadow-offset-y"].pxValue;if(this.shadowStyle(e,y,r?0:v,g,m,x),"haystack"===n.edgeType)this.drawStyledEdge(i,e,n.haystackPts,f,p);else if("self"===n.edgeType||"compound"===n.edgeType){var b=[(E=i._private.rscratch).startX,E.startY,E.cp2ax,E.cp2ay,E.selfEdgeMidX,E.selfEdgeMidY,E.selfEdgeMidX,E.selfEdgeMidY,E.cp2cx,E.cp2cy,E.endX,E.endY];this.drawStyledEdge(i,e,b,f,p)}else if("straight"===n.edgeType){var w=l._private.position.x-s._private.position.x,_=l._private.position.y-s._private.position.y;if(w*(n.endX-n.startX)+_*(n.endY-n.startY)<0)n.straightEdgeTooShort=!0;else{var E=n;this.drawStyledEdge(i,e,[E.startX,E.startY,E.endX,E.endY],f,p),n.straightEdgeTooShort=!1}}else{E=n;this.drawStyledEdge(i,e,[E.startX,E.startY,E.cp2x,E.cp2y,E.endX,E.endY],f,p)}"haystack"===n.edgeType?this.drawArrowheads(e,i,r):!0!==n.noArrowPlacement&&void 0!==n.startX&&this.drawArrowheads(e,i,r),this.shadowStyle(e,"transparent",0)}}},i.drawStyledEdge=function(e,i,r,n,a){var o,s=e._private.rscratch,l=i,u=!1,c=t.usePaths();if(c){for(var d=r,h=s.pathCacheKey&&d.length===s.pathCacheKey.length,p=0;h&&p<d.length;p++)s.pathCacheKey[p]!==d[p]&&(h=!1);h?(o=i=s.pathCache,u=!0):(o=i=new Path2D,s.pathCacheKey=d,s.pathCache=o)}if(l.setLineDash)switch(n){case"dotted":l.setLineDash([1,1]);break;case"dashed":l.setLineDash([6,3]);break;case"solid":l.setLineDash([])}u||(i.beginPath&&i.beginPath(),i.moveTo(r[0],r[1]),6!==r.length||s.badBezier?12!==r.length||s.badBezier?4!==r.length||s.badLine||i.lineTo(r[2],r[3]):(i.quadraticCurveTo(r[2],r[3],r[4],r[5]),i.quadraticCurveTo(r[8],r[9],r[10],r[11])):i.quadraticCurveTo(r[2],r[3],r[4],r[5])),i=l,c?i.stroke(o):i.stroke(),i.setLineDash&&i.setLineDash([])},i.drawArrowheads=function(e,t,i){if(!i){var r,n,a,o,s,l,u=t._private.rscratch,c=this,d="haystack"===u.edgeType,h=t.source().position(),p=t.target().position();d?(a=u.haystackPts[0],o=u.haystackPts[1],s=u.haystackPts[2],l=u.haystackPts[3]):(a=u.arrowStartX,o=u.arrowStartY,s=u.arrowEndX,l=u.arrowEndY);var f=t._private.style;r=a-h.x,n=o-h.y,d||isNaN(a)||isNaN(o)||isNaN(r)||isNaN(n)||y("source",a,o,r,n);var g=u.midX,v=u.midY;d&&(g=(a+s)/2,v=(o+l)/2),r=a-s,n=o-l,"self"===u.edgeType&&(r=1,n=-1),isNaN(g)||isNaN(v)||y("mid-target",g,v,r,n),r*=-1,n*=-1,isNaN(g)||isNaN(v)||y("mid-source",g,v,r,n),r=s-p.x,n=l-p.y,d||isNaN(s)||isNaN(l)||isNaN(r)||isNaN(n)||y("target",s,l,r,n)}function y(i,r,n,a,o){var s=f[i+"-arrow-shape"].value;if("none"!==s){var l=e.globalCompositeOperation,u="hollow"===f[i+"-arrow-fill"].value?"both":"filled",d=f[i+"-arrow-fill"].value;"half-triangle-overshot"===s&&(d="hollow",u="hollow"),1===f.opacity.value&&"hollow"!==d||(e.globalCompositeOperation="destination-out",c.fillStyle(e,255,255,255,1),c.strokeStyle(e,255,255,255,1),c.drawArrowShape(t,i,e,u,f.width.pxValue,f[i+"-arrow-shape"].value,r,n,a,o),e.globalCompositeOperation=l);var h=f[i+"-arrow-color"].value;c.fillStyle(e,h[0],h[1],h[2],f.opacity.value),c.strokeStyle(e,h[0],h[1],h[2],f.opacity.value),c.drawArrowShape(t,i,e,d,f.width.pxValue,f[i+"-arrow-shape"].value,r,n,a,o)}}},i.drawArrowShape=function(e,i,r,n,a,o,s,l,u,c){var d,h=t.usePaths(),p=e._private.rscratch,f=!1,g=r,v={x:s,y:l},y=Math.asin(c/Math.sqrt(u*u+c*c));u<0?y+=Math.PI/2:y=-(Math.PI/2+y);var m=this.getArrowWidth(a),x=t.arrowShapes[o];if(h){var b=m+"$"+o+"$"+y+"$"+s+"$"+l;p.arrowPathCacheKey=p.arrowPathCacheKey||{},p.arrowPathCache=p.arrowPathCache||{},p.arrowPathCacheKey[i]===b?(d=r=p.arrowPathCache[i],f=!0):(d=r=new Path2D,p.arrowPathCacheKey[i]=b,p.arrowPathCache[i]=d)}r.beginPath&&r.beginPath(),f||x.draw(r,m,y,v),!x.leavePathOpen&&r.closePath&&r.closePath(),r=g,"filled"!==n&&"both"!==n||(h?r.fill(d):r.fill()),"hollow"!==n&&"both"!==n||(r.lineWidth=x.matchEdgeWidth?a:1,r.lineJoin="miter",h?r.stroke(d):r.stroke())}}(),function(e){"use strict";var t=cytoscape("renderer","canvas"),i=t.prototype;i.getCachedImage=function(e,t){var i=this.imageCache=this.imageCache||{};if(i[e]&&i[e].image)return i[e].image;var r=(i[e]=i[e]||{}).image=new Image;return r.addEventListener("load",t),r.src=e,r},i.safeDrawImage=function(e,i,r,n,a,o,s,l,u,c){var d=this;try{e.drawImage(i,r,n,a,o,s,l,u,c)}catch(e){d.data.canvasNeedsRedraw[t.NODE]=!0,d.data.canvasNeedsRedraw[t.DRAG]=!0,d.drawingImage=!0,d.redraw()}},i.drawInscribedImage=function(e,i,r){var n=this,a=r._private.position.x,o=r._private.position.y,s=r._private.style,l=s["background-fit"].value,u=s["background-position-x"],c=s["background-position-y"],d=s["background-repeat"].value,h=r.width(),p=r.height(),f=r._private.rscratch,g="node"===s["background-clip"].value,v=s["background-image-opacity"].value,y=i.width,m=i.height;if(0!==y&&0!==m){var x=s["background-width"];"auto"!==x.value&&(y="%"===x.units?x.value/100*h:x.pxValue);var b=s["background-height"];if("auto"!==b.value&&(m="%"===b.units?b.value/100*p:b.pxValue),0!==y&&0!==m){if("contain"===l)y*=w=Math.min(h/y,p/m),m*=w;else if("cover"===l){var w;y*=w=Math.max(h/y,p/m),m*=w}var _=a-h/2;"%"===u.units?_+=(h-y)*u.value/100:_+=u.pxValue;var E=o-p/2;"%"===c.units?E+=(p-m)*c.value/100:E+=c.pxValue,f.pathCache&&(_-=a,E-=o,a=0,o=0);var S=e.globalAlpha;if(e.globalAlpha=v,"no-repeat"===d)g&&(e.save(),f.pathCache?e.clip(f.pathCache):(t.nodeShapes[n.getNodeShape(r)].drawPath(e,a,o,h,p),e.clip())),n.safeDrawImage(e,i,0,0,i.width,i.height,_,E,y,m),g&&e.restore();else{var D=e.createPattern(i,d);e.fillStyle=D,t.nodeShapes[n.getNodeShape(r)].drawPath(e,a,o,h,p),e.translate(_,E),e.fill(),e.translate(-_,-E)}e.globalAlpha=S}}}}(),function(e){"use strict";var t=e("renderer","canvas").prototype;t.drawEdgeText=function(t,i){var r=i._private.style.content.strValue;if(r&&!r.match(/^\s+$/)&&!(this.hideEdgesOnViewport&&(this.dragData.didDrag||this.pinching||this.hoverData.dragging||this.data.wheel||this.swipePanning)||i._private.style["font-size"].pxValue*i.cy().zoom()<i._private.style["min-zoomed-font-size"].pxValue)){t.textAlign="center",t.textBaseline="middle";var n,a,o,s=i._private.rscratch;if(e.is.number(s.labelX)&&e.is.number(s.labelY))if("autorotate"===i._private.style["edge-text-rotation"].strValue){switch(s.edgeType){case"haystack":a=s.haystackPts[2]-s.haystackPts[0],o=s.haystackPts[3]-s.haystackPts[1];break;default:a=s.endX-s.startX,o=s.endY-s.startY}n=Math.atan(o/a),t.translate(s.labelX,s.labelY),t.rotate(n),this.drawText(t,i,0,0),t.rotate(-n),t.translate(-s.labelX,-s.labelY)}else this.drawText(t,i,s.labelX,s.labelY)}},t.drawNodeText=function(t,i){var r=i._private.style.content.strValue;if(r&&!r.match(/^\s+$/)&&!(i._private.style["font-size"].pxValue*i.cy().zoom()<i._private.style["min-zoomed-font-size"].pxValue)){var n=i._private.style["text-halign"].strValue,a=i._private.style["text-valign"].strValue,o=i._private.rscratch;if(e.is.number(o.labelX)&&e.is.number(o.labelY)){switch(n){case"left":t.textAlign="right";break;case"right":t.textAlign="left";break;default:t.textAlign="center"}switch(a){case"top":t.textBaseline="bottom";break;case"bottom":t.textBaseline="top";break;default:t.textBaseline="middle"}this.drawText(t,i,o.labelX,o.labelY)}}},t.getFontCache=function(e){var t;this.fontCaches=this.fontCaches||[];for(var i=0;i<this.fontCaches.length;i++)if((t=this.fontCaches[i]).context===e)return t;return t={context:e},this.fontCaches.push(t),t},t.setupTextStyle=function(e,t){var i=t.effectiveOpacity(),r=t._private.style,n=r["font-style"].strValue,a=r["font-size"].pxValue+"px",o=r["font-family"].strValue,s=r["font-weight"].strValue,l=r["text-opacity"].value*r.opacity.value*i,u=r["text-outline-opacity"].value*l,c=r.color.value,d=r["text-outline-color"].value,h=r["text-shadow-blur"].pxValue,p=r["text-shadow-opacity"].value,f=r["text-shadow-color"].value,g=r["text-shadow-offset-x"].pxValue,v=r["text-shadow-offset-y"].pxValue,y=t._private.fontKey,m=this.getFontCache(e);m.key!==y&&(e.font=n+" "+s+" "+a+" "+o,m.key=y);var x=this.getLabelText(t);return e.lineJoin="round",this.fillStyle(e,c[0],c[1],c[2],l),this.strokeStyle(e,d[0],d[1],d[2],u),this.shadowStyle(e,f,p,h,g,v),x},t.drawText=function(e,t,i,r){var n=t._private,a=n.style,o=n.rstyle,s=n.rscratch,l=t.effectiveOpacity();if(0!==l&&0!==a["text-opacity"].value){var u,c,d,h,p,f,g=this.setupTextStyle(e,t),v=a["text-halign"].value,y=a["text-valign"].value;if(t.isEdge()&&(v="center",y="center"),null!=g&&!isNaN(i)&&!isNaN(r)){var m=a["text-background-opacity"].value,x=a["text-border-opacity"].value,b=a["text-border-width"].pxValue;if(m>0||b>0&&x>0){var w=4+b/2;t.isNode()&&("top"===y?r-=w:"bottom"===y&&(r+=w),"left"===v?i-=w:"right"===v&&(i+=w));var _=o.labelWidth,E=o.labelHeight,S=i;v&&("center"==v?S-=_/2:"left"==v&&(S-=_));var D=r;if(t.isNode()?"top"==y?D-=E:"center"==y&&(D-=E/2):D-=E/2,"autorotate"===a["edge-text-rotation"].strValue?(S=i-(_+=4)/2,D=(r=0)-E/2):(S-=w,D-=w,E+=2*w,_+=2*w),m>0){var k=e.fillStyle,P=a["text-background-color"].value;e.fillStyle="rgba("+P[0]+","+P[1]+","+P[2]+","+m*l+")","roundrectangle"==a["text-background-shape"].strValue?(u=e,c=S,d=D,h=_,p=E,f=(f=2)||5,u.beginPath(),u.moveTo(c+f,d),u.lineTo(c+h-f,d),u.quadraticCurveTo(c+h,d,c+h,d+f),u.lineTo(c+h,d+p-f),u.quadraticCurveTo(c+h,d+p,c+h-f,d+p),u.lineTo(c+f,d+p),u.quadraticCurveTo(c,d+p,c,d+p-f),u.lineTo(c,d+f),u.quadraticCurveTo(c,d,c+f,d),u.closePath(),u.fill()):e.fillRect(S,D,_,E),e.fillStyle=k}if(b>0&&x>0){var T=e.strokeStyle,C=e.lineWidth,M=a["text-border-color"].value,B=a["text-border-style"].value;if(e.strokeStyle="rgba("+M[0]+","+M[1]+","+M[2]+","+x*l+")",e.lineWidth=b,e.setLineDash)switch(B){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash([4,2]);break;case"double":e.lineWidth=b/4,e.setLineDash([]);break;case"solid":e.setLineDash([])}if(e.strokeRect(S,D,_,E),"double"===B){var N=b/2;e.strokeRect(S+N,D+N,_-2*N,E-2*N)}e.setLineDash&&e.setLineDash([]),e.lineWidth=C,e.strokeStyle=T}}var I=2*a["text-outline-width"].pxValue;if(I>0&&(e.lineWidth=I),"wrap"===a["text-wrap"].value){var O=s.labelWrapCachedLines,z=o.labelHeight/O.length;switch(y){case"top":r-=(O.length-1)*z;break;case"bottom":break;default:case"center":r-=(O.length-1)*z/2}for(var L=0;L<O.length;L++)I>0&&e.strokeText(O[L],i,r),e.fillText(O[L],i,r),r+=z}else I>0&&e.strokeText(g,i,r),e.fillText(g,i,r);this.shadowStyle(e,"transparent",0)}}}}(cytoscape),function(e){"use strict";var t=e("renderer","canvas"),i=t.prototype;i.drawNode=function(e,i,r){var n,a,o=this,s=i._private.style,l=i._private.rscratch,u=i._private,c=u.position;if(void 0!==c.x&&void 0!==c.y){var d,h=t.usePaths(),p=e,f=!1,g=s["overlay-padding"].pxValue,v=s["overlay-opacity"].value,y=s["overlay-color"].value;if(!r||0!==v){var m=i.effectiveOpacity();if(0!==m)if(n=this.getNodeWidth(i),a=this.getNodeHeight(i),e.lineWidth=s["border-width"].pxValue,void 0!==r&&r)v>0&&(this.fillStyle(e,y[0],y[1],y[2],v),t.nodeShapes.roundrectangle.drawPath(e,i._private.position.x,i._private.position.y,n+2*g,a+2*g),e.fill());else{var x,b=s["background-image"].value[2]||s["background-image"].value[1];if(void 0!==b){x=this.getCachedImage(b,function(){o.data.canvasNeedsRedraw[t.NODE]=!0,o.data.canvasNeedsRedraw[t.DRAG]=!0,o.drawingImage=!0,o.redraw()});var w=u.backgrounding;u.backgrounding=!x.complete,w!==u.backgrounding&&i.updateStyle(!1)}var _=s["background-color"].value,E=s["border-color"].value,S=s["border-style"].value;this.fillStyle(e,_[0],_[1],_[2],s["background-opacity"].value*m),this.strokeStyle(e,E[0],E[1],E[2],s["border-opacity"].value*m);var D=s["shadow-blur"].pxValue,k=s["shadow-opacity"].value,P=s["shadow-color"].value,T=s["shadow-offset-x"].pxValue,C=s["shadow-offset-y"].pxValue;if(this.shadowStyle(e,P,k,D,T,C),e.lineJoin="miter",e.setLineDash)switch(S){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash([4,2]);break;case"solid":case"double":e.setLineDash([])}var M=s.shape.strValue;if(h){var B=M+"$"+n+"$"+a;e.translate(c.x,c.y),l.pathCacheKey===B?(d=e=l.pathCache,f=!0):(d=e=new Path2D,l.pathCacheKey=B,l.pathCache=d)}if(!f){var N=c;h&&(N={x:0,y:0}),t.nodeShapes[this.getNodeShape(i)].drawPath(e,N.x,N.y,n,a)}e=p,h?e.fill(d):e.fill(),this.shadowStyle(e,"transparent",0),void 0!==b&&x.complete&&this.drawInscribedImage(e,x,i);var I=s["background-blacken"].value,O=s["border-width"].pxValue;if(this.hasPie(i)&&(this.drawPie(e,i,m),0===I&&0===O||h||t.nodeShapes[this.getNodeShape(i)].drawPath(e,c.x,c.y,n,a)),I>0?(this.fillStyle(e,0,0,0,I),h?e.fill(d):e.fill()):I<0&&(this.fillStyle(e,255,255,255,-I),h?e.fill(d):e.fill()),O>0&&(h?e.stroke(d):e.stroke(),"double"===S)){e.lineWidth=s["border-width"].pxValue/3;var z=e.globalCompositeOperation;e.globalCompositeOperation="destination-out",h?e.stroke(d):e.stroke(),e.globalCompositeOperation=z}h&&e.translate(-c.x,-c.y),e.setLineDash&&e.setLineDash([])}}}},i.hasPie=function(e){return(e=e[0])._private.hasPie},i.drawPie=function(i,r,n){var a=(r=r[0])._private,o=a.style,s=o["pie-size"],l=this.getNodeWidth(r),u=this.getNodeHeight(r),c=a.position.x,d=a.position.y,h=Math.min(l,u)/2,p=0;t.usePaths()&&(c=0,d=0),"%"===s.units?h=h*s.value/100:void 0!==s.pxValue&&(h=s.pxValue/2);for(var f=1;f<=e.style.pieBackgroundN;f++){var g=o["pie-"+f+"-background-size"].value,v=o["pie-"+f+"-background-color"].value,y=o["pie-"+f+"-background-opacity"].value*n,m=g/100;m+p>1&&(m=1-p);var x=1.5*Math.PI+2*Math.PI*p,b=x+2*Math.PI*m;0===g||p>=1||p+m>1||(i.beginPath(),i.moveTo(c,d),i.arc(c,d,h,x,b),i.closePath(),this.fillStyle(i,v[0],v[1],v[2],y),i.fill(),p+=m)}}}(cytoscape),function(e){"use strict";var t=e("renderer","canvas"),i=t,r=t.prototype;r.getPixelRatio=function(){var e=this.data.contexts[0];if(null!=this.forcedPixelRatio)return this.forcedPixelRatio;var t=e.backingStorePixelRatio||e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return(window.devicePixelRatio||1)/t},r.paintCache=function(e){for(var t,i=this.paintCaches=this.paintCaches||[],r=!0,n=0;n<i.length;n++)if((t=i[n]).context===e){r=!1;break}return r&&(t={context:e},i.push(t)),t},r.fillStyle=function(e,t,i,r,n){e.fillStyle="rgba("+t+","+i+","+r+","+n+")"},r.strokeStyle=function(e,t,i,r,n){e.strokeStyle="rgba("+t+","+i+","+r+","+n+")"},r.shadowStyle=function(e,t,i,r,n,a){var o=this.data.cy.zoom(),s=this.paintCache(e);0===s.shadowOpacity&&0===i||(s.shadowOpacity=i,i>0?(e.shadowBlur=r*o,e.shadowColor="rgba("+t[0]+","+t[1]+","+t[2]+","+i+")",e.shadowOffsetX=n*o,e.shadowOffsetY=a*o):(e.shadowBlur=0,e.shadowColor="transparent"))},r.matchCanvasSize=function(e){var r=this.data,n=e.clientWidth,a=e.clientHeight,o=this.getPixelRatio(),s=this.motionBlurPxRatio;e!==this.data.bufferCanvases[i.MOTIONBLUR_BUFFER_NODE]&&e!==this.data.bufferCanvases[i.MOTIONBLUR_BUFFER_DRAG]||(o=s);var l,u=n*o,c=a*o;if(u!==this.canvasWidth||c!==this.canvasHeight){this.fontCaches=null;var d=r.canvasContainer;d.style.width=n+"px",d.style.height=a+"px";for(var h=0;h<t.CANVAS_LAYERS;h++)(l=r.canvases[h]).width===u&&l.height===c||(l.width=u,l.height=c,l.style.width=n+"px",l.style.height=a+"px");for(h=0;h<t.BUFFER_COUNT;h++)(l=r.bufferCanvases[h]).width===u&&l.height===c||(l.width=u,l.height=c,l.style.width=n+"px",l.style.height=a+"px");this.textureMult=1,o<=1&&(l=r.bufferCanvases[t.TEXTURE_BUFFER],this.textureMult=2,l.width=u*this.textureMult,l.height=c*this.textureMult),this.canvasWidth=u,this.canvasHeight=c}},r.renderTo=function(e,t,i,r){this.redraw({forcedContext:e,forcedZoom:t,forcedPan:i,drawAllLayers:!0,forcedPxRatio:r})},r.timeToRender=function(){return this.redrawTotalTime/this.redrawCount},t.minRedrawLimit=1e3/60,t.maxRedrawLimit=1e3,t.motionBlurDelay=100,r.redraw=function(r){var n=(r=r||{}).forcedContext,a=r.drawAllLayers,o=r.drawOnlyNodeLayer,s=r.forcedZoom,l=r.forcedPan,u=this,c=void 0===r.forcedPxRatio?this.getPixelRatio():r.forcedPxRatio,d=u.data.cy,h=u.data,p=h.canvasNeedsRedraw,f=u.textureOnViewport&&!n&&(u.pinching||u.hoverData.dragging||u.swipePanning||u.data.wheelZooming),g=void 0!==r.motionBlur?r.motionBlur:u.motionBlur,v=u.motionBlurPxRatio,y=d.hasCompoundNodes(),m=u.hoverData.draggingEles,x=!(!u.hoverData.selecting&&!u.touchData.selecting),b=g=g&&!n&&u.motionBlurEnabled&&!x;!n&&u.motionBlurTimeout&&clearTimeout(u.motionBlurTimeout),!n&&this.redrawTimeout&&clearTimeout(this.redrawTimeout),this.redrawTimeout=null,void 0===this.averageRedrawTime&&(this.averageRedrawTime=0);var w=t.minRedrawLimit,_=t.maxRedrawLimit,E=this.averageRedrawTime;E=(E=w>E?w:E)<_?E:_,void 0===this.lastDrawTime&&(this.lastDrawTime=0);var S=Date.now(),D=S-this.lastDrawTime>=E;if(!n&&!u.clearingMotionBlur){if(!D||this.currentlyDrawing)return void(this.redrawTimeout=setTimeout(function(){u.redraw()},E));this.lastDrawTime=S,this.currentlyDrawing=!0}g&&(null==u.mbFrames&&(u.mbFrames=0),u.drawingImage||u.mbFrames++,u.mbFrames<3&&(b=!1),u.mbFrames>u.minMbLowQualFrames&&(u.motionBlurPxRatio=u.mbPxRBlurry)),u.clearingMotionBlur&&(u.motionBlurPxRatio=1);var k=Date.now();function P(){u.textureDrawLastFrame&&!f&&(p[i.NODE]=!0,p[i.SELECT_BOX]=!0);var r=u.getCachedEdges(),x=d.style()._private.coreStyle,w=d.zoom(),_=void 0!==s?s:w,E=d.pan(),S={x:E.x,y:E.y},D={zoom:w,pan:{x:E.x,y:E.y}},P=u.prevViewport;void 0===P||D.zoom!==P.zoom||D.pan.x!==P.pan.x||D.pan.y!==P.pan.y||m&&!y||(u.motionBlurPxRatio=1),l&&(S=l),_*=c,S.x*=c,S.y*=c;var T={nodes:[],edges:[],eles:[]},C={nodes:[],edges:[],eles:[]};function M(e,t,i,r,n){var a=e.globalCompositeOperation;e.globalCompositeOperation="destination-out",u.fillStyle(e,255,255,255,u.motionBlurTransparency),e.fillRect(t,i,r,n),e.globalCompositeOperation=a}function B(e,t){var r,o,c,d;u.clearingMotionBlur||e!==h.bufferContexts[i.MOTIONBLUR_BUFFER_NODE]&&e!==h.bufferContexts[i.MOTIONBLUR_BUFFER_DRAG]?(r=S,o=_,c=u.canvasWidth,d=u.canvasHeight):(r={x:E.x*v,y:E.y*v},o=w*v,c=u.canvasWidth*v,d=u.canvasHeight*v),e.setTransform(1,0,0,1,0,0),"motionBlur"===t?M(e,0,0,c,d):n||void 0!==t&&!t||e.clearRect(0,0,c,d),a||(e.translate(r.x,r.y),e.scale(o,o)),l&&e.translate(l.x,l.y),s&&e.scale(s,s)}if(f||(u.textureDrawLastFrame=!1),f){if(u.textureDrawLastFrame=!0,!u.textureCache){u.textureCache={},j=u.textureCache.bb=d.elements().boundingBox(),u.textureCache.texture=u.data.bufferCanvases[t.TEXTURE_BUFFER];var N=u.data.bufferContexts[t.TEXTURE_BUFFER];N.setTransform(1,0,0,1,0,0),N.clearRect(0,0,u.canvasWidth*u.textureMult,u.canvasHeight*u.textureMult),u.redraw({forcedContext:N,drawOnlyNodeLayer:!0,forcedPxRatio:c*u.textureMult}),(D=u.textureCache.viewport={zoom:d.zoom(),pan:d.pan(),width:u.canvasWidth,height:u.canvasHeight}).mpan={x:(0-D.pan.x)/D.zoom,y:(0-D.pan.y)/D.zoom}}p[i.DRAG]=!1,p[i.NODE]=!1;var I=h.contexts[i.NODE],O=u.textureCache.texture;D=u.textureCache.viewport;j=u.textureCache.bb,I.setTransform(1,0,0,1,0,0),g?M(I,0,0,D.width,D.height):I.clearRect(0,0,D.width,D.height);var z=x["outside-texture-bg-color"].value,L=x["outside-texture-bg-opacity"].value;u.fillStyle(I,z[0],z[1],z[2],L),I.fillRect(0,0,D.width,D.height);w=d.zoom();B(I,!1),I.clearRect(D.mpan.x,D.mpan.y,D.width/D.zoom/c,D.height/D.zoom/c),I.drawImage(O,D.mpan.x,D.mpan.y,D.width/D.zoom/c,D.height/D.zoom/c)}else u.textureOnViewport&&!n&&(u.textureCache=null);var R=u.pinching||u.hoverData.dragging||u.swipePanning||u.data.wheelZooming||u.hoverData.draggingEles,V=u.hideEdgesOnViewport&&R,A=u.hideLabelsOnViewport&&R;if(p[i.DRAG]||p[i.NODE]||a||o){V||u.findEdgeControlPoints(r);for(var X=u.getCachedZSortedEles(),F=d.extent(),Y=0;Y<X.length;Y++){var q=X[Y],j=n?null:q.boundingBox();(!!n||e.math.boundingBoxesIntersect(F,j))&&(q._private.rscratch.inDragLayer?T:C).eles.push(q)}}function $(e,t){for(var i=e.eles,r=0;r<i.length;r++){var n=i[r];n.isNode()?(u.drawNode(t,n),A||u.drawNodeText(t,n),u.drawNode(t,n,!0)):V||(u.drawEdge(t,n),A||u.drawEdgeText(t,n),u.drawEdge(t,n,!0))}}var W=[];if(W[i.NODE]=!p[i.NODE]&&g&&!u.clearedForMotionBlur[i.NODE]||u.clearingMotionBlur,W[i.NODE]&&(u.clearedForMotionBlur[i.NODE]=!0),W[i.DRAG]=!p[i.DRAG]&&g&&!u.clearedForMotionBlur[i.DRAG]||u.clearingMotionBlur,W[i.DRAG]&&(u.clearedForMotionBlur[i.DRAG]=!0),p[i.NODE]||a||o||W[i.NODE]){var H=g&&!W[i.NODE]&&1!==v;B(I=n||(H?u.data.bufferContexts[i.MOTIONBLUR_BUFFER_NODE]:h.contexts[i.NODE]),g&&!H?"motionBlur":void 0),$(C,I),a||g||(p[i.NODE]=!1)}if(!o&&(p[i.DRAG]||a||W[i.DRAG])){H=g&&!W[i.DRAG]&&1!==v;B(I=n||(H?u.data.bufferContexts[i.MOTIONBLUR_BUFFER_DRAG]:h.contexts[i.DRAG]),g&&!H?"motionBlur":void 0),$(T,I),a||g||(p[i.DRAG]=!1)}if(u.showFps||!o&&p[i.SELECT_BOX]&&!a){if(B(I=n||h.contexts[i.SELECT_BOX]),1==h.select[4]&&(u.hoverData.selecting||u.touchData.selecting)){w=h.cy.zoom();var Z=x["selection-box-border-width"].value/w;I.lineWidth=Z,I.fillStyle="rgba("+x["selection-box-color"].value[0]+","+x["selection-box-color"].value[1]+","+x["selection-box-color"].value[2]+","+x["selection-box-opacity"].value+")",I.fillRect(h.select[0],h.select[1],h.select[2]-h.select[0],h.select[3]-h.select[1]),Z>0&&(I.strokeStyle="rgba("+x["selection-box-border-color"].value[0]+","+x["selection-box-border-color"].value[1]+","+x["selection-box-border-color"].value[2]+","+x["selection-box-opacity"].value+")",I.strokeRect(h.select[0],h.select[1],h.select[2]-h.select[0],h.select[3]-h.select[1]))}if(h.bgActivePosistion&&!u.hoverData.selecting){w=h.cy.zoom();var U=h.bgActivePosistion;I.fillStyle="rgba("+x["active-bg-color"].value[0]+","+x["active-bg-color"].value[1]+","+x["active-bg-color"].value[2]+","+x["active-bg-opacity"].value+")",I.beginPath(),I.arc(U.x,U.y,x["active-bg-size"].pxValue/w,0,2*Math.PI),I.fill()}var G=u.averageRedrawTime;if(u.showFps&&G){G=Math.round(G);var K=Math.round(1e3/G);I.setTransform(1,0,0,1,0,0),I.fillStyle="rgba(255, 0, 0, 0.75)",I.strokeStyle="rgba(255, 0, 0, 0.75)",I.lineWidth=1,I.fillText("1 frame = "+G+" ms = "+K+" fps",0,20);I.strokeRect(0,30,250,20),I.fillRect(0,30,250*Math.min(K/60,1),20)}a||(p[i.SELECT_BOX]=!1)}if(g&&1!==v){var J=h.contexts[i.NODE],Q=u.data.bufferCanvases[i.MOTIONBLUR_BUFFER_NODE],ee=h.contexts[i.DRAG],te=u.data.bufferCanvases[i.MOTIONBLUR_BUFFER_DRAG],ie=function(e,t,i){e.setTransform(1,0,0,1,0,0),i||!b?e.clearRect(0,0,u.canvasWidth,u.canvasHeight):M(e,0,0,u.canvasWidth,u.canvasHeight);var r=v;e.drawImage(t,0,0,u.canvasWidth*r,u.canvasHeight*r,0,0,u.canvasWidth,u.canvasHeight)};(p[i.NODE]||W[i.NODE])&&(ie(J,Q,W[i.NODE]),p[i.NODE]=!1),(p[i.DRAG]||W[i.DRAG])&&(ie(ee,te,W[i.DRAG]),p[i.DRAG]=!1)}var re=Date.now();void 0===u.averageRedrawTime&&(u.averageRedrawTime=re-k),void 0===u.redrawCount&&(u.redrawCount=0),u.redrawCount++,void 0===u.redrawTotalTime&&(u.redrawTotalTime=0),u.redrawTotalTime+=re-k,u.lastRedrawTime=re-k,u.averageRedrawTime=u.averageRedrawTime/2+(re-k)/2,u.currentlyDrawing=!1,u.prevViewport=D,u.clearingMotionBlur&&(u.clearingMotionBlur=!1,u.motionBlurCleared=!0,u.motionBlur=!0),g&&(u.motionBlurTimeout=setTimeout(function(){u.motionBlurTimeout=null,u.clearedForMotionBlur[i.NODE]=!1,u.clearedForMotionBlur[i.DRAG]=!1,u.motionBlur=!1,u.clearingMotionBlur=!f,u.mbFrames=0,p[i.NODE]=!0,p[i.DRAG]=!0,u.redraw()},t.motionBlurDelay)),u.drawingImage=!1}n?P():e.util.requestAnimationFrame(P),n||u.initrender||(u.initrender=!0,d.trigger("initrender")),n||d.triggerOnRender()}}(cytoscape),function(e){"use strict";var t=e("renderer","canvas").prototype;t.drawPolygonPath=function(e,t,i,r,n,a){var o=r/2,s=n/2;e.beginPath&&e.beginPath(),e.moveTo(t+o*a[0],i+s*a[1]);for(var l=1;l<a.length/2;l++)e.lineTo(t+o*a[2*l],i+s*a[2*l+1]);e.closePath()},t.drawPolygon=function(e,t,i,r,n,a){this.drawPolygonPath(e,t,i,r,n,a),e.fill()},t.drawRoundRectanglePath=function(t,i,r,n,a,o){var s=n/2,l=a/2,u=e.math.getRoundRectangleRadius(n,a);t.beginPath&&t.beginPath(),t.moveTo(i,r-l),t.arcTo(i+s,r-l,i+s,r,u),t.arcTo(i+s,r+l,i,r+l,u),t.arcTo(i-s,r+l,i-s,r,u),t.arcTo(i-s,r-l,i,r-l,u),t.lineTo(i,r-l),t.closePath()},t.drawRoundRectangle=function(e,t,i,r,n,a){this.drawRoundRectanglePath(e,t,i,r,n,a),e.fill()}}(cytoscape),function(e){"use strict";var t=e("renderer","canvas").prototype;t.createBuffer=function(e,t){var i=document.createElement("canvas");return i.width=e,i.height=t,[i,i.getContext("2d")]},t.bufferCanvasImage=function(t){var i=this.data.cy,r=i.elements().boundingBox(),n=t.full?Math.ceil(r.w):this.data.container.clientWidth,a=t.full?Math.ceil(r.h):this.data.container.clientHeight,o=1;if(void 0!==t.scale)n*=t.scale,a*=t.scale,o=t.scale;else if(e.is.number(t.maxWidth)||e.is.number(t.maxHeight)){var s=1/0,l=1/0;e.is.number(t.maxWidth)&&(s=o*t.maxWidth/n),e.is.number(t.maxHeight)&&(l=o*t.maxHeight/a),n*=o=Math.min(s,l),a*=o}var u=document.createElement("canvas");u.width=n,u.height=a,u.style.width=n+"px",u.style.height=a+"px";var c=u.getContext("2d");if(n>0&&a>0)if(c.clearRect(0,0,n,a),t.bg&&(c.fillStyle=t.bg,c.rect(0,0,n,a),c.fill()),c.globalCompositeOperation="source-over",t.full)this.redraw({forcedContext:c,drawAllLayers:!0,forcedZoom:o,forcedPan:{x:-r.x1*o,y:-r.y1*o},forcedPxRatio:1});else{var d=i.pan(),h={x:d.x*o,y:d.y*o},p=i.zoom()*o;this.redraw({forcedContext:c,drawAllLayers:!0,forcedZoom:p,forcedPan:h,forcedPxRatio:1})}return u},t.png=function(e){return this.bufferCanvasImage(e).toDataURL("image/png")},t.jpg=function(e){return this.bufferCanvasImage(e).toDataURL("image/jpeg")}}(cytoscape),function(e){"use strict";var t=e("renderer","canvas"),i=t.prototype;i.registerBinding=function(e,t,i,r){this.bindings.push({target:e,event:t,handler:i,useCapture:r}),e.addEventListener(t,i,r)},i.nodeIsDraggable=function(e){return!(0===e._private.style.opacity.value||"visible"!=e._private.style.visibility.value||"element"!=e._private.style.display.value||e.locked()||!e.grabbable())},i.load=function(){var i=this,r=function(e){var t;if(e.addToList&&i.data.cy.hasCompoundNodes()){if(!e.addToList.hasId){e.addToList.hasId={};for(var r=0;r<e.addToList.length;r++){var n=e.addToList[r];e.addToList.hasId[n.id()]=!0}}t=e.addToList.hasId}return t||{}},n=function(e,t){var i=e._private,n=r(t);t.inDragLayer&&(i.rscratch.inDragLayer=!0),t.addToList&&!n[e.id()]&&(t.addToList.push(e),n[e.id()]=!0,i.grabbed=!0);for(var a=i.edges,s=0;t.inDragLayer&&s<a.length;s++)a[s]._private.rscratch.inDragLayer=!0;!function(e,t){if(e._private.cy.hasCompoundNodes()&&(null!=t.inDragLayer||null!=t.addToList))for(var i=r(t),n=e.descendants(),a=0;a<n.size();a++){var o=n[a],s=o._private;t.inDragLayer&&(s.rscratch.inDragLayer=!0),t.addToList&&!i[o.id()]&&(t.addToList.push(o),i[o.id()]=!0,s.grabbed=!0);for(var l=s.edges,u=0;t.inDragLayer&&u<l.length;u++)l[u]._private.rscratch.inDragLayer=!0}}(e,t),o(e,{inDragLayer:t.inDragLayer})},a=function(e){if(e)for(var t=0;t<e.length;t++){var i=e[t]._private;if("nodes"===i.group){i.rscratch.inDragLayer=!1,i.grabbed=!1;for(var r=i.edges,n=0;n<r.length;n++)r[n]._private.rscratch.inDragLayer=!1;o(e[t],{inDragLayer:!1})}else"edges"===i.group&&(i.rscratch.inDragLayer=!1)}},o=function(e,t){if(null!=t.inDragLayer||null!=t.addToList){var i=e;if(e._private.cy.hasCompoundNodes()){for(;i.parent().nonempty();)i=i.parent()[0];if(i!=e){for(var n=i.descendants().merge(i).unmerge(e).unmerge(e.descendants()),a=n.connectedEdges(),o=r(t),s=0;s<n.size();s++)void 0!==t.inDragLayer&&(n[s]._private.rscratch.inDragLayer=t.inDragLayer),t.addToList&&!o[n[s].id()]&&(t.addToList.push(n[s]),o[n[s].id()]=!0,n[s]._private.grabbed=!0);for(var l=0;void 0!==t.inDragLayer&&l<a.length;l++)a[l]._private.rscratch.inDragLayer=t.inDragLayer}}}};"undefined"!=typeof MutationObserver?(i.removeObserver=new MutationObserver(function(e){for(var t=0;t<e.length;t++){var r=e[t].removedNodes;if(r)for(var n=0;n<r.length;n++){if(r[n]===i.data.container){i.destroy();break}}}}),i.removeObserver.observe(i.data.container.parentNode,{childList:!0})):i.registerBinding(i.data.container,"DOMNodeRemoved",function(e){i.destroy()}),i.registerBinding(window,"resize",e.util.debounce(function(e){i.invalidateContainerClientCoordsCache(),i.matchCanvasSize(i.data.container),i.data.canvasNeedsRedraw[t.NODE]=!0,i.redraw()},100));for(var s,l=i.data.cy.container();s=l,i.registerBinding(s,"scroll",function(e){i.invalidateContainerClientCoordsCache()}),l.parentNode;)l=l.parentNode;i.registerBinding(i.data.container,"contextmenu",function(e){e.preventDefault()});i.registerBinding(i.data.container,"mousedown",function(r){r.preventDefault(),i.hoverData.capture=!0,i.hoverData.which=r.which;var a=i.data.cy,o=i.projectIntoViewport(r.clientX,r.clientY),s=i.data.select,l=i.findNearestElement(o[0],o[1],!0,!1),u=i.dragData.possibleDragElements;i.hoverData.mdownPos=o;var c=i.data.canvasNeedsRedraw;if(3==r.which){i.hoverData.cxtStarted=!0;var d=new e.Event(r,{type:"cxttapstart",cyPosition:{x:o[0],y:o[1]}});l?(l.activate(),l.trigger(d),i.hoverData.down=l):a.trigger(d),i.hoverData.downTime=(new Date).getTime(),i.hoverData.cxtDragged=!1}else if(1==r.which){if(l&&l.activate(),null!=l){if(i.nodeIsDraggable(l)){var h=new e.Event(r,{type:"grab",cyPosition:{x:o[0],y:o[1]}});if(l.isNode()&&!l.selected())u=i.dragData.possibleDragElements=[],n(l,{addToList:u}),l.trigger(h);else if(l.isNode()&&l.selected()){u=i.dragData.possibleDragElements=[];for(var p=a.$(function(){return this.isNode()&&this.selected()}),f=0;f<p.length;f++)i.nodeIsDraggable(p[f])&&n(p[f],{addToList:u});l.trigger(h)}c[t.NODE]=!0,c[t.DRAG]=!0}l.trigger(new e.Event(r,{type:"mousedown",cyPosition:{x:o[0],y:o[1]}})).trigger(new e.Event(r,{type:"tapstart",cyPosition:{x:o[0],y:o[1]}})).trigger(new e.Event(r,{type:"vmousedown",cyPosition:{x:o[0],y:o[1]}}))}else null==l&&a.trigger(new e.Event(r,{type:"mousedown",cyPosition:{x:o[0],y:o[1]}})).trigger(new e.Event(r,{type:"tapstart",cyPosition:{x:o[0],y:o[1]}})).trigger(new e.Event(r,{type:"vmousedown",cyPosition:{x:o[0],y:o[1]}}));if(i.hoverData.down=l,i.hoverData.downTime=(new Date).getTime(),null==l||l.isEdge()){s[4]=1;var g=Math.max(0,t.panOrBoxSelectDelay-(+new Date-i.hoverData.downTime));clearTimeout(i.bgActiveTimeout),a.boxSelectionEnabled()||l&&l.isEdge()?i.bgActiveTimeout=setTimeout(function(){l&&l.unactivate(),i.data.bgActivePosistion={x:o[0],y:o[1]},i.hoverData.dragging=!0,c[t.SELECT_BOX]=!0,i.redraw()},g):(i.data.bgActivePosistion={x:o[0],y:o[1]},c[t.SELECT_BOX]=!0,i.redraw())}i.hoverData.tapholdCancelled=!1,clearTimeout(i.hoverData.tapholdTimeout),i.hoverData.tapholdTimeout=setTimeout(function(){if(!i.hoverData.tapholdCancelled){var t=i.hoverData.down;t?t.trigger(new e.Event(r,{type:"taphold",cyPosition:{x:o[0],y:o[1]}})):a.trigger(new e.Event(r,{type:"taphold",cyPosition:{x:o[0],y:o[1]}}))}},i.tapholdDuration)}s[0]=s[2]=o[0],s[1]=s[3]=o[1]},!1),i.registerBinding(window,"mousemove",e.util.throttle(function(r){var a=!1;if(!i.hoverData.capture){var o=i.findContainerClientCoords();if(!(r.clientX>o[0]&&r.clientX<o[0]+i.canvasWidth&&r.clientY>o[1]&&r.clientY<o[1]+i.canvasHeight))return;for(var s=i.data.container,l=r.target.parentNode,u=!1;l;){if(l===s){u=!0;break}l=l.parentNode}if(!u)return}var c=i.data.cy,d=c.zoom(),h=i.projectIntoViewport(r.clientX,r.clientY),p=i.data.select,f=i.data.canvasNeedsRedraw,g=null;i.hoverData.draggingEles||(g=i.findNearestElement(h[0],h[1],!0,!1));var v=i.hoverData.last,y=i.hoverData.down,m=[h[0]-p[2],h[1]-p[3]],x=i.dragData.possibleDragElements,b=p[2]-p[0],w=b*b,_=p[3]-p[1],E=(w+_*_)*d*d;i.hoverData.tapholdCancelled=!0;if(a=!0,null!=g?g.trigger(new e.Event(r,{type:"mousemove",cyPosition:{x:h[0],y:h[1]}})).trigger(new e.Event(r,{type:"vmousemove",cyPosition:{x:h[0],y:h[1]}})).trigger(new e.Event(r,{type:"tapdrag",cyPosition:{x:h[0],y:h[1]}})):null==g&&c.trigger(new e.Event(r,{type:"mousemove",cyPosition:{x:h[0],y:h[1]}})).trigger(new e.Event(r,{type:"vmousemove",cyPosition:{x:h[0],y:h[1]}})).trigger(new e.Event(r,{type:"tapdrag",cyPosition:{x:h[0],y:h[1]}})),3===i.hoverData.which){var S=new e.Event(r,{type:"cxtdrag",cyPosition:{x:h[0],y:h[1]}});y?y.trigger(S):c.trigger(S),i.hoverData.cxtDragged=!0,i.hoverData.cxtOver&&g===i.hoverData.cxtOver||(i.hoverData.cxtOver&&i.hoverData.cxtOver.trigger(new e.Event(r,{type:"cxtdragout",cyPosition:{x:h[0],y:h[1]}})),i.hoverData.cxtOver=g,g&&g.trigger(new e.Event(r,{type:"cxtdragover",cyPosition:{x:h[0],y:h[1]}})))}else if(i.hoverData.dragging){if(a=!0,c.panningEnabled()&&c.userPanningEnabled()){var D;if(i.hoverData.justStartedPan){var k=i.hoverData.mdownPos;D={x:(h[0]-k[0])*d,y:(h[1]-k[1])*d},i.hoverData.justStartedPan=!1}else D={x:m[0]*d,y:m[1]*d};c.panBy(D),i.hoverData.dragged=!0}h=i.projectIntoViewport(r.clientX,r.clientY)}else if(1==p[4]&&(null==y||y.isEdge())&&(!c.boxSelectionEnabled()||+new Date-i.hoverData.downTime>=t.panOrBoxSelectDelay)&&!i.hoverData.selecting&&E>=i.desktopTapThreshold2&&c.panningEnabled()&&c.userPanningEnabled())i.hoverData.dragging=!0,i.hoverData.selecting=!1,i.hoverData.justStartedPan=!0,p[4]=0;else{if(c.boxSelectionEnabled()&&!i.hoverData.dragging&&Math.pow(p[2]-p[0],2)+Math.pow(p[3]-p[1],2)>7&&p[4]&&(clearTimeout(i.bgActiveTimeout),i.data.bgActivePosistion=void 0,i.hoverData.selecting=!0,f[t.SELECT_BOX]=!0,i.redraw()),y&&y.isEdge()&&y.active()&&y.unactivate(),g!=v&&(v&&(v.trigger(new e.Event(r,{type:"mouseout",cyPosition:{x:h[0],y:h[1]}})),v.trigger(new e.Event(r,{type:"tapdragout",cyPosition:{x:h[0],y:h[1]}}))),g&&(g.trigger(new e.Event(r,{type:"mouseover",cyPosition:{x:h[0],y:h[1]}})),g.trigger(new e.Event(r,{type:"tapdragover",cyPosition:{x:h[0],y:h[1]}}))),i.hoverData.last=g),y&&y.isNode()&&i.nodeIsDraggable(y))if(E>=i.desktopTapThreshold2){var P=!i.dragData.didDrag;P&&(f[t.NODE]=!0),i.dragData.didDrag=!0;for(var T=[],C=0;C<x.length;C++){var M=x[C];if(i.hoverData.draggingEles||n(M,{inDragLayer:!0}),M.isNode()&&i.nodeIsDraggable(M)&&M.grabbed()){var B=M._private.position;if(T.push(M),e.is.number(m[0])&&e.is.number(m[1])&&(B.x+=m[0],B.y+=m[1],P)){var N=i.hoverData.dragDelta;e.is.number(N[0])&&e.is.number(N[1])&&(B.x+=N[0],B.y+=N[1])}}}i.hoverData.draggingEles=!0;var I=new e.Collection(c,T);I.updateCompoundBounds(),I.trigger("position drag"),f[t.DRAG]=!0,i.redraw()}else!function(){var e=i.hoverData.dragDelta=i.hoverData.dragDelta||[];0===e.length?(e.push(m[0]),e.push(m[1])):(e[0]+=m[0],e[1]+=m[1])}();a=!0}if(p[2]=h[0],p[3]=h[1],a)return r.stopPropagation&&r.stopPropagation(),r.preventDefault&&r.preventDefault(),!1},1e3/30,{trailing:!0}),!1),i.registerBinding(window,"mouseup",function(r){if(i.hoverData.capture){i.hoverData.capture=!1;var n=i.data.cy,o=i.projectIntoViewport(r.clientX,r.clientY),s=i.data.select,l=i.findNearestElement(o[0],o[1],!0,!1),u=i.dragData.possibleDragElements,c=i.hoverData.down,d=r.shiftKey,h=i.data.canvasNeedsRedraw;if(i.data.bgActivePosistion&&(h[t.SELECT_BOX]=!0,i.redraw()),i.hoverData.tapholdCancelled=!0,i.data.bgActivePosistion=void 0,clearTimeout(i.bgActiveTimeout),c&&c.unactivate(),3===i.hoverData.which){var p=new e.Event(r,{type:"cxttapend",cyPosition:{x:o[0],y:o[1]}});if(c?c.trigger(p):n.trigger(p),!i.hoverData.cxtDragged){var f=new e.Event(r,{type:"cxttap",cyPosition:{x:o[0],y:o[1]}});c?c.trigger(f):n.trigger(f)}i.hoverData.cxtDragged=!1,i.hoverData.which=null}else{if(null!=c||i.dragData.didDrag||i.hoverData.dragged||(n.$(function(){return this.selected()}).unselect(),u.length>0&&(h[t.NODE]=!0),i.dragData.possibleDragElements=u=[]),null!=l?l.trigger(new e.Event(r,{type:"mouseup",cyPosition:{x:o[0],y:o[1]}})).trigger(new e.Event(r,{type:"tapend",cyPosition:{x:o[0],y:o[1]}})).trigger(new e.Event(r,{type:"vmouseup",cyPosition:{x:o[0],y:o[1]}})):null==l&&n.trigger(new e.Event(r,{type:"mouseup",cyPosition:{x:o[0],y:o[1]}})).trigger(new e.Event(r,{type:"tapend",cyPosition:{x:o[0],y:o[1]}})).trigger(new e.Event(r,{type:"vmouseup",cyPosition:{x:o[0],y:o[1]}})),i.dragData.didDrag||i.hoverData.dragged||(null!=l?l.trigger(new e.Event(r,{type:"click",cyPosition:{x:o[0],y:o[1]}})).trigger(new e.Event(r,{type:"tap",cyPosition:{x:o[0],y:o[1]}})).trigger(new e.Event(r,{type:"vclick",cyPosition:{x:o[0],y:o[1]}})):null==l&&n.trigger(new e.Event(r,{type:"click",cyPosition:{x:o[0],y:o[1]}})).trigger(new e.Event(r,{type:"tap",cyPosition:{x:o[0],y:o[1]}})).trigger(new e.Event(r,{type:"vclick",cyPosition:{x:o[0],y:o[1]}}))),l!=c||i.dragData.didDrag||null!=l&&l._private.selectable&&(i.hoverData.dragging||("additive"===n.selectionType()||d?l.selected()?l.unselect():l.select():d||(n.$(":selected").unmerge(l).unselect(),l.select())),h[t.NODE]=!0),i.hoverData.selecting&&n.boxSelectionEnabled()&&Math.pow(s[2]-s[0],2)+Math.pow(s[3]-s[1],2)>7&&s[4]){var g=[],v=i.getAllInBox(s[0],s[1],s[2],s[3]);h[t.SELECT_BOX]=!0,v.length>0&&(h[t.NODE]=!0);for(var y=0;y<v.length;y++)v[y]._private.selectable&&g.push(v[y]);var m=new e.Collection(n,g);"additive"===n.selectionType()?m.select():(d||n.$(":selected").unmerge(m).unselect(),m.select()),i.redraw()}i.hoverData.dragging&&(i.hoverData.dragging=!1,h[t.SELECT_BOX]=!0,h[t.NODE]=!0,i.redraw()),s[4]||(h[t.DRAG]=!0,h[t.NODE]=!0,a(u),c&&c.trigger("free"))}s[4]=0,i.hoverData.down=null,i.hoverData.cxtStarted=!1,i.hoverData.draggingEles=!1,i.hoverData.selecting=!1,i.dragData.didDrag=!1,i.hoverData.dragged=!1,i.hoverData.dragDelta=[]}},!1);var u,c,d,h,p,f,g,v,y,m,x,b,w;i.registerBinding(i.data.container,"wheel",function(e){if(!i.scrollingPage){var r=i.data.cy,n=i.projectIntoViewport(e.clientX,e.clientY),a=[n[0]*r.zoom()+r.pan().x,n[1]*r.zoom()+r.pan().y];if(i.hoverData.draggingEles||i.hoverData.dragging||i.hoverData.cxtStarted||0!==i.data.select[4])e.preventDefault();else if(r.panningEnabled()&&r.userPanningEnabled()&&r.zoomingEnabled()&&r.userZoomingEnabled()){e.preventDefault(),i.data.wheelZooming=!0,clearTimeout(i.data.wheelTimeout),i.data.wheelTimeout=setTimeout(function(){i.data.wheelZooming=!1,i.data.canvasNeedsRedraw[t.NODE]=!0,i.redraw()},150);var o=e.deltaY/-250||e.wheelDeltaY/1e3||e.wheelDelta/1e3;o*=i.wheelSensitivity,1===e.deltaMode&&(o*=33),r.zoom({level:r.zoom()*Math.pow(10,o),renderedPosition:{x:a[0],y:a[1]}})}}},!0),i.registerBinding(window,"scroll",function(e){i.scrollingPage=!0,clearTimeout(i.scrollingPageTimeout),i.scrollingPageTimeout=setTimeout(function(){i.scrollingPage=!1},250)},!0),i.registerBinding(i.data.container,"mouseout",function(t){var r=i.projectIntoViewport(t.clientX,t.clientY);i.data.cy.trigger(new e.Event(t,{type:"mouseout",cyPosition:{x:r[0],y:r[1]}}))},!1),i.registerBinding(i.data.container,"mouseover",function(t){var r=i.projectIntoViewport(t.clientX,t.clientY);i.data.cy.trigger(new e.Event(t,{type:"mouseover",cyPosition:{x:r[0],y:r[1]}}))},!1);var _=function(e,t,i,r){return Math.sqrt((i-e)*(i-e)+(r-t)*(r-t))},E=function(e,t,i,r){return(i-e)*(i-e)+(r-t)*(r-t)};i.registerBinding(i.data.container,"touchstart",function(r){clearTimeout(this.threeFingerSelectTimeout),r.target!==i.data.link&&r.preventDefault(),i.touchData.capture=!0,i.data.bgActivePosistion=void 0;var a=i.data.cy,o=i.getCachedNodes(),s=i.getCachedEdges(),l=i.touchData.now,S=i.touchData.earlier,D=i.data.canvasNeedsRedraw;if(r.touches[0]){var k=i.projectIntoViewport(r.touches[0].clientX,r.touches[0].clientY);l[0]=k[0],l[1]=k[1]}if(r.touches[1]){k=i.projectIntoViewport(r.touches[1].clientX,r.touches[1].clientY);l[2]=k[0],l[3]=k[1]}if(r.touches[2]){k=i.projectIntoViewport(r.touches[2].clientX,r.touches[2].clientY);l[4]=k[0],l[5]=k[1]}if(r.touches[1]){var P=function(e){for(var t=0;t<e.length;t++)e[t]._private.grabbed=!1,e[t]._private.rscratch.inDragLayer=!1,e[t].active()&&e[t].unactivate()};P(o),P(s);var T=i.findContainerClientCoords();y=T[0],m=T[1],x=T[2],b=T[3],u=r.touches[0].clientX-y,c=r.touches[0].clientY-m,d=r.touches[1].clientX-y,h=r.touches[1].clientY-m,w=0<=u&&u<=x&&0<=d&&d<=x&&0<=c&&c<=b&&0<=h&&h<=b;var C=a.pan(),M=a.zoom();p=_(u,c,d,h),f=E(u,c,d,h),v=[((g=[(u+d)/2,(c+h)/2])[0]-C.x)/M,(g[1]-C.y)/M];if(f<4e4&&!r.touches[2]){var B=i.findNearestElement(l[0],l[1],!0,!0),N=i.findNearestElement(l[2],l[3],!0,!0);return B&&B.isNode()?(B.activate().trigger(new e.Event(r,{type:"cxttapstart",cyPosition:{x:l[0],y:l[1]}})),i.touchData.start=B):N&&N.isNode()?(N.activate().trigger(new e.Event(r,{type:"cxttapstart",cyPosition:{x:l[0],y:l[1]}})),i.touchData.start=N):(a.trigger(new e.Event(r,{type:"cxttapstart",cyPosition:{x:l[0],y:l[1]}})),i.touchData.start=null),i.touchData.start&&(i.touchData.start._private.grabbed=!1),i.touchData.cxt=!0,i.touchData.cxtDragged=!1,i.data.bgActivePosistion=void 0,void i.redraw()}}if(r.touches[2]);else if(r.touches[1]);else if(r.touches[0]){var I=i.findNearestElement(l[0],l[1],!0,!0);if(null!=I){if(I.activate(),i.touchData.start=I,I.isNode()&&i.nodeIsDraggable(I)){var O=i.dragData.touchDragEles=[];if(D[t.NODE]=!0,D[t.DRAG]=!0,I.selected())for(var z=a.$(function(){return this.isNode()&&this.selected()}),L=0;L<z.length;L++){var R=z[L];i.nodeIsDraggable(R)&&n(R,{addToList:O})}else n(I,{addToList:O});I.trigger(new e.Event(r,{type:"grab",cyPosition:{x:l[0],y:l[1]}}))}I.trigger(new e.Event(r,{type:"touchstart",cyPosition:{x:l[0],y:l[1]}})).trigger(new e.Event(r,{type:"tapstart",cyPosition:{x:l[0],y:l[1]}})).trigger(new e.Event(r,{type:"vmousdown",cyPosition:{x:l[0],y:l[1]}}))}null==I&&(a.trigger(new e.Event(r,{type:"touchstart",cyPosition:{x:l[0],y:l[1]}})).trigger(new e.Event(r,{type:"tapstart",cyPosition:{x:l[0],y:l[1]}})).trigger(new e.Event(r,{type:"vmousedown",cyPosition:{x:l[0],y:l[1]}})),i.data.bgActivePosistion={x:k[0],y:k[1]},D[t.SELECT_BOX]=!0,i.redraw());for(var V=0;V<l.length;V++)S[V]=l[V],i.touchData.startPosition[V]=l[V];i.touchData.singleTouchMoved=!1,i.touchData.singleTouchStartTime=+new Date,clearTimeout(i.touchData.tapholdTimeout),i.touchData.tapholdTimeout=setTimeout(function(){!1!==i.touchData.singleTouchMoved||i.pinching||(i.touchData.start?i.touchData.start.trigger(new e.Event(r,{type:"taphold",cyPosition:{x:l[0],y:l[1]}})):(i.data.cy.trigger(new e.Event(r,{type:"taphold",cyPosition:{x:l[0],y:l[1]}})),a.$(":selected").unselect()))},i.tapholdDuration)}},!1),i.registerBinding(window,"touchmove",e.util.throttle(function(r){var a=i.data.select,o=i.touchData.capture;o&&r.preventDefault();var s=i.data.cy,l=i.touchData.now,g=i.touchData.earlier,x=s.zoom(),b=i.data.canvasNeedsRedraw;if(r.touches[0]){var S=i.projectIntoViewport(r.touches[0].clientX,r.touches[0].clientY);l[0]=S[0],l[1]=S[1]}if(r.touches[1]){S=i.projectIntoViewport(r.touches[1].clientX,r.touches[1].clientY);l[2]=S[0],l[3]=S[1]}if(r.touches[2]){S=i.projectIntoViewport(r.touches[2].clientX,r.touches[2].clientY);l[4]=S[0],l[5]=S[1]}for(var D=[],k=0;k<l.length;k++)D[k]=l[k]-g[k];var P=i.touchData.startPosition,T=l[0]-P[0],C=T*T,M=l[1]-P[1],B=(C+M*M)*x*x;if(o&&i.touchData.cxt){var N=r.touches[0].clientX-y,I=r.touches[0].clientY-m,O=r.touches[1].clientX-y,z=r.touches[1].clientY-m,L=E(N,I,O,z);if(L/f>=2.25||L>=22500){i.touchData.cxt=!1,i.touchData.start&&(i.touchData.start.unactivate(),i.touchData.start=null),i.data.bgActivePosistion=void 0,b[t.SELECT_BOX]=!0;var R=new e.Event(r,{type:"cxttapend",cyPosition:{x:l[0],y:l[1]}});i.touchData.start?i.touchData.start.trigger(R):s.trigger(R)}}if(o&&i.touchData.cxt){R=new e.Event(r,{type:"cxtdrag",cyPosition:{x:l[0],y:l[1]}});i.data.bgActivePosistion=void 0,b[t.SELECT_BOX]=!0,i.touchData.start?i.touchData.start.trigger(R):s.trigger(R),i.touchData.start&&(i.touchData.start._private.grabbed=!1),i.touchData.cxtDragged=!0;var V=i.findNearestElement(l[0],l[1],!0,!0);i.touchData.cxtOver&&V===i.touchData.cxtOver||(i.touchData.cxtOver&&i.touchData.cxtOver.trigger(new e.Event(r,{type:"cxtdragout",cyPosition:{x:l[0],y:l[1]}})),i.touchData.cxtOver=V,V&&V.trigger(new e.Event(r,{type:"cxtdragover",cyPosition:{x:l[0],y:l[1]}})))}else if(o&&r.touches[2]&&s.boxSelectionEnabled())i.data.bgActivePosistion=void 0,clearTimeout(this.threeFingerSelectTimeout),this.lastThreeTouch=+new Date,i.touchData.selecting=!0,b[t.SELECT_BOX]=!0,a&&0!==a.length&&void 0!==a[0]?(a[2]=(l[0]+l[2]+l[4])/3,a[3]=(l[1]+l[3]+l[5])/3):(a[0]=(l[0]+l[2]+l[4])/3,a[1]=(l[1]+l[3]+l[5])/3,a[2]=(l[0]+l[2]+l[4])/3+1,a[3]=(l[1]+l[3]+l[5])/3+1),a[4]=1,i.touchData.selecting=!0,i.redraw();else if(o&&r.touches[1]&&s.zoomingEnabled()&&s.panningEnabled()&&s.userZoomingEnabled()&&s.userPanningEnabled()){if(i.data.bgActivePosistion=void 0,b[t.SELECT_BOX]=!0,ee=i.dragData.touchDragEles){b[t.DRAG]=!0;for(var A=0;A<ee.length;A++)ee[A]._private.grabbed=!1,ee[A]._private.rscratch.inDragLayer=!1}N=r.touches[0].clientX-y,I=r.touches[0].clientY-m,O=r.touches[1].clientX-y,z=r.touches[1].clientY-m;var X=_(N,I,O,z),F=X/p;if(1!=F&&w){var Y=(N-u+(O-d))/2,q=(I-c+(z-h))/2,j=s.zoom(),$=j*F,W=s.pan(),H=v[0]*j+W.x,Z=v[1]*j+W.y,U={x:-$/j*(H-W.x-Y)+H,y:-$/j*(Z-W.y-q)+Z};if(i.touchData.start){if(ee=i.dragData.touchDragEles)for(A=0;A<ee.length;A++){var G=ee[A]._private;G.grabbed=!1,G.rscratch.inDragLayer=!1}var K=i.touchData.start._private;K.active=!1,K.grabbed=!1,K.rscratch.inDragLayer=!1,b[t.DRAG]=!0,i.touchData.start.trigger("free").trigger("unactivate")}s.viewport({zoom:$,pan:U,cancelOnFailedZoom:!0}),p=X,u=N,c=I,d=O,h=z,i.pinching=!0}if(r.touches[0]){S=i.projectIntoViewport(r.touches[0].clientX,r.touches[0].clientY);l[0]=S[0],l[1]=S[1]}if(r.touches[1]){S=i.projectIntoViewport(r.touches[1].clientX,r.touches[1].clientY);l[2]=S[0],l[3]=S[1]}if(r.touches[2]){S=i.projectIntoViewport(r.touches[2].clientX,r.touches[2].clientY);l[4]=S[0],l[5]=S[1]}}else if(r.touches[0]){var J=i.touchData.start,Q=i.touchData.last;V=V||i.findNearestElement(l[0],l[1],!0,!0);if(null!=J&&"nodes"==J._private.group&&i.nodeIsDraggable(J))if(B>=i.touchTapThreshold2){for(var ee=i.dragData.touchDragEles,te=0;te<ee.length;te++){var ie=ee[te];if(i.nodeIsDraggable(ie)&&ie.isNode()&&ie.grabbed()){i.dragData.didDrag=!0;var re=ie._private.position,ne=!i.hoverData.draggingEles;if(e.is.number(D[0])&&e.is.number(D[1])&&(re.x+=D[0],re.y+=D[1]),ne){n(ie,{inDragLayer:!0}),b[t.NODE]=!0;var ae=i.touchData.dragDelta;e.is.number(ae[0])&&e.is.number(ae[1])&&(re.x+=ae[0],re.y+=ae[1])}}}var oe=new e.Collection(s,ie);oe.updateCompoundBounds(),oe.trigger("position drag"),i.hoverData.draggingEles=!0,b[t.DRAG]=!0,i.touchData.startPosition[0]==g[0]&&i.touchData.startPosition[1]==g[1]&&(b[t.NODE]=!0),i.redraw()}else{0===(ae=i.touchData.dragDelta=i.touchData.dragDelta||[]).length?(ae.push(D[0]),ae.push(D[1])):(ae[0]+=D[0],ae[1]+=D[1])}null!=J&&(J.trigger(new e.Event(r,{type:"touchmove",cyPosition:{x:l[0],y:l[1]}})),J.trigger(new e.Event(r,{type:"tapdrag",cyPosition:{x:l[0],y:l[1]}})),J.trigger(new e.Event(r,{type:"vmousemove",cyPosition:{x:l[0],y:l[1]}}))),null==J&&(null!=V&&(V.trigger(new e.Event(r,{type:"touchmove",cyPosition:{x:l[0],y:l[1]}})),V.trigger(new e.Event(r,{type:"tapdrag",cyPosition:{x:l[0],y:l[1]}})),V.trigger(new e.Event(r,{type:"vmousemove",cyPosition:{x:l[0],y:l[1]}}))),null==V&&(s.trigger(new e.Event(r,{type:"touchmove",cyPosition:{x:l[0],y:l[1]}})),s.trigger(new e.Event(r,{type:"tapdrag",cyPosition:{x:l[0],y:l[1]}})),s.trigger(new e.Event(r,{type:"vmousemove",cyPosition:{x:l[0],y:l[1]}})))),V!=Q&&(Q&&Q.trigger(new e.Event(r,{type:"tapdragout",cyPosition:{x:l[0],y:l[1]}})),V&&V.trigger(new e.Event(r,{type:"tapdragover",cyPosition:{x:l[0],y:l[1]}}))),i.touchData.last=V;for(A=0;A<l.length;A++)l[A]&&i.touchData.startPosition[A]&&Math.abs(l[A]-i.touchData.startPosition[A])>4&&(i.touchData.singleTouchMoved=!0);if(o&&(null==J||J.isEdge())&&s.panningEnabled()&&s.userPanningEnabled()){i.swipePanning?s.panBy({x:D[0]*x,y:D[1]*x}):B>=i.touchTapThreshold2&&(i.swipePanning=!0,s.panBy({x:T*x,y:M*x})),J&&(J.unactivate(),i.data.bgActivePosistion||(i.data.bgActivePosistion={x:l[0],y:l[1]}),b[t.SELECT_BOX]=!0,i.touchData.start=null);S=i.projectIntoViewport(r.touches[0].clientX,r.touches[0].clientY);l[0]=S[0],l[1]=S[1]}}for(k=0;k<l.length;k++)g[k]=l[k]},1e3/30,{trailing:!0}),!1),i.registerBinding(window,"touchcancel",function(e){var t=i.touchData.start;i.touchData.capture=!1,t&&t.unactivate()}),i.registerBinding(window,"touchend",function(r){var n=i.touchData.start;if(i.touchData.capture){i.touchData.capture=!1,r.preventDefault();var o=i.data.select;i.swipePanning=!1,i.hoverData.draggingEles=!1;var s,l=i.data.cy,u=l.zoom(),c=i.touchData.now,d=i.touchData.earlier,h=i.data.canvasNeedsRedraw;if(r.touches[0]){var p=i.projectIntoViewport(r.touches[0].clientX,r.touches[0].clientY);c[0]=p[0],c[1]=p[1]}if(r.touches[1]){p=i.projectIntoViewport(r.touches[1].clientX,r.touches[1].clientY);c[2]=p[0],c[3]=p[1]}if(r.touches[2]){p=i.projectIntoViewport(r.touches[2].clientX,r.touches[2].clientY);c[4]=p[0],c[5]=p[1]}if(n&&n.unactivate(),i.touchData.cxt){if(s=new e.Event(r,{type:"cxttapend",cyPosition:{x:c[0],y:c[1]}}),n?n.trigger(s):l.trigger(s),!i.touchData.cxtDragged){var f=new e.Event(r,{type:"cxttap",cyPosition:{x:c[0],y:c[1]}});n?n.trigger(f):l.trigger(f)}return i.touchData.start&&(i.touchData.start._private.grabbed=!1),i.touchData.cxt=!1,i.touchData.start=null,void i.redraw()}if(!r.touches[2]&&l.boxSelectionEnabled()&&i.touchData.selecting){i.touchData.selecting=!1,clearTimeout(this.threeFingerSelectTimeout);var g=[],v=i.getAllInBox(o[0],o[1],o[2],o[3]);o[0]=void 0,o[1]=void 0,o[2]=void 0,o[3]=void 0,o[4]=0,h[t.SELECT_BOX]=!0;for(var y=0;y<v.length;y++)v[y]._private.selectable&&g.push(v[y]);var m=new e.Collection(l,g);"single"===l.selectionType()&&l.$(":selected").unmerge(m).unselect(),m.select(),m.length>0?h[t.NODE]=!0:i.redraw()}var x=!1;if(null!=n&&(n._private.active=!1,x=!0,n.unactivate()),r.touches[2])i.data.bgActivePosistion=void 0,h[t.SELECT_BOX]=!0;else if(r.touches[1]);else if(r.touches[0]);else if(!r.touches[0]){i.data.bgActivePosistion=void 0,h[t.SELECT_BOX]=!0;var b=i.dragData.touchDragEles;if(null!=n){var w=n._private.grabbed;a(b),h[t.DRAG]=!0,h[t.NODE]=!0,w&&n.trigger("free"),n.trigger(new e.Event(r,{type:"touchend",cyPosition:{x:c[0],y:c[1]}})).trigger(new e.Event(r,{type:"tapend",cyPosition:{x:c[0],y:c[1]}})).trigger(new e.Event(r,{type:"vmouseup",cyPosition:{x:c[0],y:c[1]}})),n.unactivate(),i.touchData.start=null}else{var _=i.findNearestElement(c[0],c[1],!0,!0);null!=_&&_.trigger(new e.Event(r,{type:"touchend",cyPosition:{x:c[0],y:c[1]}})).trigger(new e.Event(r,{type:"tapend",cyPosition:{x:c[0],y:c[1]}})).trigger(new e.Event(r,{type:"vmouseup",cyPosition:{x:c[0],y:c[1]}})),null==_&&l.trigger(new e.Event(r,{type:"touchend",cyPosition:{x:c[0],y:c[1]}})).trigger(new e.Event(r,{type:"tapend",cyPosition:{x:c[0],y:c[1]}})).trigger(new e.Event(r,{type:"vmouseup",cyPosition:{x:c[0],y:c[1]}}))}var E=i.touchData.startPosition[0]-c[0],S=E*E,D=i.touchData.startPosition[1]-c[1],k=(S+D*D)*u*u;null!=n&&!i.dragData.didDrag&&n._private.selectable&&k<i.touchTapThreshold2&&!i.pinching&&("single"===l.selectionType()?(l.$(":selected").unmerge(n).unselect(),n.select()):n.selected()?n.unselect():n.select(),x=!0,h[t.NODE]=!0),!1===i.touchData.singleTouchMoved&&(n?n.trigger(new e.Event(r,{type:"tap",cyPosition:{x:c[0],y:c[1]}})).trigger(new e.Event(r,{type:"vclick",cyPosition:{x:c[0],y:c[1]}})):l.trigger(new e.Event(r,{type:"tap",cyPosition:{x:c[0],y:c[1]}})).trigger(new e.Event(r,{type:"vclick",cyPosition:{x:c[0],y:c[1]}}))),i.touchData.singleTouchMoved=!0}for(var P=0;P<c.length;P++)d[P]=c[P];i.dragData.didDrag=!1,0===r.touches.length&&(i.touchData.dragDelta=[]),x&&n&&n.updateStyle(!1),r.touches.length<2&&(i.pinching=!1,h[t.NODE]=!0,i.redraw())}},!1)}}(cytoscape),function(e){"use strict";for(var t=e("renderer","canvas"),i=t.prototype,r=t.usePaths(),n=t.nodeShapes={},a=Math.sin(0),o=Math.cos(0),s={},l={},u=0*Math.PI;u<2*Math.PI;u+=.1)s[u]=Math.sin(u),l[u]=Math.cos(u);function c(t,r){n[t]={points:r,draw:function(e,r,a,o,s){i.drawPolygon(e,r,a,o,s,n[t].points)},drawPath:function(e,r,a,o,s){i.drawPolygonPath(e,r,a,o,s,n[t].points)},intersectLine:function(i,r,a,o,s,l,u){return e.math.polygonIntersectLine(s,l,n[t].points,i,r,a/2,o/2,u)},intersectBox:function(i,r,a,o,s,l,u,c,d){var h=n[t].points;return e.math.boxIntersectPolygon(i,r,a,o,h,s,l,u,c,[0,-1],d)},checkPoint:function(i,r,a,o,s,l,u){return e.math.pointInsidePolygon(i,r,n[t].points,l,u,o,s,[0,-1],a)}}}n.ellipse={draw:function(e,t,i,r,a){n.ellipse.drawPath(e,t,i,r,a),e.fill()},drawPath:function(e,t,i,n,u){if(r){var c,d;e.beginPath&&e.beginPath();for(var h=n/2,p=u/2,f=0*Math.PI;f<2*Math.PI;f+=.1)c=t-h*s[f]*a+h*l[f]*o,d=i+p*l[f]*a+p*s[f]*o,0===f?e.moveTo(c,d):e.lineTo(c,d);e.closePath()}else e.beginPath&&e.beginPath(),e.translate(t,i),e.scale(n/2,u/2),e.arc(0,0,1,0,2*Math.PI*.999,!1),e.closePath(),e.scale(2/n,2/u),e.translate(-t,-i)},intersectLine:function(t,i,r,n,a,o,s){return e.math.intersectLineEllipse(a,o,t,i,r/2+s,n/2+s)},intersectBox:function(t,i,r,n,a,o,s,l,u){return e.math.boxIntersectEllipse(t,i,r,n,u,a,o,s,l)},checkPoint:function(e,t,i,r,n,a,o){return e-=a,t-=o,e/=r/2+i,t/=n/2+i,Math.pow(e,2)+Math.pow(t,2)<=1}},c("triangle",e.math.generateUnitNgonPointsFitToSquare(3,0)),c("square",e.math.generateUnitNgonPointsFitToSquare(4,0)),n.rectangle=n.square,n.roundrectangle={points:e.math.generateUnitNgonPointsFitToSquare(4,0),draw:function(e,t,r,n,a){i.drawRoundRectangle(e,t,r,n,a,10)},drawPath:function(e,t,r,n,a){i.drawRoundRectanglePath(e,t,r,n,a,10)},intersectLine:function(t,i,r,n,a,o,s){return e.math.roundRectangleIntersectLine(a,o,t,i,r,n,s)},intersectBox:function(t,i,r,n,a,o,s,l,u){return e.math.roundRectangleIntersectBox(t,i,r,n,a,o,s,l,u)},checkPoint:function(t,i,r,a,o,s,l){var u=e.math.getRoundRectangleRadius(a,o);if(e.math.pointInsidePolygon(t,i,n.roundrectangle.points,s,l,a,o-2*u,[0,-1],r))return!0;if(e.math.pointInsidePolygon(t,i,n.roundrectangle.points,s,l,a-2*u,o,[0,-1],r))return!0;var c=function(e,t,i,r,n,a,o){return e-=i,t-=r,e/=n/2+o,t/=a/2+o,Math.pow(e,2)+Math.pow(t,2)<=1};return!!c(t,i,s-a/2+u,l-o/2+u,2*u,2*u,r)||(!!c(t,i,s+a/2-u,l-o/2+u,2*u,2*u,r)||(!!c(t,i,s+a/2-u,l+o/2-u,2*u,2*u,r)||!!c(t,i,s-a/2+u,l+o/2-u,2*u,2*u,r)))}},c("diamond",[0,1,1,0,0,-1,-1,0]),c("pentagon",e.math.generateUnitNgonPointsFitToSquare(5,0)),c("hexagon",e.math.generateUnitNgonPointsFitToSquare(6,0)),c("heptagon",e.math.generateUnitNgonPointsFitToSquare(7,0)),c("octagon",e.math.generateUnitNgonPointsFitToSquare(8,0));var d=new Array(20),h=e.math.generateUnitNgonPoints(5,0),p=e.math.generateUnitNgonPoints(5,Math.PI/5),f=.5*(3-Math.sqrt(5));f*=1.57;for(u=0;u<p.length/2;u++)p[2*u]*=f,p[2*u+1]*=f;for(u=0;u<5;u++)d[4*u]=h[2*u],d[4*u+1]=h[2*u+1],d[4*u+2]=p[2*u],d[4*u+3]=p[2*u+1];c("star",d=e.math.fitPolygonToSquare(d)),c("vee",[-1,-1,0,-.333,1,-1,0,1]),c("rhomboid",[-1,-1,.333,-1,1,1,-.333,1])}(cytoscape),function(e){"use strict";var t={animate:!0,maxSimulationTime:4e3,fit:!0,padding:30,boundingBox:void 0,ungrabifyWhileSimulating:!1,ready:void 0,stop:void 0,repulsion:void 0,stiffness:void 0,friction:void 0,gravity:!0,fps:void 0,precision:void 0,nodeMass:void 0,edgeLength:void 0,stepSize:.1,stableEnergy:function(e){var t=e;return t.max<=.5||t.mean<=.3},infinite:!1};function i(i){this._private={},this._private.options=e.util.extend({},t,i)}i.prototype.run=function(){var t=this,i=this._private.options;return e.util.require("arbor",function(r){var n=i.cy,a=i.eles,o=a.nodes().not(":parent"),s=a.edges(),l=e.util.makeBoundingBox(i.boundingBox?i.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()}),u=!1;if(t.trigger({type:"layoutstart",layout:t}),void 0!==i.liveUpdate&&(i.animate=i.liveUpdate),a.nodes().size()<=1)return i.fit&&n.reset(),a.nodes().position({x:Math.round((l.x1+l.x2)/2),y:Math.round((l.y1+l.y2)/2)}),t.one("layoutready",i.ready),t.trigger({type:"layoutready",layout:t}),t.one("layoutstop",i.stop),void t.trigger({type:"layoutstop",layout:t});var c=t._private.system=r.ParticleSystem();c.parameters({repulsion:i.repulsion,stiffness:i.stiffness,friction:i.friction,gravity:i.gravity,fps:i.fps,dt:i.dt,precision:i.precision}),i.animate&&i.fit&&n.fit(l,i.padding);var d,h,p,f,g,v,y=!1,m=(new Date,{init:function(e){},redraw:function(){var e=c.energy();if(!i.infinite&&null!=i.stableEnergy&&null!=e&&e.n>0&&i.stableEnergy(e))t.stop();else{i.infinite||(clearTimeout(d),d=setTimeout(w,250));var r=n.collection();c.eachNode(function(e,t){var i=e.data.element;null!=i&&(i.locked()||i.grabbed()||(i.silentPosition({x:l.x1+t.x,y:l.y1+t.y}),r.merge(i)))}),i.animate&&r.length>0&&(u=!0,r.rtrigger("position"),i.fit&&n.fit(i.padding),+new Date,u=!1),y||(y=!0,t.one("layoutready",i.ready),t.trigger({type:"layoutready",layout:t}))}}});function x(e,t){return null==t?void 0:"function"==typeof t?t.apply(e,[e._private.data,{nodes:o.length,edges:s.length,element:e}]):t}c.renderer=m,c.screenSize(l.w,l.h),c.screenPadding(i.padding,i.padding,i.padding,i.padding),c.screenStep(i.stepSize),o.on("grab free position",h=function(e){if(!u){var t=this.position(),n=c.fromScreen(t);if(n){var a=r.Point(n.x,n.y),o=i.padding;switch(l.x1+o<=t.x&&t.x<=l.x2-o&&l.y1+o<=t.y&&t.y<=l.y2-o&&(this.scratch().arbor.p=a),e.type){case"grab":this.scratch().arbor.fixed=!0;break;case"free":this.scratch().arbor.fixed=!1}}}}),o.on("lock unlock",p=function(e){node.scratch().arbor.fixed=node.locked()}),a.on("remove",f=function(e){}),n.on("add","*",g=function(){}),n.on("resize",v=function(){if(null==i.boundingBox&&null!=t._private.system){var e=n.width(),r=n.height();c.screenSize(e,r)}}),o.each(function(e,t){!function(e){if(!e.isFullAutoParent()){var t=e._private.data.id,r=x(e,i.nodeMass),n=e._private.locked,a=e.position(),o=c.fromScreen({x:a.x,y:a.y});e.scratch().arbor=c.addNode(t,{element:e,mass:r,fixed:n,x:n&&o?o.x:void 0,y:n&&o?o.y:void 0})}}(t)}),s.each(function(e,t){!function(e){var t=e.source().id(),r=e.target().id(),n=x(e,i.edgeLength);e.scratch().arbor=c.addEdge(t,r,{length:n})}(t)});var b=o.filter(":grabbable");i.ungrabifyWhileSimulating&&b.ungrabify();var w=t._private.doneHandler=function(){t._private.doneHandler=null,i.animate||(i.fit&&n.reset(),o.rtrigger("position")),o.off("grab free position",h),o.off("lock unlock",p),a.off("remove",f),n.off("add","*",g),n.off("resize",v),i.ungrabifyWhileSimulating&&b.grabify(),t.one("layoutstop",i.stop),t.trigger({type:"layoutstop",layout:t})};c.start(),!i.infinite&&null!=i.maxSimulationTime&&i.maxSimulationTime>0&&i.maxSimulationTime!==1/0&&setTimeout(function(){t.stop()},i.maxSimulationTime)}),this},i.prototype.stop=function(){return null!=this._private.system&&this._private.system.stop(),this._private.doneHandler&&this._private.doneHandler(),this},e("layout","arbor",i)}(cytoscape),function(e){"use strict";var t={fit:!0,directed:!1,padding:30,circle:!1,spacingFactor:1.75,boundingBox:void 0,avoidOverlap:!0,roots:void 0,maximalAdjustments:0,animate:!1,animationDuration:500,ready:void 0,stop:void 0};function i(i){this.options=e.util.extend({},t,i)}i.prototype.run=function(){var t,i=this.options,r=i,n=i.cy,a=r.eles,o=a.nodes().not(":parent"),s=a,l=e.util.makeBoundingBox(r.boundingBox?r.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()});if(e.is.elementOrCollection(r.roots))t=r.roots;else if(e.is.array(r.roots)){for(var u=[],c=0;c<r.roots.length;c++){var d=r.roots[c],h=n.getElementById(d);u.push(h)}t=new e.Collection(n,u)}else if(e.is.string(r.roots))t=n.$(r.roots);else if(r.directed)t=o.roots();else{for(var p=[],f=o;f.length>0;){var g=n.collection();a.bfs({roots:f[0],visit:function(e,t,i,r,n){g=g.add(i)},directed:!1}),f=f.not(g),p.push(g)}t=n.collection();for(c=0;c<p.length;c++){var v=p[c],y=v.maxDegree(!1),m=v.filter(function(){return this.degree(!1)===y});t=t.add(m)}}var x=[],b={},w={},_={},E={},S={};s.bfs({roots:t,directed:r.directed,visit:function(e,t,i,r,n){var a=this[0],o=a.id();if(x[t]||(x[t]=[]),x[t].push(a),b[o]=!0,w[o]=t,_[o]=n,E[o]=r,n){var s=n.id();(S[s]=S[s]||[]).push(i)}}});var D=[];for(c=0;c<o.length;c++){h=o[c];b[h.id()]||D.push(h)}for(var k=3*D.length,P=0;0!==D.length&&P<k;){var T=(M=D.shift()).neighborhood().nodes(),C=!1;for(c=0;c<T.length;c++){if(void 0!==(ee=w[T[c].id()])){x[ee].push(M),C=!0;break}}C||D.push(M),P++}for(;0!==D.length;){var M=D.shift();(C=!1)||(0===x.length&&x.push([]),x[0].push(M))}var B=function(){for(var e=0;e<x.length;e++)for(var t=x[e],i=0;i<t.length;i++){t[i]._private.scratch.breadthfirst={depth:e,index:i}}};B();for(var N=function(e){for(var t,i=e.connectedEdges(function(){return this.data("target")===e.id()}),r=e._private.scratch.breadthfirst,n=0,a=0;a<i.length;a++){var o=i[a].source()[0],s=o._private.scratch.breadthfirst;r.depth<=s.depth&&n<s.depth&&(n=s.depth,t=o)}return t},I=0;I<r.maximalAdjustments;I++){var O=x.length,z=[];for(c=0;c<O;c++)for(var L=(ee=x[c]).length,R=0;R<L;R++){var V=(h=ee[R])._private.scratch.breadthfirst;(A=N(h))&&(V.intEle=A,z.push(h))}for(c=0;c<z.length;c++){var A,X=(A=(V=(h=z[c])._private.scratch.breadthfirst).intEle)._private.scratch.breadthfirst;x[V.depth].splice(V.index,1);for(var F=X.depth+1;F>x.length-1;)x.push([]);x[F].push(h),V.depth=F,V.index=x[F].length-1}B()}var Y=0;if(r.avoidOverlap){for(c=0;c<o.length;c++){var q=o[c].outerWidth(),j=o[c].outerHeight();Y=Math.max(Y,q,j)}Y*=r.spacingFactor}for(var $={},W=function(e){if($[e.id()])return $[e.id()];for(var t=e._private.scratch.breadthfirst.depth,i=e.neighborhood().nodes().not(":parent"),r=0,n=0,a=0;a<i.length;a++){var o=i[a]._private.scratch.breadthfirst,s=o.index,l=o.depth,u=x[l].length;(t>l||0===t)&&(r+=s/u,n++)}return r/=n=Math.max(1,n),0===n&&(r=void 0),$[e.id()]=r,r},H=function(e,t){return W(e)-W(t)},Z=0;Z<3;Z++){for(c=0;c<x.length;c++)x[c]=x[c].sort(H);B()}var U=0;for(c=0;c<x.length;c++)U=Math.max(x[c].length,U);var G=l.x1+l.w/2,K=l.x1+l.h/2,J=function(e,t){var i=e._private.scratch.breadthfirst,n=i.depth,a=i.index,o=x[n].length,s=Math.max(l.w/(o+1),Y),u=Math.max(l.h/(x.length+1),Y),c=Math.min(l.w/2/x.length,l.h/2/x.length);if(c=Math.max(c,Y),r.circle){if(r.circle){var d=c*n+c-(x.length>0&&x[0].length<=3?c/2:0),h=2*Math.PI/x[n].length*a;return 0===n&&1===x[0].length&&(d=1),{x:G+d*Math.cos(h),y:K+d*Math.sin(h)}}return{x:G+(a+1-(o+1)/2)*s,y:(n+1)*u}}var p={x:G+(a+1-(o+1)/2)*s,y:(n+1)*u};return p},Q={};for(c=x.length-1;c>=0;c--){var ee=x[c];for(R=0;R<ee.length;R++){M=ee[R];Q[M.id()]=J(M,x.length)}}return o.layoutPositions(this,r,function(){return Q[this.id()]}),this},e("layout","breadthfirst",i)}(cytoscape),function(e){"use strict";var t={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,radius:void 0,startAngle:1.5*Math.PI,counterclockwise:!1,sort:void 0,animate:!1,animationDuration:500,ready:void 0,stop:void 0};function i(i){this.options=e.util.extend({},t,i)}i.prototype.run=function(){var t=this.options,i=t,r=t.cy,n=i.eles.nodes().not(":parent");i.sort&&(n=n.sort(i.sort));for(var a,o=e.util.makeBoundingBox(i.boundingBox?i.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()}),s=o.x1+o.w/2,l=o.y1+o.h/2,u=i.startAngle,c=2*Math.PI/n.length,d=0,h=0;h<n.length;h++){var p=n[h].outerWidth(),f=n[h].outerHeight();d=Math.max(d,p,f)}if(a=e.is.number(i.radius)?i.radius:n.length<=1?0:Math.min(o.h,o.w)/2-d,n.length>1&&i.avoidOverlap){d*=1.75;c=2*Math.PI/n.length;var g=Math.cos(c)-Math.cos(0),v=Math.sin(c)-Math.sin(0),y=Math.sqrt(d*d/(g*g+v*v));a=Math.max(y,a)}return n.layoutPositions(this,i,function(e,t){var r=a*Math.cos(u),n=a*Math.sin(u),o={x:s+r,y:l+n};return u=i.counterclockwise?u-c:u+c,o}),this},e("layout","circle",i)}(cytoscape),function(e){"use strict";var t={animate:!0,refresh:1,maxSimulationTime:4e3,ungrabifyWhileSimulating:!1,fit:!0,padding:30,boundingBox:void 0,ready:function(){},stop:function(){},randomize:!1,avoidOverlap:!0,handleDisconnected:!0,nodeSpacing:function(e){return 10},flow:void 0,alignment:void 0,edgeLength:void 0,edgeSymDiffLength:void 0,edgeJaccardLength:void 0,unconstrIter:void 0,userConstIter:void 0,allConstIter:void 0,infinite:!1};function i(i){this.options=e.util.extend(!0,{},t,i)}i.prototype.run=function(){var t=this,i=this.options;return t.manuallyStopped=!1,e.util.require("cola",function(r){var n=i.cy,a=i.eles,o=a.nodes(),s=a.edges(),l=!1,u=e.util.makeBoundingBox(i.boundingBox?i.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()}),c=function(t,i){return e.is.fn(t)?t.apply(i,[i]):t},d=function(){for(var t={min:1/0,max:-1/0},r={min:1/0,max:-1/0},a=0;a<o.length;a++){var s=o[a],d=s._private.scratch.cola;if(t.min=Math.min(t.min,d.x||0),t.max=Math.max(t.max,d.x||0),r.min=Math.min(r.min,d.y||0),r.max=Math.max(r.max,d.y||0),!d.updatedDims){var h=s.boundingBox(),f=c(i.nodeSpacing,s);d.width=h.w+2*f,d.height=h.h+2*f}}o.positions(function(i,n){var a,o=n._private.scratch.cola;return n.grabbed()||n.isParent()||(a={x:u.x1+o.x-t.min,y:u.y1+o.y-r.min},e.is.number(a.x)&&e.is.number(a.y)||(a=void 0)),a}),o.updateCompoundBounds(),l||(p(),l=!0),i.fit&&n.fit(i.padding)},h=function(){i.ungrabifyWhileSimulating&&m.grabify(),o.off("grab free position",v),o.off("lock unlock",y),t.one("layoutstop",i.stop),t.trigger({type:"layoutstop",layout:t})},p=function(){t.one("layoutready",i.ready),t.trigger({type:"layoutready",layout:t})},f=i.refresh;i.refresh<0?(Math.abs(i.refresh),f=1):f=Math.max(1,f);var g=t.adaptor=r.adaptor({trigger:function(e){var t=r.EventType?r.EventType.tick:null,n=r.EventType?r.EventType.end:null;switch(e.type){case"tick":case t:i.animate&&d();break;case"end":case n:d(),i.infinite||h()}},kick:function(){var r=function(){if(t.manuallyStopped)return h(),!0;var e=g.tick();return e&&i.infinite&&g.resume(),e};if(i.animate){var n=function(){(function(){for(var e,t=0;t<f&&!e;t++)e=e||r();return e})()||e.util.requestAnimationFrame(n)};e.util.requestAnimationFrame(n)}else for(;!r(););},on:function(e,t){},drag:function(){}});t.adaptor=g;var v,y,m=o.filter(":grabbable");i.ungrabifyWhileSimulating&&m.ungrabify(),o.on("grab free position",v=function(t){var i=this._private.scratch.cola,r=this._private.position;switch(this.grabbed()?(i.x=r.x-u.x1,i.y=r.y-u.y1,g.dragstart(i)):e.is.number(i.x)&&e.is.number(i.y)&&(r.x=i.x+u.x1,r.y=i.y+u.y1),t.type){case"grab":g.dragstart(i),g.resume();break;case"free":g.dragend(i)}}),o.on("lock unlock",y=function(e){var t=this._private.scratch.cola;this.locked()?g.dragstart(t):g.dragend(t)});var x,b,w=o.stdFilter(function(e){return!e.isParent()});if(g.nodes(w.map(function(e,t){var r=c(i.nodeSpacing,e),n=e.position(),a=e.boundingBox();return e._private.scratch.cola={x:i.randomize||void 0===n.x?Math.round(Math.random()*u.w):n.x,y:i.randomize||void 0===n.y?Math.round(Math.random()*u.h):n.y,width:a.w+2*r,height:a.h+2*r,index:t}})),i.alignment){var _=[],E=[];w.forEach(function(e){var t=c(i.alignment,e),r=e._private.scratch.cola.index;t&&(null!=t.x&&_.push({node:r,offset:t.x}),null!=t.y&&E.push({node:r,offset:t.y}))});var S=[];_.length>0&&S.push({type:"alignment",axis:"x",offsets:_}),E.length>0&&S.push({type:"alignment",axis:"y",offsets:E}),g.constraints(S)}g.groups(o.stdFilter(function(e){return e.isParent()}).map(function(e,t){var r=e._private.style,n=c(i.nodeSpacing,e),a=r["padding-left"].pxValue+n,o=r["padding-right"].pxValue+n,s=r["padding-top"].pxValue+n,l=r["padding-bottom"].pxValue+n;return e._private.scratch.cola={index:t,padding:Math.max(a,o,s,l),leaves:e.descendants().stdFilter(function(e){return!e.isParent()}).map(function(e){return e[0]._private.scratch.cola.index})},e}).map(function(e){return e._private.scratch.cola.groups=e.descendants().stdFilter(function(e){return e.isParent()}).map(function(e){return e._private.scratch.cola.index}),e._private.scratch.cola})),null!=i.edgeLength?(x=i.edgeLength,b="linkDistance"):null!=i.edgeSymDiffLength?(x=i.edgeSymDiffLength,b="symmetricDiffLinkLengths"):null!=i.edgeJaccardLength?(x=i.edgeJaccardLength,b="jaccardLinkLengths"):(x=100,b="linkDistance");if(g.links(s.stdFilter(function(e){return!e.source().isParent()&&!e.target().isParent()}).map(function(e,t){var i=e._private.scratch.cola={source:e.source()[0]._private.scratch.cola.index,target:e.target()[0]._private.scratch.cola.index};return null!=x&&(i.calcLength=c(x,e)),i})),g.size([u.w,u.h]),null!=x&&g[b](function(e){return e.calcLength}),i.flow){var D;e.is.string(i.flow)?D={axis:i.flow,minSeparation:50}:e.is.number(i.flow)?D={axis:"y",minSeparation:i.flow}:e.is.plainObject(i.flow)?((D=i.flow).axis=D.axis||"y",D.minSeparation=null!=D.minSeparation?D.minSeparation:50):D={axis:"y",minSeparation:50},g.flowLayout(D.axis,D.minSeparation)}t.trigger({type:"layoutstart",layout:t}),g.avoidOverlaps(i.avoidOverlap).handleDisconnected(i.handleDisconnected).start(i.unconstrIter,i.userConstIter,i.allConstIter),i.infinite||setTimeout(function(){t.manuallyStopped||g.stop()},i.maxSimulationTime)}),this},i.prototype.stop=function(){return this.adaptor&&(this.manuallyStopped=!0,this.adaptor.stop()),this},e("layout","cola",i)}(cytoscape),function(e){"use strict";var t={fit:!0,padding:30,startAngle:1.5*Math.PI,counterclockwise:!1,minNodeSpacing:10,boundingBox:void 0,avoidOverlap:!0,height:void 0,width:void 0,concentric:function(e){return e.degree()},levelWidth:function(e){return e.maxDegree()/4},animate:!1,animationDuration:500,ready:void 0,stop:void 0};function i(i){this.options=e.util.extend({},t,i)}i.prototype.run=function(){for(var t=this.options,i=t,r=t.cy,n=i.eles.nodes().not(":parent"),a=e.util.makeBoundingBox(i.boundingBox?i.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()}),o=a.x1+a.w/2,s=a.y1+a.h/2,l=[],u=i.startAngle,c=0,d=0;d<n.length;d++){var h,p=n[d];h=i.concentric.apply(p,[p]),l.push({value:h,node:p}),p._private.scratch.concentric=h}n.updateStyle();for(d=0;d<n.length;d++){p=n[d];c=Math.max(c,p.outerWidth(),p.outerHeight())}l.sort(function(e,t){return t.value-e.value});var f=i.levelWidth(n),g=[[]],v=g[0];for(d=0;d<l.length;d++){var y=l[d];if(v.length>0)Math.abs(v[0].value-y.value)>=f&&(v=[],g.push(v));v.push(y)}var m={},x=0,b=c+i.minNodeSpacing;if(!i.avoidOverlap){var w=g.length>0&&g[0].length>1,_=(Math.min(a.w,a.h)/2-b)/(g.length+w?1:0);b=Math.min(b,_)}for(d=0;d<g.length;d++){var E=g[d],S=2*Math.PI/E.length;if(E.length>1&&i.avoidOverlap){var D=Math.cos(S)-Math.cos(0),k=Math.sin(S)-Math.sin(0),P=Math.sqrt(b*b/(D*D+k*k));x=Math.max(P,x)}for(var T=0;T<E.length;T++){y=E[T],u=i.startAngle+(i.counterclockwise?-1:1)*S*T;var C={x:o+x*Math.cos(u),y:s+x*Math.sin(u)};m[y.node.id()]=C}x+=b}return n.layoutPositions(this,i,function(){var e=this.id();return m[e]}),this},e("layout","concentric",i)}(cytoscape),function(e){"use strict";var t,i={ready:function(){},stop:function(){},animate:!0,refresh:4,fit:!0,padding:30,boundingBox:void 0,randomize:!0,debug:!1,nodeRepulsion:4e5,nodeOverlap:10,idealEdgeLength:10,edgeElasticity:100,nestingFactor:5,gravity:250,numIter:100,initialTemp:200,coolingFactor:.95,minTemp:1};function r(t){this.options=e.util.extend({},i,t)}r.prototype.run=function(){var i=this.options,r=i.cy,a=this;a.stopped=!1,a.trigger({type:"layoutstart",layout:a}),t=!0===i.debug;new Date;var o=n(r,a,i);t&&s(o),!0===i.randomize&&l(o,r),m(o,r,i);var d=function(e){return!a.stopped&&(c(o,r,i,e),o.temperature=o.temperature*i.coolingFactor,!(o.temperature<i.minTemp))},h=function(){u(o,r,i),!0===i.fit&&r.fit(i.padding);new Date;a.one("layoutstop",i.stop),a.trigger({type:"layoutstop",layout:a})};if(i.animate){var p=0,f=function(){for(var t=0;t<i.refresh&&p<i.numIter;){var n;if(!1===(n=d(p)))break;t++,p++}u(o,r,i),i.fit&&r.fit(i.padding),!1!==n&&p+1<i.numIter?e.util.requestAnimationFrame(f):h()};e.util.requestAnimationFrame(f)}else{for(p=0;p<i.numIter&&!1!==d(p);p++);h()}return this},r.prototype.stop=function(){return this.stopped=!0,this};var n=function(t,i,r){for(var n=r.eles.edges(),o=r.eles.nodes(),s={layout:i,layoutNodes:[],idToIndex:{},nodeSize:o.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:n.size(),temperature:r.initialTemp,clientWidth:t.width(),clientHeight:t.width(),boundingBox:e.util.makeBoundingBox(r.boundingBox?r.boundingBox:{x1:0,y1:0,w:t.width(),h:t.height()})},l=0;l<s.nodeSize;l++){(C={}).id=o[l].data("id"),C.parentId=o[l].data("parent"),C.children=[],C.positionX=o[l].position("x"),C.positionY=o[l].position("y"),C.offsetX=0,C.offsetY=0,C.height=o[l].height(),C.width=o[l].width(),C.maxX=C.positionX+C.width/2,C.minX=C.positionX-C.width/2,C.maxY=C.positionY+C.height/2,C.minY=C.positionY-C.height/2,C.padLeft=o[l]._private.style["padding-left"].pxValue,C.padRight=o[l]._private.style["padding-right"].pxValue,C.padTop=o[l]._private.style["padding-top"].pxValue,C.padBottom=o[l]._private.style["padding-bottom"].pxValue,s.layoutNodes.push(C),s.idToIndex[C.id]=l}var u=[],c=0,d=-1,h=[];for(l=0;l<s.nodeSize;l++){var p=s.layoutNodes[l],f=p.parentId;null!=f?s.layoutNodes[s.idToIndex[f]].children.push(p.id):(u[++d]=p.id,h.push(p.id))}for(s.graphSet.push(h);c<=d;){var g=u[c++],v=s.idToIndex[g],y=s.layoutNodes[v].children;if(y.length>0){s.graphSet.push(y);for(l=0;l<y.length;l++)u[++d]=y[l]}}for(l=0;l<s.graphSet.length;l++)for(var m=s.graphSet[l],x=0;x<m.length;x++){var b=s.idToIndex[m[x]];s.indexToGraph[b]=l}for(l=0;l<s.edgeSize;l++){var w=n[l],_={};_.id=w.data("id"),_.sourceId=w.data("source"),_.targetId=w.data("target");var E=r.idealEdgeLength,S=s.idToIndex[_.sourceId],D=s.idToIndex[_.targetId];if(s.indexToGraph[S]!=s.indexToGraph[D]){for(var k=a(_.sourceId,_.targetId,s),P=s.graphSet[k],T=0,C=s.layoutNodes[S];-1===$.inArray(C.id,P);)C=s.layoutNodes[s.idToIndex[C.parentId]],T++;for(C=s.layoutNodes[D];-1===$.inArray(C.id,P);)C=s.layoutNodes[s.idToIndex[C.parentId]],T++;E*=T*r.nestingFactor}_.idealLength=E,s.layoutEdges.push(_)}return s},a=function(e,t,i){var r=o(e,t,0,i);return 2>r.count?0:r.graph},o=function(e,t,i,r){var n=r.graphSet[i];if(-1<$.inArray(e,n)&&-1<$.inArray(t,n))return{count:2,graph:i};for(var a=0,s=0;s<n.length;s++){var l=n[s],u=r.idToIndex[l],c=r.layoutNodes[u].children;if(0!==c.length){var d=r.indexToGraph[r.idToIndex[c[0]]],h=o(e,t,d,r);if(0!==h.count){if(1!==h.count)return h;if(2===++a)break}}}return{count:a,graph:i}},s=function(e){if(t){for(var i=0;i<e.nodeSize;i++){var r=e.layoutNodes[i];r.id,r.children.toString(),r.parentId,r.positionX,r.positionY,r.offsetX,r.offsetY,r.padLeft,r.padRight,r.padTop,r.padBottom}for(var i in e.idToIndex);var n=e.graphSet;for(i=0;i<n.length;i++);for(i=0;i<e.indexToGraph.length;i++)"\nIndex : "+i+" Graph: "+e.indexToGraph[i];"Layout Edges";for(i=0;i<e.layoutEdges.length;i++){var a=e.layoutEdges[i];"\nEdge Index: "+i+" ID: "+a.id+" SouceID: "+a.sourceId+" TargetId: "+a.targetId+" Ideal Length: "+a.idealLength}"nodeSize: "+e.nodeSize,"\nedgeSize: "+e.edgeSize,"\ntemperature: "+e.temperature}},l=function(e,t){for(var i=e.clientWidth,r=e.clientHeight,n=0;n<e.nodeSize;n++){var a=e.layoutNodes[n];a.positionX=Math.random()*i,a.positionY=Math.random()*r}},u=function(e,t,i){var r=e.layout,n=i.eles.nodes(),a=e.boundingBox,o={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0};i.boundingBox&&(n.forEach(function(t){var i=e.layoutNodes[e.idToIndex[t.data("id")]];o.x1=Math.min(o.x1,i.positionX),o.x2=Math.max(o.x2,i.positionX),o.y1=Math.min(o.y1,i.positionY),o.y2=Math.max(o.y2,i.positionY)}),o.w=o.x2-o.x1,o.h=o.y2-o.y1),n.positions(function(t,r){var n=e.layoutNodes[e.idToIndex[r.data("id")]];if(i.boundingBox){var s=(n.positionX-o.x1)/o.w,l=(n.positionY-o.y1)/o.h;return{x:a.x1+s*a.w,y:a.y1+l*a.h}}return{x:n.positionX,y:n.positionY}}),!0!==e.ready&&(e.ready=!0,r.one("layoutready",i.ready),r.trigger({type:"layoutready",layout:this}))},c=function(e,t,i,r){d(e,t,i),g(e,t,i),v(e,t,i),y(e,t,i),m(e,t,i)},d=function(e,t,i){for(var r=0;r<e.graphSet.length;r++)for(var n=e.graphSet[r],a=n.length,o=0;o<a;o++)for(var s=e.layoutNodes[e.idToIndex[n[o]]],l=o+1;l<a;l++){var u=e.layoutNodes[e.idToIndex[n[l]]];h(s,u,e,t,i)}},h=function(e,t,i,r,n){var a=t.positionX-e.positionX,o=t.positionY-e.positionY;if(0!==a||0!==o){var s=f(e,t,a,o);if(s>0)var l=(c=n.nodeOverlap*s)*a/(m=Math.sqrt(a*a+o*o)),u=c*o/m;else{var c,d=p(e,a,o),h=p(t,-1*a,-1*o),g=h.x-d.x,v=h.y-d.y,y=g*g+v*v,m=Math.sqrt(y);l=(c=n.nodeRepulsion/y)*g/m,u=c*v/m}e.offsetX-=l,e.offsetY-=u,t.offsetX+=l,t.offsetY+=u}},p=function(e,t,i){var r=e.positionX,n=e.positionY,a=e.height,o=e.width,s=i/t,l=a/o,u={};do{if(0===t&&0<i){u.x=r,u.y=n+a/2;break}if(0===t&&0>i){u.x=r,u.y=n+a/2;break}if(0<t&&-1*l<=s&&s<=l){u.x=r+o/2,u.y=n+o*i/2/t;break}if(0>t&&-1*l<=s&&s<=l){u.x=r-o/2,u.y=n-o*i/2/t;break}if(0<i&&(s<=-1*l||s>=l)){u.x=r+a*t/2/i,u.y=n+a/2;break}if(0>i&&(s<=-1*l||s>=l)){u.x=r-a*t/2/i,u.y=n-a/2;break}}while(0);return u},f=function(e,t,i,r){if(i>0)var n=e.maxX-t.minX;else n=t.maxX-e.minX;if(r>0)var a=e.maxY-t.minY;else a=t.maxY-e.minY;return n>=0&&a>=0?Math.sqrt(n*n+a*a):0},g=function(e,t,i){for(var r=0;r<e.edgeSize;r++){var n=e.layoutEdges[r],a=e.idToIndex[n.sourceId],o=e.layoutNodes[a],s=e.idToIndex[n.targetId],l=e.layoutNodes[s],u=l.positionX-o.positionX,c=l.positionY-o.positionY;if(0===u&&0===c)return;var d=p(o,u,c),h=p(l,-1*u,-1*c),f=h.x-d.x,g=h.y-d.y,v=Math.sqrt(f*f+g*g),y=Math.pow(n.idealLength-v,2)/i.edgeElasticity;if(0!==v)var m=y*f/v,x=y*g/v;else m=0,x=0;o.offsetX+=m,o.offsetY+=x,l.offsetX-=m,l.offsetY-=x}},v=function(e,t,i){for(var r=0;r<e.graphSet.length;r++){var n=e.graphSet[r],a=n.length;if(0===r)var o=e.clientHeight/2,s=e.clientWidth/2;else{var l=e.layoutNodes[e.idToIndex[n[0]]],u=e.layoutNodes[e.idToIndex[l.parentId]];o=u.positionX,s=u.positionY}for(var c=0;c<a;c++){var d=e.layoutNodes[e.idToIndex[n[c]]],h=o-d.positionX,p=s-d.positionY,f=Math.sqrt(h*h+p*p);if(f>1){var g=i.gravity*h/f,v=i.gravity*p/f;d.offsetX+=g,d.offsetY+=v}}}},y=function(e,t,i){var r=[],n=0,a=-1;for(r.push.apply(r,e.graphSet[0]),a+=e.graphSet[0].length;n<=a;){var o=r[n++],s=e.idToIndex[o],l=e.layoutNodes[s],u=l.children;if(0<u.length){for(var c=l.offsetX,d=l.offsetY,h=0;h<u.length;h++){var p=e.layoutNodes[e.idToIndex[u[h]]];p.offsetX+=c,p.offsetY+=d,r[++a]=u[h]}l.offsetX=0,l.offsetY=0}}},m=function(e,t,i){for(var r=0;r<e.nodeSize;r++){0<(a=e.layoutNodes[r]).children.length&&(a.maxX=void 0,a.minX=void 0,a.maxY=void 0,a.minY=void 0)}for(r=0;r<e.nodeSize;r++){if(!(0<(a=e.layoutNodes[r]).children.length)){var n=x(a.offsetX,a.offsetY,e.temperature);a.positionX+=n.x,a.positionY+=n.y,a.offsetX=0,a.offsetY=0,a.minX=a.positionX-a.width,a.maxX=a.positionX+a.width,a.minY=a.positionY-a.height,a.maxY=a.positionY+a.height,b(a,e)}}for(r=0;r<e.nodeSize;r++){var a;0<(a=e.layoutNodes[r]).children.length&&(a.positionX=(a.maxX+a.minX)/2,a.positionY=(a.maxY+a.minY)/2,a.width=a.maxX-a.minX,a.height=a.maxY-a.minY)}},x=function(e,t,i){var r=Math.sqrt(e*e+t*t);if(r>i)var n={x:i*e/r,y:i*t/r};else n={x:e,y:t};return n},b=function(e,t){var i=e.parentId;if(null!=i){var r=t.layoutNodes[t.idToIndex[i]],n=!1;return(null==r.maxX||e.maxX+r.padRight>r.maxX)&&(r.maxX=e.maxX+r.padRight,n=!0),(null==r.minX||e.minX-r.padLeft<r.minX)&&(r.minX=e.minX-r.padLeft,n=!0),(null==r.maxY||e.maxY+r.padBottom>r.maxY)&&(r.maxY=e.maxY+r.padBottom,n=!0),(null==r.minY||e.minY-r.padTop<r.minY)&&(r.minY=e.minY-r.padTop,n=!0),n?b(r,t):void 0}};e("layout","cose",r)}(cytoscape),function(e){"use strict";var t={nodeSep:void 0,edgeSep:void 0,rankSep:void 0,rankDir:void 0,minLen:function(e){return 1},edgeWeight:function(e){return 1},fit:!0,padding:30,animate:!1,animationDuration:500,boundingBox:void 0,ready:function(){},stop:function(){}};function i(i){this.options=e.util.extend(!0,{},t,i)}i.prototype.run=function(){var t=this.options,i=this;return e.util.require("dagre",function(r){var n=t.cy,a=t.eles,o=function(t,i){return e.is.fn(i)?i.apply(t,[t]):i},s=e.util.makeBoundingBox(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()}),l=new r.graphlib.Graph({multigraph:!0,compound:!0}),u={},c=function(e,t){null!=t&&(u[e]=t)};c("nodesep",t.nodeSep),c("edgesep",t.edgeSep),c("ranksep",t.rankSep),c("rankdir",t.rankDir),l.setGraph(u),l.setDefaultEdgeLabel(function(){return{}}),l.setDefaultNodeLabel(function(){return{}});for(var d=a.nodes(),h=0;h<d.length;h++){var p=d[h];l.setNode(p.id(),{width:p.width(),height:p.height(),name:p.id()})}for(h=0;h<d.length;h++){(p=d[h]).isChild()&&l.setParent(p.id(),p.parent().id())}var f=a.edges().stdFilter(function(e){return!e.source().isParent()&&!e.target().isParent()});for(h=0;h<f.length;h++){var g=f[h];l.setEdge(g.source().id(),g.target().id(),{minlen:o(g,t.minLen),weight:o(g,t.edgeWeight),name:g.id()},g.id())}r.layout(l);var v,y=l.nodes();for(h=0;h<y.length;h++){var m=y[h],x=l.node(m);n.getElementById(m).scratch().dagre=x}t.boundingBox?(v={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0},d.forEach(function(e){var t=e.scratch().dagre;v.x1=Math.min(v.x1,t.x),v.x2=Math.max(v.x2,t.x),v.y1=Math.min(v.y1,t.y),v.y2=Math.max(v.y2,t.y)}),v.w=v.x2-v.x1,v.h=v.y2-v.y1):v=s;d.layoutPositions(i,t,function(){var e=this.scratch().dagre;return function(e){if(t.boundingBox){var i=(e.x-v.x1)/v.w,r=(e.y-v.y1)/v.h;return{x:s.x1+i*s.w,y:s.y1+r*s.h}}return e}({x:e.x,y:e.y})})}),this},e("layout","dagre",i)}(cytoscape),function(e){"use strict";var t={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,rows:void 0,columns:void 0,position:function(e){},sort:void 0,animate:!1,animationDuration:500,ready:void 0,stop:void 0};function i(i){this.options=e.util.extend({},t,i)}i.prototype.run=function(){var t=this.options,i=t,r=t.cy,n=i.eles.nodes().not(":parent");i.sort&&(n=n.sort(i.sort));var a=e.util.makeBoundingBox(i.boundingBox?i.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()});if(0===a.h||0===a.w)n.layoutPositions(this,i,function(){return{x:a.x1,y:a.y1}});else{var o=n.size(),s=Math.sqrt(o*a.h/a.w),l=Math.round(s),u=Math.round(a.w/a.h*s),c=function(e){if(null==e)return Math.min(l,u);Math.min(l,u)==l?l=e:u=e},d=function(e){if(null==e)return Math.max(l,u);Math.max(l,u)==l?l=e:u=e};if(null!=i.rows&&null!=i.columns)l=i.rows,u=i.columns;else if(null!=i.rows&&null==i.columns)l=i.rows,u=Math.ceil(o/l);else if(null==i.rows&&null!=i.columns)u=i.columns,l=Math.ceil(o/u);else if(u*l>o){((p=c())-1)*(h=d())>=o?c(p-1):(h-1)*p>=o&&d(h-1)}else for(;u*l<o;){var h,p=c();((h=d())+1)*p>=o?d(h+1):c(p+1)}var f=a.w/u,g=a.h/l;if(i.avoidOverlap)for(var v=0;v<n.length;v++){var y=(k=n[v]).outerWidth(),m=k.outerHeight();f=Math.max(f,y),g=Math.max(g,m)}var x={},b=function(e,t){return!!x["c-"+e+"-"+t]},w=function(e,t){x["c-"+e+"-"+t]=!0},_=0,E=0,S=function(){++E>=u&&(E=0,_++)},D={};for(v=0;v<n.length;v++){var k=n[v],P=i.position(k);if(P&&(void 0!==P.row||void 0!==P.col)){var T={row:P.row,col:P.col};if(void 0===T.col)for(T.col=0;b(T.row,T.col);)T.col++;else if(void 0===T.row)for(T.row=0;b(T.row,T.col);)T.row++;D[k.id()]=T,w(T.row,T.col)}}n.layoutPositions(this,i,function(e,t){var i,r;if(t.locked()||t.isFullAutoParent())return!1;var n=D[t.id()];if(n)i=n.col*f+f/2+a.x1,r=n.row*g+g/2+a.y1;else{for(;b(_,E);)S();i=E*f+f/2+a.x1,r=_*g+g/2+a.y1,w(_,E),S()}return{x:i,y:r}})}return this},e("layout","grid",i)}(cytoscape),function(e){"use strict";var t={ready:function(){},stop:function(){}};function i(i){this.options=e.util.extend(!0,{},t,i)}i.prototype.run=function(){var e=this.options,t=e.eles;e.cy;return this.trigger("layoutstart"),t.nodes().positions(function(){return{x:0,y:0}}),this.one("layoutready",e.ready),this.trigger("layoutready"),this.one("layoutstop",e.stop),this.trigger("layoutstop"),this},i.prototype.stop=function(){return this},e("layout","null",i)}(cytoscape),function(e){"use strict";var t={positions:void 0,zoom:void 0,pan:void 0,fit:!0,padding:30,animate:!1,animationDuration:500,ready:void 0,stop:void 0};function i(i){this.options=e.util.extend(!0,{},t,i)}i.prototype.run=function(){var t=this.options,i=t.eles.nodes(),r=e.is.fn(t.positions);return i.layoutPositions(this,t,function(e,i){var n=function(e){if(null==t.positions)return null;if(r)return t.positions.apply(e,[e]);var i=t.positions[e._private.data.id];return null==i?null:i}(i);return!i.locked()&&null!=n&&n}),this},e("layout","preset",i)}(cytoscape),function(e){"use strict";var t={fit:!0,padding:30,boundingBox:void 0,animate:!1,animationDuration:500,ready:void 0,stop:void 0};function i(i){this.options=e.util.extend(!0,{},t,i)}i.prototype.run=function(){var t=this.options,i=t.cy,r=t.eles.nodes().not(":parent"),n=e.util.makeBoundingBox(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:i.width(),h:i.height()});return r.layoutPositions(this,t,function(e,t){return{x:n.x1+Math.round(Math.random()*n.w),y:n.y1+Math.round(Math.random()*n.h)}}),this},e("layout","random",i)}(cytoscape),function($$){"use strict";var defaults={animate:!0,ready:void 0,stop:void 0,fit:!0,minDist:20,padding:20,expandingFactor:-1,maxFruchtermanReingoldIterations:50,maxExpandIterations:4,boundingBox:void 0};function SpreadLayout(e){this.options=$$.util.extend({},defaults,e)}function cellCentroid(e){for(var t,i,r,n=e.halfedges,a=0,o=0,s=0,l=0;l<n.length;++l)t=n[l].getEndpoint(),i=n[l].getStartpoint(),a+=t.x*i.y,a-=t.y*i.x,r=t.x*i.y-i.x*t.y,o+=(t.x+i.x)*r,s+=(t.y+i.y)*r;return{x:o/(r=6*(a/=2)),y:s/r}}function sitesDistance(e,t){var i=e.x-t.x,r=e.y-t.y;return Math.sqrt(i*i+r*r)}SpreadLayout.prototype.run=function(){var layout=this,options=this.options;return $$.util.requires(["foograph","Voronoi"],function(foograph,Voronoi){var cy=options.cy,nodes=cy.nodes(),edges=cy.edges(),cWidth=cy.width(),cHeight=cy.height(),simulationBounds=options.boundingBox?$$.util.makeBoundingBox(options.boundingBox):null,padding=options.padding,simBBFactor=Math.max(1,.8*Math.log(nodes.length));nodes.length<100&&(simBBFactor/=2),layout.trigger({type:"layoutstart",layout:layout});var simBB={x1:0,y1:0,x2:cWidth*simBBFactor,y2:cHeight*simBBFactor};simulationBounds&&(simBB.x1=simulationBounds.x1,simBB.y1=simulationBounds.y1,simBB.x2=simulationBounds.x2,simBB.y2=simulationBounds.y2),simBB.x1+=padding,simBB.y1+=padding,simBB.x2-=padding,simBB.y2-=padding;var width=simBB.x2-simBB.x1,height=simBB.y2-simBB.y1,startTime=Date.now();if(nodes.size()<=1){nodes.positions({x:Math.round((simBB.x1+simBB.x2)/2),y:Math.round((simBB.y1+simBB.y2)/2)}),options.fit&&cy.fit(options.padding);var endTime=Date.now();return layout.one("layoutready",options.ready),layout.trigger("layoutready"),layout.one("layoutstop",options.stop),void layout.trigger("layoutstop")}var pData={width:width,height:height,minDist:options.minDist,expFact:options.expandingFactor,expIt:0,maxExpIt:options.maxExpandIterations,vertices:[],edges:[],startTime:startTime,maxFruchtermanReingoldIterations:options.maxFruchtermanReingoldIterations};nodes.each(function(e,t){var i=this._private.data.id;pData.vertices.push({id:i,x:0,y:0})}),edges.each(function(){var e=this.source().id(),t=this.target().id();pData.edges.push({src:e,tgt:t})});var t1=$$.Thread();function setPositions(e){for(var t=e.vertices,i=[],r=0;r<t.length;++r){var n=t[r];i[n.id]={x:n.x,y:n.y}}nodes.positions(function(e,t){var r=t._private.data.id,n=i[r];return{x:Math.round(simBB.x1+n.x),y:Math.round(simBB.y1+n.y)}}),options.fit&&cy.fit(options.padding),cy.nodes().rtrigger("position")}t1.require(foograph,"foograph"),t1.require(Voronoi),t1.require(sitesDistance),t1.require(cellCentroid);var didLayoutReady=!1;t1.on("message",function(e){var t=e.message;options.animate&&(setPositions(t),didLayoutReady||(layout.trigger("layoutready"),didLayoutReady=!0))}),layout.one("layoutready",options.ready),t1.pass(pData).run(function(pData){foograph=eval("foograph"),Voronoi=eval("Voronoi");for(var lWidth=pData.width,lHeight=pData.height,lMinDist=pData.minDist,lExpFact=pData.expFact,lMaxExpIt=pData.maxExpIt,lMaxFruchtermanReingoldIterations=pData.maxFruchtermanReingoldIterations,savePositions=function(){pData.width=lWidth,pData.height=lHeight,pData.expIt=expandIteration,pData.expFact=lExpFact,pData.vertices=[];for(var e=0;e<fv.length;++e)pData.vertices.push({id:fv[e].label,x:fv[e].x,y:fv[e].y})},messagePositions=function(){broadcast(pData)},frg=new foograph.Graph("FRgraph",!1),frgNodes={},dataVertices=pData.vertices,ni=0;ni<dataVertices.length;++ni){var id=dataVertices[ni].id,v=new foograph.Vertex(id,Math.round(Math.random()*lHeight),Math.round(Math.random()*lHeight));frgNodes[id]=v,frg.insertVertex(v)}for(var dataEdges=pData.edges,ei=0;ei<dataEdges.length;++ei){var srcNodeId=dataEdges[ei].src,tgtNodeId=dataEdges[ei].tgt;frg.insertEdge("",1,frgNodes[srcNodeId],frgNodes[tgtNodeId])}var fv=frg.vertices,iterations=lMaxFruchtermanReingoldIterations,frLayoutManager=new foograph.ForceDirectedVertexLayout(lWidth,lHeight,iterations,!1,lMinDist);frLayoutManager.callback=function(){savePositions(),messagePositions()},frLayoutManager.layout(frg),savePositions(),messagePositions();for(var voronoi=new Voronoi,bbox={xl:0,xr:lWidth,yt:0,yb:lHeight},vSites=[],i=0;i<fv.length;++i)vSites[fv[i].label]=fv[i];function checkMinDist(e){for(var t=0,i=0;i<e.length;++i){var r=e[i];null!=r.lSite&&null!=r.rSite&&sitesDistance(r.lSite,r.rSite)<lMinDist&&++t}return t}for(var diagram=voronoi.compute(fv,bbox),cells=diagram.cells,i=0;i<cells.length;++i){var cell=cells[i],site=cell.site,centroid=cellCentroid(cell),currv=vSites[site.label];currv.x=centroid.x,currv.y=centroid.y}lExpFact<0&&(lExpFact=Math.max(.05,Math.min(.1,lMinDist/Math.sqrt(lWidth*lHeight/fv.length)*.5)));for(var prevInfractions=checkMinDist(diagram.edges),bStop=prevInfractions<=0,voronoiIteration=0,expandIteration=0;!bStop;){++voronoiIteration;for(var it=0;it<=4;++it){voronoi.recycle(diagram),diagram=voronoi.compute(fv,bbox),cells=diagram.cells;for(var i=0;i<cells.length;++i){var cell=cells[i],site=cell.site,centroid=cellCentroid(cell),currv=vSites[site.label];currv.x=centroid.x,currv.y=centroid.y}}var currInfractions=checkMinDist(diagram.edges);currInfractions<=0?bStop=!0:(currInfractions>=prevInfractions||voronoiIteration>=4)&&(expandIteration>=lMaxExpIt?bStop=!0:(lWidth+=lWidth*lExpFact,lHeight+=lHeight*lExpFact,bbox={xl:0,xr:lWidth,yt:0,yb:lHeight},++expandIteration,voronoiIteration=0)),prevInfractions=currInfractions,savePositions(),messagePositions()}return savePositions(),pData}).then(function(e){e.vertices;setPositions(e);e.startTime,new Date;layout.one("layoutstop",options.stop),options.animate||layout.trigger("layoutready"),layout.trigger("layoutstop"),t1.stop()})}),this},SpreadLayout.prototype.stop=function(){},$$("layout","spread",SpreadLayout)}(cytoscape),function(e){"use strict";var t={animate:!0,maxSimulationTime:4e3,ungrabifyWhileSimulating:!1,fit:!0,padding:30,boundingBox:void 0,random:!1,infinite:!1,ready:void 0,stop:void 0,stiffness:400,repulsion:400,damping:.5};function i(i){this.options=e.util.extend(!0,{},t,i)}i.prototype.run=function(){var t=this,i=this,r=this.options;return e.util.require("Springy",function(n){var a=!1,o=r.cy;t.trigger({type:"layoutstart",layout:t});var s=r.eles,l=s.nodes().not(":parent"),u=s.edges(),c=e.util.makeBoundingBox(r.boundingBox?r.boundingBox:{x1:0,y1:0,w:o.width(),h:o.height()}),d=new n.Graph;l.each(function(e,t){t.scratch("springy",{model:d.newNode({element:t})})}),u.each(function(e,t){var i=t.source().scratch("springy").model,r=t.target().scratch("springy").model;t.scratch("springy",{model:d.newEdge(i,r,{element:t})})});var h=window.sim=new n.Layout.ForceDirected(d,r.stiffness,r.repulsion,r.damping);r.infinite&&(h.minEnergyThreshold=-1/0);var p,f=h.getBoundingBox(),g=function(e){var t=(f=h.getBoundingBox()).topright.subtract(f.bottomleft),i=(e.x-c.x1)/c.w*t.x+f.bottomleft.x,r=(e.y-c.y1)/c.h*t.y+f.bottomleft.y;return new n.Vector(i,r)},v=o.collection(),y=o.nodes().size(),m=1,x=new n.Renderer(h,function(){i.stopped||v.length>0&&r.animate&&(a=!0,v.rtrigger("position"),r.fit&&o.fit(r.padding),v=o.collection(),a=!1)},function(e,t,i){},function(e,a){if(!i.stopped){var o=function(e){var t=(f=h.getBoundingBox()).topright.subtract(f.bottomleft),i=e.subtract(f.bottomleft).divide(t.x).x*c.w+c.x1,r=e.subtract(f.bottomleft).divide(t.y).y*c.h+c.x1;return new n.Vector(i,r)}(a),s=e.data.element;s.locked()||s.grabbed()||(s._private.position={x:o.x,y:o.y},v.merge(s)),m==y&&(t.one("layoutready",r.ready),t.trigger({type:"layoutready",layout:t})),m++}});function b(e){var t=e.scratch("springy").model.id,i=x.layout.nodePoints[t].p,r=e.position(),n=null!=r.x&&null!=r.y?g(e.position()):{x:4*Math.random()-2,y:4*Math.random()-2};i.x=n.x,i.y=n.y}l.each(function(e,t){r.random||b(t)}),l.on("position",p=function(){a||b(this)});var w=l.filter(":grabbable");i.stopSystem=function(){i.stopped=!0,d.filterNodes(function(){return!1}),r.ungrabifyWhileSimulating&&w.grabify(),r.fit&&o.fit(r.padding),l.off("drag position",p),t.one("layoutstop",r.stop),t.trigger({type:"layoutstop",layout:t}),i.stopSystem=null},i.stopped=!1,r.ungrabifyWhileSimulating&&w.ungrabify(),x.start(),r.infinite||setTimeout(function(){i.stop()},r.maxSimulationTime)}),this},i.prototype.stop=function(){return null!=this.stopSystem&&this.stopSystem(),this},e("layout","springy",i)}(cytoscape),function(e){"use strict";function t(e){this.options=e}t.prototype.recalculateRenderedStyle=function(){},t.prototype.notify=function(){},e("renderer","null",t)}(cytoscape);
},{"path":21,"child_process":23,"os":22,"process":8}],12:[function(require,module,exports) {
var r=jQuery=require("jquery"),e=require("cytoscape"),o=module.exports=function(r){this.theme=r};o.prototype.getColor=function(e){var o="black";return r("#acolor").length>0?"A"===e?o=r("#acolor").spectrum("get").toHexString():"C"===e?o=r("#ccolor").spectrum("get").toHexString():"U"===e?o=r("#ucolor").spectrum("get").toHexString():"G"===e?o=r("#gcolor").spectrum("get").toHexString():"hbond"===e?o="#3A9AD9":"violation"===e&&(o="red"):"A"===e?o="#64F73F":"C"===e?o="#FFB340":"U"===e?o="#3C88EE":"G"===e?o="#EB413C":"hbond"===e?o="#3A9AD9":"violation"===e&&(o="red"),o},o.prototype.getWeight=function(r){return"hbond"===r||"violation"===r?4:5},o.prototype.getCytoscapeStyle=function(){return e.stylesheet().selector("node").css({content:"data(label)","text-valign":"center",color:"white","text-outline-width":2,"text-outline-color":"#778899"}).selector("edge").css({"background-color":"white"}).selector(".chosen").css({"background-color":"black",opacity:.6}).selector(".edgehandles-hover").css({"background-color":"red"}).selector(".edgehandles-source").css({"border-width":2,"border-color":"red"}).selector(".edgehandles-target").css({"border-width":2,"border-color":"red"}).selector(".edgehandles-preview, .edgehandles-ghost-edge").css({"line-color":"red","target-arrow-color":"red","target-arrow-color":"red"}).selector(".wcwccis").css({"mid-target-arrow-shape":"circle","mid-target-arrow-color":"red"}).selector(".wcsgcis").css({"source-arrow-shape":"circle","source-arrow-color":"red","target-arrow-shape":"triangle","target-arrow-color":"red"}).selector(".sgwccis").css({"target-arrow-shape":"circle","target-arrow-color":"red","source-arrow-shape":"triangle","source-arrow-color":"red"}).selector(".hgsgcis").css({"source-arrow-shape":"square","source-arrow-color":"red","target-arrow-shape":"triangle","target-arrow-color":"red"}).selector(".sghgcis").css({"target-arrow-shape":"square","target-arrow-color":"red","source-arrow-shape":"triangle","source-arrow-color":"red"}).selector(".wchgcis").css({"source-arrow-shape":"circle","source-arrow-color":"red","target-arrow-shape":"square","target-arrow-color":"red"}).selector(".hgwccis").css({"target-arrow-shape":"circle","target-arrow-color":"red","source-arrow-shape":"square","source-arrow-color":"red"}).selector(".sgsgcis").css({"mid-target-arrow-shape":"triangle","mid-target-arrow-color":"red"}).selector(".wcwctrans").css({"mid=target-arrow-shape":"circle","mid-target-arrow-color":"red","mid-target-arrow-fill":"hollow"}).selector(".wcsgtrans").css({"source-arrow-shape":"circle","source-arrow-color":"red","target-arrow-shape":"triangle","target-arrow-color":"red","target-arrow-fill":"hollow","source-arrow-fill":"hollow"}).selector(".sgwctrans").css({"target-arrow-shape":"circle","target-arrow-color":"red","source-arrow-shape":"triangle","source-arrow-color":"red","source-arrow-fill":"hollow","target-arrow-fill":"hollow"}).selector(".hgsgtrans").css({"source-arrow-shape":"square","source-arrow-color":"red","target-arrow-shape":"triangle","target-arrow-color":"red","target-arrow-fill":"hollow","source-arrow-fill":"hollow"}).selector(".sghgtrans").css({"target-arrow-shape":"square","target-arrow-color":"red","source-arrow-shape":"triangle","source-arrow-color":"red","source-arrow-fill":"hollow","target-arrow-fill":"hollow"}).selector(".wchgtrans").css({"source-arrow-shape":"circle","source-arrow-color":"red","target-arrow-shape":"square","target-arrow-color":"red","target-arrow-fill":"hollow","source-arrow-fill":"hollow"}).selector(".hgwctrans").css({"target-arrow-shape":"circle","target-arrow-color":"red","source-arrow-shape":"square","source-arrow-color":"red","source-arrow-fill":"hollow","target-arrow-fill":"hollow"}).selector(".sgsgtrans").css({"mid-target-arrow-shape":"triangle","mid-target-arrow-color":"red","mid-target-arrow-fill":"hollow"}).selector(".hghgcis").css({"mid-target-arrow-shape":"square","mid-target-arrow-color":"red"}).selector(".hghgtrans").css({"mid-target-arrow-shape":"square","mid-target-arrow-color":"red","mid-target-arrow-fill":"hollow"})};
},{"jquery":6,"cytoscape":20}],11:[function(require,module,exports) {
var e=require("backbone"),t=e.Model.extend({defaults:{group:"edges"},initialize:function(e){this.set("id",e.id),this.set("source",e.source),this.set("target",e.target),this.set("label",e.label),this.set("weight",e.weight),this.set("color",e.color)}});module.exports=t;
},{"backbone":5}],13:[function(require,module,exports) {
var e=require("backbone"),t=require("./link"),i=require("../utils/parsedbr"),s=e.Collection.extend({model:t,initialize:function(e,t,i){this.style=t,this.residues=i},newBond:function(e,s){var r=this.residues.at(parseInt(e)),o=this.residues.at(parseInt(s)),n=i.getType(i.isWatsonCrick(r,o)),a=this.style;this.add(new t({id:e+"to"+s,source:e,target:s,label:n,weight:a.getWeight(n),color:a.getColor(n)}))}});module.exports=s;
},{"backbone":5,"./link":11,"../utils/parsedbr":10}],14:[function(require,module,exports) {
var e=require("backbone"),t=e.Model.extend({defaults:{group:"nodes",selectable:!0,locked:!1,grabbable:!0},initialize:function(e){this.set("name",e.name),this.set("color",e.color),this.set("x",e.x),this.set("y",e.y),this.set("id",e.id)}});module.exports=t;
},{"backbone":5}],15:[function(require,module,exports) {
var e=require("backbone"),o=require("./residue"),r=require("underscore"),i=e.Collection.extend({model:o,setResidueColor:function(e,o){r.each(this.where({name:e}),function(e){e.set("color",o)})},setSelectionColor:function(e,o){for(var r=null,i=0;i<e.length;i++)r=e[i],this.where({id:r.id()})[0].set("color",o)}});module.exports=i;
},{"backbone":5,"./residue":14,"underscore":7}],3:[function(require,module,exports) {
var e=require("backbone"),t=require("../utils/parsedbr"),r=require("../layouts/layout.js"),s=require("../utils/style"),i=require("./link"),n=require("./linkcol"),o=require("./residue"),g=require("./residuecol"),l=e.Model.extend({initialize:function(e,t,r){this.set("seq",e),this.set("dotbr",t),this.set("layout",r),this.set("style",new s("standard")),this.set("renderSwitch",!0),this.defineStructure(),this.on("change:renderSwitch",this.defineStructure)},reconstruct:function(){for(var e,t="",r=[],s=this.get("residues"),i=0;i<s.length;i++)if(t+=s.at(i).get("name"),-1===(e=this.getPartner(i.toString())))r[i]=".";else{if(!(e>i))continue;r[i]="(",r[e]=")"}this.set("seq",t),this.set("dotbr",r.join("")),this.set("renderSwitch",!this.get("renderSwitch"))},defineStructure:function(){for(var e=this.get("seq"),s=this.get("dotbr"),l=this.get("layout"),a=this.get("style"),u=new g,d=t.parseDbr(e,s),h=new r(l,d.nodes,d.links).getCoords(),c=0;c<d.nodes.length;c++)u.add(new o({name:d.nodes[c].name,color:a.getColor(d.nodes[c].name),x:h[c].x,y:h[c].y,id:c.toString()}));this.set("residues",u);var b=new n(null,a,u);for(c=0;c<d.links.length;c++)b.add(new i({id:d.links[c].source+"to"+d.links[c].target,source:d.links[c].source.toString(),target:d.links[c].target.toString(),label:d.links[c].type,weight:a.getWeight(d.links[c].type),color:a.getColor(d.links[c].type)}));this.set("links",b),this.listenTo(this.get("links"),"update",this.reconstruct)},toCytoscape:function(){for(var e,t=[],r=this.get("residues"),s=0;s<r.length;s++)e=r.at(s),t.push({group:e.get("group"),data:{id:e.get("id"),label:e.get("name"),type:"residue"},position:{x:e.get("x"),y:e.get("y")},selected:e.get("selected"),selectable:e.get("selectable"),locked:e.get("locked"),grabbable:e.get("grabbable"),css:{"background-color":e.get("color")}});var i=this.get("links");for(s=0;s<i.length;s++)e=i.at(s),t.push({group:e.get("group"),data:{id:e.get("id"),source:e.get("source"),target:e.get("target"),label:e.get("label"),weight:e.get("weight")},css:{"line-color":e.get("color"),width:e.get("weight")}});return t},getPartner:function(e){for(var t=this.get("links"),r=-1,s=0;s<t.length;s++)if("phosphodiester"===t.at(s).get("label"));else{if(t.at(s).get("source")===e){r=t.at(s).get("target");break}if(t.at(s).get("target")===e){r=t.at(s).get("source");break}}return r}});module.exports=l;
},{"backbone":5,"../utils/parsedbr":10,"../layouts/layout.js":9,"../utils/style":12,"./link":11,"./linkcol":13,"./residue":14,"./residuecol":15}],25:[function(require,module,exports) {
var e=require("backbone"),s=e.Model.extend({defaults:{base1:"wc",base2:"wc",stericity:"cis",edge:null},initialize:function(e,s,t,i){this.set("base1",e),this.set("base2",s),this.set("edge",i),this.set("stericity",t)},getLabels:function(){for(var e=[],s=1;s<3;s++)switch(this.get("base"+s)){case"wc":e.push("Watson-Crick");break;case"hg":e.push("Hoogsteen");break;case"sg":e.push("Sugar")}return e.push(this.get("stericity")),e}});module.exports=s;
},{"backbone":5}],27:[function(require,module,exports) {
!function(n){"use strict";n.fn.emulateTransitionEnd=function(t){var i=!1,r=this;n(this).one("bsTransitionEnd",function(){i=!0});return setTimeout(function(){i||n(r).trigger(n.support.transition.end)},t),this},n(function(){n.support.transition=function(){var n=document.createElement("bootstrap"),t={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var i in t)if(void 0!==n.style[i])return{end:t[i]};return!1}(),n.support.transition&&(n.event.special.bsTransitionEnd={bindType:n.support.transition.end,delegateType:n.support.transition.end,handle:function(t){if(n(t.target).is(this))return t.handleObj.handler.apply(this,arguments)}})})}(jQuery);
},{}],28:[function(require,module,exports) {
!function(t){"use strict";var e='[data-dismiss="alert"]',a=function(a){t(a).on("click",e,this.close)};a.VERSION="3.3.7",a.TRANSITION_DURATION=150,a.prototype.close=function(e){var r=t(this),n=r.attr("data-target");n||(n=(n=r.attr("href"))&&n.replace(/.*(?=#[^\s]*$)/,""));var s=t("#"===n?[]:n);function o(){s.detach().trigger("closed.bs.alert").remove()}e&&e.preventDefault(),s.length||(s=r.closest(".alert")),s.trigger(e=t.Event("close.bs.alert")),e.isDefaultPrevented()||(s.removeClass("in"),t.support.transition&&s.hasClass("fade")?s.one("bsTransitionEnd",o).emulateTransitionEnd(a.TRANSITION_DURATION):o())};var r=t.fn.alert;t.fn.alert=function(e){return this.each(function(){var r=t(this),n=r.data("bs.alert");n||r.data("bs.alert",n=new a(this)),"string"==typeof e&&n[e].call(r)})},t.fn.alert.Constructor=a,t.fn.alert.noConflict=function(){return t.fn.alert=r,this},t(document).on("click.bs.alert.data-api",e,a.prototype.close)}(jQuery);
},{}],29:[function(require,module,exports) {
!function(t){"use strict";var e=function(n,s){this.$element=t(n),this.options=t.extend({},e.DEFAULTS,s),this.isLoading=!1};function n(n){return this.each(function(){var s=t(this),i=s.data("bs.button"),o="object"==typeof n&&n;i||s.data("bs.button",i=new e(this,o)),"toggle"==n?i.toggle():n&&i.setState(n)})}e.VERSION="3.3.7",e.DEFAULTS={loadingText:"loading..."},e.prototype.setState=function(e){var n="disabled",s=this.$element,i=s.is("input")?"val":"html",o=s.data();e+="Text",null==o.resetText&&s.data("resetText",s[i]()),setTimeout(t.proxy(function(){s[i](null==o[e]?this.options[e]:o[e]),"loadingText"==e?(this.isLoading=!0,s.addClass(n).attr(n,n).prop(n,!0)):this.isLoading&&(this.isLoading=!1,s.removeClass(n).removeAttr(n).prop(n,!1))},this),0)},e.prototype.toggle=function(){var t=!0,e=this.$element.closest('[data-toggle="buttons"]');if(e.length){var n=this.$element.find("input");"radio"==n.prop("type")?(n.prop("checked")&&(t=!1),e.find(".active").removeClass("active"),this.$element.addClass("active")):"checkbox"==n.prop("type")&&(n.prop("checked")!==this.$element.hasClass("active")&&(t=!1),this.$element.toggleClass("active")),n.prop("checked",this.$element.hasClass("active")),t&&n.trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active")),this.$element.toggleClass("active")};var s=t.fn.button;t.fn.button=n,t.fn.button.Constructor=e,t.fn.button.noConflict=function(){return t.fn.button=s,this},t(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(e){var s=t(e.target).closest(".btn");n.call(s,"toggle"),t(e.target).is('input[type="radio"], input[type="checkbox"]')||(e.preventDefault(),s.is("input,button")?s.trigger("focus"):s.find("input:visible,button:visible").first().trigger("focus"))}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(e){t(e.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(e.type))})}(jQuery);
},{}],30:[function(require,module,exports) {
!function(t){"use strict";var e=function(e,i){this.$element=t(e),this.$indicators=this.$element.find(".carousel-indicators"),this.options=i,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",t.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",t.proxy(this.pause,this)).on("mouseleave.bs.carousel",t.proxy(this.cycle,this))};function i(i){return this.each(function(){var s=t(this),n=s.data("bs.carousel"),a=t.extend({},e.DEFAULTS,s.data(),"object"==typeof i&&i),r="string"==typeof i?i:a.slide;n||s.data("bs.carousel",n=new e(this,a)),"number"==typeof i?n.to(i):r?n[r]():a.interval&&n.pause().cycle()})}e.VERSION="3.3.7",e.TRANSITION_DURATION=600,e.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},e.prototype.keydown=function(t){if(!/input|textarea/i.test(t.target.tagName)){switch(t.which){case 37:this.prev();break;case 39:this.next();break;default:return}t.preventDefault()}},e.prototype.cycle=function(e){return e||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(t.proxy(this.next,this),this.options.interval)),this},e.prototype.getItemIndex=function(t){return this.$items=t.parent().children(".item"),this.$items.index(t||this.$active)},e.prototype.getItemForDirection=function(t,e){var i=this.getItemIndex(e);if(("prev"==t&&0===i||"next"==t&&i==this.$items.length-1)&&!this.options.wrap)return e;var s=(i+("prev"==t?-1:1))%this.$items.length;return this.$items.eq(s)},e.prototype.to=function(t){var e=this,i=this.getItemIndex(this.$active=this.$element.find(".item.active"));if(!(t>this.$items.length-1||t<0))return this.sliding?this.$element.one("slid.bs.carousel",function(){e.to(t)}):i==t?this.pause().cycle():this.slide(t>i?"next":"prev",this.$items.eq(t))},e.prototype.pause=function(e){return e||(this.paused=!0),this.$element.find(".next, .prev").length&&t.support.transition&&(this.$element.trigger(t.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},e.prototype.next=function(){if(!this.sliding)return this.slide("next")},e.prototype.prev=function(){if(!this.sliding)return this.slide("prev")},e.prototype.slide=function(i,s){var n=this.$element.find(".item.active"),a=s||this.getItemForDirection(i,n),r=this.interval,o="next"==i?"left":"right",l=this;if(a.hasClass("active"))return this.sliding=!1;var h=a[0],c=t.Event("slide.bs.carousel",{relatedTarget:h,direction:o});if(this.$element.trigger(c),!c.isDefaultPrevented()){if(this.sliding=!0,r&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var d=t(this.$indicators.children()[this.getItemIndex(a)]);d&&d.addClass("active")}var u=t.Event("slid.bs.carousel",{relatedTarget:h,direction:o});return t.support.transition&&this.$element.hasClass("slide")?(a.addClass(i),a[0].offsetWidth,n.addClass(o),a.addClass(o),n.one("bsTransitionEnd",function(){a.removeClass([i,o].join(" ")).addClass("active"),n.removeClass(["active",o].join(" ")),l.sliding=!1,setTimeout(function(){l.$element.trigger(u)},0)}).emulateTransitionEnd(e.TRANSITION_DURATION)):(n.removeClass("active"),a.addClass("active"),this.sliding=!1,this.$element.trigger(u)),r&&this.cycle(),this}};var s=t.fn.carousel;t.fn.carousel=i,t.fn.carousel.Constructor=e,t.fn.carousel.noConflict=function(){return t.fn.carousel=s,this};var n=function(e){var s,n=t(this),a=t(n.attr("data-target")||(s=n.attr("href"))&&s.replace(/.*(?=#[^\s]+$)/,""));if(a.hasClass("carousel")){var r=t.extend({},a.data(),n.data()),o=n.attr("data-slide-to");o&&(r.interval=!1),i.call(a,r),o&&a.data("bs.carousel").to(o),e.preventDefault()}};t(document).on("click.bs.carousel.data-api","[data-slide]",n).on("click.bs.carousel.data-api","[data-slide-to]",n),t(window).on("load",function(){t('[data-ride="carousel"]').each(function(){var e=t(this);i.call(e,e.data())})})}(jQuery);
},{}],31:[function(require,module,exports) {
!function(t){"use strict";var e=function(a,s){this.$element=t(a),this.options=t.extend({},e.DEFAULTS,s),this.$trigger=t('[data-toggle="collapse"][href="#'+a.id+'"],[data-toggle="collapse"][data-target="#'+a.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};function a(e){var a,s=e.attr("data-target")||(a=e.attr("href"))&&a.replace(/.*(?=#[^\s]+$)/,"");return t(s)}function s(a){return this.each(function(){var s=t(this),i=s.data("bs.collapse"),n=t.extend({},e.DEFAULTS,s.data(),"object"==typeof a&&a);!i&&n.toggle&&/show|hide/.test(a)&&(n.toggle=!1),i||s.data("bs.collapse",i=new e(this,n)),"string"==typeof a&&i[a]()})}e.VERSION="3.3.7",e.TRANSITION_DURATION=350,e.DEFAULTS={toggle:!0},e.prototype.dimension=function(){return this.$element.hasClass("width")?"width":"height"},e.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var a,i=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(i&&i.length&&(a=i.data("bs.collapse"))&&a.transitioning)){var n=t.Event("show.bs.collapse");if(this.$element.trigger(n),!n.isDefaultPrevented()){i&&i.length&&(s.call(i,"hide"),a||i.data("bs.collapse",null));var l=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[l](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var o=function(){this.$element.removeClass("collapsing").addClass("collapse in")[l](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!t.support.transition)return o.call(this);var r=t.camelCase(["scroll",l].join("-"));this.$element.one("bsTransitionEnd",t.proxy(o,this)).emulateTransitionEnd(e.TRANSITION_DURATION)[l](this.$element[0][r])}}}},e.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var a=t.Event("hide.bs.collapse");if(this.$element.trigger(a),!a.isDefaultPrevented()){var s=this.dimension();this.$element[s](this.$element[s]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var i=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};if(!t.support.transition)return i.call(this);this.$element[s](0).one("bsTransitionEnd",t.proxy(i,this)).emulateTransitionEnd(e.TRANSITION_DURATION)}}},e.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},e.prototype.getParent=function(){return t(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(t.proxy(function(e,s){var i=t(s);this.addAriaAndCollapsedClass(a(i),i)},this)).end()},e.prototype.addAriaAndCollapsedClass=function(t,e){var a=t.hasClass("in");t.attr("aria-expanded",a),e.toggleClass("collapsed",!a).attr("aria-expanded",a)};var i=t.fn.collapse;t.fn.collapse=s,t.fn.collapse.Constructor=e,t.fn.collapse.noConflict=function(){return t.fn.collapse=i,this},t(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(e){var i=t(this);i.attr("data-target")||e.preventDefault();var n=a(i),l=n.data("bs.collapse")?"toggle":i.data();s.call(n,l)})}(jQuery);
},{}],32:[function(require,module,exports) {
!function(t){"use strict";var e=".dropdown-backdrop",o='[data-toggle="dropdown"]',n=function(e){t(e).on("click.bs.dropdown",this.toggle)};function r(e){var o=e.attr("data-target");o||(o=(o=e.attr("href"))&&/#[A-Za-z]/.test(o)&&o.replace(/.*(?=#[^\s]*$)/,""));var n=o&&t(o);return n&&n.length?n:e.parent()}function a(n){n&&3===n.which||(t(e).remove(),t(o).each(function(){var e=t(this),o=r(e),a={relatedTarget:this};o.hasClass("open")&&(n&&"click"==n.type&&/input|textarea/i.test(n.target.tagName)&&t.contains(o[0],n.target)||(o.trigger(n=t.Event("hide.bs.dropdown",a)),n.isDefaultPrevented()||(e.attr("aria-expanded","false"),o.removeClass("open").trigger(t.Event("hidden.bs.dropdown",a)))))}))}n.VERSION="3.3.7",n.prototype.toggle=function(e){var o=t(this);if(!o.is(".disabled, :disabled")){var n=r(o),d=n.hasClass("open");if(a(),!d){"ontouchstart"in document.documentElement&&!n.closest(".navbar-nav").length&&t(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(t(this)).on("click",a);var i={relatedTarget:this};if(n.trigger(e=t.Event("show.bs.dropdown",i)),e.isDefaultPrevented())return;o.trigger("focus").attr("aria-expanded","true"),n.toggleClass("open").trigger(t.Event("shown.bs.dropdown",i))}return!1}},n.prototype.keydown=function(e){if(/(38|40|27|32)/.test(e.which)&&!/input|textarea/i.test(e.target.tagName)){var n=t(this);if(e.preventDefault(),e.stopPropagation(),!n.is(".disabled, :disabled")){var a=r(n),d=a.hasClass("open");if(!d&&27!=e.which||d&&27==e.which)return 27==e.which&&a.find(o).trigger("focus"),n.trigger("click");var i=a.find(".dropdown-menu li:not(.disabled):visible a");if(i.length){var s=i.index(e.target);38==e.which&&s>0&&s--,40==e.which&&s<i.length-1&&s++,~s||(s=0),i.eq(s).trigger("focus")}}}};var d=t.fn.dropdown;t.fn.dropdown=function(e){return this.each(function(){var o=t(this),r=o.data("bs.dropdown");r||o.data("bs.dropdown",r=new n(this)),"string"==typeof e&&r[e].call(o)})},t.fn.dropdown.Constructor=n,t.fn.dropdown.noConflict=function(){return t.fn.dropdown=d,this},t(document).on("click.bs.dropdown.data-api",a).on("click.bs.dropdown.data-api",".dropdown form",function(t){t.stopPropagation()}).on("click.bs.dropdown.data-api",o,n.prototype.toggle).on("keydown.bs.dropdown.data-api",o,n.prototype.keydown).on("keydown.bs.dropdown.data-api",".dropdown-menu",n.prototype.keydown)}(jQuery);
},{}],33:[function(require,module,exports) {
!function(t){"use strict";var e=function(e,o){this.options=o,this.$body=t(document.body),this.$element=t(e),this.$dialog=this.$element.find(".modal-dialog"),this.$backdrop=null,this.isShown=null,this.originalBodyPad=null,this.scrollbarWidth=0,this.ignoreBackdropClick=!1,this.options.remote&&this.$element.find(".modal-content").load(this.options.remote,t.proxy(function(){this.$element.trigger("loaded.bs.modal")},this))};function o(o,i){return this.each(function(){var s=t(this),n=s.data("bs.modal"),a=t.extend({},e.DEFAULTS,s.data(),"object"==typeof o&&o);n||s.data("bs.modal",n=new e(this,a)),"string"==typeof o?n[o](i):a.show&&n.show(i)})}e.VERSION="3.3.7",e.TRANSITION_DURATION=300,e.BACKDROP_TRANSITION_DURATION=150,e.DEFAULTS={backdrop:!0,keyboard:!0,show:!0},e.prototype.toggle=function(t){return this.isShown?this.hide():this.show(t)},e.prototype.show=function(o){var i=this,s=t.Event("show.bs.modal",{relatedTarget:o});this.$element.trigger(s),this.isShown||s.isDefaultPrevented()||(this.isShown=!0,this.checkScrollbar(),this.setScrollbar(),this.$body.addClass("modal-open"),this.escape(),this.resize(),this.$element.on("click.dismiss.bs.modal",'[data-dismiss="modal"]',t.proxy(this.hide,this)),this.$dialog.on("mousedown.dismiss.bs.modal",function(){i.$element.one("mouseup.dismiss.bs.modal",function(e){t(e.target).is(i.$element)&&(i.ignoreBackdropClick=!0)})}),this.backdrop(function(){var s=t.support.transition&&i.$element.hasClass("fade");i.$element.parent().length||i.$element.appendTo(i.$body),i.$element.show().scrollTop(0),i.adjustDialog(),s&&i.$element[0].offsetWidth,i.$element.addClass("in"),i.enforceFocus();var n=t.Event("shown.bs.modal",{relatedTarget:o});s?i.$dialog.one("bsTransitionEnd",function(){i.$element.trigger("focus").trigger(n)}).emulateTransitionEnd(e.TRANSITION_DURATION):i.$element.trigger("focus").trigger(n)}))},e.prototype.hide=function(o){o&&o.preventDefault(),o=t.Event("hide.bs.modal"),this.$element.trigger(o),this.isShown&&!o.isDefaultPrevented()&&(this.isShown=!1,this.escape(),this.resize(),t(document).off("focusin.bs.modal"),this.$element.removeClass("in").off("click.dismiss.bs.modal").off("mouseup.dismiss.bs.modal"),this.$dialog.off("mousedown.dismiss.bs.modal"),t.support.transition&&this.$element.hasClass("fade")?this.$element.one("bsTransitionEnd",t.proxy(this.hideModal,this)).emulateTransitionEnd(e.TRANSITION_DURATION):this.hideModal())},e.prototype.enforceFocus=function(){t(document).off("focusin.bs.modal").on("focusin.bs.modal",t.proxy(function(t){document===t.target||this.$element[0]===t.target||this.$element.has(t.target).length||this.$element.trigger("focus")},this))},e.prototype.escape=function(){this.isShown&&this.options.keyboard?this.$element.on("keydown.dismiss.bs.modal",t.proxy(function(t){27==t.which&&this.hide()},this)):this.isShown||this.$element.off("keydown.dismiss.bs.modal")},e.prototype.resize=function(){this.isShown?t(window).on("resize.bs.modal",t.proxy(this.handleUpdate,this)):t(window).off("resize.bs.modal")},e.prototype.hideModal=function(){var t=this;this.$element.hide(),this.backdrop(function(){t.$body.removeClass("modal-open"),t.resetAdjustments(),t.resetScrollbar(),t.$element.trigger("hidden.bs.modal")})},e.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},e.prototype.backdrop=function(o){var i=this,s=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var n=t.support.transition&&s;if(this.$backdrop=t(document.createElement("div")).addClass("modal-backdrop "+s).appendTo(this.$body),this.$element.on("click.dismiss.bs.modal",t.proxy(function(t){this.ignoreBackdropClick?this.ignoreBackdropClick=!1:t.target===t.currentTarget&&("static"==this.options.backdrop?this.$element[0].focus():this.hide())},this)),n&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!o)return;n?this.$backdrop.one("bsTransitionEnd",o).emulateTransitionEnd(e.BACKDROP_TRANSITION_DURATION):o()}else if(!this.isShown&&this.$backdrop){this.$backdrop.removeClass("in");var a=function(){i.removeBackdrop(),o&&o()};t.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one("bsTransitionEnd",a).emulateTransitionEnd(e.BACKDROP_TRANSITION_DURATION):a()}else o&&o()},e.prototype.handleUpdate=function(){this.adjustDialog()},e.prototype.adjustDialog=function(){var t=this.$element[0].scrollHeight>document.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&t?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!t?this.scrollbarWidth:""})},e.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},e.prototype.checkScrollbar=function(){var t=window.innerWidth;if(!t){var e=document.documentElement.getBoundingClientRect();t=e.right-Math.abs(e.left)}this.bodyIsOverflowing=document.body.clientWidth<t,this.scrollbarWidth=this.measureScrollbar()},e.prototype.setScrollbar=function(){var t=parseInt(this.$body.css("padding-right")||0,10);this.originalBodyPad=document.body.style.paddingRight||"",this.bodyIsOverflowing&&this.$body.css("padding-right",t+this.scrollbarWidth)},e.prototype.resetScrollbar=function(){this.$body.css("padding-right",this.originalBodyPad)},e.prototype.measureScrollbar=function(){var t=document.createElement("div");t.className="modal-scrollbar-measure",this.$body.append(t);var e=t.offsetWidth-t.clientWidth;return this.$body[0].removeChild(t),e};var i=t.fn.modal;t.fn.modal=o,t.fn.modal.Constructor=e,t.fn.modal.noConflict=function(){return t.fn.modal=i,this},t(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',function(e){var i=t(this),s=i.attr("href"),n=t(i.attr("data-target")||s&&s.replace(/.*(?=#[^\s]+$)/,"")),a=n.data("bs.modal")?"toggle":t.extend({remote:!/#/.test(s)&&s},n.data(),i.data());i.is("a")&&e.preventDefault(),n.one("show.bs.modal",function(t){t.isDefaultPrevented()||n.one("hidden.bs.modal",function(){i.is(":visible")&&i.trigger("focus")})}),o.call(n,a,this)})}(jQuery);
},{}],34:[function(require,module,exports) {
!function(t){"use strict";var e=function(t,e){this.type=null,this.options=null,this.enabled=null,this.timeout=null,this.hoverState=null,this.$element=null,this.inState=null,this.init("tooltip",t,e)};e.VERSION="3.3.7",e.TRANSITION_DURATION=150,e.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}},e.prototype.init=function(e,i,o){if(this.enabled=!0,this.type=e,this.$element=t(i),this.options=this.getOptions(o),this.$viewport=this.options.viewport&&t(t.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var n=this.options.trigger.split(" "),s=n.length;s--;){var r=n[s];if("click"==r)this.$element.on("click."+this.type,this.options.selector,t.proxy(this.toggle,this));else if("manual"!=r){var l="hover"==r?"mouseenter":"focusin",a="hover"==r?"mouseleave":"focusout";this.$element.on(l+"."+this.type,this.options.selector,t.proxy(this.enter,this)),this.$element.on(a+"."+this.type,this.options.selector,t.proxy(this.leave,this))}}this.options.selector?this._options=t.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},e.prototype.getDefaults=function(){return e.DEFAULTS},e.prototype.getOptions=function(e){return(e=t.extend({},this.getDefaults(),this.$element.data(),e)).delay&&"number"==typeof e.delay&&(e.delay={show:e.delay,hide:e.delay}),e},e.prototype.getDelegateOptions=function(){var e={},i=this.getDefaults();return this._options&&t.each(this._options,function(t,o){i[t]!=o&&(e[t]=o)}),e},e.prototype.enter=function(e){var i=e instanceof this.constructor?e:t(e.currentTarget).data("bs."+this.type);if(i||(i=new this.constructor(e.currentTarget,this.getDelegateOptions()),t(e.currentTarget).data("bs."+this.type,i)),e instanceof t.Event&&(i.inState["focusin"==e.type?"focus":"hover"]=!0),i.tip().hasClass("in")||"in"==i.hoverState)i.hoverState="in";else{if(clearTimeout(i.timeout),i.hoverState="in",!i.options.delay||!i.options.delay.show)return i.show();i.timeout=setTimeout(function(){"in"==i.hoverState&&i.show()},i.options.delay.show)}},e.prototype.isInStateTrue=function(){for(var t in this.inState)if(this.inState[t])return!0;return!1},e.prototype.leave=function(e){var i=e instanceof this.constructor?e:t(e.currentTarget).data("bs."+this.type);if(i||(i=new this.constructor(e.currentTarget,this.getDelegateOptions()),t(e.currentTarget).data("bs."+this.type,i)),e instanceof t.Event&&(i.inState["focusout"==e.type?"focus":"hover"]=!1),!i.isInStateTrue()){if(clearTimeout(i.timeout),i.hoverState="out",!i.options.delay||!i.options.delay.hide)return i.hide();i.timeout=setTimeout(function(){"out"==i.hoverState&&i.hide()},i.options.delay.hide)}},e.prototype.show=function(){var i=t.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(i);var o=t.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(i.isDefaultPrevented()||!o)return;var n=this,s=this.tip(),r=this.getUID(this.type);this.setContent(),s.attr("id",r),this.$element.attr("aria-describedby",r),this.options.animation&&s.addClass("fade");var l="function"==typeof this.options.placement?this.options.placement.call(this,s[0],this.$element[0]):this.options.placement,a=/\s?auto?\s?/i,p=a.test(l);p&&(l=l.replace(a,"")||"top"),s.detach().css({top:0,left:0,display:"block"}).addClass(l).data("bs."+this.type,this),this.options.container?s.appendTo(this.options.container):s.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var h=this.getPosition(),f=s[0].offsetWidth,c=s[0].offsetHeight;if(p){var u=l,d=this.getPosition(this.$viewport);l="bottom"==l&&h.bottom+c>d.bottom?"top":"top"==l&&h.top-c<d.top?"bottom":"right"==l&&h.right+f>d.width?"left":"left"==l&&h.left-f<d.left?"right":l,s.removeClass(u).addClass(l)}var g=this.getCalculatedOffset(l,h,f,c);this.applyPlacement(g,l);var m=function(){var t=n.hoverState;n.$element.trigger("shown.bs."+n.type),n.hoverState=null,"out"==t&&n.leave(n)};t.support.transition&&this.$tip.hasClass("fade")?s.one("bsTransitionEnd",m).emulateTransitionEnd(e.TRANSITION_DURATION):m()}},e.prototype.applyPlacement=function(e,i){var o=this.tip(),n=o[0].offsetWidth,s=o[0].offsetHeight,r=parseInt(o.css("margin-top"),10),l=parseInt(o.css("margin-left"),10);isNaN(r)&&(r=0),isNaN(l)&&(l=0),e.top+=r,e.left+=l,t.offset.setOffset(o[0],t.extend({using:function(t){o.css({top:Math.round(t.top),left:Math.round(t.left)})}},e),0),o.addClass("in");var a=o[0].offsetWidth,p=o[0].offsetHeight;"top"==i&&p!=s&&(e.top=e.top+s-p);var h=this.getViewportAdjustedDelta(i,e,a,p);h.left?e.left+=h.left:e.top+=h.top;var f=/top|bottom/.test(i),c=f?2*h.left-n+a:2*h.top-s+p,u=f?"offsetWidth":"offsetHeight";o.offset(e),this.replaceArrow(c,o[0][u],f)},e.prototype.replaceArrow=function(t,e,i){this.arrow().css(i?"left":"top",50*(1-t/e)+"%").css(i?"top":"left","")},e.prototype.setContent=function(){var t=this.tip(),e=this.getTitle();t.find(".tooltip-inner")[this.options.html?"html":"text"](e),t.removeClass("fade in top bottom left right")},e.prototype.hide=function(i){var o=this,n=t(this.$tip),s=t.Event("hide.bs."+this.type);function r(){"in"!=o.hoverState&&n.detach(),o.$element&&o.$element.removeAttr("aria-describedby").trigger("hidden.bs."+o.type),i&&i()}if(this.$element.trigger(s),!s.isDefaultPrevented())return n.removeClass("in"),t.support.transition&&n.hasClass("fade")?n.one("bsTransitionEnd",r).emulateTransitionEnd(e.TRANSITION_DURATION):r(),this.hoverState=null,this},e.prototype.fixTitle=function(){var t=this.$element;(t.attr("title")||"string"!=typeof t.attr("data-original-title"))&&t.attr("data-original-title",t.attr("title")||"").attr("title","")},e.prototype.hasContent=function(){return this.getTitle()},e.prototype.getPosition=function(e){var i=(e=e||this.$element)[0],o="BODY"==i.tagName,n=i.getBoundingClientRect();null==n.width&&(n=t.extend({},n,{width:n.right-n.left,height:n.bottom-n.top}));var s=window.SVGElement&&i instanceof window.SVGElement,r=o?{top:0,left:0}:s?null:e.offset(),l={scroll:o?document.documentElement.scrollTop||document.body.scrollTop:e.scrollTop()},a=o?{width:t(window).width(),height:t(window).height()}:null;return t.extend({},n,l,a,r)},e.prototype.getCalculatedOffset=function(t,e,i,o){return"bottom"==t?{top:e.top+e.height,left:e.left+e.width/2-i/2}:"top"==t?{top:e.top-o,left:e.left+e.width/2-i/2}:"left"==t?{top:e.top+e.height/2-o/2,left:e.left-i}:{top:e.top+e.height/2-o/2,left:e.left+e.width}},e.prototype.getViewportAdjustedDelta=function(t,e,i,o){var n={top:0,left:0};if(!this.$viewport)return n;var s=this.options.viewport&&this.options.viewport.padding||0,r=this.getPosition(this.$viewport);if(/right|left/.test(t)){var l=e.top-s-r.scroll,a=e.top+s-r.scroll+o;l<r.top?n.top=r.top-l:a>r.top+r.height&&(n.top=r.top+r.height-a)}else{var p=e.left-s,h=e.left+s+i;p<r.left?n.left=r.left-p:h>r.right&&(n.left=r.left+r.width-h)}return n},e.prototype.getTitle=function(){var t=this.$element,e=this.options;return t.attr("data-original-title")||("function"==typeof e.title?e.title.call(t[0]):e.title)},e.prototype.getUID=function(t){do{t+=~~(1e6*Math.random())}while(document.getElementById(t));return t},e.prototype.tip=function(){if(!this.$tip&&(this.$tip=t(this.options.template),1!=this.$tip.length))throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!");return this.$tip},e.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},e.prototype.enable=function(){this.enabled=!0},e.prototype.disable=function(){this.enabled=!1},e.prototype.toggleEnabled=function(){this.enabled=!this.enabled},e.prototype.toggle=function(e){var i=this;e&&((i=t(e.currentTarget).data("bs."+this.type))||(i=new this.constructor(e.currentTarget,this.getDelegateOptions()),t(e.currentTarget).data("bs."+this.type,i))),e?(i.inState.click=!i.inState.click,i.isInStateTrue()?i.enter(i):i.leave(i)):i.tip().hasClass("in")?i.leave(i):i.enter(i)},e.prototype.destroy=function(){var t=this;clearTimeout(this.timeout),this.hide(function(){t.$element.off("."+t.type).removeData("bs."+t.type),t.$tip&&t.$tip.detach(),t.$tip=null,t.$arrow=null,t.$viewport=null,t.$element=null})};var i=t.fn.tooltip;t.fn.tooltip=function(i){return this.each(function(){var o=t(this),n=o.data("bs.tooltip"),s="object"==typeof i&&i;!n&&/destroy|hide/.test(i)||(n||o.data("bs.tooltip",n=new e(this,s)),"string"==typeof i&&n[i]())})},t.fn.tooltip.Constructor=e,t.fn.tooltip.noConflict=function(){return t.fn.tooltip=i,this}}(jQuery);
},{}],35:[function(require,module,exports) {
!function(t){"use strict";var o=function(t,o){this.init("popover",t,o)};if(!t.fn.tooltip)throw new Error("Popover requires tooltip.js");o.VERSION="3.3.7",o.DEFAULTS=t.extend({},t.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:'<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'}),o.prototype=t.extend({},t.fn.tooltip.Constructor.prototype),o.prototype.constructor=o,o.prototype.getDefaults=function(){return o.DEFAULTS},o.prototype.setContent=function(){var t=this.tip(),o=this.getTitle(),e=this.getContent();t.find(".popover-title")[this.options.html?"html":"text"](o),t.find(".popover-content").children().detach().end()[this.options.html?"string"==typeof e?"html":"append":"text"](e),t.removeClass("fade top bottom left right in"),t.find(".popover-title").html()||t.find(".popover-title").hide()},o.prototype.hasContent=function(){return this.getTitle()||this.getContent()},o.prototype.getContent=function(){var t=this.$element,o=this.options;return t.attr("data-content")||("function"==typeof o.content?o.content.call(t[0]):o.content)},o.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};var e=t.fn.popover;t.fn.popover=function(e){return this.each(function(){var n=t(this),r=n.data("bs.popover"),i="object"==typeof e&&e;!r&&/destroy|hide/.test(e)||(r||n.data("bs.popover",r=new o(this,i)),"string"==typeof e&&r[e]())})},t.fn.popover.Constructor=o,t.fn.popover.noConflict=function(){return t.fn.popover=e,this}}(jQuery);
},{}],36:[function(require,module,exports) {
!function(t){"use strict";function s(e,i){this.$body=t(document.body),this.$scrollElement=t(e).is(document.body)?t(window):t(e),this.options=t.extend({},s.DEFAULTS,i),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",t.proxy(this.process,this)),this.refresh(),this.process()}function e(e){return this.each(function(){var i=t(this),o=i.data("bs.scrollspy"),r="object"==typeof e&&e;o||i.data("bs.scrollspy",o=new s(this,r)),"string"==typeof e&&o[e]()})}s.VERSION="3.3.7",s.DEFAULTS={offset:10},s.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},s.prototype.refresh=function(){var s=this,e="offset",i=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),t.isWindow(this.$scrollElement[0])||(e="position",i=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map(function(){var s=t(this),o=s.data("target")||s.attr("href"),r=/^#./.test(o)&&t(o);return r&&r.length&&r.is(":visible")&&[[r[e]().top+i,o]]||null}).sort(function(t,s){return t[0]-s[0]}).each(function(){s.offsets.push(this[0]),s.targets.push(this[1])})},s.prototype.process=function(){var t,s=this.$scrollElement.scrollTop()+this.options.offset,e=this.getScrollHeight(),i=this.options.offset+e-this.$scrollElement.height(),o=this.offsets,r=this.targets,l=this.activeTarget;if(this.scrollHeight!=e&&this.refresh(),s>=i)return l!=(t=r[r.length-1])&&this.activate(t);if(l&&s<o[0])return this.activeTarget=null,this.clear();for(t=o.length;t--;)l!=r[t]&&s>=o[t]&&(void 0===o[t+1]||s<o[t+1])&&this.activate(r[t])},s.prototype.activate=function(s){this.activeTarget=s,this.clear();var e=this.selector+'[data-target="'+s+'"],'+this.selector+'[href="'+s+'"]',i=t(e).parents("li").addClass("active");i.parent(".dropdown-menu").length&&(i=i.closest("li.dropdown").addClass("active")),i.trigger("activate.bs.scrollspy")},s.prototype.clear=function(){t(this.selector).parentsUntil(this.options.target,".active").removeClass("active")};var i=t.fn.scrollspy;t.fn.scrollspy=e,t.fn.scrollspy.Constructor=s,t.fn.scrollspy.noConflict=function(){return t.fn.scrollspy=i,this},t(window).on("load.bs.scrollspy.data-api",function(){t('[data-spy="scroll"]').each(function(){var s=t(this);e.call(s,s.data())})})}(jQuery);
},{}],37:[function(require,module,exports) {
!function(t){"use strict";var a=function(a){this.element=t(a)};function e(e){return this.each(function(){var n=t(this),i=n.data("bs.tab");i||n.data("bs.tab",i=new a(this)),"string"==typeof e&&i[e]()})}a.VERSION="3.3.7",a.TRANSITION_DURATION=150,a.prototype.show=function(){var a=this.element,e=a.closest("ul:not(.dropdown-menu)"),n=a.data("target");if(n||(n=(n=a.attr("href"))&&n.replace(/.*(?=#[^\s]*$)/,"")),!a.parent("li").hasClass("active")){var i=e.find(".active:last a"),r=t.Event("hide.bs.tab",{relatedTarget:a[0]}),s=t.Event("show.bs.tab",{relatedTarget:i[0]});if(i.trigger(r),a.trigger(s),!s.isDefaultPrevented()&&!r.isDefaultPrevented()){var d=t(n);this.activate(a.closest("li"),e),this.activate(d,d.parent(),function(){i.trigger({type:"hidden.bs.tab",relatedTarget:a[0]}),a.trigger({type:"shown.bs.tab",relatedTarget:i[0]})})}}},a.prototype.activate=function(e,n,i){var r=n.find("> .active"),s=i&&t.support.transition&&(r.length&&r.hasClass("fade")||!!n.find("> .fade").length);function d(){r.removeClass("active").find("> .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),e.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),s?(e[0].offsetWidth,e.addClass("in")):e.removeClass("fade"),e.parent(".dropdown-menu").length&&e.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),i&&i()}r.length&&s?r.one("bsTransitionEnd",d).emulateTransitionEnd(a.TRANSITION_DURATION):d(),r.removeClass("in")};var n=t.fn.tab;t.fn.tab=e,t.fn.tab.Constructor=a,t.fn.tab.noConflict=function(){return t.fn.tab=n,this};var i=function(a){a.preventDefault(),e.call(t(this),"show")};t(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',i).on("click.bs.tab.data-api",'[data-toggle="pill"]',i)}(jQuery);
},{}],38:[function(require,module,exports) {
!function(t){"use strict";var i=function(e,o){this.options=t.extend({},i.DEFAULTS,o),this.$target=t(this.options.target).on("scroll.bs.affix.data-api",t.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",t.proxy(this.checkPositionWithEventLoop,this)),this.$element=t(e),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};function e(e){return this.each(function(){var o=t(this),f=o.data("bs.affix"),n="object"==typeof e&&e;f||o.data("bs.affix",f=new i(this,n)),"string"==typeof e&&f[e]()})}i.VERSION="3.3.7",i.RESET="affix affix-top affix-bottom",i.DEFAULTS={offset:0,target:window},i.prototype.getState=function(t,i,e,o){var f=this.$target.scrollTop(),n=this.$element.offset(),s=this.$target.height();if(null!=e&&"top"==this.affixed)return f<e&&"top";if("bottom"==this.affixed)return null!=e?!(f+this.unpin<=n.top)&&"bottom":!(f+s<=t-o)&&"bottom";var a=null==this.affixed,h=a?f:n.top;return null!=e&&f<=e?"top":null!=o&&h+(a?s:i)>=t-o&&"bottom"},i.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(i.RESET).addClass("affix");var t=this.$target.scrollTop(),e=this.$element.offset();return this.pinnedOffset=e.top-t},i.prototype.checkPositionWithEventLoop=function(){setTimeout(t.proxy(this.checkPosition,this),1)},i.prototype.checkPosition=function(){if(this.$element.is(":visible")){var e=this.$element.height(),o=this.options.offset,f=o.top,n=o.bottom,s=Math.max(t(document).height(),t(document.body).height());"object"!=typeof o&&(n=f=o),"function"==typeof f&&(f=o.top(this.$element)),"function"==typeof n&&(n=o.bottom(this.$element));var a=this.getState(s,e,f,n);if(this.affixed!=a){null!=this.unpin&&this.$element.css("top","");var h="affix"+(a?"-"+a:""),r=t.Event(h+".bs.affix");if(this.$element.trigger(r),r.isDefaultPrevented())return;this.affixed=a,this.unpin="bottom"==a?this.getPinnedOffset():null,this.$element.removeClass(i.RESET).addClass(h).trigger(h.replace("affix","affixed")+".bs.affix")}"bottom"==a&&this.$element.offset({top:s-e-n})}};var o=t.fn.affix;t.fn.affix=e,t.fn.affix.Constructor=i,t.fn.affix.noConflict=function(){return t.fn.affix=o,this},t(window).on("load",function(){t('[data-spy="affix"]').each(function(){var i=t(this),o=i.data();o.offset=o.offset||{},null!=o.offsetBottom&&(o.offset.bottom=o.offsetBottom),null!=o.offsetTop&&(o.offset.top=o.offsetTop),e.call(i,o)})})}(jQuery);
},{}],26:[function(require,module,exports) {
require("../../js/transition.js"),require("../../js/alert.js"),require("../../js/button.js"),require("../../js/carousel.js"),require("../../js/collapse.js"),require("../../js/dropdown.js"),require("../../js/modal.js"),require("../../js/tooltip.js"),require("../../js/popover.js"),require("../../js/scrollspy.js"),require("../../js/tab.js"),require("../../js/affix.js");
},{"../../js/transition.js":27,"../../js/alert.js":28,"../../js/button.js":29,"../../js/carousel.js":30,"../../js/collapse.js":31,"../../js/dropdown.js":32,"../../js/modal.js":33,"../../js/tooltip.js":34,"../../js/popover.js":35,"../../js/scrollspy.js":36,"../../js/tab.js":37,"../../js/affix.js":38}],18:[function(require,module,exports) {
var e=require("backbone"),t=require("../models/ncanno"),n=jQuery=require("jquery"),s=require("bootstrap"),a=e.View.extend({events:{"click #annook":"applyAnno","click #wc1":"selectWc1","click #hg1":"selectHg1","click #sg1":"selectSg1","click #wc2":"selectWc2","click #hg2":"selectHg2","click #sg2":"selectSg2","click #st1":"selectStericityCis","click #st2":"selectStericityTrans"},initialize:function(e,n,s,a,i){var o=document.createElement("div");i.parentNode.appendChild(o),this.setElement(o),this.anno=new t(e,n,s,a),this.defineStyle(),this.render()},applyAnno:function(){var e=this.anno.get("base1"),t=this.anno.get("base2"),n=this.anno.get("stericity");this.anno.get("edge")._private.classes={},this.anno.get("edge").addClass(e+t+n),this.remove()},render:function(){var e=this.anno.get("edge").source().data("label"),t=this.anno.get("edge").target().data("label"),n=this.anno.getLabels();this.el.innerHTML+="<div class='col-md-4'><span>Residue: "+e+"</span><div class='dropdown'><button class='btn btn-default dropdown-toggle' type='button' id='menu1' data-toggle='dropdown'>"+n[0]+"<span class='caret'></span></button><ul class='dropdown-menu' role='menu' aria-labelledby='menu1'><li role='presentation'><span class='text-muted' id='wc1' style='cursor: pointer;'>Watson-Crick</span></li><li role='presentation'><span class='text-muted' id='hg1' style='cursor: pointer;'>Hoogsteen</span></li><li role='presentation'><span class='text-muted' id='sg1' style='cursor: pointer;'>Sugar</span></li></ul></div></div>",this.el.innerHTML+="<div class='col-md-4'><span>Residue: "+t+"</span><div class='dropdown'><button class='btn btn-default dropdown-toggle' type='button' id='menu2' data-toggle='dropdown'>"+n[1]+"<span class='caret'></span></button><ul class='dropdown-menu' role='menu' aria-labelledby='menu2'><li role='presentation'><span class='text-muted' id='wc2' style='cursor: pointer;'>Watson-Crick</span></li><li role='presentation'><span class='text-muted' id='hg2' style='cursor: pointer;'>Hoogsteen</span></li><li role='presentation'><span class='text-muted' id='sg2' style='cursor: pointer;'>Sugar</span></li></ul></div></div>",this.el.innerHTML+="<div class='col-md-3'><div class='dropdown'><button class='btn btn-default dropdown-toggle' type='button' id='menu3' data-toggle='dropdown' style='margin-top: 19px;'>"+n[2]+"<span class='caret'></span></button><ul class='dropdown-menu'><li role='presentation'><span class='text-muted' id='st1' style='cursor: pointer;'>cis</span></li><li role='presentation'><span class='text-muted' id='st2' style='cursor: pointer;'>trans</span></li></ul></div></div>",this.el.innerHTML+="<div class='col-md-1'><button class='btn btn-default' type='button' id='annook' style='margin-top: 19px;'>OK</button></div>"},defineStyle:function(){var e=this.el.style;e.display="block",e.position="absolute",e.left="1%",e.width="435px",e.height="170px",e.padding="10px",e.paddingRight="55px",e.border="1px solid black",e.borderRadius="1px",e.backgroundColor="#F6F6F6",e.overflow="auto",e.fontWeight="bold",e.textAlign="center",e.zIndex=1002},selectWc1:function(){this.anno.set("base1","wc"),document.getElementById("menu1").innerHTML="Watson-Crick<span class='caret'></span>"},selectHg1:function(){this.anno.set("base1","hg"),document.getElementById("menu1").innerHTML="Hoogsteen<span class='caret'></span>"},selectSg1:function(){this.anno.set("base1","sg"),document.getElementById("menu1").innerHTML="Sugar<span class='caret'></span>"},selectWc2:function(){this.anno.set("base2","wc"),document.getElementById("menu2").innerHTML="Watson-Crick<span class='caret'></span>"},selectHg2:function(){this.anno.set("base2","hg"),document.getElementById("menu2").innerHTML="Hoogsteen<span class='caret'></span>"},selectSg2:function(){this.anno.set("base2","sg"),document.getElementById("menu2").innerHTML="Sugar<span class='caret'></span>"},selectStericityCis:function(){this.anno.set("stericity","cis"),document.getElementById("menu3").innerHTML="Cis<span class='caret'></span>"},selectStericityTrans:function(){this.anno.set("stericity","trans"),document.getElementById("menu3").innerHTML="Trans<span class='caret'></span>"}});module.exports=a;
},{"backbone":5,"../models/ncanno":25,"jquery":6,"bootstrap":26}],19:[function(require,module,exports) {
!function(e,t){"use strict";var n=function(e,t){if(cytoscape){var n={preview:!0,handleSize:10,handleTouchTargetMult:3,handleColor:"#ff0000",handleLineType:"ghost",handleLineWidth:1,handleNodes:"node",hoverDelay:150,cxt:!1,enabled:!0,toggleOffOnLeave:!1,edgeType:function(e,t){return"flat"},loopAllowed:function(e){return!1},nodeLoopOffset:-50,nodeParams:function(e,t){return{}},edgeParams:function(e,t,n){return{}},start:function(e){},complete:function(e,t,n){},stop:function(e){}};t.fn.cytoscapeEdgehandles=function(o){var d=o,a={destroy:function(){var e=t(this),n=e.data("cyedgehandles");if(null!=n)return n.unbind(),e.data("cyedgehandles",{}),e},option:function(e,o){var d=t(this),a=d.data("cyedgehandles");if(null!=a){var r=a.options;if(void 0===o){if(typeof e!=typeof{})return r[e];var s=e;r=t.extend(!0,{},n,s),a.options=r}else r[e]=o;return d.data("cyedgehandles",a),d}},disable:function(){return a.option.apply(this,["enabled",!1])},enable:function(){return a.option.apply(this,["enabled",!0])},resize:function(){t(this).trigger("cyedgehandles.resize")},drawon:function(){t(this).trigger("cyedgehandles.drawon")},drawoff:function(){t(this).trigger("cyedgehandles.drawoff")},init:function(){var d,a,r,s,i,l,g,h,c,u=t.extend(!0,{},n,o),f=t(this),p=t("<canvas></canvas>"),v=!1,y=!1,m=!1,b=!0,w=!1;function x(){p.attr("height",f.height()).attr("width",f.width()).css({position:"absolute","z-index":"999"})}f.append(p),x(),t(window).bind("resize",function(){x()}),f.bind("cyedgehandles.resize",function(){x()}),f.on("cyedgehandles.drawon",function(){w=!0,c=d.autoungrabify(),d.autoungrabify(!0)}),f.on("cyedgehandles.drawoff",function(){w=!1,d.autoungrabify(c)});var E,L,C,T,z=p[0].getContext("2d"),P=f.data("cyedgehandles");function O(){return E||(E=f.data("cyedgehandles").options)}function S(){return!O().enabled}function X(){if(!b){var e=f.width(),t=f.height();z.clearRect(0,0,e,t),b=!0}}function Y(){L=d.panningEnabled(),C=d.zoomingEnabled(),T=d.boxSelectionEnabled(),d.zoomingEnabled(!1).panningEnabled(!1).boxSelectionEnabled(!1)}function k(){X(),d.nodes().removeClass("edgehandles-hover").removeClass("edgehandles-source").removeClass("edgehandles-target"),d.$(".edgehandles-ghost").remove(),a=null,h=null,d.zoomingEnabled(C).panningEnabled(L).boxSelectionEnabled(T)}function N(e,t){e.edgesWith(t).filter(".edgehandles-preview").remove(),t.neighborhood("node.edgehandles-preview").closedNeighborhood(".edgehandles-preview").remove(),t.trigger("cyedgehandles.removepreview")}function W(e,t,n){z.fillStyle=O().handleColor,z.strokeStyle=O().handleColor,z.beginPath(),z.arc(e,t,n,0,2*Math.PI),z.closePath(),z.fill(),b=!1}null==P&&(P={}),P.options=u;var D=0,M=function(e,t,n,o){var r=+new Date;if(!(r-D<1e3/30)){switch(D=r,"ghost"!==O().handleLineType&&(z.fillStyle=O().handleColor,z.strokeStyle=O().handleColor,z.lineWidth=O().handleLineWidth),O().handleLineType){case"ghost":g&&!g.removed()||(W(),g=d.add({group:"nodes",classes:"edgehandles-ghost edgehandles-ghost-node",css:{"background-color":"blue",width:1e-4,height:1e-4,opacity:0},position:{x:0,y:0}}),d.add({group:"edges",classes:"edgehandles-ghost edgehandles-ghost-edge",data:{source:h.id(),target:g.id()}})),g.renderedPosition({x:n,y:o});break;case"straight":z.beginPath(),z.moveTo(e,t),z.lineTo(n,o),z.closePath(),z.stroke();break;case"draw":default:null==a?a=[[n,o]]:a.push([n,o]),z.beginPath(),z.moveTo(e,t);for(var s=0;s<a.length;s++){var i=a[s];z.lineTo(i[0],i[1])}z.stroke()}"ghost"!==O().handleLineType&&(b=!1)}};function A(e,n,o){var a=n||d.nodes(".edgehandles-source"),r=o||d.nodes(".edgehandles-target"),s=e?"edgehandles-preview":"",i=d.collection();if(n||o||e||!O().preview||d.$(".edgehandles-ghost").remove(),0!==a.size()&&0!==r.size()){if(!n&&!o){if(!e&&O().preview)return i=d.elements(".edgehandles-preview").removeClass("edgehandles-preview"),O().complete(a,r,i),void a.trigger("cyedgehandles.complete");d.elements(".edgehandles-preview").remove()}for(var l=0;l<r.length;l++){var g=r[l];switch(O().edgeType(a,g)){case"node":var h,c=a.position(),u=g.position();h=a.id()===g.id()?{x:c.x+O().nodeLoopOffset,y:c.y+O().nodeLoopOffset}:{x:(c.x+u.x)/2,y:(c.y+u.y)/2};var f=d.add(t.extend(!0,{group:"nodes",position:h},O().nodeParams(a,g))).addClass(s),p=d.add(t.extend(!0,{group:"edges",data:{source:a.id(),target:f.id()}},O().edgeParams(a,g,0))).addClass(s),v=d.add(t.extend(!0,{group:"edges",data:{source:f.id(),target:g.id()}},O().edgeParams(a,g,1))).addClass(s);i=i.add(f).add(p).add(v);break;case"flat":var y=d.add(t.extend(!0,{group:"edges",data:{source:a.id(),target:g.id()}},O().edgeParams(a,g,0))).addClass(s);i=i.add(y);break;default:g.removeClass("edgehandles-target")}}e||(O().complete(a,r,i),a.trigger("cyedgehandles.complete"))}}function H(e){var t=e;clearTimeout(l),l=setTimeout(function(){var n=d.nodes(".edgehandles-source"),o=e.hasClass("edgehandles-source"),a=O().loopAllowed(e),r=e.hasClass("edgehandles-ghost-node"),s=null==O().edgeType(n,e);r||s||(!o||o&&a)&&(e.addClass("edgehandles-hover"),e.toggleClass("edgehandles-target"),O().preview&&(e.hasClass("edgehandles-target")?function(e,t){A(!0),t.trigger("cyedgehandles.addpreview")}(0,t):N(n,t)))},O().hoverDelay)}function j(e){var t=e;if(e.removeClass("edgehandles-hover"),clearTimeout(l),O().toggleOffOnLeave){var n=h;e.removeClass("edgehandles-target"),N(n,t)}}f.cytoscape(function(n){var o,a,l,g,c,u,p,b,x,E,z,N,D,$,R,q;L=(d=this).panningEnabled(),C=d.zoomingEnabled(),T=d.boxSelectionEnabled(),d.bind("zoom pan",a=function(){X()}),d.on("mouseover tap","node",g=function(n){var a=this;if(!(S()||w||v||y||this.hasClass("edgehandles-preview")||m||this.hasClass("edgehandles-ghost-node")||0===a.filter(O().handleNodes).length)){l&&(f[0].removeEventListener("mousedown",l,!0),f[0].removeEventListener("touchstart",l,!0));var g=a.renderedPosition(),c=a.renderedOuterHeight();o=a.id(),X(),i=O().handleSize/2*d.zoom(),r=g.x,s=g.y-c/2,W(r,s,i),a.trigger("cyedgehandles.showhandle"),f[0].addEventListener("mousedown",u,!0),f[0].addEventListener("touchstart",u,!0),l=u}function u(n){f[0].removeEventListener("mousedown",u,!0),f[0].removeEventListener("touchstart",u,!0);var o=n.touches?n.touches[0].pageX:n.pageX,d=n.touches?n.touches[0].pageY:n.pageY,l=o-f.offset().left,g=d-f.offset().top,c=e.is.touch()?i*O().handleTouchTargetMult:i;if((0===n.button||n.touches)&&!(Math.abs(l-r)>c||Math.abs(g-s)>c||m))return v=!0,n.preventDefault(),n.stopPropagation(),h=a,a.addClass("edgehandles-source"),a.trigger("cyedgehandles.start"),t(window).one("mouseup touchend touchcancel blur",function(e){v&&!m&&(t(this),v=!1,t(window).unbind("mousemove touchmove",p),A(),k(),O().stop(a),a.trigger("cyedgehandles.stop"))}).bind("mousemove touchmove",p),Y(),O().start(a),!1}function p(e){var t=e.originalEvent.touches?e.originalEvent.touches[0].pageX:e.pageX,n=e.originalEvent.touches?e.originalEvent.touches[0].pageY:e.pageY,o=t-f.offset().left,d=n-f.offset().top;return"ghost"!==O().handleLineType&&(X(),W(r,s,i)),M(r,s,o,d),!1}}).on("mouseover tapdragover","node",c=function(){if(!(S()||w||this.hasClass("edgehandles-preview")))return v?(H(this),!1):void 0}).on("mouseout tapdragout","node",u=function(){w||v&&j(this)}).on("drag position","node",b=function(){if(!w){this.hasClass("edgehandles-ghost")||setTimeout(X,50)}}).on("grab","node",function(){X()}).on("drag","node",function(){y=!0}).on("free","node",p=function(){y=!1}).on("cyedgehandles.forcestart","node",x=function(){var e=this;if(0!==e.filter(O().handleNodes).length){m=!0,X();var n=h=e;o=e.id(),e.trigger("cyedgehandles.start"),e.addClass("edgehandles-source");var a=e.renderedPosition(),r=e.renderedOuterHeight(),s=e.renderedOuterWidth(),i=O().handleSize/2*d.zoom(),l=a.x,g=a.y-r/2;W(l,g,i),e.trigger("cyedgehandles.showhandle");var c,u=function(n){f[0].removeEventListener("mousedown",u,!0),f[0].removeEventListener("touchstart",u,!0);var o=(void 0!==n.pageX?n.pageX:n.originalEvent.touches[0].pageX)-f.offset().left,h=(void 0!==n.pageY?n.pageY:n.originalEvent.touches[0].pageY)-f.offset().top,p=i/2;if(a.x-s/2-p<=o&&o<=a.x+s/2+p&&a.y-r/2-p<=h&&h<=a.y+r/2+p){Y(),v=!0;var y=function(e){var t=(void 0!==e.pageX?e.pageX:e.originalEvent.touches[0].pageX)-f.offset().left,n=(void 0!==e.pageY?e.pageY:e.originalEvent.touches[0].pageY)-f.offset().top;"ghost"!==O().handleLineType&&(X(),W(l,g,i)),M(l,g,t,n)};return f[0].addEventListener("mousemove",y,!0),f[0].addEventListener("touchmove",y,!0),t(window).one("mouseup touchend blur",function(){f[0].removeEventListener("mousemove",y,!0),f[0].removeEventListener("touchmove",y,!0),m=!1,v=!1,A(),O().stop(e),e.trigger("cyedgehandles.stop"),d.off("tap","node",c),e.off("remove",void 0),k()}),n.stopPropagation(),n.preventDefault(),!1}};f[0].addEventListener("mousedown",u,!0),f[0].addEventListener("touchstart",u,!0),e.one("remove",function(){f[0].removeEventListener("mousedown",u,!0),f[0].removeEventListener("touchstart",u,!0),d.off("tap","node",c)}),d.one("tap","node",c=function(){var t=n.id()===this.id(),o=O().loopAllowed(this);(!t||t&&o)&&A(!1,n,this),m=!1,O().stop(e),e.trigger("cyedgehandles.stop"),f[0].removeEventListener("mousedown",u,!0),f[0].removeEventListener("touchstart",u,!0),e.off("remove",void 0),k()})}}).on("remove","node",E=function(){this.id()===o&&setTimeout(function(){k()},5)}).on("cxttapstart tapstart","node",z=function(e){if(0!==(a=this).filter(O().handleNodes).length){var t=O().cxt&&"cxttapstart"===e.type,n=w&&"tapstart"===e.type;if(t||n){X();var a;a=h=this;o=a.id(),a.trigger("cyedgehandles.start"),a.addClass("edgehandles-source");var l=a.renderedPosition(),g=a.renderedOuterHeight();a.renderedOuterWidth();i=O().handleSize/2*d.zoom(),r=l.x,s=l.y-g/2-i/2,W(r,s,i),a.trigger("cyedgehandles.showhandle"),O().start(a),a.trigger("cyedgehandles.start")}}}).on("cxtdrag tapdrag",D=function(e){var t=O().cxt&&"cxtdrag"===e.type,n=w&&"tapdrag"===e.type;if((t||n)&&h){var o=e.cyRenderedPosition;M(r,s,o.x,o.y)}}).on("cxtdragover tapdragover","node",$=function(e){var t=O().cxt&&"cxtdragover"===e.type,n=w&&"tapdragover"===e.type;if((t||n)&&h){H(this)}}).on("cxtdragout tapdragout","node",R=function(e){var t=O().cxt&&"cxtdragout"===e.type,n=w&&"tapdragout"===e.type;if((t||n)&&h){j(this)}}).on("cxttapend tapend",q=function(e){var t=O().cxt&&"cxttapend"===e.type,n=w&&"tapend"===e.type;(t||n)&&(A(),k(),(h=null)&&(O().stop(h),node.trigger("cyedgehandles.stop"),O().complete(h)))}).on("tap","node",N=function(){}),P.unbind=function(){d.off("mouseover","node",g).off("mouseover","node",c).off("mouseout","node",u).off("drag position","node",b).off("grab","node",void 0).off("free","node",p).off("cyedgehandles.forcestart","node",x).off("remove","node",E).off("cxttapstart","node",z).off("cxttapend",q).off("cxtdrag",D).off("cxtdragover","node",$).off("cxtdragout","node",R).off("tap","node",N),d.unbind("zoom pan",a)}}),f.data("cyedgehandles",P)},start:function(e){t(this).cytoscape(function(t){this.$("#"+e).trigger("cyedgehandles.forcestart")})}};return a[d]?a[d].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof d&&d?(t.error("No such function `"+d+"` for jquery.cytoscapeEdgeHandles"),t(this)):a.init.apply(this,arguments)},t.fn.cyEdgehandles=t.fn.cytoscapeEdgehandles,e("core","edgehandles",function(e){return t(this.container()).cytoscapeEdgehandles(e)})}};"undefined"!=typeof module&&module.exports&&(module.exports=n),"undefined"!=typeof define&&define.amd&&define("cytoscape-edgehandles",function(){return n}),t&&e&&n(e,t)}(cytoscape,jQuery);
},{}],4:[function(require,module,exports) {
var e=require("backbone"),t=require("cytoscape"),s=jQuery=require("jquery"),i=require("../models/link"),n=require("./annoview"),r=require("cytoscape-edgehandles")(t,s),a=require("../utils/style"),c=e.View.extend({initialize:function(e){this.el=e.el,this.struct=e.struct,this.resindex=e.resindex,this.annotate=!0,this.listenTo(this.struct,"change:renderSwitch",this.render)},render:function(){var e=this;e.innerHTML="",this.cy=t({container:e.el,style:(new a).getCytoscapeStyle(),elements:e.struct.toCytoscape(),layout:{name:"preset"},ready:function(){this.edges("[label='violation']").each(function(e,t){0===Object.keys(t._private.classes).length&&t.addClass("wcwccis")}),this.on("tapstart",function(e){this.$(".chosen").removeClass("chosen")}),this.on("tapdragover","node",function(e){var t=document.getElementById("seqbox");t&&this.id()<t.value.length&&(t.selectionStart=parseInt(this.id()),t.selectionEnd=parseInt(this.id())+1)}),this.on("tapdragout","node",function(e){var t=document.getElementById("seqbox");t&&this.id()<t.value.length&&(t.selectionEnd=-1)}),this.on("tap","edge",function(t){if(e.annotate&&"violation"===this.data("label")){var s=this._private.classes;for(var i in s)break;new n(i.substring(0,2),i.substring(2,4),i.substring(4,i.length+1),this,e.el)}}),e.resindex&&e.setResidueNodes(this)},userPanningEnabled:!0,userZoomingEnabled:!0}),this.cy.edgehandles({loopAllowed:function(e){return!1},complete:function(t,s,i){e.struct.get("links").newBond(t[0].id(),s[0].id())},enabled:!1,preview:!1}),this.trigger("rendered")},setResidueNodes:function(e){for(var t=1;t<this.struct.get("seq").length/5;t++){var s=this.getPos(this.struct,5*t-1);this.cy.add({group:"nodes",data:{id:(this.struct.get("seq").length+t).toString(),label:5*t+"",type:"index"},position:{x:s[0],y:s[1]},selected:!1,selectable:!1,locked:!1,grabbable:!0,css:{"background-color":"#fff"}}),e.add({group:"edges",data:{id:"index"+t,source:5*t-1,target:this.struct.get("seq").length+t,label:5*t,weight:4},css:{"line-color":"black",width:4}})}},getPos:function(e,t){for(var s,i,n,r,a,c=!1,o=e.get("residues").at(t).get("x"),d=e.get("residues").at(t).get("y"),l=0;!c&&l<1;){s=l*Math.PI*2,i=50*Math.cos(s)+o,n=50*Math.sin(s)+d;for(var h=0;h<e.get("seq").length+1;h++){if(h===e.get("seq").length){c=!0;break}if(r=e.get("residues").at(h).get("x"),a=e.get("residues").at(h).get("y"),Math.pow(i-r,2)+Math.pow(n-a,2)<Math.pow(50,2))break}l+=.05}return[i,n]},changeBondType:function(e,t){if("canonical"===t)this.cy.$("#"+e)[0].style("line-color","#3A9AD9"),this.cy.$("#"+e)[0].style("width",4),this.cy.$("#"+e)[0]._private.classes={};else{if("non-canonical"!==t)throw new Error("Type must be 'canoncial' or 'non-canonical'");this.cy.$("#"+e)[0].style("line-color","red"),this.cy.$("#"+e)[0].style("width",4),this.cy.$("#"+e)[0].addClass("wcwccis")}},addNCBond:function(e,t){this.cy.add({group:"edges",data:{id:e+"to"+t,source:e.toString(),target:t.toString()},css:{"line-color":"red",width:4}}),this.cy.$("#"+e+"to"+t)[0].addClass("wcwccis")},setLeontisWesthof:function(e,t){var s=["wcwccis","wcwctrans","sgsgcis","sgsgtrans","hghgcis","hghgtrans","wcsgcis","wcsgtrans","sgwccis","sgwctrans","wchgcis","wchgtrans","hgwccis","hgwctrans","hgsgcis","hgsgtrans","sghgcis","sghgtrans"];if(-1===s.indexOf(t))throw new Error("LW-Class must be one of "+s);for(var i=Object.keys(this.cy.$("#"+e)[0]._private.classes),n=0;n<i.length;n++)this.cy.$("#"+e)[0].removeClass(i[n]);this.cy.$("#"+e)[0].addClass(t)}});module.exports=c;
},{"backbone":5,"cytoscape":20,"jquery":6,"../models/link":11,"./annoview":18,"cytoscape-edgehandles":19,"../utils/style":12}],2:[function(require,module,exports) {
var e=require("backbone"),i=require("./models/structure"),r=require("./views/vispanel"),t=e.View.extend({initialize:function(e){this.struct=new i(e.seq,e.dotbr,"naview"),this.vis=new r({el:e.el,struct:this.struct,resindex:e.resindex})},render:function(){this.vis.render()}});module.exports=t;
},{"backbone":5,"./models/structure":3,"./views/vispanel":4}],1:[function(require,module,exports) {
"use strict";var e=require("./drawrnajs/drawrna"),t=r(e);function r(e){return e&&e.__esModule?e:{default:e}}_.extend(window.bundleEntries||{},{load:function(e){var r=e.chart,n=e.dataset;$.ajax({url:n.download_url,success:function(n){var a=n.split("\n");new t.default({el:document.getElementById(e.targets[0]),seq:a[1],dotbr:a[2],resindex:!1}).render(),r.state("ok","Done."),e.process.resolve()},error:function(){r.state("failed","Could not access dataset content of '"+n.name+"'."),e.process.resolve()}})}});
},{"./drawrnajs/drawrna":2}]},{},[1])