diff --git a/README.md b/README.md index d979a2c..373ce9a 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Postal.js -## Version 0.8.2 (Dual Licensed [MIT](http://www.opensource.org/licenses/mit-license) & [GPL](http://www.opensource.org/licenses/gpl-license)) +## Version 0.8.3 (Dual Licensed [MIT](http://www.opensource.org/licenses/mit-license) & [GPL](http://www.opensource.org/licenses/gpl-license)) ## What is it? Postal.js is an in-memory message bus - very loosely inspired by [AMQP](http://www.amqp.org/) - written in JavaScript. Postal.js runs in the browser, or on the server-side using Node.js. It takes the familiar "eventing-style" paradigm (of which most JavaScript developers are familiar) and extends it by providing "broker" and subscriber implementations which are more sophisticated than what you typically find in simple event delegation. diff --git a/build.json b/build.json index 9bd38f0..30e715c 100644 --- a/build.json +++ b/build.json @@ -1,14 +1,13 @@ { "anvil.uglify" : { "all" :true }, - "anvil.http": { - "paths": { - "/": "./" - } + "httpPaths": { + "/": "./" }, "output": { "full": "lib", "partial": { - "**/lib/postal.*" : [ "example/standard/js", "example/amd/js/libs/postal" ] + "/lib/postal.js" : [ "/example/standard/js", "/example/amd/js/libs/postal" ], + "/lib/postal.min.js" : [ "/example/standard/js", "/example/amd/js/libs/postal" ] } }, "dependencies": [ "anvil.uglify" ] diff --git a/component.json b/component.json old mode 100644 new mode 100755 index 78cfb3a..de498d0 --- a/component.json +++ b/component.json @@ -1,6 +1,6 @@ { "name": "postal.js", - "version": "0.8.2", + "version": "0.8.3", "main": ["lib/postal.min.js", "lib/postal.js"], "dependencies": { "underscore": "~1.3.0" diff --git a/example/amd/js/libs/postal/postal.js b/example/amd/js/libs/postal/postal.js old mode 100644 new mode 100755 index 99c82dc..fa7eaf1 --- a/example/amd/js/libs/postal/postal.js +++ b/example/amd/js/libs/postal/postal.js @@ -2,7 +2,7 @@ postal Author: Jim Cowart (http://freshbrewedcode.com/jimcowart) License: Dual licensed MIT (http://www.opensource.org/licenses/mit-license) & GPL (http://www.opensource.org/licenses/gpl-license) - Version 0.8.0 + Version 0.8.3 */ (function ( root, factory ) { if ( typeof module === "object" && module.exports ) { @@ -69,7 +69,7 @@ ChannelDefinition.prototype.publish = function () { var envelope = arguments.length === 1 ? (Object.prototype.toString.call(arguments[0]) === '[object String]' ? - arguments[0] : { topic: arguments[0] }) : { topic : arguments[0], data : arguments[1] }; + { topic: arguments[0] } : arguments[0]) : { topic : arguments[0], data : arguments[1] }; envelope.channel = this.channel; return postal.configuration.bus.publish( envelope ); }; @@ -203,32 +203,51 @@ } }; var bindingsResolver = { - cache : { }, + cache : {}, + regex : {}, compare : function ( binding, topic ) { - if ( this.cache[topic] && this.cache[topic][binding] ) { - return true; + var pattern, rgx, prev, result = (this.cache[topic] && this.cache[topic][binding]); + if(typeof result !== "undefined") { + return result; } - var pattern = ("^" + binding.replace( /\./g, "\\." ) // escape actual periods - .replace( /\*/g, "[A-Z,a-z,0-9]*" ) // asterisks match any alpha-numeric 'word' - .replace( /#/g, ".*" ) + "$") // hash matches 'n' # of words (+ optional on start/end of topic) - .replace( "\\..*$", "(\\..*)*$" ) // fix end of topic matching on hash wildcards - .replace( "^.*\\.", "^(.*\\.)*" ); // fix beginning of topic matching on hash wildcards - var rgx = new RegExp( pattern ); - var result = rgx.test( topic ); - if ( result ) { - if ( !this.cache[topic] ) { - this.cache[topic] = {}; - } - this.cache[topic][binding] = true; + if(!(rgx = this.regex[binding])) { + pattern = "^" + _.map(binding.split('.'), function(segment) { + var res = !!prev && prev !== "#" ? "\\.\\b" : "\\b"; + if(segment === "#") { + res += "[A-Z,a-z,0-9,\\.]*" + } else if (segment === "*") { + res += "[A-Z,a-z,0-9]+" + } else { + res += segment; + } + prev = segment; + return res; + } ).join('') + "$"; + rgx = this.regex[binding] = new RegExp( pattern ); } + this.cache[topic] = this.cache[topic] || {}; + this.cache[topic][binding] = result = rgx.test( topic ); return result; }, reset : function () { this.cache = {}; + this.regex = {}; } }; + var fireSub = function(subDef, envelope) { + if ( postal.configuration.resolver.compare( subDef.topic, envelope.topic ) ) { + if ( _.all( subDef.constraints, function ( constraint ) { + return constraint.call( subDef.context, envelope.data, envelope ); + } ) ) { + if ( typeof subDef.callback === 'function' ) { + subDef.callback.call( subDef.context, envelope.data, envelope ); + } + } + } + }; + var localBus = { addWireTap : function ( callback ) { var self = this; @@ -247,20 +266,14 @@ tap( envelope.data, envelope ); } ); if ( this.subscriptions[envelope.channel] ) { - _.each( this.subscriptions[envelope.channel], function ( topic ) { - // TODO: research faster ways to handle this than _.clone - _.each( _.clone( topic ), function ( subDef ) { - if ( postal.configuration.resolver.compare( subDef.topic, envelope.topic ) ) { - if ( _.all( subDef.constraints, function ( constraint ) { - return constraint.call( subDef.context, envelope.data, envelope ); - } ) ) { - if ( typeof subDef.callback === 'function' ) { - subDef.callback.call( subDef.context, envelope.data, envelope ); - } - } - } - } ); - } ); + _.each( this.subscriptions[envelope.channel], function ( subscribers ) { + var idx = 0, len = subscribers.length, subDef; + while(idx < len) { + if( subDef = subscribers[idx++] ){ + fireSub(subDef, envelope); + } + } + } ); } return envelope; }, diff --git a/example/amd/js/libs/postal/postal.min.js b/example/amd/js/libs/postal/postal.min.js new file mode 100755 index 0000000..747ced6 --- /dev/null +++ b/example/amd/js/libs/postal/postal.min.js @@ -0,0 +1,7 @@ +/* + postal + Author: Jim Cowart (http://freshbrewedcode.com/jimcowart) + License: Dual licensed MIT (http://www.opensource.org/licenses/mit-license) & GPL (http://www.opensource.org/licenses/gpl-license) + Version 0.8.3 + */ +(function(t,n){"object"==typeof module&&module.exports?module.exports=function(t){return t=t||require("underscore"),n(t)}:"function"==typeof define&&define.amd?define(["underscore"],function(i){return n(i,t)}):t.postal=n(t._,t)})(this,function(t){var n="/",i="postal",s=function(){var n;return function(i){var s=!1;return t.isString(i)?(s=i===n,n=i):(s=t.isEqual(i,n),n=t.clone(i)),!s}},c=function(){var n=[];return function(i){var s=!t.any(n,function(n){return t.isObject(i)||t.isArray(i)?t.isEqual(i,n):i===n});return s&&n.push(i),s}},e=function(t){this.channel=t||n};e.prototype.subscribe=function(){return 1===arguments.length?new r(this.channel,arguments[0].topic,arguments[0].callback):new r(this.channel,arguments[0],arguments[1])},e.prototype.publish=function(){var t=1===arguments.length?"[object String]"===Object.prototype.toString.call(arguments[0])?{topic:arguments[0]}:arguments[0]:{topic:arguments[0],data:arguments[1]};return t.channel=this.channel,h.configuration.bus.publish(t)};var r=function(t,n,s){this.channel=t,this.topic=n,this.callback=s,this.constraints=[],this.context=null,h.configuration.bus.publish({channel:i,topic:"subscription.created",data:{event:"subscription.created",channel:t,topic:n}}),h.configuration.bus.subscribe(this)};r.prototype={unsubscribe:function(){h.configuration.bus.unsubscribe(this),h.configuration.bus.publish({channel:i,topic:"subscription.removed",data:{event:"subscription.removed",channel:this.channel,topic:this.topic}})},defer:function(){var t=this.callback;return this.callback=function(n){setTimeout(t,0,n)},this},disposeAfter:function(n){if(t.isNaN(n)||0>=n)throw"The value provided to disposeAfter (maxCalls) must be a number greater than zero.";var i=this.callback,s=t.after(n,t.bind(function(){this.unsubscribe()},this));return this.callback=function(){i.apply(this.context,arguments),s()},this},distinctUntilChanged:function(){return this.withConstraint(new s),this},distinct:function(){return this.withConstraint(new c),this},once:function(){this.disposeAfter(1)},withConstraint:function(n){if(!t.isFunction(n))throw"Predicate constraint must be a function";return this.constraints.push(n),this},withConstraints:function(n){var i=this;return t.isArray(n)&&t.each(n,function(t){i.withConstraint(t)}),i},withContext:function(t){return this.context=t,this},withDebounce:function(n){if(t.isNaN(n))throw"Milliseconds must be a number";var i=this.callback;return this.callback=t.debounce(i,n),this},withDelay:function(n){if(t.isNaN(n))throw"Milliseconds must be a number";var i=this.callback;return this.callback=function(t){setTimeout(function(){i(t)},n)},this},withThrottle:function(n){if(t.isNaN(n))throw"Milliseconds must be a number";var i=this.callback;return this.callback=t.throttle(i,n),this},subscribe:function(t){return this.callback=t,this}};var o={cache:{},regex:{},compare:function(n,i){var s,c,e,r=this.cache[i]&&this.cache[i][n];return r!==undefined?r:((c=this.regex[n])||(s="^"+t.map(n.split("."),function(t){var n=e&&"#"!==e?"\\.\\b":"\\b";return n+="#"===t?"[A-Z,a-z,0-9,\\.]*":"*"===t?"[A-Z,a-z,0-9]+":t,e=t,n}).join("")+"$",c=this.regex[n]=RegExp(s)),this.cache[i]=this.cache[i]||{},this.cache[i][n]=r=c.test(i),r)},reset:function(){this.cache={},this.regex={}}},u=function(n,i){h.configuration.resolver.compare(n.topic,i.topic)&&t.all(n.constraints,function(t){return t.call(n.context,i.data,i)})&&"function"==typeof n.callback&&n.callback.call(n.context,i.data,i)},a={addWireTap:function(t){var n=this;return n.wireTaps.push(t),function(){var i=n.wireTaps.indexOf(t);-1!==i&&n.wireTaps.splice(i,1)}},publish:function(n){return n.timeStamp=new Date,t.each(this.wireTaps,function(t){t(n.data,n)}),this.subscriptions[n.channel]&&t.each(this.subscriptions[n.channel],function(t){for(var i,s=0,c=t.length;c>s;)(i=t[s++])&&u(i,n)}),n},reset:function(){this.subscriptions&&(t.each(this.subscriptions,function(n){t.each(n,function(t){for(;t.length;)t.pop().unsubscribe()})}),this.subscriptions={})},subscribe:function(t){var n,i=this.subscriptions[t.channel];return i||(i=this.subscriptions[t.channel]={}),n=this.subscriptions[t.channel][t.topic],n||(n=this.subscriptions[t.channel][t.topic]=[]),n.push(t),t},subscriptions:{},wireTaps:[],unsubscribe:function(t){if(this.subscriptions[t.channel][t.topic])for(var n=this.subscriptions[t.channel][t.topic].length,i=0;n>i;i++)if(this.subscriptions[t.channel][t.topic][i]===t){this.subscriptions[t.channel][t.topic].splice(i,1);break}}};a.subscriptions[i]={};var h={configuration:{bus:a,resolver:o,DEFAULT_CHANNEL:n,SYSTEM_CHANNEL:i},ChannelDefinition:e,SubscriptionDefinition:r,channel:function(t){return new e(t)},subscribe:function(t){return new r(t.channel||n,t.topic,t.callback)},publish:function(t){return t.channel=t.channel||n,h.configuration.bus.publish(t)},addWireTap:function(t){return this.configuration.bus.addWireTap(t)},linkChannels:function(i,s){var c=[];return i=t.isArray(i)?i:[i],s=t.isArray(s)?s:[s],t.each(i,function(i){i.topic||"#",t.each(s,function(s){var e=s.channel||n;c.push(h.subscribe({channel:i.channel||n,topic:i.topic||"#",callback:function(n,i){var c=t.clone(i);c.topic=t.isFunction(s.topic)?s.topic(i.topic):s.topic||i.topic,c.channel=e,c.data=n,h.publish(c)}}))})}),c},utils:{getSubscribersFor:function(){var t=arguments[0],n=arguments[1];return 1===arguments.length&&(t=arguments[0].channel||h.configuration.DEFAULT_CHANNEL,n=arguments[0].topic),h.configuration.bus.subscriptions[t]&&h.configuration.bus.subscriptions[t].hasOwnProperty(n)?h.configuration.bus.subscriptions[t][n]:[]},reset:function(){h.configuration.bus.reset(),h.configuration.resolver.reset()}}};return h}); \ No newline at end of file diff --git a/example/standard/js/postal.js b/example/standard/js/postal.js old mode 100644 new mode 100755 index 5091e43..fa7eaf1 --- a/example/standard/js/postal.js +++ b/example/standard/js/postal.js @@ -2,7 +2,7 @@ postal Author: Jim Cowart (http://freshbrewedcode.com/jimcowart) License: Dual licensed MIT (http://www.opensource.org/licenses/mit-license) & GPL (http://www.opensource.org/licenses/gpl-license) - Version 0.8.0 + Version 0.8.3 */ (function ( root, factory ) { if ( typeof module === "object" && module.exports ) { @@ -13,7 +13,7 @@ } } else if ( typeof define === "function" && define.amd ) { // AMD. Register as an anonymous module. - define( ["."], function ( _ ) { + define( ["underscore"], function ( _ ) { return factory( _, root ); } ); } else { @@ -69,7 +69,7 @@ ChannelDefinition.prototype.publish = function () { var envelope = arguments.length === 1 ? (Object.prototype.toString.call(arguments[0]) === '[object String]' ? - arguments[0] : { topic: arguments[0] }) : { topic : arguments[0], data : arguments[1] }; + { topic: arguments[0] } : arguments[0]) : { topic : arguments[0], data : arguments[1] }; envelope.channel = this.channel; return postal.configuration.bus.publish( envelope ); }; @@ -203,32 +203,51 @@ } }; var bindingsResolver = { - cache : { }, + cache : {}, + regex : {}, compare : function ( binding, topic ) { - if ( this.cache[topic] && this.cache[topic][binding] ) { - return true; + var pattern, rgx, prev, result = (this.cache[topic] && this.cache[topic][binding]); + if(typeof result !== "undefined") { + return result; } - var pattern = ("^" + binding.replace( /\./g, "\\." ) // escape actual periods - .replace( /\*/g, "[A-Z,a-z,0-9]*" ) // asterisks match any alpha-numeric 'word' - .replace( /#/g, ".*" ) + "$") // hash matches 'n' # of words (+ optional on start/end of topic) - .replace( "\\..*$", "(\\..*)*$" ) // fix end of topic matching on hash wildcards - .replace( "^.*\\.", "^(.*\\.)*" ); // fix beginning of topic matching on hash wildcards - var rgx = new RegExp( pattern ); - var result = rgx.test( topic ); - if ( result ) { - if ( !this.cache[topic] ) { - this.cache[topic] = {}; - } - this.cache[topic][binding] = true; + if(!(rgx = this.regex[binding])) { + pattern = "^" + _.map(binding.split('.'), function(segment) { + var res = !!prev && prev !== "#" ? "\\.\\b" : "\\b"; + if(segment === "#") { + res += "[A-Z,a-z,0-9,\\.]*" + } else if (segment === "*") { + res += "[A-Z,a-z,0-9]+" + } else { + res += segment; + } + prev = segment; + return res; + } ).join('') + "$"; + rgx = this.regex[binding] = new RegExp( pattern ); } + this.cache[topic] = this.cache[topic] || {}; + this.cache[topic][binding] = result = rgx.test( topic ); return result; }, reset : function () { this.cache = {}; + this.regex = {}; } }; + var fireSub = function(subDef, envelope) { + if ( postal.configuration.resolver.compare( subDef.topic, envelope.topic ) ) { + if ( _.all( subDef.constraints, function ( constraint ) { + return constraint.call( subDef.context, envelope.data, envelope ); + } ) ) { + if ( typeof subDef.callback === 'function' ) { + subDef.callback.call( subDef.context, envelope.data, envelope ); + } + } + } + }; + var localBus = { addWireTap : function ( callback ) { var self = this; @@ -247,20 +266,14 @@ tap( envelope.data, envelope ); } ); if ( this.subscriptions[envelope.channel] ) { - _.each( this.subscriptions[envelope.channel], function ( topic ) { - // TODO: research faster ways to handle this than _.clone - _.each( _.clone( topic ), function ( subDef ) { - if ( postal.configuration.resolver.compare( subDef.topic, envelope.topic ) ) { - if ( _.all( subDef.constraints, function ( constraint ) { - return constraint.call( subDef.context, envelope.data, envelope ); - } ) ) { - if ( typeof subDef.callback === 'function' ) { - subDef.callback.call( subDef.context, envelope.data, envelope ); - } - } - } - } ); - } ); + _.each( this.subscriptions[envelope.channel], function ( subscribers ) { + var idx = 0, len = subscribers.length, subDef; + while(idx < len) { + if( subDef = subscribers[idx++] ){ + fireSub(subDef, envelope); + } + } + } ); } return envelope; }, diff --git a/example/standard/js/postal.min.js b/example/standard/js/postal.min.js new file mode 100755 index 0000000..747ced6 --- /dev/null +++ b/example/standard/js/postal.min.js @@ -0,0 +1,7 @@ +/* + postal + Author: Jim Cowart (http://freshbrewedcode.com/jimcowart) + License: Dual licensed MIT (http://www.opensource.org/licenses/mit-license) & GPL (http://www.opensource.org/licenses/gpl-license) + Version 0.8.3 + */ +(function(t,n){"object"==typeof module&&module.exports?module.exports=function(t){return t=t||require("underscore"),n(t)}:"function"==typeof define&&define.amd?define(["underscore"],function(i){return n(i,t)}):t.postal=n(t._,t)})(this,function(t){var n="/",i="postal",s=function(){var n;return function(i){var s=!1;return t.isString(i)?(s=i===n,n=i):(s=t.isEqual(i,n),n=t.clone(i)),!s}},c=function(){var n=[];return function(i){var s=!t.any(n,function(n){return t.isObject(i)||t.isArray(i)?t.isEqual(i,n):i===n});return s&&n.push(i),s}},e=function(t){this.channel=t||n};e.prototype.subscribe=function(){return 1===arguments.length?new r(this.channel,arguments[0].topic,arguments[0].callback):new r(this.channel,arguments[0],arguments[1])},e.prototype.publish=function(){var t=1===arguments.length?"[object String]"===Object.prototype.toString.call(arguments[0])?{topic:arguments[0]}:arguments[0]:{topic:arguments[0],data:arguments[1]};return t.channel=this.channel,h.configuration.bus.publish(t)};var r=function(t,n,s){this.channel=t,this.topic=n,this.callback=s,this.constraints=[],this.context=null,h.configuration.bus.publish({channel:i,topic:"subscription.created",data:{event:"subscription.created",channel:t,topic:n}}),h.configuration.bus.subscribe(this)};r.prototype={unsubscribe:function(){h.configuration.bus.unsubscribe(this),h.configuration.bus.publish({channel:i,topic:"subscription.removed",data:{event:"subscription.removed",channel:this.channel,topic:this.topic}})},defer:function(){var t=this.callback;return this.callback=function(n){setTimeout(t,0,n)},this},disposeAfter:function(n){if(t.isNaN(n)||0>=n)throw"The value provided to disposeAfter (maxCalls) must be a number greater than zero.";var i=this.callback,s=t.after(n,t.bind(function(){this.unsubscribe()},this));return this.callback=function(){i.apply(this.context,arguments),s()},this},distinctUntilChanged:function(){return this.withConstraint(new s),this},distinct:function(){return this.withConstraint(new c),this},once:function(){this.disposeAfter(1)},withConstraint:function(n){if(!t.isFunction(n))throw"Predicate constraint must be a function";return this.constraints.push(n),this},withConstraints:function(n){var i=this;return t.isArray(n)&&t.each(n,function(t){i.withConstraint(t)}),i},withContext:function(t){return this.context=t,this},withDebounce:function(n){if(t.isNaN(n))throw"Milliseconds must be a number";var i=this.callback;return this.callback=t.debounce(i,n),this},withDelay:function(n){if(t.isNaN(n))throw"Milliseconds must be a number";var i=this.callback;return this.callback=function(t){setTimeout(function(){i(t)},n)},this},withThrottle:function(n){if(t.isNaN(n))throw"Milliseconds must be a number";var i=this.callback;return this.callback=t.throttle(i,n),this},subscribe:function(t){return this.callback=t,this}};var o={cache:{},regex:{},compare:function(n,i){var s,c,e,r=this.cache[i]&&this.cache[i][n];return r!==undefined?r:((c=this.regex[n])||(s="^"+t.map(n.split("."),function(t){var n=e&&"#"!==e?"\\.\\b":"\\b";return n+="#"===t?"[A-Z,a-z,0-9,\\.]*":"*"===t?"[A-Z,a-z,0-9]+":t,e=t,n}).join("")+"$",c=this.regex[n]=RegExp(s)),this.cache[i]=this.cache[i]||{},this.cache[i][n]=r=c.test(i),r)},reset:function(){this.cache={},this.regex={}}},u=function(n,i){h.configuration.resolver.compare(n.topic,i.topic)&&t.all(n.constraints,function(t){return t.call(n.context,i.data,i)})&&"function"==typeof n.callback&&n.callback.call(n.context,i.data,i)},a={addWireTap:function(t){var n=this;return n.wireTaps.push(t),function(){var i=n.wireTaps.indexOf(t);-1!==i&&n.wireTaps.splice(i,1)}},publish:function(n){return n.timeStamp=new Date,t.each(this.wireTaps,function(t){t(n.data,n)}),this.subscriptions[n.channel]&&t.each(this.subscriptions[n.channel],function(t){for(var i,s=0,c=t.length;c>s;)(i=t[s++])&&u(i,n)}),n},reset:function(){this.subscriptions&&(t.each(this.subscriptions,function(n){t.each(n,function(t){for(;t.length;)t.pop().unsubscribe()})}),this.subscriptions={})},subscribe:function(t){var n,i=this.subscriptions[t.channel];return i||(i=this.subscriptions[t.channel]={}),n=this.subscriptions[t.channel][t.topic],n||(n=this.subscriptions[t.channel][t.topic]=[]),n.push(t),t},subscriptions:{},wireTaps:[],unsubscribe:function(t){if(this.subscriptions[t.channel][t.topic])for(var n=this.subscriptions[t.channel][t.topic].length,i=0;n>i;i++)if(this.subscriptions[t.channel][t.topic][i]===t){this.subscriptions[t.channel][t.topic].splice(i,1);break}}};a.subscriptions[i]={};var h={configuration:{bus:a,resolver:o,DEFAULT_CHANNEL:n,SYSTEM_CHANNEL:i},ChannelDefinition:e,SubscriptionDefinition:r,channel:function(t){return new e(t)},subscribe:function(t){return new r(t.channel||n,t.topic,t.callback)},publish:function(t){return t.channel=t.channel||n,h.configuration.bus.publish(t)},addWireTap:function(t){return this.configuration.bus.addWireTap(t)},linkChannels:function(i,s){var c=[];return i=t.isArray(i)?i:[i],s=t.isArray(s)?s:[s],t.each(i,function(i){i.topic||"#",t.each(s,function(s){var e=s.channel||n;c.push(h.subscribe({channel:i.channel||n,topic:i.topic||"#",callback:function(n,i){var c=t.clone(i);c.topic=t.isFunction(s.topic)?s.topic(i.topic):s.topic||i.topic,c.channel=e,c.data=n,h.publish(c)}}))})}),c},utils:{getSubscribersFor:function(){var t=arguments[0],n=arguments[1];return 1===arguments.length&&(t=arguments[0].channel||h.configuration.DEFAULT_CHANNEL,n=arguments[0].topic),h.configuration.bus.subscriptions[t]&&h.configuration.bus.subscriptions[t].hasOwnProperty(n)?h.configuration.bus.subscriptions[t][n]:[]},reset:function(){h.configuration.bus.reset(),h.configuration.resolver.reset()}}};return h}); \ No newline at end of file diff --git a/lib/postal.js b/lib/postal.js old mode 100644 new mode 100755 index e20cad9..fa7eaf1 --- a/lib/postal.js +++ b/lib/postal.js @@ -2,7 +2,7 @@ postal Author: Jim Cowart (http://freshbrewedcode.com/jimcowart) License: Dual licensed MIT (http://www.opensource.org/licenses/mit-license) & GPL (http://www.opensource.org/licenses/gpl-license) - Version 0.8.2 + Version 0.8.3 */ (function ( root, factory ) { if ( typeof module === "object" && module.exports ) { diff --git a/lib/postal.min.js b/lib/postal.min.js old mode 100644 new mode 100755 index cfc3dcc..747ced6 --- a/lib/postal.min.js +++ b/lib/postal.min.js @@ -2,6 +2,6 @@ postal Author: Jim Cowart (http://freshbrewedcode.com/jimcowart) License: Dual licensed MIT (http://www.opensource.org/licenses/mit-license) & GPL (http://www.opensource.org/licenses/gpl-license) - Version 0.8.2 + Version 0.8.3 */ (function(t,n){"object"==typeof module&&module.exports?module.exports=function(t){return t=t||require("underscore"),n(t)}:"function"==typeof define&&define.amd?define(["underscore"],function(i){return n(i,t)}):t.postal=n(t._,t)})(this,function(t){var n="/",i="postal",s=function(){var n;return function(i){var s=!1;return t.isString(i)?(s=i===n,n=i):(s=t.isEqual(i,n),n=t.clone(i)),!s}},c=function(){var n=[];return function(i){var s=!t.any(n,function(n){return t.isObject(i)||t.isArray(i)?t.isEqual(i,n):i===n});return s&&n.push(i),s}},e=function(t){this.channel=t||n};e.prototype.subscribe=function(){return 1===arguments.length?new r(this.channel,arguments[0].topic,arguments[0].callback):new r(this.channel,arguments[0],arguments[1])},e.prototype.publish=function(){var t=1===arguments.length?"[object String]"===Object.prototype.toString.call(arguments[0])?{topic:arguments[0]}:arguments[0]:{topic:arguments[0],data:arguments[1]};return t.channel=this.channel,h.configuration.bus.publish(t)};var r=function(t,n,s){this.channel=t,this.topic=n,this.callback=s,this.constraints=[],this.context=null,h.configuration.bus.publish({channel:i,topic:"subscription.created",data:{event:"subscription.created",channel:t,topic:n}}),h.configuration.bus.subscribe(this)};r.prototype={unsubscribe:function(){h.configuration.bus.unsubscribe(this),h.configuration.bus.publish({channel:i,topic:"subscription.removed",data:{event:"subscription.removed",channel:this.channel,topic:this.topic}})},defer:function(){var t=this.callback;return this.callback=function(n){setTimeout(t,0,n)},this},disposeAfter:function(n){if(t.isNaN(n)||0>=n)throw"The value provided to disposeAfter (maxCalls) must be a number greater than zero.";var i=this.callback,s=t.after(n,t.bind(function(){this.unsubscribe()},this));return this.callback=function(){i.apply(this.context,arguments),s()},this},distinctUntilChanged:function(){return this.withConstraint(new s),this},distinct:function(){return this.withConstraint(new c),this},once:function(){this.disposeAfter(1)},withConstraint:function(n){if(!t.isFunction(n))throw"Predicate constraint must be a function";return this.constraints.push(n),this},withConstraints:function(n){var i=this;return t.isArray(n)&&t.each(n,function(t){i.withConstraint(t)}),i},withContext:function(t){return this.context=t,this},withDebounce:function(n){if(t.isNaN(n))throw"Milliseconds must be a number";var i=this.callback;return this.callback=t.debounce(i,n),this},withDelay:function(n){if(t.isNaN(n))throw"Milliseconds must be a number";var i=this.callback;return this.callback=function(t){setTimeout(function(){i(t)},n)},this},withThrottle:function(n){if(t.isNaN(n))throw"Milliseconds must be a number";var i=this.callback;return this.callback=t.throttle(i,n),this},subscribe:function(t){return this.callback=t,this}};var o={cache:{},regex:{},compare:function(n,i){var s,c,e,r=this.cache[i]&&this.cache[i][n];return r!==undefined?r:((c=this.regex[n])||(s="^"+t.map(n.split("."),function(t){var n=e&&"#"!==e?"\\.\\b":"\\b";return n+="#"===t?"[A-Z,a-z,0-9,\\.]*":"*"===t?"[A-Z,a-z,0-9]+":t,e=t,n}).join("")+"$",c=this.regex[n]=RegExp(s)),this.cache[i]=this.cache[i]||{},this.cache[i][n]=r=c.test(i),r)},reset:function(){this.cache={},this.regex={}}},u=function(n,i){h.configuration.resolver.compare(n.topic,i.topic)&&t.all(n.constraints,function(t){return t.call(n.context,i.data,i)})&&"function"==typeof n.callback&&n.callback.call(n.context,i.data,i)},a={addWireTap:function(t){var n=this;return n.wireTaps.push(t),function(){var i=n.wireTaps.indexOf(t);-1!==i&&n.wireTaps.splice(i,1)}},publish:function(n){return n.timeStamp=new Date,t.each(this.wireTaps,function(t){t(n.data,n)}),this.subscriptions[n.channel]&&t.each(this.subscriptions[n.channel],function(t){for(var i,s=0,c=t.length;c>s;)(i=t[s++])&&u(i,n)}),n},reset:function(){this.subscriptions&&(t.each(this.subscriptions,function(n){t.each(n,function(t){for(;t.length;)t.pop().unsubscribe()})}),this.subscriptions={})},subscribe:function(t){var n,i=this.subscriptions[t.channel];return i||(i=this.subscriptions[t.channel]={}),n=this.subscriptions[t.channel][t.topic],n||(n=this.subscriptions[t.channel][t.topic]=[]),n.push(t),t},subscriptions:{},wireTaps:[],unsubscribe:function(t){if(this.subscriptions[t.channel][t.topic])for(var n=this.subscriptions[t.channel][t.topic].length,i=0;n>i;i++)if(this.subscriptions[t.channel][t.topic][i]===t){this.subscriptions[t.channel][t.topic].splice(i,1);break}}};a.subscriptions[i]={};var h={configuration:{bus:a,resolver:o,DEFAULT_CHANNEL:n,SYSTEM_CHANNEL:i},ChannelDefinition:e,SubscriptionDefinition:r,channel:function(t){return new e(t)},subscribe:function(t){return new r(t.channel||n,t.topic,t.callback)},publish:function(t){return t.channel=t.channel||n,h.configuration.bus.publish(t)},addWireTap:function(t){return this.configuration.bus.addWireTap(t)},linkChannels:function(i,s){var c=[];return i=t.isArray(i)?i:[i],s=t.isArray(s)?s:[s],t.each(i,function(i){i.topic||"#",t.each(s,function(s){var e=s.channel||n;c.push(h.subscribe({channel:i.channel||n,topic:i.topic||"#",callback:function(n,i){var c=t.clone(i);c.topic=t.isFunction(s.topic)?s.topic(i.topic):s.topic||i.topic,c.channel=e,c.data=n,h.publish(c)}}))})}),c},utils:{getSubscribersFor:function(){var t=arguments[0],n=arguments[1];return 1===arguments.length&&(t=arguments[0].channel||h.configuration.DEFAULT_CHANNEL,n=arguments[0].topic),h.configuration.bus.subscriptions[t]&&h.configuration.bus.subscriptions[t].hasOwnProperty(n)?h.configuration.bus.subscriptions[t][n]:[]},reset:function(){h.configuration.bus.reset(),h.configuration.resolver.reset()}}};return h}); \ No newline at end of file diff --git a/lib/report/assets/css/plato-file.css b/lib/report/assets/css/plato-file.css new file mode 100755 index 0000000..ae23d64 --- /dev/null +++ b/lib/report/assets/css/plato-file.css @@ -0,0 +1,80 @@ +.CodeMirror { + height: auto; +} + +.CodeMirror-scroll { + overflow-x: hidden; + overflow-y: hidden; +} +.CodeMirror-lines { + cursor:default; +} + +.plato-mark { + background-color:rgb(212, 250, 236); + border: 1px dashed red; + border-width:1px 0 1px 0; + cursor:pointer; +} + +.plato-mark.focus { + background-color: rgb(235, 250, 166); +} +.plato-mark.active { + background-color: rgb(158, 180, 255); +} + +.plato-mark-start { + border-left-width:1px; + padding-left:1px; +} +.plato-mark-end { + border-right-width:1px; + padding-right:1px; +} +.plato-gutter { +} + +.plato-gutter-icon { + font-size:16px; + cursor:pointer; + color: #800000; + text-align:center; +} + +.plato-gutter-jshint, .plato-gutter-complexity { + width:14px; +} + +.charts { + margin-top:1em; +} + +.charts .header { + font-weight:normal; + text-align:center; +} + +.chart-header { + font-weight:normal; + text-align:center; +} + +.CodeMirror-linewidget { + background-color: hsl(240, 20%, 96%); + font-size:12px; + box-shadow:inset 10px 10px 10px -12px hsl(240, 20%, 17%); + margin-top:10px; + padding-top:5px; + padding-left:5px; + padding-bottom:2px; +} + +.CodeMirror-linewidget ~ .CodeMirror-linewidget{ + box-shadow:inset 10px 0px 10px -12px hsl(240, 20%, 17%); + margin-top:0px; + padding-top:0px; +} + +.plato-line-widget { +} \ No newline at end of file diff --git a/lib/report/assets/css/plato-overview.css b/lib/report/assets/css/plato-overview.css new file mode 100755 index 0000000..b1f8e79 --- /dev/null +++ b/lib/report/assets/css/plato-overview.css @@ -0,0 +1,81 @@ +.chart { + margin: 0 auto; + height:300px; +} + +.chart rect { + cursor:pointer; +} + +.file-list li { + border-bottom:1px solid #ccc; + padding-bottom:10px; + padding-top:10px; +} + +.file-list li:nth-child(odd) { + background-color: hsl(0, 0%, 98%); +} + +.fade-left { + background: -moz-linear-gradient(left, rgba(255,255,255,1) 0%, rgba(255,255,255,0) 100%); /* FF3.6+ */ + background: -webkit-gradient(linear, left top, right top, color-stop(0%,rgba(255,255,255,1)), color-stop(100%,rgba(255,255,255,0))); /* Chrome,Safari4+ */ + background: -webkit-linear-gradient(left, rgba(255,255,255,1) 0%,rgba(255,255,255,0) 100%); /* Chrome10+,Safari5.1+ */ + background: -o-linear-gradient(left, rgba(255,255,255,1) 0%,rgba(255,255,255,0) 100%); /* Opera 11.10+ */ + background: -ms-linear-gradient(left, rgba(255,255,255,1) 0%,rgba(255,255,255,0) 100%); /* IE10+ */ + background: linear-gradient(to right, rgba(255,255,255,1) 0%,rgba(255,255,255,0) 100%); /* W3C */ + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#00ffffff',GradientType=1 ); /* IE6-9 */ +} + +.file-list li:nth-child(odd) .fade-left { + background: -moz-linear-gradient(left, rgba(249,249,249,1) 0%, rgba(255,255,255,0) 100%); /* FF3.6+ */ + background: -webkit-gradient(linear, left top, right top, color-stop(0%,rgba(249,249,249,1)), color-stop(100%,rgba(255,255,255,0))); /* Chrome,Safari4+ */ + background: -webkit-linear-gradient(left, rgba(249,249,249,1) 0%,rgba(255,255,255,0) 100%); /* Chrome10+,Safari5.1+ */ + background: -o-linear-gradient(left, rgba(249,249,249,1) 0%,rgba(255,255,255,0) 100%); /* Opera 11.10+ */ + background: -ms-linear-gradient(left, rgba(249,249,249,1) 0%,rgba(255,255,255,0) 100%); /* IE10+ */ + background: linear-gradient(to right, rgba(249,249,249,1) 0%,rgba(255,255,255,0) 100%); /* W3C */ + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f9f9f9', endColorstr='#00ffffff',GradientType=1 ); /* IE6-9 */ +} + +.plato-file-fade { + position: absolute; + height: 50px; + z-index: 10; + float: left; + width:70px +} + +.plato-file { + white-space: nowrap; +} + + +.plato-file-link { + text-align: right; + direction: rtl; + overflow: hidden; + height:40px; +} + +@media (max-width: 767px) { + .plato-file-link { + text-align: center; + } +} + +.plato-file-chart { + height:40px; +} + +.plato-file-link { + font-size:20px; + color: #334B6D; + display:block; + padding:12px 12px 12px 0; + text-decoration: underline; +} + +.plato-file-link:hover { + color: #3B71B1; +} + diff --git a/lib/report/assets/css/plato.css b/lib/report/assets/css/plato.css new file mode 100755 index 0000000..9a31e96 --- /dev/null +++ b/lib/report/assets/css/plato.css @@ -0,0 +1,62 @@ + +body { +} + +.navbar { + margin-bottom:0; + padding: 0 20px; + background-color: #f2f2f2; + background-image: none; + border: 1px solid #d4d4d4; + border-radius: 4px; + -webkit-box-shadow: none; + box-shadow: none; + line-height:10px; +} + +a:visited { + fill:inherit; +} + +.jumbotron { + background: rgb(255,255,255); /* Old browsers */ + background: -moz-linear-gradient(top, rgba(255,255,255,1) 0%, rgba(229,229,229,1) 100%); /* FF3.6+ */ + background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(255,255,255,1)), color-stop(100%,rgba(229,229,229,1))); /* Chrome,Safari4+ */ + background: -webkit-linear-gradient(top, rgba(255,255,255,1) 0%,rgba(229,229,229,1) 100%); /* Chrome10+,Safari5.1+ */ + background: -o-linear-gradient(top, rgba(255,255,255,1) 0%,rgba(229,229,229,1) 100%); /* Opera 11.10+ */ + background: -ms-linear-gradient(top, rgba(255,255,255,1) 0%,rgba(229,229,229,1) 100%); /* IE10+ */ + background: linear-gradient(to bottom, rgba(255,255,255,1) 0%,rgba(229,229,229,1) 100%); /* W3C */ + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#e5e5e5',GradientType=0 ); /* IE6-9 */ + + color:#333; + box-shadow: 5px 5px 15px -6px black; +} + +li { + line-height: 10px; +} + +/* Landscape phone to portrait tablet */ +@media (max-width: 767px) { + .jumbotron h1 { + font-size: 40px; + } +} + +.aggregate-stats { + +} + +.aggregate-stats .header { + text-align: center; + color: #5a5a5a; + font-weight:lighter; +} + +.aggregate-stats .stat { + text-align: center; + color: #5a5a5a; + font-size:55px; + line-height:70px; +} + diff --git a/lib/report/assets/css/vendor/bootstrap-3.0.0-wip.css b/lib/report/assets/css/vendor/bootstrap-3.0.0-wip.css new file mode 100755 index 0000000..44581d4 --- /dev/null +++ b/lib/report/assets/css/vendor/bootstrap-3.0.0-wip.css @@ -0,0 +1,5536 @@ +/*! + * Bootstrap v3.0.0 + * + * Copyright 2012 Twitter, Inc + * Licensed under the Apache License v2.0 + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Designed and built with all the love in the world by @mdo and @fat. + */ + +/*! normalize.css v2.0.1 | MIT License | git.io/normalize */ + +article, +aside, +details, +figcaption, +figure, +footer, +header, +hgroup, +nav, +section, +summary { + display: block; +} + +audio, +canvas, +video { + display: inline-block; +} + +audio:not([controls]) { + display: none; + height: 0; +} + +[hidden] { + display: none; +} + +html { + font-family: sans-serif; + -webkit-text-size-adjust: 100%; + -ms-text-size-adjust: 100%; +} + +body { + margin: 0; +} + +a:focus { + outline: thin dotted; +} + +a:active, +a:hover { + outline: 0; +} + +h1 { + font-size: 2em; +} + +abbr[title] { + border-bottom: 1px dotted; +} + +b, +strong { + font-weight: bold; +} + +dfn { + font-style: italic; +} + +mark { + color: #000; + background: #ff0; +} + +code, +kbd, +pre, +samp { + font-family: monospace, serif; + font-size: 1em; +} + +pre { + word-wrap: break-word; + white-space: pre; + white-space: pre-wrap; +} + +q { + quotes: "\201C" "\201D" "\2018" "\2019"; +} + +small { + font-size: 80%; +} + +sub, +sup { + position: relative; + font-size: 75%; + line-height: 0; + vertical-align: baseline; +} + +sup { + top: -0.5em; +} + +sub { + bottom: -0.25em; +} + +img { + border: 0; +} + +svg:not(:root) { + overflow: hidden; +} + +figure { + margin: 0; +} + +fieldset { + padding: 0.35em 0.625em 0.75em; + margin: 0 2px; + border: 1px solid #c0c0c0; +} + +legend { + padding: 0; + border: 0; +} + +button, +input, +select, +textarea { + margin: 0; + font-family: inherit; + font-size: 100%; +} + +button, +input { + line-height: normal; +} + +button, +html input[type="button"], +input[type="reset"], +input[type="submit"] { + cursor: pointer; + -webkit-appearance: button; +} + +button[disabled], +html input[disabled] { + cursor: default; +} + +input[type="checkbox"], +input[type="radio"] { + padding: 0; + box-sizing: border-box; +} + +input[type="search"] { + -webkit-box-sizing: content-box; + -moz-box-sizing: content-box; + box-sizing: content-box; + -webkit-appearance: textfield; +} + +input[type="search"]::-webkit-search-cancel-button, +input[type="search"]::-webkit-search-decoration { + -webkit-appearance: none; +} + +button::-moz-focus-inner, +input::-moz-focus-inner { + padding: 0; + border: 0; +} + +textarea { + overflow: auto; + vertical-align: top; +} + +table { + border-collapse: collapse; + border-spacing: 0; +} + +body { + margin: 0; + color: #333333; + background-color: #ffffff; +} + +body, +input, +button, +select, +textarea { + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 14px; + line-height: 20px; +} + +a { + color: #0088cc; + text-decoration: none; +} + +a:hover { + color: #005580; + text-decoration: underline; +} + +a:focus { + outline: thin dotted #333; + outline: 5px auto -webkit-focus-ring-color; + outline-offset: -2px; +} + +img { + width: auto\9; + height: auto; + max-width: 100%; + vertical-align: middle; +} + +.img-rounded { + border-radius: 6px; +} + +.img-polaroid { + padding: 4px; + background-color: #fff; + border: 1px solid #ccc; + border: 1px solid rgba(0, 0, 0, 0.2); + -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); +} + +.img-circle { + border-radius: 500px; +} + +@media print { + * { + color: #000 !important; + text-shadow: none !important; + background: transparent !important; + box-shadow: none !important; + } + a, + a:visited { + text-decoration: underline; + } + a[href]:after { + content: " (" attr(href) ")"; + } + abbr[title]:after { + content: " (" attr(title) ")"; + } + .ir a:after, + a[href^="javascript:"]:after, + a[href^="#"]:after { + content: ""; + } + pre, + blockquote { + border: 1px solid #999; + page-break-inside: avoid; + } + thead { + display: table-header-group; + } + tr, + img { + page-break-inside: avoid; + } + img { + max-width: 100% !important; + } + @page { + margin: 0.5cm; + } + p, + h2, + h3 { + orphans: 3; + widows: 3; + } + h2, + h3 { + page-break-after: avoid; + } +} + +.container { + max-width: 940px; + margin-right: auto; + margin-left: auto; +} + +.container:before, +.container:after { + display: table; + content: " "; +} + +.container:after { + clear: both; +} + +.row { + margin-right: -10px; + margin-left: -10px; +} + +.row:before, +.row:after { + display: table; + content: " "; +} + +.row:after { + clear: both; +} + +[class*="span"] { + float: left; + min-height: 1px; + padding-right: 10px; + padding-left: 10px; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} + +.span12 { + width: 100%; +} + +.span11 { + width: 91.66666666666666%; +} + +.span10 { + width: 83.33333333333334%; +} + +.span9 { + width: 75%; +} + +.span8 { + width: 66.66666666666666%; +} + +.span7 { + width: 58.333333333333336%; +} + +.span6 { + width: 50%; +} + +.span5 { + width: 41.66666666666667%; +} + +.span4 { + width: 33.33333333333333%; +} + +.span3 { + width: 25%; +} + +.span2 { + width: 16.666666666666664%; +} + +.span1 { + width: 8.333333333333332%; +} + +.offset12 { + margin-left: 100%; +} + +.offset11 { + margin-left: 91.66666666666666%; +} + +.offset10 { + margin-left: 83.33333333333334%; +} + +.offset9 { + margin-left: 75%; +} + +.offset8 { + margin-left: 66.66666666666666%; +} + +.offset7 { + margin-left: 58.333333333333336%; +} + +.offset6 { + margin-left: 50%; +} + +.offset5 { + margin-left: 41.66666666666667%; +} + +.offset4 { + margin-left: 33.33333333333333%; +} + +.offset3 { + margin-left: 25%; +} + +.offset2 { + margin-left: 16.666666666666664%; +} + +.offset1 { + margin-left: 8.333333333333332%; +} + +[class*="span"].pull-right { + float: right; +} + +p { + margin: 0 0 10px; +} + +.lead { + margin-bottom: 20px; + font-size: 21px; + font-weight: 200; + line-height: 30px; +} + +small { + font-size: 85%; +} + +strong { + font-weight: bold; +} + +em { + font-style: italic; +} + +cite { + font-style: normal; +} + +.muted { + color: #999999; +} + +a.muted:hover { + color: #808080; +} + +.text-warning { + color: #c09853; +} + +a.text-warning:hover { + color: #a47e3c; +} + +.text-error { + color: #b94a48; +} + +a.text-error:hover { + color: #953b39; +} + +.text-info { + color: #3a87ad; +} + +a.text-info:hover { + color: #2d6987; +} + +.text-success { + color: #468847; +} + +a.text-success:hover { + color: #356635; +} + +h1, +h2, +h3, +h4, +h5, +h6 { + margin: 10px 0; + font-family: inherit; + font-weight: bold; + line-height: 20px; + text-rendering: optimizelegibility; +} + +h1 small, +h2 small, +h3 small, +h4 small, +h5 small, +h6 small { + font-weight: normal; + line-height: 1; + color: #999999; +} + +h1, +h2, +h3 { + line-height: 40px; +} + +h1 { + font-size: 38.5px; +} + +h2 { + font-size: 31.5px; +} + +h3 { + font-size: 24.5px; +} + +h4 { + font-size: 17.5px; +} + +h5 { + font-size: 14px; +} + +h6 { + font-size: 11.9px; +} + +h1 small { + font-size: 24.5px; +} + +h2 small { + font-size: 17.5px; +} + +h3 small { + font-size: 14px; +} + +h4 small { + font-size: 14px; +} + +.page-header { + padding-bottom: 9px; + margin: 20px 0 30px; + border-bottom: 1px solid #eeeeee; +} + +ul, +ol { + padding: 0; + margin: 0 0 10px 25px; +} + +ul ul, +ul ol, +ol ol, +ol ul { + margin-bottom: 0; +} + +li { + line-height: 20px; +} + +.list-unstyled, +.list-inline { + margin-left: 0; + list-style: none; +} + +.list-inline > li { + display: inline-block; + padding-right: 5px; + padding-left: 5px; +} + +dl { + margin-bottom: 20px; +} + +dt, +dd { + line-height: 20px; +} + +dt { + font-weight: bold; +} + +dd { + margin-left: 10px; +} + +.dl-horizontal:before, +.dl-horizontal:after { + display: table; + content: " "; +} + +.dl-horizontal:after { + clear: both; +} + +.dl-horizontal dt { + float: left; + width: 160px; + overflow: hidden; + clear: left; + text-align: right; + text-overflow: ellipsis; + white-space: nowrap; +} + +.dl-horizontal dd { + margin-left: 180px; +} + +hr { + margin: 20px 0; + border: 0; + border-top: 1px solid #eeeeee; + border-bottom: 1px solid #fff; +} + +abbr[title], +abbr[data-original-title] { + cursor: help; + border-bottom: 1px dotted #999999; +} + +abbr.initialism { + font-size: 90%; + text-transform: uppercase; +} + +blockquote { + padding: 0 0 0 15px; + margin: 0 0 20px; + border-left: 5px solid #eeeeee; +} + +blockquote p { + margin-bottom: 0; + font-size: 16px; + font-weight: 300; + line-height: 25px; +} + +blockquote small { + display: block; + line-height: 20px; + color: #999999; +} + +blockquote small:before { + content: '\2014 \00A0'; +} + +blockquote.pull-right { + float: right; + padding-right: 15px; + padding-left: 0; + border-right: 5px solid #eeeeee; + border-left: 0; +} + +blockquote.pull-right p, +blockquote.pull-right small { + text-align: right; +} + +blockquote.pull-right small:before { + content: ''; +} + +blockquote.pull-right small:after { + content: '\00A0 \2014'; +} + +q:before, +q:after, +blockquote:before, +blockquote:after { + content: ""; +} + +address { + display: block; + margin-bottom: 20px; + font-style: normal; + line-height: 20px; +} + +code, +pre { + padding: 0 3px 2px; + font-family: Monaco, Menlo, Consolas, "Courier New", monospace; + font-size: 12px; + color: #333333; + border-radius: 4px; +} + +code { + padding: 2px 4px; + color: #d14; + white-space: nowrap; + background-color: #f7f7f9; + border: 1px solid #e1e1e8; +} + +pre { + display: block; + padding: 9.5px; + margin: 0 0 10px; + font-size: 13px; + line-height: 20px; + word-break: break-all; + word-wrap: break-word; + white-space: pre; + white-space: pre-wrap; + background-color: #f5f5f5; + border: 1px solid #ccc; + border: 1px solid rgba(0, 0, 0, 0.15); + border-radius: 4px; +} + +pre.prettyprint { + margin-bottom: 20px; +} + +pre code { + padding: 0; + color: inherit; + white-space: pre; + white-space: pre-wrap; + background-color: transparent; + border: 0; +} + +.pre-scrollable { + max-height: 340px; + overflow-y: scroll; +} + +form { + margin: 0 0 20px; +} + +fieldset { + padding: 0; + margin: 0; + border: 0; +} + +legend { + display: block; + width: 100%; + padding: 0; + margin-bottom: 20px; + font-size: 21px; + line-height: 40px; + color: #333333; + border: 0; + border-bottom: 1px solid #e5e5e5; +} + +label { + display: inline-block; + margin-bottom: 5px; + font-weight: bold; +} + +select, +textarea, +input[type="text"], +input[type="password"], +input[type="datetime"], +input[type="datetime-local"], +input[type="date"], +input[type="month"], +input[type="time"], +input[type="week"], +input[type="number"], +input[type="email"], +input[type="url"], +input[type="search"], +input[type="tel"], +input[type="color"], +.uneditable-input { + display: inline-block; + min-height: 34px; + padding: 6px 9px; + margin-bottom: 10px; + font-size: 14px; + line-height: 20px; + color: #555555; + vertical-align: middle; + background-color: #ffffff; + border: 1px solid #cccccc; + border-radius: 4px; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + -webkit-transition: border linear 0.2s, box-shadow linear 0.2s; + -moz-transition: border linear 0.2s, box-shadow linear 0.2s; + -o-transition: border linear 0.2s, box-shadow linear 0.2s; + transition: border linear 0.2s, box-shadow linear 0.2s; +} + +input, +select, +textarea, +.uneditable-input { + width: 100%; +} + +input[type="file"], +input[type="image"], +input[type="submit"], +input[type="reset"], +input[type="button"], +input[type="radio"], +input[type="checkbox"] { + width: auto; +} + +textarea { + height: auto; +} + +textarea:focus, +input[type="text"]:focus, +input[type="password"]:focus, +input[type="datetime"]:focus, +input[type="datetime-local"]:focus, +input[type="date"]:focus, +input[type="month"]:focus, +input[type="time"]:focus, +input[type="week"]:focus, +input[type="number"]:focus, +input[type="email"]:focus, +input[type="url"]:focus, +input[type="search"]:focus, +input[type="tel"]:focus, +input[type="color"]:focus, +.uneditable-input:focus { + border-color: rgba(82, 168, 236, 0.8); + outline: 0; + outline: thin dotted \9; + /* IE6-9 */ + + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6); +} + +input[type="radio"], +input[type="checkbox"] { + margin: 4px 0 0; + margin-top: 1px \9; + /* IE8-9 */ + + line-height: normal; +} + +select, +input[type="file"] { + height: 34px; + /* In IE7, the height of the select element cannot be changed by height, only font-size. TODO: Check if this is still needed when dropping IE7 support */ + + line-height: 34px; +} + +select { + border: 1px solid #cccccc; +} + +select[multiple], +select[size] { + height: auto; +} + +select:focus, +input[type="file"]:focus, +input[type="radio"]:focus, +input[type="checkbox"]:focus { + outline: thin dotted #333; + outline: 5px auto -webkit-focus-ring-color; + outline-offset: -2px; +} + +.uneditable-input, +.uneditable-textarea { + color: #999999; + cursor: not-allowed; + background-color: #fcfcfc; + border-color: #cccccc; + -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.025); + box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.025); +} + +.uneditable-input { + overflow: hidden; + white-space: nowrap; +} + +.uneditable-textarea { + width: auto; + height: auto; +} + +input:-moz-placeholder, +textarea:-moz-placeholder { + color: #999999; +} + +input:-ms-input-placeholder, +textarea:-ms-input-placeholder { + color: #999999; +} + +input::-webkit-input-placeholder, +textarea::-webkit-input-placeholder { + color: #999999; +} + +.radio, +.checkbox { + display: block; + min-height: 20px; + padding-left: 20px; +} + +.radio label, +.checkbox label { + margin-bottom: 0; + font-weight: normal; +} + +.radio input[type="radio"], +.checkbox input[type="checkbox"] { + float: left; + margin-left: -20px; +} + +.controls > .radio:first-child, +.controls > .checkbox:first-child { + padding-top: 5px; +} + +.radio.inline, +.checkbox.inline { + display: inline-block; + padding-top: 5px; + margin-bottom: 0; + vertical-align: middle; +} + +.radio.inline + .radio.inline, +.checkbox.inline + .checkbox.inline { + margin-left: 10px; +} + +select.input-large, +textarea.input-large, +input[type="text"].input-large, +input[type="password"].input-large, +input[type="datetime"].input-large, +input[type="datetime-local"].input-large, +input[type="date"].input-large, +input[type="month"].input-large, +input[type="time"].input-large, +input[type="week"].input-large, +input[type="number"].input-large, +input[type="email"].input-large, +input[type="url"].input-large, +input[type="search"].input-large, +input[type="tel"].input-large, +input[type="color"].input-large, +.uneditable-input.input-large { + padding: 11px 19px; + padding-right: 14px; + padding-left: 14px; + font-size: 17.5px; + border-radius: 6px; +} + +select.input-small, +textarea.input-small, +input[type="text"].input-small, +input[type="password"].input-small, +input[type="datetime"].input-small, +input[type="datetime-local"].input-small, +input[type="date"].input-small, +input[type="month"].input-small, +input[type="time"].input-small, +input[type="week"].input-small, +input[type="number"].input-small, +input[type="email"].input-small, +input[type="url"].input-small, +input[type="search"].input-small, +input[type="tel"].input-small, +input[type="color"].input-small, +.uneditable-input.input-small { + padding: 2px 10px; + font-size: 11.9px; + border-radius: 3px; +} + +select.input-mini, +textarea.input-mini, +input[type="text"].input-mini, +input[type="password"].input-mini, +input[type="datetime"].input-mini, +input[type="datetime-local"].input-mini, +input[type="date"].input-mini, +input[type="month"].input-mini, +input[type="time"].input-mini, +input[type="week"].input-mini, +input[type="number"].input-mini, +input[type="email"].input-mini, +input[type="url"].input-mini, +input[type="search"].input-mini, +input[type="tel"].input-mini, +input[type="color"].input-mini, +.uneditable-input.input-mini { + padding: 0 6px; + font-size: 10.5px; + border-radius: 3px; +} + +input[class*="span"], +select[class*="span"], +textarea[class*="span"], +.uneditable-input[class*="span"] { + float: none; + margin-right: 0; + margin-left: 0; +} + +.controls-row input.offset12, +textarea.offset12, +select.offset12, +uneditable-input.offset12 { + margin-left: 101.06382978723404%; +} + +.controls-row input.offset11, +textarea.offset11, +select.offset11, +uneditable-input.offset11 { + margin-left: 92.7304964539007%; +} + +.controls-row input.offset10, +textarea.offset10, +select.offset10, +uneditable-input.offset10 { + margin-left: 84.39716312056738%; +} + +.controls-row input.offset9, +textarea.offset9, +select.offset9, +uneditable-input.offset9 { + margin-left: 76.06382978723404%; +} + +.controls-row input.offset8, +textarea.offset8, +select.offset8, +uneditable-input.offset8 { + margin-left: 67.7304964539007%; +} + +.controls-row input.offset7, +textarea.offset7, +select.offset7, +uneditable-input.offset7 { + margin-left: 59.39716312056738%; +} + +.controls-row input.offset6, +textarea.offset6, +select.offset6, +uneditable-input.offset6 { + margin-left: 51.06382978723404%; +} + +.controls-row input.offset5, +textarea.offset5, +select.offset5, +uneditable-input.offset5 { + margin-left: 42.73049645390071%; +} + +.controls-row input.offset4, +textarea.offset4, +select.offset4, +uneditable-input.offset4 { + margin-left: 34.39716312056737%; +} + +.controls-row input.offset3, +textarea.offset3, +select.offset3, +uneditable-input.offset3 { + margin-left: 26.06382978723404%; +} + +.controls-row input.offset2, +textarea.offset2, +select.offset2, +uneditable-input.offset2 { + margin-left: 17.730496453900706%; +} + +.controls-row input.offset1, +textarea.offset1, +select.offset1, +uneditable-input.offset1 { + margin-left: 9.397163120567374%; +} + +.input-append input[class*="span"], +.input-append .uneditable-input[class*="span"], +.input-prepend input[class*="span"], +.input-prepend .uneditable-input[class*="span"] { + display: inline-block; +} + +input[class*="span"], +select[class*="span"], +textarea[class*="span"], +.uneditable-input[class*="span"] { + height: 34px; +} + +.controls-row:before, +.controls-row:after { + display: table; + content: " "; +} + +.controls-row:after { + clear: both; +} + +.controls-row [class*="span"] { + float: left; +} + +.controls-row .checkbox[class*="span"], +.controls-row .radio[class*="span"] { + padding-top: 5px; +} + +input[disabled], +select[disabled], +textarea[disabled], +input[readonly], +select[readonly], +textarea[readonly], +fieldset[disabled] input, +fieldset[disabled] select, +fieldset[disabled] textarea { + cursor: not-allowed; + background-color: #eeeeee; +} + +input[type="radio"][disabled], +input[type="checkbox"][disabled], +input[type="radio"][readonly], +input[type="checkbox"][readonly], +fieldset[disabled] input[type="radio"], +fieldset[disabled] input[type="checkbox"] { + background-color: transparent; +} + +.control-group.warning .control-label, +.control-group.warning .help-block, +.control-group.warning .help-inline { + color: #c09853; +} + +.control-group.warning .checkbox, +.control-group.warning .radio, +.control-group.warning input, +.control-group.warning select, +.control-group.warning textarea { + color: #c09853; +} + +.control-group.warning input, +.control-group.warning select, +.control-group.warning textarea { + border-color: #c09853; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); +} + +.control-group.warning input:focus, +.control-group.warning select:focus, +.control-group.warning textarea:focus { + border-color: #a47e3c; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #dbc59e; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #dbc59e; +} + +.control-group.warning .input-prepend .add-on, +.control-group.warning .input-append .add-on { + color: #c09853; + background-color: #fcf8e3; + border-color: #c09853; +} + +.control-group.error .control-label, +.control-group.error .help-block, +.control-group.error .help-inline { + color: #b94a48; +} + +.control-group.error .checkbox, +.control-group.error .radio, +.control-group.error input, +.control-group.error select, +.control-group.error textarea { + color: #b94a48; +} + +.control-group.error input, +.control-group.error select, +.control-group.error textarea { + border-color: #b94a48; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); +} + +.control-group.error input:focus, +.control-group.error select:focus, +.control-group.error textarea:focus { + border-color: #953b39; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #d59392; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #d59392; +} + +.control-group.error .input-prepend .add-on, +.control-group.error .input-append .add-on { + color: #b94a48; + background-color: #f2dede; + border-color: #b94a48; +} + +.control-group.success .control-label, +.control-group.success .help-block, +.control-group.success .help-inline { + color: #468847; +} + +.control-group.success .checkbox, +.control-group.success .radio, +.control-group.success input, +.control-group.success select, +.control-group.success textarea { + color: #468847; +} + +.control-group.success input, +.control-group.success select, +.control-group.success textarea { + border-color: #468847; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); +} + +.control-group.success input:focus, +.control-group.success select:focus, +.control-group.success textarea:focus { + border-color: #356635; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7aba7b; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7aba7b; +} + +.control-group.success .input-prepend .add-on, +.control-group.success .input-append .add-on { + color: #468847; + background-color: #dff0d8; + border-color: #468847; +} + +.control-group.info .control-label, +.control-group.info .help-block, +.control-group.info .help-inline { + color: #3a87ad; +} + +.control-group.info .checkbox, +.control-group.info .radio, +.control-group.info input, +.control-group.info select, +.control-group.info textarea { + color: #3a87ad; +} + +.control-group.info input, +.control-group.info select, +.control-group.info textarea { + border-color: #3a87ad; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); +} + +.control-group.info input:focus, +.control-group.info select:focus, +.control-group.info textarea:focus { + border-color: #2d6987; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7ab5d3; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7ab5d3; +} + +.control-group.info .input-prepend .add-on, +.control-group.info .input-append .add-on { + color: #3a87ad; + background-color: #d9edf7; + border-color: #3a87ad; +} + +input:focus:invalid, +textarea:focus:invalid, +select:focus:invalid { + color: #b94a48; + border-color: #ee5f5b; +} + +input:focus:invalid:focus, +textarea:focus:invalid:focus, +select:focus:invalid:focus { + border-color: #e9322d; + -webkit-box-shadow: 0 0 6px #f8b9b7; + box-shadow: 0 0 6px #f8b9b7; +} + +.form-actions { + padding: 19px 20px 20px; + margin-top: 20px; + margin-bottom: 20px; + background-color: #f5f5f5; + border-top: 1px solid #e5e5e5; +} + +.form-actions:before, +.form-actions:after { + display: table; + content: " "; +} + +.form-actions:after { + clear: both; +} + +.help-block, +.help-inline { + color: #737373; +} + +.help-block { + display: block; + margin-bottom: 10px; +} + +.help-inline { + display: inline-block; + padding-left: 5px; + vertical-align: middle; +} + +.input-group { + display: table; +} + +.input-group[class*="span"] { + float: none; + padding: 0; +} + +.input-group input, +.input-group select, +.input-group .uneditable-input { + width: 100%; +} + +.input-group-addon, +.input-group-btn, +.input-group input, +.input-group .uneditable-input { + display: table-cell; + margin: 0; + border-radius: 0; +} + +.input-group-addon, +.input-group-btn { + width: 1%; + vertical-align: middle; +} + +.input-group-addon { + padding: 6px 8px; + font-size: 14px; + font-weight: normal; + line-height: 20px; + text-align: center; + text-shadow: 0 1px 0 #fff; + background-color: #eeeeee; + border: 1px solid #ccc; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} + +.input-group input:first-child, +.input-group .uneditable-input:first-child, +.input-group-addon:first-child { + border-bottom-left-radius: 4px; + border-top-left-radius: 4px; +} + +.input-group-addon:first-child { + border-right: 0; +} + +.input-group input:last-child, +.input-group .uneditable-input:last-child, +.input-group-addon:last-child { + border-top-right-radius: 4px; + border-bottom-right-radius: 4px; +} + +.input-group-addon:last-child { + border-left: 0; +} + +.input-group-btn, +.input-group-btn .btn { + white-space: nowrap; +} + +.input-group-btn > .btn { + float: left; + border-radius: 0; +} + +.input-group-btn > .btn + .btn { + border-left: 0; +} + +.input-group-btn.btn-group { + display: table-cell; +} + +.input-group-btn:first-child > .btn, +.input-group-btn.btn-group:first-child > .btn { + border-right: 0; +} + +.input-group-btn:first-child > .btn, +.input-group-btn.btn-group:first-child > .btn { + border-radius: 4px 0 0 4px; +} + +.input-group-btn:last-child > .btn, +.input-group-btn.btn-group:last-child > .btn:first-child { + border-left: 0; +} + +.input-group-btn:last-child > .btn, +.input-group-btn.btn-group:last-child > .btn { + border-radius: 0 4px 4px 0; +} + +table { + max-width: 100%; + background-color: transparent; + border-collapse: collapse; + border-spacing: 0; +} + +.table { + width: 100%; + margin-bottom: 20px; +} + +.table th, +.table td { + padding: 8px; + line-height: 20px; + text-align: left; + vertical-align: top; + border-top: 1px solid #dddddd; +} + +.table th { + font-weight: bold; +} + +.table thead th { + vertical-align: bottom; +} + +.table caption + thead tr:first-child th, +.table caption + thead tr:first-child td, +.table colgroup + thead tr:first-child th, +.table colgroup + thead tr:first-child td, +.table thead:first-child tr:first-child th, +.table thead:first-child tr:first-child td { + border-top: 0; +} + +.table tbody + tbody { + border-top: 2px solid #dddddd; +} + +.table .table { + background-color: #ffffff; +} + +.table-condensed th, +.table-condensed td { + padding: 4px 5px; +} + +.table-bordered { + border: 1px solid #dddddd; + border-collapse: separate; + border-left: 0; + border-radius: 4px; +} + +.table-bordered th, +.table-bordered td { + border-left: 1px solid #dddddd; +} + +.table-bordered caption + thead tr:first-child th, +.table-bordered caption + tbody tr:first-child th, +.table-bordered caption + tbody tr:first-child td, +.table-bordered colgroup + thead tr:first-child th, +.table-bordered colgroup + tbody tr:first-child th, +.table-bordered colgroup + tbody tr:first-child td, +.table-bordered thead:first-child tr:first-child th, +.table-bordered tbody:first-child tr:first-child th, +.table-bordered tbody:first-child tr:first-child td { + border-top: 0; +} + +.table-bordered thead:first-child tr:first-child > th:first-child, +.table-bordered tbody:first-child tr:first-child > td:first-child { + border-top-left-radius: 4px; +} + +.table-bordered thead:first-child tr:first-child > th:last-child, +.table-bordered tbody:first-child tr:first-child > td:last-child { + border-top-right-radius: 4px; +} + +.table-bordered thead:last-child tr:last-child > th:first-child, +.table-bordered tbody:last-child tr:last-child > td:first-child, +.table-bordered tfoot:last-child tr:last-child > td:first-child { + border-bottom-left-radius: 4px; +} + +.table-bordered thead:last-child tr:last-child > th:last-child, +.table-bordered tbody:last-child tr:last-child > td:last-child, +.table-bordered tfoot:last-child tr:last-child > td:last-child { + border-bottom-right-radius: 4px; +} + +.table-bordered tfoot + tbody:last-child tr:last-child > td:first-child { + border-bottom-left-radius: 0; +} + +.table-bordered tfoot + tbody:last-child tr:last-child > td:last-child { + border-bottom-right-radius: 0; +} + +.table-bordered caption + thead tr:first-child th:first-child, +.table-bordered caption + tbody tr:first-child td:first-child, +.table-bordered colgroup + thead tr:first-child th:first-child, +.table-bordered colgroup + tbody tr:first-child td:first-child { + border-top-left-radius: 4px; +} + +.table-bordered caption + thead tr:first-child th:last-child, +.table-bordered caption + tbody tr:first-child td:last-child, +.table-bordered colgroup + thead tr:first-child th:last-child, +.table-bordered colgroup + tbody tr:first-child td:last-child { + border-top-right-radius: 4px; +} + +.table-striped tbody > tr:nth-child(odd) > td, +.table-striped tbody > tr:nth-child(odd) > th { + background-color: #f9f9f9; +} + +.table-hover tbody tr:hover td, +.table-hover tbody tr:hover th { + background-color: #f5f5f5; +} + +table td[class*="span"], +table th[class*="span"] { + display: table-cell; + float: none; + margin-left: 0; +} + +.table tbody tr.success td { + background-color: #dff0d8; +} + +.table tbody tr.error td { + background-color: #f2dede; +} + +.table tbody tr.warning td { + background-color: #fcf8e3; +} + +.table tbody tr.info td { + background-color: #d9edf7; +} + +.table-hover tbody tr.success:hover td { + background-color: #d0e9c6; +} + +.table-hover tbody tr.error:hover td { + background-color: #ebcccc; +} + +.table-hover tbody tr.warning:hover td { + background-color: #faf2cc; +} + +.table-hover tbody tr.info:hover td { + background-color: #c4e3f3; +} + +@font-face { + font-family: 'Glyphicons Halflings'; + font-style: normal; + font-weight: normal; + src: url('../fonts/glyphiconshalflings-regular.eot'); + src: url('../fonts/glyphiconshalflings-regular.eot?#iefix') format('embedded-opentype'), url('../fonts/glyphiconshalflings-regular.woff') format('woff'), url('../fonts/glyphiconshalflings-regular.ttf') format('truetype'), url('../fonts/glyphiconshalflings-regular.svg#glyphicons_halflingsregular') format('svg'); +} + +[class^="glyphicon-"]:before { + font-family: 'Glyphicons Halflings'; + font-style: normal; + line-height: 1; +} + +.glyphicon-glass:before { + content: "\e001"; +} + +.glyphicon-music:before { + content: "\e002"; +} + +.glyphicon-search:before { + content: "\e003"; +} + +.glyphicon-envelope:before { + content: "\2709"; +} + +.glyphicon-heart:before { + content: "\e005"; +} + +.glyphicon-star:before { + content: "\e006"; +} + +.glyphicon-star-empty:before { + content: "\e007"; +} + +.glyphicon-user:before { + content: "\e008"; +} + +.glyphicon-film:before { + content: "\e009"; +} + +.glyphicon-th-large:before { + content: "\e010"; +} + +.glyphicon-th:before { + content: "\e011"; +} + +.glyphicon-th-list:before { + content: "\e012"; +} + +.glyphicon-ok:before { + content: "\e013"; +} + +.glyphicon-remove:before { + content: "\e014"; +} + +.glyphicon-zoom-in:before { + content: "\e015"; +} + +.glyphicon-zoom-out:before { + content: "\e016"; +} + +.glyphicon-off:before { + content: "\e017"; +} + +.glyphicon-signal:before { + content: "\e018"; +} + +.glyphicon-cog:before { + content: "\e019"; +} + +.glyphicon-trash:before { + content: "\e020"; +} + +.glyphicon-home:before { + content: "\e021"; +} + +.glyphicon-file:before { + content: "\e022"; +} + +.glyphicon-time:before { + content: "\e023"; +} + +.glyphicon-road:before { + content: "\e024"; +} + +.glyphicon-download-alt:before { + content: "\e025"; +} + +.glyphicon-download:before { + content: "\e026"; +} + +.glyphicon-upload:before { + content: "\e027"; +} + +.glyphicon-inbox:before { + content: "\e028"; +} + +.glyphicon-play-circle:before { + content: "\e029"; +} + +.glyphicon-repeat:before { + content: "\e030"; +} + +.glyphicon-refresh:before { + content: "\e031"; +} + +.glyphicon-list-alt:before { + content: "\e032"; +} + +.glyphicon-lock:before { + content: "\e033"; +} + +.glyphicon-flag:before { + content: "\e034"; +} + +.glyphicon-headphones:before { + content: "\e035"; +} + +.glyphicon-volume-off:before { + content: "\e036"; +} + +.glyphicon-volume-down:before { + content: "\e037"; +} + +.glyphicon-volume-up:before { + content: "\e038"; +} + +.glyphicon-qrcode:before { + content: "\e039"; +} + +.glyphicon-barcode:before { + content: "\e040"; +} + +.glyphicon-tag:before { + content: "\e041"; +} + +.glyphicon-tags:before { + content: "\e042"; +} + +.glyphicon-book:before { + content: "\e043"; +} + +.glyphicon-bookmark:before { + content: "\e044"; +} + +.glyphicon-print:before { + content: "\e045"; +} + +.glyphicon-camera:before { + content: "\e046"; +} + +.glyphicon-font:before { + content: "\e047"; +} + +.glyphicon-bold:before { + content: "\e048"; +} + +.glyphicon-italic:before { + content: "\e049"; +} + +.glyphicon-text-height:before { + content: "\e050"; +} + +.glyphicon-text-width:before { + content: "\e051"; +} + +.glyphicon-align-left:before { + content: "\e052"; +} + +.glyphicon-align-center:before { + content: "\e053"; +} + +.glyphicon-align-right:before { + content: "\e054"; +} + +.glyphicon-align-justify:before { + content: "\e055"; +} + +.glyphicon-list:before { + content: "\e056"; +} + +.glyphicon-indent-left:before { + content: "\e057"; +} + +.glyphicon-indent-right:before { + content: "\e058"; +} + +.glyphicon-facetime-video:before { + content: "\e059"; +} + +.glyphicon-picture:before { + content: "\e060"; +} + +.glyphicon-pencil:before { + content: "\270f"; +} + +.glyphicon-map-marker:before { + content: "\e062"; +} + +.glyphicon-adjust:before { + content: "\e063"; +} + +.glyphicon-tint:before { + content: "\e064"; +} + +.glyphicon-edit:before { + content: "\e065"; +} + +.glyphicon-share:before { + content: "\e066"; +} + +.glyphicon-check:before { + content: "\e067"; +} + +.glyphicon-move:before { + content: "\e068"; +} + +.glyphicon-step-backward:before { + content: "\e069"; +} + +.glyphicon-fast-backward:before { + content: "\e070"; +} + +.glyphicon-backward:before { + content: "\e071"; +} + +.glyphicon-play:before { + content: "\e072"; +} + +.glyphicon-pause:before { + content: "\e073"; +} + +.glyphicon-stop:before { + content: "\e074"; +} + +.glyphicon-forward:before { + content: "\e075"; +} + +.glyphicon-fast-forward:before { + content: "\e076"; +} + +.glyphicon-step-forward:before { + content: "\e077"; +} + +.glyphicon-eject:before { + content: "\e078"; +} + +.glyphicon-chevron-left:before { + content: "\e079"; +} + +.glyphicon-chevron-right:before { + content: "\e080"; +} + +.glyphicon-plus-sign:before { + content: "\e081"; +} + +.glyphicon-minus-sign:before { + content: "\e082"; +} + +.glyphicon-remove-sign:before { + content: "\e083"; +} + +.glyphicon-ok-sign:before { + content: "\e084"; +} + +.glyphicon-question-sign:before { + content: "\e085"; +} + +.glyphicon-info-sign:before { + content: "\e086"; +} + +.glyphicon-screenshot:before { + content: "\e087"; +} + +.glyphicon-remove-circle:before { + content: "\e088"; +} + +.glyphicon-ok-circle:before { + content: "\e089"; +} + +.glyphicon-ban-circle:before { + content: "\e090"; +} + +.glyphicon-arrow-left:before { + content: "\e091"; +} + +.glyphicon-arrow-right:before { + content: "\e092"; +} + +.glyphicon-arrow-up:before { + content: "\e093"; +} + +.glyphicon-arrow-down:before { + content: "\e094"; +} + +.glyphicon-share-alt:before { + content: "\e095"; +} + +.glyphicon-resize-full:before { + content: "\e096"; +} + +.glyphicon-resize-small:before { + content: "\e097"; +} + +.glyphicon-plus:before { + content: "\002b"; +} + +.glyphicon-minus:before { + content: "\2212"; +} + +.glyphicon-asterisk:before { + content: "\002a"; +} + +.glyphicon-exclamation-sign:before { + content: "\e101"; +} + +.glyphicon-gift:before { + content: "\e102"; +} + +.glyphicon-leaf:before { + content: "\e103"; +} + +.glyphicon-fire:before { + content: "\e104"; +} + +.glyphicon-eye-open:before { + content: "\e105"; +} + +.glyphicon-eye-close:before { + content: "\e106"; +} + +.glyphicon-warning-sign:before { + content: "\e107"; +} + +.glyphicon-plane:before { + content: "\e108"; +} + +.glyphicon-calendar:before { + content: "\e109"; +} + +.glyphicon-random:before { + content: "\e110"; +} + +.glyphicon-comment:before { + content: "\e111"; +} + +.glyphicon-magnet:before { + content: "\e112"; +} + +.glyphicon-chevron-up:before { + content: "\e113"; +} + +.glyphicon-chevron-down:before { + content: "\e114"; +} + +.glyphicon-retweet:before { + content: "\e115"; +} + +.glyphicon-shopping-cart:before { + content: "\e116"; +} + +.glyphicon-folder-close:before { + content: "\e117"; +} + +.glyphicon-folder-open:before { + content: "\e118"; +} + +.glyphicon-resize-vertical:before { + content: "\e119"; +} + +.glyphicon-resize-horizontal:before { + content: "\e120"; +} + +.glyphicon-hdd:before { + content: "\e121"; +} + +.glyphicon-bullhorn:before { + content: "\e122"; +} + +.glyphicon-bell:before { + content: "\e123"; +} + +.glyphicon-certificate:before { + content: "\e124"; +} + +.glyphicon-thumbs-up:before { + content: "\e125"; +} + +.glyphicon-thumbs-down:before { + content: "\e126"; +} + +.glyphicon-hand-right:before { + content: "\e127"; +} + +.glyphicon-hand-left:before { + content: "\e128"; +} + +.glyphicon-hand-up:before { + content: "\e129"; +} + +.glyphicon-hand-down:before { + content: "\e130"; +} + +.glyphicon-circle-arrow-right:before { + content: "\e131"; +} + +.glyphicon-circle-arrow-left:before { + content: "\e132"; +} + +.glyphicon-circle-arrow-up:before { + content: "\e133"; +} + +.glyphicon-circle-arrow-down:before { + content: "\e134"; +} + +.glyphicon-globe:before { + content: "\e135"; +} + +.glyphicon-wrench:before { + content: "\e136"; +} + +.glyphicon-tasks:before { + content: "\e137"; +} + +.glyphicon-filter:before { + content: "\e138"; +} + +.glyphicon-briefcase:before { + content: "\e139"; +} + +.glyphicon-fullscreen:before { + content: "\e140"; +} + +.glyphicon-dashboard:before { + content: "\e141"; +} + +.glyphicon-paperclip:before { + content: "\e142"; +} + +.glyphicon-heart-empty:before { + content: "\e143"; +} + +.glyphicon-link:before { + content: "\e144"; +} + +.glyphicon-phone:before { + content: "\e145"; +} + +.glyphicon-pushpin:before { + content: "\e146"; +} + +.glyphicon-euro:before { + content: "\20ac"; +} + +.glyphicon-usd:before { + content: "\e148"; +} + +.glyphicon-gbp:before { + content: "\e149"; +} + +.glyphicon-sort:before { + content: "\e150"; +} + +.glyphicon-sort-by-alphabet:before { + content: "\e151"; +} + +.glyphicon-sort-by-alphabet-alt:before { + content: "\e152"; +} + +.glyphicon-sort-by-order:before { + content: "\e153"; +} + +.glyphicon-sort-by-order-alt:before { + content: "\e154"; +} + +.glyphicon-sort-by-attributes:before { + content: "\e155"; +} + +.glyphicon-sort-by-attributes-alt:before { + content: "\e156"; +} + +.glyphicon-unchecked:before { + content: "\e157"; +} + +.glyphicon-expand:before { + content: "\e158"; +} + +.glyphicon-collapse:before { + content: "\e159"; +} + +.glyphicon-collapse-top:before { + content: "\e160"; +} + +.dropup, +.dropdown { + position: relative; +} + +.dropdown-toggle:active, +.open .dropdown-toggle { + outline: 0; +} + +.caret { + display: inline-block; + width: 0; + height: 0; + vertical-align: top; + border-top: 4px solid #000; + border-right: 4px solid transparent; + border-left: 4px solid transparent; + content: ""; +} + +.dropdown .caret { + margin-top: 8px; + margin-left: 2px; +} + +.dropdown-menu { + position: absolute; + top: 100%; + left: 0; + z-index: 1000; + display: none; + float: left; + min-width: 160px; + padding: 5px 0; + margin: 2px 0 0; + list-style: none; + background-color: #ffffff; + border: 1px solid #ccc; + border: 1px solid rgba(0, 0, 0, 0.2); + border-radius: 4px; + -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); + box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); + -webkit-background-clip: padding-box; + -moz-background-clip: padding-box; + background-clip: padding-box; +} + +.dropdown-menu.pull-right { + right: 0; + left: auto; +} + +.dropdown-menu .divider { + height: 1px; + margin: 9px 1px; + overflow: hidden; + background-color: #e5e5e5; + border-bottom: 1px solid #ffffff; +} + +.dropdown-menu > li > a { + display: block; + padding: 3px 20px; + clear: both; + font-weight: normal; + line-height: 20px; + color: #333333; + white-space: nowrap; +} + +.dropdown-menu li > a:hover, +.dropdown-menu li > a:focus { + color: #ffffff; + text-decoration: none; + background-color: #0077b3; + background-image: -moz-linear-gradient(top, #0088cc, #0077b3); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0077b3)); + background-image: -webkit-linear-gradient(top, #0088cc, #0077b3); + background-image: -o-linear-gradient(top, #0088cc, #0077b3); + background-image: linear-gradient(to bottom, #0088cc, #0077b3); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0077b3', GradientType=0); +} + +.dropdown-menu > .active > a, +.dropdown-menu > .active > a:hover { + color: #ffffff; + text-decoration: none; + background-color: #0077b3; + background-image: -moz-linear-gradient(top, #0088cc, #0077b3); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0077b3)); + background-image: -webkit-linear-gradient(top, #0088cc, #0077b3); + background-image: -o-linear-gradient(top, #0088cc, #0077b3); + background-image: linear-gradient(to bottom, #0088cc, #0077b3); + background-repeat: repeat-x; + outline: 0; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0077b3', GradientType=0); +} + +.dropdown-menu > .disabled > a, +.dropdown-menu > .disabled > a:hover { + color: #999999; +} + +.dropdown-menu > .disabled > a:hover { + text-decoration: none; + cursor: default; + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); +} + +.open > .dropdown-menu { + display: block; +} + +.pull-right > .dropdown-menu { + right: 0; + left: auto; +} + +.dropup .caret, +.navbar-fixed-bottom .dropdown .caret { + border-top: 0; + border-bottom: 4px solid #000; + content: ""; +} + +.dropup .dropdown-menu, +.navbar-fixed-bottom .dropdown .dropdown-menu { + top: auto; + bottom: 100%; + margin-bottom: 1px; +} + +.dropdown .dropdown-menu .nav-header { + padding-right: 20px; + padding-left: 20px; +} + +.typeahead { + z-index: 1051; +} + +.well { + min-height: 20px; + padding: 19px; + margin-bottom: 20px; + background-color: #f5f5f5; + border: 1px solid #e3e3e3; + border-radius: 4px; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); +} + +.well blockquote { + border-color: #ddd; + border-color: rgba(0, 0, 0, 0.15); +} + +.well-large { + padding: 24px; + border-radius: 6px; +} + +.well-small { + padding: 9px; + border-radius: 3px; +} + +.fade { + opacity: 0; + -webkit-transition: opacity 0.15s linear; + -moz-transition: opacity 0.15s linear; + -o-transition: opacity 0.15s linear; + transition: opacity 0.15s linear; +} + +.fade.in { + opacity: 1; +} + +.collapse { + position: relative; + height: 0; + overflow: hidden; + -webkit-transition: height 0.35s ease; + -moz-transition: height 0.35s ease; + -o-transition: height 0.35s ease; + transition: height 0.35s ease; +} + +.collapse.in { + height: auto; +} + +.close { + float: right; + font-size: 20px; + font-weight: bold; + line-height: 20px; + color: #000; + text-shadow: 0 1px 0 #ffffff; + opacity: 0.2; + filter: alpha(opacity=20); +} + +.close:hover { + color: #000; + text-decoration: none; + cursor: pointer; + opacity: 0.4; + filter: alpha(opacity=40); +} + +button.close { + padding: 0; + cursor: pointer; + background: transparent; + border: 0; + -webkit-appearance: none; +} + +.btn { + display: inline-block; + padding: 6px 13px; + margin-bottom: 0; + font-size: 14px; + line-height: 20px; + text-align: center; + vertical-align: middle; + cursor: pointer; + border: 1px solid #ccc; + border-radius: 4px; + -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25); + box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25); +} + +.btn:focus { + outline: thin dotted #333; + outline: 5px auto -webkit-focus-ring-color; + outline-offset: -2px; +} + +.btn:hover { + text-decoration: none; +} + +.btn:active, +.btn.active { + background-image: none; + outline: 0; + -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125), 0 1px 0 rgba(255, 255, 255, 0.1); + box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125), 0 1px 0 rgba(255, 255, 255, 0.1); +} + +.btn.disabled, +.btn[disabled], +fieldset[disabled] .btn { + cursor: default; + opacity: 0.65; + filter: alpha(opacity=65); + -webkit-box-shadow: none; + box-shadow: none; +} + +.btn-large { + padding: 11px 19px; + font-size: 17.5px; + border-radius: 6px; +} + +.btn-small { + padding: 2px 10px; + font-size: 11.9px; + border-radius: 3px; +} + +.btn-mini [class^="icon-"], +.btn-mini [class*=" icon-"] { + margin-top: -1px; +} + +.btn-mini { + padding: 0 6px; + font-size: 10.5px; + border-radius: 3px; +} + +.btn [class^="glyphicon-"]::before { + vertical-align: -2px; +} + +.btn-small [class^="glyphicon-"]::before, +.btn-mini [class^="glyphicon-"]::before { + vertical-align: -1px; +} + +.btn-block { + display: block; + width: 100%; + padding-right: 0; + padding-left: 0; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} + +.btn-block + .btn-block { + margin-top: 5px; +} + +input[type="submit"].btn-block, +input[type="reset"].btn-block, +input[type="button"].btn-block { + width: 100%; +} + +.btn { + color: #555555; + text-shadow: 0 1px 0 rgba(255, 255, 255, 0.75); + background-color: #eaeaea; + background-image: -moz-linear-gradient(top, #ffffff, #eaeaea); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#eaeaea)); + background-image: -webkit-linear-gradient(top, #ffffff, #eaeaea); + background-image: -o-linear-gradient(top, #ffffff, #eaeaea); + background-image: linear-gradient(to bottom, #ffffff, #eaeaea); + background-repeat: repeat-x; + border-color: #d7d7d7; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffeaeaea', GradientType=0); +} + +.btn:hover, +.btn:active, +.btn.active { + color: #555555; + background-color: #eaeaea; + background-position: 0 -15px; +} + +.btn:active, +.btn.active, +.btn[disabled], +.btn.disabled, +fieldset[disabled] .btn { + background-image: none; +} + +.btn-primary { + color: #ffffff; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + background-color: #006699; + background-image: -moz-linear-gradient(top, #0088cc, #006699); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#006699)); + background-image: -webkit-linear-gradient(top, #0088cc, #006699); + background-image: -o-linear-gradient(top, #0088cc, #006699); + background-image: linear-gradient(to bottom, #0088cc, #006699); + background-repeat: repeat-x; + border-color: #004c73; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff006699', GradientType=0); +} + +.btn-primary:hover, +.btn-primary:active, +.btn-primary.active { + color: #ffffff; + background-color: #006699; + background-position: 0 -15px; +} + +.btn-primary:active, +.btn-primary.active, +.btn-primary[disabled], +.btn-primary.disabled, +fieldset[disabled] .btn-primary { + background-image: none; +} + +.btn-warning { + color: #ffffff; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + background-color: #f89406; + background-image: -moz-linear-gradient(top, #fbb450, #f89406); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#fbb450), to(#f89406)); + background-image: -webkit-linear-gradient(top, #fbb450, #f89406); + background-image: -o-linear-gradient(top, #fbb450, #f89406); + background-image: linear-gradient(to bottom, #fbb450, #f89406); + background-repeat: repeat-x; + border-color: #d37e05; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffbb450', endColorstr='#fff89406', GradientType=0); +} + +.btn-warning:hover, +.btn-warning:active, +.btn-warning.active { + color: #ffffff; + background-color: #f89406; + background-position: 0 -15px; +} + +.btn-warning:active, +.btn-warning.active, +.btn-warning[disabled], +.btn-warning.disabled, +fieldset[disabled] .btn-warning { + background-image: none; +} + +.btn-danger { + color: #ffffff; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + background-color: #bd362f; + background-image: -moz-linear-gradient(top, #ee5f5b, #bd362f); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ee5f5b), to(#bd362f)); + background-image: -webkit-linear-gradient(top, #ee5f5b, #bd362f); + background-image: -o-linear-gradient(top, #ee5f5b, #bd362f); + background-image: linear-gradient(to bottom, #ee5f5b, #bd362f); + background-repeat: repeat-x; + border-color: #9e2d27; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffee5f5b', endColorstr='#ffbd362f', GradientType=0); +} + +.btn-danger:hover, +.btn-danger:active, +.btn-danger.active { + color: #ffffff; + background-color: #bd362f; + background-position: 0 -15px; +} + +.btn-danger:active, +.btn-danger.active, +.btn-danger[disabled], +.btn-danger.disabled, +fieldset[disabled] .btn-danger { + background-image: none; +} + +.btn-success { + color: #ffffff; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + background-color: #51a351; + background-image: -moz-linear-gradient(top, #62c462, #51a351); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#62c462), to(#51a351)); + background-image: -webkit-linear-gradient(top, #62c462, #51a351); + background-image: -o-linear-gradient(top, #62c462, #51a351); + background-image: linear-gradient(to bottom, #62c462, #51a351); + background-repeat: repeat-x; + border-color: #448944; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff62c462', endColorstr='#ff51a351', GradientType=0); +} + +.btn-success:hover, +.btn-success:active, +.btn-success.active { + color: #ffffff; + background-color: #51a351; + background-position: 0 -15px; +} + +.btn-success:active, +.btn-success.active, +.btn-success[disabled], +.btn-success.disabled, +fieldset[disabled] .btn-success { + background-image: none; +} + +.btn-link, +.btn-link:active, +.btn-link[disabled], +fieldset[disabled] .btn-link { + background-color: transparent; + background-image: none; + -webkit-box-shadow: none; + box-shadow: none; +} + +.btn-link { + color: #0088cc; + cursor: pointer; + border-color: transparent; + border-radius: 0; +} + +.btn-link:hover { + color: #005580; + text-decoration: underline; + background-color: transparent; +} + +.btn-link[disabled]:hover, +fieldset[disabled] .btn-link:hover { + color: #333333; + text-decoration: none; +} + +.btn-group { + position: relative; + display: inline-block; + font-size: 0; + white-space: nowrap; + vertical-align: middle; +} + +.btn-group + .btn-group { + margin-left: 5px; +} + +.btn-toolbar { + margin-top: 10px; + margin-bottom: 10px; + font-size: 0; +} + +.btn-toolbar > .btn + .btn, +.btn-toolbar > .btn-group + .btn, +.btn-toolbar > .btn + .btn-group { + margin-left: 5px; +} + +.btn-group > .btn { + position: relative; + border-radius: 0; +} + +.btn-group > .btn + .btn { + margin-left: -1px; +} + +.btn-group > .btn, +.btn-group > .dropdown-menu, +.btn-group > .popover { + font-size: 14px; +} + +.btn-group > .btn-mini { + font-size: 10.5px; +} + +.btn-group > .btn-small { + font-size: 11.9px; +} + +.btn-group > .btn-large { + font-size: 17.5px; +} + +.btn-group > .btn:first-child { + margin-left: 0; + border-bottom-left-radius: 4px; + border-top-left-radius: 4px; +} + +.btn-group > .btn:last-child, +.btn-group > .dropdown-toggle { + border-top-right-radius: 4px; + border-bottom-right-radius: 4px; +} + +.btn-group > .btn.large:first-child { + margin-left: 0; + border-bottom-left-radius: 6px; + border-top-left-radius: 6px; +} + +.btn-group > .btn.large:last-child, +.btn-group > .large.dropdown-toggle { + border-top-right-radius: 6px; + border-bottom-right-radius: 6px; +} + +.btn-group > .btn:hover, +.btn-group > .btn:focus, +.btn-group > .btn:active, +.btn-group > .btn.active { + z-index: 2; +} + +.btn-group .dropdown-toggle:active, +.btn-group.open .dropdown-toggle { + outline: 0; +} + +.btn-group > .btn + .dropdown-toggle { + padding-right: 8px; + padding-left: 8px; + -webkit-box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.125), inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); + box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.125), inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); +} + +.btn-group > .btn-mini + .dropdown-toggle { + padding-right: 5px; + padding-left: 5px; +} + +.btn-group > .btn-large + .dropdown-toggle { + padding-right: 12px; + padding-left: 12px; +} + +.btn-group.open .dropdown-toggle { + background-image: none; + -webkit-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05); + box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05); +} + +.btn-group.open .btn.dropdown-toggle { + background-color: #eaeaea; +} + +.btn-group.open .btn-primary.dropdown-toggle { + background-color: #006699; +} + +.btn-group.open .btn-warning.dropdown-toggle { + background-color: #f89406; +} + +.btn-group.open .btn-danger.dropdown-toggle { + background-color: #bd362f; +} + +.btn-group.open .btn-success.dropdown-toggle { + background-color: #51a351; +} + +.btn .caret { + margin-top: 8px; + margin-left: 0; +} + +.btn-large .caret { + margin-top: 6px; +} + +.btn-large .caret { + border-top-width: 5px; + border-right-width: 5px; + border-left-width: 5px; +} + +.btn-mini .caret, +.btn-small .caret { + margin-top: 8px; +} + +.dropup .btn-large .caret { + border-bottom-width: 5px; +} + +.btn-primary .caret, +.btn-warning .caret, +.btn-danger .caret, +.btn-info .caret, +.btn-success .caret, +.btn-inverse .caret { + border-top-color: #fff; + border-bottom-color: #fff; +} + +.btn-group-vertical { + display: inline-block; +} + +.btn-group-vertical > .btn { + display: block; + float: none; + max-width: 100%; + border-radius: 0; +} + +.btn-group-vertical > .btn + .btn { + margin-top: -1px; + margin-left: 0; +} + +.btn-group-vertical .btn:first-child { + border-radius: 4px 4px 0 0; +} + +.btn-group-vertical .btn:last-child { + border-radius: 0 0 4px 4px; +} + +.btn-group-vertical .btn-large:first-child { + border-radius: 6px 6px 0 0; +} + +.btn-group-vertical .btn-large:last-child { + border-radius: 0 0 6px 6px; +} + +.alert { + padding: 8px 35px 8px 14px; + margin-bottom: 20px; + text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); + background-color: #fcf8e3; + border: 1px solid #fbeed5; + border-radius: 4px; +} + +.alert, +.alert h4 { + color: #c09853; +} + +.alert h4 { + margin: 0; +} + +.alert .close { + position: relative; + top: -2px; + right: -21px; + line-height: 20px; +} + +.alert-success { + color: #468847; + background-color: #dff0d8; + border-color: #d6e9c6; +} + +.alert-success h4 { + color: #468847; +} + +.alert-danger, +.alert-error { + color: #b94a48; + background-color: #f2dede; + border-color: #eed3d7; +} + +.alert-danger h4, +.alert-error h4 { + color: #b94a48; +} + +.alert-info { + color: #3a87ad; + background-color: #d9edf7; + border-color: #bce8f1; +} + +.alert-info h4 { + color: #3a87ad; +} + +.alert-block { + padding-top: 14px; + padding-bottom: 14px; +} + +.alert-block > p, +.alert-block > ul { + margin-bottom: 0; +} + +.alert-block p + p { + margin-top: 5px; +} + +.nav { + margin-bottom: 20px; + margin-left: 0; + list-style: none; +} + +.nav:before, +.nav:after { + display: table; + content: " "; +} + +.nav:after { + clear: both; +} + +.nav > li { + float: left; +} + +.nav > li > a { + display: block; + padding: 8px 12px; +} + +.nav > li > a:hover { + text-decoration: none; + background-color: #eeeeee; +} + +.nav > li > a > img { + max-width: none; +} + +.nav > .pull-right { + float: right; +} + +.nav-header { + display: block; + padding: 3px 15px; + font-size: 11px; + font-weight: bold; + line-height: 20px; + color: #999999; + text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); + text-transform: uppercase; +} + +.nav li + .nav-header { + margin-top: 9px; +} + +.nav .divider { + height: 1px; + margin: 9px 1px; + overflow: hidden; + background-color: #e5e5e5; + border-bottom: 1px solid #ffffff; +} + +.nav-tabs { + border-bottom: 1px solid #ddd; +} + +.nav-tabs > li { + margin-bottom: -1px; +} + +.nav-tabs > li > a { + margin-right: 2px; + line-height: 20px; + border: 1px solid transparent; + border-radius: 4px 4px 0 0; +} + +.nav-tabs > li > a:hover { + border-color: #eeeeee #eeeeee #dddddd; +} + +.nav-tabs > .active > a, +.nav-tabs > .active > a:hover { + color: #555555; + cursor: default; + background-color: #ffffff; + border: 1px solid #ddd; + border-bottom-color: transparent; +} + +.nav-pills > li > a { + border-radius: 5px; +} + +.nav-pills > li + li > a { + margin-left: 2px; +} + +.nav-pills > .active > a, +.nav-pills > .active > a:hover { + color: #fff; + background-color: #0088cc; +} + +.nav-stacked > li { + float: none; +} + +.nav-stacked > li + li > a { + margin-top: 2px; + margin-left: 0; +} + +.nav-justified { + max-height: 37px; +} + +.nav-justified > li { + display: table-cell; + float: none; + width: 1%; + text-align: center; +} + +.nav-list { + background-color: #fff; + border-radius: 6px; + -webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.065); + box-shadow: 0 1px 4px rgba(0, 0, 0, 0.065); +} + +.nav-list > li { + float: none; +} + +.nav-list > li > a { + margin-bottom: -1px; + border: 1px solid #e5e5e5; +} + +.nav-list > li > a:hover { + background-color: #f5f5f5; +} + +.nav-list > li:first-child > a { + border-radius: 6px 6px 0 0; +} + +.nav-list > li:last-child > a { + border-radius: 0 0 6px 6px; +} + +.nav-list > .active > a, +.nav-list > .active > a:hover { + position: relative; + z-index: 2; + padding: 9px 15px; + color: #fff; + text-shadow: 0 1px 0 rgba(0, 0, 0, 0.15); + background-color: #0088cc; + border-width: 0; + -webkit-box-shadow: inset 1px 0 0 rgba(0, 0, 0, 0.1), inset -1px 0 0 rgba(0, 0, 0, 0.1); + box-shadow: inset 1px 0 0 rgba(0, 0, 0, 0.1), inset -1px 0 0 rgba(0, 0, 0, 0.1); +} + +.nav-tabs .dropdown-menu { + border-top-right-radius: 0; + border-top-left-radius: 0; +} + +.nav .dropdown-toggle .caret { + margin-top: 8px; + border-top-color: #0088cc; + border-bottom-color: #0088cc; +} + +.nav .dropdown-toggle:hover .caret { + border-top-color: #005580; + border-bottom-color: #005580; +} + +.nav .active .dropdown-toggle .caret { + border-top-color: #fff; + border-bottom-color: #fff; +} + +.nav-tabs .active .dropdown-toggle .caret { + border-top-color: #555555; + border-bottom-color: #555555; +} + +.nav > .dropdown.active > a:hover { + cursor: pointer; +} + +.nav-tabs .open .dropdown-toggle, +.nav-pills .open .dropdown-toggle, +.nav > li.dropdown.open.active > a:hover { + color: #fff; + background-color: #999999; + border-color: #999999; +} + +.nav li.dropdown.open .caret, +.nav li.dropdown.open.active .caret, +.nav li.dropdown.open a:hover .caret { + border-top-color: #fff; + border-bottom-color: #fff; + opacity: 1; + filter: alpha(opacity=100); +} + +.tabs-stacked .open > a:hover { + border-color: #999999; +} + +.tabbable:before, +.tabbable:after { + display: table; + content: " "; +} + +.tabbable:after { + clear: both; +} + +.tab-content { + overflow: auto; +} + +.tab-content > .tab-pane, +.pill-content > .pill-pane { + display: none; +} + +.tab-content > .active, +.pill-content > .active { + display: block; +} + +.nav > .disabled > a { + color: #999999; +} + +.nav > .disabled > a:hover { + text-decoration: none; + cursor: default; + background-color: transparent; +} + +.navbar { + padding: 0 20px; + margin-bottom: 20px; + overflow: visible; + background-color: #f2f2f2; + background-image: -moz-linear-gradient(top, #ffffff, #f2f2f2); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#f2f2f2)); + background-image: -webkit-linear-gradient(top, #ffffff, #f2f2f2); + background-image: -o-linear-gradient(top, #ffffff, #f2f2f2); + background-image: linear-gradient(to bottom, #ffffff, #f2f2f2); + background-repeat: repeat-x; + border: 1px solid #d4d4d4; + border-radius: 4px; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#fff2f2f2', GradientType=0); + -webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.065); + box-shadow: 0 1px 4px rgba(0, 0, 0, 0.065); +} + +.navbar:before, +.navbar:after { + display: table; + content: " "; +} + +.navbar:after { + clear: both; +} + +.navbar .container { + width: auto; +} + +.nav-collapse.collapse { + height: auto; + overflow: visible; +} + +.navbar .brand { + display: block; + float: left; + padding: 12px 20px 12px; + margin-left: -20px; + font-size: 20px; + font-weight: 200; + color: #777777; + text-shadow: 0 1px 0 #ffffff; +} + +.navbar .brand:hover { + text-decoration: none; +} + +.navbar-text { + margin-bottom: 0; + line-height: 44px; + color: #777777; +} + +.navbar-link { + color: #777777; +} + +.navbar-link:hover { + color: #333333; +} + +.navbar .divider-vertical { + height: 44px; + margin: 0 9px; + border-right: 1px solid #ffffff; + border-left: 1px solid #f2f2f2; +} + +.navbar .btn, +.navbar .btn-group { + margin-top: 7px; +} + +.navbar .btn-group .btn, +.navbar .input-prepend .btn, +.navbar .input-append .btn { + margin-top: 0; +} + +.navbar-form { + margin-bottom: 0; +} + +.navbar-form:before, +.navbar-form:after { + display: table; + content: " "; +} + +.navbar-form:after { + clear: both; +} + +.navbar-form input, +.navbar-form select, +.navbar-form .radio, +.navbar-form .checkbox { + margin-top: 7px; +} + +.navbar-form input, +.navbar-form select, +.navbar-form .btn { + display: inline-block; + margin-bottom: 0; +} + +.navbar-form input[type="image"], +.navbar-form input[type="checkbox"], +.navbar-form input[type="radio"] { + margin-top: 3px; +} + +.navbar-form .input-append, +.navbar-form .input-prepend { + margin-top: 5px; + white-space: nowrap; +} + +.navbar-form .input-append input, +.navbar-form .input-prepend input { + margin-top: 0; +} + +.navbar-search { + position: relative; + float: left; + margin-top: 7px; + margin-bottom: 0; +} + +.navbar-search .search-query { + padding: 4px 14px; + margin-bottom: 0; + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 13px; + font-weight: normal; + line-height: 1; + border-radius: 15px; +} + +.navbar-static-top { + position: static; + margin-bottom: 0; + border-radius: 0; +} + +.navbar-fixed-top, +.navbar-fixed-bottom { + position: fixed; + right: 0; + left: 0; + z-index: 1030; + padding-right: 0; + padding-left: 0; + margin-bottom: 0; + border-width: 0 0 1px; + border-radius: 0; +} + +.navbar-fixed-bottom { + border-width: 1px 0 0; +} + +.navbar-static-top .container, +.navbar-fixed-top .container, +.navbar-fixed-bottom .container { + width: 100%; +} + +.navbar-fixed-top { + top: 0; +} + +.navbar-fixed-top, +.navbar-static-top { + -webkit-box-shadow: 0 1px 10px rgba(0, 0, 0, 0.1); + box-shadow: 0 1px 10px rgba(0, 0, 0, 0.1); +} + +.navbar-fixed-bottom { + bottom: 0; + -webkit-box-shadow: 0 -1px 10px rgba(0, 0, 0, 0.1); + box-shadow: 0 -1px 10px rgba(0, 0, 0, 0.1); +} + +.navbar .nav { + position: relative; + left: 0; + display: block; + float: left; + margin: 0 10px 0 0; +} + +.navbar .nav.pull-right { + float: right; + margin-right: 0; +} + +.navbar .nav > li { + float: left; +} + +.navbar .nav > li > a { + float: none; + padding: 12px 15px 12px; + color: #777777; + text-decoration: none; + text-shadow: 0 1px 0 #ffffff; +} + +.navbar .nav .dropdown-toggle .caret { + margin-top: 8px; +} + +.navbar .nav > li > a:focus, +.navbar .nav > li > a:hover { + color: #333333; + text-decoration: none; + background-color: transparent; +} + +.navbar .nav > .active > a, +.navbar .nav > .active > a:hover, +.navbar .nav > .active > a:focus { + color: #555555; + text-decoration: none; + background-color: #e5e5e5; + -webkit-box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.125); + box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.125); +} + +.navbar .btn-navbar { + display: none; + float: right; + padding: 7px 10px; + margin-right: 5px; + margin-left: 5px; + color: #ffffff; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + background-color: #e5e5e5; + background-image: -moz-linear-gradient(top, #f2f2f2, #e5e5e5); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#f2f2f2), to(#e5e5e5)); + background-image: -webkit-linear-gradient(top, #f2f2f2, #e5e5e5); + background-image: -o-linear-gradient(top, #f2f2f2, #e5e5e5); + background-image: linear-gradient(to bottom, #f2f2f2, #e5e5e5); + background-repeat: repeat-x; + border-color: #d2d2d2; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2f2f2', endColorstr='#ffe5e5e5', GradientType=0); + -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.075); + box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.075); +} + +.navbar .btn-navbar:hover, +.navbar .btn-navbar:active, +.navbar .btn-navbar.active { + color: #ffffff; + background-color: #e5e5e5; + background-position: 0 -15px; +} + +.navbar .btn-navbar:active, +.navbar .btn-navbar.active, +.navbar .btn-navbar[disabled], +.navbar .btn-navbar.disabled, +fieldset[disabled] .navbar .btn-navbar { + background-image: none; +} + +.navbar .btn-navbar .icon-bar { + display: block; + width: 18px; + height: 2px; + background-color: #f5f5f5; + border-radius: 1px; + -webkit-box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25); + box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25); +} + +.btn-navbar .icon-bar + .icon-bar { + margin-top: 3px; +} + +.navbar .nav > li > .dropdown-menu:before { + position: absolute; + top: -7px; + left: 9px; + display: inline-block; + border-right: 7px solid transparent; + border-bottom: 7px solid #ccc; + border-left: 7px solid transparent; + border-bottom-color: rgba(0, 0, 0, 0.2); + content: ''; +} + +.navbar .nav > li > .dropdown-menu:after { + position: absolute; + top: -6px; + left: 10px; + display: inline-block; + border-right: 6px solid transparent; + border-bottom: 6px solid #ffffff; + border-left: 6px solid transparent; + content: ''; +} + +.navbar-fixed-bottom .nav > li > .dropdown-menu:before { + top: auto; + bottom: -7px; + border-top: 7px solid #ccc; + border-bottom: 0; + border-top-color: rgba(0, 0, 0, 0.2); +} + +.navbar-fixed-bottom .nav > li > .dropdown-menu:after { + top: auto; + bottom: -6px; + border-top: 6px solid #ffffff; + border-bottom: 0; +} + +.navbar .nav li.dropdown > a:hover .caret { + border-top-color: #555555; + border-bottom-color: #555555; +} + +.navbar .nav li.dropdown.open > .dropdown-toggle, +.navbar .nav li.dropdown.active > .dropdown-toggle, +.navbar .nav li.dropdown.open.active > .dropdown-toggle { + color: #555555; + background-color: #e5e5e5; +} + +.navbar .nav li.dropdown > .dropdown-toggle .caret { + border-top-color: #777777; + border-bottom-color: #777777; +} + +.navbar .nav li.dropdown.open > .dropdown-toggle .caret, +.navbar .nav li.dropdown.active > .dropdown-toggle .caret, +.navbar .nav li.dropdown.open.active > .dropdown-toggle .caret { + border-top-color: #555555; + border-bottom-color: #555555; +} + +.navbar .pull-right > li > .dropdown-menu, +.navbar .nav > li > .dropdown-menu.pull-right { + right: 0; + left: auto; +} + +.navbar .pull-right > li > .dropdown-menu:before, +.navbar .nav > li > .dropdown-menu.pull-right:before { + right: 12px; + left: auto; +} + +.navbar .pull-right > li > .dropdown-menu:after, +.navbar .nav > li > .dropdown-menu.pull-right:after { + right: 13px; + left: auto; +} + +.navbar .pull-right > li > .dropdown-menu .dropdown-menu, +.navbar .nav > li > .dropdown-menu.pull-right .dropdown-menu { + right: 100%; + left: auto; + margin-right: -1px; + margin-left: 0; + border-radius: 6px 0 6px 6px; +} + +.navbar-inverse { + background-color: #111111; + background-image: -moz-linear-gradient(top, #222222, #111111); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#222222), to(#111111)); + background-image: -webkit-linear-gradient(top, #222222, #111111); + background-image: -o-linear-gradient(top, #222222, #111111); + background-image: linear-gradient(to bottom, #222222, #111111); + background-repeat: repeat-x; + border-color: #111111; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff222222', endColorstr='#ff111111', GradientType=0); +} + +.navbar-inverse .brand, +.navbar-inverse .nav > li > a { + color: #999999; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); +} + +.navbar-inverse .brand:hover, +.navbar-inverse .nav > li > a:hover { + color: #ffffff; +} + +.navbar-inverse .brand { + color: #999999; +} + +.navbar-inverse .navbar-text { + color: #999999; +} + +.navbar-inverse .nav > li > a:focus, +.navbar-inverse .nav > li > a:hover { + color: #ffffff; + background-color: transparent; +} + +.navbar-inverse .nav .active > a, +.navbar-inverse .nav .active > a:hover, +.navbar-inverse .nav .active > a:focus { + color: #ffffff; + background-color: #111111; +} + +.navbar-inverse .navbar-link { + color: #999999; +} + +.navbar-inverse .navbar-link:hover { + color: #ffffff; +} + +.navbar-inverse .divider-vertical { + border-right-color: #222222; + border-left-color: #111111; +} + +.navbar-inverse .nav li.dropdown.open > .dropdown-toggle, +.navbar-inverse .nav li.dropdown.active > .dropdown-toggle, +.navbar-inverse .nav li.dropdown.open.active > .dropdown-toggle { + color: #ffffff; + background-color: #111111; +} + +.navbar-inverse .nav li.dropdown > a:hover .caret { + border-top-color: #ffffff; + border-bottom-color: #ffffff; +} + +.navbar-inverse .nav li.dropdown > .dropdown-toggle .caret { + border-top-color: #999999; + border-bottom-color: #999999; +} + +.navbar-inverse .nav li.dropdown.open > .dropdown-toggle .caret, +.navbar-inverse .nav li.dropdown.active > .dropdown-toggle .caret, +.navbar-inverse .nav li.dropdown.open.active > .dropdown-toggle .caret { + border-top-color: #ffffff; + border-bottom-color: #ffffff; +} + +.navbar-inverse .navbar-search .search-query { + color: #fff; + background-color: #515151; + border-color: #111111; + -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 0 rgba(255, 255, 255, 0.15); + box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 0 rgba(255, 255, 255, 0.15); + -webkit-transition: none; + -moz-transition: none; + -o-transition: none; + transition: none; +} + +.navbar-inverse .navbar-search .search-query:-moz-placeholder { + color: #cccccc; +} + +.navbar-inverse .navbar-search .search-query:-ms-input-placeholder { + color: #cccccc; +} + +.navbar-inverse .navbar-search .search-query::-webkit-input-placeholder { + color: #cccccc; +} + +.navbar-inverse .navbar-search .search-query:focus, +.navbar-inverse .navbar-search .search-query.focused { + padding: 5px 15px; + color: #333333; + text-shadow: 0 1px 0 #fff; + background-color: #ffffff; + border: 0; + outline: 0; + -webkit-box-shadow: 0 0 3px rgba(0, 0, 0, 0.15); + box-shadow: 0 0 3px rgba(0, 0, 0, 0.15); +} + +.navbar-inverse .btn-navbar { + color: #ffffff; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + background-color: #040404; + background-image: -moz-linear-gradient(top, #151515, #040404); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#151515), to(#040404)); + background-image: -webkit-linear-gradient(top, #151515, #040404); + background-image: -o-linear-gradient(top, #151515, #040404); + background-image: linear-gradient(to bottom, #151515, #040404); + background-repeat: repeat-x; + border-color: #000000; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff151515', endColorstr='#ff040404', GradientType=0); +} + +.navbar-inverse .btn-navbar:hover, +.navbar-inverse .btn-navbar:active, +.navbar-inverse .btn-navbar.active { + color: #ffffff; + background-color: #040404; + background-position: 0 -15px; +} + +.navbar-inverse .btn-navbar:active, +.navbar-inverse .btn-navbar.active, +.navbar-inverse .btn-navbar[disabled], +.navbar-inverse .btn-navbar.disabled, +fieldset[disabled] .navbar-inverse .btn-navbar { + background-image: none; +} + +.breadcrumb { + padding: 8px 15px; + margin: 0 0 20px; + list-style: none; + background-color: #f5f5f5; + border-radius: 4px; +} + +.breadcrumb > li { + display: inline-block; + text-shadow: 0 1px 0 #fff; +} + +.breadcrumb > li:after { + display: inline-block; + padding: 0 5px; + color: #ccc; + content: "\00a0 /"; +} + +.breadcrumb > .active { + color: #999999; +} + +.pagination { + margin: 20px 0; +} + +.pagination ul { + display: inline-block; + margin-bottom: 0; + margin-left: 0; + border-radius: 4px; + -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); + box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); +} + +.pagination ul > li { + display: inline; +} + +.pagination ul > li > a, +.pagination ul > li > span { + float: left; + padding: 4px 12px; + line-height: 20px; + text-decoration: none; + background-color: #ffffff; + border: 1px solid #dddddd; + border-left-width: 0; +} + +.pagination ul > li > a:hover, +.pagination ul > .active > a, +.pagination ul > .active > span { + background-color: #f5f5f5; +} + +.pagination ul > .active > a, +.pagination ul > .active > span { + color: #999999; + cursor: default; +} + +.pagination ul > .disabled > span, +.pagination ul > .disabled > a, +.pagination ul > .disabled > a:hover { + color: #999999; + cursor: default; + background-color: transparent; +} + +.pagination ul > li:first-child > a, +.pagination ul > li:first-child > span { + border-left-width: 1px; + border-bottom-left-radius: 4px; + border-top-left-radius: 4px; +} + +.pagination ul > li:last-child > a, +.pagination ul > li:last-child > span { + border-top-right-radius: 4px; + border-bottom-right-radius: 4px; +} + +.pagination-centered { + text-align: center; +} + +.pagination-right { + text-align: right; +} + +.pagination-large ul > li > a, +.pagination-large ul > li > span { + padding: 11px 19px; + font-size: 17.5px; +} + +.pagination-large ul > li:first-child > a, +.pagination-large ul > li:first-child > span { + border-bottom-left-radius: 6px; + border-top-left-radius: 6px; +} + +.pagination-large ul > li:last-child > a, +.pagination-large ul > li:last-child > span { + border-top-right-radius: 6px; + border-bottom-right-radius: 6px; +} + +.pagination-mini ul > li:first-child > a, +.pagination-small ul > li:first-child > a, +.pagination-mini ul > li:first-child > span, +.pagination-small ul > li:first-child > span { + border-bottom-left-radius: 3px; + border-top-left-radius: 3px; +} + +.pagination-mini ul > li:last-child > a, +.pagination-small ul > li:last-child > a, +.pagination-mini ul > li:last-child > span, +.pagination-small ul > li:last-child > span { + border-top-right-radius: 3px; + border-bottom-right-radius: 3px; +} + +.pagination-small ul > li > a, +.pagination-small ul > li > span { + padding: 2px 10px; + font-size: 11.9px; +} + +.pagination-mini ul > li > a, +.pagination-mini ul > li > span { + padding: 0 6px; + font-size: 10.5px; +} + +.pager { + margin: 20px 0; + text-align: center; + list-style: none; +} + +.pager:before, +.pager:after { + display: table; + content: " "; +} + +.pager:after { + clear: both; +} + +.pager li { + display: inline; +} + +.pager li > a, +.pager li > span { + display: inline-block; + padding: 5px 14px; + background-color: #fff; + border: 1px solid #ddd; + border-radius: 15px; +} + +.pager li > a:hover { + text-decoration: none; + background-color: #f5f5f5; +} + +.pager .next > a, +.pager .next > span { + float: right; +} + +.pager .previous > a, +.pager .previous > span { + float: left; +} + +.pager .disabled > a, +.pager .disabled > a:hover, +.pager .disabled > span { + color: #999999; + cursor: default; + background-color: #fff; +} + +.modal-backdrop { + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; + z-index: 1040; + background-color: #000; +} + +.modal-backdrop.fade { + opacity: 0; +} + +.modal-backdrop, +.modal-backdrop.fade.in { + opacity: 0.8; + filter: alpha(opacity=80); +} + +.modal { + position: fixed; + top: 10%; + left: 50%; + z-index: 1050; + display: none; + width: 560px; + margin-left: -280px; + background-color: #fff; + border: 1px solid #999; + border: 1px solid rgba(0, 0, 0, 0.3); + border-radius: 6px; + outline: none; + -webkit-box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3); + box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3); + -webkit-background-clip: padding-box; + -moz-background-clip: padding-box; + background-clip: padding-box; +} + +.modal.fade { + top: -25%; + -webkit-transition: opacity 0.3s linear, top 0.3s ease-out; + -moz-transition: opacity 0.3s linear, top 0.3s ease-out; + -o-transition: opacity 0.3s linear, top 0.3s ease-out; + transition: opacity 0.3s linear, top 0.3s ease-out; +} + +.modal.fade.in { + top: 10%; +} + +.modal-header { + padding: 9px 15px; + border-bottom: 1px solid #eee; +} + +.modal-header .close { + margin-top: 2px; +} + +.modal-header h3 { + margin: 0; + line-height: 30px; +} + +.modal-body { + position: relative; + max-height: 400px; + padding: 15px; + overflow-y: auto; +} + +.modal-form { + margin-bottom: 0; +} + +.modal-footer { + padding: 14px 15px 15px; + margin-bottom: 0; + text-align: right; + background-color: #f5f5f5; + border-top: 1px solid #ddd; + border-radius: 0 0 6px 6px; + -webkit-box-shadow: inset 0 1px 0 #ffffff; + box-shadow: inset 0 1px 0 #ffffff; +} + +.modal-footer:before, +.modal-footer:after { + display: table; + content: " "; +} + +.modal-footer:after { + clear: both; +} + +.modal-footer .btn + .btn { + margin-bottom: 0; + margin-left: 5px; +} + +.modal-footer .btn-group .btn + .btn { + margin-left: -1px; +} + +.modal-footer .btn-block + .btn-block { + margin-left: 0; +} + +.tooltip { + position: absolute; + z-index: 1030; + display: block; + padding: 5px; + font-size: 11px; + opacity: 0; + filter: alpha(opacity=0); + visibility: visible; +} + +.tooltip.in { + opacity: 1; + filter: alpha(opacity=100); +} + +.tooltip.top { + margin-top: -3px; +} + +.tooltip.right { + margin-left: 3px; +} + +.tooltip.bottom { + margin-top: 3px; +} + +.tooltip.left { + margin-left: -3px; +} + +.tooltip-inner { + max-width: 200px; + padding: 3px 8px; + color: #ffffff; + text-align: center; + text-decoration: none; + background-color: rgba(0, 0, 0, 0.9); + border-radius: 4px; +} + +.tooltip-arrow { + position: absolute; + width: 0; + height: 0; + border-color: transparent; + border-style: solid; +} + +.tooltip.top .tooltip-arrow { + bottom: 0; + left: 50%; + margin-left: -5px; + border-top-color: rgba(0, 0, 0, 0.9); + border-width: 5px 5px 0; +} + +.tooltip.right .tooltip-arrow { + top: 50%; + left: 0; + margin-top: -5px; + border-right-color: rgba(0, 0, 0, 0.9); + border-width: 5px 5px 5px 0; +} + +.tooltip.left .tooltip-arrow { + top: 50%; + right: 0; + margin-top: -5px; + border-left-color: rgba(0, 0, 0, 0.9); + border-width: 5px 0 5px 5px; +} + +.tooltip.bottom .tooltip-arrow { + top: 0; + left: 50%; + margin-left: -5px; + border-bottom-color: rgba(0, 0, 0, 0.9); + border-width: 0 5px 5px; +} + +.popover { + position: absolute; + top: 0; + left: 0; + z-index: 1010; + display: none; + width: 236px; + padding: 1px; + text-align: left; + white-space: normal; + background-color: #ffffff; + border: 1px solid #ccc; + border: 1px solid rgba(0, 0, 0, 0.2); + border-radius: 6px; + -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); + box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); + -webkit-background-clip: padding-box; + -moz-background-clip: padding; + background-clip: padding-box; +} + +.popover.top { + margin-top: -10px; +} + +.popover.right { + margin-left: 10px; +} + +.popover.bottom { + margin-top: 10px; +} + +.popover.left { + margin-left: -10px; +} + +.popover-title { + padding: 8px 14px; + margin: 0; + font-size: 14px; + font-weight: normal; + line-height: 18px; + background-color: #f7f7f7; + border-bottom: 1px solid #ebebeb; + border-radius: 5px 5px 0 0; +} + +.popover-content { + padding: 9px 14px; +} + +.popover .arrow, +.popover .arrow:after { + position: absolute; + display: block; + width: 0; + height: 0; + border-color: transparent; + border-style: solid; +} + +.popover .arrow { + border-width: 11px; +} + +.popover .arrow:after { + border-width: 10px; + content: ""; +} + +.popover.top .arrow { + bottom: -11px; + left: 50%; + margin-left: -11px; + border-top-color: #999; + border-top-color: rgba(0, 0, 0, 0.25); + border-bottom-width: 0; +} + +.popover.top .arrow:after { + bottom: 1px; + margin-left: -10px; + border-top-color: #ffffff; + border-bottom-width: 0; +} + +.popover.right .arrow { + top: 50%; + left: -11px; + margin-top: -11px; + border-right-color: #999; + border-right-color: rgba(0, 0, 0, 0.25); + border-left-width: 0; +} + +.popover.right .arrow:after { + bottom: -10px; + left: 1px; + border-right-color: #ffffff; + border-left-width: 0; +} + +.popover.bottom .arrow { + top: -11px; + left: 50%; + margin-left: -11px; + border-bottom-color: #999; + border-bottom-color: rgba(0, 0, 0, 0.25); + border-top-width: 0; +} + +.popover.bottom .arrow:after { + top: 1px; + margin-left: -10px; + border-bottom-color: #ffffff; + border-top-width: 0; +} + +.popover.left .arrow { + top: 50%; + right: -11px; + margin-top: -11px; + border-left-color: #999; + border-left-color: rgba(0, 0, 0, 0.25); + border-right-width: 0; +} + +.popover.left .arrow:after { + right: 1px; + bottom: -10px; + border-left-color: #ffffff; + border-right-width: 0; +} + +.thumbnail { + display: block; + padding: 4px; + line-height: 20px; + border: 1px solid #ddd; + border-radius: 4px; + -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.055); + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.055); + -webkit-transition: all 0.2s ease-in-out; + -moz-transition: all 0.2s ease-in-out; + -o-transition: all 0.2s ease-in-out; + transition: all 0.2s ease-in-out; +} + +a.thumbnail:hover { + border-color: #0088cc; + -webkit-box-shadow: 0 1px 4px rgba(0, 105, 214, 0.25); + box-shadow: 0 1px 4px rgba(0, 105, 214, 0.25); +} + +.thumbnail > img { + display: block; + max-width: 100%; + margin-right: auto; + margin-left: auto; +} + +.thumbnail .caption { + padding: 9px; + color: #555555; +} + +.media, +.media-body { + overflow: hidden; + zoom: 1; +} + +.media, +.media .media { + margin-top: 15px; +} + +.media:first-child { + margin-top: 0; +} + +.media-object { + display: block; +} + +.media-heading { + margin: 0 0 5px; +} + +.media > .pull-left { + margin-right: 10px; +} + +.media > .pull-right { + margin-left: 10px; +} + +.media-list { + margin-left: 0; + list-style: none; +} + +.badge { + display: inline-block; + padding: 2px 4px; + font-size: 11.844px; + font-weight: bold; + line-height: 14px; + color: #fff; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + white-space: nowrap; + vertical-align: baseline; + background-color: #999999; + border-radius: 3px; +} + +.badge:empty { + display: none; +} + +a.badge:hover { + color: #fff; + text-decoration: none; + cursor: pointer; +} + +.badge-danger { + background-color: #b94a48; +} + +.badge-danger[href] { + background-color: #953b39; +} + +.badge-warning { + background-color: #f89406; +} + +.badge-warning[href] { + background-color: #c67605; +} + +.badge-success { + background-color: #468847; +} + +.badge-success[href] { + background-color: #356635; +} + +.badge-info { + background-color: #3a87ad; +} + +.badge-info[href] { + background-color: #2d6987; +} + +.badge-inverse { + background-color: #333333; +} + +.badge-inverse[href] { + background-color: #1a1a1a; +} + +.btn .badge { + position: relative; + top: -1px; +} + +.btn-mini .badge { + top: 0; +} + +@-webkit-keyframes progress-bar-stripes { + from { + background-position: 40px 0; + } + to { + background-position: 0 0; + } +} + +@-moz-keyframes progress-bar-stripes { + from { + background-position: 40px 0; + } + to { + background-position: 0 0; + } +} + +@-ms-keyframes progress-bar-stripes { + from { + background-position: 40px 0; + } + to { + background-position: 0 0; + } +} + +@-o-keyframes progress-bar-stripes { + from { + background-position: 0 0; + } + to { + background-position: 40px 0; + } +} + +@keyframes progress-bar-stripes { + from { + background-position: 40px 0; + } + to { + background-position: 0 0; + } +} + +.progress { + height: 20px; + margin-bottom: 20px; + overflow: hidden; + background-color: #f9f9f9; + background-image: -moz-linear-gradient(top, #f5f5f5, #f9f9f9); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#f5f5f5), to(#f9f9f9)); + background-image: -webkit-linear-gradient(top, #f5f5f5, #f9f9f9); + background-image: -o-linear-gradient(top, #f5f5f5, #f9f9f9); + background-image: linear-gradient(to bottom, #f5f5f5, #f9f9f9); + background-repeat: repeat-x; + border-radius: 4px; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#fff9f9f9', GradientType=0); + -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); + box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); +} + +.progress .bar { + float: left; + width: 0; + height: 100%; + font-size: 12px; + color: #fff; + text-align: center; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + background-color: #0480be; + background-image: -moz-linear-gradient(top, #149bdf, #0480be); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#149bdf), to(#0480be)); + background-image: -webkit-linear-gradient(top, #149bdf, #0480be); + background-image: -o-linear-gradient(top, #149bdf, #0480be); + background-image: linear-gradient(to bottom, #149bdf, #0480be); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff149bdf', endColorstr='#ff0480be', GradientType=0); + -webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15); + box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15); + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + -webkit-transition: width 0.6s ease; + -moz-transition: width 0.6s ease; + -o-transition: width 0.6s ease; + transition: width 0.6s ease; +} + +.progress .bar + .bar { + -webkit-box-shadow: inset 1px 0 0 rgba(0, 0, 0, 0.15), inset 0 -1px 0 rgba(0, 0, 0, 0.15); + box-shadow: inset 1px 0 0 rgba(0, 0, 0, 0.15), inset 0 -1px 0 rgba(0, 0, 0, 0.15); +} + +.progress-striped .bar { + background-color: #149bdf; + background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent)); + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + -webkit-background-size: 40px 40px; + -moz-background-size: 40px 40px; + -o-background-size: 40px 40px; + background-size: 40px 40px; +} + +.progress.active .bar { + -webkit-animation: progress-bar-stripes 2s linear infinite; + -moz-animation: progress-bar-stripes 2s linear infinite; + -ms-animation: progress-bar-stripes 2s linear infinite; + -o-animation: progress-bar-stripes 2s linear infinite; + animation: progress-bar-stripes 2s linear infinite; +} + +.progress-danger .bar, +.progress .bar-danger { + background-color: #c43c35; + background-image: -moz-linear-gradient(top, #ee5f5b, #c43c35); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ee5f5b), to(#c43c35)); + background-image: -webkit-linear-gradient(top, #ee5f5b, #c43c35); + background-image: -o-linear-gradient(top, #ee5f5b, #c43c35); + background-image: linear-gradient(to bottom, #ee5f5b, #c43c35); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffee5f5b', endColorstr='#ffc43c35', GradientType=0); +} + +.progress-danger.progress-striped .bar, +.progress-striped .bar-danger { + background-color: #ee5f5b; + background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent)); + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); +} + +.progress-success .bar, +.progress .bar-success { + background-color: #57a957; + background-image: -moz-linear-gradient(top, #62c462, #57a957); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#62c462), to(#57a957)); + background-image: -webkit-linear-gradient(top, #62c462, #57a957); + background-image: -o-linear-gradient(top, #62c462, #57a957); + background-image: linear-gradient(to bottom, #62c462, #57a957); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff62c462', endColorstr='#ff57a957', GradientType=0); +} + +.progress-success.progress-striped .bar, +.progress-striped .bar-success { + background-color: #62c462; + background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent)); + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); +} + +.progress-info .bar, +.progress .bar-info { + background-color: #339bb9; + background-image: -moz-linear-gradient(top, #5bc0de, #339bb9); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#5bc0de), to(#339bb9)); + background-image: -webkit-linear-gradient(top, #5bc0de, #339bb9); + background-image: -o-linear-gradient(top, #5bc0de, #339bb9); + background-image: linear-gradient(to bottom, #5bc0de, #339bb9); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff339bb9', GradientType=0); +} + +.progress-info.progress-striped .bar, +.progress-striped .bar-info { + background-color: #5bc0de; + background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent)); + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); +} + +.progress-warning .bar, +.progress .bar-warning { + background-color: #f89406; + background-image: -moz-linear-gradient(top, #fbb450, #f89406); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#fbb450), to(#f89406)); + background-image: -webkit-linear-gradient(top, #fbb450, #f89406); + background-image: -o-linear-gradient(top, #fbb450, #f89406); + background-image: linear-gradient(to bottom, #fbb450, #f89406); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffbb450', endColorstr='#fff89406', GradientType=0); +} + +.progress-warning.progress-striped .bar, +.progress-striped .bar-warning { + background-color: #fbb450; + background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent)); + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); +} + +.accordion { + margin-bottom: 20px; +} + +.accordion-group { + margin-bottom: 2px; + border: 1px solid #e5e5e5; + border-radius: 4px; +} + +.accordion-heading { + border-bottom: 0; +} + +.accordion-heading .accordion-toggle { + display: block; + padding: 8px 15px; +} + +.accordion-toggle { + cursor: pointer; +} + +.accordion-inner { + padding: 9px 15px; + border-top: 1px solid #e5e5e5; +} + +.carousel { + position: relative; + margin-bottom: 20px; + line-height: 1; +} + +.carousel-inner { + position: relative; + width: 100%; + overflow: hidden; +} + +.carousel-inner > .item { + position: relative; + display: none; + -webkit-transition: 0.6s ease-in-out left; + -moz-transition: 0.6s ease-in-out left; + -o-transition: 0.6s ease-in-out left; + transition: 0.6s ease-in-out left; +} + +.carousel-inner > .item > img { + display: block; + line-height: 1; +} + +.carousel-inner > .active, +.carousel-inner > .next, +.carousel-inner > .prev { + display: block; +} + +.carousel-inner > .active { + left: 0; +} + +.carousel-inner > .next, +.carousel-inner > .prev { + position: absolute; + top: 0; + width: 100%; +} + +.carousel-inner > .next { + left: 100%; +} + +.carousel-inner > .prev { + left: -100%; +} + +.carousel-inner > .next.left, +.carousel-inner > .prev.right { + left: 0; +} + +.carousel-inner > .active.left { + left: -100%; +} + +.carousel-inner > .active.right { + left: 100%; +} + +.carousel-control { + position: absolute; + top: 0; + bottom: 0; + left: 0; + width: 120px; + opacity: 0.5; + filter: alpha(opacity=50); +} + +.carousel-control.left { + background-color: rgba(0, 0, 0, 0.001); + background-color: transparent; + background-image: -moz-linear-gradient(left, rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0.001)); + background-image: -webkit-gradient(linear, 0 0, 100% 0, from(rgba(0, 0, 0, 0.75)), to(rgba(0, 0, 0, 0.001))); + background-image: -webkit-linear-gradient(left, rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0.001)); + background-image: -o-linear-gradient(left, rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0.001)); + background-image: linear-gradient(to right, rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0.001)); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#bf000000', endColorstr='#00000000', GradientType=1); +} + +.carousel-control.right { + right: 0; + left: auto; + background-color: rgba(0, 0, 0, 0.75); + background-color: transparent; + background-image: -moz-linear-gradient(left, rgba(0, 0, 0, 0.001), rgba(0, 0, 0, 0.75)); + background-image: -webkit-gradient(linear, 0 0, 100% 0, from(rgba(0, 0, 0, 0.001)), to(rgba(0, 0, 0, 0.75))); + background-image: -webkit-linear-gradient(left, rgba(0, 0, 0, 0.001), rgba(0, 0, 0, 0.75)); + background-image: -o-linear-gradient(left, rgba(0, 0, 0, 0.001), rgba(0, 0, 0, 0.75)); + background-image: linear-gradient(to right, rgba(0, 0, 0, 0.001), rgba(0, 0, 0, 0.75)); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#bf000000', GradientType=1); +} + +.carousel-control:hover { + color: #fff; + text-decoration: none; + opacity: 0.9; + filter: alpha(opacity=90); +} + +.carousel-control .control { + position: absolute; + top: 50%; + z-index: 5; + display: block; + margin-top: -35px; + margin-left: 30px; + font-size: 80px; + font-weight: 100; + color: #fff; + text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); +} + +.carousel-control.right .control { + margin-left: 70px; +} + +.carousel-indicators { + position: absolute; + top: 15px; + right: 15px; + z-index: 5; + margin: 0; + list-style: none; +} + +.carousel-indicators li { + display: block; + float: left; + width: 10px; + height: 10px; + margin-left: 5px; + text-indent: -999px; + background-color: #ccc; + background-color: rgba(255, 255, 255, 0.25); + border-radius: 5px; +} + +.carousel-indicators .active { + background-color: #fff; +} + +.carousel-caption { + position: absolute; + right: 0; + bottom: 0; + left: 0; + z-index: 10; + max-width: 60%; + padding: 40px; + text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); +} + +.carousel-caption h3, +.carousel-caption p { + line-height: 20px; + color: #fff; +} + +.carousel-caption h3 { + margin: 0 0 5px; +} + +.carousel-caption p { + margin-bottom: 0; +} + +.jumbotron { + padding: 60px; + margin-bottom: 30px; + font-size: 18px; + font-weight: 200; + line-height: 30px; + color: inherit; + background-color: #eeeeee; + border-radius: 6px; +} + +.jumbotron h1 { + margin-bottom: 0; + font-size: 60px; + line-height: 1; + letter-spacing: -1px; + color: inherit; +} + +.jumbotron li { + line-height: 30px; +} + +.clearfix:before, +.clearfix:after { + display: table; + content: " "; +} + +.clearfix:after { + clear: both; +} + +.pull-right { + float: right; +} + +.pull-left { + float: left; +} + +.hide { + display: none !important; +} + +.show { + display: block !important; +} + +.invisible { + visibility: hidden; +} + +.text-hide { + font: 0/0 a; + color: transparent; + text-shadow: none; + background-color: transparent; + border: 0; +} + +.affix { + position: fixed; +} + +.control-block-level { + display: block; + width: 100%; +} + +@-ms-viewport { + width: device-width; +} + +.hidden { + display: none; + visibility: hidden; +} + +.visible-phone { + display: none !important; +} + +.visible-tablet { + display: none !important; +} + +.hidden-desktop { + display: none !important; +} + +.visible-desktop { + display: inherit !important; +} + +@media (min-width: 768px) and (max-width: 979px) { + .hidden-desktop { + display: inherit !important; + } + .visible-desktop { + display: none !important ; + } + .visible-tablet { + display: inherit !important; + } + .hidden-tablet { + display: none !important; + } +} + +@media (max-width: 767px) { + .hidden-desktop { + display: inherit !important; + } + .visible-desktop { + display: none !important; + } + .visible-phone { + display: inherit !important; + } + .hidden-phone { + display: none !important; + } +} + +@media (min-width: 1200px) { + .container { + max-width: 1170px; + } + .row { + margin-right: -15px; + margin-left: -15px; + } + .row:before, + .row:after { + display: table; + content: " "; + } + .row:after { + clear: both; + } + [class*="span"] { + float: left; + min-height: 1px; + padding-right: 15px; + padding-left: 15px; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + } + .span12 { + width: 100%; + } + .span11 { + width: 91.66666666666666%; + } + .span10 { + width: 83.33333333333334%; + } + .span9 { + width: 75%; + } + .span8 { + width: 66.66666666666666%; + } + .span7 { + width: 58.333333333333336%; + } + .span6 { + width: 50%; + } + .span5 { + width: 41.66666666666667%; + } + .span4 { + width: 33.33333333333333%; + } + .span3 { + width: 25%; + } + .span2 { + width: 16.666666666666664%; + } + .span1 { + width: 8.333333333333332%; + } + .offset12 { + margin-left: 100%; + } + .offset11 { + margin-left: 91.66666666666666%; + } + .offset10 { + margin-left: 83.33333333333334%; + } + .offset9 { + margin-left: 75%; + } + .offset8 { + margin-left: 66.66666666666666%; + } + .offset7 { + margin-left: 58.333333333333336%; + } + .offset6 { + margin-left: 50%; + } + .offset5 { + margin-left: 41.66666666666667%; + } + .offset4 { + margin-left: 33.33333333333333%; + } + .offset3 { + margin-left: 25%; + } + .offset2 { + margin-left: 16.666666666666664%; + } + .offset1 { + margin-left: 8.333333333333332%; + } +} + +@media (min-width: 768px) and (max-width: 979px) { + .row { + margin-right: -10px; + margin-left: -10px; + } + .row:before, + .row:after { + display: table; + content: " "; + } + .row:after { + clear: both; + } + [class*="span"] { + float: left; + min-height: 1px; + padding-right: 10px; + padding-left: 10px; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + } + .span12 { + width: 100%; + } + .span11 { + width: 91.66666666666666%; + } + .span10 { + width: 83.33333333333334%; + } + .span9 { + width: 75%; + } + .span8 { + width: 66.66666666666666%; + } + .span7 { + width: 58.333333333333336%; + } + .span6 { + width: 50%; + } + .span5 { + width: 41.66666666666667%; + } + .span4 { + width: 33.33333333333333%; + } + .span3 { + width: 25%; + } + .span2 { + width: 16.666666666666664%; + } + .span1 { + width: 8.333333333333332%; + } + .offset12 { + margin-left: 100%; + } + .offset11 { + margin-left: 91.66666666666666%; + } + .offset10 { + margin-left: 83.33333333333334%; + } + .offset9 { + margin-left: 75%; + } + .offset8 { + margin-left: 66.66666666666666%; + } + .offset7 { + margin-left: 58.333333333333336%; + } + .offset6 { + margin-left: 50%; + } + .offset5 { + margin-left: 41.66666666666667%; + } + .offset4 { + margin-left: 33.33333333333333%; + } + .offset3 { + margin-left: 25%; + } + .offset2 { + margin-left: 16.666666666666664%; + } + .offset1 { + margin-left: 8.333333333333332%; + } +} + +@media (max-width: 767px) { + body { + padding-right: 20px; + padding-left: 20px; + } + .navbar-fixed-top, + .navbar-fixed-bottom, + .navbar-static-top { + margin-right: -20px; + margin-left: -20px; + } + .dl-horizontal dt { + float: none; + width: auto; + clear: none; + text-align: left; + } + .dl-horizontal dd { + margin-left: 0; + } + .container { + width: auto; + } + [class*="span"], + .uneditable-input[class*="span"] { + display: block; + float: none; + width: 100%; + margin-left: 0; + } + input[class*="span"], + select[class*="span"], + textarea[class*="span"], + .uneditable-input { + display: block; + width: 100%; + } + .input-prepend input, + .input-append input, + .input-prepend input[class*="span"], + .input-append input[class*="span"] { + display: inline-block; + width: auto; + } + .controls-row [class*="span"] + [class*="span"] { + margin-left: 0; + } + .modal { + position: fixed; + top: 20px; + right: 20px; + left: 20px; + width: auto; + margin: 0; + } + .modal.fade { + top: -100px; + } + .modal.fade.in { + top: 20px; + } +} + +@media (max-width: 480px) { + .nav-collapse { + -webkit-transform: translate3d(0, 0, 0); + } + .page-header h1 small { + display: block; + line-height: 20px; + } + input[type="checkbox"], + input[type="radio"] { + border: 1px solid #ccc; + } + .form-horizontal .control-label { + float: none; + width: auto; + padding-top: 0; + text-align: left; + } + .form-horizontal .controls { + margin-left: 0; + } + .form-horizontal .control-list { + padding-top: 0; + } + .form-horizontal .form-actions { + padding-right: 10px; + padding-left: 10px; + } + .media .pull-left, + .media .pull-right { + display: block; + float: none; + margin-bottom: 10px; + } + .media-object { + margin-right: 0; + margin-left: 0; + } + .modal { + top: 10px; + right: 10px; + left: 10px; + } + .modal-header .close { + padding: 10px; + margin: -10px; + } + .carousel-caption { + position: static; + } +} + +@media (max-width: 979px) { + body { + padding-top: 0; + } + .navbar-fixed-top, + .navbar-fixed-bottom { + position: static; + } + .navbar-fixed-top { + margin-bottom: 20px; + } + .navbar-fixed-bottom { + margin-top: 20px; + } + .navbar-fixed-top, + .navbar-fixed-bottom { + padding: 5px; + } + .navbar .container { + width: auto; + padding: 0; + } + .navbar .brand { + padding-right: 10px; + padding-left: 10px; + margin: 0 0 0 -5px; + } + .nav-collapse { + clear: both; + } + .nav-collapse .nav { + float: none; + margin: 0 0 10px; + } + .nav-collapse .nav > li { + float: none; + } + .nav-collapse .nav > li > a { + margin-bottom: 2px; + } + .nav-collapse .nav > .divider-vertical { + display: none; + } + .nav-collapse .nav .nav-header { + color: #777777; + text-shadow: none; + } + .nav-collapse .nav > li > a, + .nav-collapse .dropdown-menu a { + padding: 9px 15px; + font-weight: bold; + color: #777777; + border-radius: 3px; + } + .nav-collapse .btn { + padding: 4px 10px 4px; + font-weight: normal; + border-radius: 4px; + } + .nav-collapse .dropdown-menu li + li a { + margin-bottom: 2px; + } + .nav-collapse .nav > li > a:hover, + .nav-collapse .dropdown-menu a:hover { + background-color: #f2f2f2; + } + .navbar-inverse .nav-collapse .nav > li > a, + .navbar-inverse .nav-collapse .dropdown-menu a { + color: #999999; + } + .navbar-inverse .nav-collapse .nav > li > a:hover, + .navbar-inverse .nav-collapse .dropdown-menu a:hover { + background-color: #111111; + } + .nav-collapse.in .btn-group { + padding: 0; + margin-top: 5px; + } + .nav-collapse .dropdown-menu { + position: static; + top: auto; + left: auto; + display: none; + float: none; + max-width: none; + padding: 0; + margin: 0 15px; + background-color: transparent; + border: none; + border-radius: 0; + -webkit-box-shadow: none; + box-shadow: none; + } + .nav-collapse .open > .dropdown-menu { + display: block; + } + .nav-collapse .dropdown-menu:before, + .nav-collapse .dropdown-menu:after { + display: none; + } + .nav-collapse .dropdown-menu .divider { + display: none; + } + .nav-collapse .nav > li > .dropdown-menu:before, + .nav-collapse .nav > li > .dropdown-menu:after { + display: none; + } + .nav-collapse .navbar-form, + .nav-collapse .navbar-search { + float: none; + padding: 10px 15px; + margin: 10px 0; + border-top: 1px solid #f2f2f2; + border-bottom: 1px solid #f2f2f2; + -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1); + box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1); + } + .navbar-inverse .nav-collapse .navbar-form, + .navbar-inverse .nav-collapse .navbar-search { + border-top-color: #111111; + border-bottom-color: #111111; + } + .navbar .nav-collapse .nav.pull-right { + float: none; + margin-left: 0; + } + .nav-collapse, + .nav-collapse.collapse { + height: 0; + overflow: hidden; + } + .navbar .btn-navbar { + display: block; + } + .navbar-static { + padding-right: 10px; + padding-left: 10px; + } +} + +@media (min-width: 980px) { + .nav-collapse.collapse { + height: auto !important; + overflow: visible !important; + } +} diff --git a/lib/report/assets/css/vendor/codemirror.css b/lib/report/assets/css/vendor/codemirror.css new file mode 100755 index 0000000..bf995f4 --- /dev/null +++ b/lib/report/assets/css/vendor/codemirror.css @@ -0,0 +1,239 @@ +/* BASICS */ + +.CodeMirror { + /* Set height, width, borders, and global font properties here */ + font-family: monospace; + height: 300px; +} +.CodeMirror-scroll { + /* Set scrolling behaviour here */ + overflow: auto; +} + +/* PADDING */ + +.CodeMirror-lines { + padding: 4px 0; /* Vertical padding around content */ +} +.CodeMirror pre { + padding: 0 4px; /* Horizontal padding of content */ +} + +.CodeMirror-scrollbar-filler { + background-color: white; /* The little square between H and V scrollbars */ +} + +/* GUTTER */ + +.CodeMirror-gutters { + border-right: 1px solid #ddd; + background-color: #f7f7f7; +} +.CodeMirror-linenumbers {} +.CodeMirror-linenumber { + padding: 0 3px 0 5px; + min-width: 20px; + text-align: right; + color: #999; +} + +/* CURSOR */ + +.CodeMirror pre.CodeMirror-cursor { + border-left: 1px solid black; +} +/* Shown when moving in bi-directional text */ +.CodeMirror pre.CodeMirror-secondarycursor { + border-left: 1px solid silver; +} +.cm-keymap-fat-cursor pre.CodeMirror-cursor { + width: auto; + border: 0; + background: transparent; + background: rgba(0, 200, 0, .4); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#6600c800, endColorstr=#4c00c800); +} +/* Kludge to turn off filter in ie9+, which also accepts rgba */ +.cm-keymap-fat-cursor pre.CodeMirror-cursor:not(#nonsense_id) { + filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); +} +/* Can style cursor different in overwrite (non-insert) mode */ +.CodeMirror pre.CodeMirror-cursor.CodeMirror-overwrite {} + +/* DEFAULT THEME */ + +.cm-s-default .cm-keyword {color: #708;} +.cm-s-default .cm-atom {color: #219;} +.cm-s-default .cm-number {color: #164;} +.cm-s-default .cm-def {color: #00f;} +.cm-s-default .cm-variable {color: black;} +.cm-s-default .cm-variable-2 {color: #05a;} +.cm-s-default .cm-variable-3 {color: #085;} +.cm-s-default .cm-property {color: black;} +.cm-s-default .cm-operator {color: black;} +.cm-s-default .cm-comment {color: #a50;} +.cm-s-default .cm-string {color: #a11;} +.cm-s-default .cm-string-2 {color: #f50;} +.cm-s-default .cm-meta {color: #555;} +.cm-s-default .cm-error {color: #f00;} +.cm-s-default .cm-qualifier {color: #555;} +.cm-s-default .cm-builtin {color: #30a;} +.cm-s-default .cm-bracket {color: #997;} +.cm-s-default .cm-tag {color: #170;} +.cm-s-default .cm-attribute {color: #00c;} +.cm-s-default .cm-header {color: blue;} +.cm-s-default .cm-quote {color: #090;} +.cm-s-default .cm-hr {color: #999;} +.cm-s-default .cm-link {color: #00c;} + +.cm-negative {color: #d44;} +.cm-positive {color: #292;} +.cm-header, .cm-strong {font-weight: bold;} +.cm-em {font-style: italic;} +.cm-emstrong {font-style: italic; font-weight: bold;} +.cm-link {text-decoration: underline;} + +.cm-invalidchar {color: #f00;} + +div.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;} +div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;} + +/* STOP */ + +/* The rest of this file contains styles related to the mechanics of + the editor. You probably shouldn't touch them. */ + +.CodeMirror { + line-height: 1; + position: relative; + overflow: hidden; +} + +.CodeMirror-scroll { + /* 30px is the magic margin used to hide the element's real scrollbars */ + /* See overflow: hidden in .CodeMirror, and the paddings in .CodeMirror-sizer */ + margin-bottom: -30px; margin-right: -30px; + padding-bottom: 30px; padding-right: 30px; + height: 100%; + outline: none; /* Prevent dragging from highlighting the element */ + position: relative; +} +.CodeMirror-sizer { + position: relative; +} + +/* The fake, visible scrollbars. Used to force redraw during scrolling + before actuall scrolling happens, thus preventing shaking and + flickering artifacts. */ +.CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler { + position: absolute; + z-index: 6; + display: none; +} +.CodeMirror-vscrollbar { + right: 0; top: 0; + overflow-x: hidden; + overflow-y: scroll; +} +.CodeMirror-hscrollbar { + bottom: 0; left: 0; + overflow-y: hidden; + overflow-x: scroll; +} +.CodeMirror-scrollbar-filler { + right: 0; bottom: 0; + z-index: 6; +} + +.CodeMirror-gutters { + position: absolute; left: 0; top: 0; + height: 100%; + z-index: 3; +} +.CodeMirror-gutter { + height: 100%; + display: inline-block; + /* Hack to make IE7 behave */ + *zoom:1; + *display:inline; +} +.CodeMirror-gutter-elt { + position: absolute; + cursor: default; + z-index: 4; +} + +.CodeMirror-lines { + cursor: text; +} +.CodeMirror pre { + /* Reset some styles that the rest of the page might have set */ + -moz-border-radius: 0; -webkit-border-radius: 0; -o-border-radius: 0; border-radius: 0; + border-width: 0; + background: transparent; + font-family: inherit; + font-size: inherit; + margin: 0; + white-space: pre; + word-wrap: normal; + line-height: inherit; + color: inherit; + z-index: 2; + position: relative; + overflow: visible; +} +.CodeMirror-wrap pre { + word-wrap: break-word; + white-space: pre-wrap; + word-break: normal; +} +.CodeMirror-linebackground { + position: absolute; + left: 0; right: 0; top: 0; bottom: 0; + z-index: 0; +} + +.CodeMirror-linewidget { + position: relative; + z-index: 2; +} + +.CodeMirror-wrap .CodeMirror-scroll { + overflow-x: hidden; +} + +.CodeMirror-measure { + position: absolute; + width: 100%; height: 0px; + overflow: hidden; + visibility: hidden; +} +.CodeMirror-measure pre { position: static; } + +.CodeMirror pre.CodeMirror-cursor { + position: absolute; + visibility: hidden; + border-right: none; + width: 0; +} +.CodeMirror-focused pre.CodeMirror-cursor { + visibility: visible; +} + +.CodeMirror-selected { background: #d9d9d9; } +.CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; } + +.CodeMirror-searching { + background: #ffa; + background: rgba(255, 255, 0, .4); +} + +/* IE7 hack to prevent it from returning funny offsetTops on the spans */ +.CodeMirror span { *vertical-align: text-bottom; } + +@media print { + /* Hide the cursor when printing */ + .CodeMirror pre.CodeMirror-cursor { + visibility: hidden; + } +} diff --git a/lib/report/assets/css/vendor/font-awesome-ie7.css b/lib/report/assets/css/vendor/font-awesome-ie7.css new file mode 100755 index 0000000..c1dc3ac --- /dev/null +++ b/lib/report/assets/css/vendor/font-awesome-ie7.css @@ -0,0 +1,645 @@ +[class^="icon-"], +[class*=" icon-"] { + font-family: FontAwesome; + font-style: normal; + font-weight: normal; +} +.btn.dropdown-toggle [class^="icon-"], +.btn.dropdown-toggle [class*=" icon-"] { + /* keeps button heights with and without icons the same */ + + line-height: 1.4em; +} +.icon-large { + font-size: 1.3333em; +} +.icon-glass { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-music { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-search { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-envelope { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-heart { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-star { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-star-empty { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-user { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-film { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-th-large { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-th { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-th-list { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-ok { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-remove { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-zoom-in { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-zoom-out { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-off { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-signal { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-cog { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-trash { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-home { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-file { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-time { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-road { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-download-alt { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-download { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-upload { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-inbox { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-play-circle { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-repeat { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-refresh { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-list-alt { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-lock { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-flag { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-headphones { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-volume-off { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-volume-down { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-volume-up { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-qrcode { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-barcode { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-tag { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-tags { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-book { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-bookmark { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-print { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-camera { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-bold { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-italic { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-text-height { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-text-width { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-align-left { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-align-center { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-align-right { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-align-justify { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-list { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-indent-left { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-indent-right { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-facetime-video { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-picture { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-pencil { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-map-marker { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-adjust { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-tint { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-edit { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-share { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-check { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-move { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-step-backward { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-fast-backward { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-backward { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-play { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-pause { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-stop { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-forward { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-fast-forward { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-step-forward { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-eject { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-chevron-left { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-chevron-right { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-plus-sign { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-minus-sign { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-remove-sign { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-ok-sign { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-question-sign { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-info-sign { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-screenshot { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-remove-circle { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-ok-circle { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-ban-circle { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-arrow-left { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-arrow-right { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-arrow-up { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-arrow-down { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-share-alt { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-resize-full { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-resize-small { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-plus { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-minus { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-asterisk { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-exclamation-sign { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-gift { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-leaf { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-fire { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-eye-open { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-eye-close { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-warning-sign { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-plane { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-calendar { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-random { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-comment { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-magnet { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-chevron-up { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-chevron-down { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-retweet { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-shopping-cart { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-folder-close { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-folder-open { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-resize-vertical { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-resize-horizontal { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-bar-chart { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-twitter-sign { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-facebook-sign { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-camera-retro { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-key { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-cogs { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-comments { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-thumbs-up { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-thumbs-down { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-star-half { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-heart-empty { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-signout { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-linkedin-sign { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-pushpin { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-external-link { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-signin { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-trophy { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-github-sign { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-upload-alt { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-lemon { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-phone { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-check-empty { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-bookmark-empty { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-phone-sign { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-twitter { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-facebook { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-github { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-unlock { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-credit-card { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-rss { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-hdd { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-bullhorn { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-bell { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-certificate { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-hand-right { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-hand-left { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-hand-up { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-hand-down { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-circle-arrow-left { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-circle-arrow-right { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-circle-arrow-up { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-circle-arrow-down { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-globe { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-wrench { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-tasks { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-filter { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-briefcase { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-fullscreen { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-group { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-link { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-cloud { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-beaker { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-cut { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-copy { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-paper-clip { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-save { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-sign-blank { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-reorder { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-list-ul { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-list-ol { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-strikethrough { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-underline { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-table { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-magic { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-truck { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-pinterest { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-pinterest-sign { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-google-plus-sign { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-google-plus { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-money { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-caret-down { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-caret-up { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-caret-left { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-caret-right { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-columns { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-sort { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-sort-down { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-sort-up { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-envelope-alt { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-linkedin { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-undo { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-legal { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-dashboard { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-comment-alt { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-comments-alt { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-bolt { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-sitemap { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-umbrella { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-paste { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-user-md { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} diff --git a/lib/report/assets/css/vendor/font-awesome.css b/lib/report/assets/css/vendor/font-awesome.css new file mode 100755 index 0000000..3280ad4 --- /dev/null +++ b/lib/report/assets/css/vendor/font-awesome.css @@ -0,0 +1,303 @@ +/* Font Awesome + the iconic font designed for use with Twitter Bootstrap + ------------------------------------------------------- + The full suite of pictographic icons, examples, and documentation + can be found at: http://fortawesome.github.com/Font-Awesome/ + + License + ------------------------------------------------------- + The Font Awesome webfont, CSS, and LESS files are licensed under CC BY 3.0: + http://creativecommons.org/licenses/by/3.0/ A mention of + 'Font Awesome - http://fortawesome.github.com/Font-Awesome' in human-readable + source code is considered acceptable attribution (most common on the web). + If human readable source code is not available to the end user, a mention in + an 'About' or 'Credits' screen is considered acceptable (most common in desktop + or mobile software). + + Contact + ------------------------------------------------------- + Email: dave@davegandy.com + Twitter: http://twitter.com/fortaweso_me + Work: http://lemonwi.se co-founder + + */ +@font-face { + font-family: "FontAwesome"; + src: url('../../font/fontawesome-webfont.eot'); + src: url('../../font/fontawesome-webfont.eot?#iefix') format('eot'), url('../../font/fontawesome-webfont.woff') format('woff'), url('../../font/fontawesome-webfont.ttf') format('truetype'), url('../../font/fontawesome-webfont.svg#FontAwesome') format('svg'); + font-weight: normal; + font-style: normal; +} + +/* Font Awesome styles + ------------------------------------------------------- */ +[class^="icon-"]:before, [class*=" icon-"]:before { + font-family: FontAwesome; + font-weight: normal; + font-style: normal; + display: inline-block; + text-decoration: inherit; +} +a [class^="icon-"], a [class*=" icon-"] { + display: inline-block; + text-decoration: inherit; +} +/* makes the font 33% larger relative to the icon container */ +.icon-large:before { + vertical-align: top; + font-size: 1.3333333333333333em; +} +.btn [class^="icon-"], .btn [class*=" icon-"] { + /* keeps button heights with and without icons the same */ + + line-height: .9em; +} +li [class^="icon-"], li [class*=" icon-"] { + display: inline-block; + width: 1.25em; + text-align: center; +} +li .icon-large[class^="icon-"], li .icon-large[class*=" icon-"] { + /* 1.5 increased font size for icon-large * 1.25 width */ + + width: 1.875em; +} +li[class^="icon-"], li[class*=" icon-"] { + margin-left: 0; + list-style-type: none; +} +li[class^="icon-"]:before, li[class*=" icon-"]:before { + text-indent: -2em; + text-align: center; +} +li[class^="icon-"].icon-large:before, li[class*=" icon-"].icon-large:before { + text-indent: -1.3333333333333333em; +} +/* Font Awesome uses the Unicode Private Use Area (PUA) to ensure screen + readers do not read off random characters that represent icons */ +.icon-glass:before { content: "\f000"; } +.icon-music:before { content: "\f001"; } +.icon-search:before { content: "\f002"; } +.icon-envelope:before { content: "\f003"; } +.icon-heart:before { content: "\f004"; } +.icon-star:before { content: "\f005"; } +.icon-star-empty:before { content: "\f006"; } +.icon-user:before { content: "\f007"; } +.icon-film:before { content: "\f008"; } +.icon-th-large:before { content: "\f009"; } +.icon-th:before { content: "\f00a"; } +.icon-th-list:before { content: "\f00b"; } +.icon-ok:before { content: "\f00c"; } +.icon-remove:before { content: "\f00d"; } +.icon-zoom-in:before { content: "\f00e"; } + +.icon-zoom-out:before { content: "\f010"; } +.icon-off:before { content: "\f011"; } +.icon-signal:before { content: "\f012"; } +.icon-cog:before { content: "\f013"; } +.icon-trash:before { content: "\f014"; } +.icon-home:before { content: "\f015"; } +.icon-file:before { content: "\f016"; } +.icon-time:before { content: "\f017"; } +.icon-road:before { content: "\f018"; } +.icon-download-alt:before { content: "\f019"; } +.icon-download:before { content: "\f01a"; } +.icon-upload:before { content: "\f01b"; } +.icon-inbox:before { content: "\f01c"; } +.icon-play-circle:before { content: "\f01d"; } +.icon-repeat:before { content: "\f01e"; } + +/* \f020 doesn't work in Safari. all shifted one down */ +.icon-refresh:before { content: "\f021"; } +.icon-list-alt:before { content: "\f022"; } +.icon-lock:before { content: "\f023"; } +.icon-flag:before { content: "\f024"; } +.icon-headphones:before { content: "\f025"; } +.icon-volume-off:before { content: "\f026"; } +.icon-volume-down:before { content: "\f027"; } +.icon-volume-up:before { content: "\f028"; } +.icon-qrcode:before { content: "\f029"; } +.icon-barcode:before { content: "\f02a"; } +.icon-tag:before { content: "\f02b"; } +.icon-tags:before { content: "\f02c"; } +.icon-book:before { content: "\f02d"; } +.icon-bookmark:before { content: "\f02e"; } +.icon-print:before { content: "\f02f"; } + +.icon-camera:before { content: "\f030"; } +.icon-font:before { content: "\f031"; } +.icon-bold:before { content: "\f032"; } +.icon-italic:before { content: "\f033"; } +.icon-text-height:before { content: "\f034"; } +.icon-text-width:before { content: "\f035"; } +.icon-align-left:before { content: "\f036"; } +.icon-align-center:before { content: "\f037"; } +.icon-align-right:before { content: "\f038"; } +.icon-align-justify:before { content: "\f039"; } +.icon-list:before { content: "\f03a"; } +.icon-indent-left:before { content: "\f03b"; } +.icon-indent-right:before { content: "\f03c"; } +.icon-facetime-video:before { content: "\f03d"; } +.icon-picture:before { content: "\f03e"; } + +.icon-pencil:before { content: "\f040"; } +.icon-map-marker:before { content: "\f041"; } +.icon-adjust:before { content: "\f042"; } +.icon-tint:before { content: "\f043"; } +.icon-edit:before { content: "\f044"; } +.icon-share:before { content: "\f045"; } +.icon-check:before { content: "\f046"; } +.icon-move:before { content: "\f047"; } +.icon-step-backward:before { content: "\f048"; } +.icon-fast-backward:before { content: "\f049"; } +.icon-backward:before { content: "\f04a"; } +.icon-play:before { content: "\f04b"; } +.icon-pause:before { content: "\f04c"; } +.icon-stop:before { content: "\f04d"; } +.icon-forward:before { content: "\f04e"; } + +.icon-fast-forward:before { content: "\f050"; } +.icon-step-forward:before { content: "\f051"; } +.icon-eject:before { content: "\f052"; } +.icon-chevron-left:before { content: "\f053"; } +.icon-chevron-right:before { content: "\f054"; } +.icon-plus-sign:before { content: "\f055"; } +.icon-minus-sign:before { content: "\f056"; } +.icon-remove-sign:before { content: "\f057"; } +.icon-ok-sign:before { content: "\f058"; } +.icon-question-sign:before { content: "\f059"; } +.icon-info-sign:before { content: "\f05a"; } +.icon-screenshot:before { content: "\f05b"; } +.icon-remove-circle:before { content: "\f05c"; } +.icon-ok-circle:before { content: "\f05d"; } +.icon-ban-circle:before { content: "\f05e"; } + +.icon-arrow-left:before { content: "\f060"; } +.icon-arrow-right:before { content: "\f061"; } +.icon-arrow-up:before { content: "\f062"; } +.icon-arrow-down:before { content: "\f063"; } +.icon-share-alt:before { content: "\f064"; } +.icon-resize-full:before { content: "\f065"; } +.icon-resize-small:before { content: "\f066"; } +.icon-plus:before { content: "\f067"; } +.icon-minus:before { content: "\f068"; } +.icon-asterisk:before { content: "\f069"; } +.icon-exclamation-sign:before { content: "\f06a"; } +.icon-gift:before { content: "\f06b"; } +.icon-leaf:before { content: "\f06c"; } +.icon-fire:before { content: "\f06d"; } +.icon-eye-open:before { content: "\f06e"; } + +.icon-eye-close:before { content: "\f070"; } +.icon-warning-sign:before { content: "\f071"; } +.icon-plane:before { content: "\f072"; } +.icon-calendar:before { content: "\f073"; } +.icon-random:before { content: "\f074"; } +.icon-comment:before { content: "\f075"; } +.icon-magnet:before { content: "\f076"; } +.icon-chevron-up:before { content: "\f077"; } +.icon-chevron-down:before { content: "\f078"; } +.icon-retweet:before { content: "\f079"; } +.icon-shopping-cart:before { content: "\f07a"; } +.icon-folder-close:before { content: "\f07b"; } +.icon-folder-open:before { content: "\f07c"; } +.icon-resize-vertical:before { content: "\f07d"; } +.icon-resize-horizontal:before { content: "\f07e"; } + +.icon-bar-chart:before { content: "\f080"; } +.icon-twitter-sign:before { content: "\f081"; } +.icon-facebook-sign:before { content: "\f082"; } +.icon-camera-retro:before { content: "\f083"; } +.icon-key:before { content: "\f084"; } +.icon-cogs:before { content: "\f085"; } +.icon-comments:before { content: "\f086"; } +.icon-thumbs-up:before { content: "\f087"; } +.icon-thumbs-down:before { content: "\f088"; } +.icon-star-half:before { content: "\f089"; } +.icon-heart-empty:before { content: "\f08a"; } +.icon-signout:before { content: "\f08b"; } +.icon-linkedin-sign:before { content: "\f08c"; } +.icon-pushpin:before { content: "\f08d"; } +.icon-external-link:before { content: "\f08e"; } + +.icon-signin:before { content: "\f090"; } +.icon-trophy:before { content: "\f091"; } +.icon-github-sign:before { content: "\f092"; } +.icon-upload-alt:before { content: "\f093"; } +.icon-lemon:before { content: "\f094"; } +.icon-phone:before { content: "\f095"; } +.icon-check-empty:before { content: "\f096"; } +.icon-bookmark-empty:before { content: "\f097"; } +.icon-phone-sign:before { content: "\f098"; } +.icon-twitter:before { content: "\f099"; } +.icon-facebook:before { content: "\f09a"; } +.icon-github:before { content: "\f09b"; } +.icon-unlock:before { content: "\f09c"; } +.icon-credit-card:before { content: "\f09d"; } +.icon-rss:before { content: "\f09e"; } + +.icon-hdd:before { content: "\f0a0"; } +.icon-bullhorn:before { content: "\f0a1"; } +.icon-bell:before { content: "\f0a2"; } +.icon-certificate:before { content: "\f0a3"; } +.icon-hand-right:before { content: "\f0a4"; } +.icon-hand-left:before { content: "\f0a5"; } +.icon-hand-up:before { content: "\f0a6"; } +.icon-hand-down:before { content: "\f0a7"; } +.icon-circle-arrow-left:before { content: "\f0a8"; } +.icon-circle-arrow-right:before { content: "\f0a9"; } +.icon-circle-arrow-up:before { content: "\f0aa"; } +.icon-circle-arrow-down:before { content: "\f0ab"; } +.icon-globe:before { content: "\f0ac"; } +.icon-wrench:before { content: "\f0ad"; } +.icon-tasks:before { content: "\f0ae"; } + +.icon-filter:before { content: "\f0b0"; } +.icon-briefcase:before { content: "\f0b1"; } +.icon-fullscreen:before { content: "\f0b2"; } + +.icon-group:before { content: "\f0c0"; } +.icon-link:before { content: "\f0c1"; } +.icon-cloud:before { content: "\f0c2"; } +.icon-beaker:before { content: "\f0c3"; } +.icon-cut:before { content: "\f0c4"; } +.icon-copy:before { content: "\f0c5"; } +.icon-paper-clip:before { content: "\f0c6"; } +.icon-save:before { content: "\f0c7"; } +.icon-sign-blank:before { content: "\f0c8"; } +.icon-reorder:before { content: "\f0c9"; } +.icon-list-ul:before { content: "\f0ca"; } +.icon-list-ol:before { content: "\f0cb"; } +.icon-strikethrough:before { content: "\f0cc"; } +.icon-underline:before { content: "\f0cd"; } +.icon-table:before { content: "\f0ce"; } + +.icon-magic:before { content: "\f0d0"; } +.icon-truck:before { content: "\f0d1"; } +.icon-pinterest:before { content: "\f0d2"; } +.icon-pinterest-sign:before { content: "\f0d3"; } +.icon-google-plus-sign:before { content: "\f0d4"; } +.icon-google-plus:before { content: "\f0d5"; } +.icon-money:before { content: "\f0d6"; } +.icon-caret-down:before { content: "\f0d7"; } +.icon-caret-up:before { content: "\f0d8"; } +.icon-caret-left:before { content: "\f0d9"; } +.icon-caret-right:before { content: "\f0da"; } +.icon-columns:before { content: "\f0db"; } +.icon-sort:before { content: "\f0dc"; } +.icon-sort-down:before { content: "\f0dd"; } +.icon-sort-up:before { content: "\f0de"; } + +.icon-envelope-alt:before { content: "\f0e0"; } +.icon-linkedin:before { content: "\f0e1"; } +.icon-undo:before { content: "\f0e2"; } +.icon-legal:before { content: "\f0e3"; } +.icon-dashboard:before { content: "\f0e4"; } +.icon-comment-alt:before { content: "\f0e5"; } +.icon-comments-alt:before { content: "\f0e6"; } +.icon-bolt:before { content: "\f0e7"; } +.icon-sitemap:before { content: "\f0e8"; } +.icon-umbrella:before { content: "\f0e9"; } +.icon-paste:before { content: "\f0ea"; } + +.icon-user-md:before { content: "\f200"; } diff --git a/lib/report/assets/css/vendor/morris.css b/lib/report/assets/css/vendor/morris.css new file mode 100755 index 0000000..99a7134 --- /dev/null +++ b/lib/report/assets/css/vendor/morris.css @@ -0,0 +1,2 @@ +.morris-hover{position:absolute;z-index:1000;}.morris-hover.morris-default-style{border-radius:10px;padding:6px;color:#666;background:rgba(255, 255, 255, 0.8);border:solid 2px rgba(230, 230, 230, 0.8);font-family:sans-serif;font-size:12px;text-align:center;}.morris-hover.morris-default-style .morris-hover-row-label{font-weight:bold;margin:0.25em 0;} +.morris-hover.morris-default-style .morris-hover-point{white-space:nowrap;margin:0.1em 0;} \ No newline at end of file diff --git a/lib/report/assets/font/fontawesome-webfont.eot b/lib/report/assets/font/fontawesome-webfont.eot new file mode 100755 index 0000000..89070c1 Binary files /dev/null and b/lib/report/assets/font/fontawesome-webfont.eot differ diff --git a/lib/report/assets/font/fontawesome-webfont.svg b/lib/report/assets/font/fontawesome-webfont.svg new file mode 100755 index 0000000..1245f92 --- /dev/null +++ b/lib/report/assets/font/fontawesome-webfont.svg @@ -0,0 +1,255 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/lib/report/assets/font/fontawesome-webfont.ttf b/lib/report/assets/font/fontawesome-webfont.ttf new file mode 100755 index 0000000..c17e9f8 Binary files /dev/null and b/lib/report/assets/font/fontawesome-webfont.ttf differ diff --git a/lib/report/assets/font/fontawesome-webfont.woff b/lib/report/assets/font/fontawesome-webfont.woff new file mode 100755 index 0000000..09f2469 Binary files /dev/null and b/lib/report/assets/font/fontawesome-webfont.woff differ diff --git a/lib/report/assets/scripts/bundles/codemirror.js b/lib/report/assets/scripts/bundles/codemirror.js new file mode 100755 index 0000000..4e05e1d --- /dev/null +++ b/lib/report/assets/scripts/bundles/codemirror.js @@ -0,0 +1,3 @@ +window.CodeMirror=function(){"use strict";function t(i,o){if(!(this instanceof t))return new t(i,o);this.options=o=o||{};for(var a in ti)!o.hasOwnProperty(a)&&ti.hasOwnProperty(a)&&(o[a]=ti[a]);h(o);var u=this.display=e(i);u.wrapper.CodeMirror=this,l(this),o.autofocus&&!$r&&J(this),this.view=n(new An([new Mn([yn("",null,q(u))])])),this.nextOpId=0,r(this),s(this),o.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),this.setValue(o.value||""),Er&&setTimeout(or(Q,this,!0),20),this.view.history=jn(),ee(this);var c;try{c=document.activeElement==u.input}catch(f){}c||o.autofocus&&!$r?setTimeout(or(me,this),20):ye(this),Y(this,function(){for(var t in Jr)Jr.propertyIsEnumerable(t)&&Jr[t](this,o[t],ei);for(var e=0;oi.length>e;++e)oi[e](this)})()}function e(t){var e={},n=e.input=lr("textarea",null,null,"position: absolute; padding: 0; width: 1px; height: 1em; outline: none;");n.setAttribute("wrap","off"),n.setAttribute("autocorrect","off"),n.setAttribute("autocapitalize","off"),e.inputDiv=lr("div",[n],null,"overflow: hidden; position: relative; width: 3px; height: 0px;"),e.scrollbarH=lr("div",[lr("div",null,null,"height: 1px")],"CodeMirror-hscrollbar"),e.scrollbarV=lr("div",[lr("div",null,null,"width: 1px")],"CodeMirror-vscrollbar"),e.scrollbarFiller=lr("div",null,"CodeMirror-scrollbar-filler"),e.lineDiv=lr("div"),e.selectionDiv=lr("div",null,null,"position: relative; z-index: 1"),e.cursor=lr("pre"," ","CodeMirror-cursor"),e.otherCursor=lr("pre"," ","CodeMirror-cursor CodeMirror-secondarycursor"),e.measure=lr("div",null,"CodeMirror-measure"),e.lineSpace=lr("div",[e.measure,e.selectionDiv,e.lineDiv,e.cursor,e.otherCursor],null,"position: relative; outline: none"),e.mover=lr("div",[lr("div",[e.lineSpace],"CodeMirror-lines")],null,"position: relative"),e.sizer=lr("div",[e.mover],"CodeMirror-sizer"),e.heightForcer=lr("div"," ",null,"position: absolute; height: "+ci+"px"),e.gutters=lr("div",null,"CodeMirror-gutters"),e.lineGutter=null;var r=lr("div",[e.sizer,e.heightForcer,e.gutters],null,"position: relative; min-height: 100%");return e.scroller=lr("div",[r],"CodeMirror-scroll"),e.scroller.setAttribute("tabIndex","-1"),e.wrapper=lr("div",[e.inputDiv,e.scrollbarH,e.scrollbarV,e.scrollbarFiller,e.scroller],"CodeMirror"),Br&&(e.gutters.style.zIndex=-1,e.scroller.style.paddingRight=0),t.appendChild?t.appendChild(e.wrapper):t(e.wrapper),qr&&(n.style.width="0px"),Hr||(e.scroller.draggable=!0),zr?(e.inputDiv.style.height="1px",e.inputDiv.style.position="absolute"):Br&&(e.scrollbarH.style.minWidth=e.scrollbarV.style.minWidth="18px"),e.viewOffset=e.showingFrom=e.showingTo=e.lastSizeC=0,e.lineNumWidth=e.lineNumInnerWidth=e.lineNumChars=null,e.prevInput="",e.alignWidgets=!1,e.pollingFast=!1,e.poll=new Qn,e.draggingText=!1,e.cachedCharWidth=e.cachedTextHeight=null,e.measureLineCache=[],e.measureLineCachePos=0,e.inaccurateSelection=!1,e.pasteIncoming=!1,e}function n(t){var e={line:0,ch:0};return{doc:t,frontier:0,highlight:new Qn,sel:{from:e,to:e,head:e,anchor:e,shift:!1,extend:!1},scrollTop:0,scrollLeft:0,overwrite:!1,focused:!1,maxLine:En(t,0),maxLineLength:0,maxLineChanged:!1,suppressEdits:!1,goalColumn:null,cantEdit:!1,keyMaps:[]}}function r(e){var n=e.view.doc;e.view.mode=t.getMode(e.options,e.options.mode),n.iter(0,n.size,function(t){t.stateAfter=null}),e.view.frontier=0,N(e,100)}function i(t){var e=t.view.doc,n=q(t.display);if(t.options.lineWrapping){t.display.wrapper.className+=" CodeMirror-wrap";var r=t.display.scroller.clientWidth/$(t.display)-3;e.iter(0,e.size,function(t){if(0!=t.height){var e=Math.ceil(t.text.length/r)||1;1!=e&&Bn(t,e*n)}}),t.display.sizer.style.minWidth=""}else t.display.wrapper.className=t.display.wrapper.className.replace(" CodeMirror-wrap",""),c(t.view),e.iter(0,e.size,function(t){0!=t.height&&Bn(t,n)});U(t,0,e.size),j(t),setTimeout(function(){f(t.display,t.view.doc.height)},100)}function o(t){var e=ai[t.options.keyMap].style;t.display.wrapper.className=t.display.wrapper.className.replace(/\s*cm-keymap-\S+/g,"")+(e?" cm-keymap-"+e:"")}function s(t){t.display.wrapper.className=t.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+t.options.theme.replace(/(^|\s)\s*/g," cm-s-"),j(t)}function a(t){l(t),y(t,!0)}function l(t){var e=t.display.gutters,n=t.options.gutters;ur(e);for(var r=0;n.length>r;++r){var i=n[r],o=e.appendChild(lr("div",null,"CodeMirror-gutter "+i));"CodeMirror-linenumbers"==i&&(t.display.lineGutter=o,o.style.width=(t.display.lineNumWidth||1)+"px")}e.style.display=r?"":"none"}function u(t,e){if(0==e.height)return 0;for(var n,r=e.text.length,i=e;n=ln(i);){var o=n.find();i=En(t,o.from.line),r+=o.from.ch-o.to.ch}for(i=e;n=un(i);){var o=n.find();r-=i.text.length-o.from.ch,i=En(t,o.to.line),r+=i.text.length-o.to.ch}return r}function c(t){t.maxLine=En(t.doc,0),t.maxLineLength=u(t.doc,t.maxLine),t.maxLineChanged=!0,t.doc.iter(1,t.doc.size,function(e){var n=u(t.doc,e);n>t.maxLineLength&&(t.maxLineLength=n,t.maxLine=e)})}function h(t){for(var e=!1,n=0;t.gutters.length>n;++n)"CodeMirror-linenumbers"==t.gutters[n]&&(t.lineNumbers?e=!0:t.gutters.splice(n--,1));!e&&t.lineNumbers&&t.gutters.push("CodeMirror-linenumbers")}function f(t,e){var n=e+2*B(t);t.sizer.style.minHeight=t.heightForcer.style.top=n+"px";var r=Math.max(n,t.scroller.scrollHeight),i=t.scroller.scrollWidth>t.scroller.clientWidth,o=r>t.scroller.clientHeight;o?(t.scrollbarV.style.display="block",t.scrollbarV.style.bottom=i?fr(t.measure)+"px":"0",t.scrollbarV.firstChild.style.height=r-t.scroller.clientHeight+t.scrollbarV.clientHeight+"px"):t.scrollbarV.style.display="",i?(t.scrollbarH.style.display="block",t.scrollbarH.style.right=o?fr(t.measure)+"px":"0",t.scrollbarH.firstChild.style.width=t.scroller.scrollWidth-t.scroller.clientWidth+t.scrollbarH.clientWidth+"px"):t.scrollbarH.style.display="",i&&o?(t.scrollbarFiller.style.display="block",t.scrollbarFiller.style.height=t.scrollbarFiller.style.width=fr(t.measure)+"px"):t.scrollbarFiller.style.display="",Wr&&0===fr(t.measure)&&(t.scrollbarV.style.minWidth=t.scrollbarH.style.minHeight=Pr?"18px":"12px")}function p(t,e,n){var r=t.scroller.scrollTop,i=t.wrapper.clientHeight;"number"==typeof n?r=n:n&&(r=n.top,i=n.bottom-n.top),r=Math.floor(r-B(t));var o=Math.ceil(r+i);return{from:Hn(e,r),to:Hn(e,o)}}function d(t){var e=t.display;if(e.alignWidgets||e.gutters.firstChild){for(var n=m(e)-e.scroller.scrollLeft+t.view.scrollLeft,r=e.gutters.offsetWidth,i=n+"px",o=e.lineDiv.firstChild;o;o=o.nextSibling)if(o.alignable)for(var s=0,a=o.alignable;a.length>s;++s)a[s].style.left=i;e.gutters.style.left=n+r+"px"}}function g(t){if(!t.options.lineNumbers)return!1;var e=t.view.doc,n=v(t.options,e.size-1),r=t.display;if(n.length!=r.lineNumChars){var i=r.measure.appendChild(lr("div",[lr("div",n)],"CodeMirror-linenumber CodeMirror-gutter-elt")),o=i.firstChild.offsetWidth,s=i.offsetWidth-o;return r.lineGutter.style.width="",r.lineNumInnerWidth=Math.max(o,r.lineGutter.offsetWidth-s),r.lineNumWidth=r.lineNumInnerWidth+s,r.lineNumChars=r.lineNumInnerWidth?n.length:-1,r.lineGutter.style.width=r.lineNumWidth+"px",!0}return!1}function v(t,e){return t.lineNumberFormatter(e+t.firstLineNumber)+""}function m(t){return t.scroller.getBoundingClientRect().left-t.sizer.getBoundingClientRect().left}function y(t,e,n){var r=t.display.showingFrom,i=t.display.showingTo,o=x(t,e,n);return o&&(Kn(t,t,"update",t),(t.display.showingFrom!=r||t.display.showingTo!=i)&&Kn(t,t,"viewportChange",t,t.display.showingFrom,t.display.showingTo)),_(t),f(t.display,t.view.doc.height),o}function x(t,e,n){var r=t.display,i=t.view.doc;if(!r.wrapper.clientWidth)return r.showingFrom=r.showingTo=r.viewOffset=0,void 0;var o=p(r,i,n);if(!(e!==!0&&0==e.length&&o.from>r.showingFrom&&o.tos;++s)for(var a,l=e[s];a=ln(En(i,l.from));){var u=a.find().from.line;l.diff&&(l.diff-=l.from-u),l.from=u}var c=e===!0?0:1/0;if(t.options.lineNumbers&&e&&e!==!0)for(var s=0;e.length>s;++s)if(e[s].diff){c=e[s].from;break}var u=Math.max(o.from-t.options.viewportMargin,0),h=Math.min(i.size,o.to+t.options.viewportMargin);if(u>r.showingFrom&&20>u-r.showingFrom&&(u=r.showingFrom),r.showingTo>h&&20>r.showingTo-h&&(h=Math.min(i.size,r.showingTo)),Yr)for(u=Dn(cn(i,En(i,u)));i.size>h&&hn(En(i,h));)++h;for(var f=e===!0?[]:b([{from:r.showingFrom,to:r.showingTo}],e),d=0,s=0;f.length>s;++s){var v=f[s];u>v.from&&(v.from=u),v.to>h&&(v.to=h),v.from>=v.to?f.splice(s--,1):d+=v.to-v.from}if(d!=h-u||u!=r.showingFrom||h!=r.showingTo){f.sort(function(t,e){return t.from-e.from}),.7*(h-u)>d&&(r.lineDiv.style.display="none"),C(t,u,h,f,c),r.lineDiv.style.display="";var m=u!=r.showingFrom||h!=r.showingTo||r.lastSizeC!=r.wrapper.clientHeight;m&&(r.lastSizeC=r.wrapper.clientHeight),r.showingFrom=u,r.showingTo=h,N(t,100);for(var y,x=r.lineDiv.offsetTop,w=r.lineDiv.firstChild;w;w=w.nextSibling)if(w.lineObj){if(Br){var k=w.offsetTop+w.offsetHeight;y=k-x,x=k}else{var _=w.getBoundingClientRect();y=_.bottom-_.top}var S=w.lineObj.height-y;2>y&&(y=q(r)),(S>.001||-.001>S)&&Bn(w.lineObj,y)}return r.viewOffset=Fn(t,En(i,u)),r.mover.style.top=r.viewOffset+"px",!0}}}function b(t,e){for(var n=0,r=e.length||0;r>n;++n){for(var i=e[n],o=[],s=i.diff||0,a=0,l=t.length;l>a;++a){var u=t[a];i.to<=u.from&&i.diff?o.push({from:u.from+s,to:u.to+s}):i.to<=u.from||i.from>=u.to?o.push(u):(i.from>u.from&&o.push({from:u.from,to:i.from}),i.to=h.from&&h.to>f){for(;c.lineObj!=e;)c=o(c);l&&f>=i&&c.lineNumber&&hr(c.lineNumber,v(t.options,f)),c=c.nextSibling}else{var n=k(t,e,f,s);u.insertBefore(n,c),n.lineObj=e}++f});c;)c=o(c)}function k(t,e,n,r){var i=_n(t,e),o=e.gutterMarkers,s=t.display;if(!(t.options.lineNumbers||o||e.bgClass||e.wrapClass||e.widgets&&e.widgets.length))return i;var a=lr("div",null,e.wrapClass,"position: relative");if(t.options.lineNumbers||o){var l=a.appendChild(lr("div",null,null,"position: absolute; left: "+r.fixedPos+"px"));if(a.alignable=[l],!t.options.lineNumbers||o&&o["CodeMirror-linenumbers"]||(a.lineNumber=l.appendChild(lr("div",v(t.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+s.lineNumInnerWidth+"px"))),o)for(var u=0;t.options.gutters.length>u;++u){var c=t.options.gutters[u],h=o.hasOwnProperty(c)&&o[c];h&&l.appendChild(lr("div",[h],"CodeMirror-gutter-elt","left: "+r.gutterLeft[c]+"px; width: "+r.gutterWidth[c]+"px"))}}if(e.bgClass&&a.appendChild(lr("div"," ",e.bgClass+" CodeMirror-linebackground")),a.appendChild(i),e.widgets)for(var f=0,p=e.widgets;p.length>f;++f){var d=p[f],g=lr("div",[d.node],"CodeMirror-linewidget");if(g.widget=d,d.noHScroll){(a.alignable||(a.alignable=[])).push(g);var m=r.wrapperWidth;g.style.left=r.fixedPos+"px",d.coverGutter||(m-=r.gutterTotalWidth,g.style.paddingLeft=r.gutterTotalWidth+"px"),g.style.width=m+"px"}d.coverGutter&&(g.style.zIndex=5,g.style.position="relative",d.noHScroll||(g.style.marginLeft=-r.gutterTotalWidth+"px")),d.above?a.insertBefore(g,t.options.lineNumbers&&0!=e.height?l:i):a.appendChild(g)}return Br&&(a.style.zIndex=2),a}function _(t){var e=t.display,n=Se(t.view.sel.from,t.view.sel.to);n||t.options.showCursorWhenSelecting?S(t):e.cursor.style.display=e.otherCursor.style.display="none",n?e.selectionDiv.style.display="none":T(t);var r=W(t,t.view.sel.head,"div"),i=e.wrapper.getBoundingClientRect(),o=e.lineDiv.getBoundingClientRect();e.inputDiv.style.top=Math.max(0,Math.min(e.wrapper.clientHeight-10,r.top+o.top-i.top))+"px",e.inputDiv.style.left=Math.max(0,Math.min(e.wrapper.clientWidth-10,r.left+o.left-i.left))+"px"}function S(t){var e=t.display,n=W(t,t.view.sel.head,"div");e.cursor.style.left=n.left+"px",e.cursor.style.top=n.top+"px",e.cursor.style.height=Math.max(0,n.bottom-n.top)*t.options.cursorHeight+"px",e.cursor.style.display="",n.other?(e.otherCursor.style.display="",e.otherCursor.style.left=n.other.left+"px",e.otherCursor.style.top=n.other.top+"px",e.otherCursor.style.height=.85*(n.other.bottom-n.other.top)+"px"):e.otherCursor.style.display="none"}function T(t){function e(t,e,n,r){0>e&&(e=0),s.appendChild(lr("div",null,"CodeMirror-selected","position: absolute; left: "+t+"px; top: "+e+"px; width: "+(null==n?a-t:n)+"px; height: "+(r-e)+"px"))}function n(n,r,o,s){function u(e){return z(t,{line:n,ch:e},"div",c)}var c=En(i,n),h=c.text.length,f=s?1/0:-1/0;return dr(On(c),r||0,null==o?h:o,function(t,n,i){var c=u("rtl"==i?n-1:t),p=u("rtl"==i?t:n-1),d=c.left,g=p.right;p.top-c.top>3&&(e(d,c.top,null,c.bottom),d=l,c.bottomd&&(d=l),e(d,p.top,g-d,p.bottom)}),f}var r=t.display,i=t.view.doc,o=t.view.sel,s=document.createDocumentFragment(),a=r.lineSpace.offsetWidth,l=D(t.display);if(o.from.line==o.to.line)n(o.from.line,o.from.ch,o.to.ch);else{for(var u,c,h=En(i,o.from.line),f=h,p=[o.from.line,o.from.ch];u=un(f);){var d=u.find();if(p.push(d.from.ch,d.to.line,d.to.ch),d.to.line==o.to.line){p.push(o.to.ch),c=!0;break}f=En(i,d.to.line)}if(c)for(var g=0;p.length>g;g+=3)n(p[g],p[g+1],p[g+2]);else{var v,m,y=En(i,o.to.line);v=o.from.ch?n(o.from.line,o.from.ch,null,!1):Fn(t,h)-r.viewOffset,m=o.to.ch?n(o.to.line,ln(y)?null:0,o.to.ch,!0):Fn(t,y)-r.viewOffset,m>v&&e(l,v,null,m)}}cr(r.selectionDiv,s),r.selectionDiv.style.display=""}function L(t){var e=t.display;clearInterval(e.blinker);var n=!0;e.cursor.style.visibility=e.otherCursor.style.visibility="",e.blinker=setInterval(function(){e.cursor.offsetHeight&&(e.cursor.style.visibility=e.otherCursor.style.visibility=(n=!n)?"":"hidden")},t.options.cursorBlinkRate)}function N(t,e){t.view.frontier=t.display.showingTo)){var r,i=+new Date+t.options.workTime,o=Ve(e.mode,E(t,e.frontier)),s=[];n.iter(e.frontier,Math.min(n.size,t.display.showingTo+500),function(n){return e.frontier>=t.display.showingFrom?(wn(t,n,o)&&e.frontier>=t.display.showingFrom&&(r&&r.end==e.frontier?r.end++:s.push(r={start:e.frontier,end:e.frontier+1})),n.stateAfter=Ve(e.mode,o)):(Cn(t,n,o),n.stateAfter=0==e.frontier%5?Ve(e.mode,o):null),++e.frontier,+new Date>i?(N(t,t.options.workDelay),!0):void 0}),s.length&&Y(t,function(){for(var t=0;s.length>t;++t)U(this,s[t].start,s[t].end)})()}}function A(t,e){for(var n,r,i=t.view.doc,o=e,s=e-100;o>s;--o){if(0==o)return 0;var a=En(i,o-1);if(a.stateAfter)return o;var l=Jn(a.text,null,t.options.tabSize);(null==r||n>l)&&(r=o-1,n=l)}return r}function E(t,e){var n=t.view,r=A(t,e),i=r&&En(n.doc,r-1).stateAfter;return i=i?Ve(n.mode,i):Xe(n.mode),n.doc.iter(r,e,function(o){Cn(t,o,i);var s=r==e-1||0==r%5||r>=n.showingFrom&&n.showingTo>r;o.stateAfter=s?Ve(n.mode,i):null,++r}),i}function B(t){return t.lineSpace.offsetTop}function D(t){var e=cr(t.measure,lr("pre")).appendChild(lr("span","x"));return e.offsetLeft}function H(t,e,n,r){for(var r=r||F(t,e),i=-1,o=n;;o+=i){var s=r[o];if(s)break;0>i&&0==o&&(i=1)}return{left:n>o?s.right:s.left,right:o>n?s.left:s.right,top:s.top,bottom:s.bottom}}function F(t,e){for(var n=t.display,r=t.display.measureLineCache,i=0;r.length>i;++i){var o=r[i];if(o.text==e.text&&o.markedSpans==e.markedSpans&&n.scroller.clientWidth==o.width)return o.measure}var s=O(t,e),o={text:e.text,width:n.scroller.clientWidth,markedSpans:e.markedSpans,measure:s};return 16==r.length?r[++n.measureLineCachePos%16]=o:r.push(o),s}function O(t,e){var n=t.display,r=ir(e.text.length),i=_n(t,e,r);if(Er&&!Br&&!t.options.lineWrapping&&i.childNodes.length>100){for(var o=document.createDocumentFragment(),s=10,a=i.childNodes.length,l=0,u=Math.ceil(a/s);u>l;++l){for(var c=lr("div",null,null,"display: inline-block"),h=0;s>h&&a;++h)c.appendChild(i.firstChild),--a;o.appendChild(c)}i.appendChild(o)}cr(n.measure,i);for(var f,p=n.lineDiv.getBoundingClientRect(),d=[],g=ir(e.text.length),v=i.offsetHeight,l=0;r.length>l;++l)if(f=r[l]){for(var m=f.getBoundingClientRect(),y=Math.max(0,m.top-p.top),x=Math.min(m.bottom-p.top,v),h=0;d.length>h;h+=2){var b=d[h],w=d[h+1];if(!(b>x||y>w)&&(y>=b&&w>=x||b>=y&&x>=w||Math.min(x,w)-Math.max(y,b)>=x-y>>1)){d[h]=Math.min(y,b),d[h+1]=Math.max(x,w);break}}h==d.length&&d.push(y,x),g[l]={left:m.left-p.left,right:m.right-p.left,top:h}}for(var f,l=0;g.length>l;++l)if(f=g[l]){var C=f.top;f.top=d[C],f.bottom=d[C+1]}return g}function j(t){t.display.measureLineCache.length=t.display.measureLineCachePos=0,t.display.cachedCharWidth=t.display.cachedTextHeight=null,t.view.maxLineChanged=!0}function I(t,e,n,r){if(e.widgets)for(var i=0;e.widgets.length>i;++i)if(e.widgets[i].above){var o=e.widgets[i].node.offsetHeight;n.top+=o,n.bottom+=o}if("line"==r)return n;r||(r="local");var s=Fn(t,e);if("local"!=r&&(s-=t.display.viewOffset),"page"==r){var a=t.display.lineSpace.getBoundingClientRect();s+=a.top+(window.pageYOffset||(document.documentElement||document.body).scrollTop);var l=a.left+(window.pageXOffset||(document.documentElement||document.body).scrollLeft);n.left+=l,n.right+=l}return n.top+=s,n.bottom+=s,n}function z(t,e,n,r){return r||(r=En(t.view.doc,e.line)),I(t,r,H(t,r,e.ch),n)}function W(t,e,n,r,i){function o(e,o){var s=H(t,r,e,i);return o?s.left=s.right:s.right=s.left,I(t,r,s,n)}r=r||En(t.view.doc,e.line),i||(i=F(t,r));var s=On(r),a=e.ch;if(!s)return o(a);for(var l,u,c=s[0].level,h=0;s.length>h;++h){var f,p,d=s[h],g=d.level%2;if(a>d.from&&d.to>a)return o(a,g);var v=g?d.to:d.from,m=g?d.from:d.to;if(v==a)p=h&&d.level<(f=s[h-1]).level?o(f.level%2?f.from:f.to-1,!0):o(g&&d.from!=d.to?a-1:a),g==c?l=p:u=p;else if(m==a){var f=s.length-1>h&&s[h+1];if(!g&&f&&f.from==f.to)continue;p=f&&d.leveln)return{line:0,ch:0,outside:!0};var i=Hn(r,n);if(i>=r.size)return{line:r.size-1,ch:En(r,r.size-1).text.length};for(0>e&&(e=0);;){var o=En(r,i),s=R(t,o,i,e,n),a=un(o);if(!a||s.ch!=yr(o))return s;i=a.find().to.line}}function R(t,e,n,r,i){function o(r){var i=W(t,{line:n,ch:r},"line",e,u);return a=!0,s>i.bottom?Math.max(0,i.left-l):i.top>s?i.left+l:(a=!1,i.left)}var s=i-Fn(t,e),a=!1,l=t.display.wrapper.clientWidth,u=F(t,e),c=On(e),h=e.text.length,f=mr(e),p=yr(e),d=D(t.display),g=o(p);if(r>g)return{line:n,ch:p,outside:a};for(;;){if(c?p==f||p==wr(e,f,1):1>=p-f){for(var v=g-r>r-d,m=v?f:p;di.test(e.text.charAt(m));)++m;return{line:n,ch:m,after:v,outside:a}}var y=Math.ceil(h/2),x=f+y;if(c){x=f;for(var b=0;y>b;++b)x=wr(e,x,1)}var w=o(x);w>r?(p=x,g=w,a&&(g+=1e3),h-=y):(f=x,d=w,h=y)}}function q(t){if(null!=t.cachedTextHeight)return t.cachedTextHeight;if(null==kr){kr=lr("pre");for(var e=0;49>e;++e)kr.appendChild(document.createTextNode("x")),kr.appendChild(lr("br"));kr.appendChild(document.createTextNode("x"))}cr(t.measure,kr);var n=kr.offsetHeight/50;return n>3&&(t.cachedTextHeight=n),ur(t.measure),n||1}function $(t){if(null!=t.cachedCharWidth)return t.cachedCharWidth;var e=lr("span","x"),n=lr("pre",[e]);cr(t.measure,n);var r=e.offsetWidth;return r>2&&(t.cachedCharWidth=r),r||10}function V(t){t.curOp?++t.curOp.depth:t.curOp={depth:1,changes:[],delayedCallbacks:[],updateInput:null,userSelChange:null,textChanged:null,selectionChanged:!1,updateMaxLine:!1,id:++t.nextOpId}}function X(t){var e=t.curOp;if(!--e.depth){t.curOp=null;var n=t.view,r=t.display;if(e.updateMaxLine&&c(n),n.maxLineChanged&&!t.options.lineWrapping){var i=H(t,n.maxLine,n.maxLine.text.length).right;r.sizer.style.minWidth=i+3+ci+"px",n.maxLineChanged=!1}var o,s;if(e.selectionChanged){var a=W(t,n.sel.head);o=Ie(t,a.left,a.top,a.left,a.bottom)}(e.changes.length||o&&null!=o.scrollTop)&&(s=y(t,e.changes,o&&o.scrollTop)),!s&&e.selectionChanged&&_(t),o&&Fe(t),e.selectionChanged&&L(t),n.focused&&e.updateInput&&Q(t,e.userSelChange),e.textChanged&&Gn(t,"change",t,e.textChanged),e.selectionChanged&&Gn(t,"cursorActivity",t);for(var l=0;e.delayedCallbacks.length>l;++l)e.delayedCallbacks[l](t)}}function Y(t,e){return function(){var n=t||this;V(n);try{var r=e.apply(n,arguments)}finally{X(n)}return r}}function U(t,e,n,r){t.curOp.changes.push({from:e,to:n,diff:r})}function G(t){t.view.pollingFast||t.display.poll.set(t.options.pollInterval,function(){Z(t),t.view.focused&&G(t)})}function K(t){function e(){var r=Z(t);r||n?(t.display.pollingFast=!1,G(t)):(n=!0,t.display.poll.set(60,e))}var n=!1;t.display.pollingFast=!0,t.display.poll.set(20,e)}function Z(t){var e=t.display.input,n=t.display.prevInput,r=t.view,i=r.sel;if(!r.focused||bi(e)||te(t))return!1;var o=e.value;if(o==n&&Se(i.from,i.to))return!1;V(t),r.sel.shift=!1;for(var s=0,a=Math.min(n.length,o.length);a>s&&n[s]==o[s];)++s;var l=i.from,u=i.to;n.length>s?l={line:l.line,ch:l.ch-(n.length-s)}:r.overwrite&&Se(l,u)&&!t.display.pasteIncoming&&(u={line:u.line,ch:Math.min(En(t.view.doc,u.line).text.length,u.ch+(o.length-s))});var c=t.curOp.updateInput;return be(t,l,u,xi(o.slice(s)),"end",t.display.pasteIncoming?"paste":"input",{from:l,to:u}),t.curOp.updateInput=c,o.length>1e3?e.value=t.display.prevInput="":t.display.prevInput=o,X(t),t.display.pasteIncoming=!1,!0}function Q(t,e){var n,r,i=t.view;Se(i.sel.from,i.sel.to)?e&&(t.display.prevInput=t.display.input.value=""):(t.display.prevInput="",n=wi&&(i.sel.to.line-i.sel.from.line>100||(r=t.getSelection()).length>1e3),t.display.input.value=n?"-":r||t.getSelection(),i.focused&&nr(t.display.input)),t.display.inaccurateSelection=n}function J(t){"nocursor"==t.options.readOnly||!Er&&document.activeElement==t.display.input||t.display.input.focus()}function te(t){return t.options.readOnly||t.view.cantEdit}function ee(t){function e(){t.view.focused&&setTimeout(or(J,t),0)}function n(e){t.options.onDragEvent&&t.options.onDragEvent(t,Wn(e))||qn(e)}function r(){i.inaccurateSelection&&(i.prevInput="",i.inaccurateSelection=!1,i.input.value=t.getSelection(),nr(i.input))}var i=t.display;Yn(i.scroller,"mousedown",Y(t,ie)),Yn(i.scroller,"dblclick",Y(t,Pn)),Yn(i.lineSpace,"selectstart",function(t){ne(i,t)||Pn(t)}),Ar||Yn(i.scroller,"contextmenu",function(e){xe(t,e)}),Yn(i.scroller,"scroll",function(){le(t,i.scroller.scrollTop),ue(t,i.scroller.scrollLeft,!0),Gn(t,"scroll",t)}),Yn(i.scrollbarV,"scroll",function(){le(t,i.scrollbarV.scrollTop)}),Yn(i.scrollbarH,"scroll",function(){ue(t,i.scrollbarH.scrollLeft)}),Yn(i.scroller,"mousewheel",function(e){ce(t,e)}),Yn(i.scroller,"DOMMouseScroll",function(e){ce(t,e)}),Yn(i.scrollbarH,"mousedown",e),Yn(i.scrollbarV,"mousedown",e),Yn(i.wrapper,"scroll",function(){i.wrapper.scrollTop=i.wrapper.scrollLeft=0}),Yn(window,"resize",function o(){i.cachedCharWidth=i.cachedTextHeight=null,j(t),i.wrapper.parentNode?y(t,!0):Un(window,"resize",o)}),Yn(i.input,"keyup",Y(t,function(e){t.options.onKeyEvent&&t.options.onKeyEvent(t,Wn(e))||16==Xn(e,"keyCode")&&(t.view.sel.shift=!1)})),Yn(i.input,"input",or(K,t)),Yn(i.input,"keydown",Y(t,ge)),Yn(i.input,"keypress",Y(t,ve)),Yn(i.input,"focus",or(me,t)),Yn(i.input,"blur",or(ye,t)),t.options.dragDrop&&(Yn(i.scroller,"dragstart",function(e){ae(t,e)}),Yn(i.scroller,"dragenter",n),Yn(i.scroller,"dragover",n),Yn(i.scroller,"drop",Y(t,oe))),Yn(i.scroller,"paste",function(){J(t),K(t)}),Yn(i.input,"paste",function(){i.pasteIncoming=!0,K(t)}),Yn(i.input,"cut",r),Yn(i.input,"copy",r),zr&&Yn(i.sizer,"mouseup",function(){document.activeElement==i.input&&i.input.blur(),J(t)})}function ne(t,e){for(var n=$n(e);n!=t.wrapper;n=n.parentNode)if(/\bCodeMirror-(?:line)?widget\b/.test(n.className)||n.parentNode==t.sizer&&n!=t.mover)return!0}function re(t,e,n){var r=t.display;if(!n){var i=$n(e);if(i==r.scrollbarH||i==r.scrollbarH.firstChild||i==r.scrollbarV||i==r.scrollbarV.firstChild||i==r.scrollbarFiller)return null}var o,s,a=r.lineSpace.getBoundingClientRect();try{o=e.clientX,s=e.clientY}catch(e){return null}return P(t,o-a.left,s-a.top)}function ie(t){function e(t){if("single"==h)return Ee(i,Me(l,u),t),void 0;if(v=Me(l,v),m=Me(l,m),"double"==h){var e=Re(En(l,t.line).text,t);Te(t,v)?Ee(i,e.from,m):Ee(i,v,e.to)}else"triple"==h&&(Te(t,v)?Ee(i,m,Me(l,{line:t.line,ch:0})):Ee(i,v,Me(l,{line:t.line+1,ch:0})))}function n(t){var r=++x,a=re(i,t,!0);if(a)if(Se(a,d)){var u=t.clientYy.bottom?20:0;u&&setTimeout(Y(i,function(){x==r&&(o.scroller.scrollTop+=u,n(t))}),50)}else{s.focused||me(i),d=a,e(a);var c=p(o,l);(a.line>=c.to||a.linec-400&&Se(Sr.pos,u))h="triple",Pn(t),setTimeout(or(J,i),20),qe(i,u.line);else if(_r&&_r.time>c-400&&Se(_r.pos,u)){h="double",Sr={time:c,pos:u},Pn(t);var f=Re(En(l,u.line).text,u);Ee(i,f.from,f.to)}else _r={time:c,pos:u};var d=u;if(i.options.dragDrop&&gi&&!te(i)&&!Se(a.from,a.to)&&!Te(u,a.from)&&!Te(a.to,u)&&"single"==h){var g=Y(i,function(e){Hr&&(o.scroller.draggable=!1),s.draggingText=!1,Un(document,"mouseup",g),Un(o.scroller,"drop",g),10>Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)&&(Pn(e),Ee(i,u),J(i))});return Hr&&(o.scroller.draggable=!0),s.draggingText=g,o.scroller.dragDrop&&o.scroller.dragDrop(),Yn(document,"mouseup",g),Yn(o.scroller,"drop",g),void 0}Pn(t),"single"==h&&Ee(i,Me(l,u));var v=a.from,m=a.to,y=o.wrapper.getBoundingClientRect(),x=0,b=Y(i,function(t){Er||Vn(t)?n(t):r(t)}),w=Y(i,r);Yn(document,"mousemove",b),Yn(document,"mouseup",w)}}function oe(t){var e=this;if(!e.options.onDragEvent||!e.options.onDragEvent(e,Wn(t))){Pn(t);var n=re(e,t,!0),r=t.dataTransfer.files;if(n&&!te(e))if(r&&r.length&&window.FileReader&&window.File)for(var i=r.length,o=Array(i),s=0,a=function(t,r){var a=new FileReader;a.onload=function(){o[r]=a.result,++s==i&&(n=Me(e.view.doc,n),Y(e,function(){var t=_e(e,o.join(""),n,n,"paste");Be(e,n,t)})())},a.readAsText(t)},l=0;i>l;++l)a(r[l],l);else{if(e.view.draggingText&&!Te(n,e.view.sel.from)&&!Te(e.view.sel.to,n))return e.view.draggingText(t),Er&&setTimeout(or(J,e),50),void 0;try{var o=t.dataTransfer.getData("Text");if(o){var u=e.view.sel.from,c=e.view.sel.to;Be(e,n,n),e.view.draggingText&&_e(e,"",u,c,"paste"),e.replaceSelection(o,null,"paste"),J(e),me(e)}}catch(t){}}}}function se(t,e){var n=t.display;try{var r=e.clientX,i=e.clientY}catch(e){return!1}if(r>=Math.floor(n.gutters.getBoundingClientRect().right))return!1;if(Pn(e),!Zn(t,"gutterClick"))return!0;var o=n.lineDiv.getBoundingClientRect();if(i>o.bottom)return!0;i-=o.top-n.viewOffset;for(var s=0;t.options.gutters.length>s;++s){var a=n.gutters.childNodes[s];if(a&&a.getBoundingClientRect().right>=r){var l=Hn(t.view.doc,i),u=t.options.gutters[s];Kn(t,t,"gutterClick",t,l,u,e);break}}return!0}function ae(t,e){var n=t.getSelection();e.dataTransfer.setData("Text",n),e.dataTransfer.setDragImage&&!Ir&&e.dataTransfer.setDragImage(lr("img"),0,0)}function le(t,e){2>Math.abs(t.view.scrollTop-e)||(t.view.scrollTop=e,Ar||y(t,[],e),t.display.scroller.scrollTop!=e&&(t.display.scroller.scrollTop=e),t.display.scrollbarV.scrollTop!=e&&(t.display.scrollbarV.scrollTop=e),Ar&&y(t,[]))}function ue(t,e,n){(n?e==t.view.scrollLeft:2>Math.abs(t.view.scrollLeft-e))||(t.view.scrollLeft=e,d(t),t.display.scroller.scrollLeft!=e&&(t.display.scroller.scrollLeft=e),t.display.scrollbarH.scrollLeft!=e&&(t.display.scrollbarH.scrollLeft=e))}function ce(t,e){var n=e.wheelDeltaX,r=e.wheelDeltaY;if(null==n&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(n=e.detail),null==r&&e.detail&&e.axis==e.VERTICAL_AXIS?r=e.detail:null==r&&(r=e.wheelDelta),r&&Vr&&Hr)for(var i=e.target;i!=o;i=i.parentNode)if(i.lineObj){t.display.currentWheelTarget=i;break}var o=t.display.scroller;if(n&&!Ar&&!jr&&null!=Gr)return r&&le(t,Math.max(0,Math.min(o.scrollTop+r*Gr,o.scrollHeight-o.clientHeight))),ue(t,Math.max(0,Math.min(o.scrollLeft+n*Gr,o.scrollWidth-o.clientWidth))),Pn(e),Nr=null,void 0;if(r&&null!=Gr){var s=r*Gr,a=t.view.scrollTop,l=a+t.display.wrapper.clientHeight;0>s?a=Math.max(0,a+s-50):l=Math.min(t.view.doc.height,l+s+50),y(t,[],{top:a,bottom:l})}20>Ur&&(null==Nr?(Nr=o.scrollLeft,Mr=o.scrollTop,Tr=n,Lr=r,setTimeout(function(){if(null!=Nr){var t=o.scrollLeft-Nr,e=o.scrollTop-Mr,n=e&&Lr&&e/Lr||t&&Tr&&t/Tr;Nr=Mr=null,n&&(Gr=(Gr*Ur+n)/(Ur+1),++Ur)}},200)):(Tr+=n,Lr+=r))}function he(t,e,n){if("string"==typeof e&&(e=si[e],!e))return!1;t.display.pollingFast&&Z(t)&&(t.display.pollingFast=!1);var r=t.view,i=r.sel.shift;try{te(t)&&(r.suppressEdits=!0),n&&(r.sel.shift=!1),e(t)}catch(o){if(o!=hi)throw o;return!1}finally{r.sel.shift=i,r.suppressEdits=!1}return!0}function fe(t){var e=t.view.keyMaps.slice(0);return e.push(t.options.keyMap),t.options.extraKeys&&e.unshift(t.options.extraKeys),e}function pe(t,e){function n(){l=!0}var r=Ye(t.options.keyMap),i=r.auto;clearTimeout(Kr),i&&!Ge(e)&&(Kr=setTimeout(function(){Ye(t.options.keyMap)==r&&(t.options.keyMap=i.call?i.call(null,t):i)},50));var o=Ci[Xn(e,"keyCode")],s=!1,a=Vr&&(jr||Fr);if(null==o||e.altGraphKey)return!1;Xn(e,"altKey")&&(o="Alt-"+o),Xn(e,a?"metaKey":"ctrlKey")&&(o="Ctrl-"+o),Xn(e,a?"ctrlKey":"metaKey")&&(o="Cmd-"+o);var l=!1,u=fe(t);return s=Xn(e,"shiftKey")?Ue("Shift-"+o,u,function(e){return he(t,e,!0)},n)||Ue(o,u,function(e){return"string"==typeof e&&/^go[A-Z]/.test(e)?he(t,e):void 0},n):Ue(o,u,function(e){return he(t,e)},n),l&&(s=!1),s&&(Pn(e),L(t),Dr&&(e.oldKeyCode=e.keyCode,e.keyCode=0)),s}function de(t,e,n){var r=Ue("'"+n+"'",fe(t),function(e){return he(t,e,!0)});return r&&(Pn(e),L(t)),r}function ge(t){var e=this;if(e.view.focused||me(e),Er&&27==t.keyCode&&(t.returnValue=!1),!e.options.onKeyEvent||!e.options.onKeyEvent(e,Wn(t))){var n=Xn(t,"keyCode");e.view.sel.shift=16==n||Xn(t,"shiftKey");var r=pe(e,t);jr&&(Qr=r?n:null,r||88!=n||wi||!Xn(t,Vr?"metaKey":"ctrlKey")||e.replaceSelection(""))}}function ve(t){var e=this;if(!e.options.onKeyEvent||!e.options.onKeyEvent(e,Wn(t))){var n=Xn(t,"keyCode"),r=Xn(t,"charCode");if(jr&&n==Qr)return Qr=null,Pn(t),void 0;if(!(jr&&(!t.which||10>t.which)||zr)||!pe(e,t)){var i=String.fromCharCode(null==r?n:r);this.options.electricChars&&this.view.mode.electricChars&&this.options.smartIndent&&!te(this)&&this.view.mode.electricChars.indexOf(i)>-1&&setTimeout(Y(e,function(){ze(e,e.view.sel.to.line,"smart")}),75),de(e,t,i)||K(e)}}}function me(t){"nocursor"!=t.options.readOnly&&(t.view.focused||(Gn(t,"focus",t),t.view.focused=!0,-1==t.display.scroller.className.search(/\bCodeMirror-focused\b/)&&(t.display.scroller.className+=" CodeMirror-focused"),Q(t,!0)),G(t),L(t))}function ye(t){t.view.focused&&(Gn(t,"blur",t),t.view.focused=!1,t.display.scroller.className=t.display.scroller.className.replace(" CodeMirror-focused","")),clearInterval(t.display.blinker),setTimeout(function(){t.view.focused||(t.view.sel.shift=!1)},150)}function xe(t,e){function n(){if(r.inputDiv.style.position="relative",r.input.style.cssText=a,Dr&&(r.scrollbarV.scrollTop=r.scroller.scrollTop=s),G(t),null!=r.input.selectionStart){clearTimeout(Zr); +var e=r.input.value=" "+(Se(i.from,i.to)?"":r.input.value),n=0;r.prevInput=" ",r.input.selectionStart=1,r.input.selectionEnd=e.length,Zr=setTimeout(function o(){" "==r.prevInput&&0==r.input.selectionStart?Y(t,si.selectAll)(t):10>n++?Zr=setTimeout(o,500):Q(t)},200)}}var r=t.display,i=t.view.sel,o=re(t,e),s=r.scroller.scrollTop;if(o&&!jr){(Se(i.from,i.to)||Te(o,i.from)||!Te(o,i.to))&&Y(t,Be)(t,o,o);var a=r.input.style.cssText;r.inputDiv.style.position="absolute",r.input.style.cssText="position: fixed; width: 30px; height: 30px; top: "+(e.clientY-5)+"px; left: "+(e.clientX-5)+"px; z-index: 1000; background: white; outline: none;"+"border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",J(t),Q(t,!0),Se(i.from,i.to)&&(r.input.value=r.prevInput=" "),Ar?(qn(e),Yn(window,"mouseup",function l(){Un(window,"mouseup",l),setTimeout(n,20)})):setTimeout(n,50)}}function be(t,e,n,r,i,o){var s=Xr&&sn(t.view.doc,e,n);if(!s)return we(t,e,n,r,i,o);for(var a=s.length-1;a>=1;--a)we(t,s[a].from,s[a].to,[""],o);return s.length?we(t,s[0].from,s[0].to,r,i,o):void 0}function we(t,e,n,r,i,o){if(!t.view.suppressEdits){var s=t.view,a=s.doc,l=[];a.iter(e.line,n.line+1,function(t){l.push(gn(t.text,t.markedSpans))});var u=s.sel.from,c=s.sel.to,h=on(dn(l[0]),dn(er(l)),e.ch,n.ch,r),f=ke(t,e,n,h,i,o);return s.history&&In(t,e.line,r.length,l,o,u,c,s.sel.from,s.sel.to),f}}function Ce(t,e){var n=t.view.doc,r=t.view.history,i=("undo"==e?r.done:r.undone).pop();if(i){for(var o={events:[],fromBefore:i.fromAfter,toBefore:i.toAfter,fromAfter:i.fromBefore,toAfter:i.toBefore},s=i.events.length-1;s>=0;s-=1){r.dirtyCounter+="undo"==e?-1:1;var a=i.events[s],l=[],u=a.start+a.added;n.iter(a.start,u,function(t){l.push(gn(t.text,t.markedSpans))}),o.events.push({start:a.start,added:a.old.length,old:l});var c=s?null:{from:i.fromBefore,to:i.toBefore};ke(t,{line:a.start,ch:0},{line:u-1,ch:En(n,u-1).text.length},a.old,c,e)}("undo"==e?r.undone:r.done).push(o)}}function ke(t,e,n,r,i,o){var s=t.view,a=s.doc,l=t.display;if(!s.suppressEdits){var c=n.line-e.line,h=En(a,e.line),f=En(a,n.line),p=!1,d=e.line;t.options.lineWrapping||(d=Dn(cn(a,h)),a.iter(d,n.line+1,function(t){return u(a,t)==s.maxLineLength?(p=!0,!0):void 0}));var g=er(r),v=q(l);if(0==e.ch&&0==n.ch&&""==pn(g)){for(var m=[],y=0,x=r.length-1;x>y;++y)m.push(yn(pn(r[y]),dn(r[y]),v));xn(t,f,f.text,dn(g)),c&&a.remove(e.line,c,t),m.length&&a.insert(e.line,m)}else if(h==f)if(1==r.length)xn(t,h,h.text.slice(0,e.ch)+pn(r[0])+h.text.slice(n.ch),dn(r[0]));else{for(var m=[],y=1,x=r.length-1;x>y;++y)m.push(yn(pn(r[y]),dn(r[y]),v));m.push(yn(pn(g)+h.text.slice(n.ch),dn(g),v)),xn(t,h,h.text.slice(0,e.ch)+pn(r[0]),dn(r[0])),a.insert(e.line+1,m)}else if(1==r.length)xn(t,h,h.text.slice(0,e.ch)+pn(r[0])+f.text.slice(n.ch),dn(r[0])),a.remove(e.line+1,c,t);else{var m=[];xn(t,h,h.text.slice(0,e.ch)+pn(r[0]),dn(r[0])),xn(t,f,pn(g)+f.text.slice(n.ch),dn(g));for(var y=1,x=r.length-1;x>y;++y)m.push(yn(pn(r[y]),dn(r[y]),v));c>1&&a.remove(e.line+1,c-1,t),a.insert(e.line+1,m)}if(t.options.lineWrapping){var b=Math.max(5,l.scroller.clientWidth/$(l)-3);a.iter(e.line,e.line+r.length,function(t){if(0!=t.height){var e=(Math.ceil(t.text.length/b)||1)*v;e!=t.height&&Bn(t,e)}})}else a.iter(d,e.line+r.length,function(t){var e=u(a,t);e>s.maxLineLength&&(s.maxLine=t,s.maxLineLength=e,s.maxLineChanged=!0,p=!1)}),p&&(t.curOp.updateMaxLine=!0);s.frontier=Math.min(s.frontier,e.line),N(t,400);var w=r.length-c-1;if(U(t,e.line,n.line+1,w),Zn(t,"change")){for(var y=0;r.length>y;++y)"string"!=typeof r[y]&&(r[y]=r[y].text);var C={from:e,to:n,text:r,origin:o};if(t.curOp.textChanged){for(var k=t.curOp.textChanged;k.next;k=k.next);k.next=C}else t.curOp.textChanged=C}var _,S,T={line:e.line+r.length-1,ch:pn(g).length+(1==r.length?e.ch:0)};if(i&&"string"!=typeof i)i.from?(_=i.from,S=i.to):_=S=i;else if("end"==i)_=S=T;else if("start"==i)_=S=e;else if("around"==i)_=e,S=T;else{var L=function(t){if(Te(t,e))return t;if(!Te(n,t))return T;var r=t.line+w,i=t.ch;return t.line==n.line&&(i+=pn(g).length-(n.ch-(n.line==e.line?e.ch:0))),{line:r,ch:i}};_=L(s.sel.from),S=L(s.sel.to)}return Be(t,_,S,null,!0),T}}function _e(t,e,n,r,i){if(r||(r=n),Te(r,n)){var o=r;r=n,n=o}return be(t,n,r,xi(e),null,i)}function Se(t,e){return t.line==e.line&&t.ch==e.ch}function Te(t,e){return t.linee.line)return{line:0,ch:0};if(e.line>=t.size)return{line:t.size-1,ch:En(t,t.size-1).text.length};var n=e.ch,r=En(t,e.line).text.length;return null==n||n>r?{line:e.line,ch:r}:0>n?{line:e.line,ch:0}:e}function Ae(t,e){return e>=0&&t.size>e}function Ee(t,e,n,r){var i=t.view.sel;if(i.shift||i.extend){var o=i.anchor;if(n){var s=Te(e,o);s!=Te(n,o)?(o=e,e=n):s!=Te(e,n)&&(e=n)}Be(t,o,e,r)}else Be(t,e,n||e,r);t.curOp.userSelChange=!0}function Be(t,e,n,r,i){t.view.goalColumn=null;var o=t.view.sel;if((i||!Se(e,o.anchor))&&(e=He(t,e,r,"push"!=i)),(i||!Se(n,o.head))&&(n=He(t,n,r,"push"!=i)),!Se(o.anchor,e)||!Se(o.head,n)){o.anchor=e,o.head=n;var s=Te(n,e);o.from=s?n:e,o.to=s?e:n,t.curOp.updateInput=!0,t.curOp.selectionChanged=!0}}function De(t){Be(t,t.view.sel.from,t.view.sel.to,null,"push")}function He(t,e,n,r){var i=t.view.doc,o=!1,s=e,a=n||1;t.view.cantEdit=!1;t:for(;;){var l,u=En(i,s.line);if(u.markedSpans){for(var c=0;u.markedSpans.length>c;++c){var h=u.markedSpans[c],f=h.marker;if((null==h.from||(f.inclusiveLeft?h.from<=s.ch:h.from=s.ch:h.to>s.ch))){if(r&&f.clearOnEnter){(l||(l=[])).push(f);continue}if(!f.atomic)continue;var p=f.find()[0>a?"from":"to"];if(Se(p,s)&&(p.ch+=a,0>p.ch?p=p.line?Me(i,{line:p.line-1}):null:p.ch>u.text.length&&(p=p.linec;++c)l[c].clear()}return s}}function Fe(t){var e=t.view,n=Oe(t,e.sel.head);if(e.focused){var r=t.display,i=r.sizer.getBoundingClientRect(),o=null;if(0>n.top+i.top?o=!0:n.bottom+i.top>(window.innerHeight||document.documentElement.clientHeight)&&(o=!1),null!=o&&!Rr){var s="none"==r.cursor.style.display;s&&(r.cursor.style.display="",r.cursor.style.left=n.left+"px",r.cursor.style.top=n.top-r.viewOffset+"px"),r.cursor.scrollIntoView(o),s&&(r.cursor.style.display="none")}}}function Oe(t,e){for(;;){var n=!1,r=W(t,e),i=Ie(t,r.left,r.top,r.left,r.bottom),o=t.view.scrollTop,s=t.view.scrollLeft;if(null!=i.scrollTop&&(le(t,i.scrollTop),Math.abs(t.view.scrollTop-o)>1&&(n=!0)),null!=i.scrollLeft&&(ue(t,i.scrollLeft),Math.abs(t.view.scrollLeft-s)>1&&(n=!0)),!n)return r}}function je(t,e,n,r,i){var o=Ie(t,e,n,r,i);null!=o.scrollTop&&le(t,o.scrollTop),null!=o.scrollLeft&&ue(t,o.scrollLeft)}function Ie(t,e,n,r,i){var o=t.display,s=B(o);n+=s,i+=s;var a=o.scroller.clientHeight-ci,l=o.scroller.scrollTop,u={},c=t.view.doc.height+2*s,h=s+10>n,f=i+s>c-10;l>n?u.scrollTop=h?0:Math.max(0,n):i>l+a&&(u.scrollTop=(f?c:i)-a);var p=o.scroller.clientWidth-ci,d=o.scroller.scrollLeft;e+=o.gutters.offsetWidth,r+=o.gutters.offsetWidth;var g=o.gutters.offsetWidth,v=g+10>e;return d+g>e||v?(v&&(e=0),u.scrollLeft=Math.max(0,e-10-g)):r>p+d-3&&(u.scrollLeft=r+10-p),u}function ze(t,e,n,r){var i=t.view.doc;if(n||(n="add"),"smart"==n)if(t.view.mode.indent)var o=E(t,e);else n="prev";var s,a=t.options.tabSize,l=En(i,e),u=Jn(l.text,null,a),c=l.text.match(/^\s*/)[0];if("smart"==n&&(s=t.view.mode.indent(o,l.text.slice(c.length),l.text),s==hi)){if(!r)return;n="prev"}"prev"==n?s=e?Jn(En(i,e-1).text,null,a):0:"add"==n?s=u+t.options.indentUnit:"subtract"==n&&(s=u-t.options.indentUnit),s=Math.max(0,s);var h="",f=0;if(t.options.indentWithTabs)for(var p=Math.floor(s/a);p;--p)f+=a,h+=" ";s>f&&(h+=tr(s-f)),h!=c&&_e(t,h,{line:e,ch:0},{line:e,ch:c.length},"input"),l.stateAfter=null}function We(t,e,n){var r=e,i=e,o=t.view.doc;return"number"==typeof e?i=En(o,Ne(o,e)):r=Dn(e),null==r?null:n(i,r)?(U(t,r,r+1),i):null}function Pe(t,e,n,r){function i(){var t=l+e;return 0>t||t==s.size?!1:(l=t,c=En(s,t))}function o(t){var n=(r?wr:Cr)(c,u,e,!0);if(null==n){if(t||!i())return!1;u=r?(0>e?yr:mr)(c):0>e?c.text.length:0}else u=n;return!0}var s=t.view.doc,a=t.view.sel.head,l=a.line,u=a.ch,c=En(s,l);if("char"==n)o();else if("column"==n)o(!0);else if("word"==n)for(var h=!1;!(0>e)||o();){if(sr(c.text.charAt(u)))h=!0;else if(h){0>e&&(e=1,o());break}if(e>0&&!o())break}return He(t,{line:l,ch:u},e,!0)}function Re(t,e){var n=e.ch,r=e.ch;if(t){e.after===!1||r==t.length?--n:++r;for(var i=t.charAt(n),o=sr(i)?sr:/\s/.test(i)?function(t){return/\s/.test(t)}:function(t){return!/\s/.test(t)&&!sr(t)};n>0&&o(t.charAt(n-1));)--n;for(;t.length>r&&o(t.charAt(r));)++r}return{from:{line:e.line,ch:n},to:{line:e.line,ch:r}}}function qe(t,e){Ee(t,{line:e,ch:0},Me(t.view.doc,{line:e+1,ch:0}))}function $e(e,n,r,i){t.defaults[e]=n,r&&(Jr[e]=i?function(t,e,n){n!=ei&&r(t,e,n)}:r)}function Ve(t,e){if(e===!0)return e;if(t.copyState)return t.copyState(e);var n={};for(var r in e){var i=e[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n}function Xe(t,e,n){return t.startState?t.startState(e,n):!0}function Ye(t){return"string"==typeof t?ai[t]:t}function Ue(t,e,n,r){function i(e){e=Ye(e);var o=e[t];if(o===!1)return r&&r(),!0;if(null!=o&&n(o))return!0;if(e.nofallthrough)return r&&r(),!0;var s=e.fallthrough;if(null==s)return!1;if("[object Array]"!=Object.prototype.toString.call(s))return i(s);for(var a=0,l=s.length;l>a;++a)if(i(s[a]))return!0;return!1}for(var o=0;e.length>o;++o)if(i(e[o]))return!0}function Ge(t){var e=Ci[Xn(t,"keyCode")];return"Ctrl"==e||"Alt"==e||"Shift"==e||"Mod"==e}function Ke(t,e){this.pos=this.start=0,this.string=t,this.tabSize=e||8}function Ze(t,e){this.lines=[],this.type=e,this.cm=t}function Qe(t,e,n,r,i){var o=t.view.doc,s=new Ze(t,i);if("range"==i&&!Te(e,n))return s;if(r)for(var a in r)r.hasOwnProperty(a)&&(s[a]=r[a]);s.replacedWith&&(s.collapsed=!0,s.replacedWith=lr("span",[s.replacedWith],"CodeMirror-widget")),s.collapsed&&(Yr=!0);var l,u,c=e.line,h=0;if(o.iter(c,n.line+1,function(t){var r={from:null,to:null,marker:s};h+=t.text.length,c==e.line&&(r.from=e.ch,h-=e.ch),c==n.line&&(r.to=n.ch,h-=t.text.length-n.ch),s.collapsed&&(c==n.line&&(u=an(t,n.ch)),c==e.line?l=an(t,e.ch):Bn(t,0)),en(t,r),s.collapsed&&c==e.line&&hn(t)&&Bn(t,0),++c}),s.readOnly&&(Xr=!0,(t.view.history.done.length||t.view.history.undone.length)&&t.clearHistory()),s.collapsed){if(l!=u)throw Error("Inserting collapsed marker overlapping an existing one");s.size=h,s.atomic=!0}return(s.className||s.startStyle||s.endStyle||s.collapsed)&&U(t,e.line,n.line+1),s.atomic&&De(t),s}function Je(t,e){if(t)for(var n=0;t.length>n;++n){var r=t[n];if(r.marker==e)return r}}function tn(t,e){for(var n,r=0;t.length>r;++r)t[r]!=e&&(n||(n=[])).push(t[r]);return n}function en(t,e){t.markedSpans=t.markedSpans?t.markedSpans.concat([e]):[e],e.marker.lines.push(t)}function nn(t,e){if(t)for(var n,r=0;t.length>r;++r){var i=t[r],o=i.marker,s=null==i.from||(o.inclusiveLeft?e>=i.from:e>i.from);if(s||"bookmark"==o.type&&i.from==e){var a=null==i.to||(o.inclusiveRight?i.to>=e:i.to>e);(n||(n=[])).push({from:i.from,to:a?null:i.to,marker:o})}}return n}function rn(t,e,n){if(t)for(var r,i=0;t.length>i;++i){var o=t[i],s=o.marker,a=null==o.to||(s.inclusiveRight?o.to>=n:o.to>n);if(a||"bookmark"==s.type&&o.from==n&&o.from!=e){var l=null==o.from||(s.inclusiveLeft?n>=o.from:n>o.from);(r||(r=[])).push({from:l?null:o.from-n,to:null==o.to?null:o.to-n,marker:s})}}return r}function on(t,e,n,r,i){if(!t&&!e)return i;var o=nn(t,n),s=rn(e,n,r),a=1==i.length,l=er(i).length+(a?n:0);if(o)for(var u=0;o.length>u;++u){var c=o[u];if(null==c.to){var h=Je(s,c.marker);h?a&&(c.to=null==h.to?null:h.to+l):c.to=n}}if(s)for(var u=0;s.length>u;++u){var c=s[u];if(null!=c.to&&(c.to+=l),null==c.from){var h=Je(o,c.marker);h||(c.from=l,a&&(o||(o=[])).push(c))}else c.from+=l,a&&(o||(o=[])).push(c)}var f=[gn(i[0],o)];if(!a){var p,d=i.length-2;if(d>0&&o)for(var u=0;o.length>u;++u)null==o[u].to&&(p||(p=[])).push({from:null,to:null,marker:o[u].marker});for(var u=0;d>u;++u)f.push(gn(i[u+1],p));f.push(gn(er(i),s))}return f}function sn(t,e,n){var r=null;if(t.iter(e.line,n.line+1,function(t){if(t.markedSpans)for(var e=0;t.markedSpans.length>e;++e){var n=t.markedSpans[e].marker;!n.readOnly||r&&-1!=rr(r,n)||(r||(r=[])).push(n)}}),!r)return null;for(var i=[{from:e,to:n}],o=0;r.length>o;++o)for(var s=r[o].find(),a=0;i.length>a;++a){var l=i[a];if(Te(s.from,l.to)&&!Te(s.to,l.from)){var u=[a,1];Te(l.from,s.from)&&u.push({from:l.from,to:s.from}),Te(s.to,l.to)&&u.push({from:s.to,to:l.to}),i.splice.apply(i,u),a+=u.length-1}}return i}function an(t,e){var n,r=Yr&&t.markedSpans;if(r)for(var i,o=0;r.length>o;++o)i=r[o],i.marker.collapsed&&(null==i.from||e>i.from)&&(null==i.to||i.to>e)&&(!n||n.widthr;++r)if(n=e[r],n.marker.collapsed){if(null==n.from)return!0;if(0==n.from&&n.marker.inclusiveLeft&&fn(t,n))return!0}}function fn(t,e){if(null==e.to||e.marker.inclusiveRight&&e.to==t.text.length)return!0;for(var n,r=0;t.markedSpans.length>r;++r)if(n=t.markedSpans[r],n.marker.collapsed&&n.from==e.to&&(n.marker.inclusiveLeft||e.marker.inclusiveRight)&&fn(t,n))return!0}function pn(t){return"string"==typeof t?t:t.text}function dn(t){if("string"==typeof t)return null;for(var e=t.markedSpans,n=null,r=0;e.length>r;++r)e[r].marker.explicitlyCleared?n||(n=e.slice(0,r)):n&&n.push(e[r]);return n?n.length?n:null:e}function gn(t,e){return e?{text:t,markedSpans:e}:t}function vn(t){var e=t.markedSpans;if(e){for(var n=0;e.length>n;++n){var r=e[n].marker.lines,i=rr(r,t);r.splice(i,1)}t.markedSpans=null}}function mn(t,e){if(e){for(var n=0;e.length>n;++n)e[n].marker.lines.push(t);t.markedSpans=e}}function yn(t,e,n){var r={text:t,height:n};return mn(r,e),hn(r)&&(r.height=0),r}function xn(t,e,n,r){e.text=n,e.stateAfter=e.styles=null,null!=e.order&&(e.order=null),vn(e),mn(e,r),hn(e)?e.height=0:e.height||(e.height=q(t.display)),Kn(t,e,"change")}function bn(t){t.parent=null,vn(t)}function wn(t,e,n){var r=t.view.mode,i=t.options.flattenSpans,o=!e.styles,s=0,a="",l=null,u=new Ke(e.text,t.options.tabSize),c=e.styles||(e.styles=[]);for(""==e.text&&r.blankLine&&r.blankLine(n);!u.eol();){var h=r.token(u,n),f=u.current();if(u.start=u.pos,i&&l==h?a+=f:(a&&(o=o||s>=c.length||a!=c[s]||l!=c[s+1],c[s++]=a,c[s++]=l),a=f,l=h),u.pos>5e3)break}return a&&(o=o||s>=c.length||a!=c[s]||l!=c[s+1],c[s++]=a,c[s++]=l),u.pos>5e3&&(c[s++]=e.text.slice(u.pos),c[s++]=null),s!=c.length&&(c.length=s,o=!0),o}function Cn(t,e,n){var r=t.view.mode,i=new Ke(e.text,t.options.tabSize);for(""==e.text&&r.blankLine&&r.blankLine(n);!i.eol()&&5e3>=i.pos;)r.token(i,n),i.start=i.pos}function kn(t){return t?li[t]||(li[t]="cm-"+t.replace(/ +/g," cm-")):null}function _n(t,e,n){for(var r,i,o,s=e,a=!0;r=ln(s);)a=!1,s=En(t.view.doc,r.find().from.line),i||(i=s);var l={pre:lr("pre"),col:0,pos:0,display:!n,measure:null,addedOne:!1,cm:t};s.textClass&&(l.pre.className=s.textClass);do{s.styles||wn(t,s,s.stateAfter=E(t,Dn(s))),l.measure=s==e&&n,l.pos=0,l.addToken=l.measure?Tn:Sn,n&&o&&s!=e&&!l.addedOne&&(n[0]=l.pre.appendChild(pr(t.display.measure)),l.addedOne=!0);var u=Nn(s,l);o=s==i,u&&(s=En(t.view.doc,u.to.line),a=!1)}while(u);return n&&!l.addedOne&&(n[0]=l.pre.appendChild(a?lr("span"," "):pr(t.display.measure))),l.pre.firstChild||hn(e)||l.pre.appendChild(document.createTextNode(" ")),l.pre}function Sn(t,e,n,r,i){if(e){if(ui.test(e))for(var o=document.createDocumentFragment(),s=0;;){ui.lastIndex=s;var a=ui.exec(e),l=a?a.index-s:e.length-s;if(l&&(o.appendChild(document.createTextNode(e.slice(s,s+l))),t.col+=l),!a)break;if(s+=l+1," "==a[0]){var u=t.cm.options.tabSize,c=u-t.col%u;o.appendChild(lr("span",tr(c),"cm-tab")),t.col+=c}else{var h=lr("span","•","cm-invalidchar");h.title="\\u"+a[0].charCodeAt(0).toString(16),o.appendChild(h),t.col+=1}}else{t.col+=e.length;var o=document.createTextNode(e)}if(n||r||i||t.measure){var f=n||"";return r&&(f+=r),i&&(f+=i),t.pre.appendChild(lr("span",[o],f))}t.pre.appendChild(o)}}function Tn(t,e,n,r,i){for(var o=0;e.length>o;++o)o&&e.length-1>o&&t.cm.options.lineWrapping&&vi.test(e.slice(o-1,o+1))&&t.pre.appendChild(lr("wbr")),t.measure[t.pos++]=Sn(t,e.charAt(o),n,0==o&&r,o==e.length-1&&i);e.length&&(t.addedOne=!0)}function Ln(t,e,n){n&&(t.display||(n=n.cloneNode(!0)),t.pre.appendChild(n),t.measure&&e&&(t.measure[t.pos]=n,t.addedOne=!0)),t.pos+=e}function Nn(t,e){var n=t.styles,r=t.markedSpans;if(r)for(var i,o,s,a,l,u=t.text,c=u.length,h=0,f=0,p="",d=0;;){if(d==h){o=s=a="",l=null,d=1/0;for(var g=null,v=0;r.length>v;++v){var m=r[v],y=m.marker;h>=m.from&&(null==m.to||m.to>h)?(null!=m.to&&d>m.to&&(d=m.to,s=""),y.className&&(o+=" "+y.className),y.startStyle&&m.from==h&&(a+=" "+y.startStyle),y.endStyle&&m.to==d&&(s+=" "+y.endStyle),y.collapsed&&(!l||l.marker.widthh&&d>m.from&&(d=m.from),"bookmark"==y.type&&m.from==h&&y.replacedWith&&(g=y.replacedWith)}if(l&&(l.from||0)==h&&(Ln(e,(null==l.to?c:l.to)-h,null!=l.from&&l.marker.replacedWith),null==l.to))return l.marker.find();g&&!l&&Ln(e,0,g)}if(h>=c)break;for(var x=Math.min(c,d);;){if(p){var b=h+p.length;if(!l){var w=b>x?p.slice(0,x-h):p;e.addToken(e,w,i+o,a,h+w.length==d?s:"")}if(b>=x){p=p.slice(x-h),h=x;break}h=b,a=""}p=n[f++],i=kn(n[f++])}}else for(var f=0;n.length>f;f+=2)e.addToken(e,n[f],kn(n[f+1]))}function Mn(t){this.lines=t,this.parent=null;for(var e=0,n=t.length,r=0;n>e;++e)t[e].parent=this,r+=t[e].height;this.height=r}function An(t){this.children=t;for(var e=0,n=0,r=0,i=t.length;i>r;++r){var o=t[r];e+=o.chunkSize(),n+=o.height,o.parent=this}this.size=e,this.height=n,this.parent=null}function En(t,e){for(;!t.lines;)for(var n=0;;++n){var r=t.children[n],i=r.chunkSize();if(i>e){t=r;break}e-=i}return t.lines[e]}function Bn(t,e){for(var n=e-t.height,r=t;r;r=r.parent)r.height+=n}function Dn(t){if(null==t.parent)return null;for(var e=t.parent,n=rr(e.lines,t),r=e.parent;r;e=r,r=r.parent)for(var i=0;r.children[i]!=e;++i)n+=r.children[i].chunkSize();return n}function Hn(t,e){var n=0;t:do{for(var r=0,i=t.children.length;i>r;++r){var o=t.children[r],s=o.height;if(s>e){t=o;continue t}e-=s,n+=o.chunkSize()}return n}while(!t.lines);for(var r=0,i=t.lines.length;i>r;++r){var a=t.lines[r],l=a.height;if(l>e)break;e-=l}return n+r}function Fn(t,e){e=cn(t.view.doc,e);for(var n=0,r=e.parent,i=0;r.lines.length>i;++i){var o=r.lines[i];if(o==e)break;n+=o.height}for(var s=r.parent;s;r=s,s=r.parent)for(var i=0;s.children.length>i;++i){var a=s.children[i];if(a==r)break;n+=a.height}return n}function On(t){var e=t.order;return null==e&&(e=t.order=ki(t.text)),e}function jn(){return{done:[],undone:[],lastTime:0,lastOp:null,lastOrigin:null,dirtyCounter:0}}function In(t,e,n,r,i,o,s,a,l){var u=t.view.history;u.undone.length=0;var c=+new Date,h=er(u.done);if(h&&(u.lastOp==t.curOp.id||u.lastOrigin==i&&("input"==i||"delete"==i)&&u.lastTime>c-600)){var f=er(h.events);if(f.start>e+r.length||e>f.start+f.added)h.events.push({start:e,added:n,old:r});else{for(var p=Math.max(0,f.start-e),d=Math.max(0,e+r.length-(f.start+f.added)),g=p;g>0;--g)f.old.unshift(r[g-1]);for(var g=d;g>0;--g)f.old.push(r[r.length-g]);p&&(f.start=e),f.added+=n-(r.length-p-d)}h.fromAfter=a,h.toAfter=l}else{for(h={events:[{start:e,added:n,old:r}],fromBefore:o,toBefore:s,fromAfter:a,toAfter:l},u.done.push(h);u.done.length>t.options.undoDepth;)u.done.shift();0>u.dirtyCounter?u.dirtyCounter=0/0:u.dirtyCounter++}u.lastTime=c,u.lastOp=t.curOp.id,u.lastOrigin=i}function zn(){qn(this)}function Wn(t){return t.stop||(t.stop=zn),t}function Pn(t){t.preventDefault?t.preventDefault():t.returnValue=!1}function Rn(t){t.stopPropagation?t.stopPropagation():t.cancelBubble=!0}function qn(t){Pn(t),Rn(t)}function $n(t){return t.target||t.srcElement}function Vn(t){var e=t.which;return null==e&&(1&t.button?e=1:2&t.button?e=3:4&t.button&&(e=2)),Vr&&t.ctrlKey&&1==e&&(e=3),e}function Xn(t,e){var n=t.override&&t.override.hasOwnProperty(e);return n?t.override[e]:t[e]}function Yn(t,e,n){if(t.addEventListener)t.addEventListener(e,n,!1);else if(t.attachEvent)t.attachEvent("on"+e,n);else{var r=t._handlers||(t._handlers={}),i=r[e]||(r[e]=[]);i.push(n)}}function Un(t,e,n){if(t.removeEventListener)t.removeEventListener(e,n,!1);else if(t.detachEvent)t.detachEvent("on"+e,n);else{var r=t._handlers&&t._handlers[e];if(!r)return;for(var i=0;r.length>i;++i)if(r[i]==n){r.splice(i,1);break}}}function Gn(t,e){var n=t._handlers&&t._handlers[e];if(n)for(var r=Array.prototype.slice.call(arguments,2),i=0;n.length>i;++i)n[i].apply(null,r)}function Kn(t,e,n){function r(t){return function(){t.apply(null,o)}}var i=e._handlers&&e._handlers[n];if(i)for(var o=Array.prototype.slice.call(arguments,3),s=t.curOp&&t.curOp.delayedCallbacks,a=0;i.length>a;++a)s?s.push(r(i[a])):i[a].apply(null,o)}function Zn(t,e){var n=t._handlers&&t._handlers[e];return n&&n.length>0}function Qn(){this.id=null}function Jn(t,e,n){null==e&&(e=t.search(/[^\s\u00a0]/),-1==e&&(e=t.length));for(var r=0,i=0;e>r;++r)" "==t.charAt(r)?i+=n-i%n:++i;return i}function tr(t){for(;t>=fi.length;)fi.push(er(fi)+" ");return fi[t]}function er(t){return t[t.length-1]}function nr(t){qr?(t.selectionStart=0,t.selectionEnd=t.value.length):t.select()}function rr(t,e){if(t.indexOf)return t.indexOf(e);for(var n=0,r=t.length;r>n;++n)if(t[n]==e)return n;return-1}function ir(t){for(var e=[],n=0;t>n;++n)e.push(void 0);return e}function or(t){var e=Array.prototype.slice.call(arguments,1);return function(){return t.apply(null,e)}}function sr(t){return/\w/.test(t)||t>"€"&&(t.toUpperCase()!=t.toLowerCase()||pi.test(t))}function ar(t){var e=0;for(var n in t)t.hasOwnProperty(n)&&t[n]&&++e;return!e}function lr(t,e,n,r){var i=document.createElement(t);if(n&&(i.className=n),r&&(i.style.cssText=r),"string"==typeof e)hr(i,e);else if(e)for(var o=0;e.length>o;++o)i.appendChild(e[o]);return i}function ur(t){return t.innerHTML="",t}function cr(t,e){return ur(t).appendChild(e)}function hr(t,e){Dr?(t.innerHTML="",t.appendChild(document.createTextNode(e))):t.textContent=e}function fr(t){if(null!=mi)return mi;var e=lr("div",null,null,"width: 50px; height: 50px; overflow-x: scroll");return cr(t,e),e.offsetWidth&&(mi=e.offsetHeight-e.clientHeight),mi||0}function pr(t){if(null==yi){var e=lr("span","​");cr(t,lr("span",[e,document.createTextNode("x")])),0!=t.firstChild.offsetHeight&&(yi=1>=e.offsetWidth&&e.offsetHeight>2&&!Br)}return yi?lr("span","​"):lr("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px")}function dr(t,e,n,r){if(!t)return r(e,n,"ltr");for(var i=0;t.length>i;++i){var o=t[i];n>o.from&&o.to>e&&r(Math.max(o.from,e),Math.min(o.to,n),1==o.level?"rtl":"ltr")}}function gr(t){return t.level%2?t.to:t.from}function vr(t){return t.level%2?t.from:t.to}function mr(t){var e=On(t);return e?gr(e[0]):0}function yr(t){var e=On(t);return e?vr(er(e)):t.text.length}function xr(t,e){var n=En(t.view.doc,e),r=cn(t.view.doc,n);r!=n&&(e=Dn(r));var i=On(r),o=i?i[0].level%2?yr(r):mr(r):0;return{line:e,ch:o}}function br(t,e){for(var n,r;n=un(r=En(t.view.doc,e));)e=n.find().to.line;var i=On(r),o=i?i[0].level%2?mr(r):yr(r):r.text.length;return{line:e,ch:o}}function wr(t,e,n,r){var i=On(t);if(!i)return Cr(t,e,n,r);for(var o=r?function(e,n){do e+=n;while(e>0&&di.test(t.text.charAt(e)));return e}:function(t,e){return t+e},s=i[0].level,a=0;i.length>a;++a){var l=i[a],u=l.level%2==s;if(e>l.from&&l.to>e||u&&(l.from==e||l.to==e))break}for(var c=o(e,l.level%2?-n:n);null!=c;)if(l.level%2==s){if(!(l.from>c||c>l.to))break;l=i[a+=n],c=l&&(n>0==l.level%2?o(l.to,-1):o(l.from,1))}else if(c==gr(l))l=i[--a],c=l&&vr(l);else{if(c!=vr(l))break;l=i[++a],c=l&&gr(l)}return 0>c||c>t.text.length?null:c}function Cr(t,e,n,r){var i=e+n;if(r)for(;i>0&&di.test(t.text.charAt(i));)i+=n;return 0>i||i>t.text.length?null:i}var kr,_r,Sr,Tr,Lr,Nr,Mr,Ar=/gecko\/\d/i.test(navigator.userAgent),Er=/MSIE \d/.test(navigator.userAgent),Br=/MSIE [1-7]\b/.test(navigator.userAgent),Dr=/MSIE [1-8]\b/.test(navigator.userAgent),Hr=/WebKit\//.test(navigator.userAgent),Fr=Hr&&/Qt\/\d+\.\d+/.test(navigator.userAgent),Or=/Chrome\//.test(navigator.userAgent),jr=/Opera\//.test(navigator.userAgent),Ir=/Apple Computer/.test(navigator.vendor),zr=/KHTML\//.test(navigator.userAgent),Wr=/Mac OS X 1\d\D([7-9]|\d\d)\D/.test(navigator.userAgent),Pr=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(navigator.userAgent),Rr=/PhantomJS/.test(navigator.userAgent),qr=/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent),$r=qr||/Android|webOS|BlackBerry|Opera Mini|IEMobile/i.test(navigator.userAgent),Vr=qr||/Mac/.test(navigator.platform),Xr=!1,Yr=!1,Ur=0,Gr=null;Er?Gr=-.53:Ar?Gr=15:Or?Gr=-.7:Ir&&(Gr=-1/3);var Kr,Zr,Qr=null;t.prototype={getValue:function(t){var e=[],n=this.view.doc;return n.iter(0,n.size,function(t){e.push(t.text)}),e.join(t||"\n")},setValue:Y(null,function(t){var e=this.view.doc,n={line:0,ch:0},r=En(e,e.size-1).text.length;we(this,n,{line:e.size-1,ch:r},xi(t),n,n,"setValue")}),getSelection:function(t){return this.getRange(this.view.sel.from,this.view.sel.to,t)},replaceSelection:Y(null,function(t,e,n){var r=this.view.sel;be(this,r.from,r.to,xi(t),e||"around",n)}),focus:function(){window.focus(),J(this),me(this),K(this)},setOption:function(t,e){var n=this.options,r=n[t];(n[t]!=e||"mode"==t)&&(n[t]=e,Jr.hasOwnProperty(t)&&Y(this,Jr[t])(this,e,r))},getOption:function(t){return this.options[t]},getMode:function(){return this.view.mode},addKeyMap:function(t){this.view.keyMaps.push(t)},removeKeyMap:function(t){for(var e=this.view.keyMaps,n=0;e.length>n;++n)if(("string"==typeof t?e[n].name:e[n])==t)return e.splice(n,1),!0},undo:Y(null,function(){Ce(this,"undo")}),redo:Y(null,function(){Ce(this,"redo")}),indentLine:Y(null,function(t,e,n){"string"!=typeof e&&(e=null==e?this.options.smartIndent?"smart":"prev":e?"add":"subtract"),Ae(this.view.doc,t)&&ze(this,t,e,n)}),indentSelection:Y(null,function(t){var e=this.view.sel;if(Se(e.from,e.to))return ze(this,e.from.line,t);for(var n=e.to.line-(e.to.ch?0:1),r=e.from.line;n>=r;++r)ze(this,r,t)}),historySize:function(){var t=this.view.history;return{undo:t.done.length,redo:t.undone.length}},clearHistory:function(){this.view.history=jn()},markClean:function(){this.view.history.dirtyCounter=0,this.view.history.lastOp=this.view.history.lastOrigin=null},isClean:function(){return 0==this.view.history.dirtyCounter},getHistory:function(){function t(t){for(var e,n=0,r=[];t.length>n;++n){var i=t[n];r.push({events:e=[],fromBefore:i.fromBefore,toBefore:i.toBefore,fromAfter:i.fromAfter,toAfter:i.toAfter});for(var o=0,s=i.events;s.length>o;++o){var a=[],l=s[o];e.push({start:l.start,added:l.added,old:a});for(var u=0;l.old.length>u;++u)a.push(pn(l.old[u]))}}return r}var e=this.view.history;return{done:t(e.done),undone:t(e.undone)}},setHistory:function(t){var e=this.view.history=jn();e.done=t.done,e.undone=t.undone},getTokenAt:function(t){var e=this.view.doc;t=Me(e,t);for(var n=E(this,t.line),r=this.view.mode,i=En(e,t.line),o=new Ke(i.text,this.options.tabSize);o.posi;++i){var o=r[i];(null==o.from||o.from<=t.ch)&&(null==o.to||o.to>=t.ch)&&n.push(o.marker)}return n},setGutterMarker:Y(null,function(t,e,n){return We(this,t,function(t){var r=t.gutterMarkers||(t.gutterMarkers={});return r[e]=n,!n&&ar(r)&&(t.gutterMarkers=null),!0})}),clearGutter:Y(null,function(t){var e=0,n=this,r=n.view.doc;r.iter(0,r.size,function(r){r.gutterMarkers&&r.gutterMarkers[t]&&(r.gutterMarkers[t]=null,U(n,e,e+1),ar(r.gutterMarkers)&&(r.gutterMarkers=null)),++e})}),addLineClass:Y(null,function(t,e,n){return We(this,t,function(t){var r="text"==e?"textClass":"background"==e?"bgClass":"wrapClass";if(t[r]){if(RegExp("\\b"+n+"\\b").test(t[r]))return!1;t[r]+=" "+n}else t[r]=n;return!0})}),removeLineClass:Y(null,function(t,e,n){return We(this,t,function(t){var r="text"==e?"textClass":"background"==e?"bgClass":"wrapClass",i=t[r];if(!i)return!1;if(null==n)t[r]=null;else{var o=i.replace(RegExp("^"+n+"\\b\\s*|\\s*\\b"+n+"\\b"),"");if(o==i)return!1;t[r]=o||null}return!0})}),addLineWidget:Y(null,function(t,e,n){var r=n||{};return r.node=e,r.noHScroll&&(this.display.alignWidgets=!0),We(this,t,function(t){return(t.widgets||(t.widgets=[])).push(r),r.line=t,!0}),r}),removeLineWidget:Y(null,function(t){var e=t.line.widgets,n=Dn(t.line);if(null!=n){for(var r=0;e.length>r;++r)e[r]==t&&e.splice(r--,1);U(this,n,n+1)}}),lineInfo:function(t){if("number"==typeof t){if(!Ae(this.view.doc,t))return null;var e=t;if(t=En(this.view.doc,t),!t)return null}else{var e=Dn(t);if(null==e)return null}return{line:e,handle:t,text:t.text,gutterMarkers:t.gutterMarkers,textClass:t.textClass,bgClass:t.bgClass,wrapClass:t.wrapClass,widgets:t.widgets}},getViewport:function(){return{from:this.display.showingFrom,to:this.display.showingTo}},addWidget:function(t,e,n,r,i){var o=this.display;t=W(this,Me(this.view.doc,t));var s=t.top,a=t.left;if(e.style.position="absolute",o.sizer.appendChild(e),"over"==r)s=t.top;else if("near"==r){var l=Math.max(o.wrapper.clientHeight,this.view.doc.height),u=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth);t.bottom+e.offsetHeight>l&&t.top>e.offsetHeight&&(s=t.top-e.offsetHeight),a+e.offsetWidth>u&&(a=u-e.offsetWidth)}e.style.top=s+B(o)+"px",e.style.left=e.style.right="","right"==i?(a=o.sizer.clientWidth-e.offsetWidth,e.style.right="0px"):("left"==i?a=0:"middle"==i&&(a=(o.sizer.clientWidth-e.offsetWidth)/2),e.style.left=a+"px"),n&&je(this,a,s,a+e.offsetWidth,s+e.offsetHeight)},lineCount:function(){return this.view.doc.size},clipPos:function(t){return Me(this.view.doc,t)},getCursor:function(t){var e,n=this.view.sel;return e=null==t||"head"==t?n.head:"anchor"==t?n.anchor:"end"==t||t===!1?n.to:n.from,Le(e)},somethingSelected:function(){return!Se(this.view.sel.from,this.view.sel.to)},setCursor:Y(null,function(t,e,n){var r=Me(this.view.doc,"number"==typeof t?{line:t,ch:e||0}:t);n?Ee(this,r):Be(this,r,r)}),setSelection:Y(null,function(t,e){var n=this.view.doc;Be(this,Me(n,t),Me(n,e||t))}),extendSelection:Y(null,function(t,e){var n=this.view.doc;Ee(this,Me(n,t),e&&Me(n,e))}),setExtending:function(t){this.view.sel.extend=t},getLine:function(t){var e=this.getLineHandle(t);return e&&e.text},getLineHandle:function(t){var e=this.view.doc;return Ae(e,t)?En(e,t):void 0},getLineNumber:function(t){return Dn(t)},setLine:Y(null,function(t,e){Ae(this.view.doc,t)&&_e(this,e,{line:t,ch:0},{line:t,ch:En(this.view.doc,t).text.length})}),removeLine:Y(null,function(t){Ae(this.view.doc,t)&&_e(this,"",{line:t,ch:0},Me(this.view.doc,{line:t+1,ch:0}))}),replaceRange:Y(null,function(t,e,n){var r=this.view.doc;return e=Me(r,e),n=n?Me(r,n):e,_e(this,t,e,n)}),getRange:function(t,e,n){var r=this.view.doc;t=Me(r,t),e=Me(r,e);var i=t.line,o=e.line;if(i==o)return En(r,i).text.slice(t.ch,e.ch);var s=[En(r,i).text.slice(t.ch)];return r.iter(i+1,o,function(t){s.push(t.text)}),s.push(En(r,o).text.slice(0,e.ch)),s.join(n||"\n") +},triggerOnKeyDown:Y(null,ge),execCommand:function(t){return si[t](this)},moveH:Y(null,function(t,e){var n=this.view.sel,r=0>t?n.from:n.to;(n.shift||n.extend||Se(n.from,n.to))&&(r=Pe(this,t,e,!0)),Ee(this,r,r,t)}),deleteH:Y(null,function(t,e){var n=this.view.sel;Se(n.from,n.to)?_e(this,"",n.from,Pe(this,t,e,!1),"delete"):_e(this,"",n.from,n.to,"delete"),this.curOp.userSelChange=!0}),moveV:Y(null,function(t,e){var n,r=this.view,i=r.doc,o=this.display,s=r.sel.head,a=W(this,s,"div"),l=a.left;if(null!=r.goalColumn&&(l=r.goalColumn),"page"==e){var u=Math.min(o.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight);n=a.top+t*u}else"line"==e&&(n=t>0?a.bottom+3:a.top-3);do{var c=P(this,l,n);n+=5*t}while(c.outside&&(0>t?n>0:i.height>n));"page"==e&&(o.scrollbarV.scrollTop+=z(this,c,"div").top-a.top),Ee(this,c,c,t),r.goalColumn=l}),toggleOverwrite:function(){(this.view.overwrite=!this.view.overwrite)?this.display.cursor.className+=" CodeMirror-overwrite":this.display.cursor.className=this.display.cursor.className.replace(" CodeMirror-overwrite","")},posFromIndex:function(t){var e,n=0,r=this.view.doc;return r.iter(0,r.size,function(r){var i=r.text.length+1;return i>t?(e=t,!0):(t-=i,++n,void 0)}),Me(r,{line:n,ch:e})},indexFromPos:function(t){if(0>t.line||0>t.ch)return 0;var e=t.ch;return this.view.doc.iter(0,t.line,function(t){e+=t.text.length+1}),e},scrollTo:function(t,e){null!=t&&(this.display.scrollbarH.scrollLeft=this.display.scroller.scrollLeft=t),null!=e&&(this.display.scrollbarV.scrollTop=this.display.scroller.scrollTop=e),y(this,[])},getScrollInfo:function(){var t=this.display.scroller,e=ci;return{left:t.scrollLeft,top:t.scrollTop,height:t.scrollHeight-e,width:t.scrollWidth-e,clientHeight:t.clientHeight-e,clientWidth:t.clientWidth-e}},scrollIntoView:function(t){"number"==typeof t&&(t={line:t,ch:0}),t=t?Me(this.view.doc,t):this.view.sel.head,Oe(this,t)},setSize:function(t,e){function n(t){return"number"==typeof t||/^\d+$/.test(t+"")?t+"px":t}null!=t&&(this.display.wrapper.style.width=n(t)),null!=e&&(this.display.wrapper.style.height=n(e)),this.refresh()},on:function(t,e){Yn(this,t,e)},off:function(t,e){Un(this,t,e)},operation:function(t){return Y(this,t)()},refresh:function(){j(this),this.display.scroller.scrollHeight>this.view.scrollTop&&(this.display.scrollbarV.scrollTop=this.display.scroller.scrollTop=this.view.scrollTop),y(this,!0)},getInputField:function(){return this.display.input},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}};var Jr=t.optionHandlers={},ti=t.defaults={},ei=t.Init={toString:function(){return"CodeMirror.Init"}};$e("value","",function(t,e){t.setValue(e)},!0),$e("mode",null,r,!0),$e("indentUnit",2,r,!0),$e("indentWithTabs",!1),$e("smartIndent",!0),$e("tabSize",4,function(t){r(t),j(t),y(t,!0)},!0),$e("electricChars",!0),$e("theme","default",function(t){s(t),a(t)},!0),$e("keyMap","default",o),$e("extraKeys",null),$e("onKeyEvent",null),$e("onDragEvent",null),$e("lineWrapping",!1,i,!0),$e("gutters",[],function(t){h(t.options),a(t)},!0),$e("lineNumbers",!1,function(t){h(t.options),a(t)},!0),$e("firstLineNumber",1,a,!0),$e("lineNumberFormatter",function(t){return t},a,!0),$e("showCursorWhenSelecting",!1,_,!0),$e("readOnly",!1,function(t,e){"nocursor"==e?(ye(t),t.display.input.blur()):e||Q(t,!0)}),$e("dragDrop",!0),$e("cursorBlinkRate",530),$e("cursorHeight",1),$e("workTime",100),$e("workDelay",100),$e("flattenSpans",!0),$e("pollInterval",100),$e("undoDepth",40),$e("viewportMargin",10,function(t){t.refresh()},!0),$e("tabindex",null,function(t,e){t.display.input.tabIndex=e||""}),$e("autofocus",null);var ni=t.modes={},ri=t.mimeModes={};t.defineMode=function(e,n){if(t.defaults.mode||"null"==e||(t.defaults.mode=e),arguments.length>2){n.dependencies=[];for(var r=2;arguments.length>r;++r)n.dependencies.push(arguments[r])}ni[e]=n},t.defineMIME=function(t,e){ri[t]=e},t.resolveMode=function(e){if("string"==typeof e&&ri.hasOwnProperty(e))e=ri[e];else if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return t.resolveMode("application/xml");return"string"==typeof e?{name:e}:e||{name:"null"}},t.getMode=function(e,n){var n=t.resolveMode(n),r=ni[n.name];if(!r)return t.getMode(e,"text/plain");var i=r(e,n);if(ii.hasOwnProperty(n.name)){var o=ii[n.name];for(var s in o)o.hasOwnProperty(s)&&(i.hasOwnProperty(s)&&(i["_"+s]=i[s]),i[s]=o[s])}return i.name=n.name,i},t.defineMode("null",function(){return{token:function(t){t.skipToEnd()}}}),t.defineMIME("text/plain","null");var ii=t.modeExtensions={};t.extendMode=function(t,e){var n=ii.hasOwnProperty(t)?ii[t]:ii[t]={};for(var r in e)e.hasOwnProperty(r)&&(n[r]=e[r])},t.defineExtension=function(e,n){t.prototype[e]=n},t.defineOption=$e;var oi=[];t.defineInitHook=function(t){oi.push(t)},t.copyState=Ve,t.startState=Xe,t.innerMode=function(t,e){for(;t.innerMode;){var n=t.innerMode(e);e=n.state,t=n.mode}return n||{mode:t,state:e}};var si=t.commands={selectAll:function(t){t.setSelection({line:0,ch:0},{line:t.lineCount()-1})},killLine:function(t){var e=t.getCursor(!0),n=t.getCursor(!1),r=!Se(e,n);r||t.getLine(e.line).length!=e.ch?t.replaceRange("",e,r?n:{line:e.line},"delete"):t.replaceRange("",e,{line:e.line+1,ch:0},"delete")},deleteLine:function(t){var e=t.getCursor().line;t.replaceRange("",{line:e,ch:0},{line:e},"delete")},undo:function(t){t.undo()},redo:function(t){t.redo()},goDocStart:function(t){t.extendSelection({line:0,ch:0})},goDocEnd:function(t){t.extendSelection({line:t.lineCount()-1})},goLineStart:function(t){t.extendSelection(xr(t,t.getCursor().line))},goLineStartSmart:function(t){var e=t.getCursor(),n=xr(t,e.line),r=t.getLineHandle(n.line),i=On(r);if(i&&0!=i[0].level)t.extendSelection(n);else{var o=Math.max(0,r.text.search(/\S/)),s=e.line==n.line&&o>=e.ch&&e.ch;t.extendSelection({line:n.line,ch:s?0:o})}},goLineEnd:function(t){t.extendSelection(br(t,t.getCursor().line))},goLineUp:function(t){t.moveV(-1,"line")},goLineDown:function(t){t.moveV(1,"line")},goPageUp:function(t){t.moveV(-1,"page")},goPageDown:function(t){t.moveV(1,"page")},goCharLeft:function(t){t.moveH(-1,"char")},goCharRight:function(t){t.moveH(1,"char")},goColumnLeft:function(t){t.moveH(-1,"column")},goColumnRight:function(t){t.moveH(1,"column")},goWordLeft:function(t){t.moveH(-1,"word")},goWordRight:function(t){t.moveH(1,"word")},delCharBefore:function(t){t.deleteH(-1,"char")},delCharAfter:function(t){t.deleteH(1,"char")},delWordBefore:function(t){t.deleteH(-1,"word")},delWordAfter:function(t){t.deleteH(1,"word")},indentAuto:function(t){t.indentSelection("smart")},indentMore:function(t){t.indentSelection("add")},indentLess:function(t){t.indentSelection("subtract")},insertTab:function(t){t.replaceSelection(" ","end","input")},defaultTab:function(t){t.somethingSelected()?t.indentSelection("add"):t.replaceSelection(" ","end","input")},transposeChars:function(t){var e=t.getCursor(),n=t.getLine(e.line);e.ch>0&&e.ch=this.string.length},sol:function(){return 0==this.pos},peek:function(){return this.string.charAt(this.pos)||void 0},next:function(){return this.pose},eatSpace:function(){for(var t=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>t},skipToEnd:function(){this.pos=this.string.length},skipTo:function(t){var e=this.string.indexOf(t,this.pos);return e>-1?(this.pos=e,!0):void 0},backUp:function(t){this.pos-=t},column:function(){return Jn(this.string,this.start,this.tabSize)},indentation:function(){return Jn(this.string,null,this.tabSize)},match:function(t,e,n){if("string"!=typeof t){var r=this.string.slice(this.pos).match(t);return r&&r.index>0?null:(r&&e!==!1&&(this.pos+=r[0].length),r)}var i=function(t){return n?t.toLowerCase():t};return i(this.string).indexOf(i(t),this.pos)==this.pos?(e!==!1&&(this.pos+=t.length),!0):void 0},current:function(){return this.string.slice(this.start,this.pos)}},t.StringStream=Ke,Ze.prototype.clear=function(){if(!this.explicitlyCleared){V(this.cm);for(var t=null,e=null,n=0;this.lines.length>n;++n){var r=this.lines[n],i=Je(r.markedSpans,this);null!=i.to&&(e=Dn(r)),r.markedSpans=tn(r.markedSpans,i),null!=i.from?t=Dn(r):this.collapsed&&!hn(r)&&Bn(r,q(this.cm.display))}null!=t&&U(this.cm,t,e+1),this.lines.length=0,this.explicitlyCleared=!0,this.collapsed&&this.cm.view.cantEdit&&(this.cm.view.cantEdit=!1,De(this.cm)),X(this.cm),Kn(this.cm,this,"clear")}},Ze.prototype.find=function(){for(var t,e,n=0;this.lines.length>n;++n){var r=this.lines[n],i=Je(r.markedSpans,this);if(null!=i.from||null!=i.to){var o=Dn(r);null!=i.from&&(t={line:o,ch:i.from}),null!=i.to&&(e={line:o,ch:i.to})}}return"bookmark"==this.type?t:t&&{from:t,to:e}},window.lineIsHidden=hn;var li={},ui=/[\t\u0000-\u0019\u200b\u2028\u2029\uFEFF]/g;Mn.prototype={chunkSize:function(){return this.lines.length},remove:function(t,e,n){for(var r=t,i=t+e;i>r;++r){var o=this.lines[r];this.height-=o.height,bn(o),Kn(n,o,"delete")}this.lines.splice(t,e)},collapse:function(t){t.splice.apply(t,[t.length,0].concat(this.lines))},insertHeight:function(t,e,n){this.height+=n,this.lines=this.lines.slice(0,t).concat(e).concat(this.lines.slice(t));for(var r=0,i=e.length;i>r;++r)e[r].parent=this},iterN:function(t,e,n){for(var r=t+e;r>t;++t)if(n(this.lines[t]))return!0}},An.prototype={chunkSize:function(){return this.size},remove:function(t,e,n){this.size-=e;for(var r=0;this.children.length>r;++r){var i=this.children[r],o=i.chunkSize();if(o>t){var s=Math.min(e,o-t),a=i.height;if(i.remove(t,s,n),this.height-=a-i.height,o==s&&(this.children.splice(r--,1),i.parent=null),0==(e-=s))break;t=0}else t-=o}if(25>this.size-e){var l=[];this.collapse(l),this.children=[new Mn(l)],this.children[0].parent=this}},collapse:function(t){for(var e=0,n=this.children.length;n>e;++e)this.children[e].collapse(t)},insert:function(t,e){for(var n=0,r=0,i=e.length;i>r;++r)n+=e[r].height;this.insertHeight(t,e,n)},insertHeight:function(t,e,n){this.size+=e.length,this.height+=n;for(var r=0,i=this.children.length;i>r;++r){var o=this.children[r],s=o.chunkSize();if(s>=t){if(o.insertHeight(t,e,n),o.lines&&o.lines.length>50){for(;o.lines.length>50;){var a=o.lines.splice(o.lines.length-25,25),l=new Mn(a);o.height-=l.height,this.children.splice(r+1,0,l),l.parent=this}this.maybeSpill()}break}t-=s}},maybeSpill:function(){if(!(10>=this.children.length)){var t=this;do{var e=t.children.splice(t.children.length-5,5),n=new An(e);if(t.parent){t.size-=n.size,t.height-=n.height;var r=rr(t.parent.children,t);t.parent.children.splice(r+1,0,n)}else{var i=new An(t.children);i.parent=t,t.children=[i,n],t=i}n.parent=t.parent}while(t.children.length>10);t.parent.maybeSpill()}},iter:function(t,e,n){this.iterN(t,e-t,n)},iterN:function(t,e,n){for(var r=0,i=this.children.length;i>r;++r){var o=this.children[r],s=o.chunkSize();if(s>t){var a=Math.min(e,s-t);if(o.iterN(t,a,n))return!0;if(0==(e-=a))break;t=0}else t-=s}}},t.e_stop=qn,t.e_preventDefault=Pn,t.e_stopPropagation=Rn,t.on=Yn,t.off=Un,t.signal=Gn;var ci=30,hi=t.Pass={toString:function(){return"CodeMirror.Pass"}};Qn.prototype={set:function(t,e){clearTimeout(this.id),this.id=setTimeout(e,t)}},t.countColumn=Jn;var fi=[""],pi=/[\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc]/,di=/[\u0300-\u036F\u0483-\u0487\u0488-\u0489\u0591-\u05BD\u05BF\u05C1-\u05C2\u05C4-\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7-\u06E8\u06EA-\u06ED\uA66F\uA670-\uA672\uA674-\uA67D\uA69F]/,gi=function(){if(Dr)return!1;var t=lr("div");return"draggable"in t||"dragDrop"in t}(),vi=/^$/;Ar?vi=/$'/:Ir?vi=/\-[^ \-?]|\?[^ !'\"\),.\-\/:;\?\]\}]/:Or&&(vi=/\-[^ \-\.?]|\?[^ \-\.?\]\}:;!'\"\),\/]|[\.!\"#&%\)*+,:;=>\]|\}~][\(\{\[<]|\$'/);var mi,yi,xi=3!="\n\nb".split(/\n/).length?function(t){for(var e=0,n=[],r=t.length;r>=e;){var i=t.indexOf("\n",e);-1==i&&(i=t.length);var o=t.slice(e,"\r"==t.charAt(i-1)?i-1:i),s=o.indexOf("\r");-1!=s?(n.push(o.slice(0,s)),e+=s+1):(n.push(o),e=i+1)}return n}:function(t){return t.split(/\r\n?|\n/)};t.splitLines=xi;var bi=window.getSelection?function(t){try{return t.selectionStart!=t.selectionEnd}catch(e){return!1}}:function(t){try{var e=t.ownerDocument.selection.createRange()}catch(n){}return e&&e.parentElement()==t?0!=e.compareEndPoints("StartToEnd",e):!1},wi=function(){var t=lr("div");return"oncopy"in t?!0:(t.setAttribute("oncopy","return;"),"function"==typeof t.oncopy)}(),Ci={3:"Enter",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",91:"Mod",92:"Mod",93:"Mod",109:"-",107:"=",127:"Delete",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63276:"PageUp",63277:"PageDown",63275:"End",63273:"Home",63234:"Left",63232:"Up",63235:"Right",63233:"Down",63302:"Insert",63272:"Delete"};t.keyNames=Ci,function(){for(var t=0;10>t;t++)Ci[t+48]=t+"";for(var t=65;90>=t;t++)Ci[t]=String.fromCharCode(t);for(var t=1;12>=t;t++)Ci[t+111]=Ci[t+63235]="F"+t}();var ki=function(){function t(t){return 255>=t?e.charAt(t):t>=1424&&1524>=t?"R":t>=1536&&1791>=t?n.charAt(t-1536):t>=1792&&2220>=t?"r":"L"}var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLL",n="rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmmrrrrrrrrrrrrrrrrrr",r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,i=/[stwN]/,o=/[LRr]/,s=/[Lb1n]/,a=/[1n]/;return function(e){if(!r.test(e))return!1;for(var n,l=e.length,u=[],c=null,h=0;l>h;++h)u.push(n=t(e.charCodeAt(h))),null==c&&("L"==n?c="L":("R"==n||"r"==n)&&(c="R"));null==c&&(c="L");for(var h=0,f=c;l>h;++h){var n=u[h];"m"==n?u[h]=f:f=n}for(var h=0,p=c;l>h;++h){var n=u[h];"1"==n&&"r"==p?u[h]="n":o.test(n)&&(p=n,"r"==n&&(u[h]="R"))}for(var h=1,f=u[0];l-1>h;++h){var n=u[h];"+"==n&&"1"==f&&"1"==u[h+1]?u[h]="1":","!=n||f!=u[h+1]||"1"!=f&&"n"!=f||(u[h]=f),f=n}for(var h=0;l>h;++h){var n=u[h];if(","==n)u[h]="N";else if("%"==n){for(var d=h+1;l>d&&"%"==u[d];++d);for(var g=h&&"!"==u[h-1]||l-1>d&&"1"==u[d]?"1":"N",v=h;d>v;++v)u[v]=g;h=d-1}}for(var h=0,p=c;l>h;++h){var n=u[h];"L"==p&&"1"==n?u[h]="L":o.test(n)&&(p=n)}for(var h=0;l>h;++h)if(i.test(u[h])){for(var d=h+1;l>d&&i.test(u[d]);++d);for(var m="L"==(h?u[h-1]:c),y="L"==(l-1>d?u[d]:c),g=m||y?"L":"R",v=h;d>v;++v)u[v]=g;h=d-1}for(var x,b=[],h=0;l>h;)if(s.test(u[h])){var w=h;for(++h;l>h&&s.test(u[h]);++h);b.push({from:w,to:h,level:0})}else{var C=h,k=b.length;for(++h;l>h&&"L"!=u[h];++h);for(var v=C;h>v;)if(a.test(u[v])){v>C&&b.splice(k,0,{from:C,to:v,level:1});var _=v;for(++v;h>v&&a.test(u[v]);++v);b.splice(k,0,{from:_,to:v,level:2}),C=v}else++v;h>C&&b.splice(k,0,{from:C,to:h,level:1})}return 1==b[0].level&&(x=e.match(/^\s+/))&&(b[0].from=x[0].length,b.unshift({from:0,to:x[0].length,level:0})),1==er(b).level&&(x=e.match(/\s+$/))&&(er(b).to-=x[0].length,b.push({from:l-x[0].length,to:l,level:0})),b[0].level!=er(b).level&&b.push({from:l,to:l,level:b[0].level}),b}}();return t.version="3.0",t}(),CodeMirror.defineMode("javascript",function(t,e){function n(t,e,n){return e.tokenize=n,n(t,e)}function r(t,e){for(var n,r=!1;null!=(n=t.next());){if(n==e&&!r)return!1;r=!r&&"\\"==n}return r}function i(t,e,n){return I=t,z=n,e}function o(t,e){var o=t.next();if('"'==o||"'"==o)return n(t,e,s(o));if(/[\[\]{}\(\),;\:\.]/.test(o))return i(o);if("0"==o&&t.eat(/x/i))return t.eatWhile(/[\da-f]/i),i("number","number");if(/\d/.test(o)||"-"==o&&t.eat(/\d/))return t.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/),i("number","number");if("/"==o)return t.eat("*")?n(t,e,a):t.eat("/")?(t.skipToEnd(),i("comment","comment")):"operator"==e.lastType||"keyword c"==e.lastType||/^[\[{}\(,;:]$/.test(e.lastType)?(r(t,"/"),t.eatWhile(/[gimy]/),i("regexp","string-2")):(t.eatWhile($),i("operator",null,t.current()));if("#"==o)return t.skipToEnd(),i("error","error");if($.test(o))return t.eatWhile($),i("operator",null,t.current());t.eatWhile(/[\w\$_]/);var l=t.current(),u=q.propertyIsEnumerable(l)&&q[l];return u&&"."!=e.lastType?i(u.type,u.style,l):i("variable","variable",l)}function s(t){return function(e,n){return r(e,t)||(n.tokenize=o),i("string","string")}}function a(t,e){for(var n,r=!1;n=t.next();){if("/"==n&&r){e.tokenize=o;break}r="*"==n}return i("comment","comment")}function l(t,e,n,r,i,o){this.indented=t,this.column=e,this.type=n,this.prev=i,this.info=o,null!=r&&(this.align=r)}function u(t,e){for(var n=t.localVars;n;n=n.next)if(n.name==e)return!0}function c(t,e,n,r,i){var o=t.cc;for(X.state=t,X.stream=i,X.marked=null,X.cc=o,t.lexical.hasOwnProperty("align")||(t.lexical.align=!0);;){var s=o.length?o.pop():P?b:x;if(s(n,r)){for(;o.length&&o[o.length-1].lex;)o.pop()();return X.marked?X.marked:"variable"==n&&u(t,r)?"variable-2":e}}}function h(){for(var t=arguments.length-1;t>=0;t--)X.cc.push(arguments[t])}function f(){return h.apply(null,arguments),!0}function p(t){var e=X.state;if(e.context){X.marked="def";for(var n=e.localVars;n;n=n.next)if(n.name==t)return;e.localVars={name:t,next:e.localVars}}}function d(){X.state.context={prev:X.state.context,vars:X.state.localVars},X.state.localVars=Y}function g(){X.state.localVars=X.state.context.vars,X.state.context=X.state.context.prev}function v(t,e){var n=function(){var n=X.state;n.lexical=new l(n.indented,X.stream.column(),t,null,n.lexical,e)};return n.lex=!0,n}function m(){var t=X.state;t.lexical.prev&&(")"==t.lexical.type&&(t.indented=t.lexical.indented),t.lexical=t.lexical.prev)}function y(t){return function(e){return e==t?f():";"==t?h():f(arguments.callee)}}function x(t){return"var"==t?f(v("vardef"),A,y(";"),m):"keyword a"==t?f(v("form"),b,x,m):"keyword b"==t?f(v("form"),x,m):"{"==t?f(v("}"),L,m):";"==t?f():"function"==t?f(O):"for"==t?f(v("form"),y("("),v(")"),B,y(")"),m,x,m):"variable"==t?f(v("stat"),k):"switch"==t?f(v("form"),b,v("}","switch"),y("{"),L,m,m):"case"==t?f(b,y(":")):"default"==t?f(y(":")):"catch"==t?f(v("form"),d,y("("),j,y(")"),x,m,g):h(v("stat"),b,y(";"),m)}function b(t){return V.hasOwnProperty(t)?f(C):"function"==t?f(O):"keyword c"==t?f(w):"("==t?f(v(")"),w,y(")"),m,C):"operator"==t?f(b):"["==t?f(v("]"),T(b,"]"),m,C):"{"==t?f(v("}"),T(S,"}"),m,C):f()}function w(t){return t.match(/[;\}\)\],]/)?h():h(b)}function C(t,e){if("operator"==t&&/\+\+|--/.test(e))return f(C);if("operator"==t&&"?"==e)return f(b,y(":"),b);if(";"!=t)return"("==t?f(v(")"),T(b,")"),m,C):"."==t?f(_,C):"["==t?f(v("]"),b,y("]"),m,C):void 0}function k(t){return":"==t?f(m,x):h(C,y(";"),m)}function _(t){return"variable"==t?(X.marked="property",f()):void 0}function S(t){return"variable"==t&&(X.marked="property"),V.hasOwnProperty(t)?f(y(":"),b):void 0}function T(t,e){function n(r){return","==r?f(t,n):r==e?f():f(y(e))}return function(r){return r==e?f():h(t,n)}}function L(t){return"}"==t?f():h(x,L)}function N(t){return":"==t?f(M):h()}function M(t){return"variable"==t?(X.marked="variable-3",f()):h()}function A(t,e){return"variable"==t?(p(e),R?f(N,E):f(E)):h()}function E(t,e){return"="==e?f(b,E):","==t?f(A):void 0}function B(t){return"var"==t?f(A,y(";"),H):";"==t?f(H):"variable"==t?f(D):f(H)}function D(t,e){return"in"==e?f(b):f(C,H)}function H(t,e){return";"==t?f(F):"in"==e?f(b):f(b,y(";"),F)}function F(t){")"!=t&&f(b)}function O(t,e){return"variable"==t?(p(e),f(O)):"("==t?f(v(")"),d,T(j,")"),m,x,g):void 0}function j(t,e){return"variable"==t?(p(e),R?f(N):f()):void 0}var I,z,W=t.indentUnit,P=e.json,R=e.typescript,q=function(){function t(t){return{type:t,style:"keyword"}}var e=t("keyword a"),n=t("keyword b"),r=t("keyword c"),i=t("operator"),o={type:"atom",style:"atom"},s={"if":e,"while":e,"with":e,"else":n,"do":n,"try":n,"finally":n,"return":r,"break":r,"continue":r,"new":r,"delete":r,"throw":r,"var":t("var"),"const":t("var"),let:t("var"),"function":t("function"),"catch":t("catch"),"for":t("for"),"switch":t("switch"),"case":t("case"),"default":t("default"),"in":i,"typeof":i,"instanceof":i,"true":o,"false":o,"null":o,undefined:o,NaN:o,Infinity:o};if(R){var a={type:"variable",style:"variable-3"},l={"interface":t("interface"),"class":t("class"),"extends":t("extends"),constructor:t("constructor"),"public":t("public"),"private":t("private"),"protected":t("protected"),"static":t("static"),"super":t("super"),string:a,number:a,bool:a,any:a};for(var u in l)s[u]=l[u]}return s}(),$=/[+\-*&%=<>!?|]/,V={atom:!0,number:!0,variable:!0,string:!0,regexp:!0},X={state:null,column:null,marked:null,cc:null},Y={name:"this",next:{name:"arguments"}};return m.lex=!0,{startState:function(t){return{tokenize:o,lastType:null,cc:[],lexical:new l((t||0)-W,0,"block",!1),localVars:e.localVars,context:e.localVars&&{vars:e.localVars},indented:0}},token:function(t,e){if(t.sol()&&(e.lexical.hasOwnProperty("align")||(e.lexical.align=!1),e.indented=t.indentation()),t.eatSpace())return null;var n=e.tokenize(t,e);return"comment"==I?n:(e.lastType=I,c(e,n,I,z,t))},indent:function(t,e){if(t.tokenize==a)return CodeMirror.Pass;if(t.tokenize!=o)return 0;var n=e&&e.charAt(0),r=t.lexical;"stat"==r.type&&"}"==n&&(r=r.prev);var i=r.type,s=n==i;return"vardef"==i?r.indented+("operator"==t.lastType||","==t.lastType?4:0):"form"==i&&"{"==n?r.indented:"form"==i?r.indented+W:"stat"==i?r.indented+("operator"==t.lastType||","==t.lastType?W:0):"switch"!=r.info||s?r.align?r.column+(s?0:1):r.indented+(s?0:W):r.indented+(/^(?:case|default)\b/.test(e)?W:2*W)},electricChars:":{}",jsonMode:P}}),CodeMirror.defineMIME("text/javascript","javascript"),CodeMirror.defineMIME("application/json",{name:"javascript",json:!0}),CodeMirror.defineMIME("text/typescript",{name:"javascript",typescript:!0}),CodeMirror.defineMIME("application/typescript",{name:"javascript",typescript:!0}),function(){function t(t,e,n,r){if(this.atOccurrence=!1,this.cm=t,null==r&&"string"==typeof e&&(r=!1),n=n?t.clipPos(n):{line:0,ch:0},this.pos={from:n,to:n},"string"!=typeof e)e.global||(e=RegExp(e.source,e.ignoreCase?"ig":"g")),this.matches=function(n,r){if(n){e.lastIndex=0;for(var i=t.getLine(r.line).slice(0,r.ch),o=e.exec(i),s=0;o;){s+=o.index+1,i=i.slice(s),e.lastIndex=0;var a=e.exec(i);if(!a)break;o=a}s--}else{e.lastIndex=r.ch;var i=t.getLine(r.line),o=e.exec(i),s=o&&o.index}return o?{from:{line:r.line,ch:s},to:{line:r.line,ch:s+o[0].length},match:o}:void 0};else{r&&(e=e.toLowerCase());var i=r?function(t){return t.toLowerCase()}:function(t){return t},o=e.split("\n");this.matches=1==o.length?function(n,r){var o,s=i(t.getLine(r.line)),a=e.length;return(n?r.ch>=a&&-1!=(o=s.lastIndexOf(e,r.ch-a)):-1!=(o=s.indexOf(e,r.ch)))?{from:{line:r.line,ch:o},to:{line:r.line,ch:o+a}}:void 0}:function(e,n){var r=n.line,s=e?o.length-1:0,a=o[s],l=i(t.getLine(r)),u=e?l.indexOf(a)+a.length:l.lastIndexOf(a);if(!(e?u>=n.ch||u!=a.length:n.ch>=u||u!=l.length-a.length))for(;;){if(e?!r:r==t.lineCount()-1)return;if(l=i(t.getLine(r+=e?-1:1)),a=o[e?--s:++s],!(s>0&&o.length-1>s)){var c=e?l.lastIndexOf(a):l.indexOf(a)+a.length;if(e?c!=l.length-a.length:c!=a.length)return;var h={line:n.line,ch:u},f={line:r,ch:c};return{from:e?f:h,to:e?h:f}}if(l!=a)return}}}}t.prototype={findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(t){function e(t){var e={line:t,ch:0};return n.pos={from:e,to:e},n.atOccurrence=!1,!1}for(var n=this,r=this.cm.clipPos(t?this.pos.from:this.pos.to);;){if(this.pos=this.matches(t,r))return this.atOccurrence=!0,this.pos.match||!0;if(t){if(!r.line)return e(0);r={line:r.line-1,ch:this.cm.getLine(r.line-1).length}}else{var i=this.cm.lineCount();if(r.line==i-1)return e(i);r={line:r.line+1,ch:0}}}},from:function(){return this.atOccurrence?this.pos.from:void 0},to:function(){return this.atOccurrence?this.pos.to:void 0},replace:function(t){var e=this;this.atOccurrence&&(e.pos.to=this.cm.replaceRange(t,e.pos.from,e.pos.to))}},CodeMirror.defineExtension("getSearchCursor",function(e,n,r){return new t(this,e,n,r)})}(); \ No newline at end of file diff --git a/lib/report/assets/scripts/bundles/core-bundle.js b/lib/report/assets/scripts/bundles/core-bundle.js new file mode 100755 index 0000000..0ae57c7 --- /dev/null +++ b/lib/report/assets/scripts/bundles/core-bundle.js @@ -0,0 +1,8 @@ +(function(t,e){function n(t){var e=de[t]={};return J.each(t.split(ee),function(t,n){e[n]=!0}),e}function r(t,n,r){if(r===e&&1===t.nodeType){var i="data-"+n.replace(ve,"-$1").toLowerCase();if(r=t.getAttribute(i),"string"==typeof r){try{r="true"===r?!0:"false"===r?!1:"null"===r?null:+r+""===r?+r:ge.test(r)?J.parseJSON(r):r}catch(o){}J.data(t,n,r)}else r=e}return r}function i(t){var e;for(e in t)if(("data"!==e||!J.isEmptyObject(t[e]))&&"toJSON"!==e)return!1;return!0}function o(){return!1}function s(){return!0}function a(t){return!t||!t.parentNode||11===t.parentNode.nodeType}function l(t,e){do t=t[e];while(t&&1!==t.nodeType);return t}function u(t,e,n){if(e=e||0,J.isFunction(e))return J.grep(t,function(t,r){var i=!!e.call(t,r,t);return i===n});if(e.nodeType)return J.grep(t,function(t){return t===e===n});if("string"==typeof e){var r=J.grep(t,function(t){return 1===t.nodeType});if(De.test(e))return J.filter(e,r,!n);e=J.filter(e,r)}return J.grep(t,function(t){return J.inArray(t,e)>=0===n})}function h(t){var e=Oe.split("|"),n=t.createDocumentFragment();if(n.createElement)for(;e.length;)n.createElement(e.pop());return n}function c(t,e){return t.getElementsByTagName(e)[0]||t.appendChild(t.ownerDocument.createElement(e))}function f(t,e){if(1===e.nodeType&&J.hasData(t)){var n,r,i,o=J._data(t),s=J._data(e,o),a=o.events;if(a){delete s.handle,s.events={};for(n in a)for(r=0,i=a[n].length;i>r;r++)J.event.add(e,n,a[n][r])}s.data&&(s.data=J.extend({},s.data))}}function p(t,e){var n;1===e.nodeType&&(e.clearAttributes&&e.clearAttributes(),e.mergeAttributes&&e.mergeAttributes(t),n=e.nodeName.toLowerCase(),"object"===n?(e.parentNode&&(e.outerHTML=t.outerHTML),J.support.html5Clone&&t.innerHTML&&!J.trim(e.innerHTML)&&(e.innerHTML=t.innerHTML)):"input"===n&&Ue.test(t.type)?(e.defaultChecked=e.checked=t.checked,e.value!==t.value&&(e.value=t.value)):"option"===n?e.selected=t.defaultSelected:"input"===n||"textarea"===n?e.defaultValue=t.defaultValue:"script"===n&&e.text!==t.text&&(e.text=t.text),e.removeAttribute(J.expando))}function d(t){return t.getElementsByTagName!==void 0?t.getElementsByTagName("*"):t.querySelectorAll!==void 0?t.querySelectorAll("*"):[]}function g(t){Ue.test(t.type)&&(t.defaultChecked=t.checked)}function v(t,e){if(e in t)return e;for(var n=e.charAt(0).toUpperCase()+e.slice(1),r=e,i=yn.length;i--;)if(e=yn[i]+n,e in t)return e;return r}function m(t,e){return t=e||t,"none"===J.css(t,"display")||!J.contains(t.ownerDocument,t)}function y(t,e){for(var n,r,i=[],o=0,s=t.length;s>o;o++)n=t[o],n.style&&(i[o]=J._data(n,"olddisplay"),e?(!i[o]&&"none"===n.style.display&&(n.style.display=""),""===n.style.display&&m(n)&&(i[o]=J._data(n,"olddisplay",_(n.nodeName)))):(r=nn(n,"display"),!i[o]&&"none"!==r&&J._data(n,"olddisplay",r)));for(o=0;s>o;o++)n=t[o],n.style&&(e&&"none"!==n.style.display&&""!==n.style.display||(n.style.display=e?i[o]||"":"none"));return t}function x(t,e,n){var r=cn.exec(e);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):e}function b(t,e,n,r){for(var i=n===(r?"border":"content")?4:"width"===e?1:0,o=0;4>i;i+=2)"margin"===n&&(o+=J.css(t,n+mn[i],!0)),r?("content"===n&&(o-=parseFloat(nn(t,"padding"+mn[i]))||0),"margin"!==n&&(o-=parseFloat(nn(t,"border"+mn[i]+"Width"))||0)):(o+=parseFloat(nn(t,"padding"+mn[i]))||0,"padding"!==n&&(o+=parseFloat(nn(t,"border"+mn[i]+"Width"))||0));return o}function w(t,e,n){var r="width"===e?t.offsetWidth:t.offsetHeight,i=!0,o=J.support.boxSizing&&"border-box"===J.css(t,"boxSizing");if(0>=r||null==r){if(r=nn(t,e),(0>r||null==r)&&(r=t.style[e]),fn.test(r))return r;i=o&&(J.support.boxSizingReliable||r===t.style[e]),r=parseFloat(r)||0}return r+b(t,e,n||(o?"border":"content"),i)+"px"}function _(t){if(dn[t])return dn[t];var e=J("<"+t+">").appendTo(R.body),n=e.css("display");return e.remove(),("none"===n||""===n)&&(rn=R.body.appendChild(rn||J.extend(R.createElement("iframe"),{frameBorder:0,width:0,height:0})),on&&rn.createElement||(on=(rn.contentWindow||rn.contentDocument).document,on.write(""),on.close()),e=on.body.appendChild(on.createElement(t)),n=nn(e,"display"),R.body.removeChild(rn)),dn[t]=n,n}function k(t,e,n,r){var i;if(J.isArray(e))J.each(e,function(e,i){n||wn.test(t)?r(t,i):k(t+"["+("object"==typeof i?e:"")+"]",i,n,r)});else if(n||"object"!==J.type(e))r(t,e);else for(i in e)k(t+"["+i+"]",e[i],n,r)}function C(t){return function(e,n){"string"!=typeof e&&(n=e,e="*");var r,i,o,s=e.toLowerCase().split(ee),a=0,l=s.length;if(J.isFunction(n))for(;l>a;a++)r=s[a],o=/^\+/.test(r),o&&(r=r.substr(1)||"*"),i=t[r]=t[r]||[],i[o?"unshift":"push"](n)}}function T(t,n,r,i,o,s){o=o||n.dataTypes[0],s=s||{},s[o]=!0;for(var a,l=t[o],u=0,h=l?l.length:0,c=t===Pn;h>u&&(c||!a);u++)a=l[u](n,r,i),"string"==typeof a&&(!c||s[a]?a=e:(n.dataTypes.unshift(a),a=T(t,n,r,i,a,s)));return(c||!a)&&!s["*"]&&(a=T(t,n,r,i,"*",s)),a}function S(t,n){var r,i,o=J.ajaxSettings.flatOptions||{};for(r in n)n[r]!==e&&((o[r]?t:i||(i={}))[r]=n[r]);i&&J.extend(!0,t,i)}function N(t,n,r){var i,o,s,a,l=t.contents,u=t.dataTypes,h=t.responseFields;for(o in h)o in r&&(n[h[o]]=r[o]);for(;"*"===u[0];)u.shift(),i===e&&(i=t.mimeType||n.getResponseHeader("content-type"));if(i)for(o in l)if(l[o]&&l[o].test(i)){u.unshift(o);break}if(u[0]in r)s=u[0];else{for(o in r){if(!u[0]||t.converters[o+" "+u[0]]){s=o;break}a||(a=o)}s=s||a}return s?(s!==u[0]&&u.unshift(s),r[s]):void 0}function E(t,e){var n,r,i,o,s=t.dataTypes.slice(),a=s[0],l={},u=0;if(t.dataFilter&&(e=t.dataFilter(e,t.dataType)),s[1])for(n in t.converters)l[n.toLowerCase()]=t.converters[n];for(;i=s[++u];)if("*"!==i){if("*"!==a&&a!==i){if(n=l[a+" "+i]||l["* "+i],!n)for(r in l)if(o=r.split(" "),o[1]===i&&(n=l[a+" "+o[0]]||l["* "+o[0]])){n===!0?n=l[r]:l[r]!==!0&&(i=o[0],s.splice(u--,0,i));break}if(n!==!0)if(n&&t["throws"])e=n(e);else try{e=n(e)}catch(h){return{state:"parsererror",error:n?h:"No conversion from "+a+" to "+i}}}a=i}return{state:"success",data:e}}function A(){try{return new t.XMLHttpRequest}catch(e){}}function B(){try{return new t.ActiveXObject("Microsoft.XMLHTTP")}catch(e){}}function L(){return setTimeout(function(){Gn=e},0),Gn=J.now()}function M(t,e){J.each(e,function(e,n){for(var r=(tr[e]||[]).concat(tr["*"]),i=0,o=r.length;o>i;i++)if(r[i].call(t,e,n))return})}function F(t,e,n){var r,i=0,o=Kn.length,s=J.Deferred().always(function(){delete a.elem}),a=function(){for(var e=Gn||L(),n=Math.max(0,l.startTime+l.duration-e),r=n/l.duration||0,i=1-r,o=0,a=l.tweens.length;a>o;o++)l.tweens[o].run(i);return s.notifyWith(t,[l,i,n]),1>i&&a?n:(s.resolveWith(t,[l]),!1)},l=s.promise({elem:t,props:J.extend({},e),opts:J.extend(!0,{specialEasing:{}},n),originalProperties:e,originalOptions:n,startTime:Gn||L(),duration:n.duration,tweens:[],createTween:function(e,n){var r=J.Tween(t,l.opts,e,n,l.opts.specialEasing[e]||l.opts.easing);return l.tweens.push(r),r},stop:function(e){for(var n=0,r=e?l.tweens.length:0;r>n;n++)l.tweens[n].run(1);return e?s.resolveWith(t,[l,e]):s.rejectWith(t,[l,e]),this}}),u=l.props;for(j(u,l.opts.specialEasing);o>i;i++)if(r=Kn[i].call(l,t,u,l.opts))return r;return M(l,u),J.isFunction(l.opts.start)&&l.opts.start.call(t,l),J.fx.timer(J.extend(a,{anim:l,queue:l.opts.queue,elem:t})),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always)}function j(t,e){var n,r,i,o,s;for(n in t)if(r=J.camelCase(n),i=e[r],o=t[n],J.isArray(o)&&(i=o[1],o=t[n]=o[0]),n!==r&&(t[r]=o,delete t[n]),s=J.cssHooks[r],s&&"expand"in s){o=s.expand(o),delete t[r];for(n in o)n in t||(t[n]=o[n],e[n]=i)}else e[r]=i}function H(t,e,n){var r,i,o,s,a,l,u,h,c,f=this,p=t.style,d={},g=[],v=t.nodeType&&m(t);n.queue||(h=J._queueHooks(t,"fx"),null==h.unqueued&&(h.unqueued=0,c=h.empty.fire,h.empty.fire=function(){h.unqueued||c()}),h.unqueued++,f.always(function(){f.always(function(){h.unqueued--,J.queue(t,"fx").length||h.empty.fire()})})),1===t.nodeType&&("height"in e||"width"in e)&&(n.overflow=[p.overflow,p.overflowX,p.overflowY],"inline"===J.css(t,"display")&&"none"===J.css(t,"float")&&(J.support.inlineBlockNeedsLayout&&"inline"!==_(t.nodeName)?p.zoom=1:p.display="inline-block")),n.overflow&&(p.overflow="hidden",J.support.shrinkWrapBlocks||f.done(function(){p.overflow=n.overflow[0],p.overflowX=n.overflow[1],p.overflowY=n.overflow[2]}));for(r in e)if(o=e[r],Qn.exec(o)){if(delete e[r],l=l||"toggle"===o,o===(v?"hide":"show"))continue;g.push(r)}if(s=g.length){a=J._data(t,"fxshow")||J._data(t,"fxshow",{}),"hidden"in a&&(v=a.hidden),l&&(a.hidden=!v),v?J(t).show():f.done(function(){J(t).hide()}),f.done(function(){var e;J.removeData(t,"fxshow",!0);for(e in d)J.style(t,e,d[e])});for(r=0;s>r;r++)i=g[r],u=f.createTween(i,v?a[i]:0),d[i]=a[i]||J.style(t,i),i in a||(a[i]=u.start,v&&(u.end=u.start,u.start="width"===i||"height"===i?1:0))}}function D(t,e,n,r,i){return new D.prototype.init(t,e,n,r,i)}function P(t,e){var n,r={height:t},i=0;for(e=e?1:0;4>i;i+=2-e)n=mn[i],r["margin"+n]=r["padding"+n]=t;return e&&(r.opacity=r.width=t),r}function I(t){return J.isWindow(t)?t:9===t.nodeType?t.defaultView||t.parentWindow:!1}var O,z,R=t.document,q=t.location,W=t.navigator,$=t.jQuery,X=t.$,Y=Array.prototype.push,V=Array.prototype.slice,G=Array.prototype.indexOf,U=Object.prototype.toString,Q=Object.prototype.hasOwnProperty,Z=String.prototype.trim,J=function(t,e){return new J.fn.init(t,e,O)},K=/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source,te=/\S/,ee=/\s+/,ne=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,re=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,ie=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,oe=/^[\],:{}\s]*$/,se=/(?:^|:|,)(?:\s*\[)+/g,ae=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,le=/"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,ue=/^-ms-/,he=/-([\da-z])/gi,ce=function(t,e){return(e+"").toUpperCase()},fe=function(){R.addEventListener?(R.removeEventListener("DOMContentLoaded",fe,!1),J.ready()):"complete"===R.readyState&&(R.detachEvent("onreadystatechange",fe),J.ready())},pe={};J.fn=J.prototype={constructor:J,init:function(t,n,r){var i,o,s;if(!t)return this;if(t.nodeType)return this.context=this[0]=t,this.length=1,this;if("string"==typeof t){if(i="<"===t.charAt(0)&&">"===t.charAt(t.length-1)&&t.length>=3?[null,t,null]:re.exec(t),i&&(i[1]||!n)){if(i[1])return n=n instanceof J?n[0]:n,s=n&&n.nodeType?n.ownerDocument||n:R,t=J.parseHTML(i[1],s,!0),ie.test(i[1])&&J.isPlainObject(n)&&this.attr.call(t,n,!0),J.merge(this,t);if(o=R.getElementById(i[2]),o&&o.parentNode){if(o.id!==i[2])return r.find(t);this.length=1,this[0]=o}return this.context=R,this.selector=t,this}return!n||n.jquery?(n||r).find(t):this.constructor(n).find(t)}return J.isFunction(t)?r.ready(t):(t.selector!==e&&(this.selector=t.selector,this.context=t.context),J.makeArray(t,this))},selector:"",jquery:"1.8.3",length:0,size:function(){return this.length},toArray:function(){return V.call(this)},get:function(t){return null==t?this.toArray():0>t?this[this.length+t]:this[t]},pushStack:function(t,e,n){var r=J.merge(this.constructor(),t);return r.prevObject=this,r.context=this.context,"find"===e?r.selector=this.selector+(this.selector?" ":"")+n:e&&(r.selector=this.selector+"."+e+"("+n+")"),r},each:function(t,e){return J.each(this,t,e)},ready:function(t){return J.ready.promise().done(t),this},eq:function(t){return t=+t,-1===t?this.slice(t):this.slice(t,t+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(V.apply(this,arguments),"slice",V.call(arguments).join(","))},map:function(t){return this.pushStack(J.map(this,function(e,n){return t.call(e,n,e)}))},end:function(){return this.prevObject||this.constructor(null)},push:Y,sort:[].sort,splice:[].splice},J.fn.init.prototype=J.fn,J.extend=J.fn.extend=function(){var t,n,r,i,o,s,a=arguments[0]||{},l=1,u=arguments.length,h=!1;for("boolean"==typeof a&&(h=a,a=arguments[1]||{},l=2),"object"!=typeof a&&!J.isFunction(a)&&(a={}),u===l&&(a=this,--l);u>l;l++)if(null!=(t=arguments[l]))for(n in t)r=a[n],i=t[n],a!==i&&(h&&i&&(J.isPlainObject(i)||(o=J.isArray(i)))?(o?(o=!1,s=r&&J.isArray(r)?r:[]):s=r&&J.isPlainObject(r)?r:{},a[n]=J.extend(h,s,i)):i!==e&&(a[n]=i));return a},J.extend({noConflict:function(e){return t.$===J&&(t.$=X),e&&t.jQuery===J&&(t.jQuery=$),J},isReady:!1,readyWait:1,holdReady:function(t){t?J.readyWait++:J.ready(!0)},ready:function(t){if(t===!0?!--J.readyWait:!J.isReady){if(!R.body)return setTimeout(J.ready,1);J.isReady=!0,t!==!0&&--J.readyWait>0||(z.resolveWith(R,[J]),J.fn.trigger&&J(R).trigger("ready").off("ready"))}},isFunction:function(t){return"function"===J.type(t)},isArray:Array.isArray||function(t){return"array"===J.type(t)},isWindow:function(t){return null!=t&&t==t.window},isNumeric:function(t){return!isNaN(parseFloat(t))&&isFinite(t)},type:function(t){return null==t?t+"":pe[U.call(t)]||"object"},isPlainObject:function(t){if(!t||"object"!==J.type(t)||t.nodeType||J.isWindow(t))return!1;try{if(t.constructor&&!Q.call(t,"constructor")&&!Q.call(t.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}var r;for(r in t);return r===e||Q.call(t,r)},isEmptyObject:function(t){var e;for(e in t)return!1;return!0},error:function(t){throw Error(t)},parseHTML:function(t,e,n){var r;return t&&"string"==typeof t?("boolean"==typeof e&&(n=e,e=0),e=e||R,(r=ie.exec(t))?[e.createElement(r[1])]:(r=J.buildFragment([t],e,n?null:[]),J.merge([],(r.cacheable?J.clone(r.fragment):r.fragment).childNodes))):null},parseJSON:function(e){return e&&"string"==typeof e?(e=J.trim(e),t.JSON&&t.JSON.parse?t.JSON.parse(e):oe.test(e.replace(ae,"@").replace(le,"]").replace(se,""))?Function("return "+e)():(J.error("Invalid JSON: "+e),void 0)):null},parseXML:function(n){var r,i;if(!n||"string"!=typeof n)return null;try{t.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(o){r=e}return(!r||!r.documentElement||r.getElementsByTagName("parsererror").length)&&J.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(e){e&&te.test(e)&&(t.execScript||function(e){t.eval.call(t,e)})(e)},camelCase:function(t){return t.replace(ue,"ms-").replace(he,ce)},nodeName:function(t,e){return t.nodeName&&t.nodeName.toLowerCase()===e.toLowerCase()},each:function(t,n,r){var i,o=0,s=t.length,a=s===e||J.isFunction(t);if(r)if(a){for(i in t)if(n.apply(t[i],r)===!1)break}else for(;s>o&&n.apply(t[o++],r)!==!1;);else if(a){for(i in t)if(n.call(t[i],i,t[i])===!1)break}else for(;s>o&&n.call(t[o],o,t[o++])!==!1;);return t},trim:Z&&!Z.call(" ")?function(t){return null==t?"":Z.call(t)}:function(t){return null==t?"":(t+"").replace(ne,"")},makeArray:function(t,e){var n,r=e||[];return null!=t&&(n=J.type(t),null==t.length||"string"===n||"function"===n||"regexp"===n||J.isWindow(t)?Y.call(r,t):J.merge(r,t)),r},inArray:function(t,e,n){var r;if(e){if(G)return G.call(e,t,n);for(r=e.length,n=n?0>n?Math.max(0,r+n):n:0;r>n;n++)if(n in e&&e[n]===t)return n}return-1},merge:function(t,n){var r=n.length,i=t.length,o=0;if("number"==typeof r)for(;r>o;o++)t[i++]=n[o];else for(;n[o]!==e;)t[i++]=n[o++];return t.length=i,t},grep:function(t,e,n){var r,i=[],o=0,s=t.length;for(n=!!n;s>o;o++)r=!!e(t[o],o),n!==r&&i.push(t[o]);return i},map:function(t,n,r){var i,o,s=[],a=0,l=t.length,u=t instanceof J||l!==e&&"number"==typeof l&&(l>0&&t[0]&&t[l-1]||0===l||J.isArray(t));if(u)for(;l>a;a++)i=n(t[a],a,r),null!=i&&(s[s.length]=i);else for(o in t)i=n(t[o],o,r),null!=i&&(s[s.length]=i);return s.concat.apply([],s)},guid:1,proxy:function(t,n){var r,i,o;return"string"==typeof n&&(r=t[n],n=t,t=r),J.isFunction(t)?(i=V.call(arguments,2),o=function(){return t.apply(n,i.concat(V.call(arguments)))},o.guid=t.guid=t.guid||J.guid++,o):e},access:function(t,n,r,i,o,s,a){var l,u=null==r,h=0,c=t.length;if(r&&"object"==typeof r){for(h in r)J.access(t,n,h,r[h],1,s,i);o=1}else if(i!==e){if(l=a===e&&J.isFunction(i),u&&(l?(l=n,n=function(t,e,n){return l.call(J(t),n)}):(n.call(t,i),n=null)),n)for(;c>h;h++)n(t[h],r,l?i.call(t[h],h,n(t[h],r)):i,a);o=1}return o?t:u?n.call(t):c?n(t[0],r):s},now:function(){return(new Date).getTime()}}),J.ready.promise=function(e){if(!z)if(z=J.Deferred(),"complete"===R.readyState)setTimeout(J.ready,1);else if(R.addEventListener)R.addEventListener("DOMContentLoaded",fe,!1),t.addEventListener("load",J.ready,!1);else{R.attachEvent("onreadystatechange",fe),t.attachEvent("onload",J.ready);var n=!1;try{n=null==t.frameElement&&R.documentElement}catch(r){}n&&n.doScroll&&function i(){if(!J.isReady){try{n.doScroll("left")}catch(t){return setTimeout(i,50)}J.ready()}}()}return z.promise(e)},J.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(t,e){pe["[object "+e+"]"]=e.toLowerCase()}),O=J(R);var de={};J.Callbacks=function(t){t="string"==typeof t?de[t]||n(t):J.extend({},t);var r,i,o,s,a,l,u=[],h=!t.once&&[],c=function(e){for(r=t.memory&&e,i=!0,l=s||0,s=0,a=u.length,o=!0;u&&a>l;l++)if(u[l].apply(e[0],e[1])===!1&&t.stopOnFalse){r=!1;break}o=!1,u&&(h?h.length&&c(h.shift()):r?u=[]:f.disable())},f={add:function(){if(u){var e=u.length;(function n(e){J.each(e,function(e,r){var i=J.type(r);"function"===i?(!t.unique||!f.has(r))&&u.push(r):r&&r.length&&"string"!==i&&n(r)})})(arguments),o?a=u.length:r&&(s=e,c(r))}return this},remove:function(){return u&&J.each(arguments,function(t,e){for(var n;(n=J.inArray(e,u,n))>-1;)u.splice(n,1),o&&(a>=n&&a--,l>=n&&l--)}),this},has:function(t){return J.inArray(t,u)>-1},empty:function(){return u=[],this},disable:function(){return u=h=r=e,this},disabled:function(){return!u},lock:function(){return h=e,r||f.disable(),this},locked:function(){return!h},fireWith:function(t,e){return e=e||[],e=[t,e.slice?e.slice():e],u&&(!i||h)&&(o?h.push(e):c(e)),this},fire:function(){return f.fireWith(this,arguments),this},fired:function(){return!!i}};return f},J.extend({Deferred:function(t){var e=[["resolve","done",J.Callbacks("once memory"),"resolved"],["reject","fail",J.Callbacks("once memory"),"rejected"],["notify","progress",J.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var t=arguments;return J.Deferred(function(n){J.each(e,function(e,r){var o=r[0],s=t[e];i[r[1]](J.isFunction(s)?function(){var t=s.apply(this,arguments);t&&J.isFunction(t.promise)?t.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[o+"With"](this===i?n:this,[t])}:n[o])}),t=null}).promise()},promise:function(t){return null!=t?J.extend(t,r):r}},i={};return r.pipe=r.then,J.each(e,function(t,o){var s=o[2],a=o[3];r[o[1]]=s.add,a&&s.add(function(){n=a},e[1^t][2].disable,e[2][2].lock),i[o[0]]=s.fire,i[o[0]+"With"]=s.fireWith}),r.promise(i),t&&t.call(i,i),i},when:function(t){var e,n,r,i=0,o=V.call(arguments),s=o.length,a=1!==s||t&&J.isFunction(t.promise)?s:0,l=1===a?t:J.Deferred(),u=function(t,n,r){return function(i){n[t]=this,r[t]=arguments.length>1?V.call(arguments):i,r===e?l.notifyWith(n,r):--a||l.resolveWith(n,r)}};if(s>1)for(e=Array(s),n=Array(s),r=Array(s);s>i;i++)o[i]&&J.isFunction(o[i].promise)?o[i].promise().done(u(i,r,o)).fail(l.reject).progress(u(i,n,e)):--a;return a||l.resolveWith(r,o),l.promise()}}),J.support=function(){var e,n,r,i,o,s,a,l,u,h,c,f=R.createElement("div");if(f.setAttribute("className","t"),f.innerHTML="
a",n=f.getElementsByTagName("*"),r=f.getElementsByTagName("a")[0],!n||!r||!n.length)return{};i=R.createElement("select"),o=i.appendChild(R.createElement("option")),s=f.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",e={leadingWhitespace:3===f.firstChild.nodeType,tbody:!f.getElementsByTagName("tbody").length,htmlSerialize:!!f.getElementsByTagName("link").length,style:/top/.test(r.getAttribute("style")),hrefNormalized:"/a"===r.getAttribute("href"),opacity:/^0.5/.test(r.style.opacity),cssFloat:!!r.style.cssFloat,checkOn:"on"===s.value,optSelected:o.selected,getSetAttribute:"t"!==f.className,enctype:!!R.createElement("form").enctype,html5Clone:"<:nav>"!==R.createElement("nav").cloneNode(!0).outerHTML,boxModel:"CSS1Compat"===R.compatMode,submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},s.checked=!0,e.noCloneChecked=s.cloneNode(!0).checked,i.disabled=!0,e.optDisabled=!o.disabled;try{delete f.test}catch(p){e.deleteExpando=!1}if(!f.addEventListener&&f.attachEvent&&f.fireEvent&&(f.attachEvent("onclick",c=function(){e.noCloneEvent=!1}),f.cloneNode(!0).fireEvent("onclick"),f.detachEvent("onclick",c)),s=R.createElement("input"),s.value="t",s.setAttribute("type","radio"),e.radioValue="t"===s.value,s.setAttribute("checked","checked"),s.setAttribute("name","t"),f.appendChild(s),a=R.createDocumentFragment(),a.appendChild(f.lastChild),e.checkClone=a.cloneNode(!0).cloneNode(!0).lastChild.checked,e.appendChecked=s.checked,a.removeChild(s),a.appendChild(f),f.attachEvent)for(u in{submit:!0,change:!0,focusin:!0})l="on"+u,h=l in f,h||(f.setAttribute(l,"return;"),h="function"==typeof f[l]),e[u+"Bubbles"]=h;return J(function(){var n,r,i,o,s="padding:0;margin:0;border:0;display:block;overflow:hidden;",a=R.getElementsByTagName("body")[0];a&&(n=R.createElement("div"),n.style.cssText="visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px",a.insertBefore(n,a.firstChild),r=R.createElement("div"),n.appendChild(r),r.innerHTML="
t
",i=r.getElementsByTagName("td"),i[0].style.cssText="padding:0;margin:0;border:0;display:none",h=0===i[0].offsetHeight,i[0].style.display="",i[1].style.display="none",e.reliableHiddenOffsets=h&&0===i[0].offsetHeight,r.innerHTML="",r.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",e.boxSizing=4===r.offsetWidth,e.doesNotIncludeMarginInBodyOffset=1!==a.offsetTop,t.getComputedStyle&&(e.pixelPosition="1%"!==(t.getComputedStyle(r,null)||{}).top,e.boxSizingReliable="4px"===(t.getComputedStyle(r,null)||{width:"4px"}).width,o=R.createElement("div"),o.style.cssText=r.style.cssText=s,o.style.marginRight=o.style.width="0",r.style.width="1px",r.appendChild(o),e.reliableMarginRight=!parseFloat((t.getComputedStyle(o,null)||{}).marginRight)),r.style.zoom!==void 0&&(r.innerHTML="",r.style.cssText=s+"width:1px;padding:1px;display:inline;zoom:1",e.inlineBlockNeedsLayout=3===r.offsetWidth,r.style.display="block",r.style.overflow="visible",r.innerHTML="
",r.firstChild.style.width="5px",e.shrinkWrapBlocks=3!==r.offsetWidth,n.style.zoom=1),a.removeChild(n),n=r=i=o=null)}),a.removeChild(f),n=r=i=o=s=a=f=null,e}();var ge=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,ve=/([A-Z])/g;J.extend({cache:{},deletedIds:[],uuid:0,expando:"jQuery"+(J.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(t){return t=t.nodeType?J.cache[t[J.expando]]:t[J.expando],!!t&&!i(t)},data:function(t,n,r,i){if(J.acceptData(t)){var o,s,a=J.expando,l="string"==typeof n,u=t.nodeType,h=u?J.cache:t,c=u?t[a]:t[a]&&a;if(c&&h[c]&&(i||h[c].data)||!l||r!==e)return c||(u?t[a]=c=J.deletedIds.pop()||J.guid++:c=a),h[c]||(h[c]={},u||(h[c].toJSON=J.noop)),("object"==typeof n||"function"==typeof n)&&(i?h[c]=J.extend(h[c],n):h[c].data=J.extend(h[c].data,n)),o=h[c],i||(o.data||(o.data={}),o=o.data),r!==e&&(o[J.camelCase(n)]=r),l?(s=o[n],null==s&&(s=o[J.camelCase(n)])):s=o,s}},removeData:function(t,e,n){if(J.acceptData(t)){var r,o,s,a=t.nodeType,l=a?J.cache:t,u=a?t[J.expando]:J.expando;if(l[u]){if(e&&(r=n?l[u]:l[u].data)){J.isArray(e)||(e in r?e=[e]:(e=J.camelCase(e),e=e in r?[e]:e.split(" ")));for(o=0,s=e.length;s>o;o++)delete r[e[o]];if(!(n?i:J.isEmptyObject)(r))return}(n||(delete l[u].data,i(l[u])))&&(a?J.cleanData([t],!0):J.support.deleteExpando||l!=l.window?delete l[u]:l[u]=null)}}},_data:function(t,e,n){return J.data(t,e,n,!0)},acceptData:function(t){var e=t.nodeName&&J.noData[t.nodeName.toLowerCase()];return!e||e!==!0&&t.getAttribute("classid")===e}}),J.fn.extend({data:function(t,n){var i,o,s,a,l,u=this[0],h=0,c=null;if(t===e){if(this.length&&(c=J.data(u),1===u.nodeType&&!J._data(u,"parsedAttrs"))){for(s=u.attributes,l=s.length;l>h;h++)a=s[h].name,a.indexOf("data-")||(a=J.camelCase(a.substring(5)),r(u,a,c[a]));J._data(u,"parsedAttrs",!0)}return c}return"object"==typeof t?this.each(function(){J.data(this,t)}):(i=t.split(".",2),i[1]=i[1]?"."+i[1]:"",o=i[1]+"!",J.access(this,function(n){return n===e?(c=this.triggerHandler("getData"+o,[i[0]]),c===e&&u&&(c=J.data(u,t),c=r(u,t,c)),c===e&&i[1]?this.data(i[0]):c):(i[1]=n,this.each(function(){var e=J(this);e.triggerHandler("setData"+o,i),J.data(this,t,n),e.triggerHandler("changeData"+o,i)}),void 0)},null,n,arguments.length>1,null,!1))},removeData:function(t){return this.each(function(){J.removeData(this,t)})}}),J.extend({queue:function(t,e,n){var r;return t?(e=(e||"fx")+"queue",r=J._data(t,e),n&&(!r||J.isArray(n)?r=J._data(t,e,J.makeArray(n)):r.push(n)),r||[]):void 0},dequeue:function(t,e){e=e||"fx";var n=J.queue(t,e),r=n.length,i=n.shift(),o=J._queueHooks(t,e),s=function(){J.dequeue(t,e)};"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===e&&n.unshift("inprogress"),delete o.stop,i.call(t,s,o)),!r&&o&&o.empty.fire()},_queueHooks:function(t,e){var n=e+"queueHooks";return J._data(t,n)||J._data(t,n,{empty:J.Callbacks("once memory").add(function(){J.removeData(t,e+"queue",!0),J.removeData(t,n,!0)})})}}),J.fn.extend({queue:function(t,n){var r=2;return"string"!=typeof t&&(n=t,t="fx",r--),r>arguments.length?J.queue(this[0],t):n===e?this:this.each(function(){var e=J.queue(this,t,n);J._queueHooks(this,t),"fx"===t&&"inprogress"!==e[0]&&J.dequeue(this,t)})},dequeue:function(t){return this.each(function(){J.dequeue(this,t)})},delay:function(t,e){return t=J.fx?J.fx.speeds[t]||t:t,e=e||"fx",this.queue(e,function(e,n){var r=setTimeout(e,t);n.stop=function(){clearTimeout(r)}})},clearQueue:function(t){return this.queue(t||"fx",[])},promise:function(t,n){var r,i=1,o=J.Deferred(),s=this,a=this.length,l=function(){--i||o.resolveWith(s,[s])};for("string"!=typeof t&&(n=t,t=e),t=t||"fx";a--;)r=J._data(s[a],t+"queueHooks"),r&&r.empty&&(i++,r.empty.add(l));return l(),o.promise(n)}});var me,ye,xe,be=/[\t\r\n]/g,we=/\r/g,_e=/^(?:button|input)$/i,ke=/^(?:button|input|object|select|textarea)$/i,Ce=/^a(?:rea|)$/i,Te=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,Se=J.support.getSetAttribute;J.fn.extend({attr:function(t,e){return J.access(this,J.attr,t,e,arguments.length>1)},removeAttr:function(t){return this.each(function(){J.removeAttr(this,t)})},prop:function(t,e){return J.access(this,J.prop,t,e,arguments.length>1)},removeProp:function(t){return t=J.propFix[t]||t,this.each(function(){try{this[t]=e,delete this[t]}catch(n){}})},addClass:function(t){var e,n,r,i,o,s,a;if(J.isFunction(t))return this.each(function(e){J(this).addClass(t.call(this,e,this.className))});if(t&&"string"==typeof t)for(e=t.split(ee),n=0,r=this.length;r>n;n++)if(i=this[n],1===i.nodeType)if(i.className||1!==e.length){for(o=" "+i.className+" ",s=0,a=e.length;a>s;s++)0>o.indexOf(" "+e[s]+" ")&&(o+=e[s]+" ");i.className=J.trim(o)}else i.className=t;return this},removeClass:function(t){var n,r,i,o,s,a,l;if(J.isFunction(t))return this.each(function(e){J(this).removeClass(t.call(this,e,this.className))});if(t&&"string"==typeof t||t===e)for(n=(t||"").split(ee),a=0,l=this.length;l>a;a++)if(i=this[a],1===i.nodeType&&i.className){for(r=(" "+i.className+" ").replace(be," "),o=0,s=n.length;s>o;o++)for(;r.indexOf(" "+n[o]+" ")>=0;)r=r.replace(" "+n[o]+" "," ");i.className=t?J.trim(r):""}return this},toggleClass:function(t,e){var n=typeof t,r="boolean"==typeof e;return J.isFunction(t)?this.each(function(n){J(this).toggleClass(t.call(this,n,this.className,e),e)}):this.each(function(){if("string"===n)for(var i,o=0,s=J(this),a=e,l=t.split(ee);i=l[o++];)a=r?a:!s.hasClass(i),s[a?"addClass":"removeClass"](i);else("undefined"===n||"boolean"===n)&&(this.className&&J._data(this,"__className__",this.className),this.className=this.className||t===!1?"":J._data(this,"__className__")||"")})},hasClass:function(t){for(var e=" "+t+" ",n=0,r=this.length;r>n;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(be," ").indexOf(e)>=0)return!0;return!1},val:function(t){var n,r,i,o=this[0];{if(arguments.length)return i=J.isFunction(t),this.each(function(r){var o,s=J(this);1===this.nodeType&&(o=i?t.call(this,r,s.val()):t,null==o?o="":"number"==typeof o?o+="":J.isArray(o)&&(o=J.map(o,function(t){return null==t?"":t+""})),n=J.valHooks[this.type]||J.valHooks[this.nodeName.toLowerCase()],n&&"set"in n&&n.set(this,o,"value")!==e||(this.value=o))});if(o)return n=J.valHooks[o.type]||J.valHooks[o.nodeName.toLowerCase()],n&&"get"in n&&(r=n.get(o,"value"))!==e?r:(r=o.value,"string"==typeof r?r.replace(we,""):null==r?"":r)}}}),J.extend({valHooks:{option:{get:function(t){var e=t.attributes.value;return!e||e.specified?t.value:t.text}},select:{get:function(t){for(var e,n,r=t.options,i=t.selectedIndex,o="select-one"===t.type||0>i,s=o?null:[],a=o?i+1:r.length,l=0>i?a:o?i:0;a>l;l++)if(n=r[l],!(!n.selected&&l!==i||(J.support.optDisabled?n.disabled:null!==n.getAttribute("disabled"))||n.parentNode.disabled&&J.nodeName(n.parentNode,"optgroup"))){if(e=J(n).val(),o)return e;s.push(e)}return s},set:function(t,e){var n=J.makeArray(e);return J(t).find("option").each(function(){this.selected=J.inArray(J(this).val(),n)>=0}),n.length||(t.selectedIndex=-1),n}}},attrFn:{},attr:function(t,n,r,i){var o,s,a,l=t.nodeType;if(t&&3!==l&&8!==l&&2!==l)return i&&J.isFunction(J.fn[n])?J(t)[n](r):t.getAttribute===void 0?J.prop(t,n,r):(a=1!==l||!J.isXMLDoc(t),a&&(n=n.toLowerCase(),s=J.attrHooks[n]||(Te.test(n)?ye:me)),r!==e?null===r?(J.removeAttr(t,n),void 0):s&&"set"in s&&a&&(o=s.set(t,r,n))!==e?o:(t.setAttribute(n,r+""),r):s&&"get"in s&&a&&null!==(o=s.get(t,n))?o:(o=t.getAttribute(n),null===o?e:o))},removeAttr:function(t,e){var n,r,i,o,s=0;if(e&&1===t.nodeType)for(r=e.split(ee);r.length>s;s++)i=r[s],i&&(n=J.propFix[i]||i,o=Te.test(i),o||J.attr(t,i,""),t.removeAttribute(Se?i:n),o&&n in t&&(t[n]=!1))},attrHooks:{type:{set:function(t,e){if(_e.test(t.nodeName)&&t.parentNode)J.error("type property can't be changed");else if(!J.support.radioValue&&"radio"===e&&J.nodeName(t,"input")){var n=t.value;return t.setAttribute("type",e),n&&(t.value=n),e}}},value:{get:function(t,e){return me&&J.nodeName(t,"button")?me.get(t,e):e in t?t.value:null},set:function(t,e,n){return me&&J.nodeName(t,"button")?me.set(t,e,n):(t.value=e,void 0)}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(t,n,r){var i,o,s,a=t.nodeType;if(t&&3!==a&&8!==a&&2!==a)return s=1!==a||!J.isXMLDoc(t),s&&(n=J.propFix[n]||n,o=J.propHooks[n]),r!==e?o&&"set"in o&&(i=o.set(t,r,n))!==e?i:t[n]=r:o&&"get"in o&&null!==(i=o.get(t,n))?i:t[n]},propHooks:{tabIndex:{get:function(t){var n=t.getAttributeNode("tabindex");return n&&n.specified?parseInt(n.value,10):ke.test(t.nodeName)||Ce.test(t.nodeName)&&t.href?0:e}}}}),ye={get:function(t,n){var r,i=J.prop(t,n);return i===!0||"boolean"!=typeof i&&(r=t.getAttributeNode(n))&&r.nodeValue!==!1?n.toLowerCase():e},set:function(t,e,n){var r;return e===!1?J.removeAttr(t,n):(r=J.propFix[n]||n,r in t&&(t[r]=!0),t.setAttribute(n,n.toLowerCase())),n}},Se||(xe={name:!0,id:!0,coords:!0},me=J.valHooks.button={get:function(t,n){var r;return r=t.getAttributeNode(n),r&&(xe[n]?""!==r.value:r.specified)?r.value:e},set:function(t,e,n){var r=t.getAttributeNode(n);return r||(r=R.createAttribute(n),t.setAttributeNode(r)),r.value=e+""}},J.each(["width","height"],function(t,e){J.attrHooks[e]=J.extend(J.attrHooks[e],{set:function(t,n){return""===n?(t.setAttribute(e,"auto"),n):void 0 +}})}),J.attrHooks.contenteditable={get:me.get,set:function(t,e,n){""===e&&(e="false"),me.set(t,e,n)}}),J.support.hrefNormalized||J.each(["href","src","width","height"],function(t,n){J.attrHooks[n]=J.extend(J.attrHooks[n],{get:function(t){var r=t.getAttribute(n,2);return null===r?e:r}})}),J.support.style||(J.attrHooks.style={get:function(t){return t.style.cssText.toLowerCase()||e},set:function(t,e){return t.style.cssText=e+""}}),J.support.optSelected||(J.propHooks.selected=J.extend(J.propHooks.selected,{get:function(t){var e=t.parentNode;return e&&(e.selectedIndex,e.parentNode&&e.parentNode.selectedIndex),null}})),J.support.enctype||(J.propFix.enctype="encoding"),J.support.checkOn||J.each(["radio","checkbox"],function(){J.valHooks[this]={get:function(t){return null===t.getAttribute("value")?"on":t.value}}}),J.each(["radio","checkbox"],function(){J.valHooks[this]=J.extend(J.valHooks[this],{set:function(t,e){return J.isArray(e)?t.checked=J.inArray(J(t).val(),e)>=0:void 0}})});var Ne=/^(?:textarea|input|select)$/i,Ee=/^([^\.]*|)(?:\.(.+)|)$/,Ae=/(?:^|\s)hover(\.\S+|)\b/,Be=/^key/,Le=/^(?:mouse|contextmenu)|click/,Me=/^(?:focusinfocus|focusoutblur)$/,Fe=function(t){return J.event.special.hover?t:t.replace(Ae,"mouseenter$1 mouseleave$1")};J.event={add:function(t,n,r,i,o){var s,a,l,u,h,c,f,p,d,g,v;if(3!==t.nodeType&&8!==t.nodeType&&n&&r&&(s=J._data(t))){for(r.handler&&(d=r,r=d.handler,o=d.selector),r.guid||(r.guid=J.guid++),l=s.events,l||(s.events=l={}),a=s.handle,a||(s.handle=a=function(t){return J===void 0||t&&J.event.triggered===t.type?e:J.event.dispatch.apply(a.elem,arguments)},a.elem=t),n=J.trim(Fe(n)).split(" "),u=0;n.length>u;u++)h=Ee.exec(n[u])||[],c=h[1],f=(h[2]||"").split(".").sort(),v=J.event.special[c]||{},c=(o?v.delegateType:v.bindType)||c,v=J.event.special[c]||{},p=J.extend({type:c,origType:h[1],data:i,handler:r,guid:r.guid,selector:o,needsContext:o&&J.expr.match.needsContext.test(o),namespace:f.join(".")},d),g=l[c],g||(g=l[c]=[],g.delegateCount=0,v.setup&&v.setup.call(t,i,f,a)!==!1||(t.addEventListener?t.addEventListener(c,a,!1):t.attachEvent&&t.attachEvent("on"+c,a))),v.add&&(v.add.call(t,p),p.handler.guid||(p.handler.guid=r.guid)),o?g.splice(g.delegateCount++,0,p):g.push(p),J.event.global[c]=!0;t=null}},global:{},remove:function(t,e,n,r,i){var o,s,a,l,u,h,c,f,p,d,g,v=J.hasData(t)&&J._data(t);if(v&&(f=v.events)){for(e=J.trim(Fe(e||"")).split(" "),o=0;e.length>o;o++)if(s=Ee.exec(e[o])||[],a=l=s[1],u=s[2],a){for(p=J.event.special[a]||{},a=(r?p.delegateType:p.bindType)||a,d=f[a]||[],h=d.length,u=u?RegExp("(^|\\.)"+u.split(".").sort().join("\\.(?:.*\\.|)")+"(\\.|$)"):null,c=0;d.length>c;c++)g=d[c],!(!i&&l!==g.origType||n&&n.guid!==g.guid||u&&!u.test(g.namespace)||r&&r!==g.selector&&("**"!==r||!g.selector)||(d.splice(c--,1),g.selector&&d.delegateCount--,!p.remove||!p.remove.call(t,g)));0===d.length&&h!==d.length&&((!p.teardown||p.teardown.call(t,u,v.handle)===!1)&&J.removeEvent(t,a,v.handle),delete f[a])}else for(a in f)J.event.remove(t,a+e[o],n,r,!0);J.isEmptyObject(f)&&(delete v.handle,J.removeData(t,"events",!0))}},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(n,r,i,o){if(!i||3!==i.nodeType&&8!==i.nodeType){var s,a,l,u,h,c,f,p,d,g,v=n.type||n,m=[];if(Me.test(v+J.event.triggered))return;if(v.indexOf("!")>=0&&(v=v.slice(0,-1),a=!0),v.indexOf(".")>=0&&(m=v.split("."),v=m.shift(),m.sort()),(!i||J.event.customEvent[v])&&!J.event.global[v])return;if(n="object"==typeof n?n[J.expando]?n:new J.Event(v,n):new J.Event(v),n.type=v,n.isTrigger=!0,n.exclusive=a,n.namespace=m.join("."),n.namespace_re=n.namespace?RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,c=0>v.indexOf(":")?"on"+v:"",!i){s=J.cache;for(l in s)s[l].events&&s[l].events[v]&&J.event.trigger(n,r,s[l].handle.elem,!0);return}if(n.result=e,n.target||(n.target=i),r=null!=r?J.makeArray(r):[],r.unshift(n),f=J.event.special[v]||{},f.trigger&&f.trigger.apply(i,r)===!1)return;if(d=[[i,f.bindType||v]],!o&&!f.noBubble&&!J.isWindow(i)){for(g=f.delegateType||v,u=Me.test(g+v)?i:i.parentNode,h=i;u;u=u.parentNode)d.push([u,g]),h=u;h===(i.ownerDocument||R)&&d.push([h.defaultView||h.parentWindow||t,g])}for(l=0;d.length>l&&!n.isPropagationStopped();l++)u=d[l][0],n.type=d[l][1],p=(J._data(u,"events")||{})[n.type]&&J._data(u,"handle"),p&&p.apply(u,r),p=c&&u[c],p&&J.acceptData(u)&&p.apply&&p.apply(u,r)===!1&&n.preventDefault();return n.type=v,!(o||n.isDefaultPrevented()||f._default&&f._default.apply(i.ownerDocument,r)!==!1||"click"===v&&J.nodeName(i,"a")||!J.acceptData(i)||!c||!i[v]||("focus"===v||"blur"===v)&&0===n.target.offsetWidth||J.isWindow(i)||(h=i[c],h&&(i[c]=null),J.event.triggered=v,i[v](),J.event.triggered=e,!h||!(i[c]=h))),n.result}},dispatch:function(n){n=J.event.fix(n||t.event);var r,i,o,s,a,l,u,h,c,f=(J._data(this,"events")||{})[n.type]||[],p=f.delegateCount,d=V.call(arguments),g=!n.exclusive&&!n.namespace,v=J.event.special[n.type]||{},m=[];if(d[0]=n,n.delegateTarget=this,!v.preDispatch||v.preDispatch.call(this,n)!==!1){if(p&&(!n.button||"click"!==n.type))for(o=n.target;o!=this;o=o.parentNode||this)if(o.disabled!==!0||"click"!==n.type){for(a={},u=[],r=0;p>r;r++)h=f[r],c=h.selector,a[c]===e&&(a[c]=h.needsContext?J(c,this).index(o)>=0:J.find(c,this,null,[o]).length),a[c]&&u.push(h);u.length&&m.push({elem:o,matches:u})}for(f.length>p&&m.push({elem:this,matches:f.slice(p)}),r=0;m.length>r&&!n.isPropagationStopped();r++)for(l=m[r],n.currentTarget=l.elem,i=0;l.matches.length>i&&!n.isImmediatePropagationStopped();i++)h=l.matches[i],(g||!n.namespace&&!h.namespace||n.namespace_re&&n.namespace_re.test(h.namespace))&&(n.data=h.data,n.handleObj=h,s=((J.event.special[h.origType]||{}).handle||h.handler).apply(l.elem,d),s!==e&&(n.result=s,s===!1&&(n.preventDefault(),n.stopPropagation())));return v.postDispatch&&v.postDispatch.call(this,n),n.result}},props:"attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(t,e){return null==t.which&&(t.which=null!=e.charCode?e.charCode:e.keyCode),t}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(t,n){var r,i,o,s=n.button,a=n.fromElement;return null==t.pageX&&null!=n.clientX&&(r=t.target.ownerDocument||R,i=r.documentElement,o=r.body,t.pageX=n.clientX+(i&&i.scrollLeft||o&&o.scrollLeft||0)-(i&&i.clientLeft||o&&o.clientLeft||0),t.pageY=n.clientY+(i&&i.scrollTop||o&&o.scrollTop||0)-(i&&i.clientTop||o&&o.clientTop||0)),!t.relatedTarget&&a&&(t.relatedTarget=a===t.target?n.toElement:a),!t.which&&s!==e&&(t.which=1&s?1:2&s?3:4&s?2:0),t}},fix:function(t){if(t[J.expando])return t;var e,n,r=t,i=J.event.fixHooks[t.type]||{},o=i.props?this.props.concat(i.props):this.props;for(t=J.Event(r),e=o.length;e;)n=o[--e],t[n]=r[n];return t.target||(t.target=r.srcElement||R),3===t.target.nodeType&&(t.target=t.target.parentNode),t.metaKey=!!t.metaKey,i.filter?i.filter(t,r):t},special:{load:{noBubble:!0},focus:{delegateType:"focusin"},blur:{delegateType:"focusout"},beforeunload:{setup:function(t,e,n){J.isWindow(this)&&(this.onbeforeunload=n)},teardown:function(t,e){this.onbeforeunload===e&&(this.onbeforeunload=null)}}},simulate:function(t,e,n,r){var i=J.extend(new J.Event,n,{type:t,isSimulated:!0,originalEvent:{}});r?J.event.trigger(i,null,e):J.event.dispatch.call(e,i),i.isDefaultPrevented()&&n.preventDefault()}},J.event.handle=J.event.dispatch,J.removeEvent=R.removeEventListener?function(t,e,n){t.removeEventListener&&t.removeEventListener(e,n,!1)}:function(t,e,n){var r="on"+e;t.detachEvent&&(t[r]===void 0&&(t[r]=null),t.detachEvent(r,n))},J.Event=function(t,e){return this instanceof J.Event?(t&&t.type?(this.originalEvent=t,this.type=t.type,this.isDefaultPrevented=t.defaultPrevented||t.returnValue===!1||t.getPreventDefault&&t.getPreventDefault()?s:o):this.type=t,e&&J.extend(this,e),this.timeStamp=t&&t.timeStamp||J.now(),this[J.expando]=!0,void 0):new J.Event(t,e)},J.Event.prototype={preventDefault:function(){this.isDefaultPrevented=s;var t=this.originalEvent;t&&(t.preventDefault?t.preventDefault():t.returnValue=!1)},stopPropagation:function(){this.isPropagationStopped=s;var t=this.originalEvent;t&&(t.stopPropagation&&t.stopPropagation(),t.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=s,this.stopPropagation()},isDefaultPrevented:o,isPropagationStopped:o,isImmediatePropagationStopped:o},J.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(t,e){J.event.special[t]={delegateType:e,bindType:e,handle:function(t){var n,r=this,i=t.relatedTarget,o=t.handleObj;return o.selector,(!i||i!==r&&!J.contains(r,i))&&(t.type=o.origType,n=o.handler.apply(this,arguments),t.type=e),n}}}),J.support.submitBubbles||(J.event.special.submit={setup:function(){return J.nodeName(this,"form")?!1:(J.event.add(this,"click._submit keypress._submit",function(t){var n=t.target,r=J.nodeName(n,"input")||J.nodeName(n,"button")?n.form:e;r&&!J._data(r,"_submit_attached")&&(J.event.add(r,"submit._submit",function(t){t._submit_bubble=!0}),J._data(r,"_submit_attached",!0))}),void 0)},postDispatch:function(t){t._submit_bubble&&(delete t._submit_bubble,this.parentNode&&!t.isTrigger&&J.event.simulate("submit",this.parentNode,t,!0))},teardown:function(){return J.nodeName(this,"form")?!1:(J.event.remove(this,"._submit"),void 0)}}),J.support.changeBubbles||(J.event.special.change={setup:function(){return Ne.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(J.event.add(this,"propertychange._change",function(t){"checked"===t.originalEvent.propertyName&&(this._just_changed=!0)}),J.event.add(this,"click._change",function(t){this._just_changed&&!t.isTrigger&&(this._just_changed=!1),J.event.simulate("change",this,t,!0)})),!1):(J.event.add(this,"beforeactivate._change",function(t){var e=t.target;Ne.test(e.nodeName)&&!J._data(e,"_change_attached")&&(J.event.add(e,"change._change",function(t){this.parentNode&&!t.isSimulated&&!t.isTrigger&&J.event.simulate("change",this.parentNode,t,!0)}),J._data(e,"_change_attached",!0))}),void 0)},handle:function(t){var e=t.target;return this!==e||t.isSimulated||t.isTrigger||"radio"!==e.type&&"checkbox"!==e.type?t.handleObj.handler.apply(this,arguments):void 0},teardown:function(){return J.event.remove(this,"._change"),!Ne.test(this.nodeName)}}),J.support.focusinBubbles||J.each({focus:"focusin",blur:"focusout"},function(t,e){var n=0,r=function(t){J.event.simulate(e,t.target,J.event.fix(t),!0)};J.event.special[e]={setup:function(){0===n++&&R.addEventListener(t,r,!0)},teardown:function(){0===--n&&R.removeEventListener(t,r,!0)}}}),J.fn.extend({on:function(t,n,r,i,s){var a,l;if("object"==typeof t){"string"!=typeof n&&(r=r||n,n=e);for(l in t)this.on(l,n,r,t[l],s);return this}if(null==r&&null==i?(i=n,r=n=e):null==i&&("string"==typeof n?(i=r,r=e):(i=r,r=n,n=e)),i===!1)i=o;else if(!i)return this;return 1===s&&(a=i,i=function(t){return J().off(t),a.apply(this,arguments)},i.guid=a.guid||(a.guid=J.guid++)),this.each(function(){J.event.add(this,t,i,r,n)})},one:function(t,e,n,r){return this.on(t,e,n,r,1)},off:function(t,n,r){var i,s;if(t&&t.preventDefault&&t.handleObj)return i=t.handleObj,J(t.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if("object"==typeof t){for(s in t)this.off(s,n,t[s]);return this}return(n===!1||"function"==typeof n)&&(r=n,n=e),r===!1&&(r=o),this.each(function(){J.event.remove(this,t,r,n)})},bind:function(t,e,n){return this.on(t,null,e,n)},unbind:function(t,e){return this.off(t,null,e)},live:function(t,e,n){return J(this.context).on(t,this.selector,e,n),this},die:function(t,e){return J(this.context).off(t,this.selector||"**",e),this},delegate:function(t,e,n,r){return this.on(e,t,n,r)},undelegate:function(t,e,n){return 1===arguments.length?this.off(t,"**"):this.off(e,t||"**",n)},trigger:function(t,e){return this.each(function(){J.event.trigger(t,e,this)})},triggerHandler:function(t,e){return this[0]?J.event.trigger(t,e,this[0],!0):void 0},toggle:function(t){var e=arguments,n=t.guid||J.guid++,r=0,i=function(n){var i=(J._data(this,"lastToggle"+t.guid)||0)%r;return J._data(this,"lastToggle"+t.guid,i+1),n.preventDefault(),e[i].apply(this,arguments)||!1};for(i.guid=n;e.length>r;)e[r++].guid=n;return this.click(i)},hover:function(t,e){return this.mouseenter(t).mouseleave(e||t)}}),J.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(t,e){J.fn[e]=function(t,n){return null==n&&(n=t,t=null),arguments.length>0?this.on(e,null,t,n):this.trigger(e)},Be.test(e)&&(J.event.fixHooks[e]=J.event.keyHooks),Le.test(e)&&(J.event.fixHooks[e]=J.event.mouseHooks)}),function(t,e){function n(t,e,n,r){n=n||[],e=e||L;var i,o,s,a,l=e.nodeType;if(!t||"string"!=typeof t)return n;if(1!==l&&9!==l)return[];if(s=w(e),!s&&!r&&(i=ne.exec(t)))if(a=i[1]){if(9===l){if(o=e.getElementById(a),!o||!o.parentNode)return n;if(o.id===a)return n.push(o),n}else if(e.ownerDocument&&(o=e.ownerDocument.getElementById(a))&&_(e,o)&&o.id===a)return n.push(o),n}else{if(i[2])return D.apply(n,P.call(e.getElementsByTagName(t),0)),n;if((a=i[3])&&fe&&e.getElementsByClassName)return D.apply(n,P.call(e.getElementsByClassName(a),0)),n}return g(t.replace(Z,"$1"),e,n,r,s)}function r(t){return function(e){var n=e.nodeName.toLowerCase();return"input"===n&&e.type===t}}function i(t){return function(e){var n=e.nodeName.toLowerCase();return("input"===n||"button"===n)&&e.type===t}}function o(t){return O(function(e){return e=+e,O(function(n,r){for(var i,o=t([],n.length,e),s=o.length;s--;)n[i=o[s]]&&(n[i]=!(r[i]=n[i]))})})}function s(t,e,n){if(t===e)return n;for(var r=t.nextSibling;r;){if(r===e)return-1;r=r.nextSibling}return 1}function a(t,e){var r,i,o,s,a,l,u,h=q[A][t+" "];if(h)return e?0:h.slice(0);for(a=t,l=[],u=x.preFilter;a;){(!r||(i=K.exec(a)))&&(i&&(a=a.slice(i[0].length)||a),l.push(o=[])),r=!1,(i=te.exec(a))&&(o.push(r=new B(i.shift())),a=a.slice(r.length),r.type=i[0].replace(Z," "));for(s in x.filter)(i=ae[s].exec(a))&&(!u[s]||(i=u[s](i)))&&(o.push(r=new B(i.shift())),a=a.slice(r.length),r.type=s,r.matches=i);if(!r)break}return e?a.length:a?n.error(t):q(t,l).slice(0)}function l(t,e,n){var r=e.dir,i=n&&"parentNode"===e.dir,o=j++;return e.first?function(e,n,o){for(;e=e[r];)if(i||1===e.nodeType)return t(e,n,o)}:function(e,n,s){if(s){for(;e=e[r];)if((i||1===e.nodeType)&&t(e,n,s))return e}else for(var a,l=F+" "+o+" ",u=l+m;e=e[r];)if(i||1===e.nodeType){if((a=e[A])===u)return e.sizset;if("string"==typeof a&&0===a.indexOf(l)){if(e.sizset)return e}else{if(e[A]=u,t(e,n,s))return e.sizset=!0,e;e.sizset=!1}}}}function u(t){return t.length>1?function(e,n,r){for(var i=t.length;i--;)if(!t[i](e,n,r))return!1;return!0}:t[0]}function h(t,e,n,r,i){for(var o,s=[],a=0,l=t.length,u=null!=e;l>a;a++)(o=t[a])&&(!n||n(o,r,i))&&(s.push(o),u&&e.push(a));return s}function c(t,e,n,r,i,o){return r&&!r[A]&&(r=c(r)),i&&!i[A]&&(i=c(i,o)),O(function(o,s,a,l){var u,c,f,p=[],g=[],v=s.length,m=o||d(e||"*",a.nodeType?[a]:a,[]),y=!t||!o&&e?m:h(m,p,t,a,l),x=n?i||(o?t:v||r)?[]:s:y;if(n&&n(y,x,a,l),r)for(u=h(x,g),r(u,[],a,l),c=u.length;c--;)(f=u[c])&&(x[g[c]]=!(y[g[c]]=f));if(o){if(i||t){if(i){for(u=[],c=x.length;c--;)(f=x[c])&&u.push(y[c]=f);i(null,x=[],u,l)}for(c=x.length;c--;)(f=x[c])&&(u=i?I.call(o,f):p[c])>-1&&(o[u]=!(s[u]=f))}}else x=h(x===s?x.splice(v,x.length):x),i?i(null,s,x,l):D.apply(s,x)})}function f(t){for(var e,n,r,i=t.length,o=x.relative[t[0].type],s=o||x.relative[" "],a=o?1:0,h=l(function(t){return t===e},s,!0),p=l(function(t){return I.call(e,t)>-1},s,!0),d=[function(t,n,r){return!o&&(r||n!==S)||((e=n).nodeType?h(t,n,r):p(t,n,r))}];i>a;a++)if(n=x.relative[t[a].type])d=[l(u(d),n)];else{if(n=x.filter[t[a].type].apply(null,t[a].matches),n[A]){for(r=++a;i>r&&!x.relative[t[r].type];r++);return c(a>1&&u(d),a>1&&t.slice(0,a-1).join("").replace(Z,"$1"),n,r>a&&f(t.slice(a,r)),i>r&&f(t=t.slice(r)),i>r&&t.join(""))}d.push(n)}return u(d)}function p(t,e){var r=e.length>0,i=t.length>0,o=function(s,a,l,u,c){var f,p,d,g=[],v=0,y="0",b=s&&[],w=null!=c,_=S,k=s||i&&x.find.TAG("*",c&&a.parentNode||a),C=F+=null==_?1:Math.E;for(w&&(S=a!==L&&a,m=o.el);null!=(f=k[y]);y++){if(i&&f){for(p=0;d=t[p];p++)if(d(f,a,l)){u.push(f);break}w&&(F=C,m=++o.el)}r&&((f=!d&&f)&&v--,s&&b.push(f))}if(v+=y,r&&y!==v){for(p=0;d=e[p];p++)d(b,g,a,l);if(s){if(v>0)for(;y--;)!b[y]&&!g[y]&&(g[y]=H.call(u));g=h(g)}D.apply(u,g),w&&!s&&g.length>0&&v+e.length>1&&n.uniqueSort(u)}return w&&(F=C,S=_),b};return o.el=0,r?O(o):o}function d(t,e,r){for(var i=0,o=e.length;o>i;i++)n(t,e[i],r);return r}function g(t,e,n,r,i){var o,s,l,u,h,c=a(t);if(c.length,!r&&1===c.length){if(s=c[0]=c[0].slice(0),s.length>2&&"ID"===(l=s[0]).type&&9===e.nodeType&&!i&&x.relative[s[1].type]){if(e=x.find.ID(l.matches[0].replace(se,""),e,i)[0],!e)return n;t=t.slice(s.shift().length)}for(o=ae.POS.test(t)?-1:s.length-1;o>=0&&(l=s[o],!x.relative[u=l.type]);o--)if((h=x.find[u])&&(r=h(l.matches[0].replace(se,""),re.test(s[0].type)&&e.parentNode||e,i))){if(s.splice(o,1),t=r.length&&s.join(""),!t)return D.apply(n,P.call(r,0)),n;break}}return k(t,c)(r,e,i,n,re.test(t)),n}function v(){}var m,y,x,b,w,_,k,C,T,S,N=!0,E="undefined",A=("sizcache"+Math.random()).replace(".",""),B=String,L=t.document,M=L.documentElement,F=0,j=0,H=[].pop,D=[].push,P=[].slice,I=[].indexOf||function(t){for(var e=0,n=this.length;n>e;e++)if(this[e]===t)return e;return-1},O=function(t,e){return t[A]=null==e||e,t},z=function(){var t={},e=[];return O(function(n,r){return e.push(n)>x.cacheLength&&delete t[e.shift()],t[n+" "]=r},t)},R=z(),q=z(),W=z(),$="[\\x20\\t\\r\\n\\f]",X="(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",Y=X.replace("w","w#"),V="([*^$|!~]?=)",G="\\["+$+"*("+X+")"+$+"*(?:"+V+$+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+Y+")|)|)"+$+"*\\]",U=":("+X+")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:"+G+")|[^:]|\\\\.)*|.*))\\)|)",Q=":(even|odd|eq|gt|lt|nth|first|last)(?:\\("+$+"*((?:-\\d)?\\d*)"+$+"*\\)|)(?=[^-]|$)",Z=RegExp("^"+$+"+|((?:^|[^\\\\])(?:\\\\.)*)"+$+"+$","g"),K=RegExp("^"+$+"*,"+$+"*"),te=RegExp("^"+$+"*([\\x20\\t\\r\\n\\f>+~])"+$+"*"),ee=RegExp(U),ne=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,re=/[\x20\t\r\n\f]*[+~]/,ie=/h\d/i,oe=/input|select|textarea|button/i,se=/\\(?!\\)/g,ae={ID:RegExp("^#("+X+")"),CLASS:RegExp("^\\.("+X+")"),NAME:RegExp("^\\[name=['\"]?("+X+")['\"]?\\]"),TAG:RegExp("^("+X.replace("w","w*")+")"),ATTR:RegExp("^"+G),PSEUDO:RegExp("^"+U),POS:RegExp(Q,"i"),CHILD:RegExp("^:(only|nth|first|last)-child(?:\\("+$+"*(even|odd|(([+-]|)(\\d*)n|)"+$+"*(?:([+-]|)"+$+"*(\\d+)|))"+$+"*\\)|)","i"),needsContext:RegExp("^"+$+"*[>+~]|"+Q,"i")},le=function(t){var e=L.createElement("div");try{return t(e)}catch(n){return!1}finally{e=null}},ue=le(function(t){return t.appendChild(L.createComment("")),!t.getElementsByTagName("*").length}),he=le(function(t){return t.innerHTML="",t.firstChild&&typeof t.firstChild.getAttribute!==E&&"#"===t.firstChild.getAttribute("href")}),ce=le(function(t){t.innerHTML="";var e=typeof t.lastChild.getAttribute("multiple");return"boolean"!==e&&"string"!==e}),fe=le(function(t){return t.innerHTML="",t.getElementsByClassName&&t.getElementsByClassName("e").length?(t.lastChild.className="e",2===t.getElementsByClassName("e").length):!1}),pe=le(function(t){t.id=A+0,t.innerHTML="
",M.insertBefore(t,M.firstChild);var e=L.getElementsByName&&L.getElementsByName(A).length===2+L.getElementsByName(A+0).length;return y=!L.getElementById(A),M.removeChild(t),e});try{P.call(M.childNodes,0)[0].nodeType}catch(de){P=function(t){for(var e,n=[];e=this[t];t++)n.push(e);return n}}n.matches=function(t,e){return n(t,null,null,e)},n.matchesSelector=function(t,e){return n(e,null,null,[t]).length>0},b=n.getText=function(t){var e,n="",r=0,i=t.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof t.textContent)return t.textContent;for(t=t.firstChild;t;t=t.nextSibling)n+=b(t)}else if(3===i||4===i)return t.nodeValue}else for(;e=t[r];r++)n+=b(e);return n},w=n.isXML=function(t){var e=t&&(t.ownerDocument||t).documentElement;return e?"HTML"!==e.nodeName:!1},_=n.contains=M.contains?function(t,e){var n=9===t.nodeType?t.documentElement:t,r=e&&e.parentNode;return t===r||!!(r&&1===r.nodeType&&n.contains&&n.contains(r))}:M.compareDocumentPosition?function(t,e){return e&&!!(16&t.compareDocumentPosition(e))}:function(t,e){for(;e=e.parentNode;)if(e===t)return!0;return!1},n.attr=function(t,e){var n,r=w(t);return r||(e=e.toLowerCase()),(n=x.attrHandle[e])?n(t):r||ce?t.getAttribute(e):(n=t.getAttributeNode(e),n?"boolean"==typeof t[e]?t[e]?e:null:n.specified?n.value:null:null)},x=n.selectors={cacheLength:50,createPseudo:O,match:ae,attrHandle:he?{}:{href:function(t){return t.getAttribute("href",2)},type:function(t){return t.getAttribute("type")}},find:{ID:y?function(t,e,n){if(typeof e.getElementById!==E&&!n){var r=e.getElementById(t);return r&&r.parentNode?[r]:[]}}:function(t,n,r){if(typeof n.getElementById!==E&&!r){var i=n.getElementById(t);return i?i.id===t||typeof i.getAttributeNode!==E&&i.getAttributeNode("id").value===t?[i]:e:[]}},TAG:ue?function(t,e){return typeof e.getElementsByTagName!==E?e.getElementsByTagName(t):void 0}:function(t,e){var n=e.getElementsByTagName(t);if("*"===t){for(var r,i=[],o=0;r=n[o];o++)1===r.nodeType&&i.push(r);return i}return n},NAME:pe&&function(t,e){return typeof e.getElementsByName!==E?e.getElementsByName(name):void 0},CLASS:fe&&function(t,e,n){return typeof e.getElementsByClassName===E||n?void 0:e.getElementsByClassName(t)}},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){return t[1]=t[1].replace(se,""),t[3]=(t[4]||t[5]||"").replace(se,""),"~="===t[2]&&(t[3]=" "+t[3]+" "),t.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1]?(t[2]||n.error(t[0]),t[3]=+(t[3]?t[4]+(t[5]||1):2*("even"===t[2]||"odd"===t[2])),t[4]=+(t[6]+t[7]||"odd"===t[2])):t[2]&&n.error(t[0]),t},PSEUDO:function(t){var e,n;return ae.CHILD.test(t[0])?null:(t[3]?t[2]=t[3]:(e=t[4])&&(ee.test(e)&&(n=a(e,!0))&&(n=e.indexOf(")",e.length-n)-e.length)&&(e=e.slice(0,n),t[0]=t[0].slice(0,n)),t[2]=e),t.slice(0,3))}},filter:{ID:y?function(t){return t=t.replace(se,""),function(e){return e.getAttribute("id")===t}}:function(t){return t=t.replace(se,""),function(e){var n=typeof e.getAttributeNode!==E&&e.getAttributeNode("id");return n&&n.value===t}},TAG:function(t){return"*"===t?function(){return!0}:(t=t.replace(se,"").toLowerCase(),function(e){return e.nodeName&&e.nodeName.toLowerCase()===t})},CLASS:function(t){var e=R[A][t+" "];return e||(e=RegExp("(^|"+$+")"+t+"("+$+"|$)"))&&R(t,function(t){return e.test(t.className||typeof t.getAttribute!==E&&t.getAttribute("class")||"")})},ATTR:function(t,e,r){return function(i){var o=n.attr(i,t);return null==o?"!="===e:e?(o+="","="===e?o===r:"!="===e?o!==r:"^="===e?r&&0===o.indexOf(r):"*="===e?r&&o.indexOf(r)>-1:"$="===e?r&&o.substr(o.length-r.length)===r:"~="===e?(" "+o+" ").indexOf(r)>-1:"|="===e?o===r||o.substr(0,r.length+1)===r+"-":!1):!0}},CHILD:function(t,e,n,r){return"nth"===t?function(t){var e,i,o=t.parentNode;if(1===n&&0===r)return!0;if(o)for(i=0,e=o.firstChild;e&&(1!==e.nodeType||(i++,t!==e));e=e.nextSibling);return i-=r,i===n||0===i%n&&i/n>=0}:function(e){var n=e;switch(t){case"only":case"first":for(;n=n.previousSibling;)if(1===n.nodeType)return!1;if("first"===t)return!0;n=e;case"last":for(;n=n.nextSibling;)if(1===n.nodeType)return!1;return!0}}},PSEUDO:function(t,e){var r,i=x.pseudos[t]||x.setFilters[t.toLowerCase()]||n.error("unsupported pseudo: "+t);return i[A]?i(e):i.length>1?(r=[t,t,"",e],x.setFilters.hasOwnProperty(t.toLowerCase())?O(function(t,n){for(var r,o=i(t,e),s=o.length;s--;)r=I.call(t,o[s]),t[r]=!(n[r]=o[s])}):function(t){return i(t,0,r)}):i}},pseudos:{not:O(function(t){var e=[],n=[],r=k(t.replace(Z,"$1"));return r[A]?O(function(t,e,n,i){for(var o,s=r(t,null,i,[]),a=t.length;a--;)(o=s[a])&&(t[a]=!(e[a]=o))}):function(t,i,o){return e[0]=t,r(e,null,o,n),!n.pop()}}),has:O(function(t){return function(e){return n(t,e).length>0}}),contains:O(function(t){return function(e){return(e.textContent||e.innerText||b(e)).indexOf(t)>-1}}),enabled:function(t){return t.disabled===!1},disabled:function(t){return t.disabled===!0},checked:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&!!t.checked||"option"===e&&!!t.selected},selected:function(t){return t.parentNode&&t.parentNode.selectedIndex,t.selected===!0},parent:function(t){return!x.pseudos.empty(t)},empty:function(t){var e;for(t=t.firstChild;t;){if(t.nodeName>"@"||3===(e=t.nodeType)||4===e)return!1;t=t.nextSibling}return!0},header:function(t){return ie.test(t.nodeName)},text:function(t){var e,n;return"input"===t.nodeName.toLowerCase()&&"text"===(e=t.type)&&(null==(n=t.getAttribute("type"))||n.toLowerCase()===e)},radio:r("radio"),checkbox:r("checkbox"),file:r("file"),password:r("password"),image:r("image"),submit:i("submit"),reset:i("reset"),button:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&"button"===t.type||"button"===e},input:function(t){return oe.test(t.nodeName)},focus:function(t){var e=t.ownerDocument;return t===e.activeElement&&(!e.hasFocus||e.hasFocus())&&!!(t.type||t.href||~t.tabIndex)},active:function(t){return t===t.ownerDocument.activeElement},first:o(function(){return[0]}),last:o(function(t,e){return[e-1]}),eq:o(function(t,e,n){return[0>n?n+e:n]}),even:o(function(t,e){for(var n=0;e>n;n+=2)t.push(n);return t}),odd:o(function(t,e){for(var n=1;e>n;n+=2)t.push(n);return t}),lt:o(function(t,e,n){for(var r=0>n?n+e:n;--r>=0;)t.push(r);return t}),gt:o(function(t,e,n){for(var r=0>n?n+e:n;e>++r;)t.push(r);return t})}},C=M.compareDocumentPosition?function(t,e){return t===e?(T=!0,0):(t.compareDocumentPosition&&e.compareDocumentPosition?4&t.compareDocumentPosition(e):t.compareDocumentPosition)?-1:1}:function(t,e){if(t===e)return T=!0,0;if(t.sourceIndex&&e.sourceIndex)return t.sourceIndex-e.sourceIndex;var n,r,i=[],o=[],a=t.parentNode,l=e.parentNode,u=a;if(a===l)return s(t,e);if(!a)return-1;if(!l)return 1;for(;u;)i.unshift(u),u=u.parentNode;for(u=l;u;)o.unshift(u),u=u.parentNode;n=i.length,r=o.length;for(var h=0;n>h&&r>h;h++)if(i[h]!==o[h])return s(i[h],o[h]);return h===n?s(t,o[h],-1):s(i[h],e,1)},[0,0].sort(C),N=!T,n.uniqueSort=function(t){var e,n=[],r=1,i=0;if(T=N,t.sort(C),T){for(;e=t[r];r++)e===t[r-1]&&(i=n.push(r));for(;i--;)t.splice(n[i],1)}return t},n.error=function(t){throw Error("Syntax error, unrecognized expression: "+t)},k=n.compile=function(t,e){var n,r=[],i=[],o=W[A][t+" "];if(!o){for(e||(e=a(t)),n=e.length;n--;)o=f(e[n]),o[A]?r.push(o):i.push(o);o=W(t,p(i,r))}return o},L.querySelectorAll&&function(){var t,e=g,r=/'|\\/g,i=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,o=[":focus"],s=[":active"],l=M.matchesSelector||M.mozMatchesSelector||M.webkitMatchesSelector||M.oMatchesSelector||M.msMatchesSelector;le(function(t){t.innerHTML="",t.querySelectorAll("[selected]").length||o.push("\\["+$+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),t.querySelectorAll(":checked").length||o.push(":checked")}),le(function(t){t.innerHTML="

",t.querySelectorAll("[test^='']").length&&o.push("[*^$]="+$+"*(?:\"\"|'')"),t.innerHTML="",t.querySelectorAll(":enabled").length||o.push(":enabled",":disabled")}),o=RegExp(o.join("|")),g=function(t,n,i,s,l){if(!s&&!l&&!o.test(t)){var u,h,c=!0,f=A,p=n,d=9===n.nodeType&&t;if(1===n.nodeType&&"object"!==n.nodeName.toLowerCase()){for(u=a(t),(c=n.getAttribute("id"))?f=c.replace(r,"\\$&"):n.setAttribute("id",f),f="[id='"+f+"'] ",h=u.length;h--;)u[h]=f+u[h].join("");p=re.test(t)&&n.parentNode||n,d=u.join(",")}if(d)try{return D.apply(i,P.call(p.querySelectorAll(d),0)),i}catch(g){}finally{c||n.removeAttribute("id")}}return e(t,n,i,s,l)},l&&(le(function(e){t=l.call(e,"div");try{l.call(e,"[test!='']:sizzle"),s.push("!=",U)}catch(n){}}),s=RegExp(s.join("|")),n.matchesSelector=function(e,r){if(r=r.replace(i,"='$1']"),!w(e)&&!s.test(r)&&!o.test(r))try{var a=l.call(e,r);if(a||t||e.document&&11!==e.document.nodeType)return a}catch(u){}return n(r,null,null,[e]).length>0})}(),x.pseudos.nth=x.pseudos.eq,x.filters=v.prototype=x.pseudos,x.setFilters=new v,n.attr=J.attr,J.find=n,J.expr=n.selectors,J.expr[":"]=J.expr.pseudos,J.unique=n.uniqueSort,J.text=n.getText,J.isXMLDoc=n.isXML,J.contains=n.contains}(t);var je=/Until$/,He=/^(?:parents|prev(?:Until|All))/,De=/^.[^:#\[\.,]*$/,Pe=J.expr.match.needsContext,Ie={children:!0,contents:!0,next:!0,prev:!0};J.fn.extend({find:function(t){var e,n,r,i,o,s,a=this;if("string"!=typeof t)return J(t).filter(function(){for(e=0,n=a.length;n>e;e++)if(J.contains(a[e],this))return!0});for(s=this.pushStack("","find",t),e=0,n=this.length;n>e;e++)if(r=s.length,J.find(t,this[e],s),e>0)for(i=r;s.length>i;i++)for(o=0;r>o;o++)if(s[o]===s[i]){s.splice(i--,1);break}return s},has:function(t){var e,n=J(t,this),r=n.length;return this.filter(function(){for(e=0;r>e;e++)if(J.contains(this,n[e]))return!0})},not:function(t){return this.pushStack(u(this,t,!1),"not",t)},filter:function(t){return this.pushStack(u(this,t,!0),"filter",t)},is:function(t){return!!t&&("string"==typeof t?Pe.test(t)?J(t,this.context).index(this[0])>=0:J.filter(t,this).length>0:this.filter(t).length>0)},closest:function(t,e){for(var n,r=0,i=this.length,o=[],s=Pe.test(t)||"string"!=typeof t?J(t,e||this.context):0;i>r;r++)for(n=this[r];n&&n.ownerDocument&&n!==e&&11!==n.nodeType;){if(s?s.index(n)>-1:J.find.matchesSelector(n,t)){o.push(n);break}n=n.parentNode}return o=o.length>1?J.unique(o):o,this.pushStack(o,"closest",t)},index:function(t){return t?"string"==typeof t?J.inArray(this[0],J(t)):J.inArray(t.jquery?t[0]:t,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(t,e){var n="string"==typeof t?J(t,e):J.makeArray(t&&t.nodeType?[t]:t),r=J.merge(this.get(),n);return this.pushStack(a(n[0])||a(r[0])?r:J.unique(r))},addBack:function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}}),J.fn.andSelf=J.fn.addBack,J.each({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return J.dir(t,"parentNode")},parentsUntil:function(t,e,n){return J.dir(t,"parentNode",n)},next:function(t){return l(t,"nextSibling")},prev:function(t){return l(t,"previousSibling")},nextAll:function(t){return J.dir(t,"nextSibling")},prevAll:function(t){return J.dir(t,"previousSibling")},nextUntil:function(t,e,n){return J.dir(t,"nextSibling",n)},prevUntil:function(t,e,n){return J.dir(t,"previousSibling",n)},siblings:function(t){return J.sibling((t.parentNode||{}).firstChild,t)},children:function(t){return J.sibling(t.firstChild)},contents:function(t){return J.nodeName(t,"iframe")?t.contentDocument||t.contentWindow.document:J.merge([],t.childNodes)}},function(t,e){J.fn[t]=function(n,r){var i=J.map(this,e,n);return je.test(t)||(r=n),r&&"string"==typeof r&&(i=J.filter(r,i)),i=this.length>1&&!Ie[t]?J.unique(i):i,this.length>1&&He.test(t)&&(i=i.reverse()),this.pushStack(i,t,V.call(arguments).join(","))}}),J.extend({filter:function(t,e,n){return n&&(t=":not("+t+")"),1===e.length?J.find.matchesSelector(e[0],t)?[e[0]]:[]:J.find.matches(t,e)},dir:function(t,n,r){for(var i=[],o=t[n];o&&9!==o.nodeType&&(r===e||1!==o.nodeType||!J(o).is(r));)1===o.nodeType&&i.push(o),o=o[n];return i},sibling:function(t,e){for(var n=[];t;t=t.nextSibling)1===t.nodeType&&t!==e&&n.push(t);return n}});var Oe="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",ze=/ jQuery\d+="(?:null|\d+)"/g,Re=/^\s+/,qe=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,We=/<([\w:]+)/,$e=/]","i"),Ue=/^(?:checkbox|radio)$/,Qe=/checked\s*(?:[^=]|=\s*.checked.)/i,Ze=/\/(java|ecma)script/i,Je=/^\s*\s*$/g,Ke={option:[1,""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]},tn=h(R),en=tn.appendChild(R.createElement("div")); +Ke.optgroup=Ke.option,Ke.tbody=Ke.tfoot=Ke.colgroup=Ke.caption=Ke.thead,Ke.th=Ke.td,J.support.htmlSerialize||(Ke._default=[1,"X
","
"]),J.fn.extend({text:function(t){return J.access(this,function(t){return t===e?J.text(this):this.empty().append((this[0]&&this[0].ownerDocument||R).createTextNode(t))},null,t,arguments.length)},wrapAll:function(t){if(J.isFunction(t))return this.each(function(e){J(this).wrapAll(t.call(this,e))});if(this[0]){var e=J(t,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&e.insertBefore(this[0]),e.map(function(){for(var t=this;t.firstChild&&1===t.firstChild.nodeType;)t=t.firstChild;return t}).append(this)}return this},wrapInner:function(t){return J.isFunction(t)?this.each(function(e){J(this).wrapInner(t.call(this,e))}):this.each(function(){var e=J(this),n=e.contents();n.length?n.wrapAll(t):e.append(t)})},wrap:function(t){var e=J.isFunction(t);return this.each(function(n){J(this).wrapAll(e?t.call(this,n):t)})},unwrap:function(){return this.parent().each(function(){J.nodeName(this,"body")||J(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(t){(1===this.nodeType||11===this.nodeType)&&this.appendChild(t)})},prepend:function(){return this.domManip(arguments,!0,function(t){(1===this.nodeType||11===this.nodeType)&&this.insertBefore(t,this.firstChild)})},before:function(){if(!a(this[0]))return this.domManip(arguments,!1,function(t){this.parentNode.insertBefore(t,this)});if(arguments.length){var t=J.clean(arguments);return this.pushStack(J.merge(t,this),"before",this.selector)}},after:function(){if(!a(this[0]))return this.domManip(arguments,!1,function(t){this.parentNode.insertBefore(t,this.nextSibling)});if(arguments.length){var t=J.clean(arguments);return this.pushStack(J.merge(this,t),"after",this.selector)}},remove:function(t,e){for(var n,r=0;null!=(n=this[r]);r++)(!t||J.filter(t,[n]).length)&&(!e&&1===n.nodeType&&(J.cleanData(n.getElementsByTagName("*")),J.cleanData([n])),n.parentNode&&n.parentNode.removeChild(n));return this},empty:function(){for(var t,e=0;null!=(t=this[e]);e++)for(1===t.nodeType&&J.cleanData(t.getElementsByTagName("*"));t.firstChild;)t.removeChild(t.firstChild);return this},clone:function(t,e){return t=null==t?!1:t,e=null==e?t:e,this.map(function(){return J.clone(this,t,e)})},html:function(t){return J.access(this,function(t){var n=this[0]||{},r=0,i=this.length;if(t===e)return 1===n.nodeType?n.innerHTML.replace(ze,""):e;if(!("string"!=typeof t||Ye.test(t)||!J.support.htmlSerialize&&Ge.test(t)||!J.support.leadingWhitespace&&Re.test(t)||Ke[(We.exec(t)||["",""])[1].toLowerCase()])){t=t.replace(qe,"<$1>");try{for(;i>r;r++)n=this[r]||{},1===n.nodeType&&(J.cleanData(n.getElementsByTagName("*")),n.innerHTML=t);n=0}catch(o){}}n&&this.empty().append(t)},null,t,arguments.length)},replaceWith:function(t){return a(this[0])?this.length?this.pushStack(J(J.isFunction(t)?t():t),"replaceWith",t):this:J.isFunction(t)?this.each(function(e){var n=J(this),r=n.html();n.replaceWith(t.call(this,e,r))}):("string"!=typeof t&&(t=J(t).detach()),this.each(function(){var e=this.nextSibling,n=this.parentNode;J(this).remove(),e?J(e).before(t):J(n).append(t)}))},detach:function(t){return this.remove(t,!0)},domManip:function(t,n,r){t=[].concat.apply([],t);var i,o,s,a,l=0,u=t[0],h=[],f=this.length;if(!J.support.checkClone&&f>1&&"string"==typeof u&&Qe.test(u))return this.each(function(){J(this).domManip(t,n,r)});if(J.isFunction(u))return this.each(function(i){var o=J(this);t[0]=u.call(this,i,n?o.html():e),o.domManip(t,n,r)});if(this[0]){if(i=J.buildFragment(t,this,h),s=i.fragment,o=s.firstChild,1===s.childNodes.length&&(s=o),o)for(n=n&&J.nodeName(o,"tr"),a=i.cacheable||f-1;f>l;l++)r.call(n&&J.nodeName(this[l],"table")?c(this[l],"tbody"):this[l],l===a?s:J.clone(s,!0,!0));s=o=null,h.length&&J.each(h,function(t,e){e.src?J.ajax?J.ajax({url:e.src,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0}):J.error("no ajax"):J.globalEval((e.text||e.textContent||e.innerHTML||"").replace(Je,"")),e.parentNode&&e.parentNode.removeChild(e)})}return this}}),J.buildFragment=function(t,n,r){var i,o,s,a=t[0];return n=n||R,n=!n.nodeType&&n[0]||n,n=n.ownerDocument||n,1===t.length&&"string"==typeof a&&512>a.length&&n===R&&"<"===a.charAt(0)&&!Ve.test(a)&&(J.support.checkClone||!Qe.test(a))&&(J.support.html5Clone||!Ge.test(a))&&(o=!0,i=J.fragments[a],s=i!==e),i||(i=n.createDocumentFragment(),J.clean(t,n,i,r),o&&(J.fragments[a]=s&&i)),{fragment:i,cacheable:o}},J.fragments={},J.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(t,e){J.fn[t]=function(n){var r,i=0,o=[],s=J(n),a=s.length,l=1===this.length&&this[0].parentNode;if((null==l||l&&11===l.nodeType&&1===l.childNodes.length)&&1===a)return s[e](this[0]),this;for(;a>i;i++)r=(i>0?this.clone(!0):this).get(),J(s[i])[e](r),o=o.concat(r);return this.pushStack(o,t,s.selector)}}),J.extend({clone:function(t,e,n){var r,i,o,s;if(J.support.html5Clone||J.isXMLDoc(t)||!Ge.test("<"+t.nodeName+">")?s=t.cloneNode(!0):(en.innerHTML=t.outerHTML,en.removeChild(s=en.firstChild)),!(J.support.noCloneEvent&&J.support.noCloneChecked||1!==t.nodeType&&11!==t.nodeType||J.isXMLDoc(t)))for(p(t,s),r=d(t),i=d(s),o=0;r[o];++o)i[o]&&p(r[o],i[o]);if(e&&(f(t,s),n))for(r=d(t),i=d(s),o=0;r[o];++o)f(r[o],i[o]);return r=i=null,s},clean:function(t,e,n,r){var i,o,s,a,l,u,c,f,p,d,v,m=e===R&&tn,y=[];for(e&&void 0!==e.createDocumentFragment||(e=R),i=0;null!=(s=t[i]);i++)if("number"==typeof s&&(s+=""),s){if("string"==typeof s)if(Xe.test(s)){for(m=m||h(e),c=e.createElement("div"),m.appendChild(c),s=s.replace(qe,"<$1>"),a=(We.exec(s)||["",""])[1].toLowerCase(),l=Ke[a]||Ke._default,u=l[0],c.innerHTML=l[1]+s+l[2];u--;)c=c.lastChild;if(!J.support.tbody)for(f=$e.test(s),p="table"!==a||f?""!==l[1]||f?[]:c.childNodes:c.firstChild&&c.firstChild.childNodes,o=p.length-1;o>=0;--o)J.nodeName(p[o],"tbody")&&!p[o].childNodes.length&&p[o].parentNode.removeChild(p[o]);!J.support.leadingWhitespace&&Re.test(s)&&c.insertBefore(e.createTextNode(Re.exec(s)[0]),c.firstChild),s=c.childNodes,c.parentNode.removeChild(c)}else s=e.createTextNode(s);s.nodeType?y.push(s):J.merge(y,s)}if(c&&(s=c=m=null),!J.support.appendChecked)for(i=0;null!=(s=y[i]);i++)J.nodeName(s,"input")?g(s):s.getElementsByTagName!==void 0&&J.grep(s.getElementsByTagName("input"),g);if(n)for(d=function(t){return!t.type||Ze.test(t.type)?r?r.push(t.parentNode?t.parentNode.removeChild(t):t):n.appendChild(t):void 0},i=0;null!=(s=y[i]);i++)J.nodeName(s,"script")&&d(s)||(n.appendChild(s),s.getElementsByTagName!==void 0&&(v=J.grep(J.merge([],s.getElementsByTagName("script")),d),y.splice.apply(y,[i+1,0].concat(v)),i+=v.length));return y},cleanData:function(t,e){for(var n,r,i,o,s=0,a=J.expando,l=J.cache,u=J.support.deleteExpando,h=J.event.special;null!=(i=t[s]);s++)if((e||J.acceptData(i))&&(r=i[a],n=r&&l[r])){if(n.events)for(o in n.events)h[o]?J.event.remove(i,o):J.removeEvent(i,o,n.handle);l[r]&&(delete l[r],u?delete i[a]:i.removeAttribute?i.removeAttribute(a):i[a]=null,J.deletedIds.push(r))}}}),function(){var t,e;J.uaMatch=function(t){t=t.toLowerCase();var e=/(chrome)[ \/]([\w.]+)/.exec(t)||/(webkit)[ \/]([\w.]+)/.exec(t)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(t)||/(msie) ([\w.]+)/.exec(t)||0>t.indexOf("compatible")&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(t)||[];return{browser:e[1]||"",version:e[2]||"0"}},t=J.uaMatch(W.userAgent),e={},t.browser&&(e[t.browser]=!0,e.version=t.version),e.chrome?e.webkit=!0:e.webkit&&(e.safari=!0),J.browser=e,J.sub=function(){function t(e,n){return new t.fn.init(e,n)}J.extend(!0,t,this),t.superclass=this,t.fn=t.prototype=this(),t.fn.constructor=t,t.sub=this.sub,t.fn.init=function(n,r){return r&&r instanceof J&&!(r instanceof t)&&(r=t(r)),J.fn.init.call(this,n,r,e)},t.fn.init.prototype=t.fn;var e=t(R);return t}}();var nn,rn,on,sn=/alpha\([^)]*\)/i,an=/opacity=([^)]*)/,ln=/^(top|right|bottom|left)$/,un=/^(none|table(?!-c[ea]).+)/,hn=/^margin/,cn=RegExp("^("+K+")(.*)$","i"),fn=RegExp("^("+K+")(?!px)[a-z%]+$","i"),pn=RegExp("^([-+])=("+K+")","i"),dn={BODY:"block"},gn={position:"absolute",visibility:"hidden",display:"block"},vn={letterSpacing:0,fontWeight:400},mn=["Top","Right","Bottom","Left"],yn=["Webkit","O","Moz","ms"],xn=J.fn.toggle;J.fn.extend({css:function(t,n){return J.access(this,function(t,n,r){return r!==e?J.style(t,n,r):J.css(t,n)},t,n,arguments.length>1)},show:function(){return y(this,!0)},hide:function(){return y(this)},toggle:function(t,e){var n="boolean"==typeof t;return J.isFunction(t)&&J.isFunction(e)?xn.apply(this,arguments):this.each(function(){(n?t:m(this))?J(this).show():J(this).hide()})}}),J.extend({cssHooks:{opacity:{get:function(t,e){if(e){var n=nn(t,"opacity");return""===n?"1":n}}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":J.support.cssFloat?"cssFloat":"styleFloat"},style:function(t,n,r,i){if(t&&3!==t.nodeType&&8!==t.nodeType&&t.style){var o,s,a,l=J.camelCase(n),u=t.style;if(n=J.cssProps[l]||(J.cssProps[l]=v(u,l)),a=J.cssHooks[n]||J.cssHooks[l],r===e)return a&&"get"in a&&(o=a.get(t,!1,i))!==e?o:u[n];if(s=typeof r,"string"===s&&(o=pn.exec(r))&&(r=(o[1]+1)*o[2]+parseFloat(J.css(t,n)),s="number"),!(null==r||"number"===s&&isNaN(r)||("number"===s&&!J.cssNumber[l]&&(r+="px"),a&&"set"in a&&(r=a.set(t,r,i))===e)))try{u[n]=r}catch(h){}}},css:function(t,n,r,i){var o,s,a,l=J.camelCase(n);return n=J.cssProps[l]||(J.cssProps[l]=v(t.style,l)),a=J.cssHooks[n]||J.cssHooks[l],a&&"get"in a&&(o=a.get(t,!0,i)),o===e&&(o=nn(t,n)),"normal"===o&&n in vn&&(o=vn[n]),r||i!==e?(s=parseFloat(o),r||J.isNumeric(s)?s||0:o):o},swap:function(t,e,n){var r,i,o={};for(i in e)o[i]=t.style[i],t.style[i]=e[i];r=n.call(t);for(i in e)t.style[i]=o[i];return r}}),t.getComputedStyle?nn=function(e,n){var r,i,o,s,a=t.getComputedStyle(e,null),l=e.style;return a&&(r=a.getPropertyValue(n)||a[n],""===r&&!J.contains(e.ownerDocument,e)&&(r=J.style(e,n)),fn.test(r)&&hn.test(n)&&(i=l.width,o=l.minWidth,s=l.maxWidth,l.minWidth=l.maxWidth=l.width=r,r=a.width,l.width=i,l.minWidth=o,l.maxWidth=s)),r}:R.documentElement.currentStyle&&(nn=function(t,e){var n,r,i=t.currentStyle&&t.currentStyle[e],o=t.style;return null==i&&o&&o[e]&&(i=o[e]),fn.test(i)&&!ln.test(e)&&(n=o.left,r=t.runtimeStyle&&t.runtimeStyle.left,r&&(t.runtimeStyle.left=t.currentStyle.left),o.left="fontSize"===e?"1em":i,i=o.pixelLeft+"px",o.left=n,r&&(t.runtimeStyle.left=r)),""===i?"auto":i}),J.each(["height","width"],function(t,e){J.cssHooks[e]={get:function(t,n,r){return n?0===t.offsetWidth&&un.test(nn(t,"display"))?J.swap(t,gn,function(){return w(t,e,r)}):w(t,e,r):void 0},set:function(t,n,r){return x(t,n,r?b(t,e,r,J.support.boxSizing&&"border-box"===J.css(t,"boxSizing")):0)}}}),J.support.opacity||(J.cssHooks.opacity={get:function(t,e){return an.test((e&&t.currentStyle?t.currentStyle.filter:t.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":e?"1":""},set:function(t,e){var n=t.style,r=t.currentStyle,i=J.isNumeric(e)?"alpha(opacity="+100*e+")":"",o=r&&r.filter||n.filter||"";n.zoom=1,e>=1&&""===J.trim(o.replace(sn,""))&&n.removeAttribute&&(n.removeAttribute("filter"),r&&!r.filter)||(n.filter=sn.test(o)?o.replace(sn,i):o+" "+i)}}),J(function(){J.support.reliableMarginRight||(J.cssHooks.marginRight={get:function(t,e){return J.swap(t,{display:"inline-block"},function(){return e?nn(t,"marginRight"):void 0})}}),!J.support.pixelPosition&&J.fn.position&&J.each(["top","left"],function(t,e){J.cssHooks[e]={get:function(t,n){if(n){var r=nn(t,e);return fn.test(r)?J(t).position()[e]+"px":r}}}})}),J.expr&&J.expr.filters&&(J.expr.filters.hidden=function(t){return 0===t.offsetWidth&&0===t.offsetHeight||!J.support.reliableHiddenOffsets&&"none"===(t.style&&t.style.display||nn(t,"display"))},J.expr.filters.visible=function(t){return!J.expr.filters.hidden(t)}),J.each({margin:"",padding:"",border:"Width"},function(t,e){J.cssHooks[t+e]={expand:function(n){var r,i="string"==typeof n?n.split(" "):[n],o={};for(r=0;4>r;r++)o[t+mn[r]+e]=i[r]||i[r-2]||i[0];return o}},hn.test(t)||(J.cssHooks[t+e].set=x)});var bn=/%20/g,wn=/\[\]$/,_n=/\r?\n/g,kn=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,Cn=/^(?:select|textarea)/i;J.fn.extend({serialize:function(){return J.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?J.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||Cn.test(this.nodeName)||kn.test(this.type))}).map(function(t,e){var n=J(this).val();return null==n?null:J.isArray(n)?J.map(n,function(t){return{name:e.name,value:t.replace(_n,"\r\n")}}):{name:e.name,value:n.replace(_n,"\r\n")}}).get()}}),J.param=function(t,n){var r,i=[],o=function(t,e){e=J.isFunction(e)?e():null==e?"":e,i[i.length]=encodeURIComponent(t)+"="+encodeURIComponent(e)};if(n===e&&(n=J.ajaxSettings&&J.ajaxSettings.traditional),J.isArray(t)||t.jquery&&!J.isPlainObject(t))J.each(t,function(){o(this.name,this.value)});else for(r in t)k(r,t[r],n,o);return i.join("&").replace(bn,"+")};var Tn,Sn,Nn=/#.*$/,En=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,An=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,Bn=/^(?:GET|HEAD)$/,Ln=/^\/\//,Mn=/\?/,Fn=/)<[^<]*)*<\/script>/gi,jn=/([?&])_=[^&]*/,Hn=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,Dn=J.fn.load,Pn={},In={},On=["*/"]+["*"];try{Sn=q.href}catch(zn){Sn=R.createElement("a"),Sn.href="",Sn=Sn.href}Tn=Hn.exec(Sn.toLowerCase())||[],J.fn.load=function(t,n,r){if("string"!=typeof t&&Dn)return Dn.apply(this,arguments);if(!this.length)return this;var i,o,s,a=this,l=t.indexOf(" ");return l>=0&&(i=t.slice(l,t.length),t=t.slice(0,l)),J.isFunction(n)?(r=n,n=e):n&&"object"==typeof n&&(o="POST"),J.ajax({url:t,type:o,dataType:"html",data:n,complete:function(t,e){r&&a.each(r,s||[t.responseText,e,t])}}).done(function(t){s=arguments,a.html(i?J("
").append(t.replace(Fn,"")).find(i):t)}),this},J.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(t,e){J.fn[e]=function(t){return this.on(e,t)}}),J.each(["get","post"],function(t,n){J[n]=function(t,r,i,o){return J.isFunction(r)&&(o=o||i,i=r,r=e),J.ajax({type:n,url:t,data:r,success:i,dataType:o})}}),J.extend({getScript:function(t,n){return J.get(t,e,n,"script")},getJSON:function(t,e,n){return J.get(t,e,n,"json")},ajaxSetup:function(t,e){return e?S(t,J.ajaxSettings):(e=t,t=J.ajaxSettings),S(t,e),t},ajaxSettings:{url:Sn,isLocal:An.test(Tn[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":On},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":t.String,"text html":!0,"text json":J.parseJSON,"text xml":J.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:C(Pn),ajaxTransport:C(In),ajax:function(t,n){function r(t,n,r,s){var u,c,y,x,w,k=n;2!==b&&(b=2,l&&clearTimeout(l),a=e,o=s||"",_.readyState=t>0?4:0,r&&(x=N(f,_,r)),t>=200&&300>t||304===t?(f.ifModified&&(w=_.getResponseHeader("Last-Modified"),w&&(J.lastModified[i]=w),w=_.getResponseHeader("Etag"),w&&(J.etag[i]=w)),304===t?(k="notmodified",u=!0):(u=E(f,x),k=u.state,c=u.data,y=u.error,u=!y)):(y=k,(!k||t)&&(k="error",0>t&&(t=0))),_.status=t,_.statusText=(n||k)+"",u?g.resolveWith(p,[c,k,_]):g.rejectWith(p,[_,k,y]),_.statusCode(m),m=e,h&&d.trigger("ajax"+(u?"Success":"Error"),[_,f,u?c:y]),v.fireWith(p,[_,k]),h&&(d.trigger("ajaxComplete",[_,f]),--J.active||J.event.trigger("ajaxStop")))}"object"==typeof t&&(n=t,t=e),n=n||{};var i,o,s,a,l,u,h,c,f=J.ajaxSetup({},n),p=f.context||f,d=p!==f&&(p.nodeType||p instanceof J)?J(p):J.event,g=J.Deferred(),v=J.Callbacks("once memory"),m=f.statusCode||{},y={},x={},b=0,w="canceled",_={readyState:0,setRequestHeader:function(t,e){if(!b){var n=t.toLowerCase();t=x[n]=x[n]||t,y[t]=e}return this},getAllResponseHeaders:function(){return 2===b?o:null},getResponseHeader:function(t){var n;if(2===b){if(!s)for(s={};n=En.exec(o);)s[n[1].toLowerCase()]=n[2];n=s[t.toLowerCase()]}return n===e?null:n},overrideMimeType:function(t){return b||(f.mimeType=t),this},abort:function(t){return t=t||w,a&&a.abort(t),r(0,t),this}};if(g.promise(_),_.success=_.done,_.error=_.fail,_.complete=v.add,_.statusCode=function(t){if(t){var e;if(2>b)for(e in t)m[e]=[m[e],t[e]];else e=t[_.status],_.always(e)}return this},f.url=((t||f.url)+"").replace(Nn,"").replace(Ln,Tn[1]+"//"),f.dataTypes=J.trim(f.dataType||"*").toLowerCase().split(ee),null==f.crossDomain&&(u=Hn.exec(f.url.toLowerCase()),f.crossDomain=!(!u||u[1]===Tn[1]&&u[2]===Tn[2]&&(u[3]||("http:"===u[1]?80:443))==(Tn[3]||("http:"===Tn[1]?80:443)))),f.data&&f.processData&&"string"!=typeof f.data&&(f.data=J.param(f.data,f.traditional)),T(Pn,f,n,_),2===b)return _;if(h=f.global,f.type=f.type.toUpperCase(),f.hasContent=!Bn.test(f.type),h&&0===J.active++&&J.event.trigger("ajaxStart"),!f.hasContent&&(f.data&&(f.url+=(Mn.test(f.url)?"&":"?")+f.data,delete f.data),i=f.url,f.cache===!1)){var k=J.now(),C=f.url.replace(jn,"$1_="+k);f.url=C+(C===f.url?(Mn.test(f.url)?"&":"?")+"_="+k:"")}(f.data&&f.hasContent&&f.contentType!==!1||n.contentType)&&_.setRequestHeader("Content-Type",f.contentType),f.ifModified&&(i=i||f.url,J.lastModified[i]&&_.setRequestHeader("If-Modified-Since",J.lastModified[i]),J.etag[i]&&_.setRequestHeader("If-None-Match",J.etag[i])),_.setRequestHeader("Accept",f.dataTypes[0]&&f.accepts[f.dataTypes[0]]?f.accepts[f.dataTypes[0]]+("*"!==f.dataTypes[0]?", "+On+"; q=0.01":""):f.accepts["*"]);for(c in f.headers)_.setRequestHeader(c,f.headers[c]);if(!f.beforeSend||f.beforeSend.call(p,_,f)!==!1&&2!==b){w="abort";for(c in{success:1,error:1,complete:1})_[c](f[c]);if(a=T(In,f,n,_)){_.readyState=1,h&&d.trigger("ajaxSend",[_,f]),f.async&&f.timeout>0&&(l=setTimeout(function(){_.abort("timeout")},f.timeout));try{b=1,a.send(y,r)}catch(S){if(!(2>b))throw S;r(-1,S)}}else r(-1,"No Transport");return _}return _.abort()},active:0,lastModified:{},etag:{}});var Rn=[],qn=/\?/,Wn=/(=)\?(?=&|$)|\?\?/,$n=J.now();J.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var t=Rn.pop()||J.expando+"_"+$n++;return this[t]=!0,t}}),J.ajaxPrefilter("json jsonp",function(n,r,i){var o,s,a,l=n.data,u=n.url,h=n.jsonp!==!1,c=h&&Wn.test(u),f=h&&!c&&"string"==typeof l&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&Wn.test(l);return"jsonp"===n.dataTypes[0]||c||f?(o=n.jsonpCallback=J.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,s=t[o],c?n.url=u.replace(Wn,"$1"+o):f?n.data=l.replace(Wn,"$1"+o):h&&(n.url+=(qn.test(u)?"&":"?")+n.jsonp+"="+o),n.converters["script json"]=function(){return a||J.error(o+" was not called"),a[0]},n.dataTypes[0]="json",t[o]=function(){a=arguments},i.always(function(){t[o]=s,n[o]&&(n.jsonpCallback=r.jsonpCallback,Rn.push(o)),a&&J.isFunction(s)&&s(a[0]),a=s=e}),"script"):void 0}),J.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(t){return J.globalEval(t),t}}}),J.ajaxPrefilter("script",function(t){t.cache===e&&(t.cache=!1),t.crossDomain&&(t.type="GET",t.global=!1)}),J.ajaxTransport("script",function(t){if(t.crossDomain){var n,r=R.head||R.getElementsByTagName("head")[0]||R.documentElement;return{send:function(i,o){n=R.createElement("script"),n.async="async",t.scriptCharset&&(n.charset=t.scriptCharset),n.src=t.url,n.onload=n.onreadystatechange=function(t,i){(i||!n.readyState||/loaded|complete/.test(n.readyState))&&(n.onload=n.onreadystatechange=null,r&&n.parentNode&&r.removeChild(n),n=e,i||o(200,"success"))},r.insertBefore(n,r.firstChild)},abort:function(){n&&n.onload(0,1)}}}});var Xn,Yn=t.ActiveXObject?function(){for(var t in Xn)Xn[t](0,1)}:!1,Vn=0;J.ajaxSettings.xhr=t.ActiveXObject?function(){return!this.isLocal&&A()||B()}:A,function(t){J.extend(J.support,{ajax:!!t,cors:!!t&&"withCredentials"in t})}(J.ajaxSettings.xhr()),J.support.ajax&&J.ajaxTransport(function(n){if(!n.crossDomain||J.support.cors){var r;return{send:function(i,o){var s,a,l=n.xhr();if(n.username?l.open(n.type,n.url,n.async,n.username,n.password):l.open(n.type,n.url,n.async),n.xhrFields)for(a in n.xhrFields)l[a]=n.xhrFields[a];n.mimeType&&l.overrideMimeType&&l.overrideMimeType(n.mimeType),!n.crossDomain&&!i["X-Requested-With"]&&(i["X-Requested-With"]="XMLHttpRequest");try{for(a in i)l.setRequestHeader(a,i[a])}catch(u){}l.send(n.hasContent&&n.data||null),r=function(t,i){var a,u,h,c,f;try{if(r&&(i||4===l.readyState))if(r=e,s&&(l.onreadystatechange=J.noop,Yn&&delete Xn[s]),i)4!==l.readyState&&l.abort();else{a=l.status,h=l.getAllResponseHeaders(),c={},f=l.responseXML,f&&f.documentElement&&(c.xml=f);try{c.text=l.responseText}catch(p){}try{u=l.statusText}catch(p){u=""}a||!n.isLocal||n.crossDomain?1223===a&&(a=204):a=c.text?200:404}}catch(d){i||o(-1,d)}c&&o(a,u,c,h)},n.async?4===l.readyState?setTimeout(r,0):(s=++Vn,Yn&&(Xn||(Xn={},J(t).unload(Yn)),Xn[s]=r),l.onreadystatechange=r):r()},abort:function(){r&&r(0,1)}}}});var Gn,Un,Qn=/^(?:toggle|show|hide)$/,Zn=RegExp("^(?:([-+])=|)("+K+")([a-z%]*)$","i"),Jn=/queueHooks$/,Kn=[H],tr={"*":[function(t,e){var n,r,i=this.createTween(t,e),o=Zn.exec(e),s=i.cur(),a=+s||0,l=1,u=20;if(o){if(n=+o[2],r=o[3]||(J.cssNumber[t]?"":"px"),"px"!==r&&a){a=J.css(i.elem,t,!0)||n||1;do l=l||".5",a/=l,J.style(i.elem,t,a+r);while(l!==(l=i.cur()/s)&&1!==l&&--u)}i.unit=r,i.start=a,i.end=o[1]?a+(o[1]+1)*n:n}return i}]};J.Animation=J.extend(F,{tweener:function(t,e){J.isFunction(t)?(e=t,t=["*"]):t=t.split(" ");for(var n,r=0,i=t.length;i>r;r++)n=t[r],tr[n]=tr[n]||[],tr[n].unshift(e)},prefilter:function(t,e){e?Kn.unshift(t):Kn.push(t)}}),J.Tween=D,D.prototype={constructor:D,init:function(t,e,n,r,i,o){this.elem=t,this.prop=n,this.easing=i||"swing",this.options=e,this.start=this.now=this.cur(),this.end=r,this.unit=o||(J.cssNumber[n]?"":"px")},cur:function(){var t=D.propHooks[this.prop];return t&&t.get?t.get(this):D.propHooks._default.get(this)},run:function(t){var e,n=D.propHooks[this.prop];return this.pos=e=this.options.duration?J.easing[this.easing](t,this.options.duration*t,0,1,this.options.duration):t,this.now=(this.end-this.start)*e+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):D.propHooks._default.set(this),this}},D.prototype.init.prototype=D.prototype,D.propHooks={_default:{get:function(t){var e;return null==t.elem[t.prop]||t.elem.style&&null!=t.elem.style[t.prop]?(e=J.css(t.elem,t.prop,!1,""),e&&"auto"!==e?e:0):t.elem[t.prop]},set:function(t){J.fx.step[t.prop]?J.fx.step[t.prop](t):t.elem.style&&(null!=t.elem.style[J.cssProps[t.prop]]||J.cssHooks[t.prop])?J.style(t.elem,t.prop,t.now+t.unit):t.elem[t.prop]=t.now}}},D.propHooks.scrollTop=D.propHooks.scrollLeft={set:function(t){t.elem.nodeType&&t.elem.parentNode&&(t.elem[t.prop]=t.now)}},J.each(["toggle","show","hide"],function(t,e){var n=J.fn[e];J.fn[e]=function(r,i,o){return null==r||"boolean"==typeof r||!t&&J.isFunction(r)&&J.isFunction(i)?n.apply(this,arguments):this.animate(P(e,!0),r,i,o)}}),J.fn.extend({fadeTo:function(t,e,n,r){return this.filter(m).css("opacity",0).show().end().animate({opacity:e},t,n,r)},animate:function(t,e,n,r){var i=J.isEmptyObject(t),o=J.speed(e,n,r),s=function(){var e=F(this,J.extend({},t),o);i&&e.stop(!0)};return i||o.queue===!1?this.each(s):this.queue(o.queue,s)},stop:function(t,n,r){var i=function(t){var e=t.stop;delete t.stop,e(r)};return"string"!=typeof t&&(r=n,n=t,t=e),n&&t!==!1&&this.queue(t||"fx",[]),this.each(function(){var e=!0,n=null!=t&&t+"queueHooks",o=J.timers,s=J._data(this);if(n)s[n]&&s[n].stop&&i(s[n]);else for(n in s)s[n]&&s[n].stop&&Jn.test(n)&&i(s[n]);for(n=o.length;n--;)o[n].elem===this&&(null==t||o[n].queue===t)&&(o[n].anim.stop(r),e=!1,o.splice(n,1));(e||!r)&&J.dequeue(this,t)})}}),J.each({slideDown:P("show"),slideUp:P("hide"),slideToggle:P("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(t,e){J.fn[t]=function(t,n,r){return this.animate(e,t,n,r)}}),J.speed=function(t,e,n){var r=t&&"object"==typeof t?J.extend({},t):{complete:n||!n&&e||J.isFunction(t)&&t,duration:t,easing:n&&e||e&&!J.isFunction(e)&&e};return r.duration=J.fx.off?0:"number"==typeof r.duration?r.duration:r.duration in J.fx.speeds?J.fx.speeds[r.duration]:J.fx.speeds._default,(null==r.queue||r.queue===!0)&&(r.queue="fx"),r.old=r.complete,r.complete=function(){J.isFunction(r.old)&&r.old.call(this),r.queue&&J.dequeue(this,r.queue)},r},J.easing={linear:function(t){return t},swing:function(t){return.5-Math.cos(t*Math.PI)/2}},J.timers=[],J.fx=D.prototype.init,J.fx.tick=function(){var t,n=J.timers,r=0;for(Gn=J.now();n.length>r;r++)t=n[r],!t()&&n[r]===t&&n.splice(r--,1);n.length||J.fx.stop(),Gn=e},J.fx.timer=function(t){t()&&J.timers.push(t)&&!Un&&(Un=setInterval(J.fx.tick,J.fx.interval))},J.fx.interval=13,J.fx.stop=function(){clearInterval(Un),Un=null},J.fx.speeds={slow:600,fast:200,_default:400},J.fx.step={},J.expr&&J.expr.filters&&(J.expr.filters.animated=function(t){return J.grep(J.timers,function(e){return t===e.elem}).length});var er=/^(?:body|html)$/i;J.fn.offset=function(t){if(arguments.length)return t===e?this:this.each(function(e){J.offset.setOffset(this,t,e)});var n,r,i,o,s,a,l,u={top:0,left:0},h=this[0],c=h&&h.ownerDocument;if(c)return(r=c.body)===h?J.offset.bodyOffset(h):(n=c.documentElement,J.contains(n,h)?(h.getBoundingClientRect!==void 0&&(u=h.getBoundingClientRect()),i=I(c),o=n.clientTop||r.clientTop||0,s=n.clientLeft||r.clientLeft||0,a=i.pageYOffset||n.scrollTop,l=i.pageXOffset||n.scrollLeft,{top:u.top+a-o,left:u.left+l-s}):u)},J.offset={bodyOffset:function(t){var e=t.offsetTop,n=t.offsetLeft;return J.support.doesNotIncludeMarginInBodyOffset&&(e+=parseFloat(J.css(t,"marginTop"))||0,n+=parseFloat(J.css(t,"marginLeft"))||0),{top:e,left:n}},setOffset:function(t,e,n){var r=J.css(t,"position");"static"===r&&(t.style.position="relative");var i,o,s=J(t),a=s.offset(),l=J.css(t,"top"),u=J.css(t,"left"),h=("absolute"===r||"fixed"===r)&&J.inArray("auto",[l,u])>-1,c={},f={};h?(f=s.position(),i=f.top,o=f.left):(i=parseFloat(l)||0,o=parseFloat(u)||0),J.isFunction(e)&&(e=e.call(t,n,a)),null!=e.top&&(c.top=e.top-a.top+i),null!=e.left&&(c.left=e.left-a.left+o),"using"in e?e.using.call(t,c):s.css(c)}},J.fn.extend({position:function(){if(this[0]){var t=this[0],e=this.offsetParent(),n=this.offset(),r=er.test(e[0].nodeName)?{top:0,left:0}:e.offset();return n.top-=parseFloat(J.css(t,"marginTop"))||0,n.left-=parseFloat(J.css(t,"marginLeft"))||0,r.top+=parseFloat(J.css(e[0],"borderTopWidth"))||0,r.left+=parseFloat(J.css(e[0],"borderLeftWidth"))||0,{top:n.top-r.top,left:n.left-r.left}}},offsetParent:function(){return this.map(function(){for(var t=this.offsetParent||R.body;t&&!er.test(t.nodeName)&&"static"===J.css(t,"position");)t=t.offsetParent;return t||R.body})}}),J.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,n){var r=/Y/.test(n);J.fn[t]=function(i){return J.access(this,function(t,i,o){var s=I(t);return o===e?s?n in s?s[n]:s.document.documentElement[i]:t[i]:(s?s.scrollTo(r?J(s).scrollLeft():o,r?o:J(s).scrollTop()):t[i]=o,void 0)},t,i,arguments.length,null)}}),J.each({Height:"height",Width:"width"},function(t,n){J.each({padding:"inner"+t,content:n,"":"outer"+t},function(r,i){J.fn[i]=function(i,o){var s=arguments.length&&(r||"boolean"!=typeof i),a=r||(i===!0||o===!0?"margin":"border");return J.access(this,function(n,r,i){var o;return J.isWindow(n)?n.document.documentElement["client"+t]:9===n.nodeType?(o=n.documentElement,Math.max(n.body["scroll"+t],o["scroll"+t],n.body["offset"+t],o["offset"+t],o["client"+t])):i===e?J.css(n,r,i,a):J.style(n,r,i,a)},n,s?i:e,s,null)}})}),t.jQuery=t.$=J,"function"==typeof define&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return J})})(window),function(t,e){function n(t){return t&&"object"==typeof t&&t.__wrapped__?t:this instanceof n?(this.__wrapped__=t,void 0):new n(t)}function r(t,e,n){e||(e=0);var r=t.length,i=r-e>=(n||re);if(i)for(var o={},n=e-1;r>++n;){var s=t[n]+"";(ke.call(o,s)?o[s]:o[s]=[]).push(t[n])}return function(n){if(i){var r=n+"";return ke.call(o,r)&&R(o[r],n)>-1}return R(t,n,e)>-1}}function i(t){return t.charCodeAt(0)}function o(t,e){var n=t.b,r=e.b,t=t.a,e=e.a;if(t!==e){if(t>e||t===void 0)return 1;if(e>t||e===void 0)return-1}return r>n?-1:1}function s(t,e,n){function r(){var a=arguments,l=o?this:e;return i||(t=e[s]),n.length&&(a=a.length?n.concat(p(a)):n),this instanceof r?(f.prototype=t.prototype,l=new f,f.prototype=null,a=t.apply(l,a),k(a)?a:l):t.apply(l,a)}var i=_(t),o=!n,s=e;return o&&(n=e),i||(e=t),r}function a(t,e,n){return t?"function"!=typeof t?function(e){return e[t]}:e!==void 0?n?function(n,r,i,o){return t.call(e,n,r,i,o)}:function(n,r,i){return t.call(e,n,r,i)}:t:Y}function l(){for(var t,e={b:"",c:"",e:Z,f:Ye,g:"",h:Ge,i:Ze,j:ye,k:"",l:!0},n=0;t=arguments[n];n++)for(var r in t)e[r]=t[r];if(t=e.a,e.d=/^[^,]+/.exec(t)[0],n=Function,r="var i,l="+e.d+",t="+e.d+";if(!"+e.d+")return t;"+e.k+";",e.b?(r+="var m=l.length;i=-1;if(typeof m=='number'){",e.i&&(r+="if(k(l)){l=l.split('')}"),r+="while(++ii;i++)r+="i='"+e.j[i]+"';if(","constructor"==e.j[i]&&(r+="!(f&&f.prototype===l)&&"),r+="h.call(l,i)){"+e.g+"}"}return(e.b||e.h)&&(r+="}"),r+=e.c+";return t",n("e,h,j,k,p,n,s","return function("+t+"){"+r+"}")(a,ke,g,T,nn,Le,Te)}function u(t){return"\\"+rn[t]}function h(t){return fn[t]}function c(t){return"function"!=typeof t.toString&&"string"==typeof(t+"")}function f(){}function p(t,e,n){e||(e=0),n===void 0&&(n=t?t.length:0);for(var r=-1,n=n-e||0,i=Array(0>n?0:n);n>++r;)i[r]=t[e+r];return i}function d(t){return pn[t]}function g(t){return Se.call(t)==He}function v(t){var e=!1;if(!t||"object"!=typeof t||g(t))return e;var n=t.constructor;return!_(n)&&(!Je||!c(t))||n instanceof n?J?(hn(t,function(t,n,r){return e=!ke.call(r,n),!1}),!1===e):(hn(t,function(t,n){e=n}),!1===e||ke.call(t,e)):e}function m(t){var e=[];return cn(t,function(t,n){e.push(n)}),e}function y(t,e,n,r,i){if(null==t)return t;if(n&&(e=!1),n=k(t)){var o=Se.call(t);if(!tn[o]||Je&&c(t))return t;var s=gn(t)}if(!n||!e)return n?s?p(t):un({},t):t;switch(n=en[o],o){case Pe:case Ie:return new n(+t);case Oe:case qe:return new n(t);case Re:return n(t.source,he.exec(t))}for(r||(r=[]),i||(i=[]),o=r.length;o--;)if(r[o]==t)return i[o];var a=s?n(t.length):{};return r.push(t),i.push(a),(s?M:cn)(t,function(t,n){a[n]=y(t,e,null,r,i)}),s&&(ke.call(t,"index")&&(a.index=t.index),ke.call(t,"input")&&(a.input=t.input)),a}function x(t){var e=[];return hn(t,function(t,n){_(t)&&e.push(n)}),e.sort()}function b(t){var e={};return cn(t,function(t,n){e[t]=n}),e}function w(t,e,n,r){if(t===e)return 0!==t||1/t==1/e;if(null==t||null==e)return t===e;var i=Se.call(t),o=Se.call(e);if(i==He&&(i=ze),o==He&&(o=ze),i!=o)return!1;switch(i){case Pe:case Ie:return+t==+e;case Oe:return t!=+t?e!=+e:0==t?1/t==1/e:t==+e;case Re:case qe:return t==e+""}if(o=i==De,!o){if(t.__wrapped__||e.__wrapped__)return w(t.__wrapped__||t,e.__wrapped__||e);if(i!=ze||Je&&(c(t)||c(e)))return!1;var i=!Ue&&g(t)?Object:t.constructor,s=!Ue&&g(e)?Object:e.constructor;if(!(i==s||_(i)&&i instanceof i&&_(s)&&s instanceof s))return!1}for(n||(n=[]),r||(r=[]),i=n.length;i--;)if(n[i]==t)return r[i]==e;var a=!0,l=0;if(n.push(t),r.push(e),o){if(l=t.length,a=l==e.length)for(;l--&&(a=w(t[l],e[l],n,r)););return a +}return hn(t,function(t,i,o){return ke.call(o,i)?(l++,a=ke.call(e,i)&&w(t,e[i],n,r)):void 0}),a&&hn(e,function(t,e,n){return ke.call(n,e)?a=--l>-1:void 0}),a}function _(t){return"function"==typeof t}function k(t){return t?nn[typeof t]:!1}function C(t){return"number"==typeof t||Se.call(t)==Oe}function T(t){return"string"==typeof t||Se.call(t)==qe}function S(t,e,n){var r=arguments,i=0,o=2,s=r[3],a=r[4];for(n!==ne&&(s=[],a=[],"number"!=typeof n&&(o=r.length));o>++i;)cn(r[i],function(e,n){var r,i,o;if(e&&((i=gn(e))||vn(e))){for(var l=s.length;l--&&!(r=s[l]==e););r?t[n]=a[l]:(s.push(e),a.push((o=t[n],o=i?gn(o)?o:[]:vn(o)?o:{})),t[n]=S(o,e,ne,s,a))}else null!=e&&(t[n]=e)});return t}function N(t){var e=[];return cn(t,function(t){e.push(t)}),e}function E(t,e,n){var r=-1,i=t?t.length:0,o=!1,n=(0>n?Me(0,i+n):n)||0;return"number"==typeof i?o=(T(t)?t.indexOf(e,n):R(t,e,n))>-1:ln(t,function(t){return++r>=n?!(o=t===e):void 0}),o}function A(t,e,n){var r=!0,e=a(e,n);if(gn(t))for(var n=-1,i=t.length;i>++n&&(r=!!e(t[n],n,t)););else ln(t,function(t,n,i){return r=!!e(t,n,i)});return r}function B(t,e,n){var r=[],e=a(e,n);if(gn(t))for(var n=-1,i=t.length;i>++n;){var o=t[n];e(o,n,t)&&r.push(o)}else ln(t,function(t,n,i){e(t,n,i)&&r.push(t)});return r}function L(t,e,n){var r,e=a(e,n);return M(t,function(t,n,i){return e(t,n,i)?(r=t,!1):void 0}),r}function M(t,e,n){if(e&&n===void 0&&gn(t))for(var n=-1,r=t.length;r>++n&&!1!==e(t[n],n,t););else ln(t,e,n);return t}function F(t,e,n){var r=-1,i=t?t.length:0,o=Array("number"==typeof i?i:0),e=a(e,n);if(gn(t))for(;i>++r;)o[r]=e(t[r],r,t);else ln(t,function(t,n,i){o[++r]=e(t,n,i)});return o}function j(t,e,n){var r=-1/0,o=-1,s=t?t.length:0,l=r;if(e||!gn(t))e=!e&&T(t)?i:a(e,n),ln(t,function(t,n,i){n=e(t,n,i),n>r&&(r=n,l=t)});else for(;s>++o;)t[o]>l&&(l=t[o]);return l}function H(t,e){return F(t,e+"")}function D(t,e,n,r){var i=3>arguments.length,e=a(e,r,ne);if(gn(t)){var o=-1,s=t.length;for(i&&(n=t[++o]);s>++o;)n=e(n,t[o],o,t)}else ln(t,function(t,r,o){n=i?(i=!1,t):e(n,t,r,o)});return n}function P(t,e,n,r){var i=t,o=t?t.length:0,s=3>arguments.length;if("number"!=typeof o)var l=mn(t),o=l.length;else Ze&&T(t)&&(i=t.split(""));return e=a(e,r,ne),M(t,function(t,r,a){r=l?l[--o]:--o,n=s?(s=!1,i[r]):e(n,i[r],r,a)}),n}function I(t,e,n){var r,e=a(e,n);if(gn(t))for(var n=-1,i=t.length;i>++n&&!(r=e(t[n],n,t)););else ln(t,function(t,n,i){return!(r=e(t,n,i))});return!!r}function O(t,e,n){if(t){var r=t.length;return null==e||n?t[0]:p(t,0,Fe(Me(0,e),r))}}function z(t,e){for(var n=-1,r=t?t.length:0,i=[];r>++n;){var o=t[n];gn(o)?Ce.apply(i,e?o:z(o)):i.push(o)}return i}function R(t,e,n){var r=-1,i=t?t.length:0;if("number"==typeof n)r=(0>n?Me(0,i+n):n||0)-1;else if(n)return r=W(t,e),t[r]===e?r:-1;for(;i>++r;)if(t[r]===e)return r;return-1}function q(t,e,n){return p(t,null==e||n?1:Me(0,e))}function W(t,e,n,r){for(var i=0,o=t?t.length:i,n=n?a(n,r):Y,e=n(e);o>i;)r=i+o>>>1,e>n(t[r])?i=r+1:o=r;return i}function $(t,e,n,r){var i=-1,o=t?t.length:0,s=[],l=s;"function"==typeof e&&(r=n,n=e,e=!1);var u=!e&&o>=75;if(u)var h={};for(n&&(l=[],n=a(n,r));o>++i;){var r=t[i],c=n?n(r,i,t):r;if(u)var f=c+"",f=ke.call(h,f)?!(l=h[f]):l=h[f]=[];(e?!i||l[l.length-1]!==c:f||0>R(l,c))&&((n||u)&&l.push(c),s.push(r))}return s}function X(t,e){return Xe||Ne&&arguments.length>2?Ne.call.apply(Ne,arguments):s(t,e,p(arguments,2))}function Y(t){return t}function V(t){M(x(t),function(e){var r=n[e]=t[e];n.prototype[e]=function(){var t=[this.__wrapped__];return Ce.apply(t,arguments),t=r.apply(n,t),new n(t)}})}function G(){return this.__wrapped__}var U="object"==typeof exports&&exports,Q="object"==typeof global&&global;Q.global===Q&&(t=Q);var Z,J,K=[],te=new function(){},ee=0,ne=te,re=30,ie=t._,oe=/[-?+=!~*%&^<>|{(\/]|\[\D|\b(?:delete|in|instanceof|new|typeof|void)\b/,se=/&(?:amp|lt|gt|quot|#x27);/g,ae=/\b__p\+='';/g,le=/\b(__p\+=)''\+/g,ue=/(__e\(.*?\)|\b__t\))\+'';/g,he=/\w*$/,ce=/(?:__e|__t=)\(\s*(?![\d\s"']|this\.)/g,fe=RegExp("^"+(te.valueOf+"").replace(/[.*+?^=!:${}()|[\]\/\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),pe=/\$\{((?:(?=\\?)\\?[\s\S])*?)}/g,de=/<%=([\s\S]+?)%>/g,ge=/($^)/,ve=/[&<>"']/g,me=/['\n\r\t\u2028\u2029\\]/g,ye="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),xe=Math.ceil,be=K.concat,we=Math.floor,_e=fe.test(_e=Object.getPrototypeOf)&&_e,ke=te.hasOwnProperty,Ce=K.push,Te=te.propertyIsEnumerable,Se=te.toString,Ne=fe.test(Ne=p.bind)&&Ne,Ee=fe.test(Ee=Array.isArray)&&Ee,Ae=t.isFinite,Be=t.isNaN,Le=fe.test(Le=Object.keys)&&Le,Me=Math.max,Fe=Math.min,je=Math.random,He="[object Arguments]",De="[object Array]",Pe="[object Boolean]",Ie="[object Date]",Oe="[object Number]",ze="[object Object]",Re="[object RegExp]",qe="[object String]",We=!!t.attachEvent,$e=Ne&&!/\n|true/.test(Ne+We),Xe=Ne&&!$e,Ye=Le&&(We||$e),Ve=(Ve={0:1,length:1},K.splice.call(Ve,0,1),Ve[0]),Ge=!0;(function(){function t(){this.x=1}var e=[];t.prototype={valueOf:1,y:1};for(var n in new t)e.push(n);for(n in arguments)Ge=!n;Z=!/valueOf/.test(e),J="x"!=e[0]})(1);var Ue=arguments.constructor==Object,Qe=!g(arguments),Ze="xx"!="x"[0]+Object("x")[0];try{var Je=Se.call(document)==ze}catch(Ke){}var tn={"[object Function]":!1};tn[He]=tn[De]=tn[Pe]=tn[Ie]=tn[Oe]=tn[ze]=tn[Re]=tn[qe]=!0;var en={};en[De]=Array,en[Pe]=Boolean,en[Ie]=Date,en[ze]=Object,en[Oe]=Number,en[Re]=RegExp,en[qe]=String;var nn={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},rn={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"};n.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:de,variable:""};var on={a:"o,v,g",k:"for(var a=1,b=typeof g=='number'?2:arguments.length;a":">",'"':""","'":"'"},pn=b(fn),dn=l(on,{g:"if(t[i]==null)"+on.g}),gn=Ee||function(t){return Ue&&t instanceof Array||Se.call(t)==De};_(/x/)&&(_=function(t){return t instanceof Function||"[object Function]"==Se.call(t)});var vn=_e?function(t){if(!t||"object"!=typeof t)return!1;var e=t.valueOf,n="function"==typeof e&&(n=_e(e))&&_e(n);return n?t==n||_e(t)==n&&!g(t):v(t)}:v,mn=Le?function(t){return"function"==typeof t&&Te.call(t,"prototype")?m(t):k(t)?Le(t):[]}:m;n.after=function(t,e){return 1>t?e():function(){return 1>--t?e.apply(this,arguments):void 0}},n.assign=un,n.bind=X,n.bindAll=function(t){for(var e=arguments,n=e.length>1?0:(e=x(t),-1),r=e.length;r>++n;){var i=e[n];t[i]=X(t[i],t)}return t},n.bindKey=function(t,e){return s(t,e,p(arguments,2))},n.compact=function(t){for(var e=-1,n=t?t.length:0,r=[];n>++e;){var i=t[e];i&&r.push(i)}return r},n.compose=function(){var t=arguments;return function(){for(var e=arguments,n=t.length;n--;)e=[t[n].apply(this,e)];return e[0]}},n.countBy=function(t,e,n){var r={},e=a(e,n);return M(t,function(t,n,i){n=e(t,n,i),ke.call(r,n)?r[n]++:r[n]=1}),r},n.debounce=function(t,e,n){function r(){a=null,n||(o=t.apply(s,i))}var i,o,s,a;return function(){var l=n&&!a;return i=arguments,s=this,clearTimeout(a),a=setTimeout(r,e),l&&(o=t.apply(s,i)),o}},n.defaults=dn,n.defer=function(t){var n=p(arguments,1);return setTimeout(function(){t.apply(e,n)},1)},n.delay=function(t,n){var r=p(arguments,2);return setTimeout(function(){t.apply(e,r)},n)},n.difference=function(t){for(var e=-1,n=t?t.length:0,i=be.apply(K,arguments),i=r(i,n),o=[];n>++e;){var s=t[e];i(s)||o.push(s)}return o},n.filter=B,n.flatten=z,n.forEach=M,n.forIn=hn,n.forOwn=cn,n.functions=x,n.groupBy=function(t,e,n){var r={},e=a(e,n);return M(t,function(t,n,i){n=e(t,n,i),(ke.call(r,n)?r[n]:r[n]=[]).push(t)}),r},n.initial=function(t,e,n){if(!t)return[];var r=t.length;return p(t,0,Fe(Me(0,r-(null==e||n?1:e||0)),r))},n.intersection=function(t){var e=arguments,n=e.length,i={0:{}},o=-1,s=t?t.length:0,a=s>=100,l=[],u=l;t:for(;s>++o;){var h=t[o];if(a)var c=h+"",c=ke.call(i[0],c)?!(u=i[0][c]):u=i[0][c]=[];if(c||0>R(u,h)){a&&u.push(h);for(var f=n;--f;)if(!(i[f]||(i[f]=r(e[f],0,100)))(h))continue t;l.push(h)}}return l},n.invert=b,n.invoke=function(t,e){var n=p(arguments,2),r="function"==typeof e,i=[];return M(t,function(t){i.push((r?e:t[e]).apply(t,n))}),i},n.keys=mn,n.map=F,n.max=j,n.memoize=function(t,e){var n={};return function(){var r=e?e.apply(this,arguments):arguments[0];return ke.call(n,r)?n[r]:n[r]=t.apply(this,arguments)}},n.merge=S,n.min=function(t,e,n){var r=1/0,o=-1,s=t?t.length:0,l=r;if(e||!gn(t))e=!e&&T(t)?i:a(e,n),ln(t,function(t,n,i){n=e(t,n,i),r>n&&(r=n,l=t)});else for(;s>++o;)l>t[o]&&(l=t[o]);return l},n.object=function(t,e){for(var n=-1,r=t?t.length:0,i={};r>++n;){var o=t[n];e?i[o]=e[n]:i[o[0]]=o[1]}return i},n.omit=function(t,e,n){var r="function"==typeof e,i={};if(r)e=a(e,n);else var o=be.apply(K,arguments);return hn(t,function(t,n,s){(r?!e(t,n,s):0>R(o,n,1))&&(i[n]=t)}),i},n.once=function(t){var e,n=!1;return function(){return n?e:(n=!0,e=t.apply(this,arguments),t=null,e)}},n.pairs=function(t){var e=[];return cn(t,function(t,n){e.push([n,t])}),e},n.partial=function(t){return s(t,p(arguments,1))},n.pick=function(t,e,n){var r={};if("function"!=typeof e)for(var i=0,o=be.apply(K,arguments),s=o.length;s>++i;){var l=o[i];l in t&&(r[l]=t[l])}else e=a(e,n),hn(t,function(t,n,i){e(t,n,i)&&(r[n]=t)});return r},n.pluck=H,n.range=function(t,e,n){t=+t||0,n=+n||1,null==e&&(e=t,t=0);for(var r=-1,e=Me(0,xe((e-t)/n)),i=Array(e);e>++r;)i[r]=t,t+=n;return i},n.reject=function(t,e,n){return e=a(e,n),B(t,function(t,n,r){return!e(t,n,r)})},n.rest=q,n.shuffle=function(t){var e=-1,n=Array(t?t.length:0);return M(t,function(t){var r=we(je()*(++e+1));n[e]=n[r],n[r]=t}),n},n.sortBy=function(t,e,n){var r=[],e=a(e,n);for(M(t,function(t,n,i){r.push({a:e(t,n,i),b:n,c:t})}),t=r.length,r.sort(o);t--;)r[t]=r[t].c;return r},n.tap=function(t,e){return e(t),t},n.throttle=function(t,e){function n(){a=new Date,s=null,i=t.apply(o,r)}var r,i,o,s,a=0;return function(){var l=new Date,u=e-(l-a);return r=arguments,o=this,0>=u?(clearTimeout(s),s=null,a=l,i=t.apply(o,r)):s||(s=setTimeout(n,u)),i}},n.times=function(t,e,n){for(var t=+t||0,r=-1,i=Array(t);t>++r;)i[r]=e.call(n,r);return i},n.toArray=function(t){return"number"==typeof(t?t.length:0)?Ze&&T(t)?t.split(""):p(t):N(t)},n.union=function(){return $(be.apply(K,arguments))},n.uniq=$,n.values=N,n.where=function(t,e){var n=mn(e);return B(t,function(t){for(var r=n.length;r--;){var i=t[n[r]]===e[n[r]];if(!i)break}return!!i})},n.without=function(t){for(var e=-1,n=t?t.length:0,i=r(arguments,1,20),o=[];n>++e;){var s=t[e];i(s)||o.push(s)}return o},n.wrap=function(t,e){return function(){var n=[t];return Ce.apply(n,arguments),e.apply(this,n)}},n.zip=function(t){for(var e=-1,n=t?j(H(arguments,"length")):0,r=Array(n);n>++e;)r[e]=H(arguments,e);return r},n.collect=F,n.drop=q,n.each=M,n.extend=un,n.methods=x,n.select=B,n.tail=q,n.unique=$,V(n),n.clone=y,n.cloneDeep=function(t){return y(t,!0)},n.contains=E,n.escape=function(t){return null==t?"":(t+"").replace(ve,h)},n.every=A,n.find=L,n.has=function(t,e){return t?ke.call(t,e):!1},n.identity=Y,n.indexOf=R,n.isArguments=g,n.isArray=gn,n.isBoolean=function(t){return!0===t||!1===t||Se.call(t)==Pe},n.isDate=function(t){return t instanceof Date||Se.call(t)==Ie},n.isElement=function(t){return t?1===t.nodeType:!1},n.isEmpty=function(t){var e=!0;if(!t)return e;var n=Se.call(t),r=t.length;return n==De||n==qe||n==He||Qe&&g(t)||n==ze&&"number"==typeof r&&_(t.splice)?!r:(cn(t,function(){return e=!1}),e)},n.isEqual=w,n.isFinite=function(t){return Ae(t)&&!Be(parseFloat(t))},n.isFunction=_,n.isNaN=function(t){return C(t)&&t!=+t},n.isNull=function(t){return null===t},n.isNumber=C,n.isObject=k,n.isPlainObject=vn,n.isRegExp=function(t){return t instanceof RegExp||Se.call(t)==Re},n.isString=T,n.isUndefined=function(t){return t===void 0},n.lastIndexOf=function(t,e,n){var r=t?t.length:0;for("number"==typeof n&&(r=(0>n?Me(0,r+n):Fe(n,r-1))+1);r--;)if(t[r]===e)return r;return-1},n.mixin=V,n.noConflict=function(){return t._=ie,this},n.random=function(t,e){return null==t&&null==e&&(e=1),t=+t||0,null==e&&(e=t,t=0),t+we(je()*((+e||0)-t+1))},n.reduce=D,n.reduceRight=P,n.result=function(t,e){var n=t?t[e]:null;return _(n)?t[e]():n},n.size=function(t){var e=t?t.length:0;return"number"==typeof e?e:mn(t).length},n.some=I,n.sortedIndex=W,n.template=function(t,e,r){t||(t=""),r||(r={});var i,o,s=n.templateSettings,a=0,l=r.interpolate||s.interpolate||ge,h="__p+='",c=r.variable||s.variable,f=c;t.replace(RegExp((r.escape||s.escape||ge).source+"|"+l.source+"|"+(l===de?pe:ge).source+"|"+(r.evaluate||s.evaluate||ge).source+"|$","g"),function(e,n,r,o,s,l){return r||(r=o),h+=t.slice(a,l).replace(me,u),n&&(h+="'+__e("+n+")+'"),s&&(h+="';"+s+";__p+='"),r&&(h+="'+((__t=("+r+"))==null?'':__t)+'"),i||(i=s||oe.test(n||r)),a=l+e.length,e}),h+="';\n",f||(c="obj",i?h="with("+c+"){"+h+"}":(r=RegExp("(\\(\\s*)"+c+"\\."+c+"\\b","g"),h=h.replace(ce,"$&"+c+".").replace(r,"$1__d"))),h=(i?h.replace(ae,""):h).replace(le,"$1").replace(ue,"$1;"),h="function("+c+"){"+(f?"":c+"||("+c+"={});")+"var __t,__p='',__e=_.escape"+(i?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":(f?"":",__d="+c+"."+c+"||"+c)+";")+h+"return __p}";try{o=Function("_","return "+h)(n)}catch(p){throw p.source=h,p}return e?o(e):(o.source=h,o)},n.unescape=function(t){return null==t?"":(t+"").replace(se,d)},n.uniqueId=function(t){return(null==t?"":t+"")+ ++ee},n.all=A,n.any=I,n.detect=L,n.foldl=D,n.foldr=P,n.include=E,n.inject=D,cn(n,function(t,e){n.prototype[e]||(n.prototype[e]=function(){var e=[this.__wrapped__];return Ce.apply(e,arguments),t.apply(n,e)})}),n.first=O,n.last=function(t,e,n){if(t){var r=t.length;return null==e||n?t[r-1]:p(t,Me(0,r-e))}},n.take=O,n.head=O,cn(n,function(t,e){n.prototype[e]||(n.prototype[e]=function(e,r){var i=t(this.__wrapped__,e,r);return null==e||r?i:new n(i)})}),n.VERSION="1.0.0-rc.3",n.prototype.toString=function(){return this.__wrapped__+""},n.prototype.value=G,n.prototype.valueOf=G,ln(["join","pop","shift"],function(t){var e=K[t];n.prototype[t]=function(){return e.apply(this.__wrapped__,arguments)}}),ln(["push","reverse","sort","unshift"],function(t){var e=K[t];n.prototype[t]=function(){return e.apply(this.__wrapped__,arguments),this}}),ln(["concat","slice","splice"],function(t){var e=K[t];n.prototype[t]=function(){var t=e.apply(this.__wrapped__,arguments);return new n(t)}}),Ve&&ln(["pop","shift","splice"],function(t){var e=K[t],r="splice"==t;n.prototype[t]=function(){var t=this.__wrapped__,i=e.apply(t,arguments);return 0===t.length&&delete t[0],r?new n(i):i}}),"function"==typeof define&&"object"==typeof define.amd&&define.amd?(t._=n,define(function(){return n})):U?"object"==typeof module&&module&&module.exports==U?(module.exports=n)._=n:U._=n:t._=n}(this),function(t){var e,n,r="0.3.4",i="hasOwnProperty",o=/[\.\/]/,s="*",a=function(){},l=function(t,e){return t-e},u={n:{}},h=function(t,r){var i,o=n,s=Array.prototype.slice.call(arguments,2),a=h.listeners(t),u=0,c=[],f={},p=[],d=e;e=t,n=0;for(var g=0,v=a.length;v>g;g++)"zIndex"in a[g]&&(c.push(a[g].zIndex),0>a[g].zIndex&&(f[a[g].zIndex]=a[g]));for(c.sort(l);0>c[u];)if(i=f[c[u++]],p.push(i.apply(r,s)),n)return n=o,p;for(g=0;v>g;g++)if(i=a[g],"zIndex"in i)if(i.zIndex==c[u]){if(p.push(i.apply(r,s)),n)break;do if(u++,i=f[c[u]],i&&p.push(i.apply(r,s)),n)break;while(i)}else f[i.zIndex]=i;else if(p.push(i.apply(r,s)),n)break;return n=o,e=d,p.length?p:null};h.listeners=function(t){var e,n,r,i,a,l,h,c,f=t.split(o),p=u,d=[p],g=[];for(i=0,a=f.length;a>i;i++){for(c=[],l=0,h=d.length;h>l;l++)for(p=d[l].n,n=[p[f[i]],p[s]],r=2;r--;)e=n[r],e&&(c.push(e),g=g.concat(e.f||[]));d=c}return g},h.on=function(t,e){for(var n=t.split(o),r=u,i=0,s=n.length;s>i;i++)r=r.n,!r[n[i]]&&(r[n[i]]={n:{}}),r=r[n[i]];for(r.f=r.f||[],i=0,s=r.f.length;s>i;i++)if(r.f[i]==e)return a;return r.f.push(e),function(t){+t==+t&&(e.zIndex=+t)}},h.stop=function(){n=1},h.nt=function(t){return t?RegExp("(?:\\.|\\/|^)"+t+"(?:\\.|\\/|$)").test(e):e},h.off=h.unbind=function(t,e){var n,r,a,l,h,c,f,p=t.split(o),d=[u];for(l=0,h=p.length;h>l;l++)for(c=0;d.length>c;c+=a.length-2){if(a=[c,1],n=d[c].n,p[l]!=s)n[p[l]]&&a.push(n[p[l]]);else for(r in n)n[i](r)&&a.push(n[r]);d.splice.apply(d,a)}for(l=0,h=d.length;h>l;l++)for(n=d[l];n.n;){if(e){if(n.f){for(c=0,f=n.f.length;f>c;c++)if(n.f[c]==e){n.f.splice(c,1);break}!n.f.length&&delete n.f}for(r in n.n)if(n.n[i](r)&&n.n[r].f){var g=n.n[r].f;for(c=0,f=g.length;f>c;c++)if(g[c]==e){g.splice(c,1);break}!g.length&&delete n.n[r].f}}else{delete n.f;for(r in n.n)n.n[i](r)&&n.n[r].f&&delete n.n[r].f}n=n.n}},h.once=function(t,e){var n=function(){var r=e.apply(this,arguments);return h.unbind(t,n),r};return h.on(t,n)},h.version=r,h.toString=function(){return"You are running Eve "+r},"undefined"!=typeof module&&module.exports?module.exports=h:"undefined"!=typeof define?define("eve",[],function(){return h}):t.eve=h}(this),function(){function t(t){for(var e=0;sn.length>e;e++)sn[e].el.paper==t&&sn.splice(e--,1)}function e(t,e,n,i,s,a){n=Z(n);var l,u,h,c,f,p,d=t.ms,g={},v={},y={};if(i)for(w=0,_=sn.length;_>w;w++){var x=sn[w];if(x.el.id==e.id&&x.anim==t){x.percent!=n?(sn.splice(w,1),h=1):u=x,e.attr(x.totalOrigin);break}}else i=+v;for(var w=0,_=t.percents.length;_>w;w++){if(t.percents[w]==n||t.percents[w]>i*t.top){n=t.percents[w],f=t.percents[w-1]||0,d=d/t.top*(n-f),c=t.percents[w+1],l=t.anim[n];break}i&&e.attr(t.anim[t.percents[w]])}if(l){if(u)u.initstatus=i,u.start=new Date-u.ms*i;else{for(var C in l)if(l[k](C)&&(ee[k](C)||e.paper.customAttributes[k](C)))switch(g[C]=e.attr(C),null==g[C]&&(g[C]=te[C]),v[C]=l[C],ee[C]){case W:y[C]=(v[C]-g[C])/d;break;case"colour":g[C]=m.getRGB(g[C]);var T=m.getRGB(v[C]);y[C]={r:(T.r-g[C].r)/d,g:(T.g-g[C].g)/d,b:(T.b-g[C].b)/d};break;case"path":var S=je(g[C],v[C]),N=S[1];for(g[C]=S[0],y[C]=[],w=0,_=g[C].length;_>w;w++){y[C][w]=[0];for(var A=1,B=g[C][w].length;B>A;A++)y[C][w][A]=(N[w][A]-g[C][w][A])/d}break;case"transform":var L=e._,j=Oe(L[C],v[C]);if(j)for(g[C]=j.from,v[C]=j.to,y[C]=[],y[C].real=!0,w=0,_=g[C].length;_>w;w++)for(y[C][w]=[g[C][w][0]],A=1,B=g[C][w].length;B>A;A++)y[C][w][A]=(v[C][w][A]-g[C][w][A])/d;else{var H=e.matrix||new o,D={_:{transform:L.transform},getBBox:function(){return e.getBBox(1)}};g[C]=[H.a,H.b,H.c,H.d,H.e,H.f],Pe(D,v[C]),v[C]=D._.transform,y[C]=[(D.matrix.a-H.a)/d,(D.matrix.b-H.b)/d,(D.matrix.c-H.c)/d,(D.matrix.d-H.d)/d,(D.matrix.e-H.e)/d,(D.matrix.f-H.f)/d]}break;case"csv":var P=M(l[C])[F](b),I=M(g[C])[F](b);if("clip-rect"==C)for(g[C]=I,y[C]=[],w=I.length;w--;)y[C][w]=(P[w]-g[C][w])/d;v[C]=P;break;default:for(P=[][E](l[C]),I=[][E](g[C]),y[C]=[],w=e.paper.customAttributes[C].length;w--;)y[C][w]=((P[w]||0)-(I[w]||0))/d}var O=l.easing,z=m.easing_formulas[O];if(!z)if(z=M(O).match(U),z&&5==z.length){var R=z;z=function(t){return r(t,+R[1],+R[2],+R[3],+R[4],d)}}else z=ce;if(p=l.start||t.start||+new Date,x={anim:t,percent:n,timestamp:p,start:p+(t.del||0),status:0,initstatus:i||0,stop:!1,ms:d,easing:z,from:g,diff:y,to:v,el:e,callback:l.callback,prev:f,next:c,repeat:a||t.times,origin:e.attr(),totalOrigin:s},sn.push(x),i&&!u&&!h&&(x.stop=!0,x.start=new Date-d*i,1==sn.length))return ln();h&&(x.start=new Date-x.ms*i),1==sn.length&&an(ln)}eve("raphael.anim.start."+e.id,e,t)}}function n(t,e){var n=[],r={};if(this.ms=e,this.times=1,t){for(var i in t)t[k](i)&&(r[Z(i)]=t[i],n.push(Z(i)));n.sort(ue)}this.anim=r,this.top=n[n.length-1],this.percents=n}function r(t,e,n,r,i,o){function s(t,e){var n,r,i,o,s,a;for(i=t,a=0;8>a;a++){if(o=l(i)-t,e>z(o))return i;if(s=(3*c*i+2*h)*i+u,1e-6>z(s))break;i-=o/s}if(n=0,r=1,i=t,n>i)return n;if(i>r)return r;for(;r>n;){if(o=l(i),e>z(o-t))return i;t>o?n=i:r=i,i=(r-n)/2+n}return i}function a(t,e){var n=s(t,e);return((d*n+p)*n+f)*n}function l(t){return((c*t+h)*t+u)*t}var u=3*e,h=3*(r-e)-u,c=1-u-h,f=3*n,p=3*(i-n)-f,d=1-f-p;return a(t,1/(200*o))}function i(){return this.x+L+this.y+L+this.width+" × "+this.height}function o(t,e,n,r,i,o){null!=t?(this.a=+t,this.b=+e,this.c=+n,this.d=+r,this.e=+i,this.f=+o):(this.a=1,this.b=0,this.c=0,this.d=1,this.e=0,this.f=0)}function s(t,e,n){t=m._path2curve(t),e=m._path2curve(e);for(var r,i,o,s,l,u,h,c,f,p,d=n?0:[],g=0,v=t.length;v>g;g++){var y=t[g];if("M"==y[0])r=l=y[1],i=u=y[2];else{"C"==y[0]?(f=[r,i].concat(y.slice(1)),r=f[6],i=f[7]):(f=[r,i,r,i,l,u,l,u],r=l,i=u);for(var x=0,b=e.length;b>x;x++){var w=e[x];if("M"==w[0])o=h=w[1],s=c=w[2];else{"C"==w[0]?(p=[o,s].concat(w.slice(1)),o=p[6],s=p[7]):(p=[o,s,o,s,h,c,h,c],o=h,s=c);var _=a(f,p,n);if(n)d+=_;else{for(var k=0,C=_.length;C>k;k++)_[k].segment1=g,_[k].segment2=x,_[k].bez1=f,_[k].bez2=p;d=d.concat(_)}}}}}return d}function a(t,e,n){var r=m.bezierBBox(t),i=m.bezierBBox(e);if(!m.isBBoxIntersect(r,i))return n?0:[];for(var o=h.apply(0,t),s=h.apply(0,e),a=~~(o/5),u=~~(s/5),c=[],f=[],p={},d=n?0:[],g=0;a+1>g;g++){var v=m.findDotsAtSegment.apply(m,t.concat(g/a));c.push({x:v.x,y:v.y,t:g/a})}for(g=0;u+1>g;g++)v=m.findDotsAtSegment.apply(m,e.concat(g/u)),f.push({x:v.x,y:v.y,t:g/u});for(g=0;a>g;g++)for(var y=0;u>y;y++){var x=c[g],b=c[g+1],w=f[y],_=f[y+1],k=.001>z(b.x-x.x)?"y":"x",C=.001>z(_.x-w.x)?"y":"x",T=l(x.x,x.y,b.x,b.y,w.x,w.y,_.x,_.y);if(T){if(p[T.x.toFixed(4)]==T.y.toFixed(4))continue;p[T.x.toFixed(4)]=T.y.toFixed(4);var S=x.t+z((T[k]-x[k])/(b[k]-x[k]))*(b.t-x.t),N=w.t+z((T[C]-w[C])/(_[C]-w[C]))*(_.t-w.t);S>=0&&1>=S&&N>=0&&1>=N&&(n?d++:d.push({x:T.x,y:T.y,t1:S,t2:N}))}}return d}function l(t,e,n,r,i,o,s,a){if(!(I(t,n)I(i,s)||I(e,r)I(o,a))){var l=(t*r-e*n)*(i-s)-(t-n)*(i*a-o*s),u=(t*r-e*n)*(o-a)-(e-r)*(i*a-o*s),h=(t-n)*(o-a)-(e-r)*(i-s);if(!h)return;var c=l/h,f=u/h,p=+c.toFixed(2),d=+f.toFixed(2);if(+O(t,n).toFixed(2)>p||p>+I(t,n).toFixed(2)||+O(i,s).toFixed(2)>p||p>+I(i,s).toFixed(2)||+O(e,r).toFixed(2)>d||d>+I(e,r).toFixed(2)||+O(o,a).toFixed(2)>d||d>+I(o,a).toFixed(2))return;return{x:c,y:f}}}function u(t,e,n,r,i,o,s,a,l){if(!(0>l||l>h(t,e,n,r,i,o,s,a))){var u,c=1,f=c/2,p=c-f,d=.01;for(u=h(t,e,n,r,i,o,s,a,p);z(u-l)>d;)f/=2,p+=(l>u?1:-1)*f,u=h(t,e,n,r,i,o,s,a,p);return p}}function h(t,e,n,r,i,o,s,a,l){null==l&&(l=1),l=l>1?1:0>l?0:l;for(var u=l/2,h=12,f=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],p=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],d=0,g=0;h>g;g++){var v=u*f[g]+u,m=c(v,t,n,i,s),y=c(v,e,r,o,a),x=m*m+y*y;d+=p[g]*P.sqrt(x)}return u*d}function c(t,e,n,r,i){var o=-3*e+9*n-9*r+3*i,s=t*o+6*e-12*n+6*r;return t*s-3*e+3*n}function f(t,e){for(var n=[],r=0,i=t.length;i-2*!e>r;r+=2){var o=[{x:+t[r-2],y:+t[r-1]},{x:+t[r],y:+t[r+1]},{x:+t[r+2],y:+t[r+3]},{x:+t[r+4],y:+t[r+5]}];e?r?i-4==r?o[3]={x:+t[0],y:+t[1]}:i-2==r&&(o[2]={x:+t[0],y:+t[1]},o[3]={x:+t[2],y:+t[3]}):o[0]={x:+t[i-2],y:+t[i-1]}:i-4==r?o[3]=o[2]:r||(o[0]={x:+t[r],y:+t[r+1]}),n.push(["C",(-o[0].x+6*o[1].x+o[2].x)/6,(-o[0].y+6*o[1].y+o[2].y)/6,(o[1].x+6*o[2].x-o[3].x)/6,(o[1].y+6*o[2].y-o[3].y)/6,o[2].x,o[2].y])}return n}function p(){return this.hex}function d(t,e,n){function r(){var i=Array.prototype.slice.call(arguments,0),o=i.join("␀"),s=r.cache=r.cache||{},a=r.count=r.count||[];return s[k](o)?(g(a,o),n?n(s[o]):s[o]):(a.length>=1e3&&delete s[a.shift()],a.push(o),s[o]=t[N](e,i),n?n(s[o]):s[o])}return r}function g(t,e){for(var n=0,r=t.length;r>n;n++)if(t[n]===e)return t.push(t.splice(n,1)[0])}function v(t){if(Object(t)!==t)return t;var e=new t.constructor;for(var n in t)t[k](n)&&(e[n]=v(t[n]));return e}function m(t){if(m.is(t,"function"))return y?t():eve.on("raphael.DOMload",t);if(m.is(t,X))return m._engine.create[N](m,t.splice(0,3+m.is(t[0],W))).add(t);var e=Array.prototype.slice.call(arguments,0);if(m.is(e[e.length-1],"function")){var n=e.pop();return y?n.call(m._engine.create[N](m,e)):eve.on("raphael.DOMload",function(){n.call(m._engine.create[N](m,e))})}return m._engine.create[N](m,arguments)}m.version="2.1.0",m.eve=eve;var y,x,b=/[, ]+/,w={circle:1,rect:1,path:1,ellipse:1,text:1,image:1},_=/\{(\d+)\}/g,k="hasOwnProperty",C={doc:document,win:window},T={was:Object.prototype[k].call(C.win,"Raphael"),is:C.win.Raphael},S=function(){this.ca=this.customAttributes={}},N="apply",E="concat",A="createTouch"in C.doc,B="",L=" ",M=String,F="split",j="click dblclick mousedown mousemove mouseout mouseover mouseup touchstart touchmove touchend touchcancel"[F](L),H={mousedown:"touchstart",mousemove:"touchmove",mouseup:"touchend"},D=M.prototype.toLowerCase,P=Math,I=P.max,O=P.min,z=P.abs,R=P.pow,q=P.PI,W="number",$="string",X="array",Y=Object.prototype.toString,V=(m._ISURL=/^url\(['"]?([^\)]+?)['"]?\)$/i,/^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+%?)?)\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?)%?\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?)%?\s*\))\s*$/i),G={NaN:1,Infinity:1,"-Infinity":1},U=/^(?:cubic-)?bezier\(([^,]+),([^,]+),([^,]+),([^\)]+)\)/,Q=P.round,Z=parseFloat,J=parseInt,K=M.prototype.toUpperCase,te=m._availableAttrs={"arrow-end":"none","arrow-start":"none",blur:0,"clip-rect":"0 0 1e9 1e9",cursor:"default",cx:0,cy:0,fill:"#fff","fill-opacity":1,font:'10px "Arial"',"font-family":'"Arial"',"font-size":"10","font-style":"normal","font-weight":400,gradient:0,height:0,href:"http://raphaeljs.com/","letter-spacing":0,opacity:1,path:"M0,0",r:0,rx:0,ry:0,src:"",stroke:"#000","stroke-dasharray":"","stroke-linecap":"butt","stroke-linejoin":"butt","stroke-miterlimit":0,"stroke-opacity":1,"stroke-width":1,target:"_blank","text-anchor":"middle",title:"Raphael",transform:"",width:0,x:0,y:0},ee=m._availableAnimAttrs={blur:W,"clip-rect":"csv",cx:W,cy:W,fill:"colour","fill-opacity":W,"font-size":W,height:W,opacity:W,path:"path",r:W,rx:W,ry:W,stroke:"colour","stroke-opacity":W,"stroke-width":W,transform:"transform",width:W,x:W,y:W},ne=/[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*/,re={hs:1,rg:1},ie=/,?([achlmqrstvxz]),?/gi,oe=/([achlmrqstvz])[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029,]*((-?\d*\.?\d*(?:e[\-+]?\d+)?[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,?[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*)+)/gi,se=/([rstm])[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029,]*((-?\d*\.?\d*(?:e[\-+]?\d+)?[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,?[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*)+)/gi,ae=/(-?\d*\.?\d*(?:e[\-+]?\d+)?)[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,?[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*/gi,le=(m._radial_gradient=/^r(?:\(([^,]+?)[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*([^\)]+?)\))?/,{}),ue=function(t,e){return Z(t)-Z(e)},he=function(){},ce=function(t){return t},fe=m._rectPath=function(t,e,n,r,i){return i?[["M",t+i,e],["l",n-2*i,0],["a",i,i,0,0,1,i,i],["l",0,r-2*i],["a",i,i,0,0,1,-i,i],["l",2*i-n,0],["a",i,i,0,0,1,-i,-i],["l",0,2*i-r],["a",i,i,0,0,1,i,-i],["z"]]:[["M",t,e],["l",n,0],["l",0,r],["l",-n,0],["z"]]},pe=function(t,e,n,r){return null==r&&(r=n),[["M",t,e],["m",0,-r],["a",n,r,0,1,1,0,2*r],["a",n,r,0,1,1,0,-2*r],["z"]]},de=m._getPath={path:function(t){return t.attr("path")},circle:function(t){var e=t.attrs;return pe(e.cx,e.cy,e.r)},ellipse:function(t){var e=t.attrs;return pe(e.cx,e.cy,e.rx,e.ry)},rect:function(t){var e=t.attrs;return fe(e.x,e.y,e.width,e.height,e.r)},image:function(t){var e=t.attrs;return fe(e.x,e.y,e.width,e.height)},text:function(t){var e=t._getBBox();return fe(e.x,e.y,e.width,e.height)}},ge=m.mapPath=function(t,e){if(!e)return t;var n,r,i,o,s,a,l;for(t=je(t),i=0,s=t.length;s>i;i++)for(l=t[i],o=1,a=l.length;a>o;o+=2)n=e.x(l[o],l[o+1]),r=e.y(l[o],l[o+1]),l[o]=n,l[o+1]=r;return t};if(m._g=C,m.type=C.win.SVGAngle||C.doc.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")?"SVG":"VML","VML"==m.type){var ve,me=C.doc.createElement("div");if(me.innerHTML='',ve=me.firstChild,ve.style.behavior="url(#default#VML)",!ve||"object"!=typeof ve.adj)return m.type=B;me=null}m.svg=!(m.vml="VML"==m.type),m._Paper=S,m.fn=x=S.prototype=m.prototype,m._id=0,m._oid=0,m.is=function(t,e){return e=D.call(e),"finite"==e?!G[k](+t):"array"==e?t instanceof Array:"null"==e&&null===t||e==typeof t&&null!==t||"object"==e&&t===Object(t)||"array"==e&&Array.isArray&&Array.isArray(t)||Y.call(t).slice(8,-1).toLowerCase()==e},m.angle=function(t,e,n,r,i,o){if(null==i){var s=t-n,a=e-r;return s||a?(180+180*P.atan2(-a,-s)/q+360)%360:0}return m.angle(t,e,i,o)-m.angle(n,r,i,o)},m.rad=function(t){return t%360*q/180},m.deg=function(t){return 180*t/q%360},m.snapTo=function(t,e,n){if(n=m.is(n,"finite")?n:10,m.is(t,X)){for(var r=t.length;r--;)if(n>=z(t[r]-e))return t[r]}else{t=+t;var i=e%t;if(n>i)return e-i;if(i>t-n)return e-i+t}return e},m.createUUID=function(t,e){return function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(t,e).toUpperCase()}}(/[xy]/g,function(t){var e=0|16*P.random(),n="x"==t?e:8|3&e;return n.toString(16)}),m.setWindow=function(t){eve("raphael.setWindow",m,C.win,t),C.win=t,C.doc=C.win.document,m._engine.initWin&&m._engine.initWin(C.win)};var ye=function(t){if(m.vml){var e,n=/^\s+|\s+$/g;try{var r=new ActiveXObject("htmlfile");r.write(""),r.close(),e=r.body}catch(i){e=createPopup().document.body}var o=e.createTextRange();ye=d(function(t){try{e.style.color=M(t).replace(n,B);var r=o.queryCommandValue("ForeColor");return r=(255&r)<<16|65280&r|(16711680&r)>>>16,"#"+("000000"+r.toString(16)).slice(-6)}catch(i){return"none"}})}else{var s=C.doc.createElement("i");s.title="Raphaël Colour Picker",s.style.display="none",C.doc.body.appendChild(s),ye=d(function(t){return s.style.color=t,C.doc.defaultView.getComputedStyle(s,B).getPropertyValue("color")})}return ye(t)},xe=function(){return"hsb("+[this.h,this.s,this.b]+")"},be=function(){return"hsl("+[this.h,this.s,this.l]+")"},we=function(){return this.hex},_e=function(t,e,n){if(null==e&&m.is(t,"object")&&"r"in t&&"g"in t&&"b"in t&&(n=t.b,e=t.g,t=t.r),null==e&&m.is(t,$)){var r=m.getRGB(t);t=r.r,e=r.g,n=r.b}return(t>1||e>1||n>1)&&(t/=255,e/=255,n/=255),[t,e,n]},ke=function(t,e,n,r){t*=255,e*=255,n*=255;var i={r:t,g:e,b:n,hex:m.rgb(t,e,n),toString:we};return m.is(r,"finite")&&(i.opacity=r),i};m.color=function(t){var e;return m.is(t,"object")&&"h"in t&&"s"in t&&"b"in t?(e=m.hsb2rgb(t),t.r=e.r,t.g=e.g,t.b=e.b,t.hex=e.hex):m.is(t,"object")&&"h"in t&&"s"in t&&"l"in t?(e=m.hsl2rgb(t),t.r=e.r,t.g=e.g,t.b=e.b,t.hex=e.hex):(m.is(t,"string")&&(t=m.getRGB(t)),m.is(t,"object")&&"r"in t&&"g"in t&&"b"in t?(e=m.rgb2hsl(t),t.h=e.h,t.s=e.s,t.l=e.l,e=m.rgb2hsb(t),t.v=e.b):(t={hex:"none"},t.r=t.g=t.b=t.h=t.s=t.v=t.l=-1)),t.toString=we,t},m.hsb2rgb=function(t,e,n,r){this.is(t,"object")&&"h"in t&&"s"in t&&"b"in t&&(n=t.b,e=t.s,t=t.h,r=t.o),t*=360; +var i,o,s,a,l;return t=t%360/60,l=n*e,a=l*(1-z(t%2-1)),i=o=s=n-l,t=~~t,i+=[l,a,0,0,a,l][t],o+=[a,l,l,a,0,0][t],s+=[0,0,a,l,l,a][t],ke(i,o,s,r)},m.hsl2rgb=function(t,e,n,r){this.is(t,"object")&&"h"in t&&"s"in t&&"l"in t&&(n=t.l,e=t.s,t=t.h),(t>1||e>1||n>1)&&(t/=360,e/=100,n/=100),t*=360;var i,o,s,a,l;return t=t%360/60,l=2*e*(.5>n?n:1-n),a=l*(1-z(t%2-1)),i=o=s=n-l/2,t=~~t,i+=[l,a,0,0,a,l][t],o+=[a,l,l,a,0,0][t],s+=[0,0,a,l,l,a][t],ke(i,o,s,r)},m.rgb2hsb=function(t,e,n){n=_e(t,e,n),t=n[0],e=n[1],n=n[2];var r,i,o,s;return o=I(t,e,n),s=o-O(t,e,n),r=0==s?null:o==t?(e-n)/s:o==e?(n-t)/s+2:(t-e)/s+4,r=60*((r+360)%6)/360,i=0==s?0:s/o,{h:r,s:i,b:o,toString:xe}},m.rgb2hsl=function(t,e,n){n=_e(t,e,n),t=n[0],e=n[1],n=n[2];var r,i,o,s,a,l;return s=I(t,e,n),a=O(t,e,n),l=s-a,r=0==l?null:s==t?(e-n)/l:s==e?(n-t)/l+2:(t-e)/l+4,r=60*((r+360)%6)/360,o=(s+a)/2,i=0==l?0:.5>o?l/(2*o):l/(2-2*o),{h:r,s:i,l:o,toString:be}},m._path2string=function(){return this.join(",").replace(ie,"$1")},m._preload=function(t,e){var n=C.doc.createElement("img");n.style.cssText="position:absolute;left:-9999em;top:-9999em",n.onload=function(){e.call(this),this.onload=null,C.doc.body.removeChild(this)},n.onerror=function(){C.doc.body.removeChild(this)},C.doc.body.appendChild(n),n.src=t},m.getRGB=d(function(t){if(!t||(t=M(t)).indexOf("-")+1)return{r:-1,g:-1,b:-1,hex:"none",error:1,toString:p};if("none"==t)return{r:-1,g:-1,b:-1,hex:"none",toString:p};!re[k](t.toLowerCase().substring(0,2))&&"#"!=t.charAt()&&(t=ye(t));var e,n,r,i,o,s,a=t.match(V);return a?(a[2]&&(r=J(a[2].substring(5),16),n=J(a[2].substring(3,5),16),e=J(a[2].substring(1,3),16)),a[3]&&(r=J((o=a[3].charAt(3))+o,16),n=J((o=a[3].charAt(2))+o,16),e=J((o=a[3].charAt(1))+o,16)),a[4]&&(s=a[4][F](ne),e=Z(s[0]),"%"==s[0].slice(-1)&&(e*=2.55),n=Z(s[1]),"%"==s[1].slice(-1)&&(n*=2.55),r=Z(s[2]),"%"==s[2].slice(-1)&&(r*=2.55),"rgba"==a[1].toLowerCase().slice(0,4)&&(i=Z(s[3])),s[3]&&"%"==s[3].slice(-1)&&(i/=100)),a[5]?(s=a[5][F](ne),e=Z(s[0]),"%"==s[0].slice(-1)&&(e*=2.55),n=Z(s[1]),"%"==s[1].slice(-1)&&(n*=2.55),r=Z(s[2]),"%"==s[2].slice(-1)&&(r*=2.55),("deg"==s[0].slice(-3)||"°"==s[0].slice(-1))&&(e/=360),"hsba"==a[1].toLowerCase().slice(0,4)&&(i=Z(s[3])),s[3]&&"%"==s[3].slice(-1)&&(i/=100),m.hsb2rgb(e,n,r,i)):a[6]?(s=a[6][F](ne),e=Z(s[0]),"%"==s[0].slice(-1)&&(e*=2.55),n=Z(s[1]),"%"==s[1].slice(-1)&&(n*=2.55),r=Z(s[2]),"%"==s[2].slice(-1)&&(r*=2.55),("deg"==s[0].slice(-3)||"°"==s[0].slice(-1))&&(e/=360),"hsla"==a[1].toLowerCase().slice(0,4)&&(i=Z(s[3])),s[3]&&"%"==s[3].slice(-1)&&(i/=100),m.hsl2rgb(e,n,r,i)):(a={r:e,g:n,b:r,toString:p},a.hex="#"+(16777216|r|n<<8|e<<16).toString(16).slice(1),m.is(i,"finite")&&(a.opacity=i),a)):{r:-1,g:-1,b:-1,hex:"none",error:1,toString:p}},m),m.hsb=d(function(t,e,n){return m.hsb2rgb(t,e,n).hex}),m.hsl=d(function(t,e,n){return m.hsl2rgb(t,e,n).hex}),m.rgb=d(function(t,e,n){return"#"+(16777216|n|e<<8|t<<16).toString(16).slice(1)}),m.getColor=function(t){var e=this.getColor.start=this.getColor.start||{h:0,s:1,b:t||.75},n=this.hsb2rgb(e.h,e.s,e.b);return e.h+=.075,e.h>1&&(e.h=0,e.s-=.2,0>=e.s&&(this.getColor.start={h:0,s:1,b:e.b})),n.hex},m.getColor.reset=function(){delete this.start},m.parsePathString=function(t){if(!t)return null;var e=Ce(t);if(e.arr)return Se(e.arr);var n={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0},r=[];return m.is(t,X)&&m.is(t[0],X)&&(r=Se(t)),r.length||M(t).replace(oe,function(t,e,i){var o=[],s=e.toLowerCase();if(i.replace(ae,function(t,e){e&&o.push(+e)}),"m"==s&&o.length>2&&(r.push([e][E](o.splice(0,2))),s="l",e="m"==e?"l":"L"),"r"==s)r.push([e][E](o));else for(;o.length>=n[s]&&(r.push([e][E](o.splice(0,n[s]))),n[s]););}),r.toString=m._path2string,e.arr=Se(r),r},m.parseTransformString=d(function(t){if(!t)return null;var e=[];return m.is(t,X)&&m.is(t[0],X)&&(e=Se(t)),e.length||M(t).replace(se,function(t,n,r){var i=[];D.call(n),r.replace(ae,function(t,e){e&&i.push(+e)}),e.push([n][E](i))}),e.toString=m._path2string,e});var Ce=function(t){var e=Ce.ps=Ce.ps||{};return e[t]?e[t].sleep=100:e[t]={sleep:100},setTimeout(function(){for(var n in e)e[k](n)&&n!=t&&(e[n].sleep--,!e[n].sleep&&delete e[n])}),e[t]};m.findDotsAtSegment=function(t,e,n,r,i,o,s,a,l){var u=1-l,h=R(u,3),c=R(u,2),f=l*l,p=f*l,d=h*t+3*c*l*n+3*u*l*l*i+p*s,g=h*e+3*c*l*r+3*u*l*l*o+p*a,v=t+2*l*(n-t)+f*(i-2*n+t),m=e+2*l*(r-e)+f*(o-2*r+e),y=n+2*l*(i-n)+f*(s-2*i+n),x=r+2*l*(o-r)+f*(a-2*o+r),b=u*t+l*n,w=u*e+l*r,_=u*i+l*s,k=u*o+l*a,C=90-180*P.atan2(v-y,m-x)/q;return(v>y||x>m)&&(C+=180),{x:d,y:g,m:{x:v,y:m},n:{x:y,y:x},start:{x:b,y:w},end:{x:_,y:k},alpha:C}},m.bezierBBox=function(t,e,n,r,i,o,s,a){m.is(t,"array")||(t=[t,e,n,r,i,o,s,a]);var l=Fe.apply(null,t);return{x:l.min.x,y:l.min.y,x2:l.max.x,y2:l.max.y,width:l.max.x-l.min.x,height:l.max.y-l.min.y}},m.isPointInsideBBox=function(t,e,n){return e>=t.x&&t.x2>=e&&n>=t.y&&t.y2>=n},m.isBBoxIntersect=function(t,e){var n=m.isPointInsideBBox;return n(e,t.x,t.y)||n(e,t.x2,t.y)||n(e,t.x,t.y2)||n(e,t.x2,t.y2)||n(t,e.x,e.y)||n(t,e.x2,e.y)||n(t,e.x,e.y2)||n(t,e.x2,e.y2)||(t.xe.x||e.xt.x)&&(t.ye.y||e.yt.y)},m.pathIntersection=function(t,e){return s(t,e)},m.pathIntersectionNumber=function(t,e){return s(t,e,1)},m.isPointInsidePath=function(t,e,n){var r=m.pathBBox(t);return m.isPointInsideBBox(r,e,n)&&1==s(t,[["M",e,n],["H",r.x2+10]],1)%2},m._removedFactory=function(t){return function(){eve("raphael.log",null,"Raphaël: you are calling to method “"+t+"” of removed object",t)}};var Te=m.pathBBox=function(t){var e=Ce(t);if(e.bbox)return e.bbox;if(!t)return{x:0,y:0,width:0,height:0,x2:0,y2:0};t=je(t);for(var n,r=0,i=0,o=[],s=[],a=0,l=t.length;l>a;a++)if(n=t[a],"M"==n[0])r=n[1],i=n[2],o.push(r),s.push(i);else{var u=Fe(r,i,n[1],n[2],n[3],n[4],n[5],n[6]);o=o[E](u.min.x,u.max.x),s=s[E](u.min.y,u.max.y),r=n[5],i=n[6]}var h=O[N](0,o),c=O[N](0,s),f=I[N](0,o),p=I[N](0,s),d={x:h,y:c,x2:f,y2:p,width:f-h,height:p-c};return e.bbox=v(d),d},Se=function(t){var e=v(t);return e.toString=m._path2string,e},Ne=m._pathToRelative=function(t){var e=Ce(t);if(e.rel)return Se(e.rel);m.is(t,X)&&m.is(t&&t[0],X)||(t=m.parsePathString(t));var n=[],r=0,i=0,o=0,s=0,a=0;"M"==t[0][0]&&(r=t[0][1],i=t[0][2],o=r,s=i,a++,n.push(["M",r,i]));for(var l=a,u=t.length;u>l;l++){var h=n[l]=[],c=t[l];if(c[0]!=D.call(c[0]))switch(h[0]=D.call(c[0]),h[0]){case"a":h[1]=c[1],h[2]=c[2],h[3]=c[3],h[4]=c[4],h[5]=c[5],h[6]=+(c[6]-r).toFixed(3),h[7]=+(c[7]-i).toFixed(3);break;case"v":h[1]=+(c[1]-i).toFixed(3);break;case"m":o=c[1],s=c[2];default:for(var f=1,p=c.length;p>f;f++)h[f]=+(c[f]-(f%2?r:i)).toFixed(3)}else{h=n[l]=[],"m"==c[0]&&(o=c[1]+r,s=c[2]+i);for(var d=0,g=c.length;g>d;d++)n[l][d]=c[d]}var v=n[l].length;switch(n[l][0]){case"z":r=o,i=s;break;case"h":r+=+n[l][v-1];break;case"v":i+=+n[l][v-1];break;default:r+=+n[l][v-2],i+=+n[l][v-1]}}return n.toString=m._path2string,e.rel=Se(n),n},Ee=m._pathToAbsolute=function(t){var e=Ce(t);if(e.abs)return Se(e.abs);if(m.is(t,X)&&m.is(t&&t[0],X)||(t=m.parsePathString(t)),!t||!t.length)return[["M",0,0]];var n=[],r=0,i=0,o=0,s=0,a=0;"M"==t[0][0]&&(r=+t[0][1],i=+t[0][2],o=r,s=i,a++,n[0]=["M",r,i]);for(var l,u,h=3==t.length&&"M"==t[0][0]&&"R"==t[1][0].toUpperCase()&&"Z"==t[2][0].toUpperCase(),c=a,p=t.length;p>c;c++){if(n.push(l=[]),u=t[c],u[0]!=K.call(u[0]))switch(l[0]=K.call(u[0]),l[0]){case"A":l[1]=u[1],l[2]=u[2],l[3]=u[3],l[4]=u[4],l[5]=u[5],l[6]=+(u[6]+r),l[7]=+(u[7]+i);break;case"V":l[1]=+u[1]+i;break;case"H":l[1]=+u[1]+r;break;case"R":for(var d=[r,i][E](u.slice(1)),g=2,v=d.length;v>g;g++)d[g]=+d[g]+r,d[++g]=+d[g]+i;n.pop(),n=n[E](f(d,h));break;case"M":o=+u[1]+r,s=+u[2]+i;default:for(g=1,v=u.length;v>g;g++)l[g]=+u[g]+(g%2?r:i)}else if("R"==u[0])d=[r,i][E](u.slice(1)),n.pop(),n=n[E](f(d,h)),l=["R"][E](u.slice(-2));else for(var y=0,x=u.length;x>y;y++)l[y]=u[y];switch(l[0]){case"Z":r=o,i=s;break;case"H":r=l[1];break;case"V":i=l[1];break;case"M":o=l[l.length-2],s=l[l.length-1];default:r=l[l.length-2],i=l[l.length-1]}}return n.toString=m._path2string,e.abs=Se(n),n},Ae=function(t,e,n,r){return[t,e,n,r,n,r]},Be=function(t,e,n,r,i,o){var s=1/3,a=2/3;return[s*t+a*n,s*e+a*r,s*i+a*n,s*o+a*r,i,o]},Le=function(t,e,n,r,i,o,s,a,l,u){var h,c=120*q/180,f=q/180*(+i||0),p=[],g=d(function(t,e,n){var r=t*P.cos(n)-e*P.sin(n),i=t*P.sin(n)+e*P.cos(n);return{x:r,y:i}});if(u)C=u[0],T=u[1],_=u[2],k=u[3];else{h=g(t,e,-f),t=h.x,e=h.y,h=g(a,l,-f),a=h.x,l=h.y;var v=(P.cos(q/180*i),P.sin(q/180*i),(t-a)/2),m=(e-l)/2,y=v*v/(n*n)+m*m/(r*r);y>1&&(y=P.sqrt(y),n=y*n,r=y*r);var x=n*n,b=r*r,w=(o==s?-1:1)*P.sqrt(z((x*b-x*m*m-b*v*v)/(x*m*m+b*v*v))),_=w*n*m/r+(t+a)/2,k=w*-r*v/n+(e+l)/2,C=P.asin(((e-k)/r).toFixed(9)),T=P.asin(((l-k)/r).toFixed(9));C=_>t?q-C:C,T=_>a?q-T:T,0>C&&(C=2*q+C),0>T&&(T=2*q+T),s&&C>T&&(C-=2*q),!s&&T>C&&(T-=2*q)}var S=T-C;if(z(S)>c){var N=T,A=a,B=l;T=C+c*(s&&T>C?1:-1),a=_+n*P.cos(T),l=k+r*P.sin(T),p=Le(a,l,n,r,i,0,s,A,B,[T,N,_,k])}S=T-C;var L=P.cos(C),M=P.sin(C),j=P.cos(T),H=P.sin(T),D=P.tan(S/4),I=4/3*n*D,O=4/3*r*D,R=[t,e],W=[t+I*M,e-O*L],$=[a+I*H,l-O*j],X=[a,l];if(W[0]=2*R[0]-W[0],W[1]=2*R[1]-W[1],u)return[W,$,X][E](p);p=[W,$,X][E](p).join()[F](",");for(var Y=[],V=0,G=p.length;G>V;V++)Y[V]=V%2?g(p[V-1],p[V],f).y:g(p[V],p[V+1],f).x;return Y},Me=function(t,e,n,r,i,o,s,a,l){var u=1-l;return{x:R(u,3)*t+3*R(u,2)*l*n+3*u*l*l*i+R(l,3)*s,y:R(u,3)*e+3*R(u,2)*l*r+3*u*l*l*o+R(l,3)*a}},Fe=d(function(t,e,n,r,i,o,s,a){var l,u=i-2*n+t-(s-2*i+n),h=2*(n-t)-2*(i-n),c=t-n,f=(-h+P.sqrt(h*h-4*u*c))/2/u,p=(-h-P.sqrt(h*h-4*u*c))/2/u,d=[e,a],g=[t,s];return z(f)>"1e12"&&(f=.5),z(p)>"1e12"&&(p=.5),f>0&&1>f&&(l=Me(t,e,n,r,i,o,s,a,f),g.push(l.x),d.push(l.y)),p>0&&1>p&&(l=Me(t,e,n,r,i,o,s,a,p),g.push(l.x),d.push(l.y)),u=o-2*r+e-(a-2*o+r),h=2*(r-e)-2*(o-r),c=e-r,f=(-h+P.sqrt(h*h-4*u*c))/2/u,p=(-h-P.sqrt(h*h-4*u*c))/2/u,z(f)>"1e12"&&(f=.5),z(p)>"1e12"&&(p=.5),f>0&&1>f&&(l=Me(t,e,n,r,i,o,s,a,f),g.push(l.x),d.push(l.y)),p>0&&1>p&&(l=Me(t,e,n,r,i,o,s,a,p),g.push(l.x),d.push(l.y)),{min:{x:O[N](0,g),y:O[N](0,d)},max:{x:I[N](0,g),y:I[N](0,d)}}}),je=m._path2curve=d(function(t,e){var n=!e&&Ce(t);if(!e&&n.curve)return Se(n.curve);for(var r=Ee(t),i=e&&Ee(e),o={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},s={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},a=(function(t,e){var n,r;if(!t)return["C",e.x,e.y,e.x,e.y,e.x,e.y];switch(!(t[0]in{T:1,Q:1})&&(e.qx=e.qy=null),t[0]){case"M":e.X=t[1],e.Y=t[2];break;case"A":t=["C"][E](Le[N](0,[e.x,e.y][E](t.slice(1))));break;case"S":n=e.x+(e.x-(e.bx||e.x)),r=e.y+(e.y-(e.by||e.y)),t=["C",n,r][E](t.slice(1));break;case"T":e.qx=e.x+(e.x-(e.qx||e.x)),e.qy=e.y+(e.y-(e.qy||e.y)),t=["C"][E](Be(e.x,e.y,e.qx,e.qy,t[1],t[2]));break;case"Q":e.qx=t[1],e.qy=t[2],t=["C"][E](Be(e.x,e.y,t[1],t[2],t[3],t[4]));break;case"L":t=["C"][E](Ae(e.x,e.y,t[1],t[2]));break;case"H":t=["C"][E](Ae(e.x,e.y,t[1],e.y));break;case"V":t=["C"][E](Ae(e.x,e.y,e.x,t[1]));break;case"Z":t=["C"][E](Ae(e.x,e.y,e.X,e.Y))}return t}),l=function(t,e){if(t[e].length>7){t[e].shift();for(var n=t[e];n.length;)t.splice(e++,0,["C"][E](n.splice(0,6)));t.splice(e,1),c=I(r.length,i&&i.length||0)}},u=function(t,e,n,o,s){t&&e&&"M"==t[s][0]&&"M"!=e[s][0]&&(e.splice(s,0,["M",o.x,o.y]),n.bx=0,n.by=0,n.x=t[s][1],n.y=t[s][2],c=I(r.length,i&&i.length||0))},h=0,c=I(r.length,i&&i.length||0);c>h;h++){r[h]=a(r[h],o),l(r,h),i&&(i[h]=a(i[h],s)),i&&l(i,h),u(r,i,o,s,h),u(i,r,s,o,h);var f=r[h],p=i&&i[h],d=f.length,g=i&&p.length;o.x=f[d-2],o.y=f[d-1],o.bx=Z(f[d-4])||o.x,o.by=Z(f[d-3])||o.y,s.bx=i&&(Z(p[g-4])||s.x),s.by=i&&(Z(p[g-3])||s.y),s.x=i&&p[g-2],s.y=i&&p[g-1]}return i||(n.curve=Se(r)),i?[r,i]:r},null,Se),He=(m._parseDots=d(function(t){for(var e=[],n=0,r=t.length;r>n;n++){var i={},o=t[n].match(/^([^:]*):?([\d\.]*)/);if(i.color=m.getRGB(o[1]),i.color.error)return null;i.color=i.color.hex,o[2]&&(i.offset=o[2]+"%"),e.push(i)}for(n=1,r=e.length-1;r>n;n++)if(!e[n].offset){for(var s=Z(e[n-1].offset||0),a=0,l=n+1;r>l;l++)if(e[l].offset){a=e[l].offset;break}a||(a=100,l=r),a=Z(a);for(var u=(a-s)/(l-n+1);l>n;n++)s+=u,e[n].offset=s+"%"}return e}),m._tear=function(t,e){t==e.top&&(e.top=t.prev),t==e.bottom&&(e.bottom=t.next),t.next&&(t.next.prev=t.prev),t.prev&&(t.prev.next=t.next)}),De=(m._tofront=function(t,e){e.top!==t&&(He(t,e),t.next=null,t.prev=e.top,e.top.next=t,e.top=t)},m._toback=function(t,e){e.bottom!==t&&(He(t,e),t.next=e.bottom,t.prev=null,e.bottom.prev=t,e.bottom=t)},m._insertafter=function(t,e,n){He(t,n),e==n.top&&(n.top=t),e.next&&(e.next.prev=t),t.next=e.next,t.prev=e,e.next=t},m._insertbefore=function(t,e,n){He(t,n),e==n.bottom&&(n.bottom=t),e.prev&&(e.prev.next=t),t.prev=e.prev,e.prev=t,t.next=e},m.toMatrix=function(t,e){var n=Te(t),r={_:{transform:B},getBBox:function(){return n}};return Pe(r,e),r.matrix}),Pe=(m.transformPath=function(t,e){return ge(t,De(t,e))},m._extractTransform=function(t,e){if(null==e)return t._.transform;e=M(e).replace(/\.{3}|\u2026/g,t._.transform||B);var n=m.parseTransformString(e),r=0,i=0,s=0,a=1,l=1,u=t._,h=new o;if(u.transform=n||[],n)for(var c=0,f=n.length;f>c;c++){var p,d,g,v,y,x=n[c],b=x.length,w=M(x[0]).toLowerCase(),_=x[0]!=w,k=_?h.invert():0;"t"==w&&3==b?_?(p=k.x(0,0),d=k.y(0,0),g=k.x(x[1],x[2]),v=k.y(x[1],x[2]),h.translate(g-p,v-d)):h.translate(x[1],x[2]):"r"==w?2==b?(y=y||t.getBBox(1),h.rotate(x[1],y.x+y.width/2,y.y+y.height/2),r+=x[1]):4==b&&(_?(g=k.x(x[2],x[3]),v=k.y(x[2],x[3]),h.rotate(x[1],g,v)):h.rotate(x[1],x[2],x[3]),r+=x[1]):"s"==w?2==b||3==b?(y=y||t.getBBox(1),h.scale(x[1],x[b-1],y.x+y.width/2,y.y+y.height/2),a*=x[1],l*=x[b-1]):5==b&&(_?(g=k.x(x[3],x[4]),v=k.y(x[3],x[4]),h.scale(x[1],x[2],g,v)):h.scale(x[1],x[2],x[3],x[4]),a*=x[1],l*=x[2]):"m"==w&&7==b&&h.add(x[1],x[2],x[3],x[4],x[5],x[6]),u.dirtyT=1,t.matrix=h}t.matrix=h,u.sx=a,u.sy=l,u.deg=r,u.dx=i=h.e,u.dy=s=h.f,1==a&&1==l&&!r&&u.bbox?(u.bbox.x+=+i,u.bbox.y+=+s):u.dirtyT=1}),Ie=function(t){var e=t[0];switch(e.toLowerCase()){case"t":return[e,0,0];case"m":return[e,1,0,0,1,0,0];case"r":return 4==t.length?[e,0,t[2],t[3]]:[e,0];case"s":return 5==t.length?[e,1,1,t[3],t[4]]:3==t.length?[e,1,1]:[e,1]}},Oe=m._equaliseTransform=function(t,e){e=M(e).replace(/\.{3}|\u2026/g,t),t=m.parseTransformString(t)||[],e=m.parseTransformString(e)||[];for(var n,r,i,o,s=I(t.length,e.length),a=[],l=[],u=0;s>u;u++){if(i=t[u]||Ie(e[u]),o=e[u]||Ie(i),i[0]!=o[0]||"r"==i[0].toLowerCase()&&(i[2]!=o[2]||i[3]!=o[3])||"s"==i[0].toLowerCase()&&(i[3]!=o[3]||i[4]!=o[4]))return;for(a[u]=[],l[u]=[],n=0,r=I(i.length,o.length);r>n;n++)n in i&&(a[u][n]=i[n]),n in o&&(l[u][n]=o[n])}return{from:a,to:l}};m._getContainer=function(t,e,n,r){var i;return i=null!=r||m.is(t,"object")?t:C.doc.getElementById(t),null!=i?i.tagName?null==e?{container:i,width:i.style.pixelWidth||i.offsetWidth,height:i.style.pixelHeight||i.offsetHeight}:{container:i,width:e,height:n}:{container:1,x:t,y:e,width:n,height:r}:void 0},m.pathToRelative=Ne,m._engine={},m.path2curve=je,m.matrix=function(t,e,n,r,i,s){return new o(t,e,n,r,i,s)},function(t){function e(t){var e=P.sqrt(n(t));t[0]&&(t[0]/=e),t[1]&&(t[1]/=e)}function n(t){return t[0]*t[0]+t[1]*t[1]}t.add=function(t,e,n,r,i,s){var a,l,u,h,c=[[],[],[]],f=[[this.a,this.c,this.e],[this.b,this.d,this.f],[0,0,1]],p=[[t,n,i],[e,r,s],[0,0,1]];for(t&&t instanceof o&&(p=[[t.a,t.c,t.e],[t.b,t.d,t.f],[0,0,1]]),a=0;3>a;a++)for(l=0;3>l;l++){for(h=0,u=0;3>u;u++)h+=f[a][u]*p[u][l];c[a][l]=h}this.a=c[0][0],this.b=c[1][0],this.c=c[0][1],this.d=c[1][1],this.e=c[0][2],this.f=c[1][2]},t.invert=function(){var t=this,e=t.a*t.d-t.b*t.c;return new o(t.d/e,-t.b/e,-t.c/e,t.a/e,(t.c*t.f-t.d*t.e)/e,(t.b*t.e-t.a*t.f)/e)},t.clone=function(){return new o(this.a,this.b,this.c,this.d,this.e,this.f)},t.translate=function(t,e){this.add(1,0,0,1,t,e)},t.scale=function(t,e,n,r){null==e&&(e=t),(n||r)&&this.add(1,0,0,1,n,r),this.add(t,0,0,e,0,0),(n||r)&&this.add(1,0,0,1,-n,-r)},t.rotate=function(t,e,n){t=m.rad(t),e=e||0,n=n||0;var r=+P.cos(t).toFixed(9),i=+P.sin(t).toFixed(9);this.add(r,i,-i,r,e,n),this.add(1,0,0,1,-e,-n)},t.x=function(t,e){return t*this.a+e*this.c+this.e},t.y=function(t,e){return t*this.b+e*this.d+this.f},t.get=function(t){return+this[M.fromCharCode(97+t)].toFixed(4)},t.toString=function(){return m.svg?"matrix("+[this.get(0),this.get(1),this.get(2),this.get(3),this.get(4),this.get(5)].join()+")":[this.get(0),this.get(2),this.get(1),this.get(3),0,0].join()},t.toFilter=function(){return"progid:DXImageTransform.Microsoft.Matrix(M11="+this.get(0)+", M12="+this.get(2)+", M21="+this.get(1)+", M22="+this.get(3)+", Dx="+this.get(4)+", Dy="+this.get(5)+", sizingmethod='auto expand')"},t.offset=function(){return[this.e.toFixed(4),this.f.toFixed(4)]},t.split=function(){var t={};t.dx=this.e,t.dy=this.f;var r=[[this.a,this.c],[this.b,this.d]];t.scalex=P.sqrt(n(r[0])),e(r[0]),t.shear=r[0][0]*r[1][0]+r[0][1]*r[1][1],r[1]=[r[1][0]-r[0][0]*t.shear,r[1][1]-r[0][1]*t.shear],t.scaley=P.sqrt(n(r[1])),e(r[1]),t.shear/=t.scaley;var i=-r[0][1],o=r[1][1];return 0>o?(t.rotate=m.deg(P.acos(o)),0>i&&(t.rotate=360-t.rotate)):t.rotate=m.deg(P.asin(i)),t.isSimple=!(+t.shear.toFixed(9)||t.scalex.toFixed(9)!=t.scaley.toFixed(9)&&t.rotate),t.isSuperSimple=!+t.shear.toFixed(9)&&t.scalex.toFixed(9)==t.scaley.toFixed(9)&&!t.rotate,t.noRotation=!+t.shear.toFixed(9)&&!t.rotate,t},t.toTransformString=function(t){var e=t||this[F]();return e.isSimple?(e.scalex=+e.scalex.toFixed(4),e.scaley=+e.scaley.toFixed(4),e.rotate=+e.rotate.toFixed(4),(e.dx||e.dy?"t"+[e.dx,e.dy]:B)+(1!=e.scalex||1!=e.scaley?"s"+[e.scalex,e.scaley,0,0]:B)+(e.rotate?"r"+[e.rotate,0,0]:B)):"m"+[this.get(0),this.get(1),this.get(2),this.get(3),this.get(4),this.get(5)]}}(o.prototype);var ze=navigator.userAgent.match(/Version\/(.*?)\s/)||navigator.userAgent.match(/Chrome\/(\d+)/);x.safari="Apple Computer, Inc."==navigator.vendor&&(ze&&4>ze[1]||"iP"==navigator.platform.slice(0,2))||"Google Inc."==navigator.vendor&&ze&&8>ze[1]?function(){var t=this.rect(-99,-99,this.width+99,this.height+99).attr({stroke:"none"});setTimeout(function(){t.remove()})}:he;for(var Re=function(){this.returnValue=!1},qe=function(){return this.originalEvent.preventDefault()},We=function(){this.cancelBubble=!0},$e=function(){return this.originalEvent.stopPropagation()},Xe=function(){return C.doc.addEventListener?function(t,e,n,r){var i=A&&H[e]?H[e]:e,o=function(i){var o=C.doc.documentElement.scrollTop||C.doc.body.scrollTop,s=C.doc.documentElement.scrollLeft||C.doc.body.scrollLeft,a=i.clientX+s,l=i.clientY+o;if(A&&H[k](e))for(var u=0,h=i.targetTouches&&i.targetTouches.length;h>u;u++)if(i.targetTouches[u].target==t){var c=i;i=i.targetTouches[u],i.originalEvent=c,i.preventDefault=qe,i.stopPropagation=$e;break}return n.call(r,i,a,l)};return t.addEventListener(i,o,!1),function(){return t.removeEventListener(i,o,!1),!0}}:C.doc.attachEvent?function(t,e,n,r){var i=function(t){t=t||C.win.event;var e=C.doc.documentElement.scrollTop||C.doc.body.scrollTop,i=C.doc.documentElement.scrollLeft||C.doc.body.scrollLeft,o=t.clientX+i,s=t.clientY+e;return t.preventDefault=t.preventDefault||Re,t.stopPropagation=t.stopPropagation||We,n.call(r,t,o,s)};t.attachEvent("on"+e,i);var o=function(){return t.detachEvent("on"+e,i),!0};return o}:void 0}(),Ye=[],Ve=function(t){for(var e,n=t.clientX,r=t.clientY,i=C.doc.documentElement.scrollTop||C.doc.body.scrollTop,o=C.doc.documentElement.scrollLeft||C.doc.body.scrollLeft,s=Ye.length;s--;){if(e=Ye[s],A){for(var a,l=t.touches.length;l--;)if(a=t.touches[l],a.identifier==e.el._drag.id){n=a.clientX,r=a.clientY,(t.originalEvent?t.originalEvent:t).preventDefault();break}}else t.preventDefault();var u,h=e.el.node,c=h.nextSibling,f=h.parentNode,p=h.style.display;C.win.opera&&f.removeChild(h),h.style.display="none",u=e.el.paper.getElementByPoint(n,r),h.style.display=p,C.win.opera&&(c?f.insertBefore(h,c):f.appendChild(h)),u&&eve("raphael.drag.over."+e.el.id,e.el,u),n+=o,r+=i,eve("raphael.drag.move."+e.el.id,e.move_scope||e.el,n-e.el._drag.x,r-e.el._drag.y,n,r,t)}},Ge=function(t){m.unmousemove(Ve).unmouseup(Ge);for(var e,n=Ye.length;n--;)e=Ye[n],e.el._drag={},eve("raphael.drag.end."+e.el.id,e.end_scope||e.start_scope||e.move_scope||e.el,t);Ye=[]},Ue=m.el={},Qe=j.length;Qe--;)(function(t){m[t]=Ue[t]=function(e,n){return m.is(e,"function")&&(this.events=this.events||[],this.events.push({name:t,f:e,unbind:Xe(this.shape||this.node||C.doc,t,e,n||this)})),this},m["un"+t]=Ue["un"+t]=function(e){for(var n=this.events||[],r=n.length;r--;)if(n[r].name==t&&n[r].f==e)return n[r].unbind(),n.splice(r,1),!n.length&&delete this.events,this;return this}})(j[Qe]);Ue.data=function(t,e){var n=le[this.id]=le[this.id]||{};if(1==arguments.length){if(m.is(t,"object")){for(var r in t)t[k](r)&&this.data(r,t[r]);return this}return eve("raphael.data.get."+this.id,this,n[t],t),n[t]}return n[t]=e,eve("raphael.data.set."+this.id,this,e,t),this},Ue.removeData=function(t){return null==t?le[this.id]={}:le[this.id]&&delete le[this.id][t],this},Ue.hover=function(t,e,n,r){return this.mouseover(t,n).mouseout(e,r||n)},Ue.unhover=function(t,e){return this.unmouseover(t).unmouseout(e)};var Ze=[];Ue.drag=function(t,e,n,r,i,o){function s(s){(s.originalEvent||s).preventDefault();var a=C.doc.documentElement.scrollTop||C.doc.body.scrollTop,l=C.doc.documentElement.scrollLeft||C.doc.body.scrollLeft;this._drag.x=s.clientX+l,this._drag.y=s.clientY+a,this._drag.id=s.identifier,!Ye.length&&m.mousemove(Ve).mouseup(Ge),Ye.push({el:this,move_scope:r,start_scope:i,end_scope:o}),e&&eve.on("raphael.drag.start."+this.id,e),t&&eve.on("raphael.drag.move."+this.id,t),n&&eve.on("raphael.drag.end."+this.id,n),eve("raphael.drag.start."+this.id,i||r||this,s.clientX+l,s.clientY+a,s)}return this._drag={},Ze.push({el:this,start:s}),this.mousedown(s),this},Ue.onDragOver=function(t){t?eve.on("raphael.drag.over."+this.id,t):eve.unbind("raphael.drag.over."+this.id)},Ue.undrag=function(){for(var t=Ze.length;t--;)Ze[t].el==this&&(this.unmousedown(Ze[t].start),Ze.splice(t,1),eve.unbind("raphael.drag.*."+this.id));!Ze.length&&m.unmousemove(Ve).unmouseup(Ge)},x.circle=function(t,e,n){var r=m._engine.circle(this,t||0,e||0,n||0);return this.__set__&&this.__set__.push(r),r},x.rect=function(t,e,n,r,i){var o=m._engine.rect(this,t||0,e||0,n||0,r||0,i||0);return this.__set__&&this.__set__.push(o),o},x.ellipse=function(t,e,n,r){var i=m._engine.ellipse(this,t||0,e||0,n||0,r||0);return this.__set__&&this.__set__.push(i),i},x.path=function(t){t&&!m.is(t,$)&&!m.is(t[0],X)&&(t+=B);var e=m._engine.path(m.format[N](m,arguments),this);return this.__set__&&this.__set__.push(e),e},x.image=function(t,e,n,r,i){var o=m._engine.image(this,t||"about:blank",e||0,n||0,r||0,i||0);return this.__set__&&this.__set__.push(o),o},x.text=function(t,e,n){var r=m._engine.text(this,t||0,e||0,M(n));return this.__set__&&this.__set__.push(r),r},x.set=function(t){!m.is(t,"array")&&(t=Array.prototype.splice.call(arguments,0,arguments.length));var e=new hn(t);return this.__set__&&this.__set__.push(e),e},x.setStart=function(t){this.__set__=t||this.set()},x.setFinish=function(){var t=this.__set__;return delete this.__set__,t},x.setSize=function(t,e){return m._engine.setSize.call(this,t,e)},x.setViewBox=function(t,e,n,r,i){return m._engine.setViewBox.call(this,t,e,n,r,i)},x.top=x.bottom=null,x.raphael=m;var Je=function(t){var e=t.getBoundingClientRect(),n=t.ownerDocument,r=n.body,i=n.documentElement,o=i.clientTop||r.clientTop||0,s=i.clientLeft||r.clientLeft||0,a=e.top+(C.win.pageYOffset||i.scrollTop||r.scrollTop)-o,l=e.left+(C.win.pageXOffset||i.scrollLeft||r.scrollLeft)-s;return{y:a,x:l}};x.getElementByPoint=function(t,e){var n=this,r=n.canvas,i=C.doc.elementFromPoint(t,e);if(C.win.opera&&"svg"==i.tagName){var o=Je(r),s=r.createSVGRect();s.x=t-o.x,s.y=e-o.y,s.width=s.height=1;var a=r.getIntersectionList(s,null);a.length&&(i=a[a.length-1])}if(!i)return null;for(;i.parentNode&&i!=r.parentNode&&!i.raphael;)i=i.parentNode;return i==n.canvas.parentNode&&(i=r),i=i&&i.raphael?n.getById(i.raphaelid):null},x.getById=function(t){for(var e=this.bottom;e;){if(e.id==t)return e;e=e.next}return null},x.forEach=function(t,e){for(var n=this.bottom;n;){if(t.call(e,n)===!1)return this;n=n.next}return this},x.getElementsByPoint=function(t,e){var n=this.set();return this.forEach(function(r){r.isPointInside(t,e)&&n.push(r)}),n},Ue.isPointInside=function(t,e){var n=this.realPath=this.realPath||de[this.type](this);return m.isPointInsidePath(n,t,e)},Ue.getBBox=function(t){if(this.removed)return{};var e=this._;return t?((e.dirty||!e.bboxwt)&&(this.realPath=de[this.type](this),e.bboxwt=Te(this.realPath),e.bboxwt.toString=i,e.dirty=0),e.bboxwt):((e.dirty||e.dirtyT||!e.bbox)&&((e.dirty||!this.realPath)&&(e.bboxwt=0,this.realPath=de[this.type](this)),e.bbox=Te(ge(this.realPath,this.matrix)),e.bbox.toString=i,e.dirty=e.dirtyT=0),e.bbox)},Ue.clone=function(){if(this.removed)return null;var t=this.paper[this.type]().attr(this.attr());return this.__set__&&this.__set__.push(t),t},Ue.glow=function(t){if("text"==this.type)return null;t=t||{};var e={width:(t.width||10)+(+this.attr("stroke-width")||1),fill:t.fill||!1,opacity:t.opacity||.5,offsetx:t.offsetx||0,offsety:t.offsety||0,color:t.color||"#000"},n=e.width/2,r=this.paper,i=r.set(),o=this.realPath||de[this.type](this);o=this.matrix?ge(o,this.matrix):o;for(var s=1;n+1>s;s++)i.push(r.path(o).attr({stroke:e.color,fill:e.fill?e.color:"none","stroke-linejoin":"round","stroke-linecap":"round","stroke-width":+(e.width/n*s).toFixed(3),opacity:+(e.opacity/n).toFixed(3)}));return i.insertBefore(this).translate(e.offsetx,e.offsety)};var Ke=function(t,e,n,r,i,o,s,a,l){return null==l?h(t,e,n,r,i,o,s,a):m.findDotsAtSegment(t,e,n,r,i,o,s,a,u(t,e,n,r,i,o,s,a,l))},tn=function(t,e){return function(n,r,i){n=je(n);for(var o,s,a,l,u,h="",c={},f=0,p=0,d=n.length;d>p;p++){if(a=n[p],"M"==a[0])o=+a[1],s=+a[2];else{if(l=Ke(o,s,a[1],a[2],a[3],a[4],a[5],a[6]),f+l>r){if(e&&!c.start){if(u=Ke(o,s,a[1],a[2],a[3],a[4],a[5],a[6],r-f),h+=["C"+u.start.x,u.start.y,u.m.x,u.m.y,u.x,u.y],i)return h;c.start=h,h=["M"+u.x,u.y+"C"+u.n.x,u.n.y,u.end.x,u.end.y,a[5],a[6]].join(),f+=l,o=+a[5],s=+a[6];continue}if(!t&&!e)return u=Ke(o,s,a[1],a[2],a[3],a[4],a[5],a[6],r-f),{x:u.x,y:u.y,alpha:u.alpha}}f+=l,o=+a[5],s=+a[6]}h+=a.shift()+a}return c.end=h,u=t?f:e?c:m.findDotsAtSegment(o,s,a[0],a[1],a[2],a[3],a[4],a[5],1),u.alpha&&(u={x:u.x,y:u.y,alpha:u.alpha}),u}},en=tn(1),nn=tn(),rn=tn(0,1);m.getTotalLength=en,m.getPointAtLength=nn,m.getSubpath=function(t,e,n){if(1e-6>this.getTotalLength(t)-n)return rn(t,e).end;var r=rn(t,n,1);return e?rn(r,e).end:r},Ue.getTotalLength=function(){return"path"==this.type?this.node.getTotalLength?this.node.getTotalLength():en(this.attrs.path):void 0},Ue.getPointAtLength=function(t){return"path"==this.type?nn(this.attrs.path,t):void 0},Ue.getSubpath=function(t,e){return"path"==this.type?m.getSubpath(this.attrs.path,t,e):void 0};var on=m.easing_formulas={linear:function(t){return t},"<":function(t){return R(t,1.7)},">":function(t){return R(t,.48)},"<>":function(t){var e=.48-t/1.04,n=P.sqrt(.1734+e*e),r=n-e,i=R(z(r),1/3)*(0>r?-1:1),o=-n-e,s=R(z(o),1/3)*(0>o?-1:1),a=i+s+.5;return 3*(1-a)*a*a+a*a*a},backIn:function(t){var e=1.70158;return t*t*((e+1)*t-e)},backOut:function(t){t-=1;var e=1.70158;return t*t*((e+1)*t+e)+1},elastic:function(t){return t==!!t?t:R(2,-10*t)*P.sin(2*(t-.075)*q/.3)+1},bounce:function(t){var e,n=7.5625,r=2.75;return 1/r>t?e=n*t*t:2/r>t?(t-=1.5/r,e=n*t*t+.75):2.5/r>t?(t-=2.25/r,e=n*t*t+.9375):(t-=2.625/r,e=n*t*t+.984375),e}};on.easeIn=on["ease-in"]=on["<"],on.easeOut=on["ease-out"]=on[">"],on.easeInOut=on["ease-in-out"]=on["<>"],on["back-in"]=on.backIn,on["back-out"]=on.backOut;var sn=[],an=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){setTimeout(t,16)},ln=function(){for(var t=+new Date,n=0;sn.length>n;n++){var r=sn[n];if(!r.el.removed&&!r.paused){var i,o,s=t-r.start,a=r.ms,l=r.easing,u=r.from,h=r.diff,c=r.to,f=(r.t,r.el),p={},d={};if(r.initstatus?(s=(r.initstatus*r.anim.top-r.prev)/(r.percent-r.prev)*a,r.status=r.initstatus,delete r.initstatus,r.stop&&sn.splice(n--,1)):r.status=(r.prev+(r.percent-r.prev)*(s/a))/r.anim.top,!(0>s))if(a>s){var g=l(s/a);for(var v in u)if(u[k](v)){switch(ee[v]){case W:i=+u[v]+g*a*h[v];break;case"colour":i="rgb("+[un(Q(u[v].r+g*a*h[v].r)),un(Q(u[v].g+g*a*h[v].g)),un(Q(u[v].b+g*a*h[v].b))].join(",")+")";break;case"path":i=[];for(var y=0,x=u[v].length;x>y;y++){i[y]=[u[v][y][0]];for(var b=1,w=u[v][y].length;w>b;b++)i[y][b]=+u[v][y][b]+g*a*h[v][y][b];i[y]=i[y].join(L)}i=i.join(L);break;case"transform":if(h[v].real)for(i=[],y=0,x=u[v].length;x>y;y++)for(i[y]=[u[v][y][0]],b=1,w=u[v][y].length;w>b;b++)i[y][b]=u[v][y][b]+g*a*h[v][y][b];else{var _=function(t){return+u[v][t]+g*a*h[v][t]};i=[["m",_(0),_(1),_(2),_(3),_(4),_(5)]]}break;case"csv":if("clip-rect"==v)for(i=[],y=4;y--;)i[y]=+u[v][y]+g*a*h[v][y];break;default:var C=[][E](u[v]);for(i=[],y=f.paper.customAttributes[v].length;y--;)i[y]=+C[y]+g*a*h[v][y]}p[v]=i}f.attr(p),function(t,e,n){setTimeout(function(){eve("raphael.anim.frame."+t,e,n)})}(f.id,f,r.anim)}else{if(function(t,e,n){setTimeout(function(){eve("raphael.anim.frame."+e.id,e,n),eve("raphael.anim.finish."+e.id,e,n),m.is(t,"function")&&t.call(e)})}(r.callback,f,r.anim),f.attr(c),sn.splice(n--,1),r.repeat>1&&!r.next){for(o in c)c[k](o)&&(d[o]=r.totalOrigin[o]);r.el.attr(d),e(r.anim,r.el,r.anim.percents[0],null,r.totalOrigin,r.repeat-1)}r.next&&!r.stop&&e(r.anim,r.el,r.next,null,r.totalOrigin,r.repeat)}}}m.svg&&f&&f.paper&&f.paper.safari(),sn.length&&an(ln)},un=function(t){return t>255?255:0>t?0:t};Ue.animateWith=function(t,r,i,o,s,a){var l=this;if(l.removed)return a&&a.call(l),l;var u=i instanceof n?i:m.animation(i,o,s,a);e(u,l,u.percents[0],null,l.attr());for(var h=0,c=sn.length;c>h;h++)if(sn[h].anim==r&&sn[h].el==t){sn[c-1].start=sn[h].start;break}return l},Ue.onAnimation=function(t){return t?eve.on("raphael.anim.frame."+this.id,t):eve.unbind("raphael.anim.frame."+this.id),this},n.prototype.delay=function(t){var e=new n(this.anim,this.ms);return e.times=this.times,e.del=+t||0,e},n.prototype.repeat=function(t){var e=new n(this.anim,this.ms);return e.del=this.del,e.times=P.floor(I(t,0))||1,e},m.animation=function(t,e,r,i){if(t instanceof n)return t;(m.is(r,"function")||!r)&&(i=i||r||null,r=null),t=Object(t),e=+e||0;var o,s,a={};for(s in t)t[k](s)&&Z(s)!=s&&Z(s)+"%"!=s&&(o=!0,a[s]=t[s]);return o?(r&&(a.easing=r),i&&(a.callback=i),new n({100:a},e)):new n(t,e)},Ue.animate=function(t,r,i,o){var s=this;if(s.removed)return o&&o.call(s),s;var a=t instanceof n?t:m.animation(t,r,i,o);return e(a,s,a.percents[0],null,s.attr()),s},Ue.setTime=function(t,e){return t&&null!=e&&this.status(t,O(e,t.ms)/t.ms),this},Ue.status=function(t,n){var r,i,o=[],s=0;if(null!=n)return e(t,this,-1,O(n,1)),this;for(r=sn.length;r>s;s++)if(i=sn[s],i.el.id==this.id&&(!t||i.anim==t)){if(t)return i.status;o.push({anim:i.anim,status:i.status})}return t?0:o},Ue.pause=function(t){for(var e=0;sn.length>e;e++)sn[e].el.id==this.id&&(!t||sn[e].anim==t)&&eve("raphael.anim.pause."+this.id,this,sn[e].anim)!==!1&&(sn[e].paused=!0);return this},Ue.resume=function(t){for(var e=0;sn.length>e;e++)if(sn[e].el.id==this.id&&(!t||sn[e].anim==t)){var n=sn[e];eve("raphael.anim.resume."+this.id,this,n.anim)!==!1&&(delete n.paused,this.status(n.anim,n.status))}return this},Ue.stop=function(t){for(var e=0;sn.length>e;e++)sn[e].el.id==this.id&&(!t||sn[e].anim==t)&&eve("raphael.anim.stop."+this.id,this,sn[e].anim)!==!1&&sn.splice(e--,1);return this},eve.on("raphael.remove",t),eve.on("raphael.clear",t),Ue.toString=function(){return"Raphaël’s object"};var hn=function(t){if(this.items=[],this.length=0,this.type="set",t)for(var e=0,n=t.length;n>e;e++)t[e]&&(t[e].constructor==Ue.constructor||t[e].constructor==hn)&&(this[this.items.length]=this.items[this.items.length]=t[e],this.length++)},cn=hn.prototype;cn.push=function(){for(var t,e,n=0,r=arguments.length;r>n;n++)t=arguments[n],t&&(t.constructor==Ue.constructor||t.constructor==hn)&&(e=this.items.length,this[e]=this.items[e]=t,this.length++);return this},cn.pop=function(){return this.length&&delete this[this.length--],this.items.pop() +},cn.forEach=function(t,e){for(var n=0,r=this.items.length;r>n;n++)if(t.call(e,this.items[n],n)===!1)return this;return this};for(var fn in Ue)Ue[k](fn)&&(cn[fn]=function(t){return function(){var e=arguments;return this.forEach(function(n){n[t][N](n,e)})}}(fn));cn.attr=function(t,e){if(t&&m.is(t,X)&&m.is(t[0],"object"))for(var n=0,r=t.length;r>n;n++)this.items[n].attr(t[n]);else for(var i=0,o=this.items.length;o>i;i++)this.items[i].attr(t,e);return this},cn.clear=function(){for(;this.length;)this.pop()},cn.splice=function(t,e){t=0>t?I(this.length+t,0):t,e=I(0,O(this.length-t,e));var n,r=[],i=[],o=[];for(n=2;arguments.length>n;n++)o.push(arguments[n]);for(n=0;e>n;n++)i.push(this[t+n]);for(;this.length-t>n;n++)r.push(this[t+n]);var s=o.length;for(n=0;s+r.length>n;n++)this.items[t+n]=this[t+n]=s>n?o[n]:r[n-s];for(n=this.items.length=this.length-=e-s;this[n];)delete this[n++];return new hn(i)},cn.exclude=function(t){for(var e=0,n=this.length;n>e;e++)if(this[e]==t)return this.splice(e,1),!0},cn.animate=function(t,e,n,r){(m.is(n,"function")||!n)&&(r=n||null);var i,o,s=this.items.length,a=s,l=this;if(!s)return this;r&&(o=function(){!--s&&r.call(l)}),n=m.is(n,$)?n:o;var u=m.animation(t,e,n,o);for(i=this.items[--a].animate(u);a--;)this.items[a]&&!this.items[a].removed&&this.items[a].animateWith(i,u,u);return this},cn.insertAfter=function(t){for(var e=this.items.length;e--;)this.items[e].insertAfter(t);return this},cn.getBBox=function(){for(var t=[],e=[],n=[],r=[],i=this.items.length;i--;)if(!this.items[i].removed){var o=this.items[i].getBBox();t.push(o.x),e.push(o.y),n.push(o.x+o.width),r.push(o.y+o.height)}return t=O[N](0,t),e=O[N](0,e),n=I[N](0,n),r=I[N](0,r),{x:t,y:e,x2:n,y2:r,width:n-t,height:r-e}},cn.clone=function(t){t=new hn;for(var e=0,n=this.items.length;n>e;e++)t.push(this.items[e].clone());return t},cn.toString=function(){return"Raphaël‘s set"},m.registerFont=function(t){if(!t.face)return t;this.fonts=this.fonts||{};var e={w:t.w,face:{},glyphs:{}},n=t.face["font-family"];for(var r in t.face)t.face[k](r)&&(e.face[r]=t.face[r]);if(this.fonts[n]?this.fonts[n].push(e):this.fonts[n]=[e],!t.svg){e.face["units-per-em"]=J(t.face["units-per-em"],10);for(var i in t.glyphs)if(t.glyphs[k](i)){var o=t.glyphs[i];if(e.glyphs[i]={w:o.w,k:{},d:o.d&&"M"+o.d.replace(/[mlcxtrv]/g,function(t){return{l:"L",c:"C",x:"z",t:"m",r:"l",v:"c"}[t]||"M"})+"z"},o.k)for(var s in o.k)o[k](s)&&(e.glyphs[i].k[s]=o.k[s])}}return t},x.getFont=function(t,e,n,r){if(r=r||"normal",n=n||"normal",e=+e||{normal:400,bold:700,lighter:300,bolder:800}[e]||400,m.fonts){var i=m.fonts[t];if(!i){var o=RegExp("(^|\\s)"+t.replace(/[^\w\d\s+!~.:_-]/g,B)+"(\\s|$)","i");for(var s in m.fonts)if(m.fonts[k](s)&&o.test(s)){i=m.fonts[s];break}}var a;if(i)for(var l=0,u=i.length;u>l&&(a=i[l],a.face["font-weight"]!=e||a.face["font-style"]!=n&&a.face["font-style"]||a.face["font-stretch"]!=r);l++);return a}},x.print=function(t,e,n,r,i,o,s){o=o||"middle",s=I(O(s||0,1),-1);var a,l=M(n)[F](B),u=0,h=0,c=B;if(m.is(r,n)&&(r=this.getFont(r)),r){a=(i||16)/r.face["units-per-em"];for(var f=r.face.bbox[F](b),p=+f[0],d=f[3]-f[1],g=0,v=+f[1]+("baseline"==o?d+ +r.face.descent:d/2),y=0,x=l.length;x>y;y++){if("\n"==l[y])u=0,_=0,h=0,g+=d;else{var w=h&&r.glyphs[l[y-1]]||{},_=r.glyphs[l[y]];u+=h?(w.w||r.w)+(w.k&&w.k[l[y]]||0)+r.w*s:0,h=1}_&&_.d&&(c+=m.transformPath(_.d,["t",u*a,g*a,"s",a,a,p,v,"t",(t-p)/a,(e-v)/a]))}}return this.path(c).attr({fill:"#000",stroke:"none"})},x.add=function(t){if(m.is(t,"array"))for(var e,n=this.set(),r=0,i=t.length;i>r;r++)e=t[r]||{},w[k](e.type)&&n.push(this[e.type]().attr(e));return n},m.format=function(t,e){var n=m.is(e,X)?[0][E](e):arguments;return t&&m.is(t,$)&&n.length-1&&(t=t.replace(_,function(t,e){return null==n[++e]?B:n[e]})),t||B},m.fullfill=function(){var t=/\{([^\}]+)\}/g,e=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g,n=function(t,n,r){var i=r;return n.replace(e,function(t,e,n,r,o){e=e||r,i&&(e in i&&(i=i[e]),"function"==typeof i&&o&&(i=i()))}),i=(null==i||i==r?t:i)+""};return function(e,r){return(e+"").replace(t,function(t,e){return n(t,e,r)})}}(),m.ninja=function(){return T.was?C.win.Raphael=T.is:delete Raphael,m},m.st=cn,function(t,e,n){function r(){/in/.test(t.readyState)?setTimeout(r,9):m.eve("raphael.DOMload")}null==t.readyState&&t.addEventListener&&(t.addEventListener(e,n=function(){t.removeEventListener(e,n,!1),t.readyState="complete"},!1),t.readyState="loading"),r()}(document,"DOMContentLoaded"),T.was?C.win.Raphael=m:Raphael=m,eve.on("raphael.DOMload",function(){y=!0})}(),window.Raphael.svg&&function(t){var e="hasOwnProperty",n=String,r=parseFloat,i=parseInt,o=Math,s=o.max,a=o.abs,l=o.pow,u=/[, ]+/,h=t.eve,c="",f=" ",p="http://www.w3.org/1999/xlink",d={block:"M5,0 0,2.5 5,5z",classic:"M5,0 0,2.5 5,5 3.5,3 3.5,2z",diamond:"M2.5,0 5,2.5 2.5,5 0,2.5z",open:"M6,1 1,3.5 6,6",oval:"M2.5,0A2.5,2.5,0,0,1,2.5,5 2.5,2.5,0,0,1,2.5,0z"},g={};t.toString=function(){return"Your browser supports SVG.\nYou are running Raphaël "+this.version};var v=function(r,i){if(i){"string"==typeof r&&(r=v(r));for(var o in i)i[e](o)&&("xlink:"==o.substring(0,6)?r.setAttributeNS(p,o.substring(6),n(i[o])):r.setAttribute(o,n(i[o])))}else r=t._g.doc.createElementNS("http://www.w3.org/2000/svg",r),r.style&&(r.style.webkitTapHighlightColor="rgba(0,0,0,0)");return r},m=function(e,i){var u="linear",h=e.id+i,f=.5,p=.5,d=e.node,g=e.paper,m=d.style,y=t._g.doc.getElementById(h);if(!y){if(i=n(i).replace(t._radial_gradient,function(t,e,n){if(u="radial",e&&n){f=r(e),p=r(n);var i=2*(p>.5)-1;l(f-.5,2)+l(p-.5,2)>.25&&(p=o.sqrt(.25-l(f-.5,2))*i+.5)&&.5!=p&&(p=p.toFixed(5)-1e-5*i)}return c}),i=i.split(/\s*\-\s*/),"linear"==u){var x=i.shift();if(x=-r(x),isNaN(x))return null;var b=[0,0,o.cos(t.rad(x)),o.sin(t.rad(x))],w=1/(s(a(b[2]),a(b[3]))||1);b[2]*=w,b[3]*=w,0>b[2]&&(b[0]=-b[2],b[2]=0),0>b[3]&&(b[1]=-b[3],b[3]=0)}var _=t._parseDots(i);if(!_)return null;if(h=h.replace(/[\(\)\s,\xb0#]/g,"_"),e.gradient&&h!=e.gradient.id&&(g.defs.removeChild(e.gradient),delete e.gradient),!e.gradient){y=v(u+"Gradient",{id:h}),e.gradient=y,v(y,"radial"==u?{fx:f,fy:p}:{x1:b[0],y1:b[1],x2:b[2],y2:b[3],gradientTransform:e.matrix.invert()}),g.defs.appendChild(y);for(var k=0,C=_.length;C>k;k++)y.appendChild(v("stop",{offset:_[k].offset?_[k].offset:k?"100%":"0%","stop-color":_[k].color||"#fff"}))}}return v(d,{fill:"url(#"+h+")",opacity:1,"fill-opacity":1}),m.fill=c,m.opacity=1,m.fillOpacity=1,1},y=function(t){var e=t.getBBox(1);v(t.pattern,{patternTransform:t.matrix.invert()+" translate("+e.x+","+e.y+")"})},x=function(r,i,o){if("path"==r.type){for(var s,a,l,u,h,f=n(i).toLowerCase().split("-"),p=r.paper,m=o?"end":"start",y=r.node,x=r.attrs,b=x["stroke-width"],w=f.length,_="classic",k=3,C=3,T=5;w--;)switch(f[w]){case"block":case"classic":case"oval":case"diamond":case"open":case"none":_=f[w];break;case"wide":C=5;break;case"narrow":C=2;break;case"long":k=5;break;case"short":k=2}if("open"==_?(k+=2,C+=2,T+=2,l=1,u=o?4:1,h={fill:"none",stroke:x.stroke}):(u=l=k/2,h={fill:x.stroke,stroke:"none"}),r._.arrows?o?(r._.arrows.endPath&&g[r._.arrows.endPath]--,r._.arrows.endMarker&&g[r._.arrows.endMarker]--):(r._.arrows.startPath&&g[r._.arrows.startPath]--,r._.arrows.startMarker&&g[r._.arrows.startMarker]--):r._.arrows={},"none"!=_){var S="raphael-marker-"+_,N="raphael-marker-"+m+_+k+C;t._g.doc.getElementById(S)?g[S]++:(p.defs.appendChild(v(v("path"),{"stroke-linecap":"round",d:d[_],id:S})),g[S]=1);var E,A=t._g.doc.getElementById(N);A?(g[N]++,E=A.getElementsByTagName("use")[0]):(A=v(v("marker"),{id:N,markerHeight:C,markerWidth:k,orient:"auto",refX:u,refY:C/2}),E=v(v("use"),{"xlink:href":"#"+S,transform:(o?"rotate(180 "+k/2+" "+C/2+") ":c)+"scale("+k/T+","+C/T+")","stroke-width":(1/((k/T+C/T)/2)).toFixed(4)}),A.appendChild(E),p.defs.appendChild(A),g[N]=1),v(E,h);var B=l*("diamond"!=_&&"oval"!=_);o?(s=r._.arrows.startdx*b||0,a=t.getTotalLength(x.path)-B*b):(s=B*b,a=t.getTotalLength(x.path)-(r._.arrows.enddx*b||0)),h={},h["marker-"+m]="url(#"+N+")",(a||s)&&(h.d=Raphael.getSubpath(x.path,s,a)),v(y,h),r._.arrows[m+"Path"]=S,r._.arrows[m+"Marker"]=N,r._.arrows[m+"dx"]=B,r._.arrows[m+"Type"]=_,r._.arrows[m+"String"]=i}else o?(s=r._.arrows.startdx*b||0,a=t.getTotalLength(x.path)-s):(s=0,a=t.getTotalLength(x.path)-(r._.arrows.enddx*b||0)),r._.arrows[m+"Path"]&&v(y,{d:Raphael.getSubpath(x.path,s,a)}),delete r._.arrows[m+"Path"],delete r._.arrows[m+"Marker"],delete r._.arrows[m+"dx"],delete r._.arrows[m+"Type"],delete r._.arrows[m+"String"];for(h in g)if(g[e](h)&&!g[h]){var L=t._g.doc.getElementById(h);L&&L.parentNode.removeChild(L)}}},b={"":[0],none:[0],"-":[3,1],".":[1,1],"-.":[3,1,1,1],"-..":[3,1,1,1,1,1],". ":[1,3],"- ":[4,3],"--":[8,3],"- .":[4,3,1,3],"--.":[8,3,1,3],"--..":[8,3,1,3,1,3]},w=function(t,e,r){if(e=b[n(e).toLowerCase()]){for(var i=t.attrs["stroke-width"]||"1",o={round:i,square:i,butt:0}[t.attrs["stroke-linecap"]||r["stroke-linecap"]]||0,s=[],a=e.length;a--;)s[a]=e[a]*i+(a%2?1:-1)*o;v(t.node,{"stroke-dasharray":s.join(",")})}},_=function(r,o){var l=r.node,h=r.attrs,f=l.style.visibility;l.style.visibility="hidden";for(var d in o)if(o[e](d)){if(!t._availableAttrs[e](d))continue;var g=o[d];switch(h[d]=g,d){case"blur":r.blur(g);break;case"href":case"title":case"target":var b=l.parentNode;if("a"!=b.tagName.toLowerCase()){var _=v("a");b.insertBefore(_,l),_.appendChild(l),b=_}"target"==d?b.setAttributeNS(p,"show","blank"==g?"new":g):b.setAttributeNS(p,d,g);break;case"cursor":l.style.cursor=g;break;case"transform":r.transform(g);break;case"arrow-start":x(r,g);break;case"arrow-end":x(r,g,1);break;case"clip-rect":var k=n(g).split(u);if(4==k.length){r.clip&&r.clip.parentNode.parentNode.removeChild(r.clip.parentNode);var T=v("clipPath"),S=v("rect");T.id=t.createUUID(),v(S,{x:k[0],y:k[1],width:k[2],height:k[3]}),T.appendChild(S),r.paper.defs.appendChild(T),v(l,{"clip-path":"url(#"+T.id+")"}),r.clip=S}if(!g){var N=l.getAttribute("clip-path");if(N){var E=t._g.doc.getElementById(N.replace(/(^url\(#|\)$)/g,c));E&&E.parentNode.removeChild(E),v(l,{"clip-path":c}),delete r.clip}}break;case"path":"path"==r.type&&(v(l,{d:g?h.path=t._pathToAbsolute(g):"M0,0"}),r._.dirty=1,r._.arrows&&("startString"in r._.arrows&&x(r,r._.arrows.startString),"endString"in r._.arrows&&x(r,r._.arrows.endString,1)));break;case"width":if(l.setAttribute(d,g),r._.dirty=1,!h.fx)break;d="x",g=h.x;case"x":h.fx&&(g=-h.x-(h.width||0));case"rx":if("rx"==d&&"rect"==r.type)break;case"cx":l.setAttribute(d,g),r.pattern&&y(r),r._.dirty=1;break;case"height":if(l.setAttribute(d,g),r._.dirty=1,!h.fy)break;d="y",g=h.y;case"y":h.fy&&(g=-h.y-(h.height||0));case"ry":if("ry"==d&&"rect"==r.type)break;case"cy":l.setAttribute(d,g),r.pattern&&y(r),r._.dirty=1;break;case"r":"rect"==r.type?v(l,{rx:g,ry:g}):l.setAttribute(d,g),r._.dirty=1;break;case"src":"image"==r.type&&l.setAttributeNS(p,"href",g);break;case"stroke-width":(1!=r._.sx||1!=r._.sy)&&(g/=s(a(r._.sx),a(r._.sy))||1),r.paper._vbSize&&(g*=r.paper._vbSize),l.setAttribute(d,g),h["stroke-dasharray"]&&w(r,h["stroke-dasharray"],o),r._.arrows&&("startString"in r._.arrows&&x(r,r._.arrows.startString),"endString"in r._.arrows&&x(r,r._.arrows.endString,1));break;case"stroke-dasharray":w(r,g,o);break;case"fill":var A=n(g).match(t._ISURL);if(A){T=v("pattern");var B=v("image");T.id=t.createUUID(),v(T,{x:0,y:0,patternUnits:"userSpaceOnUse",height:1,width:1}),v(B,{x:0,y:0,"xlink:href":A[1]}),T.appendChild(B),function(e){t._preload(A[1],function(){var t=this.offsetWidth,n=this.offsetHeight;v(e,{width:t,height:n}),v(B,{width:t,height:n}),r.paper.safari()})}(T),r.paper.defs.appendChild(T),v(l,{fill:"url(#"+T.id+")"}),r.pattern=T,r.pattern&&y(r);break}var L=t.getRGB(g);if(L.error){if(("circle"==r.type||"ellipse"==r.type||"r"!=n(g).charAt())&&m(r,g)){if("opacity"in h||"fill-opacity"in h){var M=t._g.doc.getElementById(l.getAttribute("fill").replace(/^url\(#|\)$/g,c));if(M){var F=M.getElementsByTagName("stop");v(F[F.length-1],{"stop-opacity":("opacity"in h?h.opacity:1)*("fill-opacity"in h?h["fill-opacity"]:1)})}}h.gradient=g,h.fill="none";break}}else delete o.gradient,delete h.gradient,!t.is(h.opacity,"undefined")&&t.is(o.opacity,"undefined")&&v(l,{opacity:h.opacity}),!t.is(h["fill-opacity"],"undefined")&&t.is(o["fill-opacity"],"undefined")&&v(l,{"fill-opacity":h["fill-opacity"]});L[e]("opacity")&&v(l,{"fill-opacity":L.opacity>1?L.opacity/100:L.opacity});case"stroke":L=t.getRGB(g),l.setAttribute(d,L.hex),"stroke"==d&&L[e]("opacity")&&v(l,{"stroke-opacity":L.opacity>1?L.opacity/100:L.opacity}),"stroke"==d&&r._.arrows&&("startString"in r._.arrows&&x(r,r._.arrows.startString),"endString"in r._.arrows&&x(r,r._.arrows.endString,1));break;case"gradient":("circle"==r.type||"ellipse"==r.type||"r"!=n(g).charAt())&&m(r,g);break;case"opacity":h.gradient&&!h[e]("stroke-opacity")&&v(l,{"stroke-opacity":g>1?g/100:g});case"fill-opacity":if(h.gradient){M=t._g.doc.getElementById(l.getAttribute("fill").replace(/^url\(#|\)$/g,c)),M&&(F=M.getElementsByTagName("stop"),v(F[F.length-1],{"stop-opacity":g}));break}default:"font-size"==d&&(g=i(g,10)+"px");var j=d.replace(/(\-.)/g,function(t){return t.substring(1).toUpperCase()});l.style[j]=g,r._.dirty=1,l.setAttribute(d,g)}}C(r,o),l.style.visibility=f},k=1.2,C=function(r,o){if("text"==r.type&&(o[e]("text")||o[e]("font")||o[e]("font-size")||o[e]("x")||o[e]("y"))){var s=r.attrs,a=r.node,l=a.firstChild?i(t._g.doc.defaultView.getComputedStyle(a.firstChild,c).getPropertyValue("font-size"),10):10;if(o[e]("text")){for(s.text=o.text;a.firstChild;)a.removeChild(a.firstChild);for(var u,h=n(o.text).split("\n"),f=[],p=0,d=h.length;d>p;p++)u=v("tspan"),p&&v(u,{dy:l*k,x:s.x}),u.appendChild(t._g.doc.createTextNode(h[p])),a.appendChild(u),f[p]=u}else for(f=a.getElementsByTagName("tspan"),p=0,d=f.length;d>p;p++)p?v(f[p],{dy:l*k,x:s.x}):v(f[0],{dy:0});v(a,{x:s.x,y:s.y}),r._.dirty=1;var g=r._getBBox(),m=s.y-(g.y+g.height/2);m&&t.is(m,"finite")&&v(f[0],{dy:m})}},T=function(e,n){this[0]=this.node=e,e.raphael=!0,this.id=t._oid++,e.raphaelid=this.id,this.matrix=t.matrix(),this.realPath=null,this.paper=n,this.attrs=this.attrs||{},this._={transform:[],sx:1,sy:1,deg:0,dx:0,dy:0,dirty:1},!n.bottom&&(n.bottom=this),this.prev=n.top,n.top&&(n.top.next=this),n.top=this,this.next=null},S=t.el;T.prototype=S,S.constructor=T,t._engine.path=function(t,e){var n=v("path");e.canvas&&e.canvas.appendChild(n);var r=new T(n,e);return r.type="path",_(r,{fill:"none",stroke:"#000",path:t}),r},S.rotate=function(t,e,i){if(this.removed)return this;if(t=n(t).split(u),t.length-1&&(e=r(t[1]),i=r(t[2])),t=r(t[0]),null==i&&(e=i),null==e||null==i){var o=this.getBBox(1);e=o.x+o.width/2,i=o.y+o.height/2}return this.transform(this._.transform.concat([["r",t,e,i]])),this},S.scale=function(t,e,i,o){if(this.removed)return this;if(t=n(t).split(u),t.length-1&&(e=r(t[1]),i=r(t[2]),o=r(t[3])),t=r(t[0]),null==e&&(e=t),null==o&&(i=o),null==i||null==o)var s=this.getBBox(1);return i=null==i?s.x+s.width/2:i,o=null==o?s.y+s.height/2:o,this.transform(this._.transform.concat([["s",t,e,i,o]])),this},S.translate=function(t,e){return this.removed?this:(t=n(t).split(u),t.length-1&&(e=r(t[1])),t=r(t[0])||0,e=+e||0,this.transform(this._.transform.concat([["t",t,e]])),this)},S.transform=function(n){var r=this._;if(null==n)return r.transform;if(t._extractTransform(this,n),this.clip&&v(this.clip,{transform:this.matrix.invert()}),this.pattern&&y(this),this.node&&v(this.node,{transform:this.matrix}),1!=r.sx||1!=r.sy){var i=this.attrs[e]("stroke-width")?this.attrs["stroke-width"]:1;this.attr({"stroke-width":i})}return this},S.hide=function(){return!this.removed&&this.paper.safari(this.node.style.display="none"),this},S.show=function(){return!this.removed&&this.paper.safari(this.node.style.display=""),this},S.remove=function(){if(!this.removed&&this.node.parentNode){var e=this.paper;e.__set__&&e.__set__.exclude(this),h.unbind("raphael.*.*."+this.id),this.gradient&&e.defs.removeChild(this.gradient),t._tear(this,e),"a"==this.node.parentNode.tagName.toLowerCase()?this.node.parentNode.parentNode.removeChild(this.node.parentNode):this.node.parentNode.removeChild(this.node);for(var n in this)this[n]="function"==typeof this[n]?t._removedFactory(n):null;this.removed=!0}},S._getBBox=function(){if("none"==this.node.style.display){this.show();var t=!0}var e={};try{e=this.node.getBBox()}catch(n){}finally{e=e||{}}return t&&this.hide(),e},S.attr=function(n,r){if(this.removed)return this;if(null==n){var i={};for(var o in this.attrs)this.attrs[e](o)&&(i[o]=this.attrs[o]);return i.gradient&&"none"==i.fill&&(i.fill=i.gradient)&&delete i.gradient,i.transform=this._.transform,i}if(null==r&&t.is(n,"string")){if("fill"==n&&"none"==this.attrs.fill&&this.attrs.gradient)return this.attrs.gradient;if("transform"==n)return this._.transform;for(var s=n.split(u),a={},l=0,c=s.length;c>l;l++)n=s[l],a[n]=n in this.attrs?this.attrs[n]:t.is(this.paper.customAttributes[n],"function")?this.paper.customAttributes[n].def:t._availableAttrs[n];return c-1?a:a[s[0]]}if(null==r&&t.is(n,"array")){for(a={},l=0,c=n.length;c>l;l++)a[n[l]]=this.attr(n[l]);return a}if(null!=r){var f={};f[n]=r}else null!=n&&t.is(n,"object")&&(f=n);for(var p in f)h("raphael.attr."+p+"."+this.id,this,f[p]);for(p in this.paper.customAttributes)if(this.paper.customAttributes[e](p)&&f[e](p)&&t.is(this.paper.customAttributes[p],"function")){var d=this.paper.customAttributes[p].apply(this,[].concat(f[p]));this.attrs[p]=f[p];for(var g in d)d[e](g)&&(f[g]=d[g])}return _(this,f),this},S.toFront=function(){if(this.removed)return this;"a"==this.node.parentNode.tagName.toLowerCase()?this.node.parentNode.parentNode.appendChild(this.node.parentNode):this.node.parentNode.appendChild(this.node);var e=this.paper;return e.top!=this&&t._tofront(this,e),this},S.toBack=function(){if(this.removed)return this;var e=this.node.parentNode;return"a"==e.tagName.toLowerCase()?e.parentNode.insertBefore(this.node.parentNode,this.node.parentNode.parentNode.firstChild):e.firstChild!=this.node&&e.insertBefore(this.node,this.node.parentNode.firstChild),t._toback(this,this.paper),this.paper,this},S.insertAfter=function(e){if(this.removed)return this;var n=e.node||e[e.length-1].node;return n.nextSibling?n.parentNode.insertBefore(this.node,n.nextSibling):n.parentNode.appendChild(this.node),t._insertafter(this,e,this.paper),this},S.insertBefore=function(e){if(this.removed)return this;var n=e.node||e[0].node;return n.parentNode.insertBefore(this.node,n),t._insertbefore(this,e,this.paper),this},S.blur=function(e){var n=this;if(0!==+e){var r=v("filter"),i=v("feGaussianBlur");n.attrs.blur=e,r.id=t.createUUID(),v(i,{stdDeviation:+e||1.5}),r.appendChild(i),n.paper.defs.appendChild(r),n._blur=r,v(n.node,{filter:"url(#"+r.id+")"})}else n._blur&&(n._blur.parentNode.removeChild(n._blur),delete n._blur,delete n.attrs.blur),n.node.removeAttribute("filter")},t._engine.circle=function(t,e,n,r){var i=v("circle");t.canvas&&t.canvas.appendChild(i);var o=new T(i,t);return o.attrs={cx:e,cy:n,r:r,fill:"none",stroke:"#000"},o.type="circle",v(i,o.attrs),o},t._engine.rect=function(t,e,n,r,i,o){var s=v("rect");t.canvas&&t.canvas.appendChild(s);var a=new T(s,t);return a.attrs={x:e,y:n,width:r,height:i,r:o||0,rx:o||0,ry:o||0,fill:"none",stroke:"#000"},a.type="rect",v(s,a.attrs),a},t._engine.ellipse=function(t,e,n,r,i){var o=v("ellipse");t.canvas&&t.canvas.appendChild(o);var s=new T(o,t);return s.attrs={cx:e,cy:n,rx:r,ry:i,fill:"none",stroke:"#000"},s.type="ellipse",v(o,s.attrs),s},t._engine.image=function(t,e,n,r,i,o){var s=v("image");v(s,{x:n,y:r,width:i,height:o,preserveAspectRatio:"none"}),s.setAttributeNS(p,"href",e),t.canvas&&t.canvas.appendChild(s);var a=new T(s,t);return a.attrs={x:n,y:r,width:i,height:o,src:e},a.type="image",a},t._engine.text=function(e,n,r,i){var o=v("text");e.canvas&&e.canvas.appendChild(o);var s=new T(o,e);return s.attrs={x:n,y:r,"text-anchor":"middle",text:i,font:t._availableAttrs.font,stroke:"none",fill:"#000"},s.type="text",_(s,s.attrs),s},t._engine.setSize=function(t,e){return this.width=t||this.width,this.height=e||this.height,this.canvas.setAttribute("width",this.width),this.canvas.setAttribute("height",this.height),this._viewBox&&this.setViewBox.apply(this,this._viewBox),this},t._engine.create=function(){var e=t._getContainer.apply(0,arguments),n=e&&e.container,r=e.x,i=e.y,o=e.width,s=e.height;if(!n)throw Error("SVG container not found.");var a,l=v("svg"),u="overflow:hidden;";return r=r||0,i=i||0,o=o||512,s=s||342,v(l,{height:s,version:1.1,width:o,xmlns:"http://www.w3.org/2000/svg"}),1==n?(l.style.cssText=u+"position:absolute;left:"+r+"px;top:"+i+"px",t._g.doc.body.appendChild(l),a=1):(l.style.cssText=u+"position:relative",n.firstChild?n.insertBefore(l,n.firstChild):n.appendChild(l)),n=new t._Paper,n.width=o,n.height=s,n.canvas=l,n.clear(),n._left=n._top=0,a&&(n.renderfix=function(){}),n.renderfix(),n},t._engine.setViewBox=function(t,e,n,r,i){h("raphael.setViewBox",this,this._viewBox,[t,e,n,r,i]);var o,a,l=s(n/this.width,r/this.height),u=this.top,c=i?"meet":"xMinYMin";for(null==t?(this._vbSize&&(l=1),delete this._vbSize,o="0 0 "+this.width+f+this.height):(this._vbSize=l,o=t+f+e+f+n+f+r),v(this.canvas,{viewBox:o,preserveAspectRatio:c});l&&u;)a="stroke-width"in u.attrs?u.attrs["stroke-width"]:1,u.attr({"stroke-width":a}),u._.dirty=1,u._.dirtyT=1,u=u.prev;return this._viewBox=[t,e,n,r,!!i],this},t.prototype.renderfix=function(){var t,e=this.canvas,n=e.style;try{t=e.getScreenCTM()||e.createSVGMatrix()}catch(r){t=e.createSVGMatrix()}var i=-t.e%1,o=-t.f%1;(i||o)&&(i&&(this._left=(this._left+i)%1,n.left=this._left+"px"),o&&(this._top=(this._top+o)%1,n.top=this._top+"px"))},t.prototype.clear=function(){t.eve("raphael.clear",this);for(var e=this.canvas;e.firstChild;)e.removeChild(e.firstChild);this.bottom=this.top=null,(this.desc=v("desc")).appendChild(t._g.doc.createTextNode("Created with Raphaël "+t.version)),e.appendChild(this.desc),e.appendChild(this.defs=v("defs"))},t.prototype.remove=function(){h("raphael.remove",this),this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas);for(var e in this)this[e]="function"==typeof this[e]?t._removedFactory(e):null};var N=t.st;for(var E in S)S[e](E)&&!N[e](E)&&(N[E]=function(t){return function(){var e=arguments;return this.forEach(function(n){n[t].apply(n,e)})}}(E))}(window.Raphael),window.Raphael.vml&&function(t){var e="hasOwnProperty",n=String,r=parseFloat,i=Math,o=i.round,s=i.max,a=i.min,l=i.abs,u="fill",h=/[, ]+/,c=t.eve,f=" progid:DXImageTransform.Microsoft",p=" ",d="",g={M:"m",L:"l",C:"c",Z:"x",m:"t",l:"r",c:"v",z:"x"},v=/([clmz]),?([^clmz]*)/gi,m=/ progid:\S+Blur\([^\)]+\)/g,y=/-?[^,\s-]+/g,x="position:absolute;left:0;top:0;width:1px;height:1px",b=21600,w={path:1,rect:1,image:1},_={circle:1,ellipse:1},k=function(e){var r=/[ahqstv]/gi,i=t._pathToAbsolute;if(n(e).match(r)&&(i=t._path2curve),r=/[clmz]/g,i==t._pathToAbsolute&&!n(e).match(r)){var s=n(e).replace(v,function(t,e,n){var r=[],i="m"==e.toLowerCase(),s=g[e];return n.replace(y,function(t){i&&2==r.length&&(s+=r+g["m"==e?"l":"L"],r=[]),r.push(o(t*b))}),s+r});return s}var a,l,u=i(e);s=[];for(var h=0,c=u.length;c>h;h++){a=u[h],l=u[h][0].toLowerCase(),"z"==l&&(l="x");for(var f=1,m=a.length;m>f;f++)l+=o(a[f]*b)+(f!=m-1?",":d);s.push(l)}return s.join(p)},C=function(e,n,r){var i=t.matrix();return i.rotate(-e,.5,.5),{dx:i.x(n,r),dy:i.y(n,r)}},T=function(t,e,n,r,i,o){var s=t._,a=t.matrix,h=s.fillpos,c=t.node,f=c.style,d=1,g="",v=b/e,m=b/n;if(f.visibility="hidden",e&&n){if(c.coordsize=l(v)+p+l(m),f.rotation=o*(0>e*n?-1:1),o){var y=C(o,r,i);r=y.dx,i=y.dy}if(0>e&&(g+="x"),0>n&&(g+=" y")&&(d=-1),f.flip=g,c.coordorigin=r*-v+p+i*-m,h||s.fillsize){var x=c.getElementsByTagName(u);x=x&&x[0],c.removeChild(x),h&&(y=C(o,a.x(h[0],h[1]),a.y(h[0],h[1])),x.position=y.dx*d+p+y.dy*d),s.fillsize&&(x.size=s.fillsize[0]*l(e)+p+s.fillsize[1]*l(n)),c.appendChild(x)}f.visibility="visible"}};t.toString=function(){return"Your browser doesn’t support SVG. Falling down to VML.\nYou are running Raphaël "+this.version};var S=function(t,e,r){for(var i=n(e).toLowerCase().split("-"),o=r?"end":"start",s=i.length,a="classic",l="medium",u="medium";s--;)switch(i[s]){case"block":case"classic":case"oval":case"diamond":case"open":case"none":a=i[s];break;case"wide":case"narrow":u=i[s];break;case"long":case"short":l=i[s]}var h=t.node.getElementsByTagName("stroke")[0];h[o+"arrow"]=a,h[o+"arrowlength"]=l,h[o+"arrowwidth"]=u},N=function(i,l){i.attrs=i.attrs||{};var c=i.node,f=i.attrs,g=c.style,v=w[i.type]&&(l.x!=f.x||l.y!=f.y||l.width!=f.width||l.height!=f.height||l.cx!=f.cx||l.cy!=f.cy||l.rx!=f.rx||l.ry!=f.ry||l.r!=f.r),m=_[i.type]&&(f.cx!=l.cx||f.cy!=l.cy||f.r!=l.r||f.rx!=l.rx||f.ry!=l.ry),y=i;for(var x in l)l[e](x)&&(f[x]=l[x]);if(v&&(f.path=t._getPath[i.type](i),i._.dirty=1),l.href&&(c.href=l.href),l.title&&(c.title=l.title),l.target&&(c.target=l.target),l.cursor&&(g.cursor=l.cursor),"blur"in l&&i.blur(l.blur),(l.path&&"path"==i.type||v)&&(c.path=k(~n(f.path).toLowerCase().indexOf("r")?t._pathToAbsolute(f.path):f.path),"image"==i.type&&(i._.fillpos=[f.x,f.y],i._.fillsize=[f.width,f.height],T(i,1,1,0,0,0))),"transform"in l&&i.transform(l.transform),m){var C=+f.cx,N=+f.cy,A=+f.rx||+f.r||0,B=+f.ry||+f.r||0;c.path=t.format("ar{0},{1},{2},{3},{4},{1},{4},{1}x",o((C-A)*b),o((N-B)*b),o((C+A)*b),o((N+B)*b),o(C*b))}if("clip-rect"in l){var M=n(l["clip-rect"]).split(h);if(4==M.length){M[2]=+M[2]+ +M[0],M[3]=+M[3]+ +M[1];var F=c.clipRect||t._g.doc.createElement("div"),j=F.style;j.clip=t.format("rect({1}px {2}px {3}px {0}px)",M),c.clipRect||(j.position="absolute",j.top=0,j.left=0,j.width=i.paper.width+"px",j.height=i.paper.height+"px",c.parentNode.insertBefore(F,c),F.appendChild(c),c.clipRect=F)}l["clip-rect"]||c.clipRect&&(c.clipRect.style.clip="auto")}if(i.textpath){var H=i.textpath.style;l.font&&(H.font=l.font),l["font-family"]&&(H.fontFamily='"'+l["font-family"].split(",")[0].replace(/^['"]+|['"]+$/g,d)+'"'),l["font-size"]&&(H.fontSize=l["font-size"]),l["font-weight"]&&(H.fontWeight=l["font-weight"]),l["font-style"]&&(H.fontStyle=l["font-style"])}if("arrow-start"in l&&S(y,l["arrow-start"]),"arrow-end"in l&&S(y,l["arrow-end"],1),null!=l.opacity||null!=l["stroke-width"]||null!=l.fill||null!=l.src||null!=l.stroke||null!=l["stroke-width"]||null!=l["stroke-opacity"]||null!=l["fill-opacity"]||null!=l["stroke-dasharray"]||null!=l["stroke-miterlimit"]||null!=l["stroke-linejoin"]||null!=l["stroke-linecap"]){var D=c.getElementsByTagName(u),P=!1;if(D=D&&D[0],!D&&(P=D=L(u)),"image"==i.type&&l.src&&(D.src=l.src),l.fill&&(D.on=!0),(null==D.on||"none"==l.fill||null===l.fill)&&(D.on=!1),D.on&&l.fill){var I=n(l.fill).match(t._ISURL);if(I){D.parentNode==c&&c.removeChild(D),D.rotate=!0,D.src=I[1],D.type="tile";var O=i.getBBox(1);D.position=O.x+p+O.y,i._.fillpos=[O.x,O.y],t._preload(I[1],function(){i._.fillsize=[this.offsetWidth,this.offsetHeight]})}else D.color=t.getRGB(l.fill).hex,D.src=d,D.type="solid",t.getRGB(l.fill).error&&(y.type in{circle:1,ellipse:1}||"r"!=n(l.fill).charAt())&&E(y,l.fill,D)&&(f.fill="none",f.gradient=l.fill,D.rotate=!1)}if("fill-opacity"in l||"opacity"in l){var z=((+f["fill-opacity"]+1||2)-1)*((+f.opacity+1||2)-1)*((+t.getRGB(l.fill).o+1||2)-1);z=a(s(z,0),1),D.opacity=z,D.src&&(D.color="none")}c.appendChild(D);var R=c.getElementsByTagName("stroke")&&c.getElementsByTagName("stroke")[0],q=!1;!R&&(q=R=L("stroke")),(l.stroke&&"none"!=l.stroke||l["stroke-width"]||null!=l["stroke-opacity"]||l["stroke-dasharray"]||l["stroke-miterlimit"]||l["stroke-linejoin"]||l["stroke-linecap"])&&(R.on=!0),("none"==l.stroke||null===l.stroke||null==R.on||0==l.stroke||0==l["stroke-width"])&&(R.on=!1);var W=t.getRGB(l.stroke);R.on&&l.stroke&&(R.color=W.hex),z=((+f["stroke-opacity"]+1||2)-1)*((+f.opacity+1||2)-1)*((+W.o+1||2)-1);var $=.75*(r(l["stroke-width"])||1);if(z=a(s(z,0),1),null==l["stroke-width"]&&($=f["stroke-width"]),l["stroke-width"]&&(R.weight=$),$&&1>$&&(z*=$)&&(R.weight=1),R.opacity=z,l["stroke-linejoin"]&&(R.joinstyle=l["stroke-linejoin"]||"miter"),R.miterlimit=l["stroke-miterlimit"]||8,l["stroke-linecap"]&&(R.endcap="butt"==l["stroke-linecap"]?"flat":"square"==l["stroke-linecap"]?"square":"round"),l["stroke-dasharray"]){var X={"-":"shortdash",".":"shortdot","-.":"shortdashdot","-..":"shortdashdotdot",". ":"dot","- ":"dash","--":"longdash","- .":"dashdot","--.":"longdashdot","--..":"longdashdotdot"};R.dashstyle=X[e](l["stroke-dasharray"])?X[l["stroke-dasharray"]]:d}q&&c.appendChild(R)}if("text"==y.type){y.paper.canvas.style.display=d;var Y=y.paper.span,V=100,G=f.font&&f.font.match(/\d+(?:\.\d*)?(?=px)/);g=Y.style,f.font&&(g.font=f.font),f["font-family"]&&(g.fontFamily=f["font-family"]),f["font-weight"]&&(g.fontWeight=f["font-weight"]),f["font-style"]&&(g.fontStyle=f["font-style"]),G=r(f["font-size"]||G&&G[0])||10,g.fontSize=G*V+"px",y.textpath.string&&(Y.innerHTML=n(y.textpath.string).replace(/"));var U=Y.getBoundingClientRect();y.W=f.w=(U.right-U.left)/V,y.H=f.h=(U.bottom-U.top)/V,y.X=f.x,y.Y=f.y+y.H/2,("x"in l||"y"in l)&&(y.path.v=t.format("m{0},{1}l{2},{1}",o(f.x*b),o(f.y*b),o(f.x*b)+1));for(var Q=["x","y","text","font","font-family","font-weight","font-style","font-size"],Z=0,J=Q.length;J>Z;Z++)if(Q[Z]in l){y._.dirty=1;break}switch(f["text-anchor"]){case"start":y.textpath.style["v-text-align"]="left",y.bbx=y.W/2;break;case"end":y.textpath.style["v-text-align"]="right",y.bbx=-y.W/2;break;default:y.textpath.style["v-text-align"]="center",y.bbx=0}y.textpath.style["v-text-kern"]=!0}},E=function(e,o,s){e.attrs=e.attrs||{};var a=(e.attrs,Math.pow),l="linear",u=".5 .5";if(e.attrs.gradient=o,o=n(o).replace(t._radial_gradient,function(t,e,n){return l="radial",e&&n&&(e=r(e),n=r(n),a(e-.5,2)+a(n-.5,2)>.25&&(n=i.sqrt(.25-a(e-.5,2))*(2*(n>.5)-1)+.5),u=e+p+n),d}),o=o.split(/\s*\-\s*/),"linear"==l){var h=o.shift();if(h=-r(h),isNaN(h))return null}var c=t._parseDots(o);if(!c)return null;if(e=e.shape||e.node,c.length){e.removeChild(s),s.on=!0,s.method="none",s.color=c[0].color,s.color2=c[c.length-1].color;for(var f=[],g=0,v=c.length;v>g;g++)c[g].offset&&f.push(c[g].offset+p+c[g].color);s.colors=f.length?f.join():"0% "+s.color,"radial"==l?(s.type="gradientTitle",s.focus="100%",s.focussize="0 0",s.focusposition=u,s.angle=0):(s.type="gradient",s.angle=(270-h)%360),e.appendChild(s)}return 1},A=function(e,n){this[0]=this.node=e,e.raphael=!0,this.id=t._oid++,e.raphaelid=this.id,this.X=0,this.Y=0,this.attrs={},this.paper=n,this.matrix=t.matrix(),this._={transform:[],sx:1,sy:1,dx:0,dy:0,deg:0,dirty:1,dirtyT:1},!n.bottom&&(n.bottom=this),this.prev=n.top,n.top&&(n.top.next=this),n.top=this,this.next=null},B=t.el;A.prototype=B,B.constructor=A,B.transform=function(e){if(null==e)return this._.transform;var r,i=this.paper._viewBoxShift,o=i?"s"+[i.scale,i.scale]+"-1-1t"+[i.dx,i.dy]:d;i&&(r=e=n(e).replace(/\.{3}|\u2026/g,this._.transform||d)),t._extractTransform(this,o+e);var s,a=this.matrix.clone(),l=this.skew,u=this.node,h=~n(this.attrs.fill).indexOf("-"),c=!n(this.attrs.fill).indexOf("url(");if(a.translate(-.5,-.5),c||h||"image"==this.type)if(l.matrix="1 0 0 1",l.offset="0 0",s=a.split(),h&&s.noRotation||!s.isSimple){u.style.filter=a.toFilter();var f=this.getBBox(),g=this.getBBox(1),v=f.x-g.x,m=f.y-g.y;u.coordorigin=v*-b+p+m*-b,T(this,1,1,v,m,0)}else u.style.filter=d,T(this,s.scalex,s.scaley,s.dx,s.dy,s.rotate);else u.style.filter=d,l.matrix=n(a),l.offset=a.offset();return r&&(this._.transform=r),this},B.rotate=function(t,e,i){if(this.removed)return this;if(null!=t){if(t=n(t).split(h),t.length-1&&(e=r(t[1]),i=r(t[2])),t=r(t[0]),null==i&&(e=i),null==e||null==i){var o=this.getBBox(1);e=o.x+o.width/2,i=o.y+o.height/2}return this._.dirtyT=1,this.transform(this._.transform.concat([["r",t,e,i]])),this}},B.translate=function(t,e){return this.removed?this:(t=n(t).split(h),t.length-1&&(e=r(t[1])),t=r(t[0])||0,e=+e||0,this._.bbox&&(this._.bbox.x+=t,this._.bbox.y+=e),this.transform(this._.transform.concat([["t",t,e]])),this)},B.scale=function(t,e,i,o){if(this.removed)return this;if(t=n(t).split(h),t.length-1&&(e=r(t[1]),i=r(t[2]),o=r(t[3]),isNaN(i)&&(i=null),isNaN(o)&&(o=null)),t=r(t[0]),null==e&&(e=t),null==o&&(i=o),null==i||null==o)var s=this.getBBox(1); +return i=null==i?s.x+s.width/2:i,o=null==o?s.y+s.height/2:o,this.transform(this._.transform.concat([["s",t,e,i,o]])),this._.dirtyT=1,this},B.hide=function(){return!this.removed&&(this.node.style.display="none"),this},B.show=function(){return!this.removed&&(this.node.style.display=d),this},B._getBBox=function(){return this.removed?{}:{x:this.X+(this.bbx||0)-this.W/2,y:this.Y-this.H,width:this.W,height:this.H}},B.remove=function(){if(!this.removed&&this.node.parentNode){this.paper.__set__&&this.paper.__set__.exclude(this),t.eve.unbind("raphael.*.*."+this.id),t._tear(this,this.paper),this.node.parentNode.removeChild(this.node),this.shape&&this.shape.parentNode.removeChild(this.shape);for(var e in this)this[e]="function"==typeof this[e]?t._removedFactory(e):null;this.removed=!0}},B.attr=function(n,r){if(this.removed)return this;if(null==n){var i={};for(var o in this.attrs)this.attrs[e](o)&&(i[o]=this.attrs[o]);return i.gradient&&"none"==i.fill&&(i.fill=i.gradient)&&delete i.gradient,i.transform=this._.transform,i}if(null==r&&t.is(n,"string")){if(n==u&&"none"==this.attrs.fill&&this.attrs.gradient)return this.attrs.gradient;for(var s=n.split(h),a={},l=0,f=s.length;f>l;l++)n=s[l],a[n]=n in this.attrs?this.attrs[n]:t.is(this.paper.customAttributes[n],"function")?this.paper.customAttributes[n].def:t._availableAttrs[n];return f-1?a:a[s[0]]}if(this.attrs&&null==r&&t.is(n,"array")){for(a={},l=0,f=n.length;f>l;l++)a[n[l]]=this.attr(n[l]);return a}var p;null!=r&&(p={},p[n]=r),null==r&&t.is(n,"object")&&(p=n);for(var d in p)c("raphael.attr."+d+"."+this.id,this,p[d]);if(p){for(d in this.paper.customAttributes)if(this.paper.customAttributes[e](d)&&p[e](d)&&t.is(this.paper.customAttributes[d],"function")){var g=this.paper.customAttributes[d].apply(this,[].concat(p[d]));this.attrs[d]=p[d];for(var v in g)g[e](v)&&(p[v]=g[v])}p.text&&"text"==this.type&&(this.textpath.string=p.text),N(this,p)}return this},B.toFront=function(){return!this.removed&&this.node.parentNode.appendChild(this.node),this.paper&&this.paper.top!=this&&t._tofront(this,this.paper),this},B.toBack=function(){return this.removed?this:(this.node.parentNode.firstChild!=this.node&&(this.node.parentNode.insertBefore(this.node,this.node.parentNode.firstChild),t._toback(this,this.paper)),this)},B.insertAfter=function(e){return this.removed?this:(e.constructor==t.st.constructor&&(e=e[e.length-1]),e.node.nextSibling?e.node.parentNode.insertBefore(this.node,e.node.nextSibling):e.node.parentNode.appendChild(this.node),t._insertafter(this,e,this.paper),this)},B.insertBefore=function(e){return this.removed?this:(e.constructor==t.st.constructor&&(e=e[0]),e.node.parentNode.insertBefore(this.node,e.node),t._insertbefore(this,e,this.paper),this)},B.blur=function(e){var n=this.node.runtimeStyle,r=n.filter;r=r.replace(m,d),0!==+e?(this.attrs.blur=e,n.filter=r+p+f+".Blur(pixelradius="+(+e||1.5)+")",n.margin=t.format("-{0}px 0 0 -{0}px",o(+e||1.5))):(n.filter=r,n.margin=0,delete this.attrs.blur)},t._engine.path=function(t,e){var n=L("shape");n.style.cssText=x,n.coordsize=b+p+b,n.coordorigin=e.coordorigin;var r=new A(n,e),i={fill:"none",stroke:"#000"};t&&(i.path=t),r.type="path",r.path=[],r.Path=d,N(r,i),e.canvas.appendChild(n);var o=L("skew");return o.on=!0,n.appendChild(o),r.skew=o,r.transform(d),r},t._engine.rect=function(e,n,r,i,o,s){var a=t._rectPath(n,r,i,o,s),l=e.path(a),u=l.attrs;return l.X=u.x=n,l.Y=u.y=r,l.W=u.width=i,l.H=u.height=o,u.r=s,u.path=a,l.type="rect",l},t._engine.ellipse=function(t,e,n,r,i){var o=t.path();return o.attrs,o.X=e-r,o.Y=n-i,o.W=2*r,o.H=2*i,o.type="ellipse",N(o,{cx:e,cy:n,rx:r,ry:i}),o},t._engine.circle=function(t,e,n,r){var i=t.path();return i.attrs,i.X=e-r,i.Y=n-r,i.W=i.H=2*r,i.type="circle",N(i,{cx:e,cy:n,r:r}),i},t._engine.image=function(e,n,r,i,o,s){var a=t._rectPath(r,i,o,s),l=e.path(a).attr({stroke:"none"}),h=l.attrs,c=l.node,f=c.getElementsByTagName(u)[0];return h.src=n,l.X=h.x=r,l.Y=h.y=i,l.W=h.width=o,l.H=h.height=s,h.path=a,l.type="image",f.parentNode==c&&c.removeChild(f),f.rotate=!0,f.src=n,f.type="tile",l._.fillpos=[r,i],l._.fillsize=[o,s],c.appendChild(f),T(l,1,1,0,0,0),l},t._engine.text=function(e,r,i,s){var a=L("shape"),l=L("path"),u=L("textpath");r=r||0,i=i||0,s=s||"",l.v=t.format("m{0},{1}l{2},{1}",o(r*b),o(i*b),o(r*b)+1),l.textpathok=!0,u.string=n(s),u.on=!0,a.style.cssText=x,a.coordsize=b+p+b,a.coordorigin="0 0";var h=new A(a,e),c={fill:"#000",stroke:"none",font:t._availableAttrs.font,text:s};h.shape=a,h.path=l,h.textpath=u,h.type="text",h.attrs.text=n(s),h.attrs.x=r,h.attrs.y=i,h.attrs.w=1,h.attrs.h=1,N(h,c),a.appendChild(u),a.appendChild(l),e.canvas.appendChild(a);var f=L("skew");return f.on=!0,a.appendChild(f),h.skew=f,h.transform(d),h},t._engine.setSize=function(e,n){var r=this.canvas.style;return this.width=e,this.height=n,e==+e&&(e+="px"),n==+n&&(n+="px"),r.width=e,r.height=n,r.clip="rect(0 "+e+" "+n+" 0)",this._viewBox&&t._engine.setViewBox.apply(this,this._viewBox),this},t._engine.setViewBox=function(e,n,r,i,o){t.eve("raphael.setViewBox",this,this._viewBox,[e,n,r,i,o]);var a,l,u=this.width,h=this.height,c=1/s(r/u,i/h);return o&&(a=h/i,l=u/r,u>r*a&&(e-=(u-r*a)/2/a),h>i*l&&(n-=(h-i*l)/2/l)),this._viewBox=[e,n,r,i,!!o],this._viewBoxShift={dx:-e,dy:-n,scale:c},this.forEach(function(t){t.transform("...")}),this};var L;t._engine.initWin=function(t){var e=t.document;e.createStyleSheet().addRule(".rvml","behavior:url(#default#VML)");try{!e.namespaces.rvml&&e.namespaces.add("rvml","urn:schemas-microsoft-com:vml"),L=function(t){return e.createElement("')}}catch(n){L=function(t){return e.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="rvml">')}}},t._engine.initWin(t._g.win),t._engine.create=function(){var e=t._getContainer.apply(0,arguments),n=e.container,r=e.height,i=e.width,o=e.x,s=e.y;if(!n)throw Error("VML container not found.");var a=new t._Paper,l=a.canvas=t._g.doc.createElement("div"),u=l.style;return o=o||0,s=s||0,i=i||512,r=r||342,a.width=i,a.height=r,i==+i&&(i+="px"),r==+r&&(r+="px"),a.coordsize=1e3*b+p+1e3*b,a.coordorigin="0 0",a.span=t._g.doc.createElement("span"),a.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;",l.appendChild(a.span),u.cssText=t.format("top:0;left:0;width:{0};height:{1};display:inline-block;position:relative;clip:rect(0 {0} {1} 0);overflow:hidden",i,r),1==n?(t._g.doc.body.appendChild(l),u.left=o+"px",u.top=s+"px",u.position="absolute"):n.firstChild?n.insertBefore(l,n.firstChild):n.appendChild(l),a.renderfix=function(){},a},t.prototype.clear=function(){t.eve("raphael.clear",this),this.canvas.innerHTML=d,this.span=t._g.doc.createElement("span"),this.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;display:inline;",this.canvas.appendChild(this.span),this.bottom=this.top=null},t.prototype.remove=function(){t.eve("raphael.remove",this),this.canvas.parentNode.removeChild(this.canvas);for(var e in this)this[e]="function"==typeof this[e]?t._removedFactory(e):null;return!0};var M=t.st;for(var F in B)B[e](F)&&!M[e](F)&&(M[F]=function(t){return function(){var e=arguments;return this.forEach(function(n){n[t].apply(n,e)})}}(F))}(window.Raphael),function(){var t,e,n,r,i=[].slice,o={}.hasOwnProperty,s=function(t,e){function n(){this.constructor=t}for(var r in e)o.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},a=function(t,e){return function(){return t.apply(e,arguments)}},l=[].indexOf||function(t){for(var e=0,n=this.length;n>e;e++)if(e in this&&this[e]===t)return e;return-1};e=window.Morris={},t=jQuery,e.EventEmitter=function(){function t(){}return t.prototype.on=function(t,e){return null==this.handlers&&(this.handlers={}),null==this.handlers[t]&&(this.handlers[t]=[]),this.handlers[t].push(e)},t.prototype.fire=function(){var t,e,n,r,o,s,a;if(n=arguments[0],t=arguments.length>=2?i.call(arguments,1):[],null!=this.handlers&&null!=this.handlers[n]){for(s=this.handlers[n],a=[],r=0,o=s.length;o>r;r++)e=s[r],a.push(e.apply(null,t));return a}},t}(),e.commas=function(t){var e,n,r,i;return null!=t?(r=0>t?"-":"",e=Math.abs(t),n=Math.floor(e).toFixed(0),r+=n.replace(/(?=(?:\d{3})+$)(?!^)/g,","),i=""+e,i.length>n.length&&(r+=i.slice(n.length)),r):"-"},e.pad2=function(t){return(10>t?"0":"")+t},e.Grid=function(n){function r(e){if(this.el="string"==typeof e.element?t(document.getElementById(e.element)):t(e.element),null==this.el||0===this.el.length)throw Error("Graph container element not found");this.options=t.extend({},this.gridDefaults,this.defaults||{},e),void 0!==this.options.data&&0!==this.options.data.length&&("string"==typeof this.options.units&&(this.options.postUnits=e.units),this.r=new Raphael(this.el[0]),this.elementWidth=null,this.elementHeight=null,this.dirty=!1,this.init&&this.init(),this.setData(this.options.data))}return s(r,n),r.prototype.gridDefaults={dateFormat:null,gridLineColor:"#aaa",gridStrokeWidth:.5,gridTextColor:"#888",gridTextSize:12,numLines:5,padding:25,parseTime:!0,postUnits:"",preUnits:"",ymax:"auto",ymin:"auto 0",goals:[],goalStrokeWidth:1,goalLineColors:["#666633","#999966","#cc6666","#663333"],events:[],eventStrokeWidth:1,eventLineColors:["#005a04","#ccffbb","#3a5f0b","#005502"]},r.prototype.setData=function(t,n){var r,i,o,s,a,l,u,h,c,f,p,d;return null==n&&(n=!0),f=this.cumulative?0:null,p=this.cumulative?0:null,this.options.goals.length>0&&(a=Math.min.apply(null,this.options.goals),s=Math.max.apply(null,this.options.goals),p=null!=p?Math.min(p,a):a,f=null!=f?Math.max(f,s):s),this.data=function(){var n,r,s;for(s=[],o=n=0,r=t.length;r>n;o=++n)u=t[o],l={},l.label=u[this.options.xkey],this.options.parseTime?(l.x=e.parseDate(l.label),this.options.dateFormat?l.label=this.options.dateFormat(l.x):"number"==typeof l.label&&(l.label=""+new Date(l.label))):l.x=o,h=0,l.y=function(){var t,e,n,r;for(n=this.options.ykeys,r=[],i=t=0,e=n.length;e>t;i=++t)c=n[i],d=u[c],"string"==typeof d&&(d=parseFloat(d)),null!=d&&"number"!=typeof d&&(d=null),null!=d&&(this.cumulative?h+=d:null!=f?(f=Math.max(d,f),p=Math.min(d,p)):f=p=d),this.cumulative&&null!=h&&(f=Math.max(h,f),p=Math.min(h,p)),r.push(d);return r}.call(this),s.push(l);return s}.call(this),this.options.parseTime&&(this.data=this.data.sort(function(t,e){return(t.x>e.x)-(e.x>t.x)})),this.xmin=this.data[0].x,this.xmax=this.data[this.data.length-1].x,this.events=[],this.options.parseTime&&this.options.events.length>0&&(this.events=function(){var t,n,i,o;for(i=this.options.events,o=[],t=0,n=i.length;n>t;t++)r=i[t],o.push(e.parseDate(r));return o}.call(this),this.xmax=Math.max(this.xmax,Math.max.apply(null,this.events)),this.xmin=Math.min(this.xmin,Math.min.apply(null,this.events))),this.xmin===this.xmax&&(this.xmin-=1,this.xmax+=1),"string"==typeof this.options.ymax?"auto"===this.options.ymax.slice(0,4)?this.options.ymax.length>5?(this.ymax=parseInt(this.options.ymax.slice(5),10),null!=f&&(this.ymax=Math.max(f,this.ymax))):this.ymax=null!=f?f:0:this.ymax=parseInt(this.options.ymax,10):this.ymax=this.options.ymax,"string"==typeof this.options.ymin?"auto"===this.options.ymin.slice(0,4)?this.options.ymin.length>5?(this.ymin=parseInt(this.options.ymin.slice(5),10),null!=p&&(this.ymin=Math.min(p,this.ymin))):this.ymin=null!==p?p:0:this.ymin=parseInt(this.options.ymin,10):this.ymin=this.options.ymin,this.ymin===this.ymax&&(p&&(this.ymin-=1),this.ymax+=1),this.yInterval=(this.ymax-this.ymin)/(this.options.numLines-1),this.precision=this.yInterval>0&&1>this.yInterval?-Math.floor(Math.log(this.yInterval)/Math.log(10)):0,this.dirty=!0,n?this.redraw():void 0},r.prototype._calc=function(){var t,e,n;return n=this.el.width(),t=this.el.height(),(this.elementWidth!==n||this.elementHeight!==t||this.dirty)&&(this.elementWidth=n,this.elementHeight=t,this.dirty=!1,e=Math.max(this.measureText(this.yAxisFormat(this.ymin),this.options.gridTextSize).width,this.measureText(this.yAxisFormat(this.ymax),this.options.gridTextSize).width),this.left=e+this.options.padding,this.right=this.elementWidth-this.options.padding,this.top=this.options.padding,this.bottom=this.elementHeight-this.options.padding-1.5*this.options.gridTextSize,this.width=this.right-this.left,this.height=this.bottom-this.top,this.dx=this.width/(this.xmax-this.xmin),this.dy=this.height/(this.ymax-this.ymin),this.calc)?this.calc():void 0},r.prototype.transY=function(t){return this.bottom-(t-this.ymin)*this.dy},r.prototype.transX=function(t){return 1===this.data.length?(this.left+this.right)/2:this.left+(t-this.xmin)*this.dx},r.prototype.redraw=function(){return this.r.clear(),this._calc(),this.drawGrid(),this.drawGoals(),this.drawEvents(),this.draw?this.draw():void 0},r.prototype.drawGoals=function(){var t,e,n,r,i,o;for(i=this.options.goals,o=[],e=n=0,r=i.length;r>n;e=++n)t=i[e],o.push(this.r.path("M"+this.left+","+this.transY(t)+"H"+(this.left+this.width)).attr("stroke",this.options.goalLineColors[e%this.options.goalLineColors.length]).attr("stroke-width",this.options.goalStrokeWidth));return o},r.prototype.drawEvents=function(){var t,e,n,r,i,o;for(i=this.events,o=[],e=n=0,r=i.length;r>n;e=++n)t=i[e],o.push(this.r.path("M"+this.transX(t)+","+this.bottom+"V"+this.top).attr("stroke",this.options.eventLineColors[e%this.options.eventLineColors.length]).attr("stroke-width",this.options.eventStrokeWidth));return o},r.prototype.drawGrid=function(){var t,e,n,r,i,o,s,a;for(t=this.ymin,e=this.ymax,a=[],n=o=t,s=this.yInterval;e>=t?e>=o:o>=e;n=o+=s)r=parseFloat(n.toFixed(this.precision)),i=this.transY(r),this.r.text(this.left-this.options.padding/2,i,this.yAxisFormat(r)).attr("font-size",this.options.gridTextSize).attr("fill",this.options.gridTextColor).attr("text-anchor","end"),a.push(this.r.path("M"+this.left+","+i+"H"+(this.left+this.width)).attr("stroke",this.options.gridLineColor).attr("stroke-width",this.options.gridStrokeWidth));return a},r.prototype.measureText=function(t,e){var n,r;return null==e&&(e=12),r=this.r.text(100,100,t).attr("font-size",e),n=r.getBBox(),r.remove(),n},r.prototype.yAxisFormat=function(t){return this.yLabelFormat(t)},r.prototype.yLabelFormat=function(t){return""+this.options.preUnits+e.commas(t)+this.options.postUnits},r}(e.EventEmitter),e.parseDate=function(t){var e,n,r,i,o,s,a,l,u,h,c;return"number"==typeof t?t:(n=t.match(/^(\d+) Q(\d)$/),i=t.match(/^(\d+)-(\d+)$/),o=t.match(/^(\d+)-(\d+)-(\d+)$/),a=t.match(/^(\d+) W(\d+)$/),l=t.match(/^(\d+)-(\d+)-(\d+)[ T](\d+):(\d+)(Z|([+-])(\d\d):?(\d\d))?$/),u=t.match(/^(\d+)-(\d+)-(\d+)[ T](\d+):(\d+):(\d+(\.\d+)?)(Z|([+-])(\d\d):?(\d\d))?$/),n?new Date(parseInt(n[1],10),3*parseInt(n[2],10)-1,1).getTime():i?new Date(parseInt(i[1],10),parseInt(i[2],10)-1,1).getTime():o?new Date(parseInt(o[1],10),parseInt(o[2],10)-1,parseInt(o[3],10)).getTime():a?(h=new Date(parseInt(a[1],10),0,1),4!==h.getDay()&&h.setMonth(0,1+(4-h.getDay()+7)%7),h.getTime()+6048e5*parseInt(a[2],10)):l?l[6]?(s=0,"Z"!==l[6]&&(s=60*parseInt(l[8],10)+parseInt(l[9],10),"+"===l[7]&&(s=0-s)),Date.UTC(parseInt(l[1],10),parseInt(l[2],10)-1,parseInt(l[3],10),parseInt(l[4],10),parseInt(l[5],10)+s)):new Date(parseInt(l[1],10),parseInt(l[2],10)-1,parseInt(l[3],10),parseInt(l[4],10),parseInt(l[5],10)).getTime():u?(c=parseFloat(u[6]),e=Math.floor(c),r=Math.round(1e3*(c-e)),u[8]?(s=0,"Z"!==u[8]&&(s=60*parseInt(u[10],10)+parseInt(u[11],10),"+"===u[9]&&(s=0-s)),Date.UTC(parseInt(u[1],10),parseInt(u[2],10)-1,parseInt(u[3],10),parseInt(u[4],10),parseInt(u[5],10)+s,e,r)):new Date(parseInt(u[1],10),parseInt(u[2],10)-1,parseInt(u[3],10),parseInt(u[4],10),parseInt(u[5],10),e,r).getTime()):new Date(parseInt(t,10),0,1).getTime())},e.Line=function(t){function n(t){return this.updateHilight=a(this.updateHilight,this),this.hilight=a(this.hilight,this),this.updateHover=a(this.updateHover,this),this instanceof e.Line?(n.__super__.constructor.call(this,t),void 0):new e.Line(t)}return s(n,t),n.prototype.init=function(){var t,e=this;return this.pointGrow=Raphael.animation({r:this.options.pointSize+3},25,"linear"),this.pointShrink=Raphael.animation({r:this.options.pointSize},25,"linear"),this.prevHilight=null,this.el.mousemove(function(t){return e.updateHilight(t.pageX)}),this.options.hideHover&&this.el.mouseout(function(){return e.hilight(null)}),t=function(t){var n;return n=t.originalEvent.touches[0]||t.originalEvent.changedTouches[0],e.updateHilight(n.pageX),n},this.el.bind("touchstart",t),this.el.bind("touchmove",t),this.el.bind("touchend",t),this.el.bind("click",function(){return null!==e.prevHilight?e.fire("click",e.prevHilight,e.data[e.prevHilight]):void 0})},n.prototype.defaults={lineWidth:3,pointSize:4,lineColors:["#0b62a4","#7A92A3","#4da74d","#afd8f8","#edc240","#cb4b4b","#9440ed"],pointWidths:[1],pointStrokeColors:["#ffffff"],pointFillColors:[],hoverPaddingX:10,hoverPaddingY:5,hoverMargin:10,hoverFillColor:"#fff",hoverBorderColor:"#ccc",hoverBorderWidth:2,hoverOpacity:.95,hoverLabelColor:"#444",hoverFontSize:12,smooth:!0,hideHover:!1,xLabels:"auto",xLabelFormat:null,continuousLine:!0},n.prototype.calc=function(){return this.calcPoints(),this.generatePaths(),this.calcHoverMargins()},n.prototype.calcPoints=function(){var t,e,n,r,i,o;for(i=this.data,o=[],n=0,r=i.length;r>n;n++)t=i[n],t._x=this.transX(t.x),o.push(t._y=function(){var n,r,i,o;for(i=t.y,o=[],n=0,r=i.length;r>n;n++)e=i[n],null!=e?o.push(this.transY(e)):o.push(e);return o}.call(this));return o},n.prototype.calcHoverMargins=function(){var t,e;return this.hoverMargins=function(){var n,r,i,o;for(i=this.data.slice(1),o=[],t=n=0,r=i.length;r>n;t=++n)e=i[t],o.push((e._x+this.data[t]._x)/2);return o}.call(this)},n.prototype.generatePaths=function(){var t,n,r,i,o;return this.paths=function(){var s,a,u,h;for(h=[],r=s=0,a=this.options.ykeys.length;a>=0?a>s:s>a;r=a>=0?++s:--s)o=this.options.smooth===!0||(u=this.options.ykeys[r],l.call(this.options.smooth,u)>=0),n=function(){var t,e,n,o;for(n=this.data,o=[],t=0,e=n.length;e>t;t++)i=n[t],void 0!==i._y[r]&&o.push({x:i._x,y:i._y[r]});return o}.call(this),this.options.continuousLine&&(n=function(){var e,r,i;for(i=[],e=0,r=n.length;r>e;e++)t=n[e],null!==t.y&&i.push(t);return i}()),n.length>1?h.push(e.Line.createPath(n,o,this.bottom)):h.push(null);return h}.call(this)},n.prototype.draw=function(){return this.drawXAxis(),this.drawSeries(),this.drawHover(),this.hilight(this.options.hideHover?null:this.data.length-1)},n.prototype.drawXAxis=function(){var t,n,r,i,o,s,a,l,u,h,c=this;for(a=this.bottom+1.25*this.options.gridTextSize,s=50,i=null,t=function(t,e){var n,r;return n=c.r.text(c.transX(e),a,t).attr("font-size",c.options.gridTextSize).attr("fill",c.options.gridTextColor),r=n.getBBox(),(null==i||i>=r.x+r.width)&&r.x>=0&&r.x+r.widtht;t++)o=n[t],r.push([o.label,o.x]);return r}.call(this),r.reverse(),h=[],l=0,u=r.length;u>l;l++)n=r[l],h.push(t(n[0],n[1]));return h},n.prototype.drawSeries=function(){var t,e,n,r,i,o,s,a,l;for(e=i=s=this.options.ykeys.length-1;0>=s?0>=i:i>=0;e=0>=s?++i:--i)n=this.paths[e],null!==n&&this.r.path(n).attr("stroke",this.colorForSeries(e)).attr("stroke-width",this.options.lineWidth);for(this.seriesPoints=function(){var t,n,r;for(r=[],e=t=0,n=this.options.ykeys.length;n>=0?n>t:t>n;e=n>=0?++t:--t)r.push([]);return r}.call(this),l=[],e=o=a=this.options.ykeys.length-1;0>=a?0>=o:o>=0;e=0>=a?++o:--o)l.push(function(){var n,i,o,s;for(o=this.data,s=[],n=0,i=o.length;i>n;n++)r=o[n],t=null!=r._y[e]?this.r.circle(r._x,r._y[e],this.options.pointSize).attr("fill",this.pointFillColorForSeries(e)||this.colorForSeries(e)).attr("stroke-width",this.strokeWidthForSeries(e)).attr("stroke",this.strokeForSeries(e)):null,s.push(this.seriesPoints[e].push(t));return s}.call(this));return l},n.createPath=function(t,n,r){var i,o,s,a,l,u,h,c,f,p,d,g,v,m;for(h="",n&&(s=e.Line.gradients(t)),c={y:null},a=v=0,m=t.length;m>v;a=++v)i=t[a],null!=i.y&&(null!=c.y?n?(o=s[a],u=s[a-1],l=(i.x-c.x)/4,f=c.x+l,d=Math.min(r,c.y+l*u),p=i.x-l,g=Math.min(r,i.y-l*o),h+="C"+f+","+d+","+p+","+g+","+i.x+","+i.y):h+="L"+i.x+","+i.y:n&&null==s[a]||(h+="M"+i.x+","+i.y)),c=i;return h},n.gradients=function(t){var e,n,r,i,o,s,a,l;for(n=function(t,e){return(t.y-e.y)/(t.x-e.x)},l=[],r=s=0,a=t.length;a>s;r=++s)e=t[r],null!=e.y?(i=t[r+1]||{y:null},o=t[r-1]||{y:null},null!=o.y&&null!=i.y?l.push(n(o,i)):null!=o.y?l.push(n(o,e)):null!=i.y?l.push(n(e,i)):l.push(null)):l.push(null);return l},n.prototype.drawHover=function(){var t,e,n,r,i,o;for(this.hoverHeight=1.5*this.options.hoverFontSize*(this.options.ykeys.length+1),this.hover=this.r.rect(-10,-this.hoverHeight/2-this.options.hoverPaddingY,20,this.hoverHeight+2*this.options.hoverPaddingY,10).attr("fill",this.options.hoverFillColor).attr("stroke",this.options.hoverBorderColor).attr("stroke-width",this.options.hoverBorderWidth).attr("opacity",this.options.hoverOpacity),this.xLabel=this.r.text(0,.75*this.options.hoverFontSize-this.hoverHeight/2,"").attr("fill",this.options.hoverLabelColor).attr("font-weight","bold").attr("font-size",this.options.hoverFontSize),this.hoverSet=this.r.set(),this.hoverSet.push(this.hover),this.hoverSet.push(this.xLabel),this.yLabels=[],o=[],t=r=0,i=this.options.ykeys.length;i>=0?i>r:r>i;t=i>=0?++r:--r)e=this.cumulative?this.options.ykeys.length-t-1:t,n=this.r.text(0,1.5*this.options.hoverFontSize*(e+1.5)-this.hoverHeight/2,"").attr("fill",this.colorForSeries(t)).attr("font-size",this.options.hoverFontSize),this.yLabels.push(n),o.push(this.hoverSet.push(n));return o},n.prototype.updateHover=function(t){var e,n,r,i,o,s,a,l,u,h;for(this.hoverSet.show(),i=this.data[t],this.xLabel.attr("text",i.label),h=i.y,e=l=0,u=h.length;u>l;e=++l)s=h[e],this.yLabels[e].attr("text",""+this.options.labels[e]+": "+this.yLabelFormat(s));return r=Math.max.apply(null,function(){var t,e,r,i;for(r=this.yLabels,i=[],t=0,e=r.length;e>t;t++)n=r[t],i.push(n.getBBox().width);return i}.call(this)),r=Math.max(r,this.xLabel.getBBox().width),this.hover.attr("width",r+2*this.options.hoverPaddingX),this.hover.attr("x",-this.options.hoverPaddingX-r/2),a=Math.min.apply(null,function(){var t,e,n,r;for(n=i._y,r=[],t=0,e=n.length;e>t;t++)s=n[t],null!=s&&r.push(s);return r}().concat(this.bottom)),a=a>this.hoverHeight+2*this.options.hoverPaddingY+this.options.hoverMargin+this.top?a-this.hoverHeight/2-this.options.hoverPaddingY-this.options.hoverMargin:a+this.hoverHeight/2+this.options.hoverPaddingY+this.options.hoverMargin,a=Math.max(this.top+this.hoverHeight/2+this.options.hoverPaddingY,a),a=Math.min(this.bottom-this.hoverHeight/2-this.options.hoverPaddingY,a),o=Math.min(this.right-r/2-this.options.hoverPaddingX,this.data[t]._x),o=Math.max(this.left+r/2+this.options.hoverPaddingX,o),this.hoverSet.attr("transform","t"+o+","+a)},n.prototype.hideHover=function(){return this.hoverSet.hide()},n.prototype.hilight=function(t){var e,n,r,i,o;if(null!==this.prevHilight&&this.prevHilight!==t)for(e=n=0,i=this.seriesPoints.length-1;i>=0?i>=n:n>=i;e=i>=0?++n:--n)this.seriesPoints[e][this.prevHilight]&&this.seriesPoints[e][this.prevHilight].animate(this.pointShrink);if(null!==t&&this.prevHilight!==t){for(e=r=0,o=this.seriesPoints.length-1;o>=0?o>=r:r>=o;e=o>=0?++r:--r)this.seriesPoints[e][t]&&this.seriesPoints[e][t].animate(this.pointGrow);this.updateHover(t)}return this.prevHilight=t,null==t?this.hideHover():void 0},n.prototype.updateHilight=function(t){var e,n,r;for(t-=this.el.offset().left,e=n=0,r=this.hoverMargins.length;(r>=0?r>n:n>r)&&!(this.hoverMargins[e]>t);e=r>=0?++n:--n);return this.hilight(e)},n.prototype.colorForSeries=function(t){return this.options.lineColors[t%this.options.lineColors.length]},n.prototype.strokeWidthForSeries=function(t){return this.options.pointWidths[t%this.options.pointWidths.length]},n.prototype.strokeForSeries=function(t){return this.options.pointStrokeColors[t%this.options.pointStrokeColors.length]},n.prototype.pointFillColorForSeries=function(t){return this.options.pointFillColors[t%this.options.pointFillColors.length]},n}(e.Grid),e.labelSeries=function(n,r,i,o,s){var a,l,u,h,c,f,p,d,g,v,m;if(u=200*(r-n)/i,l=new Date(n),p=e.LABEL_SPECS[o],void 0===p)for(m=e.AUTO_LABEL_ORDER,g=0,v=m.length;v>g;g++)if(h=m[g],f=e.LABEL_SPECS[h],u>=f.span){p=f;break}for(void 0===p&&(p=e.LABEL_SPECS.second),s&&(p=t.extend({},p,{fmt:s})),a=p.start(l),c=[];r>=(d=a.getTime());)d>=n&&c.push([p.fmt(a),d]),p.incr(a);return c},n=function(t){return{span:1e3*60*t,start:function(t){return new Date(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours())},fmt:function(t){return""+e.pad2(t.getHours())+":"+e.pad2(t.getMinutes())},incr:function(e){return e.setMinutes(e.getMinutes()+t)}}},r=function(t){return{span:1e3*t,start:function(t){return new Date(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes())},fmt:function(t){return""+e.pad2(t.getHours())+":"+e.pad2(t.getMinutes())+":"+e.pad2(t.getSeconds())},incr:function(e){return e.setSeconds(e.getSeconds()+t)}}},e.LABEL_SPECS={decade:{span:1728e8,start:function(t){return new Date(t.getFullYear()-t.getFullYear()%10,0,1)},fmt:function(t){return""+t.getFullYear()},incr:function(t){return t.setFullYear(t.getFullYear()+10)}},year:{span:1728e7,start:function(t){return new Date(t.getFullYear(),0,1)},fmt:function(t){return""+t.getFullYear()},incr:function(t){return t.setFullYear(t.getFullYear()+1)}},month:{span:24192e5,start:function(t){return new Date(t.getFullYear(),t.getMonth(),1)},fmt:function(t){return""+t.getFullYear()+"-"+e.pad2(t.getMonth()+1)},incr:function(t){return t.setMonth(t.getMonth()+1)}},day:{span:864e5,start:function(t){return new Date(t.getFullYear(),t.getMonth(),t.getDate())},fmt:function(t){return""+t.getFullYear()+"-"+e.pad2(t.getMonth()+1)+"-"+e.pad2(t.getDate())},incr:function(t){return t.setDate(t.getDate()+1)}},hour:n(60),"30min":n(30),"15min":n(15),"10min":n(10),"5min":n(5),minute:n(1),"30sec":r(30),"15sec":r(15),"10sec":r(10),"5sec":r(5),second:r(1)},e.AUTO_LABEL_ORDER=["decade","year","month","day","hour","30min","15min","10min","5min","minute","30sec","15sec","10sec","5sec","second"],e.Area=function(t){function n(t){return this instanceof e.Area?(this.cumulative=!0,n.__super__.constructor.call(this,t),void 0):new e.Area(t)}return s(n,t),n.prototype.calcPoints=function(){var t,e,n,r,i,o,s;for(o=this.data,s=[],r=0,i=o.length;i>r;r++)t=o[r],t._x=this.transX(t.x),e=0,s.push(t._y=function(){var r,i,o,s;for(o=t.y,s=[],r=0,i=o.length;i>r;r++)n=o[r],e+=n||0,s.push(this.transY(e));return s}.call(this));return s},n.prototype.drawSeries=function(){var t,e,r,i;for(t=r=i=this.options.ykeys.length-1;0>=i?0>=r:r>=0;t=0>=i?++r:--r)e=this.paths[t],null!==e&&(e+="L"+this.transX(this.xmax)+","+this.bottom+"L"+this.transX(this.xmin)+","+this.bottom+"Z",this.r.path(e).attr("fill",this.fillForSeries(t)).attr("stroke-width",0));return n.__super__.drawSeries.call(this)},n.prototype.fillForSeries=function(t){var e;return e=Raphael.rgb2hsl(this.colorForSeries(t)),Raphael.hsl(e.h,Math.min(255,.75*e.s),Math.min(255,1.25*e.l))},n}(e.Line),e.Bar=function(n){function r(n){return this.updateHilight=a(this.updateHilight,this),this.hilight=a(this.hilight,this),this.updateHover=a(this.updateHover,this),this instanceof e.Bar?(r.__super__.constructor.call(this,t.extend({},n,{parseTime:!1})),void 0):new e.Bar(n)}return s(r,n),r.prototype.init=function(){var t,e=this;return this.cumulative=this.options.stacked,this.prevHilight=null,this.el.mousemove(function(t){return e.updateHilight(t.pageX)}),this.options.hideHover&&this.el.mouseout(function(){return e.hilight(null)}),t=function(t){var n;return n=t.originalEvent.touches[0]||t.originalEvent.changedTouches[0],e.updateHilight(n.pageX),n},this.el.bind("touchstart",t),this.el.bind("touchmove",t),this.el.bind("touchend",t),this.el.bind("click",function(){return null!==e.prevHilight?e.fire("click",e.prevHilight,e.data[e.prevHilight]):void 0})},r.prototype.defaults={barSizeRatio:.75,barGap:3,barColors:["#0b62a4","#7a92a3","#4da74d","#afd8f8","#edc240","#cb4b4b","#9440ed"],hoverPaddingX:10,hoverPaddingY:5,hoverMargin:10,hoverFillColor:"#fff",hoverBorderColor:"#ccc",hoverBorderWidth:2,hoverOpacity:.95,hoverLabelColor:"#444",hoverFontSize:12,hideHover:!1},r.prototype.calc=function(){return this.calcBars(),this.calcHoverMargins()},r.prototype.calcBars=function(){var t,e,n,r,i,o,s;for(o=this.data,s=[],t=r=0,i=o.length;i>r;t=++r)e=o[t],e._x=this.left+this.width*(t+.5)/this.data.length,s.push(e._y=function(){var t,r,i,o;for(i=e.y,o=[],t=0,r=i.length;r>t;t++)n=i[t],null!=n?o.push(this.transY(n)):o.push(null);return o}.call(this));return s},r.prototype.calcHoverMargins=function(){var t;return this.hoverMargins=function(){var e,n,r;for(r=[],t=e=1,n=this.data.length;n>=1?n>e:e>n;t=n>=1?++e:--e)r.push(this.left+t*this.width/this.data.length);return r}.call(this)},r.prototype.draw=function(){return this.drawXAxis(),this.drawSeries(),this.drawHover(),this.hilight(this.options.hideHover?null:this.data.length-1)},r.prototype.drawXAxis=function(){var t,e,n,r,i,o,s,a,l,u;for(s=this.bottom+1.25*this.options.gridTextSize,o=50,r=null,u=[],t=a=0,l=this.data.length;l>=0?l>a:a>l;t=l>=0?++a:--a)i=this.data[this.data.length-1-t],e=this.r.text(i._x,s,i.label).attr("font-size",this.options.gridTextSize).attr("fill",this.options.gridTextColor),n=e.getBBox(),(null==r||r>=n.x+n.width)&&n.x>=0&&n.x+n.width=this.ymin&&this.ymax>=0?this.transY(0):null,this.bars=function(){var a,d,g,v;for(g=this.data,v=[],r=a=0,d=g.length;d>a;r=++a)l=g[r],i=0,v.push(function(){var a,d,g,v;for(g=l._y,v=[],u=a=0,d=g.length;d>a;u=++a)f=g[u],null!==f?(p?(c=Math.min(f,p),e=Math.max(f,p)):(c=f,e=this.bottom),o=this.left+r*n+s,this.options.stacked||(o+=u*(t+this.options.barGap)),h=e-c,this.options.stacked&&(c-=i),this.r.rect(o,c,t,h).attr("fill",this.colorFor(l,u,"bar")).attr("stroke-width",0),v.push(i+=h)):v.push(null);return v}.call(this));return v}.call(this)},r.prototype.drawHover=function(){var t,e,n,r,i;for(this.hoverHeight=1.5*this.options.hoverFontSize*(this.options.ykeys.length+1),this.hover=this.r.rect(-10,-this.hoverHeight/2-this.options.hoverPaddingY,20,this.hoverHeight+2*this.options.hoverPaddingY,10).attr("fill",this.options.hoverFillColor).attr("stroke",this.options.hoverBorderColor).attr("stroke-width",this.options.hoverBorderWidth).attr("opacity",this.options.hoverOpacity),this.xLabel=this.r.text(0,.75*this.options.hoverFontSize-this.hoverHeight/2,"").attr("fill",this.options.hoverLabelColor).attr("font-weight","bold").attr("font-size",this.options.hoverFontSize),this.hoverSet=this.r.set(),this.hoverSet.push(this.hover),this.hoverSet.push(this.xLabel),this.yLabels=[],i=[],t=n=0,r=this.options.ykeys.length;r>=0?r>n:n>r;t=r>=0?++n:--n)e=this.r.text(0,1.5*this.options.hoverFontSize*(t+1.5)-this.hoverHeight/2,"").attr("font-size",this.options.hoverFontSize),this.yLabels.push(e),i.push(this.hoverSet.push(e));return i},r.prototype.updateHover=function(t){var e,n,r,i,o,s,a,l,u,h;for(this.hoverSet.show(),i=this.data[t],this.xLabel.attr("text",i.label),h=i.y,e=l=0,u=h.length;u>l;e=++l)s=h[e],this.yLabels[e].attr("fill",this.colorFor(i,e,"hover")),this.yLabels[e].attr("text",""+this.options.labels[e]+": "+this.yLabelFormat(s));return r=Math.max.apply(null,function(){var t,e,r,i;for(r=this.yLabels,i=[],t=0,e=r.length;e>t;t++)n=r[t],i.push(n.getBBox().width);return i}.call(this)),r=Math.max(r,this.xLabel.getBBox().width),this.hover.attr("width",r+2*this.options.hoverPaddingX),this.hover.attr("x",-this.options.hoverPaddingX-r/2),a=(this.bottom+this.top)/2,o=Math.min(this.right-r/2-this.options.hoverPaddingX,this.data[t]._x),o=Math.max(this.left+r/2+this.options.hoverPaddingX,o),this.hoverSet.attr("transform","t"+o+","+a) +},r.prototype.hideHover=function(){return this.hoverSet.hide()},r.prototype.hilight=function(t){return null!==t&&this.prevHilight!==t&&this.updateHover(t),this.prevHilight=t,null==t?this.hideHover():void 0},r.prototype.updateHilight=function(t){var e,n,r;for(t-=this.el.offset().left,e=n=0,r=this.hoverMargins.length;(r>=0?r>n:n>r)&&!(this.hoverMargins[e]>t);e=r>=0?++n:--n);return this.hilight(e)},r.prototype.colorFor=function(t,e,n){var r,i;return"function"==typeof this.options.barColors?(r={x:t.x,y:t.y[e],label:t.label},i={index:e,key:this.options.ykeys[e],label:this.options.labels[e]},this.options.barColors.call(this,r,i,n)):this.options.barColors[e%this.options.barColors.length]},r}(e.Grid),e.Donut=function(n){function r(n){if(this.click=a(this.click,this),this.select=a(this.select,this),!(this instanceof e.Donut))return new e.Donut(n);if(this.el="string"==typeof n.element?t(document.getElementById(n.element)):t(n.element),this.options=t.extend({},this.defaults,n),null===this.el||0===this.el.length)throw Error("Graph placeholder not found.");void 0!==n.data&&0!==n.data.length&&(this.data=n.data,this.redraw())}return s(r,n),r.prototype.defaults={colors:["#0B62A4","#3980B5","#679DC6","#95BBD7","#B0CCE1","#095791","#095085","#083E67","#052C48","#042135"],formatter:e.commas},r.prototype.redraw=function(){var t,n,r,i,o,s,a,l,u,h,c,f,p,d,g,v,m,y,x,b,w,_,k,C;for(this.el.empty(),this.r=new Raphael(this.el[0]),n=this.el.width()/2,r=this.el.height()/2,p=(Math.min(n,r)-10)/3,f=0,w=this.data,g=0,y=w.length;y>g;g++)d=w[g],f+=d.value;for(u=5/(2*p),t=1.9999*Math.PI-u*this.data.length,a=0,s=0,this.segments=[],_=this.data,o=v=0,x=_.length;x>v;o=++v)i=_[o],h=a+u+t*(i.value/f),c=new e.DonutSegment(n,r,2*p,p,a,h,this.options.colors[s%this.options.colors.length],i,o),c.render(this.r),this.segments.push(c),c.on("hover",this.select),c.on("click",this.click),a=h,s+=1;for(this.text1=this.r.text(n,r-10,"").attr({"font-size":15,"font-weight":800}),this.text2=this.r.text(n,r+10,"").attr({"font-size":14}),l=Math.max.apply(null,function(){var t,e,n,r;for(n=this.data,r=[],t=0,e=n.length;e>t;t++)i=n[t],r.push(i.value);return r}.call(this)),s=0,k=this.data,C=[],m=0,b=k.length;b>m;m++){if(i=k[m],i.value===l){this.select(s);break}C.push(s+=1)}return C},r.prototype.select=function(t){var e,n,r,i,o;for(o=this.segments,r=0,i=o.length;i>r;r++)e=o[r],e.deselect();return n="number"==typeof t?this.segments[t]:t,n.select(),this.setLabels(n.data.label,this.options.formatter(n.data.value,n.data))},r.prototype.click=function(t,e){return this.fire("click",t,e)},r.prototype.setLabels=function(t,e){var n,r,i,o,s,a,l,u;return n=2*(Math.min(this.el.width()/2,this.el.height()/2)-10)/3,o=1.8*n,i=n/2,r=n/3,this.text1.attr({text:t,transform:""}),s=this.text1.getBBox(),a=Math.min(o/s.width,i/s.height),this.text1.attr({transform:"S"+a+","+a+","+(s.x+s.width/2)+","+(s.y+s.height)}),this.text2.attr({text:e,transform:""}),l=this.text2.getBBox(),u=Math.min(o/l.width,r/l.height),this.text2.attr({transform:"S"+u+","+u+","+(l.x+l.width/2)+","+l.y})},r}(e.EventEmitter),e.DonutSegment=function(t){function e(t,e,n,r,i,o,s,l,u){this.cx=t,this.cy=e,this.inner=n,this.outer=r,this.color=s,this.data=l,this.i=u,this.deselect=a(this.deselect,this),this.select=a(this.select,this),this.sin_p0=Math.sin(i),this.cos_p0=Math.cos(i),this.sin_p1=Math.sin(o),this.cos_p1=Math.cos(o),this.long=o-i>Math.PI?1:0,this.path=this.calcSegment(this.inner+3,this.inner+this.outer-5),this.selectedPath=this.calcSegment(this.inner+3,this.inner+this.outer),this.hilight=this.calcArc(this.inner)}return s(e,t),e.prototype.calcArcPoints=function(t){return[this.cx+t*this.sin_p0,this.cy+t*this.cos_p0,this.cx+t*this.sin_p1,this.cy+t*this.cos_p1]},e.prototype.calcSegment=function(t,e){var n,r,i,o,s,a,l,u,h,c;return h=this.calcArcPoints(t),n=h[0],i=h[1],r=h[2],o=h[3],c=this.calcArcPoints(e),s=c[0],l=c[1],a=c[2],u=c[3],"M"+n+","+i+("A"+t+","+t+",0,"+this.long+",0,"+r+","+o)+("L"+a+","+u)+("A"+e+","+e+",0,"+this.long+",1,"+s+","+l)+"Z"},e.prototype.calcArc=function(t){var e,n,r,i,o;return o=this.calcArcPoints(t),e=o[0],r=o[1],n=o[2],i=o[3],"M"+e+","+r+("A"+t+","+t+",0,"+this.long+",0,"+n+","+i)},e.prototype.render=function(t){var e=this;return this.arc=t.path(this.hilight).attr({stroke:this.color,"stroke-width":2,opacity:0}),this.seg=t.path(this.path).attr({fill:this.color,stroke:"white","stroke-width":3}).hover(function(){return e.fire("hover",e)}).click(function(){return e.fire("click",e.i,e.data)})},e.prototype.select=function(){return this.selected?void 0:(this.seg.animate({path:this.selectedPath},150,"<>"),this.arc.animate({opacity:1},150,"<>"),this.selected=!0)},e.prototype.deselect=function(){return this.selected?(this.seg.animate({path:this.path},150,"<>"),this.arc.animate({opacity:0},150,"<>"),this.selected=!1):void 0},e}(e.EventEmitter)}.call(this),function(t){t.fn.fitText=function(e,n){var r=e||1,i=t.extend({minFontSize:Number.NEGATIVE_INFINITY,maxFontSize:Number.POSITIVE_INFINITY},n);return this.each(function(){var e=t(this),n=function(){e.css("font-size",Math.max(Math.min(e.width()/(10*r),parseFloat(i.maxFontSize)),parseFloat(i.minFontSize)))};n(),t(window).on("resize",n)})}}(jQuery),!function(t){"use strict";var e=function(t,e){this.init("tooltip",t,e)};e.prototype={constructor:e,init:function(e,n,r){var i,o;this.type=e,this.$element=t(n),this.options=this.getOptions(r),this.enabled=!0,"click"==this.options.trigger?this.$element.on("click."+this.type,this.options.selector,t.proxy(this.toggle,this)):"manual"!=this.options.trigger&&(i="hover"==this.options.trigger?"mouseenter":"focus",o="hover"==this.options.trigger?"mouseleave":"blur",this.$element.on(i+"."+this.type,this.options.selector,t.proxy(this.enter,this)),this.$element.on(o+"."+this.type,this.options.selector,t.proxy(this.leave,this))),this.options.selector?this._options=t.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},getOptions:function(e){return e=t.extend({},t.fn[this.type].defaults,e,this.$element.data()),e.delay&&"number"==typeof e.delay&&(e.delay={show:e.delay,hide:e.delay}),e},enter:function(e){var n=t(e.currentTarget)[this.type](this._options).data(this.type);return n.options.delay&&n.options.delay.show?(clearTimeout(this.timeout),n.hoverState="in",this.timeout=setTimeout(function(){"in"==n.hoverState&&n.show()},n.options.delay.show),void 0):n.show()},leave:function(e){var n=t(e.currentTarget)[this.type](this._options).data(this.type);return this.timeout&&clearTimeout(this.timeout),n.options.delay&&n.options.delay.hide?(n.hoverState="out",this.timeout=setTimeout(function(){"out"==n.hoverState&&n.hide()},n.options.delay.hide),void 0):n.hide()},show:function(){var t,e,n,r,i,o;if(this.hasContent()&&this.enabled){if(t=this.tip(),t.is(":visible"))return this;switch(this.setContent(),this.options.animation&&t.addClass("fade"),i="function"==typeof this.options.placement?this.options.placement.call(this,t[0],this.$element[0]):this.options.placement,t.detach().css({top:0,left:0,display:"block"}),document.body.appendChild(t[0]),e=this.getPosition(),n=t[0].offsetWidth,r=t[0].offsetHeight,i){case"bottom":o={top:e.top+e.height,left:e.left+e.width/2-n/2};break;case"top":o={top:e.top-r,left:e.left+e.width/2-n/2};break;case"left":o={top:e.top+e.height/2-r/2,left:e.left-n};break;case"right":o={top:e.top+e.height/2-r/2,left:e.left+e.width}}t.offset(o).addClass(i).addClass("in")}},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")},hide:function(){function e(){var e=setTimeout(function(){n.off(t.support.transition.end).detach()},500);n.one(t.support.transition.end,function(){clearTimeout(e),n.detach()})}var n=this.tip();return n.removeClass("in"),t.support.transition&&this.$tip.hasClass("fade")?e():n.detach(),this},fixTitle:function(){var t=this.$element;(t.attr("title")||"string"!=typeof t.attr("data-original-title"))&&t.attr("data-original-title",t.attr("title")||"").removeAttr("title")},hasContent:function(){return this.getTitle()},getPosition:function(){var e=this.$element[0];return t.extend({},e.getBoundingClientRect?e.getBoundingClientRect():{width:e.offsetWidth,height:e.offsetHeight},this.$element.offset())},getTitle:function(){var t,e=this.$element,n=this.options;return t=e.attr("data-original-title")||("function"==typeof n.title?n.title.call(e[0]):n.title)},tip:function(){return this.$tip=this.$tip||t(this.options.template)},validate:function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)},enable:function(){this.enabled=!0},disable:function(){this.enabled=!1},toggleEnabled:function(){this.enabled=!this.enabled},toggle:function(e){var n=t(e.currentTarget)[this.type](this._options).data(this.type);n[n.tip().hasClass("in")?"hide":"show"]()},destroy:function(){this.hide().$element.off("."+this.type).removeData(this.type)}};var n=t.fn.tooltip;t.fn.tooltip=function(n){return this.each(function(){var r=t(this),i=r.data("tooltip"),o="object"==typeof n&&n;i||r.data("tooltip",i=new e(this,o)),"string"==typeof n&&i[n]()})},t.fn.tooltip.Constructor=e,t.fn.tooltip.defaults={animation:!0,placement:"top",selector:!1,template:'
',trigger:"hover",title:"",delay:0,html:!1},t.fn.tooltip.noConflict=function(){return t.fn.tooltip=n,this}}(window.jQuery),!function(t){"use strict";var e=function(t,e){this.init("popover",t,e)};e.prototype=t.extend({},t.fn.tooltip.Constructor.prototype,{constructor:e,setContent:function(){var t=this.tip(),e=this.getTitle(),n=this.getContent();t.find(".popover-title")[this.options.html?"html":"text"](e),t.find(".popover-content")[this.options.html?"html":"text"](n),t.removeClass("fade top bottom left right in")},hasContent:function(){return this.getTitle()||this.getContent()},getContent:function(){var t,e=this.$element,n=this.options;return t=e.attr("data-content")||("function"==typeof n.content?n.content.call(e[0]):n.content)},tip:function(){return this.$tip||(this.$tip=t(this.options.template)),this.$tip},destroy:function(){this.hide().$element.off("."+this.type).removeData(this.type)}});var n=t.fn.popover;t.fn.popover=function(n){return this.each(function(){var r=t(this),i=r.data("popover"),o="object"==typeof n&&n;i||r.data("popover",i=new e(this,o)),"string"==typeof n&&i[n]()})},t.fn.popover.Constructor=e,t.fn.popover.defaults=t.extend({},t.fn.tooltip.defaults,{placement:"right",trigger:"click",content:"",template:'

'}),t.fn.popover.noConflict=function(){return t.fn.popover=n,this}}(window.jQuery); \ No newline at end of file diff --git a/lib/report/assets/scripts/codemirror.markpopovertext.js b/lib/report/assets/scripts/codemirror.markpopovertext.js new file mode 100755 index 0000000..3f233dc --- /dev/null +++ b/lib/report/assets/scripts/codemirror.markpopovertext.js @@ -0,0 +1,75 @@ +/*global CodeMirror:false, $:false*/ + +(function(){ + "use strict"; + + function makeid(num){ + num = num || 5; + var text = ""; + var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; + + for( var i=0; i < num; i++ ) + text += possible.charAt(Math.floor(Math.random() * possible.length)); + + return text; + } + + CodeMirror.prototype.markPopoverText = function(lineObj, regex, className, gutter, message){ + var re = new RegExp('(' + regex + ')', 'g'); + var cursor = this.getSearchCursor(re, lineObj); + + var match, internalClass = 'plato-mark-' + makeid(10); + while (match = cursor.findNext()) { + if (cursor.to().line !== lineObj.line) break; + this.markText( + { line : lineObj.line, ch : cursor.from().ch }, + { line : lineObj.line, ch : cursor.to().ch }, + { + className : 'plato-mark ' + internalClass + ' ' + (className || ''), + startStyle : 'plato-mark-start', + endStyle : 'plato-mark-end' + } + ); + } + + if (gutter) { + this.setGutterMarker(lineObj.line, gutter.gutterId, gutter.el); + } + + if (message) { + var markStart = $('.plato-mark-start.' + internalClass); + var markSpans = $('.' + internalClass); + + if (message.type === 'popover') { + + var triggered = false; + markSpans.add(gutter.el) + .on('mouseenter touchstart',function(e){ + e.preventDefault(); + triggered = true; + markSpans.addClass('active'); + markStart.popover('show'); + }) + .on('mouseleave touchend',function(e){ + e.preventDefault(); + markSpans.removeClass('active'); + triggered = false; + setTimeout(function(){ + if (!triggered) markStart.popover('hide'); + },200); + }); + + markStart.popover({ + trigger : 'manual', + content : message.content, + html : true, + title : message.title, + placement : 'top' + }); + } else if (message.type === 'block') { + this.addLineWidget(lineObj.line, $(message.content)[0]); + } + } + }; + +})(); diff --git a/lib/report/assets/scripts/plato-file.js b/lib/report/assets/scripts/plato-file.js new file mode 100755 index 0000000..1b407ff --- /dev/null +++ b/lib/report/assets/scripts/plato-file.js @@ -0,0 +1,106 @@ +/*global $:false, _:false, Morris:false, CodeMirror:false, __report:false */ +/*jshint browser:true*/ + +$(function(){ + "use strict"; + + _.templateSettings = { + interpolate : /\{\{(.+?)\}\}/g + }; + + function focusFragment() { + $('.plato-mark').removeClass('focus'); + var markId = window.location.hash.substr(1); + if (markId) $('.' + markId).addClass('focus'); + return focusFragment; + } + + window.onhashchange = focusFragment(); + + var srcEl = document.getElementById('file-source'); + + var options = { + lineNumbers : true, + gutters : ['plato-gutter-jshint','plato-gutter-complexity'], + readOnly : 'nocursor' + }; + + var cm = CodeMirror.fromTextArea(srcEl, options); + + var byComplexity = [], bySloc = []; + + __report.complexity.functions.forEach(function(fn,i){ + byComplexity.push({ + label : fn.name, + value : fn.complexity.cyclomatic + }); + bySloc.push({ + label : fn.name, + value : fn.complexity.sloc.physical, + formatter: function (x) { return x + " lines"; } + }); + + var name = fn.name === '' ? 'function\\s*\\([^)]*\\)' : fn.name; + var line = fn.line - 1; + var className = 'plato-mark-fn-' + i; + var gutter = { + gutterId : 'plato-gutter-complexity', + el : $('')[0] + }; + var popover = { + type : 'popover', + title : fn.name === '' ? '<anonymous>' : 'function ' + fn.name + '', + content : _.template($('#complexity-popover-template').text())(fn) + }; + cm.markPopoverText({line : line, ch:0}, name, className, gutter, popover); + }); + + var scrollToLine = function(i) { + var origScroll = [window.pageXOffset,window.pageYOffset]; + window.location.hash = '#plato-mark-fn-' + i; + window.scrollTo(origScroll[0],origScroll[1]); + var line = __report.complexity.functions[i].line; + var coords = cm.charCoords({line : line, ch : 0}); + $('body,html').animate({scrollTop : coords.top -50},250); + }; + + // yield to the browser + setTimeout(function(){ + drawCharts([ + { element: 'fn-by-complexity', data: byComplexity }, + { element: 'fn-by-sloc', data: bySloc } + ]); + },0); + setTimeout(function(){ + addLintMessages(__report); + },0); + + + function drawCharts(charts) { + charts.forEach(function(chart){ + Morris.Donut(chart).on('click',scrollToLine); + }); + } + + function addLintMessages(report) { + var lines = {}; + report.jshint.messages.forEach(function (message) { + var text = 'Column: ' + message.column + ' "' + message.message + '"'; + if (_.isArray(message.line)) { + message.line.forEach(function(line){ + if (!lines[line]) lines[line] = ''; + lines[line] += '
' + text + '
'; + }); + } else { + if (!lines[message.line]) lines[message.line] = ''; + lines[message.line] += '
' + text + '
'; + } + }); + var gutterIcon = $(''); + Object.keys(lines).forEach(function(line){ + cm.setGutterMarker(line - 1, 'plato-gutter-jshint', gutterIcon.clone()[0]); + cm.addLineWidget(line - 1, $('
' + lines[line] + '
')[0]); + }); + } +}); + diff --git a/lib/report/assets/scripts/plato-overview.js b/lib/report/assets/scripts/plato-overview.js new file mode 100755 index 0000000..e6b9ad1 --- /dev/null +++ b/lib/report/assets/scripts/plato-overview.js @@ -0,0 +1,142 @@ +/*global $:false, _:false, Morris:false, __report:false, Raphael:false */ +/*jshint browser:true*/ + +$(function(){ + "use strict"; + + // Workaround for jshint complaint I don't want to turn off. + var raphael = Raphael; + + // $('.plato-file-link').fitText(1.2, { minFontSize: '20px', maxFontSize: '28px' }); + + var colors = [ + '#50ABD2', + '#ED913D', + '#E8182E' + ]; + + var graphHeight = 10, + lineHeight = 1.35; + + var horizontalGraph = function(paper, num, orig, width, label, color){ + var offset = 70; + var y = parseInt(graphHeight * num * lineHeight,10); + paper.rect(offset, y, width, graphHeight).attr({fill: color, stroke:'none'}); + paper.text(offset - 5, y + 5, label).attr({'font-size':12,'text-anchor':'end' }); + paper.text(width + offset + 8, y + 6, orig).attr({'font-size':10,'text-anchor':'start' }); + }; + + function getColor(value, colors, thresholds) { + thresholds = thresholds || []; + for (var i = thresholds.length - 1; i > -1; i--) { + if (value > thresholds[i]) return colors[i+1]; + } + return colors[0]; + } + + function drawFileCharts(reports) { + reports.forEach(function(report, i){ + var $container = $('#plato-file-' + i + ' .plato-file-chart'); + var width = $container.width(), + height = $container.height(); + + var chart = $container.data('chart'); + if (!chart) $container.data('chart', chart = raphael($container[0],width,height)); + chart.clear(); + chart.setSize(width, height); + + // yield for UI + setTimeout(function(){ + //leave room at the end for the value labels. + width = width - 120; + + var value = report.complexity.aggregate.complexity.cyclomatic; + horizontalGraph(chart,0,value, Math.min(value * 2, width),'complexity', getColor(value, colors, [5,10])); + + value = report.complexity.aggregate.complexity.sloc.physical; + horizontalGraph(chart,1,value, Math.min(value, width), 'sloc', getColor(value,colors,[400,600])); + + value = report.complexity.aggregate.complexity.halstead.bugs.toFixed(2); + horizontalGraph(chart,2,value, value * 5, 'est bugs', getColor(value,colors,[1,5])); + },0); + }); + } + + function drawOverviewCharts(reports) { + $('.chart').empty(); + + var sloc = { + element: 'chart_sloc', + data: [], + xkey: 'label', + ykeys: ['value'], + ymax : 400, + labels: ['Lines'], + barColors : ['#FAAF78'] + }; + var maintainability = { + element: 'chart_maintainability', + data: [], + xkey: 'label', + ykeys: ['value'], + ymax : 171, + labels: ['Maintainability'], + barColors : ['#FAAF78'] + }; + var bugs = { + element: 'chart_bugs', + data: [], + xkey: 'label', + ykeys: ['value'], + labels: ['Bugs'], + ymax: 20, + barColors : ['#D54C2C'] + }; + + reports.forEach(function(report){ + + sloc.ymax = Math.max(sloc.ymax, report.complexity.aggregate.complexity.sloc.physical); + bugs.ymax = Math.max(bugs.ymax, report.complexity.aggregate.complexity.halstead.bugs.toFixed(2)); + + + sloc.data.push({ + value : report.complexity.aggregate.complexity.sloc.physical, + label : report.complexity.module + }); + bugs.data.push({ + value : report.complexity.aggregate.complexity.halstead.bugs.toFixed(2), + label : report.complexity.module + }); + maintainability.data.push({ + value : report.complexity.maintainability.toFixed(2), + label : report.complexity.module + }); + }); + + function onGraphClick(i){ + document.location = __report.reports[i].info.link; + } + + var charts = [ + Morris.Bar(bugs), + Morris.Bar(sloc), + Morris.Bar(maintainability) + ]; + + charts.forEach(function(chart){ + chart.on('click', onGraphClick); + }); + return charts; + } + + drawOverviewCharts(__report.reports); + drawFileCharts(__report.reports); + + $(window).on('resize', _.debounce(function(){ + drawFileCharts(__report.reports); + drawOverviewCharts(__report.reports); + },200)); +}); + + + diff --git a/lib/report/assets/scripts/vendor/bootstrap-popover.js b/lib/report/assets/scripts/vendor/bootstrap-popover.js new file mode 100755 index 0000000..dc639a6 --- /dev/null +++ b/lib/report/assets/scripts/vendor/bootstrap-popover.js @@ -0,0 +1,114 @@ +/* =========================================================== + * bootstrap-popover.js v3.0.0 + * http://twitter.github.com/bootstrap/javascript.html#popovers + * =========================================================== + * Copyright 2012 Twitter, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * =========================================================== */ + + +!function ($) { + + "use strict"; // jshint ;_; + + + /* POPOVER PUBLIC CLASS DEFINITION + * =============================== */ + + var Popover = function (element, options) { + this.init('popover', element, options) + } + + + /* NOTE: POPOVER EXTENDS BOOTSTRAP-TOOLTIP.js + ========================================== */ + + Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype, { + + constructor: Popover + + , setContent: function () { + var $tip = this.tip() + , title = this.getTitle() + , content = this.getContent() + + $tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title) + $tip.find('.popover-content')[this.options.html ? 'html' : 'text'](content) + + $tip.removeClass('fade top bottom left right in') + } + + , hasContent: function () { + return this.getTitle() || this.getContent() + } + + , getContent: function () { + var content + , $e = this.$element + , o = this.options + + content = $e.attr('data-content') + || (typeof o.content == 'function' ? o.content.call($e[0]) : o.content) + + return content + } + + , tip: function () { + if (!this.$tip) { + this.$tip = $(this.options.template) + } + return this.$tip + } + + , destroy: function () { + this.hide().$element.off('.' + this.type).removeData(this.type) + } + + }) + + + /* POPOVER PLUGIN DEFINITION + * ======================= */ + + var old = $.fn.popover + + $.fn.popover = function (option) { + return this.each(function () { + var $this = $(this) + , data = $this.data('popover') + , options = typeof option == 'object' && option + if (!data) $this.data('popover', (data = new Popover(this, options))) + if (typeof option == 'string') data[option]() + }) + } + + $.fn.popover.Constructor = Popover + + $.fn.popover.defaults = $.extend({} , $.fn.tooltip.defaults, { + placement: 'right' + , trigger: 'click' + , content: '' + , template: '

' + }) + + + /* POPOVER NO CONFLICT + * =================== */ + + $.fn.popover.noConflict = function () { + $.fn.popover = old + return this + } + +}(window.jQuery); diff --git a/lib/report/assets/scripts/vendor/bootstrap-tooltip.js b/lib/report/assets/scripts/vendor/bootstrap-tooltip.js new file mode 100755 index 0000000..f0c1ce6 --- /dev/null +++ b/lib/report/assets/scripts/vendor/bootstrap-tooltip.js @@ -0,0 +1,287 @@ +/* =========================================================== + * bootstrap-tooltip.js v3.0.0 + * http://twitter.github.com/bootstrap/javascript.html#tooltips + * Inspired by the original jQuery.tipsy by Jason Frame + * =========================================================== + * Copyright 2012 Twitter, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ========================================================== */ + + +!function ($) { + + "use strict"; // jshint ;_; + + + /* TOOLTIP PUBLIC CLASS DEFINITION + * =============================== */ + + var Tooltip = function (element, options) { + this.init('tooltip', element, options) + } + + Tooltip.prototype = { + + constructor: Tooltip + + , init: function (type, element, options) { + var eventIn + , eventOut + + this.type = type + this.$element = $(element) + this.options = this.getOptions(options) + this.enabled = true + + if (this.options.trigger == 'click') { + this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this)) + } else if (this.options.trigger != 'manual') { + eventIn = this.options.trigger == 'hover' ? 'mouseenter' : 'focus' + eventOut = this.options.trigger == 'hover' ? 'mouseleave' : 'blur' + this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this)) + this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this)) + } + + this.options.selector ? + (this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) : + this.fixTitle() + } + + , getOptions: function (options) { + options = $.extend({}, $.fn[this.type].defaults, options, this.$element.data()) + + if (options.delay && typeof options.delay == 'number') { + options.delay = { + show: options.delay + , hide: options.delay + } + } + + return options + } + + , enter: function (e) { + var self = $(e.currentTarget)[this.type](this._options).data(this.type) + + if (!self.options.delay || !self.options.delay.show) return self.show() + + clearTimeout(this.timeout) + self.hoverState = 'in' + this.timeout = setTimeout(function() { + if (self.hoverState == 'in') self.show() + }, self.options.delay.show) + } + + , leave: function (e) { + var self = $(e.currentTarget)[this.type](this._options).data(this.type) + + if (this.timeout) clearTimeout(this.timeout) + if (!self.options.delay || !self.options.delay.hide) return self.hide() + + self.hoverState = 'out' + this.timeout = setTimeout(function() { + if (self.hoverState == 'out') self.hide() + }, self.options.delay.hide) + } + + , show: function () { + var $tip + , pos + , actualWidth + , actualHeight + , placement + , tp + + if (this.hasContent() && this.enabled) { + $tip = this.tip() + if ($tip.is(':visible')) return this; + this.setContent() + + if (this.options.animation) { + $tip.addClass('fade') + } + + placement = typeof this.options.placement == 'function' ? + this.options.placement.call(this, $tip[0], this.$element[0]) : + this.options.placement + + $tip + .detach() + .css({ top: 0, left: 0, display: 'block' }); + + document.body.appendChild($tip[0]); + + pos = this.getPosition() + + actualWidth = $tip[0].offsetWidth + actualHeight = $tip[0].offsetHeight + + switch (placement) { + case 'bottom': + tp = {top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2} + break + case 'top': + tp = {top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2} + break + case 'left': + tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth} + break + case 'right': + tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width} + break + } + + $tip + .offset(tp) + .addClass(placement) + .addClass('in') + } + } + + , setContent: function () { + var $tip = this.tip() + , title = this.getTitle() + + $tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title) + $tip.removeClass('fade in top bottom left right') + } + + , hide: function () { + var that = this + , $tip = this.tip() + + $tip.removeClass('in') + + function removeWithAnimation() { + var timeout = setTimeout(function () { + $tip.off($.support.transition.end).detach() + }, 500) + + $tip.one($.support.transition.end, function () { + clearTimeout(timeout) + $tip.detach() + }) + } + + $.support.transition && this.$tip.hasClass('fade') ? + removeWithAnimation() : + $tip.detach() + + return this + } + + , fixTitle: function () { + var $e = this.$element + if ($e.attr('title') || typeof($e.attr('data-original-title')) != 'string') { + $e.attr('data-original-title', $e.attr('title') || '').removeAttr('title') + } + } + + , hasContent: function () { + return this.getTitle() + } + + , getPosition: function () { + var el = this.$element[0] + return $.extend({}, el.getBoundingClientRect ? el.getBoundingClientRect() : { + width: el.offsetWidth + , height: el.offsetHeight + }, this.$element.offset()) + } + + , getTitle: function () { + var title + , $e = this.$element + , o = this.options + + title = $e.attr('data-original-title') + || (typeof o.title == 'function' ? o.title.call($e[0]) : o.title) + + return title + } + + , tip: function () { + return this.$tip = this.$tip || $(this.options.template) + } + + , validate: function () { + if (!this.$element[0].parentNode) { + this.hide() + this.$element = null + this.options = null + } + } + + , enable: function () { + this.enabled = true + } + + , disable: function () { + this.enabled = false + } + + , toggleEnabled: function () { + this.enabled = !this.enabled + } + + , toggle: function (e) { + var self = $(e.currentTarget)[this.type](this._options).data(this.type) + self[self.tip().hasClass('in') ? 'hide' : 'show']() + } + + , destroy: function () { + this.hide().$element.off('.' + this.type).removeData(this.type) + } + + } + + + /* TOOLTIP PLUGIN DEFINITION + * ========================= */ + + var old = $.fn.tooltip + + $.fn.tooltip = function ( option ) { + return this.each(function () { + var $this = $(this) + , data = $this.data('tooltip') + , options = typeof option == 'object' && option + if (!data) $this.data('tooltip', (data = new Tooltip(this, options))) + if (typeof option == 'string') data[option]() + }) + } + + $.fn.tooltip.Constructor = Tooltip + + $.fn.tooltip.defaults = { + animation: true + , placement: 'top' + , selector: false + , template: '
' + , trigger: 'hover' + , title: '' + , delay: 0 + , html: false + } + + + /* TOOLTIP NO CONFLICT + * =================== */ + + $.fn.tooltip.noConflict = function () { + $.fn.tooltip = old + return this + } + +}(window.jQuery); \ No newline at end of file diff --git a/lib/report/assets/scripts/vendor/codemirror/codemirror.js b/lib/report/assets/scripts/vendor/codemirror/codemirror.js new file mode 100755 index 0000000..2003aa7 --- /dev/null +++ b/lib/report/assets/scripts/vendor/codemirror/codemirror.js @@ -0,0 +1,4553 @@ +// CodeMirror version 3.0 +// +// CodeMirror is the only global var we claim +window.CodeMirror = (function() { + "use strict"; + + // BROWSER SNIFFING + + // Crude, but necessary to handle a number of hard-to-feature-detect + // bugs and behavior differences. + var gecko = /gecko\/\d/i.test(navigator.userAgent); + var ie = /MSIE \d/.test(navigator.userAgent); + var ie_lt8 = /MSIE [1-7]\b/.test(navigator.userAgent); + var ie_lt9 = /MSIE [1-8]\b/.test(navigator.userAgent); + var webkit = /WebKit\//.test(navigator.userAgent); + var qtwebkit = webkit && /Qt\/\d+\.\d+/.test(navigator.userAgent); + var chrome = /Chrome\//.test(navigator.userAgent); + var opera = /Opera\//.test(navigator.userAgent); + var safari = /Apple Computer/.test(navigator.vendor); + var khtml = /KHTML\//.test(navigator.userAgent); + var mac_geLion = /Mac OS X 1\d\D([7-9]|\d\d)\D/.test(navigator.userAgent); + var mac_geMountainLion = /Mac OS X 1\d\D([8-9]|\d\d)\D/.test(navigator.userAgent); + var phantom = /PhantomJS/.test(navigator.userAgent); + + var ios = /AppleWebKit/.test(navigator.userAgent) && /Mobile\/\w+/.test(navigator.userAgent); + // This is woefully incomplete. Suggestions for alternative methods welcome. + var mobile = ios || /Android|webOS|BlackBerry|Opera Mini|IEMobile/i.test(navigator.userAgent); + var mac = ios || /Mac/.test(navigator.platform); + + // Optimize some code when these features are not used + var sawReadOnlySpans = false, sawCollapsedSpans = false; + + // CONSTRUCTOR + + function CodeMirror(place, options) { + if (!(this instanceof CodeMirror)) return new CodeMirror(place, options); + + this.options = options = options || {}; + // Determine effective options based on given values and defaults. + for (var opt in defaults) if (!options.hasOwnProperty(opt) && defaults.hasOwnProperty(opt)) + options[opt] = defaults[opt]; + setGuttersForLineNumbers(options); + + var display = this.display = makeDisplay(place); + display.wrapper.CodeMirror = this; + updateGutters(this); + if (options.autofocus && !mobile) focusInput(this); + + this.view = makeView(new BranchChunk([new LeafChunk([makeLine("", null, textHeight(display))])])); + this.nextOpId = 0; + loadMode(this); + themeChanged(this); + if (options.lineWrapping) + this.display.wrapper.className += " CodeMirror-wrap"; + + // Initialize the content. + this.setValue(options.value || ""); + // Override magic textarea content restore that IE sometimes does + // on our hidden textarea on reload + if (ie) setTimeout(bind(resetInput, this, true), 20); + this.view.history = makeHistory(); + + registerEventHandlers(this); + // IE throws unspecified error in certain cases, when + // trying to access activeElement before onload + var hasFocus; try { hasFocus = (document.activeElement == display.input); } catch(e) { } + if (hasFocus || (options.autofocus && !mobile)) setTimeout(bind(onFocus, this), 20); + else onBlur(this); + + operation(this, function() { + for (var opt in optionHandlers) + if (optionHandlers.propertyIsEnumerable(opt)) + optionHandlers[opt](this, options[opt], Init); + for (var i = 0; i < initHooks.length; ++i) initHooks[i](this); + })(); + } + + // DISPLAY CONSTRUCTOR + + function makeDisplay(place) { + var d = {}; + var input = d.input = elt("textarea", null, null, "position: absolute; padding: 0; width: 1px; height: 1em; outline: none;"); + input.setAttribute("wrap", "off"); input.setAttribute("autocorrect", "off"); input.setAttribute("autocapitalize", "off"); + // Wraps and hides input textarea + d.inputDiv = elt("div", [input], null, "overflow: hidden; position: relative; width: 3px; height: 0px;"); + // The actual fake scrollbars. + d.scrollbarH = elt("div", [elt("div", null, null, "height: 1px")], "CodeMirror-hscrollbar"); + d.scrollbarV = elt("div", [elt("div", null, null, "width: 1px")], "CodeMirror-vscrollbar"); + d.scrollbarFiller = elt("div", null, "CodeMirror-scrollbar-filler"); + // DIVs containing the selection and the actual code + d.lineDiv = elt("div"); + d.selectionDiv = elt("div", null, null, "position: relative; z-index: 1"); + // Blinky cursor, and element used to ensure cursor fits at the end of a line + d.cursor = elt("pre", "\u00a0", "CodeMirror-cursor"); + // Secondary cursor, shown when on a 'jump' in bi-directional text + d.otherCursor = elt("pre", "\u00a0", "CodeMirror-cursor CodeMirror-secondarycursor"); + // Used to measure text size + d.measure = elt("div", null, "CodeMirror-measure"); + // Wraps everything that needs to exist inside the vertically-padded coordinate system + d.lineSpace = elt("div", [d.measure, d.selectionDiv, d.lineDiv, d.cursor, d.otherCursor], + null, "position: relative; outline: none"); + // Moved around its parent to cover visible view + d.mover = elt("div", [elt("div", [d.lineSpace], "CodeMirror-lines")], null, "position: relative"); + // Set to the height of the text, causes scrolling + d.sizer = elt("div", [d.mover], "CodeMirror-sizer"); + // D is needed because behavior of elts with overflow: auto and padding is inconsistent across browsers + d.heightForcer = elt("div", "\u00a0", null, "position: absolute; height: " + scrollerCutOff + "px"); + // Will contain the gutters, if any + d.gutters = elt("div", null, "CodeMirror-gutters"); + d.lineGutter = null; + // Helper element to properly size the gutter backgrounds + var scrollerInner = elt("div", [d.sizer, d.heightForcer, d.gutters], null, "position: relative; min-height: 100%"); + // Provides scrolling + d.scroller = elt("div", [scrollerInner], "CodeMirror-scroll"); + d.scroller.setAttribute("tabIndex", "-1"); + // The element in which the editor lives. + d.wrapper = elt("div", [d.inputDiv, d.scrollbarH, d.scrollbarV, + d.scrollbarFiller, d.scroller], "CodeMirror"); + // Work around IE7 z-index bug + if (ie_lt8) { d.gutters.style.zIndex = -1; d.scroller.style.paddingRight = 0; } + if (place.appendChild) place.appendChild(d.wrapper); else place(d.wrapper); + + // Needed to hide big blue blinking cursor on Mobile Safari + if (ios) input.style.width = "0px"; + if (!webkit) d.scroller.draggable = true; + // Needed to handle Tab key in KHTML + if (khtml) { d.inputDiv.style.height = "1px"; d.inputDiv.style.position = "absolute"; } + // Need to set a minimum width to see the scrollbar on IE7 (but must not set it on IE8). + else if (ie_lt8) d.scrollbarH.style.minWidth = d.scrollbarV.style.minWidth = "18px"; + + // Current visible range (may be bigger than the view window). + d.viewOffset = d.showingFrom = d.showingTo = d.lastSizeC = 0; + + // Used to only resize the line number gutter when necessary (when + // the amount of lines crosses a boundary that makes its width change) + d.lineNumWidth = d.lineNumInnerWidth = d.lineNumChars = null; + // See readInput and resetInput + d.prevInput = ""; + // Set to true when a non-horizontal-scrolling widget is added. As + // an optimization, widget aligning is skipped when d is false. + d.alignWidgets = false; + // Flag that indicates whether we currently expect input to appear + // (after some event like 'keypress' or 'input') and are polling + // intensively. + d.pollingFast = false; + // Self-resetting timeout for the poller + d.poll = new Delayed(); + // True when a drag from the editor is active + d.draggingText = false; + + d.cachedCharWidth = d.cachedTextHeight = null; + d.measureLineCache = []; + d.measureLineCachePos = 0; + + // Tracks when resetInput has punted to just putting a short + // string instead of the (large) selection. + d.inaccurateSelection = false; + + // Used to adjust overwrite behaviour when a paste has been + // detected + d.pasteIncoming = false; + + return d; + } + + // VIEW CONSTRUCTOR + + function makeView(doc) { + var selPos = {line: 0, ch: 0}; + return { + doc: doc, + // frontier is the point up to which the content has been parsed, + frontier: 0, highlight: new Delayed(), + sel: {from: selPos, to: selPos, head: selPos, anchor: selPos, shift: false, extend: false}, + scrollTop: 0, scrollLeft: 0, + overwrite: false, focused: false, + // Tracks the maximum line length so that + // the horizontal scrollbar can be kept + // static when scrolling. + maxLine: getLine(doc, 0), + maxLineLength: 0, + maxLineChanged: false, + suppressEdits: false, + goalColumn: null, + cantEdit: false, + keyMaps: [] + }; + } + + // STATE UPDATES + + // Used to get the editor into a consistent state again when options change. + + function loadMode(cm) { + var doc = cm.view.doc; + cm.view.mode = CodeMirror.getMode(cm.options, cm.options.mode); + doc.iter(0, doc.size, function(line) { line.stateAfter = null; }); + cm.view.frontier = 0; + startWorker(cm, 100); + } + + function wrappingChanged(cm) { + var doc = cm.view.doc, th = textHeight(cm.display); + if (cm.options.lineWrapping) { + cm.display.wrapper.className += " CodeMirror-wrap"; + var perLine = cm.display.scroller.clientWidth / charWidth(cm.display) - 3; + doc.iter(0, doc.size, function(line) { + if (line.height == 0) return; + var guess = Math.ceil(line.text.length / perLine) || 1; + if (guess != 1) updateLineHeight(line, guess * th); + }); + cm.display.sizer.style.minWidth = ""; + } else { + cm.display.wrapper.className = cm.display.wrapper.className.replace(" CodeMirror-wrap", ""); + computeMaxLength(cm.view); + doc.iter(0, doc.size, function(line) { + if (line.height != 0) updateLineHeight(line, th); + }); + } + regChange(cm, 0, doc.size); + clearCaches(cm); + setTimeout(function(){updateScrollbars(cm.display, cm.view.doc.height);}, 100); + } + + function keyMapChanged(cm) { + var style = keyMap[cm.options.keyMap].style; + cm.display.wrapper.className = cm.display.wrapper.className.replace(/\s*cm-keymap-\S+/g, "") + + (style ? " cm-keymap-" + style : ""); + } + + function themeChanged(cm) { + cm.display.wrapper.className = cm.display.wrapper.className.replace(/\s*cm-s-\S+/g, "") + + cm.options.theme.replace(/(^|\s)\s*/g, " cm-s-"); + clearCaches(cm); + } + + function guttersChanged(cm) { + updateGutters(cm); + updateDisplay(cm, true); + } + + function updateGutters(cm) { + var gutters = cm.display.gutters, specs = cm.options.gutters; + removeChildren(gutters); + for (var i = 0; i < specs.length; ++i) { + var gutterClass = specs[i]; + var gElt = gutters.appendChild(elt("div", null, "CodeMirror-gutter " + gutterClass)); + if (gutterClass == "CodeMirror-linenumbers") { + cm.display.lineGutter = gElt; + gElt.style.width = (cm.display.lineNumWidth || 1) + "px"; + } + } + gutters.style.display = i ? "" : "none"; + } + + function lineLength(doc, line) { + if (line.height == 0) return 0; + var len = line.text.length, merged, cur = line; + while (merged = collapsedSpanAtStart(cur)) { + var found = merged.find(); + cur = getLine(doc, found.from.line); + len += found.from.ch - found.to.ch; + } + cur = line; + while (merged = collapsedSpanAtEnd(cur)) { + var found = merged.find(); + len -= cur.text.length - found.from.ch; + cur = getLine(doc, found.to.line); + len += cur.text.length - found.to.ch; + } + return len; + } + + function computeMaxLength(view) { + view.maxLine = getLine(view.doc, 0); + view.maxLineLength = lineLength(view.doc, view.maxLine); + view.maxLineChanged = true; + view.doc.iter(1, view.doc.size, function(line) { + var len = lineLength(view.doc, line); + if (len > view.maxLineLength) { + view.maxLineLength = len; + view.maxLine = line; + } + }); + } + + // Make sure the gutters options contains the element + // "CodeMirror-linenumbers" when the lineNumbers option is true. + function setGuttersForLineNumbers(options) { + var found = false; + for (var i = 0; i < options.gutters.length; ++i) { + if (options.gutters[i] == "CodeMirror-linenumbers") { + if (options.lineNumbers) found = true; + else options.gutters.splice(i--, 1); + } + } + if (!found && options.lineNumbers) + options.gutters.push("CodeMirror-linenumbers"); + } + + // SCROLLBARS + + // Re-synchronize the fake scrollbars with the actual size of the + // content. Optionally force a scrollTop. + function updateScrollbars(d /* display */, docHeight) { + var totalHeight = docHeight + 2 * paddingTop(d); + d.sizer.style.minHeight = d.heightForcer.style.top = totalHeight + "px"; + var scrollHeight = Math.max(totalHeight, d.scroller.scrollHeight); + var needsH = d.scroller.scrollWidth > d.scroller.clientWidth; + var needsV = scrollHeight > d.scroller.clientHeight; + if (needsV) { + d.scrollbarV.style.display = "block"; + d.scrollbarV.style.bottom = needsH ? scrollbarWidth(d.measure) + "px" : "0"; + d.scrollbarV.firstChild.style.height = + (scrollHeight - d.scroller.clientHeight + d.scrollbarV.clientHeight) + "px"; + } else d.scrollbarV.style.display = ""; + if (needsH) { + d.scrollbarH.style.display = "block"; + d.scrollbarH.style.right = needsV ? scrollbarWidth(d.measure) + "px" : "0"; + d.scrollbarH.firstChild.style.width = + (d.scroller.scrollWidth - d.scroller.clientWidth + d.scrollbarH.clientWidth) + "px"; + } else d.scrollbarH.style.display = ""; + if (needsH && needsV) { + d.scrollbarFiller.style.display = "block"; + d.scrollbarFiller.style.height = d.scrollbarFiller.style.width = scrollbarWidth(d.measure) + "px"; + } else d.scrollbarFiller.style.display = ""; + + if (mac_geLion && scrollbarWidth(d.measure) === 0) + d.scrollbarV.style.minWidth = d.scrollbarH.style.minHeight = mac_geMountainLion ? "18px" : "12px"; + } + + function visibleLines(display, doc, viewPort) { + var top = display.scroller.scrollTop, height = display.wrapper.clientHeight; + if (typeof viewPort == "number") top = viewPort; + else if (viewPort) {top = viewPort.top; height = viewPort.bottom - viewPort.top;} + top = Math.floor(top - paddingTop(display)); + var bottom = Math.ceil(top + height); + return {from: lineAtHeight(doc, top), to: lineAtHeight(doc, bottom)}; + } + + // LINE NUMBERS + + function alignHorizontally(cm) { + var display = cm.display; + if (!display.alignWidgets && !display.gutters.firstChild) return; + var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.view.scrollLeft; + var gutterW = display.gutters.offsetWidth, l = comp + "px"; + for (var n = display.lineDiv.firstChild; n; n = n.nextSibling) if (n.alignable) { + for (var i = 0, a = n.alignable; i < a.length; ++i) a[i].style.left = l; + } + display.gutters.style.left = (comp + gutterW) + "px"; + } + + function maybeUpdateLineNumberWidth(cm) { + if (!cm.options.lineNumbers) return false; + var doc = cm.view.doc, last = lineNumberFor(cm.options, doc.size - 1), display = cm.display; + if (last.length != display.lineNumChars) { + var test = display.measure.appendChild(elt("div", [elt("div", last)], + "CodeMirror-linenumber CodeMirror-gutter-elt")); + var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW; + display.lineGutter.style.width = ""; + display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding); + display.lineNumWidth = display.lineNumInnerWidth + padding; + display.lineNumChars = display.lineNumInnerWidth ? last.length : -1; + display.lineGutter.style.width = display.lineNumWidth + "px"; + return true; + } + return false; + } + + function lineNumberFor(options, i) { + return String(options.lineNumberFormatter(i + options.firstLineNumber)); + } + function compensateForHScroll(display) { + return display.scroller.getBoundingClientRect().left - display.sizer.getBoundingClientRect().left; + } + + // DISPLAY DRAWING + + function updateDisplay(cm, changes, viewPort) { + var oldFrom = cm.display.showingFrom, oldTo = cm.display.showingTo; + var updated = updateDisplayInner(cm, changes, viewPort); + if (updated) { + signalLater(cm, cm, "update", cm); + if (cm.display.showingFrom != oldFrom || cm.display.showingTo != oldTo) + signalLater(cm, cm, "viewportChange", cm, cm.display.showingFrom, cm.display.showingTo); + } + updateSelection(cm); + updateScrollbars(cm.display, cm.view.doc.height); + + return updated; + } + + // Uses a set of changes plus the current scroll position to + // determine which DOM updates have to be made, and makes the + // updates. + function updateDisplayInner(cm, changes, viewPort) { + var display = cm.display, doc = cm.view.doc; + if (!display.wrapper.clientWidth) { + display.showingFrom = display.showingTo = display.viewOffset = 0; + return; + } + + // Compute the new visible window + // If scrollTop is specified, use that to determine which lines + // to render instead of the current scrollbar position. + var visible = visibleLines(display, doc, viewPort); + // Bail out if the visible area is already rendered and nothing changed. + if (changes !== true && changes.length == 0 && + visible.from > display.showingFrom && visible.to < display.showingTo) + return; + + if (changes && maybeUpdateLineNumberWidth(cm)) + changes = true; + display.sizer.style.marginLeft = display.scrollbarH.style.left = display.gutters.offsetWidth + "px"; + + // When merged lines are present, the line that needs to be + // redrawn might not be the one that was changed. + if (changes !== true && sawCollapsedSpans) + for (var i = 0; i < changes.length; ++i) { + var ch = changes[i], merged; + while (merged = collapsedSpanAtStart(getLine(doc, ch.from))) { + var from = merged.find().from.line; + if (ch.diff) ch.diff -= ch.from - from; + ch.from = from; + } + } + + // Used to determine which lines need their line numbers updated + var positionsChangedFrom = changes === true ? 0 : Infinity; + if (cm.options.lineNumbers && changes && changes !== true) + for (var i = 0; i < changes.length; ++i) + if (changes[i].diff) { positionsChangedFrom = changes[i].from; break; } + + var from = Math.max(visible.from - cm.options.viewportMargin, 0); + var to = Math.min(doc.size, visible.to + cm.options.viewportMargin); + if (display.showingFrom < from && from - display.showingFrom < 20) from = display.showingFrom; + if (display.showingTo > to && display.showingTo - to < 20) to = Math.min(doc.size, display.showingTo); + if (sawCollapsedSpans) { + from = lineNo(visualLine(doc, getLine(doc, from))); + while (to < doc.size && lineIsHidden(getLine(doc, to))) ++to; + } + + // Create a range of theoretically intact lines, and punch holes + // in that using the change info. + var intact = changes === true ? [] : + computeIntact([{from: display.showingFrom, to: display.showingTo}], changes); + // Clip off the parts that won't be visible + var intactLines = 0; + for (var i = 0; i < intact.length; ++i) { + var range = intact[i]; + if (range.from < from) range.from = from; + if (range.to > to) range.to = to; + if (range.from >= range.to) intact.splice(i--, 1); + else intactLines += range.to - range.from; + } + if (intactLines == to - from && from == display.showingFrom && to == display.showingTo) + return; + intact.sort(function(a, b) {return a.from - b.from;}); + + if (intactLines < (to - from) * .7) display.lineDiv.style.display = "none"; + patchDisplay(cm, from, to, intact, positionsChangedFrom); + display.lineDiv.style.display = ""; + + var different = from != display.showingFrom || to != display.showingTo || + display.lastSizeC != display.wrapper.clientHeight; + // This is just a bogus formula that detects when the editor is + // resized or the font size changes. + if (different) display.lastSizeC = display.wrapper.clientHeight; + display.showingFrom = from; display.showingTo = to; + startWorker(cm, 100); + + var prevBottom = display.lineDiv.offsetTop; + for (var node = display.lineDiv.firstChild, height; node; node = node.nextSibling) if (node.lineObj) { + if (ie_lt8) { + var bot = node.offsetTop + node.offsetHeight; + height = bot - prevBottom; + prevBottom = bot; + } else { + var box = node.getBoundingClientRect(); + height = box.bottom - box.top; + } + var diff = node.lineObj.height - height; + if (height < 2) height = textHeight(display); + if (diff > .001 || diff < -.001) + updateLineHeight(node.lineObj, height); + } + display.viewOffset = heightAtLine(cm, getLine(doc, from)); + // Position the mover div to align with the current virtual scroll position + display.mover.style.top = display.viewOffset + "px"; + return true; + } + + function computeIntact(intact, changes) { + for (var i = 0, l = changes.length || 0; i < l; ++i) { + var change = changes[i], intact2 = [], diff = change.diff || 0; + for (var j = 0, l2 = intact.length; j < l2; ++j) { + var range = intact[j]; + if (change.to <= range.from && change.diff) { + intact2.push({from: range.from + diff, to: range.to + diff}); + } else if (change.to <= range.from || change.from >= range.to) { + intact2.push(range); + } else { + if (change.from > range.from) + intact2.push({from: range.from, to: change.from}); + if (change.to < range.to) + intact2.push({from: change.to + diff, to: range.to + diff}); + } + } + intact = intact2; + } + return intact; + } + + function getDimensions(cm) { + var d = cm.display, left = {}, width = {}; + for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) { + left[cm.options.gutters[i]] = n.offsetLeft; + width[cm.options.gutters[i]] = n.offsetWidth; + } + return {fixedPos: compensateForHScroll(d), + gutterTotalWidth: d.gutters.offsetWidth, + gutterLeft: left, + gutterWidth: width, + wrapperWidth: d.wrapper.clientWidth}; + } + + function patchDisplay(cm, from, to, intact, updateNumbersFrom) { + var dims = getDimensions(cm); + var display = cm.display, lineNumbers = cm.options.lineNumbers; + // IE does bad things to nodes when .innerHTML = "" is used on a parent + // we still need widgets and markers intact to add back to the new content later + if (!intact.length && !ie && (!webkit || !cm.display.currentWheelTarget)) + removeChildren(display.lineDiv); + var container = display.lineDiv, cur = container.firstChild; + + function rm(node) { + var next = node.nextSibling; + if (webkit && mac && cm.display.currentWheelTarget == node) { + node.style.display = "none"; + node.lineObj = null; + } else { + container.removeChild(node); + } + return next; + } + + var nextIntact = intact.shift(), lineNo = from; + cm.view.doc.iter(from, to, function(line) { + if (nextIntact && nextIntact.to == lineNo) nextIntact = intact.shift(); + if (lineIsHidden(line)) { + if (line.height != 0) updateLineHeight(line, 0); + } else if (nextIntact && nextIntact.from <= lineNo && nextIntact.to > lineNo) { + // This line is intact. Skip to the actual node. Update its + // line number if needed. + while (cur.lineObj != line) cur = rm(cur); + if (lineNumbers && updateNumbersFrom <= lineNo && cur.lineNumber) + setTextContent(cur.lineNumber, lineNumberFor(cm.options, lineNo)); + cur = cur.nextSibling; + } else { + // This line needs to be generated. + var lineNode = buildLineElement(cm, line, lineNo, dims); + container.insertBefore(lineNode, cur); + lineNode.lineObj = line; + } + ++lineNo; + }); + while (cur) cur = rm(cur); + } + + function buildLineElement(cm, line, lineNo, dims) { + var lineElement = lineContent(cm, line); + var markers = line.gutterMarkers, display = cm.display; + + if (!cm.options.lineNumbers && !markers && !line.bgClass && !line.wrapClass && + (!line.widgets || !line.widgets.length)) return lineElement; + + // Lines with gutter elements or a background class need + // to be wrapped again, and have the extra elements added + // to the wrapper div + + var wrap = elt("div", null, line.wrapClass, "position: relative"); + if (cm.options.lineNumbers || markers) { + var gutterWrap = wrap.appendChild(elt("div", null, null, "position: absolute; left: " + + dims.fixedPos + "px")); + wrap.alignable = [gutterWrap]; + if (cm.options.lineNumbers && (!markers || !markers["CodeMirror-linenumbers"])) + wrap.lineNumber = gutterWrap.appendChild( + elt("div", lineNumberFor(cm.options, lineNo), + "CodeMirror-linenumber CodeMirror-gutter-elt", + "left: " + dims.gutterLeft["CodeMirror-linenumbers"] + "px; width: " + + display.lineNumInnerWidth + "px")); + if (markers) + for (var k = 0; k < cm.options.gutters.length; ++k) { + var id = cm.options.gutters[k], found = markers.hasOwnProperty(id) && markers[id]; + if (found) + gutterWrap.appendChild(elt("div", [found], "CodeMirror-gutter-elt", "left: " + + dims.gutterLeft[id] + "px; width: " + dims.gutterWidth[id] + "px")); + } + } + // Kludge to make sure the styled element lies behind the selection (by z-index) + if (line.bgClass) + wrap.appendChild(elt("div", "\u00a0", line.bgClass + " CodeMirror-linebackground")); + wrap.appendChild(lineElement); + if (line.widgets) + for (var i = 0, ws = line.widgets; i < ws.length; ++i) { + var widget = ws[i], node = elt("div", [widget.node], "CodeMirror-linewidget"); + node.widget = widget; + if (widget.noHScroll) { + (wrap.alignable || (wrap.alignable = [])).push(node); + var width = dims.wrapperWidth; + node.style.left = dims.fixedPos + "px"; + if (!widget.coverGutter) { + width -= dims.gutterTotalWidth; + node.style.paddingLeft = dims.gutterTotalWidth + "px"; + } + node.style.width = width + "px"; + } + if (widget.coverGutter) { + node.style.zIndex = 5; + node.style.position = "relative"; + if (!widget.noHScroll) node.style.marginLeft = -dims.gutterTotalWidth + "px"; + } + if (widget.above) + wrap.insertBefore(node, cm.options.lineNumbers && line.height != 0 ? gutterWrap : lineElement); + else + wrap.appendChild(node); + } + + if (ie_lt8) wrap.style.zIndex = 2; + return wrap; + } + + // SELECTION / CURSOR + + function updateSelection(cm) { + var display = cm.display; + var collapsed = posEq(cm.view.sel.from, cm.view.sel.to); + if (collapsed || cm.options.showCursorWhenSelecting) + updateSelectionCursor(cm); + else + display.cursor.style.display = display.otherCursor.style.display = "none"; + if (!collapsed) + updateSelectionRange(cm); + else + display.selectionDiv.style.display = "none"; + + // Move the hidden textarea near the cursor to prevent scrolling artifacts + var headPos = cursorCoords(cm, cm.view.sel.head, "div"); + var wrapOff = display.wrapper.getBoundingClientRect(), lineOff = display.lineDiv.getBoundingClientRect(); + display.inputDiv.style.top = Math.max(0, Math.min(display.wrapper.clientHeight - 10, + headPos.top + lineOff.top - wrapOff.top)) + "px"; + display.inputDiv.style.left = Math.max(0, Math.min(display.wrapper.clientWidth - 10, + headPos.left + lineOff.left - wrapOff.left)) + "px"; + } + + // No selection, plain cursor + function updateSelectionCursor(cm) { + var display = cm.display, pos = cursorCoords(cm, cm.view.sel.head, "div"); + display.cursor.style.left = pos.left + "px"; + display.cursor.style.top = pos.top + "px"; + display.cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + "px"; + display.cursor.style.display = ""; + + if (pos.other) { + display.otherCursor.style.display = ""; + display.otherCursor.style.left = pos.other.left + "px"; + display.otherCursor.style.top = pos.other.top + "px"; + display.otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + "px"; + } else { display.otherCursor.style.display = "none"; } + } + + // Highlight selection + function updateSelectionRange(cm) { + var display = cm.display, doc = cm.view.doc, sel = cm.view.sel; + var fragment = document.createDocumentFragment(); + var clientWidth = display.lineSpace.offsetWidth, pl = paddingLeft(cm.display); + + function add(left, top, width, bottom) { + if (top < 0) top = 0; + fragment.appendChild(elt("div", null, "CodeMirror-selected", "position: absolute; left: " + left + + "px; top: " + top + "px; width: " + (width == null ? clientWidth - left : width) + + "px; height: " + (bottom - top) + "px")); + } + + function drawForLine(line, fromArg, toArg, retTop) { + var lineObj = getLine(doc, line); + var lineLen = lineObj.text.length, rVal = retTop ? Infinity : -Infinity; + function coords(ch) { + return charCoords(cm, {line: line, ch: ch}, "div", lineObj); + } + + iterateBidiSections(getOrder(lineObj), fromArg || 0, toArg == null ? lineLen : toArg, function(from, to, dir) { + var leftPos = coords(dir == "rtl" ? to - 1 : from); + var rightPos = coords(dir == "rtl" ? from : to - 1); + var left = leftPos.left, right = rightPos.right; + if (rightPos.top - leftPos.top > 3) { // Different lines, draw top part + add(left, leftPos.top, null, leftPos.bottom); + left = pl; + if (leftPos.bottom < rightPos.top) add(left, leftPos.bottom, null, rightPos.top); + } + if (toArg == null && to == lineLen) right = clientWidth; + if (fromArg == null && from == 0) left = pl; + rVal = retTop ? Math.min(rightPos.top, rVal) : Math.max(rightPos.bottom, rVal); + if (left < pl + 1) left = pl; + add(left, rightPos.top, right - left, rightPos.bottom); + }); + return rVal; + } + + if (sel.from.line == sel.to.line) { + drawForLine(sel.from.line, sel.from.ch, sel.to.ch); + } else { + var fromObj = getLine(doc, sel.from.line); + var cur = fromObj, merged, path = [sel.from.line, sel.from.ch], singleLine; + while (merged = collapsedSpanAtEnd(cur)) { + var found = merged.find(); + path.push(found.from.ch, found.to.line, found.to.ch); + if (found.to.line == sel.to.line) { + path.push(sel.to.ch); + singleLine = true; + break; + } + cur = getLine(doc, found.to.line); + } + + // This is a single, merged line + if (singleLine) { + for (var i = 0; i < path.length; i += 3) + drawForLine(path[i], path[i+1], path[i+2]); + } else { + var middleTop, middleBot, toObj = getLine(doc, sel.to.line); + if (sel.from.ch) + // Draw the first line of selection. + middleTop = drawForLine(sel.from.line, sel.from.ch, null, false); + else + // Simply include it in the middle block. + middleTop = heightAtLine(cm, fromObj) - display.viewOffset; + + if (!sel.to.ch) + middleBot = heightAtLine(cm, toObj) - display.viewOffset; + else + middleBot = drawForLine(sel.to.line, collapsedSpanAtStart(toObj) ? null : 0, sel.to.ch, true); + + if (middleTop < middleBot) add(pl, middleTop, null, middleBot); + } + } + + removeChildrenAndAdd(display.selectionDiv, fragment); + display.selectionDiv.style.display = ""; + } + + // Cursor-blinking + function restartBlink(cm) { + var display = cm.display; + clearInterval(display.blinker); + var on = true; + display.cursor.style.visibility = display.otherCursor.style.visibility = ""; + display.blinker = setInterval(function() { + if (!display.cursor.offsetHeight) return; + display.cursor.style.visibility = display.otherCursor.style.visibility = (on = !on) ? "" : "hidden"; + }, cm.options.cursorBlinkRate); + } + + // HIGHLIGHT WORKER + + function startWorker(cm, time) { + if (cm.view.frontier < cm.display.showingTo) + cm.view.highlight.set(time, bind(highlightWorker, cm)); + } + + function highlightWorker(cm) { + var view = cm.view, doc = view.doc; + if (view.frontier >= cm.display.showingTo) return; + var end = +new Date + cm.options.workTime; + var state = copyState(view.mode, getStateBefore(cm, view.frontier)); + var changed = [], prevChange; + doc.iter(view.frontier, Math.min(doc.size, cm.display.showingTo + 500), function(line) { + if (view.frontier >= cm.display.showingFrom) { // Visible + if (highlightLine(cm, line, state) && view.frontier >= cm.display.showingFrom) { + if (prevChange && prevChange.end == view.frontier) prevChange.end++; + else changed.push(prevChange = {start: view.frontier, end: view.frontier + 1}); + } + line.stateAfter = copyState(view.mode, state); + } else { + processLine(cm, line, state); + line.stateAfter = view.frontier % 5 == 0 ? copyState(view.mode, state) : null; + } + ++view.frontier; + if (+new Date > end) { + startWorker(cm, cm.options.workDelay); + return true; + } + }); + if (changed.length) + operation(cm, function() { + for (var i = 0; i < changed.length; ++i) + regChange(this, changed[i].start, changed[i].end); + })(); + } + + // Finds the line to start with when starting a parse. Tries to + // find a line with a stateAfter, so that it can start with a + // valid state. If that fails, it returns the line with the + // smallest indentation, which tends to need the least context to + // parse correctly. + function findStartLine(cm, n) { + var minindent, minline, doc = cm.view.doc; + for (var search = n, lim = n - 100; search > lim; --search) { + if (search == 0) return 0; + var line = getLine(doc, search-1); + if (line.stateAfter) return search; + var indented = countColumn(line.text, null, cm.options.tabSize); + if (minline == null || minindent > indented) { + minline = search - 1; + minindent = indented; + } + } + return minline; + } + + function getStateBefore(cm, n) { + var view = cm.view; + var pos = findStartLine(cm, n), state = pos && getLine(view.doc, pos-1).stateAfter; + if (!state) state = startState(view.mode); + else state = copyState(view.mode, state); + view.doc.iter(pos, n, function(line) { + processLine(cm, line, state); + var save = pos == n - 1 || pos % 5 == 0 || pos >= view.showingFrom && pos < view.showingTo; + line.stateAfter = save ? copyState(view.mode, state) : null; + ++pos; + }); + return state; + } + + // POSITION MEASUREMENT + + function paddingTop(display) {return display.lineSpace.offsetTop;} + function paddingLeft(display) { + var e = removeChildrenAndAdd(display.measure, elt("pre")).appendChild(elt("span", "x")); + return e.offsetLeft; + } + + function measureChar(cm, line, ch, data) { + var data = data || measureLine(cm, line), dir = -1; + for (var pos = ch;; pos += dir) { + var r = data[pos]; + if (r) break; + if (dir < 0 && pos == 0) dir = 1; + } + return {left: pos < ch ? r.right : r.left, + right: pos > ch ? r.left : r.right, + top: r.top, bottom: r.bottom}; + } + + function measureLine(cm, line) { + // First look in the cache + var display = cm.display, cache = cm.display.measureLineCache; + for (var i = 0; i < cache.length; ++i) { + var memo = cache[i]; + if (memo.text == line.text && memo.markedSpans == line.markedSpans && + display.scroller.clientWidth == memo.width) + return memo.measure; + } + + var measure = measureLineInner(cm, line); + // Store result in the cache + var memo = {text: line.text, width: display.scroller.clientWidth, + markedSpans: line.markedSpans, measure: measure}; + if (cache.length == 16) cache[++display.measureLineCachePos % 16] = memo; + else cache.push(memo); + return measure; + } + + function measureLineInner(cm, line) { + var display = cm.display, measure = emptyArray(line.text.length); + var pre = lineContent(cm, line, measure); + + // IE does not cache element positions of inline elements between + // calls to getBoundingClientRect. This makes the loop below, + // which gathers the positions of all the characters on the line, + // do an amount of layout work quadratic to the number of + // characters. When line wrapping is off, we try to improve things + // by first subdividing the line into a bunch of inline blocks, so + // that IE can reuse most of the layout information from caches + // for those blocks. This does interfere with line wrapping, so it + // doesn't work when wrapping is on, but in that case the + // situation is slightly better, since IE does cache line-wrapping + // information and only recomputes per-line. + if (ie && !ie_lt8 && !cm.options.lineWrapping && pre.childNodes.length > 100) { + var fragment = document.createDocumentFragment(); + var chunk = 10, n = pre.childNodes.length; + for (var i = 0, chunks = Math.ceil(n / chunk); i < chunks; ++i) { + var wrap = elt("div", null, null, "display: inline-block"); + for (var j = 0; j < chunk && n; ++j) { + wrap.appendChild(pre.firstChild); + --n; + } + fragment.appendChild(wrap); + } + pre.appendChild(fragment); + } + + removeChildrenAndAdd(display.measure, pre); + + var outer = display.lineDiv.getBoundingClientRect(); + var vranges = [], data = emptyArray(line.text.length), maxBot = pre.offsetHeight; + for (var i = 0, cur; i < measure.length; ++i) if (cur = measure[i]) { + var size = cur.getBoundingClientRect(); + var top = Math.max(0, size.top - outer.top), bot = Math.min(size.bottom - outer.top, maxBot); + for (var j = 0; j < vranges.length; j += 2) { + var rtop = vranges[j], rbot = vranges[j+1]; + if (rtop > bot || rbot < top) continue; + if (rtop <= top && rbot >= bot || + top <= rtop && bot >= rbot || + Math.min(bot, rbot) - Math.max(top, rtop) >= (bot - top) >> 1) { + vranges[j] = Math.min(top, rtop); + vranges[j+1] = Math.max(bot, rbot); + break; + } + } + if (j == vranges.length) vranges.push(top, bot); + data[i] = {left: size.left - outer.left, right: size.right - outer.left, top: j}; + } + for (var i = 0, cur; i < data.length; ++i) if (cur = data[i]) { + var vr = cur.top; + cur.top = vranges[vr]; cur.bottom = vranges[vr+1]; + } + return data; + } + + function clearCaches(cm) { + cm.display.measureLineCache.length = cm.display.measureLineCachePos = 0; + cm.display.cachedCharWidth = cm.display.cachedTextHeight = null; + cm.view.maxLineChanged = true; + } + + // Context is one of "line", "div" (display.lineDiv), "local"/null (editor), or "page" + function intoCoordSystem(cm, lineObj, rect, context) { + if (lineObj.widgets) for (var i = 0; i < lineObj.widgets.length; ++i) if (lineObj.widgets[i].above) { + var size = lineObj.widgets[i].node.offsetHeight; + rect.top += size; rect.bottom += size; + } + if (context == "line") return rect; + if (!context) context = "local"; + var yOff = heightAtLine(cm, lineObj); + if (context != "local") yOff -= cm.display.viewOffset; + if (context == "page") { + var lOff = cm.display.lineSpace.getBoundingClientRect(); + yOff += lOff.top + (window.pageYOffset || (document.documentElement || document.body).scrollTop); + var xOff = lOff.left + (window.pageXOffset || (document.documentElement || document.body).scrollLeft); + rect.left += xOff; rect.right += xOff; + } + rect.top += yOff; rect.bottom += yOff; + return rect; + } + + function charCoords(cm, pos, context, lineObj) { + if (!lineObj) lineObj = getLine(cm.view.doc, pos.line); + return intoCoordSystem(cm, lineObj, measureChar(cm, lineObj, pos.ch), context); + } + + function cursorCoords(cm, pos, context, lineObj, measurement) { + lineObj = lineObj || getLine(cm.view.doc, pos.line); + if (!measurement) measurement = measureLine(cm, lineObj); + function get(ch, right) { + var m = measureChar(cm, lineObj, ch, measurement); + if (right) m.left = m.right; else m.right = m.left; + return intoCoordSystem(cm, lineObj, m, context); + } + var order = getOrder(lineObj), ch = pos.ch; + if (!order) return get(ch); + var main, other, linedir = order[0].level; + for (var i = 0; i < order.length; ++i) { + var part = order[i], rtl = part.level % 2, nb, here; + if (part.from < ch && part.to > ch) return get(ch, rtl); + var left = rtl ? part.to : part.from, right = rtl ? part.from : part.to; + if (left == ch) { + // Opera and IE return bogus offsets and widths for edges + // where the direction flips, but only for the side with the + // lower level. So we try to use the side with the higher + // level. + if (i && part.level < (nb = order[i-1]).level) here = get(nb.level % 2 ? nb.from : nb.to - 1, true); + else here = get(rtl && part.from != part.to ? ch - 1 : ch); + if (rtl == linedir) main = here; else other = here; + } else if (right == ch) { + var nb = i < order.length - 1 && order[i+1]; + if (!rtl && nb && nb.from == nb.to) continue; + if (nb && part.level < nb.level) here = get(nb.level % 2 ? nb.to - 1 : nb.from); + else here = get(rtl ? ch : ch - 1, true); + if (rtl == linedir) main = here; else other = here; + } + } + if (linedir && !ch) other = get(order[0].to - 1); + if (!main) return other; + if (other) main.other = other; + return main; + } + + // Coords must be lineSpace-local + function coordsChar(cm, x, y) { + var doc = cm.view.doc; + y += cm.display.viewOffset; + if (y < 0) return {line: 0, ch: 0, outside: true}; + var lineNo = lineAtHeight(doc, y); + if (lineNo >= doc.size) return {line: doc.size - 1, ch: getLine(doc, doc.size - 1).text.length}; + if (x < 0) x = 0; + + for (;;) { + var lineObj = getLine(doc, lineNo); + var found = coordsCharInner(cm, lineObj, lineNo, x, y); + var merged = collapsedSpanAtEnd(lineObj); + if (merged && found.ch == lineRight(lineObj)) + lineNo = merged.find().to.line; + else + return found; + } + } + + function coordsCharInner(cm, lineObj, lineNo, x, y) { + var innerOff = y - heightAtLine(cm, lineObj); + var wrongLine = false, cWidth = cm.display.wrapper.clientWidth; + var measurement = measureLine(cm, lineObj); + + function getX(ch) { + var sp = cursorCoords(cm, {line: lineNo, ch: ch}, "line", + lineObj, measurement); + wrongLine = true; + if (innerOff > sp.bottom) return Math.max(0, sp.left - cWidth); + else if (innerOff < sp.top) return sp.left + cWidth; + else wrongLine = false; + return sp.left; + } + + var bidi = getOrder(lineObj), dist = lineObj.text.length; + var from = lineLeft(lineObj), to = lineRight(lineObj); + var fromX = paddingLeft(cm.display), toX = getX(to); + + if (x > toX) return {line: lineNo, ch: to, outside: wrongLine}; + // Do a binary search between these bounds. + for (;;) { + if (bidi ? to == from || to == moveVisually(lineObj, from, 1) : to - from <= 1) { + var after = x - fromX < toX - x, ch = after ? from : to; + while (isExtendingChar.test(lineObj.text.charAt(ch))) ++ch; + return {line: lineNo, ch: ch, after: after, outside: wrongLine}; + } + var step = Math.ceil(dist / 2), middle = from + step; + if (bidi) { + middle = from; + for (var i = 0; i < step; ++i) middle = moveVisually(lineObj, middle, 1); + } + var middleX = getX(middle); + if (middleX > x) {to = middle; toX = middleX; if (wrongLine) toX += 1000; dist -= step;} + else {from = middle; fromX = middleX; dist = step;} + } + } + + var measureText; + function textHeight(display) { + if (display.cachedTextHeight != null) return display.cachedTextHeight; + if (measureText == null) { + measureText = elt("pre"); + // Measure a bunch of lines, for browsers that compute + // fractional heights. + for (var i = 0; i < 49; ++i) { + measureText.appendChild(document.createTextNode("x")); + measureText.appendChild(elt("br")); + } + measureText.appendChild(document.createTextNode("x")); + } + removeChildrenAndAdd(display.measure, measureText); + var height = measureText.offsetHeight / 50; + if (height > 3) display.cachedTextHeight = height; + removeChildren(display.measure); + return height || 1; + } + + function charWidth(display) { + if (display.cachedCharWidth != null) return display.cachedCharWidth; + var anchor = elt("span", "x"); + var pre = elt("pre", [anchor]); + removeChildrenAndAdd(display.measure, pre); + var width = anchor.offsetWidth; + if (width > 2) display.cachedCharWidth = width; + return width || 10; + } + + // OPERATIONS + + // Operations are used to wrap changes in such a way that each + // change won't have to update the cursor and display (which would + // be awkward, slow, and error-prone), but instead updates are + // batched and then all combined and executed at once. + + function startOperation(cm) { + if (cm.curOp) ++cm.curOp.depth; + else cm.curOp = { + // Nested operations delay update until the outermost one + // finishes. + depth: 1, + // An array of ranges of lines that have to be updated. See + // updateDisplay. + changes: [], + delayedCallbacks: [], + updateInput: null, + userSelChange: null, + textChanged: null, + selectionChanged: false, + updateMaxLine: false, + id: ++cm.nextOpId + }; + } + + function endOperation(cm) { + var op = cm.curOp; + if (--op.depth) return; + cm.curOp = null; + var view = cm.view, display = cm.display; + if (op.updateMaxLine) computeMaxLength(view); + if (view.maxLineChanged && !cm.options.lineWrapping) { + var width = measureChar(cm, view.maxLine, view.maxLine.text.length).right; + display.sizer.style.minWidth = (width + 3 + scrollerCutOff) + "px"; + view.maxLineChanged = false; + } + var newScrollPos, updated; + if (op.selectionChanged) { + var coords = cursorCoords(cm, view.sel.head); + newScrollPos = calculateScrollPos(cm, coords.left, coords.top, coords.left, coords.bottom); + } + if (op.changes.length || newScrollPos && newScrollPos.scrollTop != null) + updated = updateDisplay(cm, op.changes, newScrollPos && newScrollPos.scrollTop); + if (!updated && op.selectionChanged) updateSelection(cm); + if (newScrollPos) scrollCursorIntoView(cm); + if (op.selectionChanged) restartBlink(cm); + + if (view.focused && op.updateInput) + resetInput(cm, op.userSelChange); + + if (op.textChanged) + signal(cm, "change", cm, op.textChanged); + if (op.selectionChanged) signal(cm, "cursorActivity", cm); + for (var i = 0; i < op.delayedCallbacks.length; ++i) op.delayedCallbacks[i](cm); + } + + // Wraps a function in an operation. Returns the wrapped function. + function operation(cm1, f) { + return function() { + var cm = cm1 || this; + startOperation(cm); + try {var result = f.apply(cm, arguments);} + finally {endOperation(cm);} + return result; + }; + } + + function regChange(cm, from, to, lendiff) { + cm.curOp.changes.push({from: from, to: to, diff: lendiff}); + } + + // INPUT HANDLING + + function slowPoll(cm) { + if (cm.view.pollingFast) return; + cm.display.poll.set(cm.options.pollInterval, function() { + readInput(cm); + if (cm.view.focused) slowPoll(cm); + }); + } + + function fastPoll(cm) { + var missed = false; + cm.display.pollingFast = true; + function p() { + var changed = readInput(cm); + if (!changed && !missed) {missed = true; cm.display.poll.set(60, p);} + else {cm.display.pollingFast = false; slowPoll(cm);} + } + cm.display.poll.set(20, p); + } + + // prevInput is a hack to work with IME. If we reset the textarea + // on every change, that breaks IME. So we look for changes + // compared to the previous content instead. (Modern browsers have + // events that indicate IME taking place, but these are not widely + // supported or compatible enough yet to rely on.) + function readInput(cm) { + var input = cm.display.input, prevInput = cm.display.prevInput, view = cm.view, sel = view.sel; + if (!view.focused || hasSelection(input) || isReadOnly(cm)) return false; + var text = input.value; + if (text == prevInput && posEq(sel.from, sel.to)) return false; + startOperation(cm); + view.sel.shift = false; + var same = 0, l = Math.min(prevInput.length, text.length); + while (same < l && prevInput[same] == text[same]) ++same; + var from = sel.from, to = sel.to; + if (same < prevInput.length) + from = {line: from.line, ch: from.ch - (prevInput.length - same)}; + else if (view.overwrite && posEq(from, to) && !cm.display.pasteIncoming) + to = {line: to.line, ch: Math.min(getLine(cm.view.doc, to.line).text.length, to.ch + (text.length - same))}; + var updateInput = cm.curOp.updateInput; + updateDoc(cm, from, to, splitLines(text.slice(same)), "end", + cm.display.pasteIncoming ? "paste" : "input", {from: from, to: to}); + cm.curOp.updateInput = updateInput; + if (text.length > 1000) input.value = cm.display.prevInput = ""; + else cm.display.prevInput = text; + endOperation(cm); + cm.display.pasteIncoming = false; + return true; + } + + function resetInput(cm, user) { + var view = cm.view, minimal, selected; + if (!posEq(view.sel.from, view.sel.to)) { + cm.display.prevInput = ""; + minimal = hasCopyEvent && + (view.sel.to.line - view.sel.from.line > 100 || (selected = cm.getSelection()).length > 1000); + if (minimal) cm.display.input.value = "-"; + else cm.display.input.value = selected || cm.getSelection(); + if (view.focused) selectInput(cm.display.input); + } else if (user) cm.display.prevInput = cm.display.input.value = ""; + cm.display.inaccurateSelection = minimal; + } + + function focusInput(cm) { + if (cm.options.readOnly != "nocursor" && (ie || document.activeElement != cm.display.input)) + cm.display.input.focus(); + } + + function isReadOnly(cm) { + return cm.options.readOnly || cm.view.cantEdit; + } + + // EVENT HANDLERS + + function registerEventHandlers(cm) { + var d = cm.display; + on(d.scroller, "mousedown", operation(cm, onMouseDown)); + on(d.scroller, "dblclick", operation(cm, e_preventDefault)); + on(d.lineSpace, "selectstart", function(e) { + if (!mouseEventInWidget(d, e)) e_preventDefault(e); + }); + // Gecko browsers fire contextmenu *after* opening the menu, at + // which point we can't mess with it anymore. Context menu is + // handled in onMouseDown for Gecko. + if (!gecko) on(d.scroller, "contextmenu", function(e) {onContextMenu(cm, e);}); + + on(d.scroller, "scroll", function() { + setScrollTop(cm, d.scroller.scrollTop); + setScrollLeft(cm, d.scroller.scrollLeft, true); + signal(cm, "scroll", cm); + }); + on(d.scrollbarV, "scroll", function() { + setScrollTop(cm, d.scrollbarV.scrollTop); + }); + on(d.scrollbarH, "scroll", function() { + setScrollLeft(cm, d.scrollbarH.scrollLeft); + }); + + on(d.scroller, "mousewheel", function(e){onScrollWheel(cm, e);}); + on(d.scroller, "DOMMouseScroll", function(e){onScrollWheel(cm, e);}); + + function reFocus() { if (cm.view.focused) setTimeout(bind(focusInput, cm), 0); } + on(d.scrollbarH, "mousedown", reFocus); + on(d.scrollbarV, "mousedown", reFocus); + // Prevent wrapper from ever scrolling + on(d.wrapper, "scroll", function() { d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; }); + on(window, "resize", function resizeHandler() { + // Might be a text scaling operation, clear size caches. + d.cachedCharWidth = d.cachedTextHeight = null; + clearCaches(cm); + if (d.wrapper.parentNode) updateDisplay(cm, true); + else off(window, "resize", resizeHandler); + }); + + on(d.input, "keyup", operation(cm, function(e) { + if (cm.options.onKeyEvent && cm.options.onKeyEvent(cm, addStop(e))) return; + if (e_prop(e, "keyCode") == 16) cm.view.sel.shift = false; + })); + on(d.input, "input", bind(fastPoll, cm)); + on(d.input, "keydown", operation(cm, onKeyDown)); + on(d.input, "keypress", operation(cm, onKeyPress)); + on(d.input, "focus", bind(onFocus, cm)); + on(d.input, "blur", bind(onBlur, cm)); + + function drag_(e) { + if (cm.options.onDragEvent && cm.options.onDragEvent(cm, addStop(e))) return; + e_stop(e); + } + if (cm.options.dragDrop) { + on(d.scroller, "dragstart", function(e){onDragStart(cm, e);}); + on(d.scroller, "dragenter", drag_); + on(d.scroller, "dragover", drag_); + on(d.scroller, "drop", operation(cm, onDrop)); + } + on(d.scroller, "paste", function(){focusInput(cm); fastPoll(cm);}); + on(d.input, "paste", function() { + d.pasteIncoming = true; + fastPoll(cm); + }); + + function prepareCopy() { + if (d.inaccurateSelection) { + d.prevInput = ""; + d.inaccurateSelection = false; + d.input.value = cm.getSelection(); + selectInput(d.input); + } + } + on(d.input, "cut", prepareCopy); + on(d.input, "copy", prepareCopy); + + // Needed to handle Tab key in KHTML + if (khtml) on(d.sizer, "mouseup", function() { + if (document.activeElement == d.input) d.input.blur(); + focusInput(cm); + }); + } + + function mouseEventInWidget(display, e) { + for (var n = e_target(e); n != display.wrapper; n = n.parentNode) + if (/\bCodeMirror-(?:line)?widget\b/.test(n.className) || + n.parentNode == display.sizer && n != display.mover) return true; + } + + function posFromMouse(cm, e, liberal) { + var display = cm.display; + if (!liberal) { + var target = e_target(e); + if (target == display.scrollbarH || target == display.scrollbarH.firstChild || + target == display.scrollbarV || target == display.scrollbarV.firstChild || + target == display.scrollbarFiller) return null; + } + var x, y, space = display.lineSpace.getBoundingClientRect(); + // Fails unpredictably on IE[67] when mouse is dragged around quickly. + try { x = e.clientX; y = e.clientY; } catch (e) { return null; } + return coordsChar(cm, x - space.left, y - space.top); + } + + var lastClick, lastDoubleClick; + function onMouseDown(e) { + var cm = this, display = cm.display, view = cm.view, sel = view.sel, doc = view.doc; + sel.shift = e_prop(e, "shiftKey"); + + if (mouseEventInWidget(display, e)) { + if (!webkit) { + display.scroller.draggable = false; + setTimeout(function(){display.scroller.draggable = true;}, 100); + } + return; + } + if (clickInGutter(cm, e)) return; + var start = posFromMouse(cm, e); + + switch (e_button(e)) { + case 3: + if (gecko) onContextMenu.call(cm, cm, e); + return; + case 2: + if (start) extendSelection(cm, start); + setTimeout(bind(focusInput, cm), 20); + e_preventDefault(e); + return; + } + // For button 1, if it was clicked inside the editor + // (posFromMouse returning non-null), we have to adjust the + // selection. + if (!start) {if (e_target(e) == display.scroller) e_preventDefault(e); return;} + + if (!view.focused) onFocus(cm); + + var now = +new Date, type = "single"; + if (lastDoubleClick && lastDoubleClick.time > now - 400 && posEq(lastDoubleClick.pos, start)) { + type = "triple"; + e_preventDefault(e); + setTimeout(bind(focusInput, cm), 20); + selectLine(cm, start.line); + } else if (lastClick && lastClick.time > now - 400 && posEq(lastClick.pos, start)) { + type = "double"; + lastDoubleClick = {time: now, pos: start}; + e_preventDefault(e); + var word = findWordAt(getLine(doc, start.line).text, start); + extendSelection(cm, word.from, word.to); + } else { lastClick = {time: now, pos: start}; } + + var last = start; + if (cm.options.dragDrop && dragAndDrop && !isReadOnly(cm) && !posEq(sel.from, sel.to) && + !posLess(start, sel.from) && !posLess(sel.to, start) && type == "single") { + var dragEnd = operation(cm, function(e2) { + if (webkit) display.scroller.draggable = false; + view.draggingText = false; + off(document, "mouseup", dragEnd); + off(display.scroller, "drop", dragEnd); + if (Math.abs(e.clientX - e2.clientX) + Math.abs(e.clientY - e2.clientY) < 10) { + e_preventDefault(e2); + extendSelection(cm, start); + focusInput(cm); + } + }); + // Let the drag handler handle this. + if (webkit) display.scroller.draggable = true; + view.draggingText = dragEnd; + // IE's approach to draggable + if (display.scroller.dragDrop) display.scroller.dragDrop(); + on(document, "mouseup", dragEnd); + on(display.scroller, "drop", dragEnd); + return; + } + e_preventDefault(e); + if (type == "single") extendSelection(cm, clipPos(doc, start)); + + var startstart = sel.from, startend = sel.to; + + function doSelect(cur) { + if (type == "single") { + extendSelection(cm, clipPos(doc, start), cur); + return; + } + + startstart = clipPos(doc, startstart); + startend = clipPos(doc, startend); + if (type == "double") { + var word = findWordAt(getLine(doc, cur.line).text, cur); + if (posLess(cur, startstart)) extendSelection(cm, word.from, startend); + else extendSelection(cm, startstart, word.to); + } else if (type == "triple") { + if (posLess(cur, startstart)) extendSelection(cm, startend, clipPos(doc, {line: cur.line, ch: 0})); + else extendSelection(cm, startstart, clipPos(doc, {line: cur.line + 1, ch: 0})); + } + } + + var editorSize = display.wrapper.getBoundingClientRect(); + // Used to ensure timeout re-tries don't fire when another extend + // happened in the meantime (clearTimeout isn't reliable -- at + // least on Chrome, the timeouts still happen even when cleared, + // if the clear happens after their scheduled firing time). + var counter = 0; + + function extend(e) { + var curCount = ++counter; + var cur = posFromMouse(cm, e, true); + if (!cur) return; + if (!posEq(cur, last)) { + if (!view.focused) onFocus(cm); + last = cur; + doSelect(cur); + var visible = visibleLines(display, doc); + if (cur.line >= visible.to || cur.line < visible.from) + setTimeout(operation(cm, function(){if (counter == curCount) extend(e);}), 150); + } else { + var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0; + if (outside) setTimeout(operation(cm, function() { + if (counter != curCount) return; + display.scroller.scrollTop += outside; + extend(e); + }), 50); + } + } + + function done(e) { + counter = Infinity; + var cur = posFromMouse(cm, e); + if (cur) doSelect(cur); + e_preventDefault(e); + focusInput(cm); + off(document, "mousemove", move); + off(document, "mouseup", up); + } + + var move = operation(cm, function(e) { + if (!ie && !e_button(e)) done(e); + else extend(e); + }); + var up = operation(cm, done); + on(document, "mousemove", move); + on(document, "mouseup", up); + } + + function onDrop(e) { + var cm = this; + if (cm.options.onDragEvent && cm.options.onDragEvent(cm, addStop(e))) return; + e_preventDefault(e); + var pos = posFromMouse(cm, e, true), files = e.dataTransfer.files; + if (!pos || isReadOnly(cm)) return; + if (files && files.length && window.FileReader && window.File) { + var n = files.length, text = Array(n), read = 0; + var loadFile = function(file, i) { + var reader = new FileReader; + reader.onload = function() { + text[i] = reader.result; + if (++read == n) { + pos = clipPos(cm.view.doc, pos); + operation(cm, function() { + var end = replaceRange(cm, text.join(""), pos, pos, "paste"); + setSelection(cm, pos, end); + })(); + } + }; + reader.readAsText(file); + }; + for (var i = 0; i < n; ++i) loadFile(files[i], i); + } else { + // Don't do a replace if the drop happened inside of the selected text. + if (cm.view.draggingText && !(posLess(pos, cm.view.sel.from) || posLess(cm.view.sel.to, pos))) { + cm.view.draggingText(e); + if (ie) setTimeout(bind(focusInput, cm), 50); + return; + } + try { + var text = e.dataTransfer.getData("Text"); + if (text) { + var curFrom = cm.view.sel.from, curTo = cm.view.sel.to; + setSelection(cm, pos, pos); + if (cm.view.draggingText) replaceRange(cm, "", curFrom, curTo, "paste"); + cm.replaceSelection(text, null, "paste"); + focusInput(cm); + onFocus(cm); + } + } + catch(e){} + } + } + + function clickInGutter(cm, e) { + var display = cm.display; + try { var mX = e.clientX, mY = e.clientY; } + catch(e) { return false; } + + if (mX >= Math.floor(display.gutters.getBoundingClientRect().right)) return false; + e_preventDefault(e); + if (!hasHandler(cm, "gutterClick")) return true; + + var lineBox = display.lineDiv.getBoundingClientRect(); + if (mY > lineBox.bottom) return true; + mY -= lineBox.top - display.viewOffset; + + for (var i = 0; i < cm.options.gutters.length; ++i) { + var g = display.gutters.childNodes[i]; + if (g && g.getBoundingClientRect().right >= mX) { + var line = lineAtHeight(cm.view.doc, mY); + var gutter = cm.options.gutters[i]; + signalLater(cm, cm, "gutterClick", cm, line, gutter, e); + break; + } + } + return true; + } + + function onDragStart(cm, e) { + var txt = cm.getSelection(); + e.dataTransfer.setData("Text", txt); + + // Use dummy image instead of default browsers image. + // Recent Safari (~6.0.2) have a tendency to segfault when this happens, so we don't do it there. + if (e.dataTransfer.setDragImage && !safari) + e.dataTransfer.setDragImage(elt('img'), 0, 0); + } + + function setScrollTop(cm, val) { + if (Math.abs(cm.view.scrollTop - val) < 2) return; + cm.view.scrollTop = val; + if (!gecko) updateDisplay(cm, [], val); + if (cm.display.scroller.scrollTop != val) cm.display.scroller.scrollTop = val; + if (cm.display.scrollbarV.scrollTop != val) cm.display.scrollbarV.scrollTop = val; + if (gecko) updateDisplay(cm, []); + } + function setScrollLeft(cm, val, isScroller) { + if (isScroller ? val == cm.view.scrollLeft : Math.abs(cm.view.scrollLeft - val) < 2) return; + cm.view.scrollLeft = val; + alignHorizontally(cm); + if (cm.display.scroller.scrollLeft != val) cm.display.scroller.scrollLeft = val; + if (cm.display.scrollbarH.scrollLeft != val) cm.display.scrollbarH.scrollLeft = val; + } + + // Since the delta values reported on mouse wheel events are + // unstandardized between browsers and even browser versions, and + // generally horribly unpredictable, this code starts by measuring + // the scroll effect that the first few mouse wheel events have, + // and, from that, detects the way it can convert deltas to pixel + // offsets afterwards. + // + // The reason we want to know the amount a wheel event will scroll + // is that it gives us a chance to update the display before the + // actual scrolling happens, reducing flickering. + + var wheelSamples = 0, wheelDX, wheelDY, wheelStartX, wheelStartY, wheelPixelsPerUnit = null; + // Fill in a browser-detected starting value on browsers where we + // know one. These don't have to be accurate -- the result of them + // being wrong would just be a slight flicker on the first wheel + // scroll (if it is large enough). + if (ie) wheelPixelsPerUnit = -.53; + else if (gecko) wheelPixelsPerUnit = 15; + else if (chrome) wheelPixelsPerUnit = -.7; + else if (safari) wheelPixelsPerUnit = -1/3; + + function onScrollWheel(cm, e) { + var dx = e.wheelDeltaX, dy = e.wheelDeltaY; + if (dx == null && e.detail && e.axis == e.HORIZONTAL_AXIS) dx = e.detail; + if (dy == null && e.detail && e.axis == e.VERTICAL_AXIS) dy = e.detail; + else if (dy == null) dy = e.wheelDelta; + + // Webkit browsers on OS X abort momentum scrolls when the target + // of the scroll event is removed from the scrollable element. + // This hack (see related code in patchDisplay) makes sure the + // element is kept around. + if (dy && mac && webkit) { + for (var cur = e.target; cur != scroll; cur = cur.parentNode) { + if (cur.lineObj) { + cm.display.currentWheelTarget = cur; + break; + } + } + } + + var scroll = cm.display.scroller; + // On some browsers, horizontal scrolling will cause redraws to + // happen before the gutter has been realigned, causing it to + // wriggle around in a most unseemly way. When we have an + // estimated pixels/delta value, we just handle horizontal + // scrolling entirely here. It'll be slightly off from native, but + // better than glitching out. + if (dx && !gecko && !opera && wheelPixelsPerUnit != null) { + if (dy) + setScrollTop(cm, Math.max(0, Math.min(scroll.scrollTop + dy * wheelPixelsPerUnit, scroll.scrollHeight - scroll.clientHeight))); + setScrollLeft(cm, Math.max(0, Math.min(scroll.scrollLeft + dx * wheelPixelsPerUnit, scroll.scrollWidth - scroll.clientWidth))); + e_preventDefault(e); + wheelStartX = null; // Abort measurement, if in progress + return; + } + + if (dy && wheelPixelsPerUnit != null) { + var pixels = dy * wheelPixelsPerUnit; + var top = cm.view.scrollTop, bot = top + cm.display.wrapper.clientHeight; + if (pixels < 0) top = Math.max(0, top + pixels - 50); + else bot = Math.min(cm.view.doc.height, bot + pixels + 50); + updateDisplay(cm, [], {top: top, bottom: bot}); + } + + if (wheelSamples < 20) { + if (wheelStartX == null) { + wheelStartX = scroll.scrollLeft; wheelStartY = scroll.scrollTop; + wheelDX = dx; wheelDY = dy; + setTimeout(function() { + if (wheelStartX == null) return; + var movedX = scroll.scrollLeft - wheelStartX; + var movedY = scroll.scrollTop - wheelStartY; + var sample = (movedY && wheelDY && movedY / wheelDY) || + (movedX && wheelDX && movedX / wheelDX); + wheelStartX = wheelStartY = null; + if (!sample) return; + wheelPixelsPerUnit = (wheelPixelsPerUnit * wheelSamples + sample) / (wheelSamples + 1); + ++wheelSamples; + }, 200); + } else { + wheelDX += dx; wheelDY += dy; + } + } + } + + function doHandleBinding(cm, bound, dropShift) { + if (typeof bound == "string") { + bound = commands[bound]; + if (!bound) return false; + } + // Ensure previous input has been read, so that the handler sees a + // consistent view of the document + if (cm.display.pollingFast && readInput(cm)) cm.display.pollingFast = false; + var view = cm.view, prevShift = view.sel.shift; + try { + if (isReadOnly(cm)) view.suppressEdits = true; + if (dropShift) view.sel.shift = false; + bound(cm); + } catch(e) { + if (e != Pass) throw e; + return false; + } finally { + view.sel.shift = prevShift; + view.suppressEdits = false; + } + return true; + } + + function allKeyMaps(cm) { + var maps = cm.view.keyMaps.slice(0); + maps.push(cm.options.keyMap); + if (cm.options.extraKeys) maps.unshift(cm.options.extraKeys); + return maps; + } + + var maybeTransition; + function handleKeyBinding(cm, e) { + // Handle auto keymap transitions + var startMap = getKeyMap(cm.options.keyMap), next = startMap.auto; + clearTimeout(maybeTransition); + if (next && !isModifierKey(e)) maybeTransition = setTimeout(function() { + if (getKeyMap(cm.options.keyMap) == startMap) + cm.options.keyMap = (next.call ? next.call(null, cm) : next); + }, 50); + + var name = keyNames[e_prop(e, "keyCode")], handled = false; + var flipCtrlCmd = mac && (opera || qtwebkit); + if (name == null || e.altGraphKey) return false; + if (e_prop(e, "altKey")) name = "Alt-" + name; + if (e_prop(e, flipCtrlCmd ? "metaKey" : "ctrlKey")) name = "Ctrl-" + name; + if (e_prop(e, flipCtrlCmd ? "ctrlKey" : "metaKey")) name = "Cmd-" + name; + + var stopped = false; + function stop() { stopped = true; } + var keymaps = allKeyMaps(cm); + + if (e_prop(e, "shiftKey")) { + handled = lookupKey("Shift-" + name, keymaps, + function(b) {return doHandleBinding(cm, b, true);}, stop) + || lookupKey(name, keymaps, function(b) { + if (typeof b == "string" && /^go[A-Z]/.test(b)) return doHandleBinding(cm, b); + }, stop); + } else { + handled = lookupKey(name, keymaps, + function(b) { return doHandleBinding(cm, b); }, stop); + } + if (stopped) handled = false; + if (handled) { + e_preventDefault(e); + restartBlink(cm); + if (ie_lt9) { e.oldKeyCode = e.keyCode; e.keyCode = 0; } + } + return handled; + } + + function handleCharBinding(cm, e, ch) { + var handled = lookupKey("'" + ch + "'", allKeyMaps(cm), + function(b) { return doHandleBinding(cm, b, true); }); + if (handled) { + e_preventDefault(e); + restartBlink(cm); + } + return handled; + } + + var lastStoppedKey = null; + function onKeyDown(e) { + var cm = this; + if (!cm.view.focused) onFocus(cm); + if (ie && e.keyCode == 27) { e.returnValue = false; } + if (cm.options.onKeyEvent && cm.options.onKeyEvent(cm, addStop(e))) return; + var code = e_prop(e, "keyCode"); + // IE does strange things with escape. + cm.view.sel.shift = code == 16 || e_prop(e, "shiftKey"); + // First give onKeyEvent option a chance to handle this. + var handled = handleKeyBinding(cm, e); + if (opera) { + lastStoppedKey = handled ? code : null; + // Opera has no cut event... we try to at least catch the key combo + if (!handled && code == 88 && !hasCopyEvent && e_prop(e, mac ? "metaKey" : "ctrlKey")) + cm.replaceSelection(""); + } + } + + function onKeyPress(e) { + var cm = this; + if (cm.options.onKeyEvent && cm.options.onKeyEvent(cm, addStop(e))) return; + var keyCode = e_prop(e, "keyCode"), charCode = e_prop(e, "charCode"); + if (opera && keyCode == lastStoppedKey) {lastStoppedKey = null; e_preventDefault(e); return;} + if (((opera && (!e.which || e.which < 10)) || khtml) && handleKeyBinding(cm, e)) return; + var ch = String.fromCharCode(charCode == null ? keyCode : charCode); + if (this.options.electricChars && this.view.mode.electricChars && + this.options.smartIndent && !isReadOnly(this) && + this.view.mode.electricChars.indexOf(ch) > -1) + setTimeout(operation(cm, function() {indentLine(cm, cm.view.sel.to.line, "smart");}), 75); + if (handleCharBinding(cm, e, ch)) return; + fastPoll(cm); + } + + function onFocus(cm) { + if (cm.options.readOnly == "nocursor") return; + if (!cm.view.focused) { + signal(cm, "focus", cm); + cm.view.focused = true; + if (cm.display.scroller.className.search(/\bCodeMirror-focused\b/) == -1) + cm.display.scroller.className += " CodeMirror-focused"; + resetInput(cm, true); + } + slowPoll(cm); + restartBlink(cm); + } + function onBlur(cm) { + if (cm.view.focused) { + signal(cm, "blur", cm); + cm.view.focused = false; + cm.display.scroller.className = cm.display.scroller.className.replace(" CodeMirror-focused", ""); + } + clearInterval(cm.display.blinker); + setTimeout(function() {if (!cm.view.focused) cm.view.sel.shift = false;}, 150); + } + + var detectingSelectAll; + function onContextMenu(cm, e) { + var display = cm.display, sel = cm.view.sel; + var pos = posFromMouse(cm, e), scrollPos = display.scroller.scrollTop; + if (!pos || opera) return; // Opera is difficult. + if (posEq(sel.from, sel.to) || posLess(pos, sel.from) || !posLess(pos, sel.to)) + operation(cm, setSelection)(cm, pos, pos); + + var oldCSS = display.input.style.cssText; + display.inputDiv.style.position = "absolute"; + display.input.style.cssText = "position: fixed; width: 30px; height: 30px; top: " + (e.clientY - 5) + + "px; left: " + (e.clientX - 5) + "px; z-index: 1000; background: white; outline: none;" + + "border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);"; + focusInput(cm); + resetInput(cm, true); + // Adds "Select all" to context menu in FF + if (posEq(sel.from, sel.to)) display.input.value = display.prevInput = " "; + + function rehide() { + display.inputDiv.style.position = "relative"; + display.input.style.cssText = oldCSS; + if (ie_lt9) display.scrollbarV.scrollTop = display.scroller.scrollTop = scrollPos; + slowPoll(cm); + + // Try to detect the user choosing select-all + if (display.input.selectionStart != null) { + clearTimeout(detectingSelectAll); + var extval = display.input.value = " " + (posEq(sel.from, sel.to) ? "" : display.input.value), i = 0; + display.prevInput = " "; + display.input.selectionStart = 1; display.input.selectionEnd = extval.length; + detectingSelectAll = setTimeout(function poll(){ + if (display.prevInput == " " && display.input.selectionStart == 0) + operation(cm, commands.selectAll)(cm); + else if (i++ < 10) detectingSelectAll = setTimeout(poll, 500); + else resetInput(cm); + }, 200); + } + } + + if (gecko) { + e_stop(e); + on(window, "mouseup", function mouseup() { + off(window, "mouseup", mouseup); + setTimeout(rehide, 20); + }); + } else { + setTimeout(rehide, 50); + } + } + + // UPDATING + + // Replace the range from from to to by the strings in newText. + // Afterwards, set the selection to selFrom, selTo. + function updateDoc(cm, from, to, newText, selUpdate, origin) { + // Possibly split or suppress the update based on the presence + // of read-only spans in its range. + var split = sawReadOnlySpans && + removeReadOnlyRanges(cm.view.doc, from, to); + if (split) { + for (var i = split.length - 1; i >= 1; --i) + updateDocInner(cm, split[i].from, split[i].to, [""], origin); + if (split.length) + return updateDocInner(cm, split[0].from, split[0].to, newText, selUpdate, origin); + } else { + return updateDocInner(cm, from, to, newText, selUpdate, origin); + } + } + + function updateDocInner(cm, from, to, newText, selUpdate, origin) { + if (cm.view.suppressEdits) return; + + var view = cm.view, doc = view.doc, old = []; + doc.iter(from.line, to.line + 1, function(line) { + old.push(newHL(line.text, line.markedSpans)); + }); + var startSelFrom = view.sel.from, startSelTo = view.sel.to; + var lines = updateMarkedSpans(hlSpans(old[0]), hlSpans(lst(old)), from.ch, to.ch, newText); + var retval = updateDocNoUndo(cm, from, to, lines, selUpdate, origin); + if (view.history) addChange(cm, from.line, newText.length, old, origin, + startSelFrom, startSelTo, view.sel.from, view.sel.to); + return retval; + } + + function unredoHelper(cm, type) { + var doc = cm.view.doc, hist = cm.view.history; + var set = (type == "undo" ? hist.done : hist.undone).pop(); + if (!set) return; + var anti = {events: [], fromBefore: set.fromAfter, toBefore: set.toAfter, + fromAfter: set.fromBefore, toAfter: set.toBefore}; + for (var i = set.events.length - 1; i >= 0; i -= 1) { + hist.dirtyCounter += type == "undo" ? -1 : 1; + var change = set.events[i]; + var replaced = [], end = change.start + change.added; + doc.iter(change.start, end, function(line) { replaced.push(newHL(line.text, line.markedSpans)); }); + anti.events.push({start: change.start, added: change.old.length, old: replaced}); + var selPos = i ? null : {from: set.fromBefore, to: set.toBefore}; + updateDocNoUndo(cm, {line: change.start, ch: 0}, {line: end - 1, ch: getLine(doc, end-1).text.length}, + change.old, selPos, type); + } + (type == "undo" ? hist.undone : hist.done).push(anti); + } + + function updateDocNoUndo(cm, from, to, lines, selUpdate, origin) { + var view = cm.view, doc = view.doc, display = cm.display; + if (view.suppressEdits) return; + + var nlines = to.line - from.line, firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line); + var recomputeMaxLength = false, checkWidthStart = from.line; + if (!cm.options.lineWrapping) { + checkWidthStart = lineNo(visualLine(doc, firstLine)); + doc.iter(checkWidthStart, to.line + 1, function(line) { + if (lineLength(doc, line) == view.maxLineLength) { + recomputeMaxLength = true; + return true; + } + }); + } + + var lastHL = lst(lines), th = textHeight(display); + + // First adjust the line structure + if (from.ch == 0 && to.ch == 0 && hlText(lastHL) == "") { + // This is a whole-line replace. Treated specially to make + // sure line objects move the way they are supposed to. + var added = []; + for (var i = 0, e = lines.length - 1; i < e; ++i) + added.push(makeLine(hlText(lines[i]), hlSpans(lines[i]), th)); + updateLine(cm, lastLine, lastLine.text, hlSpans(lastHL)); + if (nlines) doc.remove(from.line, nlines, cm); + if (added.length) doc.insert(from.line, added); + } else if (firstLine == lastLine) { + if (lines.length == 1) { + updateLine(cm, firstLine, firstLine.text.slice(0, from.ch) + hlText(lines[0]) + + firstLine.text.slice(to.ch), hlSpans(lines[0])); + } else { + for (var added = [], i = 1, e = lines.length - 1; i < e; ++i) + added.push(makeLine(hlText(lines[i]), hlSpans(lines[i]), th)); + added.push(makeLine(hlText(lastHL) + firstLine.text.slice(to.ch), hlSpans(lastHL), th)); + updateLine(cm, firstLine, firstLine.text.slice(0, from.ch) + hlText(lines[0]), hlSpans(lines[0])); + doc.insert(from.line + 1, added); + } + } else if (lines.length == 1) { + updateLine(cm, firstLine, firstLine.text.slice(0, from.ch) + hlText(lines[0]) + + lastLine.text.slice(to.ch), hlSpans(lines[0])); + doc.remove(from.line + 1, nlines, cm); + } else { + var added = []; + updateLine(cm, firstLine, firstLine.text.slice(0, from.ch) + hlText(lines[0]), hlSpans(lines[0])); + updateLine(cm, lastLine, hlText(lastHL) + lastLine.text.slice(to.ch), hlSpans(lastHL)); + for (var i = 1, e = lines.length - 1; i < e; ++i) + added.push(makeLine(hlText(lines[i]), hlSpans(lines[i]), th)); + if (nlines > 1) doc.remove(from.line + 1, nlines - 1, cm); + doc.insert(from.line + 1, added); + } + + if (cm.options.lineWrapping) { + var perLine = Math.max(5, display.scroller.clientWidth / charWidth(display) - 3); + doc.iter(from.line, from.line + lines.length, function(line) { + if (line.height == 0) return; + var guess = (Math.ceil(line.text.length / perLine) || 1) * th; + if (guess != line.height) updateLineHeight(line, guess); + }); + } else { + doc.iter(checkWidthStart, from.line + lines.length, function(line) { + var len = lineLength(doc, line); + if (len > view.maxLineLength) { + view.maxLine = line; + view.maxLineLength = len; + view.maxLineChanged = true; + recomputeMaxLength = false; + } + }); + if (recomputeMaxLength) cm.curOp.updateMaxLine = true; + } + + // Adjust frontier, schedule worker + view.frontier = Math.min(view.frontier, from.line); + startWorker(cm, 400); + + var lendiff = lines.length - nlines - 1; + // Remember that these lines changed, for updating the display + regChange(cm, from.line, to.line + 1, lendiff); + if (hasHandler(cm, "change")) { + // Normalize lines to contain only strings, since that's what + // the change event handler expects + for (var i = 0; i < lines.length; ++i) + if (typeof lines[i] != "string") lines[i] = lines[i].text; + var changeObj = {from: from, to: to, text: lines, origin: origin}; + if (cm.curOp.textChanged) { + for (var cur = cm.curOp.textChanged; cur.next; cur = cur.next) {} + cur.next = changeObj; + } else cm.curOp.textChanged = changeObj; + } + + // Update the selection + var newSelFrom, newSelTo, end = {line: from.line + lines.length - 1, + ch: hlText(lastHL).length + (lines.length == 1 ? from.ch : 0)}; + if (selUpdate && typeof selUpdate != "string") { + if (selUpdate.from) { newSelFrom = selUpdate.from; newSelTo = selUpdate.to; } + else newSelFrom = newSelTo = selUpdate; + } else if (selUpdate == "end") { + newSelFrom = newSelTo = end; + } else if (selUpdate == "start") { + newSelFrom = newSelTo = from; + } else if (selUpdate == "around") { + newSelFrom = from; newSelTo = end; + } else { + var adjustPos = function(pos) { + if (posLess(pos, from)) return pos; + if (!posLess(to, pos)) return end; + var line = pos.line + lendiff; + var ch = pos.ch; + if (pos.line == to.line) + ch += hlText(lastHL).length - (to.ch - (to.line == from.line ? from.ch : 0)); + return {line: line, ch: ch}; + }; + newSelFrom = adjustPos(view.sel.from); + newSelTo = adjustPos(view.sel.to); + } + setSelection(cm, newSelFrom, newSelTo, null, true); + return end; + } + + function replaceRange(cm, code, from, to, origin) { + if (!to) to = from; + if (posLess(to, from)) { var tmp = to; to = from; from = tmp; } + return updateDoc(cm, from, to, splitLines(code), null, origin); + } + + // SELECTION + + function posEq(a, b) {return a.line == b.line && a.ch == b.ch;} + function posLess(a, b) {return a.line < b.line || (a.line == b.line && a.ch < b.ch);} + function copyPos(x) {return {line: x.line, ch: x.ch};} + + function clipLine(doc, n) {return Math.max(0, Math.min(n, doc.size-1));} + function clipPos(doc, pos) { + if (pos.line < 0) return {line: 0, ch: 0}; + if (pos.line >= doc.size) return {line: doc.size-1, ch: getLine(doc, doc.size-1).text.length}; + var ch = pos.ch, linelen = getLine(doc, pos.line).text.length; + if (ch == null || ch > linelen) return {line: pos.line, ch: linelen}; + else if (ch < 0) return {line: pos.line, ch: 0}; + else return pos; + } + function isLine(doc, l) {return l >= 0 && l < doc.size;} + + // If shift is held, this will move the selection anchor. Otherwise, + // it'll set the whole selection. + function extendSelection(cm, pos, other, bias) { + var sel = cm.view.sel; + if (sel.shift || sel.extend) { + var anchor = sel.anchor; + if (other) { + var posBefore = posLess(pos, anchor); + if (posBefore != posLess(other, anchor)) { + anchor = pos; + pos = other; + } else if (posBefore != posLess(pos, other)) { + pos = other; + } + } + setSelection(cm, anchor, pos, bias); + } else { + setSelection(cm, pos, other || pos, bias); + } + cm.curOp.userSelChange = true; + } + + // Update the selection. Last two args are only used by + // updateDoc, since they have to be expressed in the line + // numbers before the update. + function setSelection(cm, anchor, head, bias, checkAtomic) { + cm.view.goalColumn = null; + var sel = cm.view.sel; + // Skip over atomic spans. + if (checkAtomic || !posEq(anchor, sel.anchor)) + anchor = skipAtomic(cm, anchor, bias, checkAtomic != "push"); + if (checkAtomic || !posEq(head, sel.head)) + head = skipAtomic(cm, head, bias, checkAtomic != "push"); + + if (posEq(sel.anchor, anchor) && posEq(sel.head, head)) return; + + sel.anchor = anchor; sel.head = head; + var inv = posLess(head, anchor); + sel.from = inv ? head : anchor; + sel.to = inv ? anchor : head; + + cm.curOp.updateInput = true; + cm.curOp.selectionChanged = true; + } + + function reCheckSelection(cm) { + setSelection(cm, cm.view.sel.from, cm.view.sel.to, null, "push"); + } + + function skipAtomic(cm, pos, bias, mayClear) { + var doc = cm.view.doc, flipped = false, curPos = pos; + var dir = bias || 1; + cm.view.cantEdit = false; + search: for (;;) { + var line = getLine(doc, curPos.line), toClear; + if (line.markedSpans) { + for (var i = 0; i < line.markedSpans.length; ++i) { + var sp = line.markedSpans[i], m = sp.marker; + if ((sp.from == null || (m.inclusiveLeft ? sp.from <= curPos.ch : sp.from < curPos.ch)) && + (sp.to == null || (m.inclusiveRight ? sp.to >= curPos.ch : sp.to > curPos.ch))) { + if (mayClear && m.clearOnEnter) { + (toClear || (toClear = [])).push(m); + continue; + } else if (!m.atomic) continue; + var newPos = m.find()[dir < 0 ? "from" : "to"]; + if (posEq(newPos, curPos)) { + newPos.ch += dir; + if (newPos.ch < 0) { + if (newPos.line) newPos = clipPos(doc, {line: newPos.line - 1}); + else newPos = null; + } else if (newPos.ch > line.text.length) { + if (newPos.line < doc.size - 1) newPos = {line: newPos.line + 1, ch: 0}; + else newPos = null; + } + if (!newPos) { + if (flipped) { + // Driven in a corner -- no valid cursor position found at all + // -- try again *with* clearing, if we didn't already + if (!mayClear) return skipAtomic(cm, pos, bias, true); + // Otherwise, turn off editing until further notice, and return the start of the doc + cm.view.cantEdit = true; + return {line: 0, ch: 0}; + } + flipped = true; newPos = pos; dir = -dir; + } + } + curPos = newPos; + continue search; + } + } + if (toClear) for (var i = 0; i < toClear.length; ++i) toClear[i].clear(); + } + return curPos; + } + } + + // SCROLLING + + function scrollCursorIntoView(cm) { + var view = cm.view; + var coords = scrollPosIntoView(cm, view.sel.head); + if (!view.focused) return; + var display = cm.display, box = display.sizer.getBoundingClientRect(), doScroll = null; + if (coords.top + box.top < 0) doScroll = true; + else if (coords.bottom + box.top > (window.innerHeight || document.documentElement.clientHeight)) doScroll = false; + if (doScroll != null && !phantom) { + var hidden = display.cursor.style.display == "none"; + if (hidden) { + display.cursor.style.display = ""; + display.cursor.style.left = coords.left + "px"; + display.cursor.style.top = (coords.top - display.viewOffset) + "px"; + } + display.cursor.scrollIntoView(doScroll); + if (hidden) display.cursor.style.display = "none"; + } + } + + function scrollPosIntoView(cm, pos) { + for (;;) { + var changed = false, coords = cursorCoords(cm, pos); + var scrollPos = calculateScrollPos(cm, coords.left, coords.top, coords.left, coords.bottom); + var startTop = cm.view.scrollTop, startLeft = cm.view.scrollLeft; + if (scrollPos.scrollTop != null) { + setScrollTop(cm, scrollPos.scrollTop); + if (Math.abs(cm.view.scrollTop - startTop) > 1) changed = true; + } + if (scrollPos.scrollLeft != null) { + setScrollLeft(cm, scrollPos.scrollLeft); + if (Math.abs(cm.view.scrollLeft - startLeft) > 1) changed = true; + } + if (!changed) return coords; + } + } + + function scrollIntoView(cm, x1, y1, x2, y2) { + var scrollPos = calculateScrollPos(cm, x1, y1, x2, y2); + if (scrollPos.scrollTop != null) setScrollTop(cm, scrollPos.scrollTop); + if (scrollPos.scrollLeft != null) setScrollLeft(cm, scrollPos.scrollLeft); + } + + function calculateScrollPos(cm, x1, y1, x2, y2) { + var display = cm.display, pt = paddingTop(display); + y1 += pt; y2 += pt; + var screen = display.scroller.clientHeight - scrollerCutOff, screentop = display.scroller.scrollTop, result = {}; + var docBottom = cm.view.doc.height + 2 * pt; + var atTop = y1 < pt + 10, atBottom = y2 + pt > docBottom - 10; + if (y1 < screentop) result.scrollTop = atTop ? 0 : Math.max(0, y1); + else if (y2 > screentop + screen) result.scrollTop = (atBottom ? docBottom : y2) - screen; + + var screenw = display.scroller.clientWidth - scrollerCutOff, screenleft = display.scroller.scrollLeft; + x1 += display.gutters.offsetWidth; x2 += display.gutters.offsetWidth; + var gutterw = display.gutters.offsetWidth; + var atLeft = x1 < gutterw + 10; + if (x1 < screenleft + gutterw || atLeft) { + if (atLeft) x1 = 0; + result.scrollLeft = Math.max(0, x1 - 10 - gutterw); + } else if (x2 > screenw + screenleft - 3) { + result.scrollLeft = x2 + 10 - screenw; + } + return result; + } + + // API UTILITIES + + function indentLine(cm, n, how, aggressive) { + var doc = cm.view.doc; + if (!how) how = "add"; + if (how == "smart") { + if (!cm.view.mode.indent) how = "prev"; + else var state = getStateBefore(cm, n); + } + + var tabSize = cm.options.tabSize; + var line = getLine(doc, n), curSpace = countColumn(line.text, null, tabSize); + var curSpaceString = line.text.match(/^\s*/)[0], indentation; + if (how == "smart") { + indentation = cm.view.mode.indent(state, line.text.slice(curSpaceString.length), line.text); + if (indentation == Pass) { + if (!aggressive) return; + how = "prev"; + } + } + if (how == "prev") { + if (n) indentation = countColumn(getLine(doc, n-1).text, null, tabSize); + else indentation = 0; + } + else if (how == "add") indentation = curSpace + cm.options.indentUnit; + else if (how == "subtract") indentation = curSpace - cm.options.indentUnit; + indentation = Math.max(0, indentation); + + var indentString = "", pos = 0; + if (cm.options.indentWithTabs) + for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += "\t";} + if (pos < indentation) indentString += spaceStr(indentation - pos); + + if (indentString != curSpaceString) + replaceRange(cm, indentString, {line: n, ch: 0}, {line: n, ch: curSpaceString.length}, "input"); + line.stateAfter = null; + } + + function changeLine(cm, handle, op) { + var no = handle, line = handle, doc = cm.view.doc; + if (typeof handle == "number") line = getLine(doc, clipLine(doc, handle)); + else no = lineNo(handle); + if (no == null) return null; + if (op(line, no)) regChange(cm, no, no + 1); + else return null; + return line; + } + + function findPosH(cm, dir, unit, visually) { + var doc = cm.view.doc, end = cm.view.sel.head, line = end.line, ch = end.ch; + var lineObj = getLine(doc, line); + function findNextLine() { + var l = line + dir; + if (l < 0 || l == doc.size) return false; + line = l; + return lineObj = getLine(doc, l); + } + function moveOnce(boundToLine) { + var next = (visually ? moveVisually : moveLogically)(lineObj, ch, dir, true); + if (next == null) { + if (!boundToLine && findNextLine()) { + if (visually) ch = (dir < 0 ? lineRight : lineLeft)(lineObj); + else ch = dir < 0 ? lineObj.text.length : 0; + } else return false; + } else ch = next; + return true; + } + if (unit == "char") moveOnce(); + else if (unit == "column") moveOnce(true); + else if (unit == "word") { + var sawWord = false; + for (;;) { + if (dir < 0) if (!moveOnce()) break; + if (isWordChar(lineObj.text.charAt(ch))) sawWord = true; + else if (sawWord) {if (dir < 0) {dir = 1; moveOnce();} break;} + if (dir > 0) if (!moveOnce()) break; + } + } + return skipAtomic(cm, {line: line, ch: ch}, dir, true); + } + + function findWordAt(line, pos) { + var start = pos.ch, end = pos.ch; + if (line) { + if (pos.after === false || end == line.length) --start; else ++end; + var startChar = line.charAt(start); + var check = isWordChar(startChar) ? isWordChar : + /\s/.test(startChar) ? function(ch) {return /\s/.test(ch);} : + function(ch) {return !/\s/.test(ch) && !isWordChar(ch);}; + while (start > 0 && check(line.charAt(start - 1))) --start; + while (end < line.length && check(line.charAt(end))) ++end; + } + return {from: {line: pos.line, ch: start}, to: {line: pos.line, ch: end}}; + } + + function selectLine(cm, line) { + extendSelection(cm, {line: line, ch: 0}, clipPos(cm.view.doc, {line: line + 1, ch: 0})); + } + + // PROTOTYPE + + // The publicly visible API. Note that operation(null, f) means + // 'wrap f in an operation, performed on its `this` parameter' + + CodeMirror.prototype = { + getValue: function(lineSep) { + var text = [], doc = this.view.doc; + doc.iter(0, doc.size, function(line) { text.push(line.text); }); + return text.join(lineSep || "\n"); + }, + + setValue: operation(null, function(code) { + var doc = this.view.doc, top = {line: 0, ch: 0}, lastLen = getLine(doc, doc.size-1).text.length; + updateDocInner(this, top, {line: doc.size - 1, ch: lastLen}, splitLines(code), top, top, "setValue"); + }), + + getSelection: function(lineSep) { return this.getRange(this.view.sel.from, this.view.sel.to, lineSep); }, + + replaceSelection: operation(null, function(code, collapse, origin) { + var sel = this.view.sel; + updateDoc(this, sel.from, sel.to, splitLines(code), collapse || "around", origin); + }), + + focus: function(){window.focus(); focusInput(this); onFocus(this); fastPoll(this);}, + + setOption: function(option, value) { + var options = this.options, old = options[option]; + if (options[option] == value && option != "mode") return; + options[option] = value; + if (optionHandlers.hasOwnProperty(option)) + operation(this, optionHandlers[option])(this, value, old); + }, + + getOption: function(option) {return this.options[option];}, + + getMode: function() {return this.view.mode;}, + + addKeyMap: function(map) { + this.view.keyMaps.push(map); + }, + + removeKeyMap: function(map) { + var maps = this.view.keyMaps; + for (var i = 0; i < maps.length; ++i) + if ((typeof map == "string" ? maps[i].name : maps[i]) == map) { + maps.splice(i, 1); + return true; + } + }, + + undo: operation(null, function() {unredoHelper(this, "undo");}), + redo: operation(null, function() {unredoHelper(this, "redo");}), + + indentLine: operation(null, function(n, dir, aggressive) { + if (typeof dir != "string") { + if (dir == null) dir = this.options.smartIndent ? "smart" : "prev"; + else dir = dir ? "add" : "subtract"; + } + if (isLine(this.view.doc, n)) indentLine(this, n, dir, aggressive); + }), + + indentSelection: operation(null, function(how) { + var sel = this.view.sel; + if (posEq(sel.from, sel.to)) return indentLine(this, sel.from.line, how); + var e = sel.to.line - (sel.to.ch ? 0 : 1); + for (var i = sel.from.line; i <= e; ++i) indentLine(this, i, how); + }), + + historySize: function() { + var hist = this.view.history; + return {undo: hist.done.length, redo: hist.undone.length}; + }, + + clearHistory: function() {this.view.history = makeHistory();}, + + markClean: function() { + this.view.history.dirtyCounter = 0; + this.view.history.lastOp = this.view.history.lastOrigin = null; + }, + + isClean: function () {return this.view.history.dirtyCounter == 0;}, + + getHistory: function() { + var hist = this.view.history; + function cp(arr) { + for (var i = 0, nw = [], nwelt; i < arr.length; ++i) { + var set = arr[i]; + nw.push({events: nwelt = [], fromBefore: set.fromBefore, toBefore: set.toBefore, + fromAfter: set.fromAfter, toAfter: set.toAfter}); + for (var j = 0, elt = set.events; j < elt.length; ++j) { + var old = [], cur = elt[j]; + nwelt.push({start: cur.start, added: cur.added, old: old}); + for (var k = 0; k < cur.old.length; ++k) old.push(hlText(cur.old[k])); + } + } + return nw; + } + return {done: cp(hist.done), undone: cp(hist.undone)}; + }, + + setHistory: function(histData) { + var hist = this.view.history = makeHistory(); + hist.done = histData.done; + hist.undone = histData.undone; + }, + + // Fetch the parser token for a given character. Useful for hacks + // that want to inspect the mode state (say, for completion). + getTokenAt: function(pos) { + var doc = this.view.doc; + pos = clipPos(doc, pos); + var state = getStateBefore(this, pos.line), mode = this.view.mode; + var line = getLine(doc, pos.line); + var stream = new StringStream(line.text, this.options.tabSize); + while (stream.pos < pos.ch && !stream.eol()) { + stream.start = stream.pos; + var style = mode.token(stream, state); + } + return {start: stream.start, + end: stream.pos, + string: stream.current(), + className: style || null, // Deprecated, use 'type' instead + type: style || null, + state: state}; + }, + + getStateAfter: function(line) { + var doc = this.view.doc; + line = clipLine(doc, line == null ? doc.size - 1: line); + return getStateBefore(this, line + 1); + }, + + cursorCoords: function(start, mode) { + var pos, sel = this.view.sel; + if (start == null) pos = sel.head; + else if (typeof start == "object") pos = clipPos(this.view.doc, start); + else pos = start ? sel.from : sel.to; + return cursorCoords(this, pos, mode || "page"); + }, + + charCoords: function(pos, mode) { + return charCoords(this, clipPos(this.view.doc, pos), mode || "page"); + }, + + coordsChar: function(coords) { + var off = this.display.lineSpace.getBoundingClientRect(); + return coordsChar(this, coords.left - off.left, coords.top - off.top); + }, + + defaultTextHeight: function() { return textHeight(this.display); }, + + markText: operation(null, function(from, to, options) { + return markText(this, clipPos(this.view.doc, from), clipPos(this.view.doc, to), + options, "range"); + }), + + setBookmark: operation(null, function(pos, widget) { + pos = clipPos(this.view.doc, pos); + return markText(this, pos, pos, widget ? {replacedWith: widget} : {}, "bookmark"); + }), + + findMarksAt: function(pos) { + var doc = this.view.doc; + pos = clipPos(doc, pos); + var markers = [], spans = getLine(doc, pos.line).markedSpans; + if (spans) for (var i = 0; i < spans.length; ++i) { + var span = spans[i]; + if ((span.from == null || span.from <= pos.ch) && + (span.to == null || span.to >= pos.ch)) + markers.push(span.marker); + } + return markers; + }, + + setGutterMarker: operation(null, function(line, gutterID, value) { + return changeLine(this, line, function(line) { + var markers = line.gutterMarkers || (line.gutterMarkers = {}); + markers[gutterID] = value; + if (!value && isEmpty(markers)) line.gutterMarkers = null; + return true; + }); + }), + + clearGutter: operation(null, function(gutterID) { + var i = 0, cm = this, doc = cm.view.doc; + doc.iter(0, doc.size, function(line) { + if (line.gutterMarkers && line.gutterMarkers[gutterID]) { + line.gutterMarkers[gutterID] = null; + regChange(cm, i, i + 1); + if (isEmpty(line.gutterMarkers)) line.gutterMarkers = null; + } + ++i; + }); + }), + + addLineClass: operation(null, function(handle, where, cls) { + return changeLine(this, handle, function(line) { + var prop = where == "text" ? "textClass" : where == "background" ? "bgClass" : "wrapClass"; + if (!line[prop]) line[prop] = cls; + else if (new RegExp("\\b" + cls + "\\b").test(line[prop])) return false; + else line[prop] += " " + cls; + return true; + }); + }), + + removeLineClass: operation(null, function(handle, where, cls) { + return changeLine(this, handle, function(line) { + var prop = where == "text" ? "textClass" : where == "background" ? "bgClass" : "wrapClass"; + var cur = line[prop]; + if (!cur) return false; + else if (cls == null) line[prop] = null; + else { + var upd = cur.replace(new RegExp("^" + cls + "\\b\\s*|\\s*\\b" + cls + "\\b"), ""); + if (upd == cur) return false; + line[prop] = upd || null; + } + return true; + }); + }), + + addLineWidget: operation(null, function(handle, node, options) { + var widget = options || {}; + widget.node = node; + if (widget.noHScroll) this.display.alignWidgets = true; + changeLine(this, handle, function(line) { + (line.widgets || (line.widgets = [])).push(widget); + widget.line = line; + return true; + }); + return widget; + }), + + removeLineWidget: operation(null, function(widget) { + var ws = widget.line.widgets, no = lineNo(widget.line); + if (no == null) return; + for (var i = 0; i < ws.length; ++i) if (ws[i] == widget) ws.splice(i--, 1); + regChange(this, no, no + 1); + }), + + lineInfo: function(line) { + if (typeof line == "number") { + if (!isLine(this.view.doc, line)) return null; + var n = line; + line = getLine(this.view.doc, line); + if (!line) return null; + } else { + var n = lineNo(line); + if (n == null) return null; + } + return {line: n, handle: line, text: line.text, gutterMarkers: line.gutterMarkers, + textClass: line.textClass, bgClass: line.bgClass, wrapClass: line.wrapClass, + widgets: line.widgets}; + }, + + getViewport: function() { return {from: this.display.showingFrom, to: this.display.showingTo};}, + + addWidget: function(pos, node, scroll, vert, horiz) { + var display = this.display; + pos = cursorCoords(this, clipPos(this.view.doc, pos)); + var top = pos.top, left = pos.left; + node.style.position = "absolute"; + display.sizer.appendChild(node); + if (vert == "over") top = pos.top; + else if (vert == "near") { + var vspace = Math.max(display.wrapper.clientHeight, this.view.doc.height), + hspace = Math.max(display.sizer.clientWidth, display.lineSpace.clientWidth); + if (pos.bottom + node.offsetHeight > vspace && pos.top > node.offsetHeight) + top = pos.top - node.offsetHeight; + if (left + node.offsetWidth > hspace) + left = hspace - node.offsetWidth; + } + node.style.top = (top + paddingTop(display)) + "px"; + node.style.left = node.style.right = ""; + if (horiz == "right") { + left = display.sizer.clientWidth - node.offsetWidth; + node.style.right = "0px"; + } else { + if (horiz == "left") left = 0; + else if (horiz == "middle") left = (display.sizer.clientWidth - node.offsetWidth) / 2; + node.style.left = left + "px"; + } + if (scroll) + scrollIntoView(this, left, top, left + node.offsetWidth, top + node.offsetHeight); + }, + + lineCount: function() {return this.view.doc.size;}, + + clipPos: function(pos) {return clipPos(this.view.doc, pos);}, + + getCursor: function(start) { + var sel = this.view.sel, pos; + if (start == null || start == "head") pos = sel.head; + else if (start == "anchor") pos = sel.anchor; + else if (start == "end" || start === false) pos = sel.to; + else pos = sel.from; + return copyPos(pos); + }, + + somethingSelected: function() {return !posEq(this.view.sel.from, this.view.sel.to);}, + + setCursor: operation(null, function(line, ch, extend) { + var pos = clipPos(this.view.doc, typeof line == "number" ? {line: line, ch: ch || 0} : line); + if (extend) extendSelection(this, pos); + else setSelection(this, pos, pos); + }), + + setSelection: operation(null, function(anchor, head) { + var doc = this.view.doc; + setSelection(this, clipPos(doc, anchor), clipPos(doc, head || anchor)); + }), + + extendSelection: operation(null, function(from, to) { + var doc = this.view.doc; + extendSelection(this, clipPos(doc, from), to && clipPos(doc, to)); + }), + + setExtending: function(val) {this.view.sel.extend = val;}, + + getLine: function(line) {var l = this.getLineHandle(line); return l && l.text;}, + + getLineHandle: function(line) { + var doc = this.view.doc; + if (isLine(doc, line)) return getLine(doc, line); + }, + + getLineNumber: function(line) {return lineNo(line);}, + + setLine: operation(null, function(line, text) { + if (isLine(this.view.doc, line)) + replaceRange(this, text, {line: line, ch: 0}, {line: line, ch: getLine(this.view.doc, line).text.length}); + }), + + removeLine: operation(null, function(line) { + if (isLine(this.view.doc, line)) + replaceRange(this, "", {line: line, ch: 0}, clipPos(this.view.doc, {line: line+1, ch: 0})); + }), + + replaceRange: operation(null, function(code, from, to) { + var doc = this.view.doc; + from = clipPos(doc, from); + to = to ? clipPos(doc, to) : from; + return replaceRange(this, code, from, to); + }), + + getRange: function(from, to, lineSep) { + var doc = this.view.doc; + from = clipPos(doc, from); to = clipPos(doc, to); + var l1 = from.line, l2 = to.line; + if (l1 == l2) return getLine(doc, l1).text.slice(from.ch, to.ch); + var code = [getLine(doc, l1).text.slice(from.ch)]; + doc.iter(l1 + 1, l2, function(line) { code.push(line.text); }); + code.push(getLine(doc, l2).text.slice(0, to.ch)); + return code.join(lineSep || "\n"); + }, + + triggerOnKeyDown: operation(null, onKeyDown), + + execCommand: function(cmd) {return commands[cmd](this);}, + + // Stuff used by commands, probably not much use to outside code. + moveH: operation(null, function(dir, unit) { + var sel = this.view.sel, pos = dir < 0 ? sel.from : sel.to; + if (sel.shift || sel.extend || posEq(sel.from, sel.to)) pos = findPosH(this, dir, unit, true); + extendSelection(this, pos, pos, dir); + }), + + deleteH: operation(null, function(dir, unit) { + var sel = this.view.sel; + if (!posEq(sel.from, sel.to)) replaceRange(this, "", sel.from, sel.to, "delete"); + else replaceRange(this, "", sel.from, findPosH(this, dir, unit, false), "delete"); + this.curOp.userSelChange = true; + }), + + moveV: operation(null, function(dir, unit) { + var view = this.view, doc = view.doc, display = this.display; + var cur = view.sel.head, pos = cursorCoords(this, cur, "div"); + var x = pos.left, y; + if (view.goalColumn != null) x = view.goalColumn; + if (unit == "page") { + var pageSize = Math.min(display.wrapper.clientHeight, window.innerHeight || document.documentElement.clientHeight); + y = pos.top + dir * pageSize; + } else if (unit == "line") { + y = dir > 0 ? pos.bottom + 3 : pos.top - 3; + } + do { + var target = coordsChar(this, x, y); + y += dir * 5; + } while (target.outside && (dir < 0 ? y > 0 : y < doc.height)); + + if (unit == "page") display.scrollbarV.scrollTop += charCoords(this, target, "div").top - pos.top; + extendSelection(this, target, target, dir); + view.goalColumn = x; + }), + + toggleOverwrite: function() { + if (this.view.overwrite = !this.view.overwrite) + this.display.cursor.className += " CodeMirror-overwrite"; + else + this.display.cursor.className = this.display.cursor.className.replace(" CodeMirror-overwrite", ""); + }, + + posFromIndex: function(off) { + var lineNo = 0, ch, doc = this.view.doc; + doc.iter(0, doc.size, function(line) { + var sz = line.text.length + 1; + if (sz > off) { ch = off; return true; } + off -= sz; + ++lineNo; + }); + return clipPos(doc, {line: lineNo, ch: ch}); + }, + indexFromPos: function (coords) { + if (coords.line < 0 || coords.ch < 0) return 0; + var index = coords.ch; + this.view.doc.iter(0, coords.line, function (line) { + index += line.text.length + 1; + }); + return index; + }, + + scrollTo: function(x, y) { + if (x != null) this.display.scrollbarH.scrollLeft = this.display.scroller.scrollLeft = x; + if (y != null) this.display.scrollbarV.scrollTop = this.display.scroller.scrollTop = y; + updateDisplay(this, []); + }, + getScrollInfo: function() { + var scroller = this.display.scroller, co = scrollerCutOff; + return {left: scroller.scrollLeft, top: scroller.scrollTop, + height: scroller.scrollHeight - co, width: scroller.scrollWidth - co, + clientHeight: scroller.clientHeight - co, clientWidth: scroller.clientWidth - co}; + }, + + scrollIntoView: function(pos) { + if (typeof pos == "number") pos = {line: pos, ch: 0}; + pos = pos ? clipPos(this.view.doc, pos) : this.view.sel.head; + scrollPosIntoView(this, pos); + }, + + setSize: function(width, height) { + function interpret(val) { + return typeof val == "number" || /^\d+$/.test(String(val)) ? val + "px" : val; + } + if (width != null) this.display.wrapper.style.width = interpret(width); + if (height != null) this.display.wrapper.style.height = interpret(height); + this.refresh(); + }, + + on: function(type, f) {on(this, type, f);}, + off: function(type, f) {off(this, type, f);}, + + operation: function(f){return operation(this, f)();}, + + refresh: function() { + clearCaches(this); + if (this.display.scroller.scrollHeight > this.view.scrollTop) + this.display.scrollbarV.scrollTop = this.display.scroller.scrollTop = this.view.scrollTop; + updateDisplay(this, true); + }, + + getInputField: function(){return this.display.input;}, + getWrapperElement: function(){return this.display.wrapper;}, + getScrollerElement: function(){return this.display.scroller;}, + getGutterElement: function(){return this.display.gutters;} + }; + + // OPTION DEFAULTS + + var optionHandlers = CodeMirror.optionHandlers = {}; + + // The default configuration options. + var defaults = CodeMirror.defaults = {}; + + function option(name, deflt, handle, notOnInit) { + CodeMirror.defaults[name] = deflt; + if (handle) optionHandlers[name] = + notOnInit ? function(cm, val, old) {if (old != Init) handle(cm, val, old);} : handle; + } + + var Init = CodeMirror.Init = {toString: function(){return "CodeMirror.Init";}}; + + // These two are, on init, called from the constructor because they + // have to be initialized before the editor can start at all. + option("value", "", function(cm, val) {cm.setValue(val);}, true); + option("mode", null, loadMode, true); + + option("indentUnit", 2, loadMode, true); + option("indentWithTabs", false); + option("smartIndent", true); + option("tabSize", 4, function(cm) { + loadMode(cm); + clearCaches(cm); + updateDisplay(cm, true); + }, true); + option("electricChars", true); + + option("theme", "default", function(cm) { + themeChanged(cm); + guttersChanged(cm); + }, true); + option("keyMap", "default", keyMapChanged); + option("extraKeys", null); + + option("onKeyEvent", null); + option("onDragEvent", null); + + option("lineWrapping", false, wrappingChanged, true); + option("gutters", [], function(cm) { + setGuttersForLineNumbers(cm.options); + guttersChanged(cm); + }, true); + option("lineNumbers", false, function(cm) { + setGuttersForLineNumbers(cm.options); + guttersChanged(cm); + }, true); + option("firstLineNumber", 1, guttersChanged, true); + option("lineNumberFormatter", function(integer) {return integer;}, guttersChanged, true); + option("showCursorWhenSelecting", false, updateSelection, true); + + option("readOnly", false, function(cm, val) { + if (val == "nocursor") {onBlur(cm); cm.display.input.blur();} + else if (!val) resetInput(cm, true); + }); + option("dragDrop", true); + + option("cursorBlinkRate", 530); + option("cursorHeight", 1); + option("workTime", 100); + option("workDelay", 100); + option("flattenSpans", true); + option("pollInterval", 100); + option("undoDepth", 40); + option("viewportMargin", 10, function(cm){cm.refresh();}, true); + + option("tabindex", null, function(cm, val) { + cm.display.input.tabIndex = val || ""; + }); + option("autofocus", null); + + // MODE DEFINITION AND QUERYING + + // Known modes, by name and by MIME + var modes = CodeMirror.modes = {}, mimeModes = CodeMirror.mimeModes = {}; + + CodeMirror.defineMode = function(name, mode) { + if (!CodeMirror.defaults.mode && name != "null") CodeMirror.defaults.mode = name; + if (arguments.length > 2) { + mode.dependencies = []; + for (var i = 2; i < arguments.length; ++i) mode.dependencies.push(arguments[i]); + } + modes[name] = mode; + }; + + CodeMirror.defineMIME = function(mime, spec) { + mimeModes[mime] = spec; + }; + + CodeMirror.resolveMode = function(spec) { + if (typeof spec == "string" && mimeModes.hasOwnProperty(spec)) + spec = mimeModes[spec]; + else if (typeof spec == "string" && /^[\w\-]+\/[\w\-]+\+xml$/.test(spec)) + return CodeMirror.resolveMode("application/xml"); + if (typeof spec == "string") return {name: spec}; + else return spec || {name: "null"}; + }; + + CodeMirror.getMode = function(options, spec) { + var spec = CodeMirror.resolveMode(spec); + var mfactory = modes[spec.name]; + if (!mfactory) return CodeMirror.getMode(options, "text/plain"); + var modeObj = mfactory(options, spec); + if (modeExtensions.hasOwnProperty(spec.name)) { + var exts = modeExtensions[spec.name]; + for (var prop in exts) { + if (!exts.hasOwnProperty(prop)) continue; + if (modeObj.hasOwnProperty(prop)) modeObj["_" + prop] = modeObj[prop]; + modeObj[prop] = exts[prop]; + } + } + modeObj.name = spec.name; + return modeObj; + }; + + CodeMirror.defineMode("null", function() { + return {token: function(stream) {stream.skipToEnd();}}; + }); + CodeMirror.defineMIME("text/plain", "null"); + + var modeExtensions = CodeMirror.modeExtensions = {}; + CodeMirror.extendMode = function(mode, properties) { + var exts = modeExtensions.hasOwnProperty(mode) ? modeExtensions[mode] : (modeExtensions[mode] = {}); + for (var prop in properties) if (properties.hasOwnProperty(prop)) + exts[prop] = properties[prop]; + }; + + // EXTENSIONS + + CodeMirror.defineExtension = function(name, func) { + CodeMirror.prototype[name] = func; + }; + + CodeMirror.defineOption = option; + + var initHooks = []; + CodeMirror.defineInitHook = function(f) {initHooks.push(f);}; + + // MODE STATE HANDLING + + // Utility functions for working with state. Exported because modes + // sometimes need to do this. + function copyState(mode, state) { + if (state === true) return state; + if (mode.copyState) return mode.copyState(state); + var nstate = {}; + for (var n in state) { + var val = state[n]; + if (val instanceof Array) val = val.concat([]); + nstate[n] = val; + } + return nstate; + } + CodeMirror.copyState = copyState; + + function startState(mode, a1, a2) { + return mode.startState ? mode.startState(a1, a2) : true; + } + CodeMirror.startState = startState; + + CodeMirror.innerMode = function(mode, state) { + while (mode.innerMode) { + var info = mode.innerMode(state); + state = info.state; + mode = info.mode; + } + return info || {mode: mode, state: state}; + }; + + // STANDARD COMMANDS + + var commands = CodeMirror.commands = { + selectAll: function(cm) {cm.setSelection({line: 0, ch: 0}, {line: cm.lineCount() - 1});}, + killLine: function(cm) { + var from = cm.getCursor(true), to = cm.getCursor(false), sel = !posEq(from, to); + if (!sel && cm.getLine(from.line).length == from.ch) + cm.replaceRange("", from, {line: from.line + 1, ch: 0}, "delete"); + else cm.replaceRange("", from, sel ? to : {line: from.line}, "delete"); + }, + deleteLine: function(cm) { + var l = cm.getCursor().line; + cm.replaceRange("", {line: l, ch: 0}, {line: l}, "delete"); + }, + undo: function(cm) {cm.undo();}, + redo: function(cm) {cm.redo();}, + goDocStart: function(cm) {cm.extendSelection({line: 0, ch: 0});}, + goDocEnd: function(cm) {cm.extendSelection({line: cm.lineCount() - 1});}, + goLineStart: function(cm) { + cm.extendSelection(lineStart(cm, cm.getCursor().line)); + }, + goLineStartSmart: function(cm) { + var cur = cm.getCursor(), start = lineStart(cm, cur.line); + var line = cm.getLineHandle(start.line); + var order = getOrder(line); + if (!order || order[0].level == 0) { + var firstNonWS = Math.max(0, line.text.search(/\S/)); + var inWS = cur.line == start.line && cur.ch <= firstNonWS && cur.ch; + cm.extendSelection({line: start.line, ch: inWS ? 0 : firstNonWS}); + } else cm.extendSelection(start); + }, + goLineEnd: function(cm) { + cm.extendSelection(lineEnd(cm, cm.getCursor().line)); + }, + goLineUp: function(cm) {cm.moveV(-1, "line");}, + goLineDown: function(cm) {cm.moveV(1, "line");}, + goPageUp: function(cm) {cm.moveV(-1, "page");}, + goPageDown: function(cm) {cm.moveV(1, "page");}, + goCharLeft: function(cm) {cm.moveH(-1, "char");}, + goCharRight: function(cm) {cm.moveH(1, "char");}, + goColumnLeft: function(cm) {cm.moveH(-1, "column");}, + goColumnRight: function(cm) {cm.moveH(1, "column");}, + goWordLeft: function(cm) {cm.moveH(-1, "word");}, + goWordRight: function(cm) {cm.moveH(1, "word");}, + delCharBefore: function(cm) {cm.deleteH(-1, "char");}, + delCharAfter: function(cm) {cm.deleteH(1, "char");}, + delWordBefore: function(cm) {cm.deleteH(-1, "word");}, + delWordAfter: function(cm) {cm.deleteH(1, "word");}, + indentAuto: function(cm) {cm.indentSelection("smart");}, + indentMore: function(cm) {cm.indentSelection("add");}, + indentLess: function(cm) {cm.indentSelection("subtract");}, + insertTab: function(cm) {cm.replaceSelection("\t", "end", "input");}, + defaultTab: function(cm) { + if (cm.somethingSelected()) cm.indentSelection("add"); + else cm.replaceSelection("\t", "end", "input"); + }, + transposeChars: function(cm) { + var cur = cm.getCursor(), line = cm.getLine(cur.line); + if (cur.ch > 0 && cur.ch < line.length - 1) + cm.replaceRange(line.charAt(cur.ch) + line.charAt(cur.ch - 1), + {line: cur.line, ch: cur.ch - 1}, {line: cur.line, ch: cur.ch + 1}); + }, + newlineAndIndent: function(cm) { + operation(cm, function() { + cm.replaceSelection("\n", "end", "input"); + cm.indentLine(cm.getCursor().line, null, true); + })(); + }, + toggleOverwrite: function(cm) {cm.toggleOverwrite();} + }; + + // STANDARD KEYMAPS + + var keyMap = CodeMirror.keyMap = {}; + keyMap.basic = { + "Left": "goCharLeft", "Right": "goCharRight", "Up": "goLineUp", "Down": "goLineDown", + "End": "goLineEnd", "Home": "goLineStartSmart", "PageUp": "goPageUp", "PageDown": "goPageDown", + "Delete": "delCharAfter", "Backspace": "delCharBefore", "Tab": "defaultTab", "Shift-Tab": "indentAuto", + "Enter": "newlineAndIndent", "Insert": "toggleOverwrite" + }; + // Note that the save and find-related commands aren't defined by + // default. Unknown commands are simply ignored. + keyMap.pcDefault = { + "Ctrl-A": "selectAll", "Ctrl-D": "deleteLine", "Ctrl-Z": "undo", "Shift-Ctrl-Z": "redo", "Ctrl-Y": "redo", + "Ctrl-Home": "goDocStart", "Alt-Up": "goDocStart", "Ctrl-End": "goDocEnd", "Ctrl-Down": "goDocEnd", + "Ctrl-Left": "goWordLeft", "Ctrl-Right": "goWordRight", "Alt-Left": "goLineStart", "Alt-Right": "goLineEnd", + "Ctrl-Backspace": "delWordBefore", "Ctrl-Delete": "delWordAfter", "Ctrl-S": "save", "Ctrl-F": "find", + "Ctrl-G": "findNext", "Shift-Ctrl-G": "findPrev", "Shift-Ctrl-F": "replace", "Shift-Ctrl-R": "replaceAll", + "Ctrl-[": "indentLess", "Ctrl-]": "indentMore", + fallthrough: "basic" + }; + keyMap.macDefault = { + "Cmd-A": "selectAll", "Cmd-D": "deleteLine", "Cmd-Z": "undo", "Shift-Cmd-Z": "redo", "Cmd-Y": "redo", + "Cmd-Up": "goDocStart", "Cmd-End": "goDocEnd", "Cmd-Down": "goDocEnd", "Alt-Left": "goWordLeft", + "Alt-Right": "goWordRight", "Cmd-Left": "goLineStart", "Cmd-Right": "goLineEnd", "Alt-Backspace": "delWordBefore", + "Ctrl-Alt-Backspace": "delWordAfter", "Alt-Delete": "delWordAfter", "Cmd-S": "save", "Cmd-F": "find", + "Cmd-G": "findNext", "Shift-Cmd-G": "findPrev", "Cmd-Alt-F": "replace", "Shift-Cmd-Alt-F": "replaceAll", + "Cmd-[": "indentLess", "Cmd-]": "indentMore", + fallthrough: ["basic", "emacsy"] + }; + keyMap["default"] = mac ? keyMap.macDefault : keyMap.pcDefault; + keyMap.emacsy = { + "Ctrl-F": "goCharRight", "Ctrl-B": "goCharLeft", "Ctrl-P": "goLineUp", "Ctrl-N": "goLineDown", + "Alt-F": "goWordRight", "Alt-B": "goWordLeft", "Ctrl-A": "goLineStart", "Ctrl-E": "goLineEnd", + "Ctrl-V": "goPageDown", "Shift-Ctrl-V": "goPageUp", "Ctrl-D": "delCharAfter", "Ctrl-H": "delCharBefore", + "Alt-D": "delWordAfter", "Alt-Backspace": "delWordBefore", "Ctrl-K": "killLine", "Ctrl-T": "transposeChars" + }; + + // KEYMAP DISPATCH + + function getKeyMap(val) { + if (typeof val == "string") return keyMap[val]; + else return val; + } + + function lookupKey(name, maps, handle, stop) { + function lookup(map) { + map = getKeyMap(map); + var found = map[name]; + if (found === false) { + if (stop) stop(); + return true; + } + if (found != null && handle(found)) return true; + if (map.nofallthrough) { + if (stop) stop(); + return true; + } + var fallthrough = map.fallthrough; + if (fallthrough == null) return false; + if (Object.prototype.toString.call(fallthrough) != "[object Array]") + return lookup(fallthrough); + for (var i = 0, e = fallthrough.length; i < e; ++i) { + if (lookup(fallthrough[i])) return true; + } + return false; + } + + for (var i = 0; i < maps.length; ++i) + if (lookup(maps[i])) return true; + } + function isModifierKey(event) { + var name = keyNames[e_prop(event, "keyCode")]; + return name == "Ctrl" || name == "Alt" || name == "Shift" || name == "Mod"; + } + CodeMirror.isModifierKey = isModifierKey; + + // FROMTEXTAREA + + CodeMirror.fromTextArea = function(textarea, options) { + if (!options) options = {}; + options.value = textarea.value; + if (!options.tabindex && textarea.tabindex) + options.tabindex = textarea.tabindex; + // Set autofocus to true if this textarea is focused, or if it has + // autofocus and no other element is focused. + if (options.autofocus == null) { + var hasFocus = document.body; + // doc.activeElement occasionally throws on IE + try { hasFocus = document.activeElement; } catch(e) {} + options.autofocus = hasFocus == textarea || + textarea.getAttribute("autofocus") != null && hasFocus == document.body; + } + + function save() {textarea.value = cm.getValue();} + if (textarea.form) { + // Deplorable hack to make the submit method do the right thing. + on(textarea.form, "submit", save); + var form = textarea.form, realSubmit = form.submit; + try { + form.submit = function wrappedSubmit() { + save(); + form.submit = realSubmit; + form.submit(); + form.submit = wrappedSubmit; + }; + } catch(e) {} + } + + textarea.style.display = "none"; + var cm = CodeMirror(function(node) { + textarea.parentNode.insertBefore(node, textarea.nextSibling); + }, options); + cm.save = save; + cm.getTextArea = function() { return textarea; }; + cm.toTextArea = function() { + save(); + textarea.parentNode.removeChild(cm.getWrapperElement()); + textarea.style.display = ""; + if (textarea.form) { + off(textarea.form, "submit", save); + if (typeof textarea.form.submit == "function") + textarea.form.submit = realSubmit; + } + }; + return cm; + }; + + // STRING STREAM + + // Fed to the mode parsers, provides helper functions to make + // parsers more succinct. + + // The character stream used by a mode's parser. + function StringStream(string, tabSize) { + this.pos = this.start = 0; + this.string = string; + this.tabSize = tabSize || 8; + } + + StringStream.prototype = { + eol: function() {return this.pos >= this.string.length;}, + sol: function() {return this.pos == 0;}, + peek: function() {return this.string.charAt(this.pos) || undefined;}, + next: function() { + if (this.pos < this.string.length) + return this.string.charAt(this.pos++); + }, + eat: function(match) { + var ch = this.string.charAt(this.pos); + if (typeof match == "string") var ok = ch == match; + else var ok = ch && (match.test ? match.test(ch) : match(ch)); + if (ok) {++this.pos; return ch;} + }, + eatWhile: function(match) { + var start = this.pos; + while (this.eat(match)){} + return this.pos > start; + }, + eatSpace: function() { + var start = this.pos; + while (/[\s\u00a0]/.test(this.string.charAt(this.pos))) ++this.pos; + return this.pos > start; + }, + skipToEnd: function() {this.pos = this.string.length;}, + skipTo: function(ch) { + var found = this.string.indexOf(ch, this.pos); + if (found > -1) {this.pos = found; return true;} + }, + backUp: function(n) {this.pos -= n;}, + column: function() {return countColumn(this.string, this.start, this.tabSize);}, + indentation: function() {return countColumn(this.string, null, this.tabSize);}, + match: function(pattern, consume, caseInsensitive) { + if (typeof pattern == "string") { + var cased = function(str) {return caseInsensitive ? str.toLowerCase() : str;}; + if (cased(this.string).indexOf(cased(pattern), this.pos) == this.pos) { + if (consume !== false) this.pos += pattern.length; + return true; + } + } else { + var match = this.string.slice(this.pos).match(pattern); + if (match && match.index > 0) return null; + if (match && consume !== false) this.pos += match[0].length; + return match; + } + }, + current: function(){return this.string.slice(this.start, this.pos);} + }; + CodeMirror.StringStream = StringStream; + + // TEXTMARKERS + + function TextMarker(cm, type) { + this.lines = []; + this.type = type; + this.cm = cm; + } + + TextMarker.prototype.clear = function() { + if (this.explicitlyCleared) return; + startOperation(this.cm); + var min = null, max = null; + for (var i = 0; i < this.lines.length; ++i) { + var line = this.lines[i]; + var span = getMarkedSpanFor(line.markedSpans, this); + if (span.to != null) max = lineNo(line); + line.markedSpans = removeMarkedSpan(line.markedSpans, span); + if (span.from != null) + min = lineNo(line); + else if (this.collapsed && !lineIsHidden(line)) + updateLineHeight(line, textHeight(this.cm.display)); + } + if (min != null) regChange(this.cm, min, max + 1); + this.lines.length = 0; + this.explicitlyCleared = true; + if (this.collapsed && this.cm.view.cantEdit) { + this.cm.view.cantEdit = false; + reCheckSelection(this.cm); + } + endOperation(this.cm); + signalLater(this.cm, this, "clear"); + }; + + TextMarker.prototype.find = function() { + var from, to; + for (var i = 0; i < this.lines.length; ++i) { + var line = this.lines[i]; + var span = getMarkedSpanFor(line.markedSpans, this); + if (span.from != null || span.to != null) { + var found = lineNo(line); + if (span.from != null) from = {line: found, ch: span.from}; + if (span.to != null) to = {line: found, ch: span.to}; + } + } + if (this.type == "bookmark") return from; + return from && {from: from, to: to}; + }; + + function markText(cm, from, to, options, type) { + var doc = cm.view.doc; + var marker = new TextMarker(cm, type); + if (type == "range" && !posLess(from, to)) return marker; + if (options) for (var opt in options) if (options.hasOwnProperty(opt)) + marker[opt] = options[opt]; + if (marker.replacedWith) { + marker.collapsed = true; + marker.replacedWith = elt("span", [marker.replacedWith], "CodeMirror-widget"); + } + if (marker.collapsed) sawCollapsedSpans = true; + + var curLine = from.line, size = 0, collapsedAtStart, collapsedAtEnd; + doc.iter(curLine, to.line + 1, function(line) { + var span = {from: null, to: null, marker: marker}; + size += line.text.length; + if (curLine == from.line) {span.from = from.ch; size -= from.ch;} + if (curLine == to.line) {span.to = to.ch; size -= line.text.length - to.ch;} + if (marker.collapsed) { + if (curLine == to.line) collapsedAtEnd = collapsedSpanAt(line, to.ch); + if (curLine == from.line) collapsedAtStart = collapsedSpanAt(line, from.ch); + else updateLineHeight(line, 0); + } + addMarkedSpan(line, span); + if (marker.collapsed && curLine == from.line && lineIsHidden(line)) + updateLineHeight(line, 0); + ++curLine; + }); + + if (marker.readOnly) { + sawReadOnlySpans = true; + if (cm.view.history.done.length || cm.view.history.undone.length) + cm.clearHistory(); + } + if (marker.collapsed) { + if (collapsedAtStart != collapsedAtEnd) + throw new Error("Inserting collapsed marker overlapping an existing one"); + marker.size = size; + marker.atomic = true; + } + if (marker.className || marker.startStyle || marker.endStyle || marker.collapsed) + regChange(cm, from.line, to.line + 1); + if (marker.atomic) reCheckSelection(cm); + return marker; + } + + // TEXTMARKER SPANS + + function getMarkedSpanFor(spans, marker) { + if (spans) for (var i = 0; i < spans.length; ++i) { + var span = spans[i]; + if (span.marker == marker) return span; + } + } + function removeMarkedSpan(spans, span) { + for (var r, i = 0; i < spans.length; ++i) + if (spans[i] != span) (r || (r = [])).push(spans[i]); + return r; + } + function addMarkedSpan(line, span) { + line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span]; + span.marker.lines.push(line); + } + + function markedSpansBefore(old, startCh) { + if (old) for (var i = 0, nw; i < old.length; ++i) { + var span = old[i], marker = span.marker; + var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= startCh : span.from < startCh); + if (startsBefore || marker.type == "bookmark" && span.from == startCh) { + var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= startCh : span.to > startCh); + (nw || (nw = [])).push({from: span.from, + to: endsAfter ? null : span.to, + marker: marker}); + } + } + return nw; + } + + function markedSpansAfter(old, startCh, endCh) { + if (old) for (var i = 0, nw; i < old.length; ++i) { + var span = old[i], marker = span.marker; + var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= endCh : span.to > endCh); + if (endsAfter || marker.type == "bookmark" && span.from == endCh && span.from != startCh) { + var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= endCh : span.from < endCh); + (nw || (nw = [])).push({from: startsBefore ? null : span.from - endCh, + to: span.to == null ? null : span.to - endCh, + marker: marker}); + } + } + return nw; + } + + function updateMarkedSpans(oldFirst, oldLast, startCh, endCh, newText) { + if (!oldFirst && !oldLast) return newText; + // Get the spans that 'stick out' on both sides + var first = markedSpansBefore(oldFirst, startCh); + var last = markedSpansAfter(oldLast, startCh, endCh); + + // Next, merge those two ends + var sameLine = newText.length == 1, offset = lst(newText).length + (sameLine ? startCh : 0); + if (first) { + // Fix up .to properties of first + for (var i = 0; i < first.length; ++i) { + var span = first[i]; + if (span.to == null) { + var found = getMarkedSpanFor(last, span.marker); + if (!found) span.to = startCh; + else if (sameLine) span.to = found.to == null ? null : found.to + offset; + } + } + } + if (last) { + // Fix up .from in last (or move them into first in case of sameLine) + for (var i = 0; i < last.length; ++i) { + var span = last[i]; + if (span.to != null) span.to += offset; + if (span.from == null) { + var found = getMarkedSpanFor(first, span.marker); + if (!found) { + span.from = offset; + if (sameLine) (first || (first = [])).push(span); + } + } else { + span.from += offset; + if (sameLine) (first || (first = [])).push(span); + } + } + } + + var newMarkers = [newHL(newText[0], first)]; + if (!sameLine) { + // Fill gap with whole-line-spans + var gap = newText.length - 2, gapMarkers; + if (gap > 0 && first) + for (var i = 0; i < first.length; ++i) + if (first[i].to == null) + (gapMarkers || (gapMarkers = [])).push({from: null, to: null, marker: first[i].marker}); + for (var i = 0; i < gap; ++i) + newMarkers.push(newHL(newText[i+1], gapMarkers)); + newMarkers.push(newHL(lst(newText), last)); + } + return newMarkers; + } + + function removeReadOnlyRanges(doc, from, to) { + var markers = null; + doc.iter(from.line, to.line + 1, function(line) { + if (line.markedSpans) for (var i = 0; i < line.markedSpans.length; ++i) { + var mark = line.markedSpans[i].marker; + if (mark.readOnly && (!markers || indexOf(markers, mark) == -1)) + (markers || (markers = [])).push(mark); + } + }); + if (!markers) return null; + var parts = [{from: from, to: to}]; + for (var i = 0; i < markers.length; ++i) { + var m = markers[i].find(); + for (var j = 0; j < parts.length; ++j) { + var p = parts[j]; + if (!posLess(m.from, p.to) || posLess(m.to, p.from)) continue; + var newParts = [j, 1]; + if (posLess(p.from, m.from)) newParts.push({from: p.from, to: m.from}); + if (posLess(m.to, p.to)) newParts.push({from: m.to, to: p.to}); + parts.splice.apply(parts, newParts); + j += newParts.length - 1; + } + } + return parts; + } + + function collapsedSpanAt(line, ch) { + var sps = sawCollapsedSpans && line.markedSpans, found; + if (sps) for (var sp, i = 0; i < sps.length; ++i) { + sp = sps[i]; + if (!sp.marker.collapsed) continue; + if ((sp.from == null || sp.from < ch) && + (sp.to == null || sp.to > ch) && + (!found || found.width < sp.marker.width)) + found = sp.marker; + } + return found; + } + function collapsedSpanAtStart(line) { return collapsedSpanAt(line, -1); } + function collapsedSpanAtEnd(line) { return collapsedSpanAt(line, line.text.length + 1); } + + function visualLine(doc, line) { + var merged; + while (merged = collapsedSpanAtStart(line)) + line = getLine(doc, merged.find().from.line); + return line; + } + + function lineIsHidden(line) { + var sps = sawCollapsedSpans && line.markedSpans; + if (sps) for (var sp, i = 0; i < sps.length; ++i) { + sp = sps[i]; + if (!sp.marker.collapsed) continue; + if (sp.from == null) return true; + if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(line, sp)) + return true; + } + } + window.lineIsHidden = lineIsHidden; + function lineIsHiddenInner(line, span) { + if (span.to == null || span.marker.inclusiveRight && span.to == line.text.length) + return true; + for (var sp, i = 0; i < line.markedSpans.length; ++i) { + sp = line.markedSpans[i]; + if (sp.marker.collapsed && sp.from == span.to && + (sp.marker.inclusiveLeft || span.marker.inclusiveRight) && + lineIsHiddenInner(line, sp)) return true; + } + } + + // hl stands for history-line, a data structure that can be either a + // string (line without markers) or a {text, markedSpans} object. + function hlText(val) { return typeof val == "string" ? val : val.text; } + function hlSpans(val) { + if (typeof val == "string") return null; + var spans = val.markedSpans, out = null; + for (var i = 0; i < spans.length; ++i) { + if (spans[i].marker.explicitlyCleared) { if (!out) out = spans.slice(0, i); } + else if (out) out.push(spans[i]); + } + return !out ? spans : out.length ? out : null; + } + function newHL(text, spans) { return spans ? {text: text, markedSpans: spans} : text; } + + function detachMarkedSpans(line) { + var spans = line.markedSpans; + if (!spans) return; + for (var i = 0; i < spans.length; ++i) { + var lines = spans[i].marker.lines; + var ix = indexOf(lines, line); + lines.splice(ix, 1); + } + line.markedSpans = null; + } + + function attachMarkedSpans(line, spans) { + if (!spans) return; + for (var i = 0; i < spans.length; ++i) + spans[i].marker.lines.push(line); + line.markedSpans = spans; + } + + // LINE DATA STRUCTURE + + // Line objects. These hold state related to a line, including + // highlighting info (the styles array). + function makeLine(text, markedSpans, height) { + var line = {text: text, height: height}; + attachMarkedSpans(line, markedSpans); + if (lineIsHidden(line)) line.height = 0; + return line; + } + + function updateLine(cm, line, text, markedSpans) { + line.text = text; + line.stateAfter = line.styles = null; + if (line.order != null) line.order = null; + detachMarkedSpans(line); + attachMarkedSpans(line, markedSpans); + if (lineIsHidden(line)) line.height = 0; + else if (!line.height) line.height = textHeight(cm.display); + signalLater(cm, line, "change"); + } + + function cleanUpLine(line) { + line.parent = null; + detachMarkedSpans(line); + } + + // Run the given mode's parser over a line, update the styles + // array, which contains alternating fragments of text and CSS + // classes. + function highlightLine(cm, line, state) { + var mode = cm.view.mode, flattenSpans = cm.options.flattenSpans; + var changed = !line.styles, pos = 0, curText = "", curStyle = null; + var stream = new StringStream(line.text, cm.options.tabSize), st = line.styles || (line.styles = []); + if (line.text == "" && mode.blankLine) mode.blankLine(state); + while (!stream.eol()) { + var style = mode.token(stream, state), substr = stream.current(); + stream.start = stream.pos; + if (!flattenSpans || curStyle != style) { + if (curText) { + changed = changed || pos >= st.length || curText != st[pos] || curStyle != st[pos+1]; + st[pos++] = curText; st[pos++] = curStyle; + } + curText = substr; curStyle = style; + } else curText = curText + substr; + // Give up when line is ridiculously long + if (stream.pos > 5000) break; + } + if (curText) { + changed = changed || pos >= st.length || curText != st[pos] || curStyle != st[pos+1]; + st[pos++] = curText; st[pos++] = curStyle; + } + if (stream.pos > 5000) { st[pos++] = line.text.slice(stream.pos); st[pos++] = null; } + if (pos != st.length) { st.length = pos; changed = true; } + return changed; + } + + // Lightweight form of highlight -- proceed over this line and + // update state, but don't save a style array. + function processLine(cm, line, state) { + var mode = cm.view.mode; + var stream = new StringStream(line.text, cm.options.tabSize); + if (line.text == "" && mode.blankLine) mode.blankLine(state); + while (!stream.eol() && stream.pos <= 5000) { + mode.token(stream, state); + stream.start = stream.pos; + } + } + + var styleToClassCache = {}; + function styleToClass(style) { + if (!style) return null; + return styleToClassCache[style] || + (styleToClassCache[style] = "cm-" + style.replace(/ +/g, " cm-")); + } + + function lineContent(cm, realLine, measure) { + var merged, line = realLine, lineBefore, sawBefore, simple = true; + while (merged = collapsedSpanAtStart(line)) { + simple = false; + line = getLine(cm.view.doc, merged.find().from.line); + if (!lineBefore) lineBefore = line; + } + + var builder = {pre: elt("pre"), col: 0, pos: 0, display: !measure, + measure: null, addedOne: false, cm: cm}; + if (line.textClass) builder.pre.className = line.textClass; + + do { + if (!line.styles) + highlightLine(cm, line, line.stateAfter = getStateBefore(cm, lineNo(line))); + builder.measure = line == realLine && measure; + builder.pos = 0; + builder.addToken = builder.measure ? buildTokenMeasure : buildToken; + if (measure && sawBefore && line != realLine && !builder.addedOne) { + measure[0] = builder.pre.appendChild(zeroWidthElement(cm.display.measure)); + builder.addedOne = true; + } + var next = insertLineContent(line, builder); + sawBefore = line == lineBefore; + if (next) { + line = getLine(cm.view.doc, next.to.line); + simple = false; + } + } while (next); + + if (measure && !builder.addedOne) + measure[0] = builder.pre.appendChild(simple ? elt("span", "\u00a0") : zeroWidthElement(cm.display.measure)); + if (!builder.pre.firstChild && !lineIsHidden(realLine)) + builder.pre.appendChild(document.createTextNode("\u00a0")); + + return builder.pre; + } + + var tokenSpecialChars = /[\t\u0000-\u0019\u200b\u2028\u2029\uFEFF]/g; + function buildToken(builder, text, style, startStyle, endStyle) { + if (!text) return; + if (!tokenSpecialChars.test(text)) { + builder.col += text.length; + var content = document.createTextNode(text); + } else { + var content = document.createDocumentFragment(), pos = 0; + while (true) { + tokenSpecialChars.lastIndex = pos; + var m = tokenSpecialChars.exec(text); + var skipped = m ? m.index - pos : text.length - pos; + if (skipped) { + content.appendChild(document.createTextNode(text.slice(pos, pos + skipped))); + builder.col += skipped; + } + if (!m) break; + pos += skipped + 1; + if (m[0] == "\t") { + var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize; + content.appendChild(elt("span", spaceStr(tabWidth), "cm-tab")); + builder.col += tabWidth; + } else { + var token = elt("span", "\u2022", "cm-invalidchar"); + token.title = "\\u" + m[0].charCodeAt(0).toString(16); + content.appendChild(token); + builder.col += 1; + } + } + } + if (style || startStyle || endStyle || builder.measure) { + var fullStyle = style || ""; + if (startStyle) fullStyle += startStyle; + if (endStyle) fullStyle += endStyle; + return builder.pre.appendChild(elt("span", [content], fullStyle)); + } + builder.pre.appendChild(content); + } + + function buildTokenMeasure(builder, text, style, startStyle, endStyle) { + for (var i = 0; i < text.length; ++i) { + if (i && i < text.length - 1 && + builder.cm.options.lineWrapping && + spanAffectsWrapping.test(text.slice(i - 1, i + 1))) + builder.pre.appendChild(elt("wbr")); + builder.measure[builder.pos++] = + buildToken(builder, text.charAt(i), style, + i == 0 && startStyle, i == text.length - 1 && endStyle); + } + if (text.length) builder.addedOne = true; + } + + function buildCollapsedSpan(builder, size, widget) { + if (widget) { + if (!builder.display) widget = widget.cloneNode(true); + builder.pre.appendChild(widget); + if (builder.measure && size) { + builder.measure[builder.pos] = widget; + builder.addedOne = true; + } + } + builder.pos += size; + } + + // Outputs a number of spans to make up a line, taking highlighting + // and marked text into account. + function insertLineContent(line, builder) { + var st = line.styles, spans = line.markedSpans; + if (!spans) { + for (var i = 0; i < st.length; i+=2) + builder.addToken(builder, st[i], styleToClass(st[i+1])); + return; + } + + var allText = line.text, len = allText.length; + var pos = 0, i = 0, text = "", style; + var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed; + for (;;) { + if (nextChange == pos) { // Update current marker set + spanStyle = spanEndStyle = spanStartStyle = ""; + collapsed = null; nextChange = Infinity; + var foundBookmark = null; + for (var j = 0; j < spans.length; ++j) { + var sp = spans[j], m = sp.marker; + if (sp.from <= pos && (sp.to == null || sp.to > pos)) { + if (sp.to != null && nextChange > sp.to) { nextChange = sp.to; spanEndStyle = ""; } + if (m.className) spanStyle += " " + m.className; + if (m.startStyle && sp.from == pos) spanStartStyle += " " + m.startStyle; + if (m.endStyle && sp.to == nextChange) spanEndStyle += " " + m.endStyle; + if (m.collapsed && (!collapsed || collapsed.marker.width < m.width)) + collapsed = sp; + } else if (sp.from > pos && nextChange > sp.from) { + nextChange = sp.from; + } + if (m.type == "bookmark" && sp.from == pos && m.replacedWith) + foundBookmark = m.replacedWith; + } + if (collapsed && (collapsed.from || 0) == pos) { + buildCollapsedSpan(builder, (collapsed.to == null ? len : collapsed.to) - pos, + collapsed.from != null && collapsed.marker.replacedWith); + if (collapsed.to == null) return collapsed.marker.find(); + } + if (foundBookmark && !collapsed) buildCollapsedSpan(builder, 0, foundBookmark); + } + if (pos >= len) break; + + var upto = Math.min(len, nextChange); + while (true) { + if (text) { + var end = pos + text.length; + if (!collapsed) { + var tokenText = end > upto ? text.slice(0, upto - pos) : text; + builder.addToken(builder, tokenText, style + spanStyle, + spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : ""); + } + if (end >= upto) {text = text.slice(upto - pos); pos = upto; break;} + pos = end; + spanStartStyle = ""; + } + text = st[i++]; style = styleToClass(st[i++]); + } + } + } + + // DOCUMENT DATA STRUCTURE + + function LeafChunk(lines) { + this.lines = lines; + this.parent = null; + for (var i = 0, e = lines.length, height = 0; i < e; ++i) { + lines[i].parent = this; + height += lines[i].height; + } + this.height = height; + } + + LeafChunk.prototype = { + chunkSize: function() { return this.lines.length; }, + remove: function(at, n, cm) { + for (var i = at, e = at + n; i < e; ++i) { + var line = this.lines[i]; + this.height -= line.height; + cleanUpLine(line); + signalLater(cm, line, "delete"); + } + this.lines.splice(at, n); + }, + collapse: function(lines) { + lines.splice.apply(lines, [lines.length, 0].concat(this.lines)); + }, + insertHeight: function(at, lines, height) { + this.height += height; + this.lines = this.lines.slice(0, at).concat(lines).concat(this.lines.slice(at)); + for (var i = 0, e = lines.length; i < e; ++i) lines[i].parent = this; + }, + iterN: function(at, n, op) { + for (var e = at + n; at < e; ++at) + if (op(this.lines[at])) return true; + } + }; + + function BranchChunk(children) { + this.children = children; + var size = 0, height = 0; + for (var i = 0, e = children.length; i < e; ++i) { + var ch = children[i]; + size += ch.chunkSize(); height += ch.height; + ch.parent = this; + } + this.size = size; + this.height = height; + this.parent = null; + } + + BranchChunk.prototype = { + chunkSize: function() { return this.size; }, + remove: function(at, n, callbacks) { + this.size -= n; + for (var i = 0; i < this.children.length; ++i) { + var child = this.children[i], sz = child.chunkSize(); + if (at < sz) { + var rm = Math.min(n, sz - at), oldHeight = child.height; + child.remove(at, rm, callbacks); + this.height -= oldHeight - child.height; + if (sz == rm) { this.children.splice(i--, 1); child.parent = null; } + if ((n -= rm) == 0) break; + at = 0; + } else at -= sz; + } + if (this.size - n < 25) { + var lines = []; + this.collapse(lines); + this.children = [new LeafChunk(lines)]; + this.children[0].parent = this; + } + }, + collapse: function(lines) { + for (var i = 0, e = this.children.length; i < e; ++i) this.children[i].collapse(lines); + }, + insert: function(at, lines) { + var height = 0; + for (var i = 0, e = lines.length; i < e; ++i) height += lines[i].height; + this.insertHeight(at, lines, height); + }, + insertHeight: function(at, lines, height) { + this.size += lines.length; + this.height += height; + for (var i = 0, e = this.children.length; i < e; ++i) { + var child = this.children[i], sz = child.chunkSize(); + if (at <= sz) { + child.insertHeight(at, lines, height); + if (child.lines && child.lines.length > 50) { + while (child.lines.length > 50) { + var spilled = child.lines.splice(child.lines.length - 25, 25); + var newleaf = new LeafChunk(spilled); + child.height -= newleaf.height; + this.children.splice(i + 1, 0, newleaf); + newleaf.parent = this; + } + this.maybeSpill(); + } + break; + } + at -= sz; + } + }, + maybeSpill: function() { + if (this.children.length <= 10) return; + var me = this; + do { + var spilled = me.children.splice(me.children.length - 5, 5); + var sibling = new BranchChunk(spilled); + if (!me.parent) { // Become the parent node + var copy = new BranchChunk(me.children); + copy.parent = me; + me.children = [copy, sibling]; + me = copy; + } else { + me.size -= sibling.size; + me.height -= sibling.height; + var myIndex = indexOf(me.parent.children, me); + me.parent.children.splice(myIndex + 1, 0, sibling); + } + sibling.parent = me.parent; + } while (me.children.length > 10); + me.parent.maybeSpill(); + }, + iter: function(from, to, op) { this.iterN(from, to - from, op); }, + iterN: function(at, n, op) { + for (var i = 0, e = this.children.length; i < e; ++i) { + var child = this.children[i], sz = child.chunkSize(); + if (at < sz) { + var used = Math.min(n, sz - at); + if (child.iterN(at, used, op)) return true; + if ((n -= used) == 0) break; + at = 0; + } else at -= sz; + } + } + }; + + // LINE UTILITIES + + function getLine(chunk, n) { + while (!chunk.lines) { + for (var i = 0;; ++i) { + var child = chunk.children[i], sz = child.chunkSize(); + if (n < sz) { chunk = child; break; } + n -= sz; + } + } + return chunk.lines[n]; + } + + function updateLineHeight(line, height) { + var diff = height - line.height; + for (var n = line; n; n = n.parent) n.height += diff; + } + + function lineNo(line) { + if (line.parent == null) return null; + var cur = line.parent, no = indexOf(cur.lines, line); + for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) { + for (var i = 0;; ++i) { + if (chunk.children[i] == cur) break; + no += chunk.children[i].chunkSize(); + } + } + return no; + } + + function lineAtHeight(chunk, h) { + var n = 0; + outer: do { + for (var i = 0, e = chunk.children.length; i < e; ++i) { + var child = chunk.children[i], ch = child.height; + if (h < ch) { chunk = child; continue outer; } + h -= ch; + n += child.chunkSize(); + } + return n; + } while (!chunk.lines); + for (var i = 0, e = chunk.lines.length; i < e; ++i) { + var line = chunk.lines[i], lh = line.height; + if (h < lh) break; + h -= lh; + } + return n + i; + } + + function heightAtLine(cm, lineObj) { + lineObj = visualLine(cm.view.doc, lineObj); + + var h = 0, chunk = lineObj.parent; + for (var i = 0; i < chunk.lines.length; ++i) { + var line = chunk.lines[i]; + if (line == lineObj) break; + else h += line.height; + } + for (var p = chunk.parent; p; chunk = p, p = chunk.parent) { + for (var i = 0; i < p.children.length; ++i) { + var cur = p.children[i]; + if (cur == chunk) break; + else h += cur.height; + } + } + return h; + } + + function getOrder(line) { + var order = line.order; + if (order == null) order = line.order = bidiOrdering(line.text); + return order; + } + + // HISTORY + + function makeHistory() { + return { + // Arrays of history events. Doing something adds an event to + // done and clears undo. Undoing moves events from done to + // undone, redoing moves them in the other direction. + done: [], undone: [], + // Used to track when changes can be merged into a single undo + // event + lastTime: 0, lastOp: null, lastOrigin: null, + // Used by the isClean() method + dirtyCounter: 0 + }; + } + + function addChange(cm, start, added, old, origin, fromBefore, toBefore, fromAfter, toAfter) { + var history = cm.view.history; + history.undone.length = 0; + var time = +new Date, cur = lst(history.done); + + if (cur && + (history.lastOp == cm.curOp.id || + history.lastOrigin == origin && (origin == "input" || origin == "delete") && + history.lastTime > time - 600)) { + // Merge this change into the last event + var last = lst(cur.events); + if (last.start > start + old.length || last.start + last.added < start) { + // Doesn't intersect with last sub-event, add new sub-event + cur.events.push({start: start, added: added, old: old}); + } else { + // Patch up the last sub-event + var startBefore = Math.max(0, last.start - start), + endAfter = Math.max(0, (start + old.length) - (last.start + last.added)); + for (var i = startBefore; i > 0; --i) last.old.unshift(old[i - 1]); + for (var i = endAfter; i > 0; --i) last.old.push(old[old.length - i]); + if (startBefore) last.start = start; + last.added += added - (old.length - startBefore - endAfter); + } + cur.fromAfter = fromAfter; cur.toAfter = toAfter; + } else { + // Can not be merged, start a new event. + cur = {events: [{start: start, added: added, old: old}], + fromBefore: fromBefore, toBefore: toBefore, fromAfter: fromAfter, toAfter: toAfter}; + history.done.push(cur); + while (history.done.length > cm.options.undoDepth) + history.done.shift(); + if (history.dirtyCounter < 0) + // The user has made a change after undoing past the last clean state. + // We can never get back to a clean state now until markClean() is called. + history.dirtyCounter = NaN; + else + history.dirtyCounter++; + } + history.lastTime = time; + history.lastOp = cm.curOp.id; + history.lastOrigin = origin; + } + + // EVENT OPERATORS + + function stopMethod() {e_stop(this);} + // Ensure an event has a stop method. + function addStop(event) { + if (!event.stop) event.stop = stopMethod; + return event; + } + + function e_preventDefault(e) { + if (e.preventDefault) e.preventDefault(); + else e.returnValue = false; + } + function e_stopPropagation(e) { + if (e.stopPropagation) e.stopPropagation(); + else e.cancelBubble = true; + } + function e_stop(e) {e_preventDefault(e); e_stopPropagation(e);} + CodeMirror.e_stop = e_stop; + CodeMirror.e_preventDefault = e_preventDefault; + CodeMirror.e_stopPropagation = e_stopPropagation; + + function e_target(e) {return e.target || e.srcElement;} + function e_button(e) { + var b = e.which; + if (b == null) { + if (e.button & 1) b = 1; + else if (e.button & 2) b = 3; + else if (e.button & 4) b = 2; + } + if (mac && e.ctrlKey && b == 1) b = 3; + return b; + } + + // Allow 3rd-party code to override event properties by adding an override + // object to an event object. + function e_prop(e, prop) { + var overridden = e.override && e.override.hasOwnProperty(prop); + return overridden ? e.override[prop] : e[prop]; + } + + // EVENT HANDLING + + function on(emitter, type, f) { + if (emitter.addEventListener) + emitter.addEventListener(type, f, false); + else if (emitter.attachEvent) + emitter.attachEvent("on" + type, f); + else { + var map = emitter._handlers || (emitter._handlers = {}); + var arr = map[type] || (map[type] = []); + arr.push(f); + } + } + + function off(emitter, type, f) { + if (emitter.removeEventListener) + emitter.removeEventListener(type, f, false); + else if (emitter.detachEvent) + emitter.detachEvent("on" + type, f); + else { + var arr = emitter._handlers && emitter._handlers[type]; + if (!arr) return; + for (var i = 0; i < arr.length; ++i) + if (arr[i] == f) { arr.splice(i, 1); break; } + } + } + + function signal(emitter, type /*, values...*/) { + var arr = emitter._handlers && emitter._handlers[type]; + if (!arr) return; + var args = Array.prototype.slice.call(arguments, 2); + for (var i = 0; i < arr.length; ++i) arr[i].apply(null, args); + } + + function signalLater(cm, emitter, type /*, values...*/) { + var arr = emitter._handlers && emitter._handlers[type]; + if (!arr) return; + var args = Array.prototype.slice.call(arguments, 3), flist = cm.curOp && cm.curOp.delayedCallbacks; + function bnd(f) {return function(){f.apply(null, args);};}; + for (var i = 0; i < arr.length; ++i) + if (flist) flist.push(bnd(arr[i])); + else arr[i].apply(null, args); + } + + function hasHandler(emitter, type) { + var arr = emitter._handlers && emitter._handlers[type]; + return arr && arr.length > 0; + } + + CodeMirror.on = on; CodeMirror.off = off; CodeMirror.signal = signal; + + // MISC UTILITIES + + // Number of pixels added to scroller and sizer to hide scrollbar + var scrollerCutOff = 30; + + // Returned or thrown by various protocols to signal 'I'm not + // handling this'. + var Pass = CodeMirror.Pass = {toString: function(){return "CodeMirror.Pass";}}; + + function Delayed() {this.id = null;} + Delayed.prototype = {set: function(ms, f) {clearTimeout(this.id); this.id = setTimeout(f, ms);}}; + + // Counts the column offset in a string, taking tabs into account. + // Used mostly to find indentation. + function countColumn(string, end, tabSize) { + if (end == null) { + end = string.search(/[^\s\u00a0]/); + if (end == -1) end = string.length; + } + for (var i = 0, n = 0; i < end; ++i) { + if (string.charAt(i) == "\t") n += tabSize - (n % tabSize); + else ++n; + } + return n; + } + CodeMirror.countColumn = countColumn; + + var spaceStrs = [""]; + function spaceStr(n) { + while (spaceStrs.length <= n) + spaceStrs.push(lst(spaceStrs) + " "); + return spaceStrs[n]; + } + + function lst(arr) { return arr[arr.length-1]; } + + function selectInput(node) { + if (ios) { // Mobile Safari apparently has a bug where select() is broken. + node.selectionStart = 0; + node.selectionEnd = node.value.length; + } else node.select(); + } + + function indexOf(collection, elt) { + if (collection.indexOf) return collection.indexOf(elt); + for (var i = 0, e = collection.length; i < e; ++i) + if (collection[i] == elt) return i; + return -1; + } + + function emptyArray(size) { + for (var a = [], i = 0; i < size; ++i) a.push(undefined); + return a; + } + + function bind(f) { + var args = Array.prototype.slice.call(arguments, 1); + return function(){return f.apply(null, args);}; + } + + var nonASCIISingleCaseWordChar = /[\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc]/; + function isWordChar(ch) { + return /\w/.test(ch) || ch > "\x80" && + (ch.toUpperCase() != ch.toLowerCase() || nonASCIISingleCaseWordChar.test(ch)); + } + + function isEmpty(obj) { + var c = 0; + for (var n in obj) if (obj.hasOwnProperty(n) && obj[n]) ++c; + return !c; + } + + var isExtendingChar = /[\u0300-\u036F\u0483-\u0487\u0488-\u0489\u0591-\u05BD\u05BF\u05C1-\u05C2\u05C4-\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7-\u06E8\u06EA-\u06ED\uA66F\uA670-\uA672\uA674-\uA67D\uA69F]/; + + // DOM UTILITIES + + function elt(tag, content, className, style) { + var e = document.createElement(tag); + if (className) e.className = className; + if (style) e.style.cssText = style; + if (typeof content == "string") setTextContent(e, content); + else if (content) for (var i = 0; i < content.length; ++i) e.appendChild(content[i]); + return e; + } + + function removeChildren(e) { + e.innerHTML = ""; + return e; + } + + function removeChildrenAndAdd(parent, e) { + return removeChildren(parent).appendChild(e); + } + + function setTextContent(e, str) { + if (ie_lt9) { + e.innerHTML = ""; + e.appendChild(document.createTextNode(str)); + } else e.textContent = str; + } + + // FEATURE DETECTION + + // Detect drag-and-drop + var dragAndDrop = function() { + // There is *some* kind of drag-and-drop support in IE6-8, but I + // couldn't get it to work yet. + if (ie_lt9) return false; + var div = elt('div'); + return "draggable" in div || "dragDrop" in div; + }(); + + // For a reason I have yet to figure out, some browsers disallow + // word wrapping between certain characters *only* if a new inline + // element is started between them. This makes it hard to reliably + // measure the position of things, since that requires inserting an + // extra span. This terribly fragile set of regexps matches the + // character combinations that suffer from this phenomenon on the + // various browsers. + var spanAffectsWrapping = /^$/; // Won't match any two-character string + if (gecko) spanAffectsWrapping = /$'/; + else if (safari) spanAffectsWrapping = /\-[^ \-?]|\?[^ !'\"\),.\-\/:;\?\]\}]/; + else if (chrome) spanAffectsWrapping = /\-[^ \-\.?]|\?[^ \-\.?\]\}:;!'\"\),\/]|[\.!\"#&%\)*+,:;=>\]|\}~][\(\{\[<]|\$'/; + + var knownScrollbarWidth; + function scrollbarWidth(measure) { + if (knownScrollbarWidth != null) return knownScrollbarWidth; + var test = elt("div", null, null, "width: 50px; height: 50px; overflow-x: scroll"); + removeChildrenAndAdd(measure, test); + if (test.offsetWidth) + knownScrollbarWidth = test.offsetHeight - test.clientHeight; + return knownScrollbarWidth || 0; + } + + var zwspSupported; + function zeroWidthElement(measure) { + if (zwspSupported == null) { + var test = elt("span", "\u200b"); + removeChildrenAndAdd(measure, elt("span", [test, document.createTextNode("x")])); + if (measure.firstChild.offsetHeight != 0) + zwspSupported = test.offsetWidth <= 1 && test.offsetHeight > 2 && !ie_lt8; + } + if (zwspSupported) return elt("span", "\u200b"); + else return elt("span", "\u00a0", null, "display: inline-block; width: 1px; margin-right: -1px"); + } + + // See if "".split is the broken IE version, if so, provide an + // alternative way to split lines. + var splitLines = "\n\nb".split(/\n/).length != 3 ? function(string) { + var pos = 0, result = [], l = string.length; + while (pos <= l) { + var nl = string.indexOf("\n", pos); + if (nl == -1) nl = string.length; + var line = string.slice(pos, string.charAt(nl - 1) == "\r" ? nl - 1 : nl); + var rt = line.indexOf("\r"); + if (rt != -1) { + result.push(line.slice(0, rt)); + pos += rt + 1; + } else { + result.push(line); + pos = nl + 1; + } + } + return result; + } : function(string){return string.split(/\r\n?|\n/);}; + CodeMirror.splitLines = splitLines; + + var hasSelection = window.getSelection ? function(te) { + try { return te.selectionStart != te.selectionEnd; } + catch(e) { return false; } + } : function(te) { + try {var range = te.ownerDocument.selection.createRange();} + catch(e) {} + if (!range || range.parentElement() != te) return false; + return range.compareEndPoints("StartToEnd", range) != 0; + }; + + var hasCopyEvent = (function() { + var e = elt("div"); + if ("oncopy" in e) return true; + e.setAttribute("oncopy", "return;"); + return typeof e.oncopy == 'function'; + })(); + + // KEY NAMING + + var keyNames = {3: "Enter", 8: "Backspace", 9: "Tab", 13: "Enter", 16: "Shift", 17: "Ctrl", 18: "Alt", + 19: "Pause", 20: "CapsLock", 27: "Esc", 32: "Space", 33: "PageUp", 34: "PageDown", 35: "End", + 36: "Home", 37: "Left", 38: "Up", 39: "Right", 40: "Down", 44: "PrintScrn", 45: "Insert", + 46: "Delete", 59: ";", 91: "Mod", 92: "Mod", 93: "Mod", 109: "-", 107: "=", 127: "Delete", + 186: ";", 187: "=", 188: ",", 189: "-", 190: ".", 191: "/", 192: "`", 219: "[", 220: "\\", + 221: "]", 222: "'", 63276: "PageUp", 63277: "PageDown", 63275: "End", 63273: "Home", + 63234: "Left", 63232: "Up", 63235: "Right", 63233: "Down", 63302: "Insert", 63272: "Delete"}; + CodeMirror.keyNames = keyNames; + (function() { + // Number keys + for (var i = 0; i < 10; i++) keyNames[i + 48] = String(i); + // Alphabetic keys + for (var i = 65; i <= 90; i++) keyNames[i] = String.fromCharCode(i); + // Function keys + for (var i = 1; i <= 12; i++) keyNames[i + 111] = keyNames[i + 63235] = "F" + i; + })(); + + // BIDI HELPERS + + function iterateBidiSections(order, from, to, f) { + if (!order) return f(from, to, "ltr"); + for (var i = 0; i < order.length; ++i) { + var part = order[i]; + if (part.from < to && part.to > from) + f(Math.max(part.from, from), Math.min(part.to, to), part.level == 1 ? "rtl" : "ltr"); + } + } + + function bidiLeft(part) { return part.level % 2 ? part.to : part.from; } + function bidiRight(part) { return part.level % 2 ? part.from : part.to; } + + function lineLeft(line) { var order = getOrder(line); return order ? bidiLeft(order[0]) : 0; } + function lineRight(line) { + var order = getOrder(line); + if (!order) return line.text.length; + return bidiRight(lst(order)); + } + + function lineStart(cm, lineN) { + var line = getLine(cm.view.doc, lineN); + var visual = visualLine(cm.view.doc, line); + if (visual != line) lineN = lineNo(visual); + var order = getOrder(visual); + var ch = !order ? 0 : order[0].level % 2 ? lineRight(visual) : lineLeft(visual); + return {line: lineN, ch: ch}; + } + function lineEnd(cm, lineNo) { + var merged, line; + while (merged = collapsedSpanAtEnd(line = getLine(cm.view.doc, lineNo))) + lineNo = merged.find().to.line; + var order = getOrder(line); + var ch = !order ? line.text.length : order[0].level % 2 ? lineLeft(line) : lineRight(line); + return {line: lineNo, ch: ch}; + } + + // This is somewhat involved. It is needed in order to move + // 'visually' through bi-directional text -- i.e., pressing left + // should make the cursor go left, even when in RTL text. The + // tricky part is the 'jumps', where RTL and LTR text touch each + // other. This often requires the cursor offset to move more than + // one unit, in order to visually move one unit. + function moveVisually(line, start, dir, byUnit) { + var bidi = getOrder(line); + if (!bidi) return moveLogically(line, start, dir, byUnit); + var moveOneUnit = byUnit ? function(pos, dir) { + do pos += dir; + while (pos > 0 && isExtendingChar.test(line.text.charAt(pos))); + return pos; + } : function(pos, dir) { return pos + dir; }; + var linedir = bidi[0].level; + for (var i = 0; i < bidi.length; ++i) { + var part = bidi[i], sticky = part.level % 2 == linedir; + if ((part.from < start && part.to > start) || + (sticky && (part.from == start || part.to == start))) break; + } + var target = moveOneUnit(start, part.level % 2 ? -dir : dir); + + while (target != null) { + if (part.level % 2 == linedir) { + if (target < part.from || target > part.to) { + part = bidi[i += dir]; + target = part && (dir > 0 == part.level % 2 ? moveOneUnit(part.to, -1) : moveOneUnit(part.from, 1)); + } else break; + } else { + if (target == bidiLeft(part)) { + part = bidi[--i]; + target = part && bidiRight(part); + } else if (target == bidiRight(part)) { + part = bidi[++i]; + target = part && bidiLeft(part); + } else break; + } + } + + return target < 0 || target > line.text.length ? null : target; + } + + function moveLogically(line, start, dir, byUnit) { + var target = start + dir; + if (byUnit) while (target > 0 && isExtendingChar.test(line.text.charAt(target))) target += dir; + return target < 0 || target > line.text.length ? null : target; + } + + // Bidirectional ordering algorithm + // See http://unicode.org/reports/tr9/tr9-13.html for the algorithm + // that this (partially) implements. + + // One-char codes used for character types: + // L (L): Left-to-Right + // R (R): Right-to-Left + // r (AL): Right-to-Left Arabic + // 1 (EN): European Number + // + (ES): European Number Separator + // % (ET): European Number Terminator + // n (AN): Arabic Number + // , (CS): Common Number Separator + // m (NSM): Non-Spacing Mark + // b (BN): Boundary Neutral + // s (B): Paragraph Separator + // t (S): Segment Separator + // w (WS): Whitespace + // N (ON): Other Neutrals + + // Returns null if characters are ordered as they appear + // (left-to-right), or an array of sections ({from, to, level} + // objects) in the order in which they occur visually. + var bidiOrdering = (function() { + // Character types for codepoints 0 to 0xff + var lowTypes = "bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLL"; + // Character types for codepoints 0x600 to 0x6ff + var arabicTypes = "rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmmrrrrrrrrrrrrrrrrrr"; + function charType(code) { + if (code <= 0xff) return lowTypes.charAt(code); + else if (0x590 <= code && code <= 0x5f4) return "R"; + else if (0x600 <= code && code <= 0x6ff) return arabicTypes.charAt(code - 0x600); + else if (0x700 <= code && code <= 0x8ac) return "r"; + else return "L"; + } + + var bidiRE = /[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/; + var isNeutral = /[stwN]/, isStrong = /[LRr]/, countsAsLeft = /[Lb1n]/, countsAsNum = /[1n]/; + + return function charOrdering(str) { + if (!bidiRE.test(str)) return false; + var len = str.length, types = [], startType = null; + for (var i = 0, type; i < len; ++i) { + types.push(type = charType(str.charCodeAt(i))); + if (startType == null) { + if (type == "L") startType = "L"; + else if (type == "R" || type == "r") startType = "R"; + } + } + if (startType == null) startType = "L"; + + // W1. Examine each non-spacing mark (NSM) in the level run, and + // change the type of the NSM to the type of the previous + // character. If the NSM is at the start of the level run, it will + // get the type of sor. + for (var i = 0, prev = startType; i < len; ++i) { + var type = types[i]; + if (type == "m") types[i] = prev; + else prev = type; + } + + // W2. Search backwards from each instance of a European number + // until the first strong type (R, L, AL, or sor) is found. If an + // AL is found, change the type of the European number to Arabic + // number. + // W3. Change all ALs to R. + for (var i = 0, cur = startType; i < len; ++i) { + var type = types[i]; + if (type == "1" && cur == "r") types[i] = "n"; + else if (isStrong.test(type)) { cur = type; if (type == "r") types[i] = "R"; } + } + + // W4. A single European separator between two European numbers + // changes to a European number. A single common separator between + // two numbers of the same type changes to that type. + for (var i = 1, prev = types[0]; i < len - 1; ++i) { + var type = types[i]; + if (type == "+" && prev == "1" && types[i+1] == "1") types[i] = "1"; + else if (type == "," && prev == types[i+1] && + (prev == "1" || prev == "n")) types[i] = prev; + prev = type; + } + + // W5. A sequence of European terminators adjacent to European + // numbers changes to all European numbers. + // W6. Otherwise, separators and terminators change to Other + // Neutral. + for (var i = 0; i < len; ++i) { + var type = types[i]; + if (type == ",") types[i] = "N"; + else if (type == "%") { + for (var end = i + 1; end < len && types[end] == "%"; ++end) {} + var replace = (i && types[i-1] == "!") || (end < len - 1 && types[end] == "1") ? "1" : "N"; + for (var j = i; j < end; ++j) types[j] = replace; + i = end - 1; + } + } + + // W7. Search backwards from each instance of a European number + // until the first strong type (R, L, or sor) is found. If an L is + // found, then change the type of the European number to L. + for (var i = 0, cur = startType; i < len; ++i) { + var type = types[i]; + if (cur == "L" && type == "1") types[i] = "L"; + else if (isStrong.test(type)) cur = type; + } + + // N1. A sequence of neutrals takes the direction of the + // surrounding strong text if the text on both sides has the same + // direction. European and Arabic numbers act as if they were R in + // terms of their influence on neutrals. Start-of-level-run (sor) + // and end-of-level-run (eor) are used at level run boundaries. + // N2. Any remaining neutrals take the embedding direction. + for (var i = 0; i < len; ++i) { + if (isNeutral.test(types[i])) { + for (var end = i + 1; end < len && isNeutral.test(types[end]); ++end) {} + var before = (i ? types[i-1] : startType) == "L"; + var after = (end < len - 1 ? types[end] : startType) == "L"; + var replace = before || after ? "L" : "R"; + for (var j = i; j < end; ++j) types[j] = replace; + i = end - 1; + } + } + + // Here we depart from the documented algorithm, in order to avoid + // building up an actual levels array. Since there are only three + // levels (0, 1, 2) in an implementation that doesn't take + // explicit embedding into account, we can build up the order on + // the fly, without following the level-based algorithm. + var order = [], m; + for (var i = 0; i < len;) { + if (countsAsLeft.test(types[i])) { + var start = i; + for (++i; i < len && countsAsLeft.test(types[i]); ++i) {} + order.push({from: start, to: i, level: 0}); + } else { + var pos = i, at = order.length; + for (++i; i < len && types[i] != "L"; ++i) {} + for (var j = pos; j < i;) { + if (countsAsNum.test(types[j])) { + if (pos < j) order.splice(at, 0, {from: pos, to: j, level: 1}); + var nstart = j; + for (++j; j < i && countsAsNum.test(types[j]); ++j) {} + order.splice(at, 0, {from: nstart, to: j, level: 2}); + pos = j; + } else ++j; + } + if (pos < i) order.splice(at, 0, {from: pos, to: i, level: 1}); + } + } + if (order[0].level == 1 && (m = str.match(/^\s+/))) { + order[0].from = m[0].length; + order.unshift({from: 0, to: m[0].length, level: 0}); + } + if (lst(order).level == 1 && (m = str.match(/\s+$/))) { + lst(order).to -= m[0].length; + order.push({from: len - m[0].length, to: len, level: 0}); + } + if (order[0].level != lst(order).level) + order.push({from: len, to: len, level: order[0].level}); + + return order; + }; + })(); + + // THE END + + CodeMirror.version = "3.0"; + + return CodeMirror; +})(); diff --git a/lib/report/assets/scripts/vendor/codemirror/javascript.js b/lib/report/assets/scripts/vendor/codemirror/javascript.js new file mode 100755 index 0000000..f00be91 --- /dev/null +++ b/lib/report/assets/scripts/vendor/codemirror/javascript.js @@ -0,0 +1,411 @@ +// TODO actually recognize syntax of TypeScript constructs + +CodeMirror.defineMode("javascript", function(config, parserConfig) { + var indentUnit = config.indentUnit; + var jsonMode = parserConfig.json; + var isTS = parserConfig.typescript; + + // Tokenizer + + var keywords = function(){ + function kw(type) {return {type: type, style: "keyword"};} + var A = kw("keyword a"), B = kw("keyword b"), C = kw("keyword c"); + var operator = kw("operator"), atom = {type: "atom", style: "atom"}; + + var jsKeywords = { + "if": A, "while": A, "with": A, "else": B, "do": B, "try": B, "finally": B, + "return": C, "break": C, "continue": C, "new": C, "delete": C, "throw": C, + "var": kw("var"), "const": kw("var"), "let": kw("var"), + "function": kw("function"), "catch": kw("catch"), + "for": kw("for"), "switch": kw("switch"), "case": kw("case"), "default": kw("default"), + "in": operator, "typeof": operator, "instanceof": operator, + "true": atom, "false": atom, "null": atom, "undefined": atom, "NaN": atom, "Infinity": atom + }; + + // Extend the 'normal' keywords with the TypeScript language extensions + if (isTS) { + var type = {type: "variable", style: "variable-3"}; + var tsKeywords = { + // object-like things + "interface": kw("interface"), + "class": kw("class"), + "extends": kw("extends"), + "constructor": kw("constructor"), + + // scope modifiers + "public": kw("public"), + "private": kw("private"), + "protected": kw("protected"), + "static": kw("static"), + + "super": kw("super"), + + // types + "string": type, "number": type, "bool": type, "any": type + }; + + for (var attr in tsKeywords) { + jsKeywords[attr] = tsKeywords[attr]; + } + } + + return jsKeywords; + }(); + + var isOperatorChar = /[+\-*&%=<>!?|]/; + + function chain(stream, state, f) { + state.tokenize = f; + return f(stream, state); + } + + function nextUntilUnescaped(stream, end) { + var escaped = false, next; + while ((next = stream.next()) != null) { + if (next == end && !escaped) + return false; + escaped = !escaped && next == "\\"; + } + return escaped; + } + + // Used as scratch variables to communicate multiple values without + // consing up tons of objects. + var type, content; + function ret(tp, style, cont) { + type = tp; content = cont; + return style; + } + + function jsTokenBase(stream, state) { + var ch = stream.next(); + if (ch == '"' || ch == "'") + return chain(stream, state, jsTokenString(ch)); + else if (/[\[\]{}\(\),;\:\.]/.test(ch)) + return ret(ch); + else if (ch == "0" && stream.eat(/x/i)) { + stream.eatWhile(/[\da-f]/i); + return ret("number", "number"); + } + else if (/\d/.test(ch) || ch == "-" && stream.eat(/\d/)) { + stream.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/); + return ret("number", "number"); + } + else if (ch == "/") { + if (stream.eat("*")) { + return chain(stream, state, jsTokenComment); + } + else if (stream.eat("/")) { + stream.skipToEnd(); + return ret("comment", "comment"); + } + else if (state.lastType == "operator" || state.lastType == "keyword c" || + /^[\[{}\(,;:]$/.test(state.lastType)) { + nextUntilUnescaped(stream, "/"); + stream.eatWhile(/[gimy]/); // 'y' is "sticky" option in Mozilla + return ret("regexp", "string-2"); + } + else { + stream.eatWhile(isOperatorChar); + return ret("operator", null, stream.current()); + } + } + else if (ch == "#") { + stream.skipToEnd(); + return ret("error", "error"); + } + else if (isOperatorChar.test(ch)) { + stream.eatWhile(isOperatorChar); + return ret("operator", null, stream.current()); + } + else { + stream.eatWhile(/[\w\$_]/); + var word = stream.current(), known = keywords.propertyIsEnumerable(word) && keywords[word]; + return (known && state.lastType != ".") ? ret(known.type, known.style, word) : + ret("variable", "variable", word); + } + } + + function jsTokenString(quote) { + return function(stream, state) { + if (!nextUntilUnescaped(stream, quote)) + state.tokenize = jsTokenBase; + return ret("string", "string"); + }; + } + + function jsTokenComment(stream, state) { + var maybeEnd = false, ch; + while (ch = stream.next()) { + if (ch == "/" && maybeEnd) { + state.tokenize = jsTokenBase; + break; + } + maybeEnd = (ch == "*"); + } + return ret("comment", "comment"); + } + + // Parser + + var atomicTypes = {"atom": true, "number": true, "variable": true, "string": true, "regexp": true}; + + function JSLexical(indented, column, type, align, prev, info) { + this.indented = indented; + this.column = column; + this.type = type; + this.prev = prev; + this.info = info; + if (align != null) this.align = align; + } + + function inScope(state, varname) { + for (var v = state.localVars; v; v = v.next) + if (v.name == varname) return true; + } + + function parseJS(state, style, type, content, stream) { + var cc = state.cc; + // Communicate our context to the combinators. + // (Less wasteful than consing up a hundred closures on every call.) + cx.state = state; cx.stream = stream; cx.marked = null, cx.cc = cc; + + if (!state.lexical.hasOwnProperty("align")) + state.lexical.align = true; + + while(true) { + var combinator = cc.length ? cc.pop() : jsonMode ? expression : statement; + if (combinator(type, content)) { + while(cc.length && cc[cc.length - 1].lex) + cc.pop()(); + if (cx.marked) return cx.marked; + if (type == "variable" && inScope(state, content)) return "variable-2"; + return style; + } + } + } + + // Combinator utils + + var cx = {state: null, column: null, marked: null, cc: null}; + function pass() { + for (var i = arguments.length - 1; i >= 0; i--) cx.cc.push(arguments[i]); + } + function cont() { + pass.apply(null, arguments); + return true; + } + function register(varname) { + var state = cx.state; + if (state.context) { + cx.marked = "def"; + for (var v = state.localVars; v; v = v.next) + if (v.name == varname) return; + state.localVars = {name: varname, next: state.localVars}; + } + } + + // Combinators + + var defaultVars = {name: "this", next: {name: "arguments"}}; + function pushcontext() { + cx.state.context = {prev: cx.state.context, vars: cx.state.localVars}; + cx.state.localVars = defaultVars; + } + function popcontext() { + cx.state.localVars = cx.state.context.vars; + cx.state.context = cx.state.context.prev; + } + function pushlex(type, info) { + var result = function() { + var state = cx.state; + state.lexical = new JSLexical(state.indented, cx.stream.column(), type, null, state.lexical, info); + }; + result.lex = true; + return result; + } + function poplex() { + var state = cx.state; + if (state.lexical.prev) { + if (state.lexical.type == ")") + state.indented = state.lexical.indented; + state.lexical = state.lexical.prev; + } + } + poplex.lex = true; + + function expect(wanted) { + return function expecting(type) { + if (type == wanted) return cont(); + else if (wanted == ";") return pass(); + else return cont(arguments.callee); + }; + } + + function statement(type) { + if (type == "var") return cont(pushlex("vardef"), vardef1, expect(";"), poplex); + if (type == "keyword a") return cont(pushlex("form"), expression, statement, poplex); + if (type == "keyword b") return cont(pushlex("form"), statement, poplex); + if (type == "{") return cont(pushlex("}"), block, poplex); + if (type == ";") return cont(); + if (type == "function") return cont(functiondef); + if (type == "for") return cont(pushlex("form"), expect("("), pushlex(")"), forspec1, expect(")"), + poplex, statement, poplex); + if (type == "variable") return cont(pushlex("stat"), maybelabel); + if (type == "switch") return cont(pushlex("form"), expression, pushlex("}", "switch"), expect("{"), + block, poplex, poplex); + if (type == "case") return cont(expression, expect(":")); + if (type == "default") return cont(expect(":")); + if (type == "catch") return cont(pushlex("form"), pushcontext, expect("("), funarg, expect(")"), + statement, poplex, popcontext); + return pass(pushlex("stat"), expression, expect(";"), poplex); + } + function expression(type) { + if (atomicTypes.hasOwnProperty(type)) return cont(maybeoperator); + if (type == "function") return cont(functiondef); + if (type == "keyword c") return cont(maybeexpression); + if (type == "(") return cont(pushlex(")"), maybeexpression, expect(")"), poplex, maybeoperator); + if (type == "operator") return cont(expression); + if (type == "[") return cont(pushlex("]"), commasep(expression, "]"), poplex, maybeoperator); + if (type == "{") return cont(pushlex("}"), commasep(objprop, "}"), poplex, maybeoperator); + return cont(); + } + function maybeexpression(type) { + if (type.match(/[;\}\)\],]/)) return pass(); + return pass(expression); + } + + function maybeoperator(type, value) { + if (type == "operator" && /\+\+|--/.test(value)) return cont(maybeoperator); + if (type == "operator" && value == "?") return cont(expression, expect(":"), expression); + if (type == ";") return; + if (type == "(") return cont(pushlex(")"), commasep(expression, ")"), poplex, maybeoperator); + if (type == ".") return cont(property, maybeoperator); + if (type == "[") return cont(pushlex("]"), expression, expect("]"), poplex, maybeoperator); + } + function maybelabel(type) { + if (type == ":") return cont(poplex, statement); + return pass(maybeoperator, expect(";"), poplex); + } + function property(type) { + if (type == "variable") {cx.marked = "property"; return cont();} + } + function objprop(type) { + if (type == "variable") cx.marked = "property"; + if (atomicTypes.hasOwnProperty(type)) return cont(expect(":"), expression); + } + function commasep(what, end) { + function proceed(type) { + if (type == ",") return cont(what, proceed); + if (type == end) return cont(); + return cont(expect(end)); + } + return function commaSeparated(type) { + if (type == end) return cont(); + else return pass(what, proceed); + }; + } + function block(type) { + if (type == "}") return cont(); + return pass(statement, block); + } + function maybetype(type) { + if (type == ":") return cont(typedef); + return pass(); + } + function typedef(type) { + if (type == "variable"){cx.marked = "variable-3"; return cont();} + return pass(); + } + function vardef1(type, value) { + if (type == "variable") { + register(value); + return isTS ? cont(maybetype, vardef2) : cont(vardef2); + } + return pass(); + } + function vardef2(type, value) { + if (value == "=") return cont(expression, vardef2); + if (type == ",") return cont(vardef1); + } + function forspec1(type) { + if (type == "var") return cont(vardef1, expect(";"), forspec2); + if (type == ";") return cont(forspec2); + if (type == "variable") return cont(formaybein); + return cont(forspec2); + } + function formaybein(_type, value) { + if (value == "in") return cont(expression); + return cont(maybeoperator, forspec2); + } + function forspec2(type, value) { + if (type == ";") return cont(forspec3); + if (value == "in") return cont(expression); + return cont(expression, expect(";"), forspec3); + } + function forspec3(type) { + if (type != ")") cont(expression); + } + function functiondef(type, value) { + if (type == "variable") {register(value); return cont(functiondef);} + if (type == "(") return cont(pushlex(")"), pushcontext, commasep(funarg, ")"), poplex, statement, popcontext); + } + function funarg(type, value) { + if (type == "variable") {register(value); return isTS ? cont(maybetype) : cont();} + } + + // Interface + + return { + startState: function(basecolumn) { + return { + tokenize: jsTokenBase, + lastType: null, + cc: [], + lexical: new JSLexical((basecolumn || 0) - indentUnit, 0, "block", false), + localVars: parserConfig.localVars, + context: parserConfig.localVars && {vars: parserConfig.localVars}, + indented: 0 + }; + }, + + token: function(stream, state) { + if (stream.sol()) { + if (!state.lexical.hasOwnProperty("align")) + state.lexical.align = false; + state.indented = stream.indentation(); + } + if (stream.eatSpace()) return null; + var style = state.tokenize(stream, state); + if (type == "comment") return style; + state.lastType = type; + return parseJS(state, style, type, content, stream); + }, + + indent: function(state, textAfter) { + if (state.tokenize == jsTokenComment) return CodeMirror.Pass; + if (state.tokenize != jsTokenBase) return 0; + var firstChar = textAfter && textAfter.charAt(0), lexical = state.lexical; + if (lexical.type == "stat" && firstChar == "}") lexical = lexical.prev; + var type = lexical.type, closing = firstChar == type; + if (type == "vardef") return lexical.indented + (state.lastType == "operator" || state.lastType == "," ? 4 : 0); + else if (type == "form" && firstChar == "{") return lexical.indented; + else if (type == "form") return lexical.indented + indentUnit; + else if (type == "stat") + return lexical.indented + (state.lastType == "operator" || state.lastType == "," ? indentUnit : 0); + else if (lexical.info == "switch" && !closing) + return lexical.indented + (/^(?:case|default)\b/.test(textAfter) ? indentUnit : 2 * indentUnit); + else if (lexical.align) return lexical.column + (closing ? 0 : 1); + else return lexical.indented + (closing ? 0 : indentUnit); + }, + + electricChars: ":{}", + + jsonMode: jsonMode + }; +}); + +CodeMirror.defineMIME("text/javascript", "javascript"); +CodeMirror.defineMIME("application/json", {name: "javascript", json: true}); +CodeMirror.defineMIME("text/typescript", { name: "javascript", typescript: true }); +CodeMirror.defineMIME("application/typescript", { name: "javascript", typescript: true }); diff --git a/lib/report/assets/scripts/vendor/codemirror/util/closetag.js b/lib/report/assets/scripts/vendor/codemirror/util/closetag.js new file mode 100755 index 0000000..7320c17 --- /dev/null +++ b/lib/report/assets/scripts/vendor/codemirror/util/closetag.js @@ -0,0 +1,85 @@ +/** + * Tag-closer extension for CodeMirror. + * + * This extension adds an "autoCloseTags" option that can be set to + * either true to get the default behavior, or an object to further + * configure its behavior. + * + * These are supported options: + * + * `whenClosing` (default true) + * Whether to autoclose when the '/' of a closing tag is typed. + * `whenOpening` (default true) + * Whether to autoclose the tag when the final '>' of an opening + * tag is typed. + * `dontCloseTags` (default is empty tags for HTML, none for XML) + * An array of tag names that should not be autoclosed. + * `indentTags` (default is block tags for HTML, none for XML) + * An array of tag names that should, when opened, cause a + * blank line to be added inside the tag, and the blank line and + * closing line to be indented. + * + * See demos/closetag.html for a usage example. + */ + +(function() { + CodeMirror.defineOption("autoCloseTags", false, function(cm, val, old) { + if (val && (old == CodeMirror.Init || !old)) { + var map = {name: "autoCloseTags"}; + if (typeof val != "object" || val.whenClosing) + map["'/'"] = function(cm) { autoCloseTag(cm, '/'); }; + if (typeof val != "object" || val.whenOpening) + map["'>'"] = function(cm) { autoCloseTag(cm, '>'); }; + cm.addKeyMap(map); + } else if (!val && (old != CodeMirror.Init && old)) { + cm.removeKeyMap("autoCloseTags"); + } + }); + + var htmlDontClose = ["area", "base", "br", "col", "command", "embed", "hr", "img", "input", "keygen", "link", "meta", "param", + "source", "track", "wbr"]; + var htmlIndent = ["applet", "blockquote", "body", "button", "div", "dl", "fieldset", "form", "frameset", "h1", "h2", "h3", "h4", + "h5", "h6", "head", "html", "iframe", "layer", "legend", "object", "ol", "p", "select", "table", "ul"]; + + function autoCloseTag(cm, ch) { + var pos = cm.getCursor(), tok = cm.getTokenAt(pos); + var inner = CodeMirror.innerMode(cm.getMode(), tok.state), state = inner.state; + if (inner.mode.name != "xml") throw CodeMirror.Pass; + + var opt = cm.getOption("autoCloseTags"), html = inner.mode.configuration == "html"; + var dontCloseTags = (typeof opt == "object" && opt.dontCloseTags) || (html && htmlDontClose); + var indentTags = (typeof opt == "object" && opt.indentTags) || (html && htmlIndent); + + if (ch == ">" && state.tagName) { + var tagName = state.tagName; + if (tok.end > pos.ch) tagName = tagName.slice(0, tagName.length - tok.end + pos.ch); + var lowerTagName = tagName.toLowerCase(); + // Don't process the '>' at the end of an end-tag or self-closing tag + if (tok.type == "tag" && state.type == "closeTag" || + /\/\s*$/.test(tok.string) || + dontCloseTags && indexOf(dontCloseTags, lowerTagName) > -1) + throw CodeMirror.Pass; + + var doIndent = indentTags && indexOf(indentTags, lowerTagName) > -1; + cm.replaceSelection(">" + (doIndent ? "\n\n" : "") + "", + doIndent ? {line: pos.line + 1, ch: 0} : {line: pos.line, ch: pos.ch + 1}); + if (doIndent) { + cm.indentLine(pos.line + 1); + cm.indentLine(pos.line + 2); + } + return; + } else if (ch == "/" && tok.type == "tag" && tok.string == "<") { + var tagName = state.context && state.context.tagName; + if (tagName) cm.replaceSelection("/" + tagName + ">", "end"); + return; + } + throw CodeMirror.Pass; + } + + function indexOf(collection, elt) { + if (collection.indexOf) return collection.indexOf(elt); + for (var i = 0, e = collection.length; i < e; ++i) + if (collection[i] == elt) return i; + return -1; + } +})(); diff --git a/lib/report/assets/scripts/vendor/codemirror/util/colorize.js b/lib/report/assets/scripts/vendor/codemirror/util/colorize.js new file mode 100755 index 0000000..62286d2 --- /dev/null +++ b/lib/report/assets/scripts/vendor/codemirror/util/colorize.js @@ -0,0 +1,29 @@ +CodeMirror.colorize = (function() { + + var isBlock = /^(p|li|div|h\\d|pre|blockquote|td)$/; + + function textContent(node, out) { + if (node.nodeType == 3) return out.push(node.nodeValue); + for (var ch = node.firstChild; ch; ch = ch.nextSibling) { + textContent(ch, out); + if (isBlock.test(node.nodeType)) out.push("\n"); + } + } + + return function(collection, defaultMode) { + if (!collection) collection = document.body.getElementsByTagName("pre"); + + for (var i = 0; i < collection.length; ++i) { + var node = collection[i]; + var mode = node.getAttribute("data-lang") || defaultMode; + if (!mode) continue; + + var text = []; + textContent(node, text); + node.innerHTML = ""; + CodeMirror.runMode(text.join(""), mode, node); + + node.className += " cm-s-default"; + } + }; +})(); diff --git a/lib/report/assets/scripts/vendor/codemirror/util/continuecomment.js b/lib/report/assets/scripts/vendor/codemirror/util/continuecomment.js new file mode 100755 index 0000000..dac83a8 --- /dev/null +++ b/lib/report/assets/scripts/vendor/codemirror/util/continuecomment.js @@ -0,0 +1,36 @@ +(function() { + var modes = ["clike", "css", "javascript"]; + for (var i = 0; i < modes.length; ++i) + CodeMirror.extendMode(modes[i], {blockCommentStart: "/*", + blockCommentEnd: "*/", + blockCommentContinue: " * "}); + + CodeMirror.commands.newlineAndIndentContinueComment = function(cm) { + var pos = cm.getCursor(), token = cm.getTokenAt(pos); + var mode = CodeMirror.innerMode(cm.getMode(), token.state).mode; + var space; + + if (token.type == "comment" && mode.blockCommentStart) { + var end = token.string.indexOf(mode.blockCommentEnd); + var full = cm.getRange({line: pos.line, ch: 0}, {line: pos.line, ch: token.end}), found; + if (end != -1 && end == token.string.length - mode.blockCommentEnd.length) { + // Comment ended, don't continue it + } else if (token.string.indexOf(mode.blockCommentStart) == 0) { + space = full.slice(0, token.start); + if (!/^\s*$/.test(space)) { + space = ""; + for (var i = 0; i < token.start; ++i) space += " "; + } + } else if ((found = full.indexOf(mode.blockCommentContinue)) != -1 && + found + mode.blockCommentContinue.length > token.start && + /^\s*$/.test(full.slice(0, found))) { + space = full.slice(0, found); + } + } + + if (space != null) + cm.replaceSelection("\n" + space + mode.blockCommentContinue, "end"); + else + cm.execCommand("newlineAndIndent"); + }; +})(); diff --git a/lib/report/assets/scripts/vendor/codemirror/util/continuelist.js b/lib/report/assets/scripts/vendor/codemirror/util/continuelist.js new file mode 100755 index 0000000..33b343b --- /dev/null +++ b/lib/report/assets/scripts/vendor/codemirror/util/continuelist.js @@ -0,0 +1,28 @@ +(function() { + CodeMirror.commands.newlineAndIndentContinueMarkdownList = function(cm) { + var pos = cm.getCursor(), token = cm.getTokenAt(pos); + var space; + if (token.className == "string") { + var full = cm.getRange({line: pos.line, ch: 0}, {line: pos.line, ch: token.end}); + var listStart = /\*|\d+\./, listContinue; + if (token.string.search(listStart) == 0) { + var reg = /^[\W]*(\d+)\./g; + var matches = reg.exec(full); + if(matches) + listContinue = (parseInt(matches[1]) + 1) + ". "; + else + listContinue = "* "; + space = full.slice(0, token.start); + if (!/^\s*$/.test(space)) { + space = ""; + for (var i = 0; i < token.start; ++i) space += " "; + } + } + } + + if (space != null) + cm.replaceSelection("\n" + space + listContinue, "end"); + else + cm.execCommand("newlineAndIndent"); + }; +})(); diff --git a/lib/report/assets/scripts/vendor/codemirror/util/dialog.css b/lib/report/assets/scripts/vendor/codemirror/util/dialog.css new file mode 100755 index 0000000..2e7c0fc --- /dev/null +++ b/lib/report/assets/scripts/vendor/codemirror/util/dialog.css @@ -0,0 +1,32 @@ +.CodeMirror-dialog { + position: absolute; + left: 0; right: 0; + background: white; + z-index: 15; + padding: .1em .8em; + overflow: hidden; + color: #333; +} + +.CodeMirror-dialog-top { + border-bottom: 1px solid #eee; + top: 0; +} + +.CodeMirror-dialog-bottom { + border-top: 1px solid #eee; + bottom: 0; +} + +.CodeMirror-dialog input { + border: none; + outline: none; + background: transparent; + width: 20em; + color: inherit; + font-family: monospace; +} + +.CodeMirror-dialog button { + font-size: 70%; +} diff --git a/lib/report/assets/scripts/vendor/codemirror/util/dialog.js b/lib/report/assets/scripts/vendor/codemirror/util/dialog.js new file mode 100755 index 0000000..380b804 --- /dev/null +++ b/lib/report/assets/scripts/vendor/codemirror/util/dialog.js @@ -0,0 +1,75 @@ +// Open simple dialogs on top of an editor. Relies on dialog.css. + +(function() { + function dialogDiv(cm, template, bottom) { + var wrap = cm.getWrapperElement(); + var dialog; + dialog = wrap.appendChild(document.createElement("div")); + if (bottom) { + dialog.className = "CodeMirror-dialog CodeMirror-dialog-bottom"; + } else { + dialog.className = "CodeMirror-dialog CodeMirror-dialog-top"; + } + dialog.innerHTML = template; + return dialog; + } + + CodeMirror.defineExtension("openDialog", function(template, callback, options) { + var dialog = dialogDiv(this, template, options && options.bottom); + var closed = false, me = this; + function close() { + if (closed) return; + closed = true; + dialog.parentNode.removeChild(dialog); + } + var inp = dialog.getElementsByTagName("input")[0], button; + if (inp) { + CodeMirror.on(inp, "keydown", function(e) { + if (e.keyCode == 13 || e.keyCode == 27) { + CodeMirror.e_stop(e); + close(); + me.focus(); + if (e.keyCode == 13) callback(inp.value); + } + }); + inp.focus(); + CodeMirror.on(inp, "blur", close); + } else if (button = dialog.getElementsByTagName("button")[0]) { + CodeMirror.on(button, "click", function() { + close(); + me.focus(); + }); + button.focus(); + CodeMirror.on(button, "blur", close); + } + return close; + }); + + CodeMirror.defineExtension("openConfirm", function(template, callbacks, options) { + var dialog = dialogDiv(this, template, options && options.bottom); + var buttons = dialog.getElementsByTagName("button"); + var closed = false, me = this, blurring = 1; + function close() { + if (closed) return; + closed = true; + dialog.parentNode.removeChild(dialog); + me.focus(); + } + buttons[0].focus(); + for (var i = 0; i < buttons.length; ++i) { + var b = buttons[i]; + (function(callback) { + CodeMirror.on(b, "click", function(e) { + CodeMirror.e_preventDefault(e); + close(); + if (callback) callback(me); + }); + })(callbacks[i]); + CodeMirror.on(b, "blur", function() { + --blurring; + setTimeout(function() { if (blurring <= 0) close(); }, 200); + }); + CodeMirror.on(b, "focus", function() { ++blurring; }); + } + }); +})(); diff --git a/lib/report/assets/scripts/vendor/codemirror/util/foldcode.js b/lib/report/assets/scripts/vendor/codemirror/util/foldcode.js new file mode 100755 index 0000000..407bac2 --- /dev/null +++ b/lib/report/assets/scripts/vendor/codemirror/util/foldcode.js @@ -0,0 +1,182 @@ +// the tagRangeFinder function is +// Copyright (C) 2011 by Daniel Glazman +// released under the MIT license (../../LICENSE) like the rest of CodeMirror +CodeMirror.tagRangeFinder = function(cm, start) { + var nameStartChar = "A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD"; + var nameChar = nameStartChar + "\-\:\.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040"; + var xmlNAMERegExp = new RegExp("^[" + nameStartChar + "][" + nameChar + "]*"); + + var lineText = cm.getLine(start.line); + var found = false; + var tag = null; + var pos = start.ch; + while (!found) { + pos = lineText.indexOf("<", pos); + if (-1 == pos) // no tag on line + return; + if (pos + 1 < lineText.length && lineText[pos + 1] == "/") { // closing tag + pos++; + continue; + } + // ok we seem to have a start tag + if (!lineText.substr(pos + 1).match(xmlNAMERegExp)) { // not a tag name... + pos++; + continue; + } + var gtPos = lineText.indexOf(">", pos + 1); + if (-1 == gtPos) { // end of start tag not in line + var l = start.line + 1; + var foundGt = false; + var lastLine = cm.lineCount(); + while (l < lastLine && !foundGt) { + var lt = cm.getLine(l); + gtPos = lt.indexOf(">"); + if (-1 != gtPos) { // found a > + foundGt = true; + var slash = lt.lastIndexOf("/", gtPos); + if (-1 != slash && slash < gtPos) { + var str = lineText.substr(slash, gtPos - slash + 1); + if (!str.match( /\/\s*\>/ )) // yep, that's the end of empty tag + return; + } + } + l++; + } + found = true; + } + else { + var slashPos = lineText.lastIndexOf("/", gtPos); + if (-1 == slashPos) { // cannot be empty tag + found = true; + // don't continue + } + else { // empty tag? + // check if really empty tag + var str = lineText.substr(slashPos, gtPos - slashPos + 1); + if (!str.match( /\/\s*\>/ )) { // finally not empty + found = true; + // don't continue + } + } + } + if (found) { + var subLine = lineText.substr(pos + 1); + tag = subLine.match(xmlNAMERegExp); + if (tag) { + // we have an element name, wooohooo ! + tag = tag[0]; + // do we have the close tag on same line ??? + if (-1 != lineText.indexOf("", pos)) // yep + { + found = false; + } + // we don't, so we have a candidate... + } + else + found = false; + } + if (!found) + pos++; + } + + if (found) { + var startTag = "(\\<\\/" + tag + "\\>)|(\\<" + tag + "\\>)|(\\<" + tag + "\\s)|(\\<" + tag + "$)"; + var startTagRegExp = new RegExp(startTag); + var endTag = ""; + var depth = 1; + var l = start.line + 1; + var lastLine = cm.lineCount(); + while (l < lastLine) { + lineText = cm.getLine(l); + var match = lineText.match(startTagRegExp); + if (match) { + for (var i = 0; i < match.length; i++) { + if (match[i] == endTag) + depth--; + else + depth++; + if (!depth) return {from: {line: start.line, ch: gtPos + 1}, + to: {line: l, ch: match.index}}; + } + } + l++; + } + return; + } +}; + +CodeMirror.braceRangeFinder = function(cm, start) { + var line = start.line, lineText = cm.getLine(line); + var at = lineText.length, startChar, tokenType; + for (;;) { + var found = lineText.lastIndexOf("{", at); + if (found < start.ch) break; + tokenType = cm.getTokenAt({line: line, ch: found}).type; + if (!/^(comment|string)/.test(tokenType)) { startChar = found; break; } + at = found - 1; + } + if (startChar == null || lineText.lastIndexOf("}") > startChar) return; + var count = 1, lastLine = cm.lineCount(), end, endCh; + outer: for (var i = line + 1; i < lastLine; ++i) { + var text = cm.getLine(i), pos = 0; + for (;;) { + var nextOpen = text.indexOf("{", pos), nextClose = text.indexOf("}", pos); + if (nextOpen < 0) nextOpen = text.length; + if (nextClose < 0) nextClose = text.length; + pos = Math.min(nextOpen, nextClose); + if (pos == text.length) break; + if (cm.getTokenAt({line: i, ch: pos + 1}).type == tokenType) { + if (pos == nextOpen) ++count; + else if (!--count) { end = i; endCh = pos; break outer; } + } + ++pos; + } + } + if (end == null || end == line + 1) return; + return {from: {line: line, ch: startChar + 1}, + to: {line: end, ch: endCh}}; +}; + +CodeMirror.indentRangeFinder = function(cm, start) { + var tabSize = cm.getOption("tabSize"), firstLine = cm.getLine(start.line); + var myIndent = CodeMirror.countColumn(firstLine, null, tabSize); + for (var i = start.line + 1, end = cm.lineCount(); i < end; ++i) { + var curLine = cm.getLine(i); + if (CodeMirror.countColumn(curLine, null, tabSize) < myIndent) + return {from: {line: start.line, ch: firstLine.length}, + to: {line: i, ch: curLine.length}}; + } +}; + +CodeMirror.newFoldFunction = function(rangeFinder, widget) { + if (widget == null) widget = "\u2194"; + if (typeof widget == "string") { + var text = document.createTextNode(widget); + widget = document.createElement("span"); + widget.appendChild(text); + widget.className = "CodeMirror-foldmarker"; + } + + return function(cm, pos) { + if (typeof pos == "number") pos = {line: pos, ch: 0}; + var range = rangeFinder(cm, pos); + if (!range) return; + + var present = cm.findMarksAt(range.from), cleared = 0; + for (var i = 0; i < present.length; ++i) { + if (present[i].__isFold) { + ++cleared; + present[i].clear(); + } + } + if (cleared) return; + + var myWidget = widget.cloneNode(true); + CodeMirror.on(myWidget, "mousedown", function() {myRange.clear();}); + var myRange = cm.markText(range.from, range.to, { + replacedWith: myWidget, + clearOnEnter: true, + __isFold: true + }); + }; +}; diff --git a/lib/report/assets/scripts/vendor/codemirror/util/formatting.js b/lib/report/assets/scripts/vendor/codemirror/util/formatting.js new file mode 100755 index 0000000..ccf2a9a --- /dev/null +++ b/lib/report/assets/scripts/vendor/codemirror/util/formatting.js @@ -0,0 +1,108 @@ +(function() { + + CodeMirror.extendMode("css", { + commentStart: "/*", + commentEnd: "*/", + newlineAfterToken: function(_type, content) { + return /^[;{}]$/.test(content); + } + }); + + CodeMirror.extendMode("javascript", { + commentStart: "/*", + commentEnd: "*/", + // FIXME semicolons inside of for + newlineAfterToken: function(_type, content, textAfter, state) { + if (this.jsonMode) { + return /^[\[,{]$/.test(content) || /^}/.test(textAfter); + } else { + if (content == ";" && state.lexical && state.lexical.type == ")") return false; + return /^[;{}]$/.test(content) && !/^;/.test(textAfter); + } + } + }); + + CodeMirror.extendMode("xml", { + commentStart: "", + newlineAfterToken: function(type, content, textAfter) { + return type == "tag" && />$/.test(content) || /^ -1 && endIndex > -1 && endIndex > startIndex) { + // Take string till comment start + selText = selText.substr(0, startIndex) + // From comment start till comment end + + selText.substring(startIndex + curMode.commentStart.length, endIndex) + // From comment end till string end + + selText.substr(endIndex + curMode.commentEnd.length); + } + cm.replaceRange(selText, from, to); + } + }); + }); + + // Applies automatic mode-aware indentation to the specified range + CodeMirror.defineExtension("autoIndentRange", function (from, to) { + var cmInstance = this; + this.operation(function () { + for (var i = from.line; i <= to.line; i++) { + cmInstance.indentLine(i, "smart"); + } + }); + }); + + // Applies automatic formatting to the specified range + CodeMirror.defineExtension("autoFormatRange", function (from, to) { + var cm = this; + var outer = cm.getMode(), text = cm.getRange(from, to).split("\n"); + var state = CodeMirror.copyState(outer, cm.getTokenAt(from).state); + var tabSize = cm.getOption("tabSize"); + + var out = "", lines = 0, atSol = from.ch == 0; + function newline() { + out += "\n"; + atSol = true; + ++lines; + } + + for (var i = 0; i < text.length; ++i) { + var stream = new CodeMirror.StringStream(text[i], tabSize); + while (!stream.eol()) { + var inner = CodeMirror.innerMode(outer, state); + var style = outer.token(stream, state), cur = stream.current(); + stream.start = stream.pos; + if (!atSol || /\S/.test(cur)) { + out += cur; + atSol = false; + } + if (!atSol && inner.mode.newlineAfterToken && + inner.mode.newlineAfterToken(style, cur, stream.string.slice(stream.pos) || text[i+1] || "", inner.state)) + newline(); + } + if (!stream.pos && outer.blankLine) outer.blankLine(state); + if (!atSol) newline(); + } + + cm.operation(function () { + cm.replaceRange(out, from, to); + for (var cur = from.line + 1, end = from.line + lines; cur <= end; ++cur) + cm.indentLine(cur, "smart"); + cm.setSelection(from, cm.getCursor(false)); + }); + }); +})(); diff --git a/lib/report/assets/scripts/vendor/codemirror/util/javascript-hint.js b/lib/report/assets/scripts/vendor/codemirror/util/javascript-hint.js new file mode 100755 index 0000000..07caba8 --- /dev/null +++ b/lib/report/assets/scripts/vendor/codemirror/util/javascript-hint.js @@ -0,0 +1,137 @@ +(function () { + function forEach(arr, f) { + for (var i = 0, e = arr.length; i < e; ++i) f(arr[i]); + } + + function arrayContains(arr, item) { + if (!Array.prototype.indexOf) { + var i = arr.length; + while (i--) { + if (arr[i] === item) { + return true; + } + } + return false; + } + return arr.indexOf(item) != -1; + } + + function scriptHint(editor, keywords, getToken, options) { + // Find the token at the cursor + var cur = editor.getCursor(), token = getToken(editor, cur), tprop = token; + // If it's not a 'word-style' token, ignore the token. + if (!/^[\w$_]*$/.test(token.string)) { + token = tprop = {start: cur.ch, end: cur.ch, string: "", state: token.state, + type: token.string == "." ? "property" : null}; + } + // If it is a property, find out what it is a property of. + while (tprop.type == "property") { + tprop = getToken(editor, {line: cur.line, ch: tprop.start}); + if (tprop.string != ".") return; + tprop = getToken(editor, {line: cur.line, ch: tprop.start}); + if (tprop.string == ')') { + var level = 1; + do { + tprop = getToken(editor, {line: cur.line, ch: tprop.start}); + switch (tprop.string) { + case ')': level++; break; + case '(': level--; break; + default: break; + } + } while (level > 0); + tprop = getToken(editor, {line: cur.line, ch: tprop.start}); + if (tprop.type == 'variable') + tprop.type = 'function'; + else return; // no clue + } + if (!context) var context = []; + context.push(tprop); + } + return {list: getCompletions(token, context, keywords, options), + from: {line: cur.line, ch: token.start}, + to: {line: cur.line, ch: token.end}}; + } + + CodeMirror.javascriptHint = function(editor, options) { + return scriptHint(editor, javascriptKeywords, + function (e, cur) {return e.getTokenAt(cur);}, + options); + }; + + function getCoffeeScriptToken(editor, cur) { + // This getToken, it is for coffeescript, imitates the behavior of + // getTokenAt method in javascript.js, that is, returning "property" + // type and treat "." as indepenent token. + var token = editor.getTokenAt(cur); + if (cur.ch == token.start + 1 && token.string.charAt(0) == '.') { + token.end = token.start; + token.string = '.'; + token.type = "property"; + } + else if (/^\.[\w$_]*$/.test(token.string)) { + token.type = "property"; + token.start++; + token.string = token.string.replace(/\./, ''); + } + return token; + } + + CodeMirror.coffeescriptHint = function(editor, options) { + return scriptHint(editor, coffeescriptKeywords, getCoffeeScriptToken, options); + }; + + var stringProps = ("charAt charCodeAt indexOf lastIndexOf substring substr slice trim trimLeft trimRight " + + "toUpperCase toLowerCase split concat match replace search").split(" "); + var arrayProps = ("length concat join splice push pop shift unshift slice reverse sort indexOf " + + "lastIndexOf every some filter forEach map reduce reduceRight ").split(" "); + var funcProps = "prototype apply call bind".split(" "); + var javascriptKeywords = ("break case catch continue debugger default delete do else false finally for function " + + "if in instanceof new null return switch throw true try typeof var void while with").split(" "); + var coffeescriptKeywords = ("and break catch class continue delete do else extends false finally for " + + "if in instanceof isnt new no not null of off on or return switch then throw true try typeof until void while with yes").split(" "); + + function getCompletions(token, context, keywords, options) { + var found = [], start = token.string; + function maybeAdd(str) { + if (str.indexOf(start) == 0 && !arrayContains(found, str)) found.push(str); + } + function gatherCompletions(obj) { + if (typeof obj == "string") forEach(stringProps, maybeAdd); + else if (obj instanceof Array) forEach(arrayProps, maybeAdd); + else if (obj instanceof Function) forEach(funcProps, maybeAdd); + for (var name in obj) maybeAdd(name); + } + + if (context) { + // If this is a property, see if it belongs to some object we can + // find in the current environment. + var obj = context.pop(), base; + if (obj.type == "variable") { + if (options && options.additionalContext) + base = options.additionalContext[obj.string]; + base = base || window[obj.string]; + } else if (obj.type == "string") { + base = ""; + } else if (obj.type == "atom") { + base = 1; + } else if (obj.type == "function") { + if (window.jQuery != null && (obj.string == '$' || obj.string == 'jQuery') && + (typeof window.jQuery == 'function')) + base = window.jQuery(); + else if (window._ != null && (obj.string == '_') && (typeof window._ == 'function')) + base = window._(); + } + while (base != null && context.length) + base = base[context.pop().string]; + if (base != null) gatherCompletions(base); + } + else { + // If not, just look in the window object and any local scope + // (reading into JS mode internals to get at the local variables) + for (var v = token.state.localVars; v; v = v.next) maybeAdd(v.name); + gatherCompletions(window); + forEach(keywords, maybeAdd); + } + return found; + } +})(); diff --git a/lib/report/assets/scripts/vendor/codemirror/util/loadmode.js b/lib/report/assets/scripts/vendor/codemirror/util/loadmode.js new file mode 100755 index 0000000..60fafbb --- /dev/null +++ b/lib/report/assets/scripts/vendor/codemirror/util/loadmode.js @@ -0,0 +1,51 @@ +(function() { + if (!CodeMirror.modeURL) CodeMirror.modeURL = "../mode/%N/%N.js"; + + var loading = {}; + function splitCallback(cont, n) { + var countDown = n; + return function() { if (--countDown == 0) cont(); }; + } + function ensureDeps(mode, cont) { + var deps = CodeMirror.modes[mode].dependencies; + if (!deps) return cont(); + var missing = []; + for (var i = 0; i < deps.length; ++i) { + if (!CodeMirror.modes.hasOwnProperty(deps[i])) + missing.push(deps[i]); + } + if (!missing.length) return cont(); + var split = splitCallback(cont, missing.length); + for (var i = 0; i < missing.length; ++i) + CodeMirror.requireMode(missing[i], split); + } + + CodeMirror.requireMode = function(mode, cont) { + if (typeof mode != "string") mode = mode.name; + if (CodeMirror.modes.hasOwnProperty(mode)) return ensureDeps(mode, cont); + if (loading.hasOwnProperty(mode)) return loading[mode].push(cont); + + var script = document.createElement("script"); + script.src = CodeMirror.modeURL.replace(/%N/g, mode); + var others = document.getElementsByTagName("script")[0]; + others.parentNode.insertBefore(script, others); + var list = loading[mode] = [cont]; + var count = 0, poll = setInterval(function() { + if (++count > 100) return clearInterval(poll); + if (CodeMirror.modes.hasOwnProperty(mode)) { + clearInterval(poll); + loading[mode] = null; + ensureDeps(mode, function() { + for (var i = 0; i < list.length; ++i) list[i](); + }); + } + }, 200); + }; + + CodeMirror.autoLoadMode = function(instance, mode) { + if (!CodeMirror.modes.hasOwnProperty(mode)) + CodeMirror.requireMode(mode, function() { + instance.setOption("mode", instance.getOption("mode")); + }); + }; +}()); diff --git a/lib/report/assets/scripts/vendor/codemirror/util/match-highlighter.js b/lib/report/assets/scripts/vendor/codemirror/util/match-highlighter.js new file mode 100755 index 0000000..bb93ebc --- /dev/null +++ b/lib/report/assets/scripts/vendor/codemirror/util/match-highlighter.js @@ -0,0 +1,46 @@ +// Define match-highlighter commands. Depends on searchcursor.js +// Use by attaching the following function call to the cursorActivity event: + //myCodeMirror.matchHighlight(minChars); +// And including a special span.CodeMirror-matchhighlight css class (also optionally a separate one for .CodeMirror-focused -- see demo matchhighlighter.html) + +(function() { + var DEFAULT_MIN_CHARS = 2; + + function MatchHighlightState() { + this.marked = []; + } + function getMatchHighlightState(cm) { + return cm._matchHighlightState || (cm._matchHighlightState = new MatchHighlightState()); + } + + function clearMarks(cm) { + var state = getMatchHighlightState(cm); + for (var i = 0; i < state.marked.length; ++i) + state.marked[i].clear(); + state.marked = []; + } + + function markDocument(cm, className, minChars) { + clearMarks(cm); + minChars = (typeof minChars !== 'undefined' ? minChars : DEFAULT_MIN_CHARS); + if (cm.somethingSelected() && cm.getSelection().replace(/^\s+|\s+$/g, "").length >= minChars) { + var state = getMatchHighlightState(cm); + var query = cm.getSelection(); + cm.operation(function() { + if (cm.lineCount() < 2000) { // This is too expensive on big documents. + for (var cursor = cm.getSearchCursor(query); cursor.findNext();) { + //Only apply matchhighlight to the matches other than the one actually selected + if (cursor.from().line !== cm.getCursor(true).line || + cursor.from().ch !== cm.getCursor(true).ch) + state.marked.push(cm.markText(cursor.from(), cursor.to(), + {className: className})); + } + } + }); + } + } + + CodeMirror.defineExtension("matchHighlight", function(className, minChars) { + markDocument(this, className, minChars); + }); +})(); diff --git a/lib/report/assets/scripts/vendor/codemirror/util/matchbrackets.js b/lib/report/assets/scripts/vendor/codemirror/util/matchbrackets.js new file mode 100755 index 0000000..2df2fbb --- /dev/null +++ b/lib/report/assets/scripts/vendor/codemirror/util/matchbrackets.js @@ -0,0 +1,63 @@ +(function() { + var matching = {"(": ")>", ")": "(<", "[": "]>", "]": "[<", "{": "}>", "}": "{<"}; + function findMatchingBracket(cm) { + var cur = cm.getCursor(), line = cm.getLineHandle(cur.line), pos = cur.ch - 1; + var match = (pos >= 0 && matching[line.text.charAt(pos)]) || matching[line.text.charAt(++pos)]; + if (!match) return null; + var forward = match.charAt(1) == ">", d = forward ? 1 : -1; + var style = cm.getTokenAt({line: cur.line, ch: pos + 1}).type; + + var stack = [line.text.charAt(pos)], re = /[(){}[\]]/; + function scan(line, lineNo, start) { + if (!line.text) return; + var pos = forward ? 0 : line.text.length - 1, end = forward ? line.text.length : -1; + if (start != null) pos = start + d; + for (; pos != end; pos += d) { + var ch = line.text.charAt(pos); + if (re.test(ch) && cm.getTokenAt({line: lineNo, ch: pos + 1}).type == style) { + var match = matching[ch]; + if (match.charAt(1) == ">" == forward) stack.push(ch); + else if (stack.pop() != match.charAt(0)) return {pos: pos, match: false}; + else if (!stack.length) return {pos: pos, match: true}; + } + } + } + for (var i = cur.line, found, e = forward ? Math.min(i + 100, cm.lineCount()) : Math.max(-1, i - 100); i != e; i+=d) { + if (i == cur.line) found = scan(line, i, pos); + else found = scan(cm.getLineHandle(i), i); + if (found) break; + } + return {from: {line: cur.line, ch: pos}, to: found && {line: i, ch: found.pos}, match: found && found.match}; + } + + function matchBrackets(cm, autoclear) { + var found = findMatchingBracket(cm); + if (!found) return; + var style = found.match ? "CodeMirror-matchingbracket" : "CodeMirror-nonmatchingbracket"; + var one = cm.markText(found.from, {line: found.from.line, ch: found.from.ch + 1}, + {className: style}); + var two = found.to && cm.markText(found.to, {line: found.to.line, ch: found.to.ch + 1}, + {className: style}); + var clear = function() { + cm.operation(function() { one.clear(); two && two.clear(); }); + }; + if (autoclear) setTimeout(clear, 800); + else return clear; + } + + var currentlyHighlighted = null; + function doMatchBrackets(cm) { + cm.operation(function() { + if (currentlyHighlighted) {currentlyHighlighted(); currentlyHighlighted = null;} + if (!cm.somethingSelected()) currentlyHighlighted = matchBrackets(cm, false); + }); + } + + CodeMirror.defineOption("matchBrackets", false, function(cm, val) { + if (val) cm.on("cursorActivity", doMatchBrackets); + else cm.off("cursorActivity", doMatchBrackets); + }); + + CodeMirror.defineExtension("matchBrackets", function() {matchBrackets(this, true);}); + CodeMirror.defineExtension("findMatchingBracket", function(){return findMatchingBracket(this);}); +})(); diff --git a/lib/report/assets/scripts/vendor/codemirror/util/multiplex.js b/lib/report/assets/scripts/vendor/codemirror/util/multiplex.js new file mode 100755 index 0000000..e77ff2a --- /dev/null +++ b/lib/report/assets/scripts/vendor/codemirror/util/multiplex.js @@ -0,0 +1,95 @@ +CodeMirror.multiplexingMode = function(outer /*, others */) { + // Others should be {open, close, mode [, delimStyle]} objects + var others = Array.prototype.slice.call(arguments, 1); + var n_others = others.length; + + function indexOf(string, pattern, from) { + if (typeof pattern == "string") return string.indexOf(pattern, from); + var m = pattern.exec(from ? string.slice(from) : string); + return m ? m.index + from : -1; + } + + return { + startState: function() { + return { + outer: CodeMirror.startState(outer), + innerActive: null, + inner: null + }; + }, + + copyState: function(state) { + return { + outer: CodeMirror.copyState(outer, state.outer), + innerActive: state.innerActive, + inner: state.innerActive && CodeMirror.copyState(state.innerActive.mode, state.inner) + }; + }, + + token: function(stream, state) { + if (!state.innerActive) { + var cutOff = Infinity, oldContent = stream.string; + for (var i = 0; i < n_others; ++i) { + var other = others[i]; + var found = indexOf(oldContent, other.open, stream.pos); + if (found == stream.pos) { + stream.match(other.open); + state.innerActive = other; + state.inner = CodeMirror.startState(other.mode, outer.indent ? outer.indent(state.outer, "") : 0); + return other.delimStyle; + } else if (found != -1 && found < cutOff) { + cutOff = found; + } + } + if (cutOff != Infinity) stream.string = oldContent.slice(0, cutOff); + var outerToken = outer.token(stream, state.outer); + if (cutOff != Infinity) stream.string = oldContent; + return outerToken; + } else { + var curInner = state.innerActive, oldContent = stream.string; + var found = indexOf(oldContent, curInner.close, stream.pos); + if (found == stream.pos) { + stream.match(curInner.close); + state.innerActive = state.inner = null; + return curInner.delimStyle; + } + if (found > -1) stream.string = oldContent.slice(0, found); + var innerToken = curInner.mode.token(stream, state.inner); + if (found > -1) stream.string = oldContent; + var cur = stream.current(), found = cur.indexOf(curInner.close); + if (found > -1) stream.backUp(cur.length - found); + return innerToken; + } + }, + + indent: function(state, textAfter) { + var mode = state.innerActive ? state.innerActive.mode : outer; + if (!mode.indent) return CodeMirror.Pass; + return mode.indent(state.innerActive ? state.inner : state.outer, textAfter); + }, + + blankLine: function(state) { + var mode = state.innerActive ? state.innerActive.mode : outer; + if (mode.blankLine) { + mode.blankLine(state.innerActive ? state.inner : state.outer); + } + if (!state.innerActive) { + for (var i = 0; i < n_others; ++i) { + var other = others[i]; + if (other.open === "\n") { + state.innerActive = other; + state.inner = CodeMirror.startState(other.mode, mode.indent ? mode.indent(state.outer, "") : 0); + } + } + } else if (mode.close === "\n") { + state.innerActive = state.inner = null; + } + }, + + electricChars: outer.electricChars, + + innerMode: function(state) { + return state.inner ? {state: state.inner, mode: state.innerActive.mode} : {state: state.outer, mode: outer}; + } + }; +}; diff --git a/lib/report/assets/scripts/vendor/codemirror/util/overlay.js b/lib/report/assets/scripts/vendor/codemirror/util/overlay.js new file mode 100755 index 0000000..fba3898 --- /dev/null +++ b/lib/report/assets/scripts/vendor/codemirror/util/overlay.js @@ -0,0 +1,59 @@ +// Utility function that allows modes to be combined. The mode given +// as the base argument takes care of most of the normal mode +// functionality, but a second (typically simple) mode is used, which +// can override the style of text. Both modes get to parse all of the +// text, but when both assign a non-null style to a piece of code, the +// overlay wins, unless the combine argument was true, in which case +// the styles are combined. + +// overlayParser is the old, deprecated name +CodeMirror.overlayMode = CodeMirror.overlayParser = function(base, overlay, combine) { + return { + startState: function() { + return { + base: CodeMirror.startState(base), + overlay: CodeMirror.startState(overlay), + basePos: 0, baseCur: null, + overlayPos: 0, overlayCur: null + }; + }, + copyState: function(state) { + return { + base: CodeMirror.copyState(base, state.base), + overlay: CodeMirror.copyState(overlay, state.overlay), + basePos: state.basePos, baseCur: null, + overlayPos: state.overlayPos, overlayCur: null + }; + }, + + token: function(stream, state) { + if (stream.start == state.basePos) { + state.baseCur = base.token(stream, state.base); + state.basePos = stream.pos; + } + if (stream.start == state.overlayPos) { + stream.pos = stream.start; + state.overlayCur = overlay.token(stream, state.overlay); + state.overlayPos = stream.pos; + } + stream.pos = Math.min(state.basePos, state.overlayPos); + if (stream.eol()) state.basePos = state.overlayPos = 0; + + if (state.overlayCur == null) return state.baseCur; + if (state.baseCur != null && combine) return state.baseCur + " " + state.overlayCur; + else return state.overlayCur; + }, + + indent: base.indent && function(state, textAfter) { + return base.indent(state.base, textAfter); + }, + electricChars: base.electricChars, + + innerMode: function(state) { return {state: state.base, mode: base}; }, + + blankLine: function(state) { + if (base.blankLine) base.blankLine(state.base); + if (overlay.blankLine) overlay.blankLine(state.overlay); + } + }; +}; diff --git a/lib/report/assets/scripts/vendor/codemirror/util/pig-hint.js b/lib/report/assets/scripts/vendor/codemirror/util/pig-hint.js new file mode 100755 index 0000000..149b468 --- /dev/null +++ b/lib/report/assets/scripts/vendor/codemirror/util/pig-hint.js @@ -0,0 +1,117 @@ +(function () { + function forEach(arr, f) { + for (var i = 0, e = arr.length; i < e; ++i) f(arr[i]); + } + + function arrayContains(arr, item) { + if (!Array.prototype.indexOf) { + var i = arr.length; + while (i--) { + if (arr[i] === item) { + return true; + } + } + return false; + } + return arr.indexOf(item) != -1; + } + + function scriptHint(editor, _keywords, getToken) { + // Find the token at the cursor + var cur = editor.getCursor(), token = getToken(editor, cur), tprop = token; + // If it's not a 'word-style' token, ignore the token. + + if (!/^[\w$_]*$/.test(token.string)) { + token = tprop = {start: cur.ch, end: cur.ch, string: "", state: token.state, + className: token.string == ":" ? "pig-type" : null}; + } + + if (!context) var context = []; + context.push(tprop); + + var completionList = getCompletions(token, context); + completionList = completionList.sort(); + //prevent autocomplete for last word, instead show dropdown with one word + if(completionList.length == 1) { + completionList.push(" "); + } + + return {list: completionList, + from: {line: cur.line, ch: token.start}, + to: {line: cur.line, ch: token.end}}; + } + + CodeMirror.pigHint = function(editor) { + return scriptHint(editor, pigKeywordsU, function (e, cur) {return e.getTokenAt(cur);}); + }; + + var pigKeywords = "VOID IMPORT RETURNS DEFINE LOAD FILTER FOREACH ORDER CUBE DISTINCT COGROUP " + + "JOIN CROSS UNION SPLIT INTO IF OTHERWISE ALL AS BY USING INNER OUTER ONSCHEMA PARALLEL " + + "PARTITION GROUP AND OR NOT GENERATE FLATTEN ASC DESC IS STREAM THROUGH STORE MAPREDUCE " + + "SHIP CACHE INPUT OUTPUT STDERROR STDIN STDOUT LIMIT SAMPLE LEFT RIGHT FULL EQ GT LT GTE LTE " + + "NEQ MATCHES TRUE FALSE"; + var pigKeywordsU = pigKeywords.split(" "); + var pigKeywordsL = pigKeywords.toLowerCase().split(" "); + + var pigTypes = "BOOLEAN INT LONG FLOAT DOUBLE CHARARRAY BYTEARRAY BAG TUPLE MAP"; + var pigTypesU = pigTypes.split(" "); + var pigTypesL = pigTypes.toLowerCase().split(" "); + + var pigBuiltins = "ABS ACOS ARITY ASIN ATAN AVG BAGSIZE BINSTORAGE BLOOM BUILDBLOOM CBRT CEIL " + + "CONCAT COR COS COSH COUNT COUNT_STAR COV CONSTANTSIZE CUBEDIMENSIONS DIFF DISTINCT DOUBLEABS " + + "DOUBLEAVG DOUBLEBASE DOUBLEMAX DOUBLEMIN DOUBLEROUND DOUBLESUM EXP FLOOR FLOATABS FLOATAVG " + + "FLOATMAX FLOATMIN FLOATROUND FLOATSUM GENERICINVOKER INDEXOF INTABS INTAVG INTMAX INTMIN " + + "INTSUM INVOKEFORDOUBLE INVOKEFORFLOAT INVOKEFORINT INVOKEFORLONG INVOKEFORSTRING INVOKER " + + "ISEMPTY JSONLOADER JSONMETADATA JSONSTORAGE LAST_INDEX_OF LCFIRST LOG LOG10 LOWER LONGABS " + + "LONGAVG LONGMAX LONGMIN LONGSUM MAX MIN MAPSIZE MONITOREDUDF NONDETERMINISTIC OUTPUTSCHEMA " + + "PIGSTORAGE PIGSTREAMING RANDOM REGEX_EXTRACT REGEX_EXTRACT_ALL REPLACE ROUND SIN SINH SIZE " + + "SQRT STRSPLIT SUBSTRING SUM STRINGCONCAT STRINGMAX STRINGMIN STRINGSIZE TAN TANH TOBAG " + + "TOKENIZE TOMAP TOP TOTUPLE TRIM TEXTLOADER TUPLESIZE UCFIRST UPPER UTF8STORAGECONVERTER"; + var pigBuiltinsU = pigBuiltins.split(" ").join("() ").split(" "); + var pigBuiltinsL = pigBuiltins.toLowerCase().split(" ").join("() ").split(" "); + var pigBuiltinsC = ("BagSize BinStorage Bloom BuildBloom ConstantSize CubeDimensions DoubleAbs " + + "DoubleAvg DoubleBase DoubleMax DoubleMin DoubleRound DoubleSum FloatAbs FloatAvg FloatMax " + + "FloatMin FloatRound FloatSum GenericInvoker IntAbs IntAvg IntMax IntMin IntSum " + + "InvokeForDouble InvokeForFloat InvokeForInt InvokeForLong InvokeForString Invoker " + + "IsEmpty JsonLoader JsonMetadata JsonStorage LongAbs LongAvg LongMax LongMin LongSum MapSize " + + "MonitoredUDF Nondeterministic OutputSchema PigStorage PigStreaming StringConcat StringMax " + + "StringMin StringSize TextLoader TupleSize Utf8StorageConverter").split(" ").join("() ").split(" "); + + function getCompletions(token, context) { + var found = [], start = token.string; + function maybeAdd(str) { + if (str.indexOf(start) == 0 && !arrayContains(found, str)) found.push(str); + } + + function gatherCompletions(obj) { + if(obj == ":") { + forEach(pigTypesL, maybeAdd); + } + else { + forEach(pigBuiltinsU, maybeAdd); + forEach(pigBuiltinsL, maybeAdd); + forEach(pigBuiltinsC, maybeAdd); + forEach(pigTypesU, maybeAdd); + forEach(pigTypesL, maybeAdd); + forEach(pigKeywordsU, maybeAdd); + forEach(pigKeywordsL, maybeAdd); + } + } + + if (context) { + // If this is a property, see if it belongs to some object we can + // find in the current environment. + var obj = context.pop(), base; + + if (obj.type == "variable") + base = obj.string; + else if(obj.type == "variable-3") + base = ":" + obj.string; + + while (base != null && context.length) + base = base[context.pop().string]; + if (base != null) gatherCompletions(base); + } + return found; + } +})(); diff --git a/lib/report/assets/scripts/vendor/codemirror/util/runmode-standalone.js b/lib/report/assets/scripts/vendor/codemirror/util/runmode-standalone.js new file mode 100755 index 0000000..afdf044 --- /dev/null +++ b/lib/report/assets/scripts/vendor/codemirror/util/runmode-standalone.js @@ -0,0 +1,90 @@ +/* Just enough of CodeMirror to run runMode under node.js */ + +function splitLines(string){ return string.split(/\r?\n|\r/); }; + +function StringStream(string) { + this.pos = this.start = 0; + this.string = string; +} +StringStream.prototype = { + eol: function() {return this.pos >= this.string.length;}, + sol: function() {return this.pos == 0;}, + peek: function() {return this.string.charAt(this.pos) || null;}, + next: function() { + if (this.pos < this.string.length) + return this.string.charAt(this.pos++); + }, + eat: function(match) { + var ch = this.string.charAt(this.pos); + if (typeof match == "string") var ok = ch == match; + else var ok = ch && (match.test ? match.test(ch) : match(ch)); + if (ok) {++this.pos; return ch;} + }, + eatWhile: function(match) { + var start = this.pos; + while (this.eat(match)){} + return this.pos > start; + }, + eatSpace: function() { + var start = this.pos; + while (/[\s\u00a0]/.test(this.string.charAt(this.pos))) ++this.pos; + return this.pos > start; + }, + skipToEnd: function() {this.pos = this.string.length;}, + skipTo: function(ch) { + var found = this.string.indexOf(ch, this.pos); + if (found > -1) {this.pos = found; return true;} + }, + backUp: function(n) {this.pos -= n;}, + column: function() {return this.start;}, + indentation: function() {return 0;}, + match: function(pattern, consume, caseInsensitive) { + if (typeof pattern == "string") { + function cased(str) {return caseInsensitive ? str.toLowerCase() : str;} + if (cased(this.string).indexOf(cased(pattern), this.pos) == this.pos) { + if (consume !== false) this.pos += pattern.length; + return true; + } + } + else { + var match = this.string.slice(this.pos).match(pattern); + if (match && consume !== false) this.pos += match[0].length; + return match; + } + }, + current: function(){return this.string.slice(this.start, this.pos);} +}; +exports.StringStream = StringStream; + +exports.startState = function(mode, a1, a2) { + return mode.startState ? mode.startState(a1, a2) : true; +}; + +var modes = exports.modes = {}, mimeModes = exports.mimeModes = {}; +exports.defineMode = function(name, mode) { modes[name] = mode; }; +exports.defineMIME = function(mime, spec) { mimeModes[mime] = spec; }; +exports.getMode = function(options, spec) { + if (typeof spec == "string" && mimeModes.hasOwnProperty(spec)) + spec = mimeModes[spec]; + if (typeof spec == "string") + var mname = spec, config = {}; + else if (spec != null) + var mname = spec.name, config = spec; + var mfactory = modes[mname]; + if (!mfactory) throw new Error("Unknown mode: " + spec); + return mfactory(options, config || {}); +}; + +exports.runMode = function(string, modespec, callback) { + var mode = exports.getMode({indentUnit: 2}, modespec); + var lines = splitLines(string), state = exports.startState(mode); + for (var i = 0, e = lines.length; i < e; ++i) { + if (i) callback("\n"); + var stream = new exports.StringStream(lines[i]); + while (!stream.eol()) { + var style = mode.token(stream, state); + callback(stream.current(), style, i, stream.start); + stream.start = stream.pos; + } + } +}; diff --git a/lib/report/assets/scripts/vendor/codemirror/util/runmode.js b/lib/report/assets/scripts/vendor/codemirror/util/runmode.js new file mode 100755 index 0000000..3e1bed7 --- /dev/null +++ b/lib/report/assets/scripts/vendor/codemirror/util/runmode.js @@ -0,0 +1,52 @@ +CodeMirror.runMode = function(string, modespec, callback, options) { + var mode = CodeMirror.getMode(CodeMirror.defaults, modespec); + + if (callback.nodeType == 1) { + var tabSize = (options && options.tabSize) || CodeMirror.defaults.tabSize; + var node = callback, col = 0; + node.innerHTML = ""; + callback = function(text, style) { + if (text == "\n") { + node.appendChild(document.createElement("br")); + col = 0; + return; + } + var content = ""; + // replace tabs + for (var pos = 0;;) { + var idx = text.indexOf("\t", pos); + if (idx == -1) { + content += text.slice(pos); + col += text.length - pos; + break; + } else { + col += idx - pos; + content += text.slice(pos, idx); + var size = tabSize - col % tabSize; + col += size; + for (var i = 0; i < size; ++i) content += " "; + pos = idx + 1; + } + } + + if (style) { + var sp = node.appendChild(document.createElement("span")); + sp.className = "cm-" + style.replace(/ +/g, " cm-"); + sp.appendChild(document.createTextNode(content)); + } else { + node.appendChild(document.createTextNode(content)); + } + }; + } + + var lines = CodeMirror.splitLines(string), state = CodeMirror.startState(mode); + for (var i = 0, e = lines.length; i < e; ++i) { + if (i) callback("\n"); + var stream = new CodeMirror.StringStream(lines[i]); + while (!stream.eol()) { + var style = mode.token(stream, state); + callback(stream.current(), style, i, stream.start); + stream.start = stream.pos; + } + } +}; diff --git a/lib/report/assets/scripts/vendor/codemirror/util/search.js b/lib/report/assets/scripts/vendor/codemirror/util/search.js new file mode 100755 index 0000000..266b2c9 --- /dev/null +++ b/lib/report/assets/scripts/vendor/codemirror/util/search.js @@ -0,0 +1,119 @@ +// Define search commands. Depends on dialog.js or another +// implementation of the openDialog method. + +// Replace works a little oddly -- it will do the replace on the next +// Ctrl-G (or whatever is bound to findNext) press. You prevent a +// replace by making sure the match is no longer selected when hitting +// Ctrl-G. + +(function() { + function SearchState() { + this.posFrom = this.posTo = this.query = null; + this.marked = []; + } + function getSearchState(cm) { + return cm._searchState || (cm._searchState = new SearchState()); + } + function getSearchCursor(cm, query, pos) { + // Heuristic: if the query string is all lowercase, do a case insensitive search. + return cm.getSearchCursor(query, pos, typeof query == "string" && query == query.toLowerCase()); + } + function dialog(cm, text, shortText, f) { + if (cm.openDialog) cm.openDialog(text, f); + else f(prompt(shortText, "")); + } + function confirmDialog(cm, text, shortText, fs) { + if (cm.openConfirm) cm.openConfirm(text, fs); + else if (confirm(shortText)) fs[0](); + } + function parseQuery(query) { + var isRE = query.match(/^\/(.*)\/([a-z]*)$/); + return isRE ? new RegExp(isRE[1], isRE[2].indexOf("i") == -1 ? "" : "i") : query; + } + var queryDialog = + 'Search: (Use /re/ syntax for regexp search)'; + function doSearch(cm, rev) { + var state = getSearchState(cm); + if (state.query) return findNext(cm, rev); + dialog(cm, queryDialog, "Search for:", function(query) { + cm.operation(function() { + if (!query || state.query) return; + state.query = parseQuery(query); + if (cm.lineCount() < 2000) { // This is too expensive on big documents. + for (var cursor = getSearchCursor(cm, state.query); cursor.findNext();) + state.marked.push(cm.markText(cursor.from(), cursor.to(), + {className: "CodeMirror-searching"})); + } + state.posFrom = state.posTo = cm.getCursor(); + findNext(cm, rev); + }); + }); + } + function findNext(cm, rev) {cm.operation(function() { + var state = getSearchState(cm); + var cursor = getSearchCursor(cm, state.query, rev ? state.posFrom : state.posTo); + if (!cursor.find(rev)) { + cursor = getSearchCursor(cm, state.query, rev ? {line: cm.lineCount() - 1} : {line: 0, ch: 0}); + if (!cursor.find(rev)) return; + } + cm.setSelection(cursor.from(), cursor.to()); + state.posFrom = cursor.from(); state.posTo = cursor.to(); + });} + function clearSearch(cm) {cm.operation(function() { + var state = getSearchState(cm); + if (!state.query) return; + state.query = null; + for (var i = 0; i < state.marked.length; ++i) state.marked[i].clear(); + state.marked.length = 0; + });} + + var replaceQueryDialog = + 'Replace: (Use /re/ syntax for regexp search)'; + var replacementQueryDialog = 'With: '; + var doReplaceConfirm = "Replace? "; + function replace(cm, all) { + dialog(cm, replaceQueryDialog, "Replace:", function(query) { + if (!query) return; + query = parseQuery(query); + dialog(cm, replacementQueryDialog, "Replace with:", function(text) { + if (all) { + cm.operation(function() { + for (var cursor = getSearchCursor(cm, query); cursor.findNext();) { + if (typeof query != "string") { + var match = cm.getRange(cursor.from(), cursor.to()).match(query); + cursor.replace(text.replace(/\$(\d)/, function(_, i) {return match[i];})); + } else cursor.replace(text); + } + }); + } else { + clearSearch(cm); + var cursor = getSearchCursor(cm, query, cm.getCursor()); + function advance() { + var start = cursor.from(), match; + if (!(match = cursor.findNext())) { + cursor = getSearchCursor(cm, query); + if (!(match = cursor.findNext()) || + (start && cursor.from().line == start.line && cursor.from().ch == start.ch)) return; + } + cm.setSelection(cursor.from(), cursor.to()); + confirmDialog(cm, doReplaceConfirm, "Replace?", + [function() {doReplace(match);}, advance]); + } + function doReplace(match) { + cursor.replace(typeof query == "string" ? text : + text.replace(/\$(\d)/, function(_, i) {return match[i];})); + advance(); + } + advance(); + } + }); + }); + } + + CodeMirror.commands.find = function(cm) {clearSearch(cm); doSearch(cm);}; + CodeMirror.commands.findNext = doSearch; + CodeMirror.commands.findPrev = function(cm) {doSearch(cm, true);}; + CodeMirror.commands.clearSearch = clearSearch; + CodeMirror.commands.replace = replace; + CodeMirror.commands.replaceAll = function(cm) {replace(cm, true);}; +})(); diff --git a/lib/report/assets/scripts/vendor/codemirror/util/searchcursor.js b/lib/report/assets/scripts/vendor/codemirror/util/searchcursor.js new file mode 100755 index 0000000..58fed74 --- /dev/null +++ b/lib/report/assets/scripts/vendor/codemirror/util/searchcursor.js @@ -0,0 +1,119 @@ +(function(){ + function SearchCursor(cm, query, pos, caseFold) { + this.atOccurrence = false; this.cm = cm; + if (caseFold == null && typeof query == "string") caseFold = false; + + pos = pos ? cm.clipPos(pos) : {line: 0, ch: 0}; + this.pos = {from: pos, to: pos}; + + // The matches method is filled in based on the type of query. + // It takes a position and a direction, and returns an object + // describing the next occurrence of the query, or null if no + // more matches were found. + if (typeof query != "string") { // Regexp match + if (!query.global) query = new RegExp(query.source, query.ignoreCase ? "ig" : "g"); + this.matches = function(reverse, pos) { + if (reverse) { + query.lastIndex = 0; + var line = cm.getLine(pos.line).slice(0, pos.ch), match = query.exec(line), start = 0; + while (match) { + start += match.index + 1; + line = line.slice(start); + query.lastIndex = 0; + var newmatch = query.exec(line); + if (newmatch) match = newmatch; + else break; + } + start--; + } else { + query.lastIndex = pos.ch; + var line = cm.getLine(pos.line), match = query.exec(line), + start = match && match.index; + } + if (match) + return {from: {line: pos.line, ch: start}, + to: {line: pos.line, ch: start + match[0].length}, + match: match}; + }; + } else { // String query + if (caseFold) query = query.toLowerCase(); + var fold = caseFold ? function(str){return str.toLowerCase();} : function(str){return str;}; + var target = query.split("\n"); + // Different methods for single-line and multi-line queries + if (target.length == 1) + this.matches = function(reverse, pos) { + var line = fold(cm.getLine(pos.line)), len = query.length, match; + if (reverse ? (pos.ch >= len && (match = line.lastIndexOf(query, pos.ch - len)) != -1) + : (match = line.indexOf(query, pos.ch)) != -1) + return {from: {line: pos.line, ch: match}, + to: {line: pos.line, ch: match + len}}; + }; + else + this.matches = function(reverse, pos) { + var ln = pos.line, idx = (reverse ? target.length - 1 : 0), match = target[idx], line = fold(cm.getLine(ln)); + var offsetA = (reverse ? line.indexOf(match) + match.length : line.lastIndexOf(match)); + if (reverse ? offsetA >= pos.ch || offsetA != match.length + : offsetA <= pos.ch || offsetA != line.length - match.length) + return; + for (;;) { + if (reverse ? !ln : ln == cm.lineCount() - 1) return; + line = fold(cm.getLine(ln += reverse ? -1 : 1)); + match = target[reverse ? --idx : ++idx]; + if (idx > 0 && idx < target.length - 1) { + if (line != match) return; + else continue; + } + var offsetB = (reverse ? line.lastIndexOf(match) : line.indexOf(match) + match.length); + if (reverse ? offsetB != line.length - match.length : offsetB != match.length) + return; + var start = {line: pos.line, ch: offsetA}, end = {line: ln, ch: offsetB}; + return {from: reverse ? end : start, to: reverse ? start : end}; + } + }; + } + } + + SearchCursor.prototype = { + findNext: function() {return this.find(false);}, + findPrevious: function() {return this.find(true);}, + + find: function(reverse) { + var self = this, pos = this.cm.clipPos(reverse ? this.pos.from : this.pos.to); + function savePosAndFail(line) { + var pos = {line: line, ch: 0}; + self.pos = {from: pos, to: pos}; + self.atOccurrence = false; + return false; + } + + for (;;) { + if (this.pos = this.matches(reverse, pos)) { + this.atOccurrence = true; + return this.pos.match || true; + } + if (reverse) { + if (!pos.line) return savePosAndFail(0); + pos = {line: pos.line-1, ch: this.cm.getLine(pos.line-1).length}; + } + else { + var maxLine = this.cm.lineCount(); + if (pos.line == maxLine - 1) return savePosAndFail(maxLine); + pos = {line: pos.line+1, ch: 0}; + } + } + }, + + from: function() {if (this.atOccurrence) return this.pos.from;}, + to: function() {if (this.atOccurrence) return this.pos.to;}, + + replace: function(newText) { + var self = this; + if (this.atOccurrence) + self.pos.to = this.cm.replaceRange(newText, self.pos.from, self.pos.to); + } + }; + + CodeMirror.defineExtension("getSearchCursor", function(query, pos, caseFold) { + return new SearchCursor(this, query, pos, caseFold); + }); +})(); diff --git a/lib/report/assets/scripts/vendor/codemirror/util/simple-hint.css b/lib/report/assets/scripts/vendor/codemirror/util/simple-hint.css new file mode 100755 index 0000000..4387cb9 --- /dev/null +++ b/lib/report/assets/scripts/vendor/codemirror/util/simple-hint.css @@ -0,0 +1,16 @@ +.CodeMirror-completions { + position: absolute; + z-index: 10; + overflow: hidden; + -webkit-box-shadow: 2px 3px 5px rgba(0,0,0,.2); + -moz-box-shadow: 2px 3px 5px rgba(0,0,0,.2); + box-shadow: 2px 3px 5px rgba(0,0,0,.2); +} +.CodeMirror-completions select { + background: #fafafa; + outline: none; + border: none; + padding: 0; + margin: 0; + font-family: monospace; +} diff --git a/lib/report/assets/scripts/vendor/codemirror/util/simple-hint.js b/lib/report/assets/scripts/vendor/codemirror/util/simple-hint.js new file mode 100755 index 0000000..1565bd4 --- /dev/null +++ b/lib/report/assets/scripts/vendor/codemirror/util/simple-hint.js @@ -0,0 +1,102 @@ +(function() { + CodeMirror.simpleHint = function(editor, getHints, givenOptions) { + // Determine effective options based on given values and defaults. + var options = {}, defaults = CodeMirror.simpleHint.defaults; + for (var opt in defaults) + if (defaults.hasOwnProperty(opt)) + options[opt] = (givenOptions && givenOptions.hasOwnProperty(opt) ? givenOptions : defaults)[opt]; + + function collectHints(previousToken) { + // We want a single cursor position. + if (editor.somethingSelected()) return; + + var tempToken = editor.getTokenAt(editor.getCursor()); + + // Don't show completions if token has changed and the option is set. + if (options.closeOnTokenChange && previousToken != null && + (tempToken.start != previousToken.start || tempToken.type != previousToken.type)) { + return; + } + + var result = getHints(editor, givenOptions); + if (!result || !result.list.length) return; + var completions = result.list; + function insert(str) { + editor.replaceRange(str, result.from, result.to); + } + // When there is only one completion, use it directly. + if (options.completeSingle && completions.length == 1) { + insert(completions[0]); + return true; + } + + // Build the select widget + var complete = document.createElement("div"); + complete.className = "CodeMirror-completions"; + var sel = complete.appendChild(document.createElement("select")); + // Opera doesn't move the selection when pressing up/down in a + // multi-select, but it does properly support the size property on + // single-selects, so no multi-select is necessary. + if (!window.opera) sel.multiple = true; + for (var i = 0; i < completions.length; ++i) { + var opt = sel.appendChild(document.createElement("option")); + opt.appendChild(document.createTextNode(completions[i])); + } + sel.firstChild.selected = true; + sel.size = Math.min(10, completions.length); + var pos = editor.cursorCoords(options.alignWithWord ? result.from : null); + complete.style.left = pos.left + "px"; + complete.style.top = pos.bottom + "px"; + document.body.appendChild(complete); + // If we're at the edge of the screen, then we want the menu to appear on the left of the cursor. + var winW = window.innerWidth || Math.max(document.body.offsetWidth, document.documentElement.offsetWidth); + if(winW - pos.left < sel.clientWidth) + complete.style.left = (pos.left - sel.clientWidth) + "px"; + // Hack to hide the scrollbar. + if (completions.length <= 10) + complete.style.width = (sel.clientWidth - 1) + "px"; + + var done = false; + function close() { + if (done) return; + done = true; + complete.parentNode.removeChild(complete); + } + function pick() { + insert(completions[sel.selectedIndex]); + close(); + setTimeout(function(){editor.focus();}, 50); + } + CodeMirror.on(sel, "blur", close); + CodeMirror.on(sel, "keydown", function(event) { + var code = event.keyCode; + // Enter + if (code == 13) {CodeMirror.e_stop(event); pick();} + // Escape + else if (code == 27) {CodeMirror.e_stop(event); close(); editor.focus();} + else if (code != 38 && code != 40 && code != 33 && code != 34 && !CodeMirror.isModifierKey(event)) { + close(); editor.focus(); + // Pass the event to the CodeMirror instance so that it can handle things like backspace properly. + editor.triggerOnKeyDown(event); + // Don't show completions if the code is backspace and the option is set. + if (!options.closeOnBackspace || code != 8) { + setTimeout(function(){collectHints(tempToken);}, 50); + } + } + }); + CodeMirror.on(sel, "dblclick", pick); + + sel.focus(); + // Opera sometimes ignores focusing a freshly created node + if (window.opera) setTimeout(function(){if (!done) sel.focus();}, 100); + return true; + } + return collectHints(); + }; + CodeMirror.simpleHint.defaults = { + closeOnBackspace: true, + closeOnTokenChange: false, + completeSingle: true, + alignWithWord: true + }; +})(); diff --git a/lib/report/assets/scripts/vendor/codemirror/util/xml-hint.js b/lib/report/assets/scripts/vendor/codemirror/util/xml-hint.js new file mode 100755 index 0000000..e9ec6b7 --- /dev/null +++ b/lib/report/assets/scripts/vendor/codemirror/util/xml-hint.js @@ -0,0 +1,131 @@ + +(function() { + + CodeMirror.xmlHints = []; + + CodeMirror.xmlHint = function(cm, simbol) { + + if(simbol.length > 0) { + var cursor = cm.getCursor(); + cm.replaceSelection(simbol); + cursor = {line: cursor.line, ch: cursor.ch + 1}; + cm.setCursor(cursor); + } + + CodeMirror.simpleHint(cm, getHint); + }; + + var getHint = function(cm) { + + var cursor = cm.getCursor(); + + if (cursor.ch > 0) { + + var text = cm.getRange({line: 0, ch: 0}, cursor); + var typed = ''; + var simbol = ''; + for(var i = text.length - 1; i >= 0; i--) { + if(text[i] == ' ' || text[i] == '<') { + simbol = text[i]; + break; + } + else { + typed = text[i] + typed; + } + } + + text = text.slice(0, text.length - typed.length); + + var path = getActiveElement(text) + simbol; + var hints = CodeMirror.xmlHints[path]; + + if(typeof hints === 'undefined') + hints = ['']; + else { + hints = hints.slice(0); + for (var i = hints.length - 1; i >= 0; i--) { + if(hints[i].indexOf(typed) != 0) + hints.splice(i, 1); + } + } + + return { + list: hints, + from: { line: cursor.line, ch: cursor.ch - typed.length }, + to: cursor + }; + }; + }; + + var getActiveElement = function(text) { + + var element = ''; + + if(text.length >= 0) { + + var regex = new RegExp('<([^!?][^\\s/>]*).*?>', 'g'); + + var matches = []; + var match; + while ((match = regex.exec(text)) != null) { + matches.push({ + tag: match[1], + selfclose: (match[0].slice(match[0].length - 2) === '/>') + }); + } + + for (var i = matches.length - 1, skip = 0; i >= 0; i--) { + + var item = matches[i]; + + if (item.tag[0] == '/') + { + skip++; + } + else if (item.selfclose == false) + { + if (skip > 0) + { + skip--; + } + else + { + element = '<' + item.tag + '>' + element; + } + } + } + + element += getOpenTag(text); + } + + return element; + }; + + var getOpenTag = function(text) { + + var open = text.lastIndexOf('<'); + var close = text.lastIndexOf('>'); + + if (close < open) + { + text = text.slice(open); + + if(text != '<') { + + var space = text.indexOf(' '); + if(space < 0) + space = text.indexOf('\t'); + if(space < 0) + space = text.indexOf('\n'); + + if (space < 0) + space = text.length; + + return text.slice(0, space); + } + } + + return ''; + }; + +})(); diff --git a/lib/report/assets/scripts/vendor/jquery-1.8.3.min.js b/lib/report/assets/scripts/vendor/jquery-1.8.3.min.js new file mode 100755 index 0000000..3883779 --- /dev/null +++ b/lib/report/assets/scripts/vendor/jquery-1.8.3.min.js @@ -0,0 +1,2 @@ +/*! jQuery v1.8.3 jquery.com | jquery.org/license */ +(function(e,t){function _(e){var t=M[e]={};return v.each(e.split(y),function(e,n){t[n]=!0}),t}function H(e,n,r){if(r===t&&e.nodeType===1){var i="data-"+n.replace(P,"-$1").toLowerCase();r=e.getAttribute(i);if(typeof r=="string"){try{r=r==="true"?!0:r==="false"?!1:r==="null"?null:+r+""===r?+r:D.test(r)?v.parseJSON(r):r}catch(s){}v.data(e,n,r)}else r=t}return r}function B(e){var t;for(t in e){if(t==="data"&&v.isEmptyObject(e[t]))continue;if(t!=="toJSON")return!1}return!0}function et(){return!1}function tt(){return!0}function ut(e){return!e||!e.parentNode||e.parentNode.nodeType===11}function at(e,t){do e=e[t];while(e&&e.nodeType!==1);return e}function ft(e,t,n){t=t||0;if(v.isFunction(t))return v.grep(e,function(e,r){var i=!!t.call(e,r,e);return i===n});if(t.nodeType)return v.grep(e,function(e,r){return e===t===n});if(typeof t=="string"){var r=v.grep(e,function(e){return e.nodeType===1});if(it.test(t))return v.filter(t,r,!n);t=v.filter(t,r)}return v.grep(e,function(e,r){return v.inArray(e,t)>=0===n})}function lt(e){var t=ct.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}function Lt(e,t){return e.getElementsByTagName(t)[0]||e.appendChild(e.ownerDocument.createElement(t))}function At(e,t){if(t.nodeType!==1||!v.hasData(e))return;var n,r,i,s=v._data(e),o=v._data(t,s),u=s.events;if(u){delete o.handle,o.events={};for(n in u)for(r=0,i=u[n].length;r").appendTo(i.body),n=t.css("display");t.remove();if(n==="none"||n===""){Pt=i.body.appendChild(Pt||v.extend(i.createElement("iframe"),{frameBorder:0,width:0,height:0}));if(!Ht||!Pt.createElement)Ht=(Pt.contentWindow||Pt.contentDocument).document,Ht.write(""),Ht.close();t=Ht.body.appendChild(Ht.createElement(e)),n=Dt(t,"display"),i.body.removeChild(Pt)}return Wt[e]=n,n}function fn(e,t,n,r){var i;if(v.isArray(t))v.each(t,function(t,i){n||sn.test(e)?r(e,i):fn(e+"["+(typeof i=="object"?t:"")+"]",i,n,r)});else if(!n&&v.type(t)==="object")for(i in t)fn(e+"["+i+"]",t[i],n,r);else r(e,t)}function Cn(e){return function(t,n){typeof t!="string"&&(n=t,t="*");var r,i,s,o=t.toLowerCase().split(y),u=0,a=o.length;if(v.isFunction(n))for(;u)[^>]*$|#([\w\-]*)$)/,E=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,S=/^[\],:{}\s]*$/,x=/(?:^|:|,)(?:\s*\[)+/g,T=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,N=/"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,C=/^-ms-/,k=/-([\da-z])/gi,L=function(e,t){return(t+"").toUpperCase()},A=function(){i.addEventListener?(i.removeEventListener("DOMContentLoaded",A,!1),v.ready()):i.readyState==="complete"&&(i.detachEvent("onreadystatechange",A),v.ready())},O={};v.fn=v.prototype={constructor:v,init:function(e,n,r){var s,o,u,a;if(!e)return this;if(e.nodeType)return this.context=this[0]=e,this.length=1,this;if(typeof e=="string"){e.charAt(0)==="<"&&e.charAt(e.length-1)===">"&&e.length>=3?s=[null,e,null]:s=w.exec(e);if(s&&(s[1]||!n)){if(s[1])return n=n instanceof v?n[0]:n,a=n&&n.nodeType?n.ownerDocument||n:i,e=v.parseHTML(s[1],a,!0),E.test(s[1])&&v.isPlainObject(n)&&this.attr.call(e,n,!0),v.merge(this,e);o=i.getElementById(s[2]);if(o&&o.parentNode){if(o.id!==s[2])return r.find(e);this.length=1,this[0]=o}return this.context=i,this.selector=e,this}return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e)}return v.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),v.makeArray(e,this))},selector:"",jquery:"1.8.3",length:0,size:function(){return this.length},toArray:function(){return l.call(this)},get:function(e){return e==null?this.toArray():e<0?this[this.length+e]:this[e]},pushStack:function(e,t,n){var r=v.merge(this.constructor(),e);return r.prevObject=this,r.context=this.context,t==="find"?r.selector=this.selector+(this.selector?" ":"")+n:t&&(r.selector=this.selector+"."+t+"("+n+")"),r},each:function(e,t){return v.each(this,e,t)},ready:function(e){return v.ready.promise().done(e),this},eq:function(e){return e=+e,e===-1?this.slice(e):this.slice(e,e+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(l.apply(this,arguments),"slice",l.call(arguments).join(","))},map:function(e){return this.pushStack(v.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:[].sort,splice:[].splice},v.fn.init.prototype=v.fn,v.extend=v.fn.extend=function(){var e,n,r,i,s,o,u=arguments[0]||{},a=1,f=arguments.length,l=!1;typeof u=="boolean"&&(l=u,u=arguments[1]||{},a=2),typeof u!="object"&&!v.isFunction(u)&&(u={}),f===a&&(u=this,--a);for(;a0)return;r.resolveWith(i,[v]),v.fn.trigger&&v(i).trigger("ready").off("ready")},isFunction:function(e){return v.type(e)==="function"},isArray:Array.isArray||function(e){return v.type(e)==="array"},isWindow:function(e){return e!=null&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return e==null?String(e):O[h.call(e)]||"object"},isPlainObject:function(e){if(!e||v.type(e)!=="object"||e.nodeType||v.isWindow(e))return!1;try{if(e.constructor&&!p.call(e,"constructor")&&!p.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}var r;for(r in e);return r===t||p.call(e,r)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw new Error(e)},parseHTML:function(e,t,n){var r;return!e||typeof e!="string"?null:(typeof t=="boolean"&&(n=t,t=0),t=t||i,(r=E.exec(e))?[t.createElement(r[1])]:(r=v.buildFragment([e],t,n?null:[]),v.merge([],(r.cacheable?v.clone(r.fragment):r.fragment).childNodes)))},parseJSON:function(t){if(!t||typeof t!="string")return null;t=v.trim(t);if(e.JSON&&e.JSON.parse)return e.JSON.parse(t);if(S.test(t.replace(T,"@").replace(N,"]").replace(x,"")))return(new Function("return "+t))();v.error("Invalid JSON: "+t)},parseXML:function(n){var r,i;if(!n||typeof n!="string")return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(s){r=t}return(!r||!r.documentElement||r.getElementsByTagName("parsererror").length)&&v.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&g.test(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(C,"ms-").replace(k,L)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,n,r){var i,s=0,o=e.length,u=o===t||v.isFunction(e);if(r){if(u){for(i in e)if(n.apply(e[i],r)===!1)break}else for(;s0&&e[0]&&e[a-1]||a===0||v.isArray(e));if(f)for(;u-1)a.splice(n,1),i&&(n<=o&&o--,n<=u&&u--)}),this},has:function(e){return v.inArray(e,a)>-1},empty:function(){return a=[],this},disable:function(){return a=f=n=t,this},disabled:function(){return!a},lock:function(){return f=t,n||c.disable(),this},locked:function(){return!f},fireWith:function(e,t){return t=t||[],t=[e,t.slice?t.slice():t],a&&(!r||f)&&(i?f.push(t):l(t)),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!r}};return c},v.extend({Deferred:function(e){var t=[["resolve","done",v.Callbacks("once memory"),"resolved"],["reject","fail",v.Callbacks("once memory"),"rejected"],["notify","progress",v.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return v.Deferred(function(n){v.each(t,function(t,r){var s=r[0],o=e[t];i[r[1]](v.isFunction(o)?function(){var e=o.apply(this,arguments);e&&v.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[s+"With"](this===i?n:this,[e])}:n[s])}),e=null}).promise()},promise:function(e){return e!=null?v.extend(e,r):r}},i={};return r.pipe=r.then,v.each(t,function(e,s){var o=s[2],u=s[3];r[s[1]]=o.add,u&&o.add(function(){n=u},t[e^1][2].disable,t[2][2].lock),i[s[0]]=o.fire,i[s[0]+"With"]=o.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=l.call(arguments),r=n.length,i=r!==1||e&&v.isFunction(e.promise)?r:0,s=i===1?e:v.Deferred(),o=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?l.call(arguments):r,n===u?s.notifyWith(t,n):--i||s.resolveWith(t,n)}},u,a,f;if(r>1){u=new Array(r),a=new Array(r),f=new Array(r);for(;t
a",n=p.getElementsByTagName("*"),r=p.getElementsByTagName("a")[0];if(!n||!r||!n.length)return{};s=i.createElement("select"),o=s.appendChild(i.createElement("option")),u=p.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t={leadingWhitespace:p.firstChild.nodeType===3,tbody:!p.getElementsByTagName("tbody").length,htmlSerialize:!!p.getElementsByTagName("link").length,style:/top/.test(r.getAttribute("style")),hrefNormalized:r.getAttribute("href")==="/a",opacity:/^0.5/.test(r.style.opacity),cssFloat:!!r.style.cssFloat,checkOn:u.value==="on",optSelected:o.selected,getSetAttribute:p.className!=="t",enctype:!!i.createElement("form").enctype,html5Clone:i.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",boxModel:i.compatMode==="CSS1Compat",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},u.checked=!0,t.noCloneChecked=u.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!o.disabled;try{delete p.test}catch(d){t.deleteExpando=!1}!p.addEventListener&&p.attachEvent&&p.fireEvent&&(p.attachEvent("onclick",h=function(){t.noCloneEvent=!1}),p.cloneNode(!0).fireEvent("onclick"),p.detachEvent("onclick",h)),u=i.createElement("input"),u.value="t",u.setAttribute("type","radio"),t.radioValue=u.value==="t",u.setAttribute("checked","checked"),u.setAttribute("name","t"),p.appendChild(u),a=i.createDocumentFragment(),a.appendChild(p.lastChild),t.checkClone=a.cloneNode(!0).cloneNode(!0).lastChild.checked,t.appendChecked=u.checked,a.removeChild(u),a.appendChild(p);if(p.attachEvent)for(l in{submit:!0,change:!0,focusin:!0})f="on"+l,c=f in p,c||(p.setAttribute(f,"return;"),c=typeof p[f]=="function"),t[l+"Bubbles"]=c;return v(function(){var n,r,s,o,u="padding:0;margin:0;border:0;display:block;overflow:hidden;",a=i.getElementsByTagName("body")[0];if(!a)return;n=i.createElement("div"),n.style.cssText="visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px",a.insertBefore(n,a.firstChild),r=i.createElement("div"),n.appendChild(r),r.innerHTML="
t
",s=r.getElementsByTagName("td"),s[0].style.cssText="padding:0;margin:0;border:0;display:none",c=s[0].offsetHeight===0,s[0].style.display="",s[1].style.display="none",t.reliableHiddenOffsets=c&&s[0].offsetHeight===0,r.innerHTML="",r.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",t.boxSizing=r.offsetWidth===4,t.doesNotIncludeMarginInBodyOffset=a.offsetTop!==1,e.getComputedStyle&&(t.pixelPosition=(e.getComputedStyle(r,null)||{}).top!=="1%",t.boxSizingReliable=(e.getComputedStyle(r,null)||{width:"4px"}).width==="4px",o=i.createElement("div"),o.style.cssText=r.style.cssText=u,o.style.marginRight=o.style.width="0",r.style.width="1px",r.appendChild(o),t.reliableMarginRight=!parseFloat((e.getComputedStyle(o,null)||{}).marginRight)),typeof r.style.zoom!="undefined"&&(r.innerHTML="",r.style.cssText=u+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=r.offsetWidth===3,r.style.display="block",r.style.overflow="visible",r.innerHTML="
",r.firstChild.style.width="5px",t.shrinkWrapBlocks=r.offsetWidth!==3,n.style.zoom=1),a.removeChild(n),n=r=s=o=null}),a.removeChild(p),n=r=s=o=u=a=p=null,t}();var D=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,P=/([A-Z])/g;v.extend({cache:{},deletedIds:[],uuid:0,expando:"jQuery"+(v.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(e){return e=e.nodeType?v.cache[e[v.expando]]:e[v.expando],!!e&&!B(e)},data:function(e,n,r,i){if(!v.acceptData(e))return;var s,o,u=v.expando,a=typeof n=="string",f=e.nodeType,l=f?v.cache:e,c=f?e[u]:e[u]&&u;if((!c||!l[c]||!i&&!l[c].data)&&a&&r===t)return;c||(f?e[u]=c=v.deletedIds.pop()||v.guid++:c=u),l[c]||(l[c]={},f||(l[c].toJSON=v.noop));if(typeof n=="object"||typeof n=="function")i?l[c]=v.extend(l[c],n):l[c].data=v.extend(l[c].data,n);return s=l[c],i||(s.data||(s.data={}),s=s.data),r!==t&&(s[v.camelCase(n)]=r),a?(o=s[n],o==null&&(o=s[v.camelCase(n)])):o=s,o},removeData:function(e,t,n){if(!v.acceptData(e))return;var r,i,s,o=e.nodeType,u=o?v.cache:e,a=o?e[v.expando]:v.expando;if(!u[a])return;if(t){r=n?u[a]:u[a].data;if(r){v.isArray(t)||(t in r?t=[t]:(t=v.camelCase(t),t in r?t=[t]:t=t.split(" ")));for(i=0,s=t.length;i1,null,!1))},removeData:function(e){return this.each(function(){v.removeData(this,e)})}}),v.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=v._data(e,t),n&&(!r||v.isArray(n)?r=v._data(e,t,v.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=v.queue(e,t),r=n.length,i=n.shift(),s=v._queueHooks(e,t),o=function(){v.dequeue(e,t)};i==="inprogress"&&(i=n.shift(),r--),i&&(t==="fx"&&n.unshift("inprogress"),delete s.stop,i.call(e,o,s)),!r&&s&&s.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return v._data(e,n)||v._data(e,n,{empty:v.Callbacks("once memory").add(function(){v.removeData(e,t+"queue",!0),v.removeData(e,n,!0)})})}}),v.fn.extend({queue:function(e,n){var r=2;return typeof e!="string"&&(n=e,e="fx",r--),arguments.length1)},removeAttr:function(e){return this.each(function(){v.removeAttr(this,e)})},prop:function(e,t){return v.access(this,v.prop,e,t,arguments.length>1)},removeProp:function(e){return e=v.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,s,o,u;if(v.isFunction(e))return this.each(function(t){v(this).addClass(e.call(this,t,this.className))});if(e&&typeof e=="string"){t=e.split(y);for(n=0,r=this.length;n=0)r=r.replace(" "+n[s]+" "," ");i.className=e?v.trim(r):""}}}return this},toggleClass:function(e,t){var n=typeof e,r=typeof t=="boolean";return v.isFunction(e)?this.each(function(n){v(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if(n==="string"){var i,s=0,o=v(this),u=t,a=e.split(y);while(i=a[s++])u=r?u:!o.hasClass(i),o[u?"addClass":"removeClass"](i)}else if(n==="undefined"||n==="boolean")this.className&&v._data(this,"__className__",this.className),this.className=this.className||e===!1?"":v._data(this,"__className__")||""})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;n=0)return!0;return!1},val:function(e){var n,r,i,s=this[0];if(!arguments.length){if(s)return n=v.valHooks[s.type]||v.valHooks[s.nodeName.toLowerCase()],n&&"get"in n&&(r=n.get(s,"value"))!==t?r:(r=s.value,typeof r=="string"?r.replace(R,""):r==null?"":r);return}return i=v.isFunction(e),this.each(function(r){var s,o=v(this);if(this.nodeType!==1)return;i?s=e.call(this,r,o.val()):s=e,s==null?s="":typeof s=="number"?s+="":v.isArray(s)&&(s=v.map(s,function(e){return e==null?"":e+""})),n=v.valHooks[this.type]||v.valHooks[this.nodeName.toLowerCase()];if(!n||!("set"in n)||n.set(this,s,"value")===t)this.value=s})}}),v.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,s=e.type==="select-one"||i<0,o=s?null:[],u=s?i+1:r.length,a=i<0?u:s?i:0;for(;a=0}),n.length||(e.selectedIndex=-1),n}}},attrFn:{},attr:function(e,n,r,i){var s,o,u,a=e.nodeType;if(!e||a===3||a===8||a===2)return;if(i&&v.isFunction(v.fn[n]))return v(e)[n](r);if(typeof e.getAttribute=="undefined")return v.prop(e,n,r);u=a!==1||!v.isXMLDoc(e),u&&(n=n.toLowerCase(),o=v.attrHooks[n]||(X.test(n)?F:j));if(r!==t){if(r===null){v.removeAttr(e,n);return}return o&&"set"in o&&u&&(s=o.set(e,r,n))!==t?s:(e.setAttribute(n,r+""),r)}return o&&"get"in o&&u&&(s=o.get(e,n))!==null?s:(s=e.getAttribute(n),s===null?t:s)},removeAttr:function(e,t){var n,r,i,s,o=0;if(t&&e.nodeType===1){r=t.split(y);for(;o=0}})});var $=/^(?:textarea|input|select)$/i,J=/^([^\.]*|)(?:\.(.+)|)$/,K=/(?:^|\s)hover(\.\S+|)\b/,Q=/^key/,G=/^(?:mouse|contextmenu)|click/,Y=/^(?:focusinfocus|focusoutblur)$/,Z=function(e){return v.event.special.hover?e:e.replace(K,"mouseenter$1 mouseleave$1")};v.event={add:function(e,n,r,i,s){var o,u,a,f,l,c,h,p,d,m,g;if(e.nodeType===3||e.nodeType===8||!n||!r||!(o=v._data(e)))return;r.handler&&(d=r,r=d.handler,s=d.selector),r.guid||(r.guid=v.guid++),a=o.events,a||(o.events=a={}),u=o.handle,u||(o.handle=u=function(e){return typeof v=="undefined"||!!e&&v.event.triggered===e.type?t:v.event.dispatch.apply(u.elem,arguments)},u.elem=e),n=v.trim(Z(n)).split(" ");for(f=0;f=0&&(y=y.slice(0,-1),a=!0),y.indexOf(".")>=0&&(b=y.split("."),y=b.shift(),b.sort());if((!s||v.event.customEvent[y])&&!v.event.global[y])return;n=typeof n=="object"?n[v.expando]?n:new v.Event(y,n):new v.Event(y),n.type=y,n.isTrigger=!0,n.exclusive=a,n.namespace=b.join("."),n.namespace_re=n.namespace?new RegExp("(^|\\.)"+b.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,h=y.indexOf(":")<0?"on"+y:"";if(!s){u=v.cache;for(f in u)u[f].events&&u[f].events[y]&&v.event.trigger(n,r,u[f].handle.elem,!0);return}n.result=t,n.target||(n.target=s),r=r!=null?v.makeArray(r):[],r.unshift(n),p=v.event.special[y]||{};if(p.trigger&&p.trigger.apply(s,r)===!1)return;m=[[s,p.bindType||y]];if(!o&&!p.noBubble&&!v.isWindow(s)){g=p.delegateType||y,l=Y.test(g+y)?s:s.parentNode;for(c=s;l;l=l.parentNode)m.push([l,g]),c=l;c===(s.ownerDocument||i)&&m.push([c.defaultView||c.parentWindow||e,g])}for(f=0;f=0:v.find(h,this,null,[s]).length),u[h]&&f.push(c);f.length&&w.push({elem:s,matches:f})}d.length>m&&w.push({elem:this,matches:d.slice(m)});for(r=0;r0?this.on(t,null,e,n):this.trigger(t)},Q.test(t)&&(v.event.fixHooks[t]=v.event.keyHooks),G.test(t)&&(v.event.fixHooks[t]=v.event.mouseHooks)}),function(e,t){function nt(e,t,n,r){n=n||[],t=t||g;var i,s,a,f,l=t.nodeType;if(!e||typeof e!="string")return n;if(l!==1&&l!==9)return[];a=o(t);if(!a&&!r)if(i=R.exec(e))if(f=i[1]){if(l===9){s=t.getElementById(f);if(!s||!s.parentNode)return n;if(s.id===f)return n.push(s),n}else if(t.ownerDocument&&(s=t.ownerDocument.getElementById(f))&&u(t,s)&&s.id===f)return n.push(s),n}else{if(i[2])return S.apply(n,x.call(t.getElementsByTagName(e),0)),n;if((f=i[3])&&Z&&t.getElementsByClassName)return S.apply(n,x.call(t.getElementsByClassName(f),0)),n}return vt(e.replace(j,"$1"),t,n,r,a)}function rt(e){return function(t){var n=t.nodeName.toLowerCase();return n==="input"&&t.type===e}}function it(e){return function(t){var n=t.nodeName.toLowerCase();return(n==="input"||n==="button")&&t.type===e}}function st(e){return N(function(t){return t=+t,N(function(n,r){var i,s=e([],n.length,t),o=s.length;while(o--)n[i=s[o]]&&(n[i]=!(r[i]=n[i]))})})}function ot(e,t,n){if(e===t)return n;var r=e.nextSibling;while(r){if(r===t)return-1;r=r.nextSibling}return 1}function ut(e,t){var n,r,s,o,u,a,f,l=L[d][e+" "];if(l)return t?0:l.slice(0);u=e,a=[],f=i.preFilter;while(u){if(!n||(r=F.exec(u)))r&&(u=u.slice(r[0].length)||u),a.push(s=[]);n=!1;if(r=I.exec(u))s.push(n=new m(r.shift())),u=u.slice(n.length),n.type=r[0].replace(j," ");for(o in i.filter)(r=J[o].exec(u))&&(!f[o]||(r=f[o](r)))&&(s.push(n=new m(r.shift())),u=u.slice(n.length),n.type=o,n.matches=r);if(!n)break}return t?u.length:u?nt.error(e):L(e,a).slice(0)}function at(e,t,r){var i=t.dir,s=r&&t.dir==="parentNode",o=w++;return t.first?function(t,n,r){while(t=t[i])if(s||t.nodeType===1)return e(t,n,r)}:function(t,r,u){if(!u){var a,f=b+" "+o+" ",l=f+n;while(t=t[i])if(s||t.nodeType===1){if((a=t[d])===l)return t.sizset;if(typeof a=="string"&&a.indexOf(f)===0){if(t.sizset)return t}else{t[d]=l;if(e(t,r,u))return t.sizset=!0,t;t.sizset=!1}}}else while(t=t[i])if(s||t.nodeType===1)if(e(t,r,u))return t}}function ft(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function lt(e,t,n,r,i){var s,o=[],u=0,a=e.length,f=t!=null;for(;u-1&&(s[f]=!(o[f]=c))}}else g=lt(g===o?g.splice(d,g.length):g),i?i(null,o,g,a):S.apply(o,g)})}function ht(e){var t,n,r,s=e.length,o=i.relative[e[0].type],u=o||i.relative[" "],a=o?1:0,f=at(function(e){return e===t},u,!0),l=at(function(e){return T.call(t,e)>-1},u,!0),h=[function(e,n,r){return!o&&(r||n!==c)||((t=n).nodeType?f(e,n,r):l(e,n,r))}];for(;a1&&ft(h),a>1&&e.slice(0,a-1).join("").replace(j,"$1"),n,a0,s=e.length>0,o=function(u,a,f,l,h){var p,d,v,m=[],y=0,w="0",x=u&&[],T=h!=null,N=c,C=u||s&&i.find.TAG("*",h&&a.parentNode||a),k=b+=N==null?1:Math.E;T&&(c=a!==g&&a,n=o.el);for(;(p=C[w])!=null;w++){if(s&&p){for(d=0;v=e[d];d++)if(v(p,a,f)){l.push(p);break}T&&(b=k,n=++o.el)}r&&((p=!v&&p)&&y--,u&&x.push(p))}y+=w;if(r&&w!==y){for(d=0;v=t[d];d++)v(x,m,a,f);if(u){if(y>0)while(w--)!x[w]&&!m[w]&&(m[w]=E.call(l));m=lt(m)}S.apply(l,m),T&&!u&&m.length>0&&y+t.length>1&&nt.uniqueSort(l)}return T&&(b=k,c=N),x};return o.el=0,r?N(o):o}function dt(e,t,n){var r=0,i=t.length;for(;r2&&(f=u[0]).type==="ID"&&t.nodeType===9&&!s&&i.relative[u[1].type]){t=i.find.ID(f.matches[0].replace($,""),t,s)[0];if(!t)return n;e=e.slice(u.shift().length)}for(o=J.POS.test(e)?-1:u.length-1;o>=0;o--){f=u[o];if(i.relative[l=f.type])break;if(c=i.find[l])if(r=c(f.matches[0].replace($,""),z.test(u[0].type)&&t.parentNode||t,s)){u.splice(o,1),e=r.length&&u.join("");if(!e)return S.apply(n,x.call(r,0)),n;break}}}return a(e,h)(r,t,s,n,z.test(e)),n}function mt(){}var n,r,i,s,o,u,a,f,l,c,h=!0,p="undefined",d=("sizcache"+Math.random()).replace(".",""),m=String,g=e.document,y=g.documentElement,b=0,w=0,E=[].pop,S=[].push,x=[].slice,T=[].indexOf||function(e){var t=0,n=this.length;for(;ti.cacheLength&&delete e[t.shift()],e[n+" "]=r},e)},k=C(),L=C(),A=C(),O="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",_=M.replace("w","w#"),D="([*^$|!~]?=)",P="\\["+O+"*("+M+")"+O+"*(?:"+D+O+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+_+")|)|)"+O+"*\\]",H=":("+M+")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:"+P+")|[^:]|\\\\.)*|.*))\\)|)",B=":(even|odd|eq|gt|lt|nth|first|last)(?:\\("+O+"*((?:-\\d)?\\d*)"+O+"*\\)|)(?=[^-]|$)",j=new RegExp("^"+O+"+|((?:^|[^\\\\])(?:\\\\.)*)"+O+"+$","g"),F=new RegExp("^"+O+"*,"+O+"*"),I=new RegExp("^"+O+"*([\\x20\\t\\r\\n\\f>+~])"+O+"*"),q=new RegExp(H),R=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,U=/^:not/,z=/[\x20\t\r\n\f]*[+~]/,W=/:not\($/,X=/h\d/i,V=/input|select|textarea|button/i,$=/\\(?!\\)/g,J={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),NAME:new RegExp("^\\[name=['\"]?("+M+")['\"]?\\]"),TAG:new RegExp("^("+M.replace("w","w*")+")"),ATTR:new RegExp("^"+P),PSEUDO:new RegExp("^"+H),POS:new RegExp(B,"i"),CHILD:new RegExp("^:(only|nth|first|last)-child(?:\\("+O+"*(even|odd|(([+-]|)(\\d*)n|)"+O+"*(?:([+-]|)"+O+"*(\\d+)|))"+O+"*\\)|)","i"),needsContext:new RegExp("^"+O+"*[>+~]|"+B,"i")},K=function(e){var t=g.createElement("div");try{return e(t)}catch(n){return!1}finally{t=null}},Q=K(function(e){return e.appendChild(g.createComment("")),!e.getElementsByTagName("*").length}),G=K(function(e){return e.innerHTML="",e.firstChild&&typeof e.firstChild.getAttribute!==p&&e.firstChild.getAttribute("href")==="#"}),Y=K(function(e){e.innerHTML="";var t=typeof e.lastChild.getAttribute("multiple");return t!=="boolean"&&t!=="string"}),Z=K(function(e){return e.innerHTML="",!e.getElementsByClassName||!e.getElementsByClassName("e").length?!1:(e.lastChild.className="e",e.getElementsByClassName("e").length===2)}),et=K(function(e){e.id=d+0,e.innerHTML="
",y.insertBefore(e,y.firstChild);var t=g.getElementsByName&&g.getElementsByName(d).length===2+g.getElementsByName(d+0).length;return r=!g.getElementById(d),y.removeChild(e),t});try{x.call(y.childNodes,0)[0].nodeType}catch(tt){x=function(e){var t,n=[];for(;t=this[e];e++)n.push(t);return n}}nt.matches=function(e,t){return nt(e,null,null,t)},nt.matchesSelector=function(e,t){return nt(t,null,null,[e]).length>0},s=nt.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(i===1||i===9||i===11){if(typeof e.textContent=="string")return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=s(e)}else if(i===3||i===4)return e.nodeValue}else for(;t=e[r];r++)n+=s(t);return n},o=nt.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?t.nodeName!=="HTML":!1},u=nt.contains=y.contains?function(e,t){var n=e.nodeType===9?e.documentElement:e,r=t&&t.parentNode;return e===r||!!(r&&r.nodeType===1&&n.contains&&n.contains(r))}:y.compareDocumentPosition?function(e,t){return t&&!!(e.compareDocumentPosition(t)&16)}:function(e,t){while(t=t.parentNode)if(t===e)return!0;return!1},nt.attr=function(e,t){var n,r=o(e);return r||(t=t.toLowerCase()),(n=i.attrHandle[t])?n(e):r||Y?e.getAttribute(t):(n=e.getAttributeNode(t),n?typeof e[t]=="boolean"?e[t]?t:null:n.specified?n.value:null:null)},i=nt.selectors={cacheLength:50,createPseudo:N,match:J,attrHandle:G?{}:{href:function(e){return e.getAttribute("href",2)},type:function(e){return e.getAttribute("type")}},find:{ID:r?function(e,t,n){if(typeof t.getElementById!==p&&!n){var r=t.getElementById(e);return r&&r.parentNode?[r]:[]}}:function(e,n,r){if(typeof n.getElementById!==p&&!r){var i=n.getElementById(e);return i?i.id===e||typeof i.getAttributeNode!==p&&i.getAttributeNode("id").value===e?[i]:t:[]}},TAG:Q?function(e,t){if(typeof t.getElementsByTagName!==p)return t.getElementsByTagName(e)}:function(e,t){var n=t.getElementsByTagName(e);if(e==="*"){var r,i=[],s=0;for(;r=n[s];s++)r.nodeType===1&&i.push(r);return i}return n},NAME:et&&function(e,t){if(typeof t.getElementsByName!==p)return t.getElementsByName(name)},CLASS:Z&&function(e,t,n){if(typeof t.getElementsByClassName!==p&&!n)return t.getElementsByClassName(e)}},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace($,""),e[3]=(e[4]||e[5]||"").replace($,""),e[2]==="~="&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),e[1]==="nth"?(e[2]||nt.error(e[0]),e[3]=+(e[3]?e[4]+(e[5]||1):2*(e[2]==="even"||e[2]==="odd")),e[4]=+(e[6]+e[7]||e[2]==="odd")):e[2]&&nt.error(e[0]),e},PSEUDO:function(e){var t,n;if(J.CHILD.test(e[0]))return null;if(e[3])e[2]=e[3];else if(t=e[4])q.test(t)&&(n=ut(t,!0))&&(n=t.indexOf(")",t.length-n)-t.length)&&(t=t.slice(0,n),e[0]=e[0].slice(0,n)),e[2]=t;return e.slice(0,3)}},filter:{ID:r?function(e){return e=e.replace($,""),function(t){return t.getAttribute("id")===e}}:function(e){return e=e.replace($,""),function(t){var n=typeof t.getAttributeNode!==p&&t.getAttributeNode("id");return n&&n.value===e}},TAG:function(e){return e==="*"?function(){return!0}:(e=e.replace($,"").toLowerCase(),function(t){return t.nodeName&&t.nodeName.toLowerCase()===e})},CLASS:function(e){var t=k[d][e+" "];return t||(t=new RegExp("(^|"+O+")"+e+"("+O+"|$)"))&&k(e,function(e){return t.test(e.className||typeof e.getAttribute!==p&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r,i){var s=nt.attr(r,e);return s==null?t==="!=":t?(s+="",t==="="?s===n:t==="!="?s!==n:t==="^="?n&&s.indexOf(n)===0:t==="*="?n&&s.indexOf(n)>-1:t==="$="?n&&s.substr(s.length-n.length)===n:t==="~="?(" "+s+" ").indexOf(n)>-1:t==="|="?s===n||s.substr(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r){return e==="nth"?function(e){var t,i,s=e.parentNode;if(n===1&&r===0)return!0;if(s){i=0;for(t=s.firstChild;t;t=t.nextSibling)if(t.nodeType===1){i++;if(e===t)break}}return i-=r,i===n||i%n===0&&i/n>=0}:function(t){var n=t;switch(e){case"only":case"first":while(n=n.previousSibling)if(n.nodeType===1)return!1;if(e==="first")return!0;n=t;case"last":while(n=n.nextSibling)if(n.nodeType===1)return!1;return!0}}},PSEUDO:function(e,t){var n,r=i.pseudos[e]||i.setFilters[e.toLowerCase()]||nt.error("unsupported pseudo: "+e);return r[d]?r(t):r.length>1?(n=[e,e,"",t],i.setFilters.hasOwnProperty(e.toLowerCase())?N(function(e,n){var i,s=r(e,t),o=s.length;while(o--)i=T.call(e,s[o]),e[i]=!(n[i]=s[o])}):function(e){return r(e,0,n)}):r}},pseudos:{not:N(function(e){var t=[],n=[],r=a(e.replace(j,"$1"));return r[d]?N(function(e,t,n,i){var s,o=r(e,null,i,[]),u=e.length;while(u--)if(s=o[u])e[u]=!(t[u]=s)}):function(e,i,s){return t[0]=e,r(t,null,s,n),!n.pop()}}),has:N(function(e){return function(t){return nt(e,t).length>0}}),contains:N(function(e){return function(t){return(t.textContent||t.innerText||s(t)).indexOf(e)>-1}}),enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&!!e.checked||t==="option"&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},parent:function(e){return!i.pseudos.empty(e)},empty:function(e){var t;e=e.firstChild;while(e){if(e.nodeName>"@"||(t=e.nodeType)===3||t===4)return!1;e=e.nextSibling}return!0},header:function(e){return X.test(e.nodeName)},text:function(e){var t,n;return e.nodeName.toLowerCase()==="input"&&(t=e.type)==="text"&&((n=e.getAttribute("type"))==null||n.toLowerCase()===t)},radio:rt("radio"),checkbox:rt("checkbox"),file:rt("file"),password:rt("password"),image:rt("image"),submit:it("submit"),reset:it("reset"),button:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&e.type==="button"||t==="button"},input:function(e){return V.test(e.nodeName)},focus:function(e){var t=e.ownerDocument;return e===t.activeElement&&(!t.hasFocus||t.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},active:function(e){return e===e.ownerDocument.activeElement},first:st(function(){return[0]}),last:st(function(e,t){return[t-1]}),eq:st(function(e,t,n){return[n<0?n+t:n]}),even:st(function(e,t){for(var n=0;n=0;)e.push(r);return e}),gt:st(function(e,t,n){for(var r=n<0?n+t:n;++r",e.querySelectorAll("[selected]").length||i.push("\\["+O+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),e.querySelectorAll(":checked").length||i.push(":checked")}),K(function(e){e.innerHTML="

",e.querySelectorAll("[test^='']").length&&i.push("[*^$]="+O+"*(?:\"\"|'')"),e.innerHTML="",e.querySelectorAll(":enabled").length||i.push(":enabled",":disabled")}),i=new RegExp(i.join("|")),vt=function(e,r,s,o,u){if(!o&&!u&&!i.test(e)){var a,f,l=!0,c=d,h=r,p=r.nodeType===9&&e;if(r.nodeType===1&&r.nodeName.toLowerCase()!=="object"){a=ut(e),(l=r.getAttribute("id"))?c=l.replace(n,"\\$&"):r.setAttribute("id",c),c="[id='"+c+"'] ",f=a.length;while(f--)a[f]=c+a[f].join("");h=z.test(e)&&r.parentNode||r,p=a.join(",")}if(p)try{return S.apply(s,x.call(h.querySelectorAll(p),0)),s}catch(v){}finally{l||r.removeAttribute("id")}}return t(e,r,s,o,u)},u&&(K(function(t){e=u.call(t,"div");try{u.call(t,"[test!='']:sizzle"),s.push("!=",H)}catch(n){}}),s=new RegExp(s.join("|")),nt.matchesSelector=function(t,n){n=n.replace(r,"='$1']");if(!o(t)&&!s.test(n)&&!i.test(n))try{var a=u.call(t,n);if(a||e||t.document&&t.document.nodeType!==11)return a}catch(f){}return nt(n,null,null,[t]).length>0})}(),i.pseudos.nth=i.pseudos.eq,i.filters=mt.prototype=i.pseudos,i.setFilters=new mt,nt.attr=v.attr,v.find=nt,v.expr=nt.selectors,v.expr[":"]=v.expr.pseudos,v.unique=nt.uniqueSort,v.text=nt.getText,v.isXMLDoc=nt.isXML,v.contains=nt.contains}(e);var nt=/Until$/,rt=/^(?:parents|prev(?:Until|All))/,it=/^.[^:#\[\.,]*$/,st=v.expr.match.needsContext,ot={children:!0,contents:!0,next:!0,prev:!0};v.fn.extend({find:function(e){var t,n,r,i,s,o,u=this;if(typeof e!="string")return v(e).filter(function(){for(t=0,n=u.length;t0)for(i=r;i=0:v.filter(e,this).length>0:this.filter(e).length>0)},closest:function(e,t){var n,r=0,i=this.length,s=[],o=st.test(e)||typeof e!="string"?v(e,t||this.context):0;for(;r-1:v.find.matchesSelector(n,e)){s.push(n);break}n=n.parentNode}}return s=s.length>1?v.unique(s):s,this.pushStack(s,"closest",e)},index:function(e){return e?typeof e=="string"?v.inArray(this[0],v(e)):v.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(e,t){var n=typeof e=="string"?v(e,t):v.makeArray(e&&e.nodeType?[e]:e),r=v.merge(this.get(),n);return this.pushStack(ut(n[0])||ut(r[0])?r:v.unique(r))},addBack:function(e){return this.add(e==null?this.prevObject:this.prevObject.filter(e))}}),v.fn.andSelf=v.fn.addBack,v.each({parent:function(e){var t=e.parentNode;return t&&t.nodeType!==11?t:null},parents:function(e){return v.dir(e,"parentNode")},parentsUntil:function(e,t,n){return v.dir(e,"parentNode",n)},next:function(e){return at(e,"nextSibling")},prev:function(e){return at(e,"previousSibling")},nextAll:function(e){return v.dir(e,"nextSibling")},prevAll:function(e){return v.dir(e,"previousSibling")},nextUntil:function(e,t,n){return v.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return v.dir(e,"previousSibling",n)},siblings:function(e){return v.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return v.sibling(e.firstChild)},contents:function(e){return v.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:v.merge([],e.childNodes)}},function(e,t){v.fn[e]=function(n,r){var i=v.map(this,t,n);return nt.test(e)||(r=n),r&&typeof r=="string"&&(i=v.filter(r,i)),i=this.length>1&&!ot[e]?v.unique(i):i,this.length>1&&rt.test(e)&&(i=i.reverse()),this.pushStack(i,e,l.call(arguments).join(","))}}),v.extend({filter:function(e,t,n){return n&&(e=":not("+e+")"),t.length===1?v.find.matchesSelector(t[0],e)?[t[0]]:[]:v.find.matches(e,t)},dir:function(e,n,r){var i=[],s=e[n];while(s&&s.nodeType!==9&&(r===t||s.nodeType!==1||!v(s).is(r)))s.nodeType===1&&i.push(s),s=s[n];return i},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)e.nodeType===1&&e!==t&&n.push(e);return n}});var ct="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",ht=/ jQuery\d+="(?:null|\d+)"/g,pt=/^\s+/,dt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,vt=/<([\w:]+)/,mt=/]","i"),Et=/^(?:checkbox|radio)$/,St=/checked\s*(?:[^=]|=\s*.checked.)/i,xt=/\/(java|ecma)script/i,Tt=/^\s*\s*$/g,Nt={option:[1,""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]},Ct=lt(i),kt=Ct.appendChild(i.createElement("div"));Nt.optgroup=Nt.option,Nt.tbody=Nt.tfoot=Nt.colgroup=Nt.caption=Nt.thead,Nt.th=Nt.td,v.support.htmlSerialize||(Nt._default=[1,"X
","
"]),v.fn.extend({text:function(e){return v.access(this,function(e){return e===t?v.text(this):this.empty().append((this[0]&&this[0].ownerDocument||i).createTextNode(e))},null,e,arguments.length)},wrapAll:function(e){if(v.isFunction(e))return this.each(function(t){v(this).wrapAll(e.call(this,t))});if(this[0]){var t=v(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstChild&&e.firstChild.nodeType===1)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return v.isFunction(e)?this.each(function(t){v(this).wrapInner(e.call(this,t))}):this.each(function(){var t=v(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=v.isFunction(e);return this.each(function(n){v(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){v.nodeName(this,"body")||v(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(e){(this.nodeType===1||this.nodeType===11)&&this.appendChild(e)})},prepend:function(){return this.domManip(arguments,!0,function(e){(this.nodeType===1||this.nodeType===11)&&this.insertBefore(e,this.firstChild)})},before:function(){if(!ut(this[0]))return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this)});if(arguments.length){var e=v.clean(arguments);return this.pushStack(v.merge(e,this),"before",this.selector)}},after:function(){if(!ut(this[0]))return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this.nextSibling)});if(arguments.length){var e=v.clean(arguments);return this.pushStack(v.merge(this,e),"after",this.selector)}},remove:function(e,t){var n,r=0;for(;(n=this[r])!=null;r++)if(!e||v.filter(e,[n]).length)!t&&n.nodeType===1&&(v.cleanData(n.getElementsByTagName("*")),v.cleanData([n])),n.parentNode&&n.parentNode.removeChild(n);return this},empty:function(){var e,t=0;for(;(e=this[t])!=null;t++){e.nodeType===1&&v.cleanData(e.getElementsByTagName("*"));while(e.firstChild)e.removeChild(e.firstChild)}return this},clone:function(e,t){return e=e==null?!1:e,t=t==null?e:t,this.map(function(){return v.clone(this,e,t)})},html:function(e){return v.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return n.nodeType===1?n.innerHTML.replace(ht,""):t;if(typeof e=="string"&&!yt.test(e)&&(v.support.htmlSerialize||!wt.test(e))&&(v.support.leadingWhitespace||!pt.test(e))&&!Nt[(vt.exec(e)||["",""])[1].toLowerCase()]){e=e.replace(dt,"<$1>");try{for(;r1&&typeof f=="string"&&St.test(f))return this.each(function(){v(this).domManip(e,n,r)});if(v.isFunction(f))return this.each(function(i){var s=v(this);e[0]=f.call(this,i,n?s.html():t),s.domManip(e,n,r)});if(this[0]){i=v.buildFragment(e,this,l),o=i.fragment,s=o.firstChild,o.childNodes.length===1&&(o=s);if(s){n=n&&v.nodeName(s,"tr");for(u=i.cacheable||c-1;a0?this.clone(!0):this).get(),v(o[i])[t](r),s=s.concat(r);return this.pushStack(s,e,o.selector)}}),v.extend({clone:function(e,t,n){var r,i,s,o;v.support.html5Clone||v.isXMLDoc(e)||!wt.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(kt.innerHTML=e.outerHTML,kt.removeChild(o=kt.firstChild));if((!v.support.noCloneEvent||!v.support.noCloneChecked)&&(e.nodeType===1||e.nodeType===11)&&!v.isXMLDoc(e)){Ot(e,o),r=Mt(e),i=Mt(o);for(s=0;r[s];++s)i[s]&&Ot(r[s],i[s])}if(t){At(e,o);if(n){r=Mt(e),i=Mt(o);for(s=0;r[s];++s)At(r[s],i[s])}}return r=i=null,o},clean:function(e,t,n,r){var s,o,u,a,f,l,c,h,p,d,m,g,y=t===i&&Ct,b=[];if(!t||typeof t.createDocumentFragment=="undefined")t=i;for(s=0;(u=e[s])!=null;s++){typeof u=="number"&&(u+="");if(!u)continue;if(typeof u=="string")if(!gt.test(u))u=t.createTextNode(u);else{y=y||lt(t),c=t.createElement("div"),y.appendChild(c),u=u.replace(dt,"<$1>"),a=(vt.exec(u)||["",""])[1].toLowerCase(),f=Nt[a]||Nt._default,l=f[0],c.innerHTML=f[1]+u+f[2];while(l--)c=c.lastChild;if(!v.support.tbody){h=mt.test(u),p=a==="table"&&!h?c.firstChild&&c.firstChild.childNodes:f[1]===""&&!h?c.childNodes:[];for(o=p.length-1;o>=0;--o)v.nodeName(p[o],"tbody")&&!p[o].childNodes.length&&p[o].parentNode.removeChild(p[o])}!v.support.leadingWhitespace&&pt.test(u)&&c.insertBefore(t.createTextNode(pt.exec(u)[0]),c.firstChild),u=c.childNodes,c.parentNode.removeChild(c)}u.nodeType?b.push(u):v.merge(b,u)}c&&(u=c=y=null);if(!v.support.appendChecked)for(s=0;(u=b[s])!=null;s++)v.nodeName(u,"input")?_t(u):typeof u.getElementsByTagName!="undefined"&&v.grep(u.getElementsByTagName("input"),_t);if(n){m=function(e){if(!e.type||xt.test(e.type))return r?r.push(e.parentNode?e.parentNode.removeChild(e):e):n.appendChild(e)};for(s=0;(u=b[s])!=null;s++)if(!v.nodeName(u,"script")||!m(u))n.appendChild(u),typeof u.getElementsByTagName!="undefined"&&(g=v.grep(v.merge([],u.getElementsByTagName("script")),m),b.splice.apply(b,[s+1,0].concat(g)),s+=g.length)}return b},cleanData:function(e,t){var n,r,i,s,o=0,u=v.expando,a=v.cache,f=v.support.deleteExpando,l=v.event.special;for(;(i=e[o])!=null;o++)if(t||v.acceptData(i)){r=i[u],n=r&&a[r];if(n){if(n.events)for(s in n.events)l[s]?v.event.remove(i,s):v.removeEvent(i,s,n.handle);a[r]&&(delete a[r],f?delete i[u]:i.removeAttribute?i.removeAttribute(u):i[u]=null,v.deletedIds.push(r))}}}}),function(){var e,t;v.uaMatch=function(e){e=e.toLowerCase();var t=/(chrome)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||e.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[];return{browser:t[1]||"",version:t[2]||"0"}},e=v.uaMatch(o.userAgent),t={},e.browser&&(t[e.browser]=!0,t.version=e.version),t.chrome?t.webkit=!0:t.webkit&&(t.safari=!0),v.browser=t,v.sub=function(){function e(t,n){return new e.fn.init(t,n)}v.extend(!0,e,this),e.superclass=this,e.fn=e.prototype=this(),e.fn.constructor=e,e.sub=this.sub,e.fn.init=function(r,i){return i&&i instanceof v&&!(i instanceof e)&&(i=e(i)),v.fn.init.call(this,r,i,t)},e.fn.init.prototype=e.fn;var t=e(i);return e}}();var Dt,Pt,Ht,Bt=/alpha\([^)]*\)/i,jt=/opacity=([^)]*)/,Ft=/^(top|right|bottom|left)$/,It=/^(none|table(?!-c[ea]).+)/,qt=/^margin/,Rt=new RegExp("^("+m+")(.*)$","i"),Ut=new RegExp("^("+m+")(?!px)[a-z%]+$","i"),zt=new RegExp("^([-+])=("+m+")","i"),Wt={BODY:"block"},Xt={position:"absolute",visibility:"hidden",display:"block"},Vt={letterSpacing:0,fontWeight:400},$t=["Top","Right","Bottom","Left"],Jt=["Webkit","O","Moz","ms"],Kt=v.fn.toggle;v.fn.extend({css:function(e,n){return v.access(this,function(e,n,r){return r!==t?v.style(e,n,r):v.css(e,n)},e,n,arguments.length>1)},show:function(){return Yt(this,!0)},hide:function(){return Yt(this)},toggle:function(e,t){var n=typeof e=="boolean";return v.isFunction(e)&&v.isFunction(t)?Kt.apply(this,arguments):this.each(function(){(n?e:Gt(this))?v(this).show():v(this).hide()})}}),v.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Dt(e,"opacity");return n===""?"1":n}}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":v.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(!e||e.nodeType===3||e.nodeType===8||!e.style)return;var s,o,u,a=v.camelCase(n),f=e.style;n=v.cssProps[a]||(v.cssProps[a]=Qt(f,a)),u=v.cssHooks[n]||v.cssHooks[a];if(r===t)return u&&"get"in u&&(s=u.get(e,!1,i))!==t?s:f[n];o=typeof r,o==="string"&&(s=zt.exec(r))&&(r=(s[1]+1)*s[2]+parseFloat(v.css(e,n)),o="number");if(r==null||o==="number"&&isNaN(r))return;o==="number"&&!v.cssNumber[a]&&(r+="px");if(!u||!("set"in u)||(r=u.set(e,r,i))!==t)try{f[n]=r}catch(l){}},css:function(e,n,r,i){var s,o,u,a=v.camelCase(n);return n=v.cssProps[a]||(v.cssProps[a]=Qt(e.style,a)),u=v.cssHooks[n]||v.cssHooks[a],u&&"get"in u&&(s=u.get(e,!0,i)),s===t&&(s=Dt(e,n)),s==="normal"&&n in Vt&&(s=Vt[n]),r||i!==t?(o=parseFloat(s),r||v.isNumeric(o)?o||0:s):s},swap:function(e,t,n){var r,i,s={};for(i in t)s[i]=e.style[i],e.style[i]=t[i];r=n.call(e);for(i in t)e.style[i]=s[i];return r}}),e.getComputedStyle?Dt=function(t,n){var r,i,s,o,u=e.getComputedStyle(t,null),a=t.style;return u&&(r=u.getPropertyValue(n)||u[n],r===""&&!v.contains(t.ownerDocument,t)&&(r=v.style(t,n)),Ut.test(r)&&qt.test(n)&&(i=a.width,s=a.minWidth,o=a.maxWidth,a.minWidth=a.maxWidth=a.width=r,r=u.width,a.width=i,a.minWidth=s,a.maxWidth=o)),r}:i.documentElement.currentStyle&&(Dt=function(e,t){var n,r,i=e.currentStyle&&e.currentStyle[t],s=e.style;return i==null&&s&&s[t]&&(i=s[t]),Ut.test(i)&&!Ft.test(t)&&(n=s.left,r=e.runtimeStyle&&e.runtimeStyle.left,r&&(e.runtimeStyle.left=e.currentStyle.left),s.left=t==="fontSize"?"1em":i,i=s.pixelLeft+"px",s.left=n,r&&(e.runtimeStyle.left=r)),i===""?"auto":i}),v.each(["height","width"],function(e,t){v.cssHooks[t]={get:function(e,n,r){if(n)return e.offsetWidth===0&&It.test(Dt(e,"display"))?v.swap(e,Xt,function(){return tn(e,t,r)}):tn(e,t,r)},set:function(e,n,r){return Zt(e,n,r?en(e,t,r,v.support.boxSizing&&v.css(e,"boxSizing")==="border-box"):0)}}}),v.support.opacity||(v.cssHooks.opacity={get:function(e,t){return jt.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=v.isNumeric(t)?"alpha(opacity="+t*100+")":"",s=r&&r.filter||n.filter||"";n.zoom=1;if(t>=1&&v.trim(s.replace(Bt,""))===""&&n.removeAttribute){n.removeAttribute("filter");if(r&&!r.filter)return}n.filter=Bt.test(s)?s.replace(Bt,i):s+" "+i}}),v(function(){v.support.reliableMarginRight||(v.cssHooks.marginRight={get:function(e,t){return v.swap(e,{display:"inline-block"},function(){if(t)return Dt(e,"marginRight")})}}),!v.support.pixelPosition&&v.fn.position&&v.each(["top","left"],function(e,t){v.cssHooks[t]={get:function(e,n){if(n){var r=Dt(e,t);return Ut.test(r)?v(e).position()[t]+"px":r}}}})}),v.expr&&v.expr.filters&&(v.expr.filters.hidden=function(e){return e.offsetWidth===0&&e.offsetHeight===0||!v.support.reliableHiddenOffsets&&(e.style&&e.style.display||Dt(e,"display"))==="none"},v.expr.filters.visible=function(e){return!v.expr.filters.hidden(e)}),v.each({margin:"",padding:"",border:"Width"},function(e,t){v.cssHooks[e+t]={expand:function(n){var r,i=typeof n=="string"?n.split(" "):[n],s={};for(r=0;r<4;r++)s[e+$t[r]+t]=i[r]||i[r-2]||i[0];return s}},qt.test(e)||(v.cssHooks[e+t].set=Zt)});var rn=/%20/g,sn=/\[\]$/,on=/\r?\n/g,un=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,an=/^(?:select|textarea)/i;v.fn.extend({serialize:function(){return v.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?v.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||an.test(this.nodeName)||un.test(this.type))}).map(function(e,t){var n=v(this).val();return n==null?null:v.isArray(n)?v.map(n,function(e,n){return{name:t.name,value:e.replace(on,"\r\n")}}):{name:t.name,value:n.replace(on,"\r\n")}}).get()}}),v.param=function(e,n){var r,i=[],s=function(e,t){t=v.isFunction(t)?t():t==null?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};n===t&&(n=v.ajaxSettings&&v.ajaxSettings.traditional);if(v.isArray(e)||e.jquery&&!v.isPlainObject(e))v.each(e,function(){s(this.name,this.value)});else for(r in e)fn(r,e[r],n,s);return i.join("&").replace(rn,"+")};var ln,cn,hn=/#.*$/,pn=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,dn=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,vn=/^(?:GET|HEAD)$/,mn=/^\/\//,gn=/\?/,yn=/)<[^<]*)*<\/script>/gi,bn=/([?&])_=[^&]*/,wn=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,En=v.fn.load,Sn={},xn={},Tn=["*/"]+["*"];try{cn=s.href}catch(Nn){cn=i.createElement("a"),cn.href="",cn=cn.href}ln=wn.exec(cn.toLowerCase())||[],v.fn.load=function(e,n,r){if(typeof e!="string"&&En)return En.apply(this,arguments);if(!this.length)return this;var i,s,o,u=this,a=e.indexOf(" ");return a>=0&&(i=e.slice(a,e.length),e=e.slice(0,a)),v.isFunction(n)?(r=n,n=t):n&&typeof n=="object"&&(s="POST"),v.ajax({url:e,type:s,dataType:"html",data:n,complete:function(e,t){r&&u.each(r,o||[e.responseText,t,e])}}).done(function(e){o=arguments,u.html(i?v("
").append(e.replace(yn,"")).find(i):e)}),this},v.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(e,t){v.fn[t]=function(e){return this.on(t,e)}}),v.each(["get","post"],function(e,n){v[n]=function(e,r,i,s){return v.isFunction(r)&&(s=s||i,i=r,r=t),v.ajax({type:n,url:e,data:r,success:i,dataType:s})}}),v.extend({getScript:function(e,n){return v.get(e,t,n,"script")},getJSON:function(e,t,n){return v.get(e,t,n,"json")},ajaxSetup:function(e,t){return t?Ln(e,v.ajaxSettings):(t=e,e=v.ajaxSettings),Ln(e,t),e},ajaxSettings:{url:cn,isLocal:dn.test(ln[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":Tn},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":e.String,"text html":!0,"text json":v.parseJSON,"text xml":v.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:Cn(Sn),ajaxTransport:Cn(xn),ajax:function(e,n){function T(e,n,s,a){var l,y,b,w,S,T=n;if(E===2)return;E=2,u&&clearTimeout(u),o=t,i=a||"",x.readyState=e>0?4:0,s&&(w=An(c,x,s));if(e>=200&&e<300||e===304)c.ifModified&&(S=x.getResponseHeader("Last-Modified"),S&&(v.lastModified[r]=S),S=x.getResponseHeader("Etag"),S&&(v.etag[r]=S)),e===304?(T="notmodified",l=!0):(l=On(c,w),T=l.state,y=l.data,b=l.error,l=!b);else{b=T;if(!T||e)T="error",e<0&&(e=0)}x.status=e,x.statusText=(n||T)+"",l?d.resolveWith(h,[y,T,x]):d.rejectWith(h,[x,T,b]),x.statusCode(g),g=t,f&&p.trigger("ajax"+(l?"Success":"Error"),[x,c,l?y:b]),m.fireWith(h,[x,T]),f&&(p.trigger("ajaxComplete",[x,c]),--v.active||v.event.trigger("ajaxStop"))}typeof e=="object"&&(n=e,e=t),n=n||{};var r,i,s,o,u,a,f,l,c=v.ajaxSetup({},n),h=c.context||c,p=h!==c&&(h.nodeType||h instanceof v)?v(h):v.event,d=v.Deferred(),m=v.Callbacks("once memory"),g=c.statusCode||{},b={},w={},E=0,S="canceled",x={readyState:0,setRequestHeader:function(e,t){if(!E){var n=e.toLowerCase();e=w[n]=w[n]||e,b[e]=t}return this},getAllResponseHeaders:function(){return E===2?i:null},getResponseHeader:function(e){var n;if(E===2){if(!s){s={};while(n=pn.exec(i))s[n[1].toLowerCase()]=n[2]}n=s[e.toLowerCase()]}return n===t?null:n},overrideMimeType:function(e){return E||(c.mimeType=e),this},abort:function(e){return e=e||S,o&&o.abort(e),T(0,e),this}};d.promise(x),x.success=x.done,x.error=x.fail,x.complete=m.add,x.statusCode=function(e){if(e){var t;if(E<2)for(t in e)g[t]=[g[t],e[t]];else t=e[x.status],x.always(t)}return this},c.url=((e||c.url)+"").replace(hn,"").replace(mn,ln[1]+"//"),c.dataTypes=v.trim(c.dataType||"*").toLowerCase().split(y),c.crossDomain==null&&(a=wn.exec(c.url.toLowerCase()),c.crossDomain=!(!a||a[1]===ln[1]&&a[2]===ln[2]&&(a[3]||(a[1]==="http:"?80:443))==(ln[3]||(ln[1]==="http:"?80:443)))),c.data&&c.processData&&typeof c.data!="string"&&(c.data=v.param(c.data,c.traditional)),kn(Sn,c,n,x);if(E===2)return x;f=c.global,c.type=c.type.toUpperCase(),c.hasContent=!vn.test(c.type),f&&v.active++===0&&v.event.trigger("ajaxStart");if(!c.hasContent){c.data&&(c.url+=(gn.test(c.url)?"&":"?")+c.data,delete c.data),r=c.url;if(c.cache===!1){var N=v.now(),C=c.url.replace(bn,"$1_="+N);c.url=C+(C===c.url?(gn.test(c.url)?"&":"?")+"_="+N:"")}}(c.data&&c.hasContent&&c.contentType!==!1||n.contentType)&&x.setRequestHeader("Content-Type",c.contentType),c.ifModified&&(r=r||c.url,v.lastModified[r]&&x.setRequestHeader("If-Modified-Since",v.lastModified[r]),v.etag[r]&&x.setRequestHeader("If-None-Match",v.etag[r])),x.setRequestHeader("Accept",c.dataTypes[0]&&c.accepts[c.dataTypes[0]]?c.accepts[c.dataTypes[0]]+(c.dataTypes[0]!=="*"?", "+Tn+"; q=0.01":""):c.accepts["*"]);for(l in c.headers)x.setRequestHeader(l,c.headers[l]);if(!c.beforeSend||c.beforeSend.call(h,x,c)!==!1&&E!==2){S="abort";for(l in{success:1,error:1,complete:1})x[l](c[l]);o=kn(xn,c,n,x);if(!o)T(-1,"No Transport");else{x.readyState=1,f&&p.trigger("ajaxSend",[x,c]),c.async&&c.timeout>0&&(u=setTimeout(function(){x.abort("timeout")},c.timeout));try{E=1,o.send(b,T)}catch(k){if(!(E<2))throw k;T(-1,k)}}return x}return x.abort()},active:0,lastModified:{},etag:{}});var Mn=[],_n=/\?/,Dn=/(=)\?(?=&|$)|\?\?/,Pn=v.now();v.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Mn.pop()||v.expando+"_"+Pn++;return this[e]=!0,e}}),v.ajaxPrefilter("json jsonp",function(n,r,i){var s,o,u,a=n.data,f=n.url,l=n.jsonp!==!1,c=l&&Dn.test(f),h=l&&!c&&typeof a=="string"&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&Dn.test(a);if(n.dataTypes[0]==="jsonp"||c||h)return s=n.jsonpCallback=v.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,o=e[s],c?n.url=f.replace(Dn,"$1"+s):h?n.data=a.replace(Dn,"$1"+s):l&&(n.url+=(_n.test(f)?"&":"?")+n.jsonp+"="+s),n.converters["script json"]=function(){return u||v.error(s+" was not called"),u[0]},n.dataTypes[0]="json",e[s]=function(){u=arguments},i.always(function(){e[s]=o,n[s]&&(n.jsonpCallback=r.jsonpCallback,Mn.push(s)),u&&v.isFunction(o)&&o(u[0]),u=o=t}),"script"}),v.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(e){return v.globalEval(e),e}}}),v.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),v.ajaxTransport("script",function(e){if(e.crossDomain){var n,r=i.head||i.getElementsByTagName("head")[0]||i.documentElement;return{send:function(s,o){n=i.createElement("script"),n.async="async",e.scriptCharset&&(n.charset=e.scriptCharset),n.src=e.url,n.onload=n.onreadystatechange=function(e,i){if(i||!n.readyState||/loaded|complete/.test(n.readyState))n.onload=n.onreadystatechange=null,r&&n.parentNode&&r.removeChild(n),n=t,i||o(200,"success")},r.insertBefore(n,r.firstChild)},abort:function(){n&&n.onload(0,1)}}}});var Hn,Bn=e.ActiveXObject?function(){for(var e in Hn)Hn[e](0,1)}:!1,jn=0;v.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&Fn()||In()}:Fn,function(e){v.extend(v.support,{ajax:!!e,cors:!!e&&"withCredentials"in e})}(v.ajaxSettings.xhr()),v.support.ajax&&v.ajaxTransport(function(n){if(!n.crossDomain||v.support.cors){var r;return{send:function(i,s){var o,u,a=n.xhr();n.username?a.open(n.type,n.url,n.async,n.username,n.password):a.open(n.type,n.url,n.async);if(n.xhrFields)for(u in n.xhrFields)a[u]=n.xhrFields[u];n.mimeType&&a.overrideMimeType&&a.overrideMimeType(n.mimeType),!n.crossDomain&&!i["X-Requested-With"]&&(i["X-Requested-With"]="XMLHttpRequest");try{for(u in i)a.setRequestHeader(u,i[u])}catch(f){}a.send(n.hasContent&&n.data||null),r=function(e,i){var u,f,l,c,h;try{if(r&&(i||a.readyState===4)){r=t,o&&(a.onreadystatechange=v.noop,Bn&&delete Hn[o]);if(i)a.readyState!==4&&a.abort();else{u=a.status,l=a.getAllResponseHeaders(),c={},h=a.responseXML,h&&h.documentElement&&(c.xml=h);try{c.text=a.responseText}catch(p){}try{f=a.statusText}catch(p){f=""}!u&&n.isLocal&&!n.crossDomain?u=c.text?200:404:u===1223&&(u=204)}}}catch(d){i||s(-1,d)}c&&s(u,f,c,l)},n.async?a.readyState===4?setTimeout(r,0):(o=++jn,Bn&&(Hn||(Hn={},v(e).unload(Bn)),Hn[o]=r),a.onreadystatechange=r):r()},abort:function(){r&&r(0,1)}}}});var qn,Rn,Un=/^(?:toggle|show|hide)$/,zn=new RegExp("^(?:([-+])=|)("+m+")([a-z%]*)$","i"),Wn=/queueHooks$/,Xn=[Gn],Vn={"*":[function(e,t){var n,r,i=this.createTween(e,t),s=zn.exec(t),o=i.cur(),u=+o||0,a=1,f=20;if(s){n=+s[2],r=s[3]||(v.cssNumber[e]?"":"px");if(r!=="px"&&u){u=v.css(i.elem,e,!0)||n||1;do a=a||".5",u/=a,v.style(i.elem,e,u+r);while(a!==(a=i.cur()/o)&&a!==1&&--f)}i.unit=r,i.start=u,i.end=s[1]?u+(s[1]+1)*n:n}return i}]};v.Animation=v.extend(Kn,{tweener:function(e,t){v.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");var n,r=0,i=e.length;for(;r-1,f={},l={},c,h;a?(l=i.position(),c=l.top,h=l.left):(c=parseFloat(o)||0,h=parseFloat(u)||0),v.isFunction(t)&&(t=t.call(e,n,s)),t.top!=null&&(f.top=t.top-s.top+c),t.left!=null&&(f.left=t.left-s.left+h),"using"in t?t.using.call(e,f):i.css(f)}},v.fn.extend({position:function(){if(!this[0])return;var e=this[0],t=this.offsetParent(),n=this.offset(),r=er.test(t[0].nodeName)?{top:0,left:0}:t.offset();return n.top-=parseFloat(v.css(e,"marginTop"))||0,n.left-=parseFloat(v.css(e,"marginLeft"))||0,r.top+=parseFloat(v.css(t[0],"borderTopWidth"))||0,r.left+=parseFloat(v.css(t[0],"borderLeftWidth"))||0,{top:n.top-r.top,left:n.left-r.left}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||i.body;while(e&&!er.test(e.nodeName)&&v.css(e,"position")==="static")e=e.offsetParent;return e||i.body})}}),v.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r=/Y/.test(n);v.fn[e]=function(i){return v.access(this,function(e,i,s){var o=tr(e);if(s===t)return o?n in o?o[n]:o.document.documentElement[i]:e[i];o?o.scrollTo(r?v(o).scrollLeft():s,r?s:v(o).scrollTop()):e[i]=s},e,i,arguments.length,null)}}),v.each({Height:"height",Width:"width"},function(e,n){v.each({padding:"inner"+e,content:n,"":"outer"+e},function(r,i){v.fn[i]=function(i,s){var o=arguments.length&&(r||typeof i!="boolean"),u=r||(i===!0||s===!0?"margin":"border");return v.access(this,function(n,r,i){var s;return v.isWindow(n)?n.document.documentElement["client"+e]:n.nodeType===9?(s=n.documentElement,Math.max(n.body["scroll"+e],s["scroll"+e],n.body["offset"+e],s["offset"+e],s["client"+e])):i===t?v.css(n,r,i,u):v.style(n,r,i,u)},n,o?i:t,o,null)}})}),e.jQuery=e.$=v,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return v})})(window); \ No newline at end of file diff --git a/lib/report/assets/scripts/vendor/jquery.fittext.js b/lib/report/assets/scripts/vendor/jquery.fittext.js new file mode 100755 index 0000000..2a482db --- /dev/null +++ b/lib/report/assets/scripts/vendor/jquery.fittext.js @@ -0,0 +1,43 @@ +/*global jQuery */ +/*! + * FitText.js 1.1 + * + * Copyright 2011, Dave Rupert http://daverupert.com + * Released under the WTFPL license + * http://sam.zoy.org/wtfpl/ + * + * Date: Thu May 05 14:23:00 2011 -0600 + */ + +(function( $ ){ + + $.fn.fitText = function( kompressor, options ) { + + // Setup options + var compressor = kompressor || 1, + settings = $.extend({ + 'minFontSize' : Number.NEGATIVE_INFINITY, + 'maxFontSize' : Number.POSITIVE_INFINITY + }, options); + + return this.each(function(){ + + // Store the object + var $this = $(this); + + // Resizer() resizes items based on the object width divided by the compressor * 10 + var resizer = function () { + $this.css('font-size', Math.max(Math.min($this.width() / (compressor*10), parseFloat(settings.maxFontSize)), parseFloat(settings.minFontSize))); + }; + + // Call once to set. + resizer(); + + // Call on resize. Opera debounces their resize by default. + $(window).on('resize', resizer); + + }); + + }; + +})( jQuery ); \ No newline at end of file diff --git a/lib/report/assets/scripts/vendor/lodash.min.js b/lib/report/assets/scripts/vendor/lodash.min.js new file mode 100755 index 0000000..40126c4 --- /dev/null +++ b/lib/report/assets/scripts/vendor/lodash.min.js @@ -0,0 +1,42 @@ +/*! + Lo-Dash 1.0.0-rc.3 lodash.com/license + Underscore.js 1.4.3 underscorejs.org/LICENSE +*/ +;(function(e,t){function n(e){if(e&&typeof e=="object"&&e.__wrapped__)return e;if(!(this instanceof n))return new n(e);this.__wrapped__=e}function r(e,t,n){t||(t=0);var r=e.length,i=r-t>=(n||tt);if(i)for(var s={},n=t-1;++nt||typeof e=="undefined")return 1;if( +ei;i++)r+="i='"+e.j[i]+"';if(","constructor"==e.j[i]&&(r+="!(f&&f.prototype===l)&&"),r+="h.call(l,i)){"+e.g+"}"}if(e.b||e.h)r+="}";return r+=e.c+";return t" +,n("e,h,j,k,p,n,s","return function("+t+"){"+r+"}")(u,Et,v,N,nn,At,xt)}function f(e){return"\\"+rn[e]}function l(e){return hn[e]}function c(e){return typeof e.toString!="function"&&typeof (e+"")=="string"}function h(){}function p(e,t,n){t||(t=0),typeof n=="undefined"&&(n=e?e.length:0);for(var r=-1,n=n-t||0,i=Array(0>n?0:n);++rn?Ot(0,i+n):n)||0;return typeof i=="number"?s=-1<(N(e)?e.indexOf(t,n):R(e,t,n)):an(e,function(e){if(++r>=n)return!(s=e===t)}),s} +function A(e,t,n){var r=!0,t=u(t,n);if(vn(e))for(var n=-1,i=e.length;++nr&&(r=n,a=e)});else for(;++sa&&(a=e[s]);return a}function H(e,t){return D(e,t+"")}function B(e,t,n,r){var i=3>arguments.length,t=u(t,r,et);if(vn(e)){var s=-1,o= +e.length;for(i&&(n=e[++s]);++sarguments.length;if(typeof s!="number")var a=gn(e),s=a.length;else Gt&&N(e)&&(i=e.split(""));return t=u(t,r,et),_(e,function(e,r,u){r=a?a[--s]:--s,n=o?(o=!1,i[r]):t(n,i[r],r,u)}),n}function F(e,t,n){var r,t=u(t,n);if(vn(e))for(var n=-1,i=e.length;++nn?Ot(0,i+n):n||0)-1;else if(n)return r=z(e,t),e[r]===t?r:-1;for(;++r>>1,n(e[r])R(a,c))(n||f)&&a.push(c),o.push(r)}return o}function X(e,t){return zt||Nt&&2|{(\/]|\[\D|\b(?:delete|in|instanceof|new|typeof|void)\b/,it=/&(?:amp|lt|gt|quot|#x27);/g,st=/\b__p\+='';/g,ot=/\b(__p\+=)''\+/g,ut=/(__e\(.*?\)|\b__t\))\+'';/g,at=/\w*$/,ft=/(?:__e|__t=)\(\s*(?![\d\s"']|this\.)/g +,lt=RegExp("^"+(Y.valueOf+"").replace(/[.*+?^=!:${}()|[\]\/\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),ct=/\$\{((?:(?=\\?)\\?[\s\S])*?)}/g,ht=/<%=([\s\S]+?)%>/g,pt=/($^)/,dt=/[&<>"']/g,vt=/['\n\r\t\u2028\u2029\\]/g,mt="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),gt=Math.ceil,yt=G.concat,bt=Math.floor,wt=lt.test(wt=Object.getPrototypeOf)&&wt,Et=Y.hasOwnProperty,St=G.push,xt=Y.propertyIsEnumerable,Tt=Y.toString,Nt=lt.test(Nt= +p.bind)&&Nt,Ct=lt.test(Ct=Array.isArray)&&Ct,kt=e.isFinite,Lt=e.isNaN,At=lt.test(At=Object.keys)&&At,Ot=Math.max,Mt=Math.min,_t=Math.random,Dt="[object Arguments]",Pt="[object Array]",Ht="[object Boolean]",Bt="[object Date]",jt="[object Number]",Ft="[object Object]",It="[object RegExp]",qt="[object String]",Rt=!!e.attachEvent,Ut=Nt&&!/\n|true/.test(Nt+Rt),zt=Nt&&!Ut,Wt=At&&(Rt||Ut),Xt,Vt,$t=($t={0:1,length:1},G.splice.call($t,0,1),$t[0]),Jt=!0;(function(){function e(){this.x=1}var t=[];e.prototype= +{valueOf:1,y:1};for(var n in new e)t.push(n);for(n in arguments)Jt=!n;Xt=!/valueOf/.test(t),Vt="x"!=t[0]})(1);var Kt=arguments.constructor==Object,Qt=!v(arguments),Gt="xx"!="x"[0]+Object("x")[0];try{var Yt=("[object Object]",Tt.call(document)==Ft)}catch(Zt){}var en={"[object Function]":!1};en[Dt]=en[Pt]=en[Ht]=en[Bt]=en[jt]=en[Ft]=en[It]=en[qt]=!0;var tn={};tn[Pt]=Array,tn[Ht]=Boolean,tn[Bt]=Date,tn[Ft]=Object,tn[jt]=Number,tn[It]=RegExp,tn[qt]=String;var nn={"boolean":!1,"function":!0,object:!0, +number:!1,string:!1,"undefined":!1},rn={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"};n.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:ht,variable:""};var sn={a:"o,v,g",k:"for(var a=1,b=typeof g=='number'?2:arguments.length;a":">",'"':""","'":"'"},pn=w(hn),dn=a(sn,{g:"if(t[i]==null)"+sn.g}),vn=Ct||function(e){return Kt&&e instanceof Array||Tt.call(e)==Pt};S(/x/)&&(S=function(e){return e instanceof Function||"[object Function]"==Tt.call(e)});var mn=wt?function(e){if(!e||typeof e!="object")return!1;var t=e.valueOf,n=typeof t=="function"&&(n=wt(t))&&wt(n);return n?e==n||wt(e)==n&&!v(e):m(e) +}:m,gn=At?function(e){return typeof e=="function"&&xt.call(e,"prototype")?g(e):x(e)?At(e):[]}:g;n.after=function(e,t){return 1>e?t():function(){if(1>--e)return t.apply(this,arguments)}},n.assign=fn,n.bind=X,n.bindAll=function(e){for(var t=arguments,n=1R(f,l)){u&&f.push(l);for(var h=n;--h;)if(!(i[h]||(i[h]=r(t[h],0,100)))(l))continue e;a.push(l)}}return a},n.invert=w,n.invoke=function(e,t){var n=p(arguments,2),r=typeof t=="function",i=[];return _(e,function(e){i.push((r?t:e[t]).apply(e,n))}),i},n.keys=gn,n.map=D, +n.max=P,n.memoize=function(e,t){var n={};return function(){var r=t?t.apply(this,arguments):arguments[0];return Et.call(n,r)?n[r]:n[r]=e.apply(this,arguments)}},n.merge=C,n.min=function(e,t,n){var r=Infinity,s=-1,o=e?e.length:0,a=r;if(t||!vn(e))t=!t&&N(e)?i:u(t,n),an(e,function(e,n,i){n=t(e,n,i),nR(s,n,1))i[n]=e}),i},n.once=function(e){var t,n=!1;return function(){return n?t:(n=!0,t=e.apply(this,arguments),e=null,t)}},n.pairs=function(e){var t=[];return cn(e,function(e,n){t.push([n,e])}),t},n.partial=function(e){return o(e,p(arguments,1))},n.pick=function(e,t,n){var r={};if(typeof t!="function")for(var i=0,s=yt.apply(G,arguments),o=s.length;++i=f?(clearTimeout(o),o=null,u=a,i=e.apply(s,r)):o||(o=setTimeout(n,f)),i}},n.times=function(e,t,n){for(var e=+e||0,r=-1,i=Array(e);++rn?Ot(0,r+n):Mt(n,r-1))+1);r--;)if(e[r]===t)return r;return-1},n.mixin=$,n.noConflict=function(){return e._=nt,this},n.random=function(e,t){return null==e&&null==t&&(t=1),e=+e||0,null==t&&(t=e,e=0),e+bt(_t()*((+t||0)-e+1))},n.reduce=B,n.reduceRight=j,n.result=function(e,t){var n=e?e[t]:null;return S(n)?e[t]():n},n.size=function(e){var t=e?e.length:0; +return typeof t=="number"?t:gn(e).length},n.some=F,n.sortedIndex=z,n.template=function(e,t,r){e||(e=""),r||(r={});var i,s,o=n.templateSettings,u=0,a=r.interpolate||o.interpolate||pt,l="__p+='",c=r.variable||o.variable,h=c;e.replace(RegExp((r.escape||o.escape||pt).source+"|"+a.source+"|"+(a===ht?ct:pt).source+"|"+(r.evaluate||o.evaluate||pt).source+"|$","g"),function(t,n,r,s,o,a){return r||(r=s),l+=e.slice(u,a).replace(vt,f),n&&(l+="'+__e("+n+")+'"),o&&(l+="';"+o+";__p+='"),r&&(l+="'+((__t=("+r+"))==null?'':__t)+'" +),i||(i=o||rt.test(n||r)),u=a+t.length,t}),l+="';\n",h||(c="obj",i?l="with("+c+"){"+l+"}":(r=RegExp("(\\(\\s*)"+c+"\\."+c+"\\b","g"),l=l.replace(ft,"$&"+c+".").replace(r,"$1__d"))),l=(i?l.replace(st,""):l).replace(ot,"$1").replace(ut,"$1;"),l="function("+c+"){"+(h?"":c+"||("+c+"={});")+"var __t,__p='',__e=_.escape"+(i?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":(h?"":",__d="+c+"."+c+"||"+c)+";")+l+"return __p}";try{s=Function("_","return "+l)(n)}catch(p){throw p.source= +l,p}return t?s(t):(s.source=l,s)},n.unescape=function(e){return null==e?"":(e+"").replace(it,d)},n.uniqueId=function(e){return(null==e?"":e+"")+ ++Z},n.all=A,n.any=F,n.detect=M,n.foldl=B,n.foldr=j,n.include=L,n.inject=B,cn(n,function(e,t){n.prototype[t]||(n.prototype[t]=function(){var t=[this.__wrapped__];return St.apply(t,arguments),e.apply(n,t)})}),n.first=I,n.last=function(e,t,n){if(e){var r=e.length;return null==t||n?e[r-1]:p(e,Ot(0,r-t))}},n.take=I,n.head=I,cn(n,function(e,t){n.prototype[t]|| +(n.prototype[t]=function(t,r){var i=e(this.__wrapped__,t,r);return null==t||r?i:new n(i)})}),n.VERSION="1.0.0-rc.3",n.prototype.toString=function(){return this.__wrapped__+""},n.prototype.value=J,n.prototype.valueOf=J,an(["join","pop","shift"],function(e){var t=G[e];n.prototype[e]=function(){return t.apply(this.__wrapped__,arguments)}}),an(["push","reverse","sort","unshift"],function(e){var t=G[e];n.prototype[e]=function(){return t.apply(this.__wrapped__,arguments),this}}),an(["concat","slice","splice" +],function(e){var t=G[e];n.prototype[e]=function(){var e=t.apply(this.__wrapped__,arguments);return new n(e)}}),$t&&an(["pop","shift","splice"],function(e){var t=G[e],r="splice"==e;n.prototype[e]=function(){var e=this.__wrapped__,i=t.apply(e,arguments);return 0===e.length&&delete e[0],r?new n(i):i}}),typeof define=="function"&&typeof define.amd=="object"&&define.amd?(e._=n,define(function(){return n})):K?typeof module=="object"&&module&&module.exports==K?(module.exports=n)._=n:K._=n:e._=n})(this); \ No newline at end of file diff --git a/lib/report/assets/scripts/vendor/morris.min.js b/lib/report/assets/scripts/vendor/morris.min.js new file mode 100755 index 0000000..54b5a2b --- /dev/null +++ b/lib/report/assets/scripts/vendor/morris.min.js @@ -0,0 +1 @@ +(function(){var e,t,n,r,i=[].slice,s={}.hasOwnProperty,o=function(e,t){function r(){this.constructor=e}for(var n in t)s.call(t,n)&&(e[n]=t[n]);return r.prototype=t.prototype,e.prototype=new r,e.__super__=t.prototype,e},u=function(e,t){return function(){return e.apply(t,arguments)}},a=[].indexOf||function(e){for(var t=0,n=this.length;tn.length&&(r+=i.slice(n.length)),r):"-"},t.pad2=function(e){return(e<10?"0":"")+e},t.Grid=function(n){function r(t){typeof t.element=="string"?this.el=e(document.getElementById(t.element)):this.el=e(t.element);if(this.el==null||this.el.length===0)throw new Error("Graph container element not found");this.options=e.extend({},this.gridDefaults,this.defaults||{},t);if(this.options.data===void 0||this.options.data.length===0)return;typeof this.options.units=="string"&&(this.options.postUnits=t.units),this.r=new Raphael(this.el[0]),this.elementWidth=null,this.elementHeight=null,this.dirty=!1,this.init&&this.init(),this.setData(this.options.data)}return o(r,n),r.prototype.gridDefaults={dateFormat:null,gridLineColor:"#aaa",gridStrokeWidth:.5,gridTextColor:"#888",gridTextSize:12,numLines:5,padding:25,parseTime:!0,postUnits:"",preUnits:"",ymax:"auto",ymin:"auto 0",goals:[],goalStrokeWidth:1,goalLineColors:["#666633","#999966","#cc6666","#663333"],events:[],eventStrokeWidth:1,eventLineColors:["#005a04","#ccffbb","#3a5f0b","#005502"]},r.prototype.setData=function(e,n){var r,i,s,o,u,a,f,l,c,h,p,d;n==null&&(n=!0),h=this.cumulative?0:null,p=this.cumulative?0:null,this.options.goals.length>0&&(u=Math.min.apply(null,this.options.goals),o=Math.max.apply(null,this.options.goals),p=p!=null?Math.min(p,u):u,h=h!=null?Math.max(h,o):o),this.data=function(){var n,r,o;o=[];for(s=n=0,r=e.length;nt.x)-(t.x>e.x)})),this.xmin=this.data[0].x,this.xmax=this.data[this.data.length-1].x,this.events=[],this.options.parseTime&&this.options.events.length>0&&(this.events=function(){var e,n,i,s;i=this.options.events,s=[];for(e=0,n=i.length;e5?(this.ymax=parseInt(this.options.ymax.slice(5),10),h!=null&&(this.ymax=Math.max(h,this.ymax))):this.ymax=h!=null?h:0:this.ymax=parseInt(this.options.ymax,10):this.ymax=this.options.ymax,typeof this.options.ymin=="string"?this.options.ymin.slice(0,4)==="auto"?this.options.ymin.length>5?(this.ymin=parseInt(this.options.ymin.slice(5),10),p!=null&&(this.ymin=Math.min(p,this.ymin))):this.ymin=p!==null?p:0:this.ymin=parseInt(this.options.ymin,10):this.ymin=this.options.ymin,this.ymin===this.ymax&&(p&&(this.ymin-=1),this.ymax+=1),this.yInterval=(this.ymax-this.ymin)/(this.options.numLines-1),this.yInterval>0&&this.yInterval<1?this.precision=-Math.floor(Math.log(this.yInterval)/Math.log(10)):this.precision=0,this.dirty=!0;if(n)return this.redraw()},r.prototype._calc=function(){var e,t,n;n=this.el.width(),e=this.el.height();if(this.elementWidth!==n||this.elementHeight!==e||this.dirty){this.elementWidth=n,this.elementHeight=e,this.dirty=!1,t=Math.max(this.measureText(this.yAxisFormat(this.ymin),this.options.gridTextSize).width,this.measureText(this.yAxisFormat(this.ymax),this.options.gridTextSize).width),this.left=t+this.options.padding,this.right=this.elementWidth-this.options.padding,this.top=this.options.padding,this.bottom=this.elementHeight-this.options.padding-1.5*this.options.gridTextSize,this.width=this.right-this.left,this.height=this.bottom-this.top,this.dx=this.width/(this.xmax-this.xmin),this.dy=this.height/(this.ymax-this.ymin);if(this.calc)return this.calc()}},r.prototype.transY=function(e){return this.bottom-(e-this.ymin)*this.dy},r.prototype.transX=function(e){return this.data.length===1?(this.left+this.right)/2:this.left+(e-this.xmin)*this.dx},r.prototype.redraw=function(){this.r.clear(),this._calc(),this.drawGrid(),this.drawGoals(),this.drawEvents();if(this.draw)return this.draw()},r.prototype.drawGoals=function(){var e,t,n,r,i,s;i=this.options.goals,s=[];for(t=n=0,r=i.length;n=t;n=s+=o)r=parseFloat(n.toFixed(this.precision)),i=this.transY(r),this.r.text(this.left-this.options.padding/2,i,this.yAxisFormat(r)).attr("font-size",this.options.gridTextSize).attr("fill",this.options.gridTextColor).attr("text-anchor","end"),u.push(this.r.path("M"+this.left+","+i+"H"+(this.left+this.width)).attr("stroke",this.options.gridLineColor).attr("stroke-width",this.options.gridStrokeWidth));return u},r.prototype.measureText=function(e,t){var n,r;return t==null&&(t=12),r=this.r.text(100,100,e).attr("font-size",t),n=r.getBBox(),r.remove(),n},r.prototype.yAxisFormat=function(e){return this.yLabelFormat(e)},r.prototype.yLabelFormat=function(e){return""+this.options.preUnits+t.commas(e)+this.options.postUnits},r}(t.EventEmitter),t.parseDate=function(e){var t,n,r,i,s,o,u,a,f,l,c;return typeof e=="number"?e:(n=e.match(/^(\d+) Q(\d)$/),i=e.match(/^(\d+)-(\d+)$/),s=e.match(/^(\d+)-(\d+)-(\d+)$/),u=e.match(/^(\d+) W(\d+)$/),a=e.match(/^(\d+)-(\d+)-(\d+)[ T](\d+):(\d+)(Z|([+-])(\d\d):?(\d\d))?$/),f=e.match(/^(\d+)-(\d+)-(\d+)[ T](\d+):(\d+):(\d+(\.\d+)?)(Z|([+-])(\d\d):?(\d\d))?$/),n?(new Date(parseInt(n[1],10),parseInt(n[2],10)*3-1,1)).getTime():i?(new Date(parseInt(i[1],10),parseInt(i[2],10)-1,1)).getTime():s?(new Date(parseInt(s[1],10),parseInt(s[2],10)-1,parseInt(s[3],10))).getTime():u?(l=new Date(parseInt(u[1],10),0,1),l.getDay()!==4&&l.setMonth(0,1+(4-l.getDay()+7)%7),l.getTime()+parseInt(u[2],10)*6048e5):a?a[6]?(o=0,a[6]!=="Z"&&(o=parseInt(a[8],10)*60+parseInt(a[9],10),a[7]==="+"&&(o=0-o)),Date.UTC(parseInt(a[1],10),parseInt(a[2],10)-1,parseInt(a[3],10),parseInt(a[4],10),parseInt(a[5],10)+o)):(new Date(parseInt(a[1],10),parseInt(a[2],10)-1,parseInt(a[3],10),parseInt(a[4],10),parseInt(a[5],10))).getTime():f?(c=parseFloat(f[6]),t=Math.floor(c),r=Math.round((c-t)*1e3),f[8]?(o=0,f[8]!=="Z"&&(o=parseInt(f[10],10)*60+parseInt(f[11],10),f[9]==="+"&&(o=0-o)),Date.UTC(parseInt(f[1],10),parseInt(f[2],10)-1,parseInt(f[3],10),parseInt(f[4],10),parseInt(f[5],10)+o,t,r)):(new Date(parseInt(f[1],10),parseInt(f[2],10)-1,parseInt(f[3],10),parseInt(f[4],10),parseInt(f[5],10),t,r)).getTime()):(new Date(parseInt(e,10),0,1)).getTime())},t.Line=function(e){function n(e){this.updateHilight=u(this.updateHilight,this),this.hilight=u(this.hilight,this),this.updateHover=u(this.updateHover,this);if(!(this instanceof t.Line))return new t.Line(e);n.__super__.constructor.call(this,e)}return o(n,e),n.prototype.init=function(){var e,t=this;return this.pointGrow=Raphael.animation({r:this.options.pointSize+3},25,"linear"),this.pointShrink=Raphael.animation({r:this.options.pointSize},25,"linear"),this.prevHilight=null,this.el.mousemove(function(e){return t.updateHilight(e.pageX)}),this.options.hideHover&&this.el.mouseout(function(e){return t.hilight(null)}),e=function(e){var n;return n=e.originalEvent.touches[0]||e.originalEvent.changedTouches[0],t.updateHilight(n.pageX),n},this.el.bind("touchstart",e),this.el.bind("touchmove",e),this.el.bind("touchend",e),this.el.bind("click",function(e){if(t.prevHilight!==null)return t.fire("click",t.prevHilight,t.data[t.prevHilight])})},n.prototype.defaults={lineWidth:3,pointSize:4,lineColors:["#0b62a4","#7A92A3","#4da74d","#afd8f8","#edc240","#cb4b4b","#9440ed"],pointWidths:[1],pointStrokeColors:["#ffffff"],pointFillColors:[],hoverPaddingX:10,hoverPaddingY:5,hoverMargin:10,hoverFillColor:"#fff",hoverBorderColor:"#ccc",hoverBorderWidth:2,hoverOpacity:.95,hoverLabelColor:"#444",hoverFontSize:12,smooth:!0,hideHover:!1,xLabels:"auto",xLabelFormat:null,continuousLine:!0},n.prototype.calc=function(){return this.calcPoints(),this.generatePaths(),this.calcHoverMargins()},n.prototype.calcPoints=function(){var e,t,n,r,i,s;i=this.data,s=[];for(n=0,r=i.length;nu;r=0<=u?++o:--o)s=this.options.smooth===!0||(f=this.options.ykeys[r],a.call(this.options.smooth,f)>=0),n=function(){var e,t,n,s;n=this.data,s=[];for(e=0,t=n.length;e1?l.push(t.Line.createPath(n,s,this.bottom)):l.push(null);return l}.call(this)},n.prototype.draw=function(){return this.drawXAxis(),this.drawSeries(),this.drawHover(),this.hilight(this.options.hideHover?null:this.data.length-1)},n.prototype.drawXAxis=function(){var e,n,r,i,s,o,u,a,f,l,c=this;u=this.bottom+this.options.gridTextSize*1.25,o=50,i=null,e=function(e,t){var n,r;return n=c.r.text(c.transX(t),u,e).attr("font-size",c.options.gridTextSize).attr("fill",c.options.gridTextColor),r=n.getBBox(),(i==null||i>=r.x+r.width)&&r.x>=0&&r.x+r.width=0;t=o<=0?++i:--i)n=this.paths[t],n!==null&&this.r.path(n).attr("stroke",this.colorForSeries(t)).attr("stroke-width",this.options.lineWidth);this.seriesPoints=function(){var e,n,r;r=[];for(t=e=0,n=this.options.ykeys.length;0<=n?en;t=0<=n?++e:--e)r.push([]);return r}.call(this),a=[];for(t=s=u=this.options.ykeys.length-1;u<=0?s<=0:s>=0;t=u<=0?++s:--s)a.push(function(){var n,i,s,o;s=this.data,o=[];for(n=0,i=s.length;ni;e=0<=i?++r:--r)t=this.cumulative?this.options.ykeys.length-e-1:e,n=this.r.text(0,this.options.hoverFontSize*1.5*(t+1.5)-this.hoverHeight/2,"").attr("fill",this.colorForSeries(e)).attr("font-size",this.options.hoverFontSize),this.yLabels.push(n),s.push(this.hoverSet.push(n));return s},n.prototype.updateHover=function(e){var t,n,r,i,s,o,u,a,f,l;this.hoverSet.show(),i=this.data[e],this.xLabel.attr("text",i.label),l=i.y;for(t=a=0,f=l.length;athis.hoverHeight+this.options.hoverPaddingY*2+this.options.hoverMargin+this.top?u=u-this.hoverHeight/2-this.options.hoverPaddingY-this.options.hoverMargin:u=u+this.hoverHeight/2+this.options.hoverPaddingY+this.options.hoverMargin,u=Math.max(this.top+this.hoverHeight/2+this.options.hoverPaddingY,u),u=Math.min(this.bottom-this.hoverHeight/2-this.options.hoverPaddingY,u),s=Math.min(this.right-r/2-this.options.hoverPaddingX,this.data[e]._x),s=Math.max(this.left+r/2+this.options.hoverPaddingX,s),this.hoverSet.attr("transform","t"+s+","+u)},n.prototype.hideHover=function(){return this.hoverSet.hide()},n.prototype.hilight=function(e){var t,n,r,i,s;if(this.prevHilight!==null&&this.prevHilight!==e)for(t=n=0,i=this.seriesPoints.length-1;0<=i?n<=i:n>=i;t=0<=i?++n:--n)this.seriesPoints[t][this.prevHilight]&&this.seriesPoints[t][this.prevHilight].animate(this.pointShrink);if(e!==null&&this.prevHilight!==e){for(t=r=0,s=this.seriesPoints.length-1;0<=s?r<=s:r>=s;t=0<=s?++r:--r)this.seriesPoints[t][e]&&this.seriesPoints[t][e].animate(this.pointGrow);this.updateHover(e)}this.prevHilight=e;if(e==null)return this.hideHover()},n.prototype.updateHilight=function(e){var t,n,r;e-=this.el.offset().left;for(t=n=0,r=this.hoverMargins.length;0<=r?nr;t=0<=r?++n:--n)if(this.hoverMargins[t]>e)break;return this.hilight(t)},n.prototype.colorForSeries=function(e){return this.options.lineColors[e%this.options.lineColors.length]},n.prototype.strokeWidthForSeries=function(e){return this.options.pointWidths[e%this.options.pointWidths.length]},n.prototype.strokeForSeries=function(e){return this.options.pointStrokeColors[e%this.options.pointStrokeColors.length]},n.prototype.pointFillColorForSeries=function(e){return this.options.pointFillColors[e%this.options.pointFillColors.length]},n}(t.Grid),t.labelSeries=function(n,r,i,s,o){var u,a,f,l,c,h,p,d,v,m,g;f=200*(r-n)/i,a=new Date(n),p=t.LABEL_SPECS[s];if(p===void 0){g=t.AUTO_LABEL_ORDER;for(v=0,m=g.length;v=h.span){p=h;break}}}p===void 0&&(p=t.LABEL_SPECS.second),o&&(p=e.extend({},p,{fmt:o})),u=p.start(a),c=[];while((d=u.getTime())<=r)d>=n&&c.push([p.fmt(u),d]),p.incr(u);return c},n=function(e){return{span:e*60*1e3,start:function(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours())},fmt:function(e){return""+t.pad2(e.getHours())+":"+t.pad2(e.getMinutes())},incr:function(t){return t.setMinutes(t.getMinutes()+e)}}},r=function(e){return{span:e*1e3,start:function(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes())},fmt:function(e){return""+t.pad2(e.getHours())+":"+t.pad2(e.getMinutes())+":"+t.pad2(e.getSeconds())},incr:function(t){return t.setSeconds(t.getSeconds()+e)}}},t.LABEL_SPECS={decade:{span:1728e8,start:function(e){return new Date(e.getFullYear()-e.getFullYear()%10,0,1)},fmt:function(e){return""+e.getFullYear()},incr:function(e){return e.setFullYear(e.getFullYear()+10)}},year:{span:1728e7,start:function(e){return new Date(e.getFullYear(),0,1)},fmt:function(e){return""+e.getFullYear()},incr:function(e){return e.setFullYear(e.getFullYear()+1)}},month:{span:24192e5,start:function(e){return new Date(e.getFullYear(),e.getMonth(),1)},fmt:function(e){return""+e.getFullYear()+"-"+t.pad2(e.getMonth()+1)},incr:function(e){return e.setMonth(e.getMonth()+1)}},day:{span:864e5,start:function(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())},fmt:function(e){return""+e.getFullYear()+"-"+t.pad2(e.getMonth()+1)+"-"+t.pad2(e.getDate())},incr:function(e){return e.setDate(e.getDate()+1)}},hour:n(60),"30min":n(30),"15min":n(15),"10min":n(10),"5min":n(5),minute:n(1),"30sec":r(30),"15sec":r(15),"10sec":r(10),"5sec":r(5),second:r(1)},t.AUTO_LABEL_ORDER=["decade","year","month","day","hour","30min","15min","10min","5min","minute","30sec","15sec","10sec","5sec","second"],t.Area=function(e){function n(e){if(!(this instanceof t.Area))return new t.Area(e);this.cumulative=!0,n.__super__.constructor.call(this,e)}return o(n,e),n.prototype.calcPoints=function(){var e,t,n,r,i,s,o;s=this.data,o=[];for(r=0,i=s.length;r=0;e=i<=0?++r:--r)t=this.paths[e],t!==null&&(t+="L"+this.transX(this.xmax)+","+this.bottom+"L"+this.transX(this.xmin)+","+this.bottom+"Z",this.r.path(t).attr("fill",this.fillForSeries(e)).attr("stroke-width",0));return n.__super__.drawSeries.call(this)},n.prototype.fillForSeries=function(e){var t;return t=Raphael.rgb2hsl(this.colorForSeries(e)),Raphael.hsl(t.h,Math.min(255,t.s*.75),Math.min(255,t.l*1.25))},n}(t.Line),t.Bar=function(n){function r(n){this.updateHilight=u(this.updateHilight,this),this.hilight=u(this.hilight,this),this.updateHover=u(this.updateHover,this);if(!(this instanceof t.Bar))return new t.Bar(n);r.__super__.constructor.call(this,e.extend({},n,{parseTime:!1}))}return o(r,n),r.prototype.init=function(){var e,t=this;return this.cumulative=this.options.stacked,this.prevHilight=null,this.el.mousemove(function(e){return t.updateHilight(e.pageX)}),this.options.hideHover&&this.el.mouseout(function(e){return t.hilight(null)}),e=function(e){var n;return n=e.originalEvent.touches[0]||e.originalEvent.changedTouches[0],t.updateHilight(n.pageX),n},this.el.bind("touchstart",e),this.el.bind("touchmove",e),this.el.bind("touchend",e),this.el.bind("click",function(e){if(t.prevHilight!==null)return t.fire("click",t.prevHilight,t.data[t.prevHilight])})},r.prototype.defaults={barSizeRatio:.75,barGap:3,barColors:["#0b62a4","#7a92a3","#4da74d","#afd8f8","#edc240","#cb4b4b","#9440ed"],hoverPaddingX:10,hoverPaddingY:5,hoverMargin:10,hoverFillColor:"#fff",hoverBorderColor:"#ccc",hoverBorderWidth:2,hoverOpacity:.95,hoverLabelColor:"#444",hoverFontSize:12,hideHover:!1},r.prototype.calc=function(){return this.calcBars(),this.calcHoverMargins()},r.prototype.calcBars=function(){var e,t,n,r,i,s,o;s=this.data,o=[];for(e=r=0,i=s.length;rn;e=1<=n?++t:--t)r.push(this.left+e*this.width/this.data.length);return r}.call(this)},r.prototype.draw=function(){return this.drawXAxis(),this.drawSeries(),this.drawHover(),this.hilight(this.options.hideHover?null:this.data.length-1)},r.prototype.drawXAxis=function(){var e,t,n,r,i,s,o,u,a,f;o=this.bottom+this.options.gridTextSize*1.25,s=50,r=null,f=[];for(e=u=0,a=this.data.length;0<=a?ua;e=0<=a?++u:--u)i=this.data[this.data.length-1-e],t=this.r.text(i._x,o,i.label).attr("font-size",this.options.gridTextSize).attr("fill",this.options.gridTextColor),n=t.getBBox(),(r==null||r>=n.x+n.width)&&n.x>=0&&n.x+n.width=0?this.transY(0):null,this.bars=function(){var u,d,v,m;v=this.data,m=[];for(r=u=0,d=v.length;ur;e=0<=r?++n:--n)t=this.r.text(0,this.options.hoverFontSize*1.5*(e+1.5)-this.hoverHeight/2,"").attr("font-size",this.options.hoverFontSize),this.yLabels.push(t),i.push(this.hoverSet.push(t));return i},r.prototype.updateHover=function(e){var t,n,r,i,s,o,u,a,f,l;this.hoverSet.show(),i=this.data[e],this.xLabel.attr("text",i.label),l=i.y;for(t=a=0,f=l.length;ar;t=0<=r?++n:--n)if(this.hoverMargins[t]>e)break;return this.hilight(t)},r.prototype.colorFor=function(e,t,n){var r,i;return typeof this.options.barColors=="function"?(r={x:e.x,y:e.y[t],label:e.label},i={index:t,key:this.options.ykeys[t],label:this.options.labels[t]},this.options.barColors.call(this,r,i,n)):this.options.barColors[t%this.options.barColors.length]},r}(t.Grid),t.Donut=function(n){function r(n){this.click=u(this.click,this),this.select=u(this.select,this);if(!(this instanceof t.Donut))return new t.Donut(n);typeof n.element=="string"?this.el=e(document.getElementById(n.element)):this.el=e(n.element),this.options=e.extend({},this.defaults,n);if(this.el===null||this.el.length===0)throw new Error("Graph placeholder not found.");if(n.data===void 0||n.data.length===0)return;this.data=n.data,this.redraw()}return o(r,n),r.prototype.defaults={colors:["#0B62A4","#3980B5","#679DC6","#95BBD7","#B0CCE1","#095791","#095085","#083E67","#052C48","#042135"],formatter:t.commas},r.prototype.redraw=function(){var e,n,r,i,s,o,u,a,f,l,c,h,p,d,v,m,g,y,b,w,E,S,x,T;this.el.empty(),this.r=new Raphael(this.el[0]),n=this.el.width()/2,r=this.el.height()/2,p=(Math.min(n,r)-10)/3,h=0,E=this.data;for(v=0,y=E.length;vMath.PI?1:0,this.path=this.calcSegment(this.inner+3,this.inner+this.outer-5),this.selectedPath=this.calcSegment(this.inner+3,this.inner+this.outer),this.hilight=this.calcArc(this.inner)}return o(t,e),t.prototype.calcArcPoints=function(e){return[this.cx+e*this.sin_p0,this.cy+e*this.cos_p0,this.cx+e*this.sin_p1,this.cy+e*this.cos_p1]},t.prototype.calcSegment=function(e,t){var n,r,i,s,o,u,a,f,l,c;return l=this.calcArcPoints(e),n=l[0],i=l[1],r=l[2],s=l[3],c=this.calcArcPoints(t),o=c[0],a=c[1],u=c[2],f=c[3],"M"+n+","+i+("A"+e+","+e+",0,"+this.long+",0,"+r+","+s)+("L"+u+","+f)+("A"+t+","+t+",0,"+this.long+",1,"+o+","+a)+"Z"},t.prototype.calcArc=function(e){var t,n,r,i,s;return s=this.calcArcPoints(e),t=s[0],r=s[1],n=s[2],i=s[3],"M"+t+","+r+("A"+e+","+e+",0,"+this.long+",0,"+n+","+i)},t.prototype.render=function(e){var t=this;return this.arc=e.path(this.hilight).attr({stroke:this.color,"stroke-width":2,opacity:0}),this.seg=e.path(this.path).attr({fill:this.color,stroke:"white","stroke-width":3}).hover(function(){return t.fire("hover",t)}).click(function(){return t.fire("click",t.i,t.data)})},t.prototype.select=function(){if(!this.selected)return this.seg.animate({path:this.selectedPath},150,"<>"),this.arc.animate({opacity:1},150,"<>"),this.selected=!0},t.prototype.deselect=function(){if(this.selected)return this.seg.animate({path:this.path},150,"<>"),this.arc.animate({opacity:0},150,"<>"),this.selected=!1},t}(t.EventEmitter)}).call(this); \ No newline at end of file diff --git a/lib/report/assets/scripts/vendor/raphael-min.js b/lib/report/assets/scripts/vendor/raphael-min.js new file mode 100755 index 0000000..d30dbad --- /dev/null +++ b/lib/report/assets/scripts/vendor/raphael-min.js @@ -0,0 +1,10 @@ +// ┌────────────────────────────────────────────────────────────────────┐ \\ +// │ Raphaël 2.1.0 - JavaScript Vector Library │ \\ +// ├────────────────────────────────────────────────────────────────────┤ \\ +// │ Copyright © 2008-2012 Dmitry Baranovskiy (http://raphaeljs.com) │ \\ +// │ Copyright © 2008-2012 Sencha Labs (http://sencha.com) │ \\ +// ├────────────────────────────────────────────────────────────────────┤ \\ +// │ Licensed under the MIT (http://raphaeljs.com/license.html) license.│ \\ +// └────────────────────────────────────────────────────────────────────┘ \\ + +(function(a){var b="0.3.4",c="hasOwnProperty",d=/[\.\/]/,e="*",f=function(){},g=function(a,b){return a-b},h,i,j={n:{}},k=function(a,b){var c=j,d=i,e=Array.prototype.slice.call(arguments,2),f=k.listeners(a),l=0,m=!1,n,o=[],p={},q=[],r=h,s=[];h=a,i=0;for(var t=0,u=f.length;tf*b.top){e=b.percents[y],p=b.percents[y-1]||0,t=t/b.top*(e-p),o=b.percents[y+1],j=b.anim[e];break}f&&d.attr(b.anim[b.percents[y]])}if(!!j){if(!k){for(var A in j)if(j[g](A))if(U[g](A)||d.paper.customAttributes[g](A)){u[A]=d.attr(A),u[A]==null&&(u[A]=T[A]),v[A]=j[A];switch(U[A]){case C:w[A]=(v[A]-u[A])/t;break;case"colour":u[A]=a.getRGB(u[A]);var B=a.getRGB(v[A]);w[A]={r:(B.r-u[A].r)/t,g:(B.g-u[A].g)/t,b:(B.b-u[A].b)/t};break;case"path":var D=bR(u[A],v[A]),E=D[1];u[A]=D[0],w[A]=[];for(y=0,z=u[A].length;yd)return d;while(cf?c=e:d=e,e=(d-c)/2+c}return e}function n(a,b){var c=o(a,b);return((l*c+k)*c+j)*c}function m(a){return((i*a+h)*a+g)*a}var g=3*b,h=3*(d-b)-g,i=1-g-h,j=3*c,k=3*(e-c)-j,l=1-j-k;return n(a,1/(200*f))}function cq(){return this.x+q+this.y+q+this.width+" × "+this.height}function cp(){return this.x+q+this.y}function cb(a,b,c,d,e,f){a!=null?(this.a=+a,this.b=+b,this.c=+c,this.d=+d,this.e=+e,this.f=+f):(this.a=1,this.b=0,this.c=0,this.d=1,this.e=0,this.f=0)}function bH(b,c,d){b=a._path2curve(b),c=a._path2curve(c);var e,f,g,h,i,j,k,l,m,n,o=d?0:[];for(var p=0,q=b.length;p=0&&y<=1&&A>=0&&A<=1&&(d?n++:n.push({x:x.x,y:x.y,t1:y,t2:A}))}}return n}function bF(a,b){return bG(a,b,1)}function bE(a,b){return bG(a,b)}function bD(a,b,c,d,e,f,g,h){if(!(x(a,c)x(e,g)||x(b,d)x(f,h))){var i=(a*d-b*c)*(e-g)-(a-c)*(e*h-f*g),j=(a*d-b*c)*(f-h)-(b-d)*(e*h-f*g),k=(a-c)*(f-h)-(b-d)*(e-g);if(!k)return;var l=i/k,m=j/k,n=+l.toFixed(2),o=+m.toFixed(2);if(n<+y(a,c).toFixed(2)||n>+x(a,c).toFixed(2)||n<+y(e,g).toFixed(2)||n>+x(e,g).toFixed(2)||o<+y(b,d).toFixed(2)||o>+x(b,d).toFixed(2)||o<+y(f,h).toFixed(2)||o>+x(f,h).toFixed(2))return;return{x:l,y:m}}}function bC(a,b,c,d,e,f,g,h,i){if(!(i<0||bB(a,b,c,d,e,f,g,h)n)k/=2,l+=(m1?1:i<0?0:i;var j=i/2,k=12,l=[-0.1252,.1252,-0.3678,.3678,-0.5873,.5873,-0.7699,.7699,-0.9041,.9041,-0.9816,.9816],m=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],n=0;for(var o=0;od;d+=2){var f=[{x:+a[d-2],y:+a[d-1]},{x:+a[d],y:+a[d+1]},{x:+a[d+2],y:+a[d+3]},{x:+a[d+4],y:+a[d+5]}];b?d?e-4==d?f[3]={x:+a[0],y:+a[1]}:e-2==d&&(f[2]={x:+a[0],y:+a[1]},f[3]={x:+a[2],y:+a[3]}):f[0]={x:+a[e-2],y:+a[e-1]}:e-4==d?f[3]=f[2]:d||(f[0]={x:+a[d],y:+a[d+1]}),c.push(["C",(-f[0].x+6*f[1].x+f[2].x)/6,(-f[0].y+6*f[1].y+f[2].y)/6,(f[1].x+6*f[2].x-f[3].x)/6,(f[1].y+6*f[2].y-f[3].y)/6,f[2].x,f[2].y])}return c}function bx(){return this.hex}function bv(a,b,c){function d(){var e=Array.prototype.slice.call(arguments,0),f=e.join("␀"),h=d.cache=d.cache||{},i=d.count=d.count||[];if(h[g](f)){bu(i,f);return c?c(h[f]):h[f]}i.length>=1e3&&delete h[i.shift()],i.push(f),h[f]=a[m](b,e);return c?c(h[f]):h[f]}return d}function bu(a,b){for(var c=0,d=a.length;c',bl=bk.firstChild,bl.style.behavior="url(#default#VML)";if(!bl||typeof bl.adj!="object")return a.type=p;bk=null}a.svg=!(a.vml=a.type=="VML"),a._Paper=j,a.fn=k=j.prototype=a.prototype,a._id=0,a._oid=0,a.is=function(a,b){b=v.call(b);if(b=="finite")return!M[g](+a);if(b=="array")return a instanceof Array;return b=="null"&&a===null||b==typeof a&&a!==null||b=="object"&&a===Object(a)||b=="array"&&Array.isArray&&Array.isArray(a)||H.call(a).slice(8,-1).toLowerCase()==b},a.angle=function(b,c,d,e,f,g){if(f==null){var h=b-d,i=c-e;if(!h&&!i)return 0;return(180+w.atan2(-i,-h)*180/B+360)%360}return a.angle(b,c,f,g)-a.angle(d,e,f,g)},a.rad=function(a){return a%360*B/180},a.deg=function(a){return a*180/B%360},a.snapTo=function(b,c,d){d=a.is(d,"finite")?d:10;if(a.is(b,E)){var e=b.length;while(e--)if(z(b[e]-c)<=d)return b[e]}else{b=+b;var f=c%b;if(fb-d)return c-f+b}return c};var bn=a.createUUID=function(a,b){return function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(a,b).toUpperCase()}}(/[xy]/g,function(a){var b=w.random()*16|0,c=a=="x"?b:b&3|8;return c.toString(16)});a.setWindow=function(b){eve("raphael.setWindow",a,h.win,b),h.win=b,h.doc=h.win.document,a._engine.initWin&&a._engine.initWin(h.win)};var bo=function(b){if(a.vml){var c=/^\s+|\s+$/g,d;try{var e=new ActiveXObject("htmlfile");e.write(""),e.close(),d=e.body}catch(f){d=createPopup().document.body}var g=d.createTextRange();bo=bv(function(a){try{d.style.color=r(a).replace(c,p);var b=g.queryCommandValue("ForeColor");b=(b&255)<<16|b&65280|(b&16711680)>>>16;return"#"+("000000"+b.toString(16)).slice(-6)}catch(e){return"none"}})}else{var i=h.doc.createElement("i");i.title="Raphaël Colour Picker",i.style.display="none",h.doc.body.appendChild(i),bo=bv(function(a){i.style.color=a;return h.doc.defaultView.getComputedStyle(i,p).getPropertyValue("color")})}return bo(b)},bp=function(){return"hsb("+[this.h,this.s,this.b]+")"},bq=function(){return"hsl("+[this.h,this.s,this.l]+")"},br=function(){return this.hex},bs=function(b,c,d){c==null&&a.is(b,"object")&&"r"in b&&"g"in b&&"b"in b&&(d=b.b,c=b.g,b=b.r);if(c==null&&a.is(b,D)){var e=a.getRGB(b);b=e.r,c=e.g,d=e.b}if(b>1||c>1||d>1)b/=255,c/=255,d/=255;return[b,c,d]},bt=function(b,c,d,e){b*=255,c*=255,d*=255;var f={r:b,g:c,b:d,hex:a.rgb(b,c,d),toString:br};a.is(e,"finite")&&(f.opacity=e);return f};a.color=function(b){var c;a.is(b,"object")&&"h"in b&&"s"in b&&"b"in b?(c=a.hsb2rgb(b),b.r=c.r,b.g=c.g,b.b=c.b,b.hex=c.hex):a.is(b,"object")&&"h"in b&&"s"in b&&"l"in b?(c=a.hsl2rgb(b),b.r=c.r,b.g=c.g,b.b=c.b,b.hex=c.hex):(a.is(b,"string")&&(b=a.getRGB(b)),a.is(b,"object")&&"r"in b&&"g"in b&&"b"in b?(c=a.rgb2hsl(b),b.h=c.h,b.s=c.s,b.l=c.l,c=a.rgb2hsb(b),b.v=c.b):(b={hex:"none"},b.r=b.g=b.b=b.h=b.s=b.v=b.l=-1)),b.toString=br;return b},a.hsb2rgb=function(a,b,c,d){this.is(a,"object")&&"h"in a&&"s"in a&&"b"in a&&(c=a.b,b=a.s,a=a.h,d=a.o),a*=360;var e,f,g,h,i;a=a%360/60,i=c*b,h=i*(1-z(a%2-1)),e=f=g=c-i,a=~~a,e+=[i,h,0,0,h,i][a],f+=[h,i,i,h,0,0][a],g+=[0,0,h,i,i,h][a];return bt(e,f,g,d)},a.hsl2rgb=function(a,b,c,d){this.is(a,"object")&&"h"in a&&"s"in a&&"l"in a&&(c=a.l,b=a.s,a=a.h);if(a>1||b>1||c>1)a/=360,b/=100,c/=100;a*=360;var e,f,g,h,i;a=a%360/60,i=2*b*(c<.5?c:1-c),h=i*(1-z(a%2-1)),e=f=g=c-i/2,a=~~a,e+=[i,h,0,0,h,i][a],f+=[h,i,i,h,0,0][a],g+=[0,0,h,i,i,h][a];return bt(e,f,g,d)},a.rgb2hsb=function(a,b,c){c=bs(a,b,c),a=c[0],b=c[1],c=c[2];var d,e,f,g;f=x(a,b,c),g=f-y(a,b,c),d=g==0?null:f==a?(b-c)/g:f==b?(c-a)/g+2:(a-b)/g+4,d=(d+360)%6*60/360,e=g==0?0:g/f;return{h:d,s:e,b:f,toString:bp}},a.rgb2hsl=function(a,b,c){c=bs(a,b,c),a=c[0],b=c[1],c=c[2];var d,e,f,g,h,i;g=x(a,b,c),h=y(a,b,c),i=g-h,d=i==0?null:g==a?(b-c)/i:g==b?(c-a)/i+2:(a-b)/i+4,d=(d+360)%6*60/360,f=(g+h)/2,e=i==0?0:f<.5?i/(2*f):i/(2-2*f);return{h:d,s:e,l:f,toString:bq}},a._path2string=function(){return this.join(",").replace(Y,"$1")};var bw=a._preload=function(a,b){var c=h.doc.createElement("img");c.style.cssText="position:absolute;left:-9999em;top:-9999em",c.onload=function(){b.call(this),this.onload=null,h.doc.body.removeChild(this)},c.onerror=function(){h.doc.body.removeChild(this)},h.doc.body.appendChild(c),c.src=a};a.getRGB=bv(function(b){if(!b||!!((b=r(b)).indexOf("-")+1))return{r:-1,g:-1,b:-1,hex:"none",error:1,toString:bx};if(b=="none")return{r:-1,g:-1,b:-1,hex:"none",toString:bx};!X[g](b.toLowerCase().substring(0,2))&&b.charAt()!="#"&&(b=bo(b));var c,d,e,f,h,i,j,k=b.match(L);if(k){k[2]&&(f=R(k[2].substring(5),16),e=R(k[2].substring(3,5),16),d=R(k[2].substring(1,3),16)),k[3]&&(f=R((i=k[3].charAt(3))+i,16),e=R((i=k[3].charAt(2))+i,16),d=R((i=k[3].charAt(1))+i,16)),k[4]&&(j=k[4][s](W),d=Q(j[0]),j[0].slice(-1)=="%"&&(d*=2.55),e=Q(j[1]),j[1].slice(-1)=="%"&&(e*=2.55),f=Q(j[2]),j[2].slice(-1)=="%"&&(f*=2.55),k[1].toLowerCase().slice(0,4)=="rgba"&&(h=Q(j[3])),j[3]&&j[3].slice(-1)=="%"&&(h/=100));if(k[5]){j=k[5][s](W),d=Q(j[0]),j[0].slice(-1)=="%"&&(d*=2.55),e=Q(j[1]),j[1].slice(-1)=="%"&&(e*=2.55),f=Q(j[2]),j[2].slice(-1)=="%"&&(f*=2.55),(j[0].slice(-3)=="deg"||j[0].slice(-1)=="°")&&(d/=360),k[1].toLowerCase().slice(0,4)=="hsba"&&(h=Q(j[3])),j[3]&&j[3].slice(-1)=="%"&&(h/=100);return a.hsb2rgb(d,e,f,h)}if(k[6]){j=k[6][s](W),d=Q(j[0]),j[0].slice(-1)=="%"&&(d*=2.55),e=Q(j[1]),j[1].slice(-1)=="%"&&(e*=2.55),f=Q(j[2]),j[2].slice(-1)=="%"&&(f*=2.55),(j[0].slice(-3)=="deg"||j[0].slice(-1)=="°")&&(d/=360),k[1].toLowerCase().slice(0,4)=="hsla"&&(h=Q(j[3])),j[3]&&j[3].slice(-1)=="%"&&(h/=100);return a.hsl2rgb(d,e,f,h)}k={r:d,g:e,b:f,toString:bx},k.hex="#"+(16777216|f|e<<8|d<<16).toString(16).slice(1),a.is(h,"finite")&&(k.opacity=h);return k}return{r:-1,g:-1,b:-1,hex:"none",error:1,toString:bx}},a),a.hsb=bv(function(b,c,d){return a.hsb2rgb(b,c,d).hex}),a.hsl=bv(function(b,c,d){return a.hsl2rgb(b,c,d).hex}),a.rgb=bv(function(a,b,c){return"#"+(16777216|c|b<<8|a<<16).toString(16).slice(1)}),a.getColor=function(a){var b=this.getColor.start=this.getColor.start||{h:0,s:1,b:a||.75},c=this.hsb2rgb(b.h,b.s,b.b);b.h+=.075,b.h>1&&(b.h=0,b.s-=.2,b.s<=0&&(this.getColor.start={h:0,s:1,b:b.b}));return c.hex},a.getColor.reset=function(){delete this.start},a.parsePathString=function(b){if(!b)return null;var c=bz(b);if(c.arr)return bJ(c.arr);var d={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0},e=[];a.is(b,E)&&a.is(b[0],E)&&(e=bJ(b)),e.length||r(b).replace(Z,function(a,b,c){var f=[],g=b.toLowerCase();c.replace(_,function(a,b){b&&f.push(+b)}),g=="m"&&f.length>2&&(e.push([b][n](f.splice(0,2))),g="l",b=b=="m"?"l":"L");if(g=="r")e.push([b][n](f));else while(f.length>=d[g]){e.push([b][n](f.splice(0,d[g])));if(!d[g])break}}),e.toString=a._path2string,c.arr=bJ(e);return e},a.parseTransformString=bv(function(b){if(!b)return null;var c={r:3,s:4,t:2,m:6},d=[];a.is(b,E)&&a.is(b[0],E)&&(d=bJ(b)),d.length||r(b).replace($,function(a,b,c){var e=[],f=v.call(b);c.replace(_,function(a,b){b&&e.push(+b)}),d.push([b][n](e))}),d.toString=a._path2string;return d});var bz=function(a){var b=bz.ps=bz.ps||{};b[a]?b[a].sleep=100:b[a]={sleep:100},setTimeout(function(){for(var c in b)b[g](c)&&c!=a&&(b[c].sleep--,!b[c].sleep&&delete b[c])});return b[a]};a.findDotsAtSegment=function(a,b,c,d,e,f,g,h,i){var j=1-i,k=A(j,3),l=A(j,2),m=i*i,n=m*i,o=k*a+l*3*i*c+j*3*i*i*e+n*g,p=k*b+l*3*i*d+j*3*i*i*f+n*h,q=a+2*i*(c-a)+m*(e-2*c+a),r=b+2*i*(d-b)+m*(f-2*d+b),s=c+2*i*(e-c)+m*(g-2*e+c),t=d+2*i*(f-d)+m*(h-2*f+d),u=j*a+i*c,v=j*b+i*d,x=j*e+i*g,y=j*f+i*h,z=90-w.atan2(q-s,r-t)*180/B;(q>s||r=a.x&&b<=a.x2&&c>=a.y&&c<=a.y2},a.isBBoxIntersect=function(b,c){var d=a.isPointInsideBBox;return d(c,b.x,b.y)||d(c,b.x2,b.y)||d(c,b.x,b.y2)||d(c,b.x2,b.y2)||d(b,c.x,c.y)||d(b,c.x2,c.y)||d(b,c.x,c.y2)||d(b,c.x2,c.y2)||(b.xc.x||c.xb.x)&&(b.yc.y||c.yb.y)},a.pathIntersection=function(a,b){return bH(a,b)},a.pathIntersectionNumber=function(a,b){return bH(a,b,1)},a.isPointInsidePath=function(b,c,d){var e=a.pathBBox(b);return a.isPointInsideBBox(e,c,d)&&bH(b,[["M",c,d],["H",e.x2+10]],1)%2==1},a._removedFactory=function(a){return function(){eve("raphael.log",null,"Raphaël: you are calling to method “"+a+"” of removed object",a)}};var bI=a.pathBBox=function(a){var b=bz(a);if(b.bbox)return b.bbox;if(!a)return{x:0,y:0,width:0,height:0,x2:0,y2:0};a=bR(a);var c=0,d=0,e=[],f=[],g;for(var h=0,i=a.length;h1&&(v=w.sqrt(v),c=v*c,d=v*d);var x=c*c,y=d*d,A=(f==g?-1:1)*w.sqrt(z((x*y-x*u*u-y*t*t)/(x*u*u+y*t*t))),C=A*c*u/d+(a+h)/2,D=A*-d*t/c+(b+i)/2,E=w.asin(((b-D)/d).toFixed(9)),F=w.asin(((i-D)/d).toFixed(9));E=aF&&(E=E-B*2),!g&&F>E&&(F=F-B*2)}else E=j[0],F=j[1],C=j[2],D=j[3];var G=F-E;if(z(G)>k){var H=F,I=h,J=i;F=E+k*(g&&F>E?1:-1),h=C+c*w.cos(F),i=D+d*w.sin(F),m=bO(h,i,c,d,e,0,g,I,J,[F,H,C,D])}G=F-E;var K=w.cos(E),L=w.sin(E),M=w.cos(F),N=w.sin(F),O=w.tan(G/4),P=4/3*c*O,Q=4/3*d*O,R=[a,b],S=[a+P*L,b-Q*K],T=[h+P*N,i-Q*M],U=[h,i];S[0]=2*R[0]-S[0],S[1]=2*R[1]-S[1];if(j)return[S,T,U][n](m);m=[S,T,U][n](m).join()[s](",");var V=[];for(var W=0,X=m.length;W"1e12"&&(l=.5),z(n)>"1e12"&&(n=.5),l>0&&l<1&&(q=bP(a,b,c,d,e,f,g,h,l),p.push(q.x),o.push(q.y)),n>0&&n<1&&(q=bP(a,b,c,d,e,f,g,h,n),p.push(q.x),o.push(q.y)),i=f-2*d+b-(h-2*f+d),j=2*(d-b)-2*(f-d),k=b-d,l=(-j+w.sqrt(j*j-4*i*k))/2/i,n=(-j-w.sqrt(j*j-4*i*k))/2/i,z(l)>"1e12"&&(l=.5),z(n)>"1e12"&&(n=.5),l>0&&l<1&&(q=bP(a,b,c,d,e,f,g,h,l),p.push(q.x),o.push(q.y)),n>0&&n<1&&(q=bP(a,b,c,d,e,f,g,h,n),p.push(q.x),o.push(q.y));return{min:{x:y[m](0,p),y:y[m](0,o)},max:{x:x[m](0,p),y:x[m](0,o)}}}),bR=a._path2curve=bv(function(a,b){var c=!b&&bz(a);if(!b&&c.curve)return bJ(c.curve);var d=bL(a),e=b&&bL(b),f={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},g={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},h=function(a,b){var c,d;if(!a)return["C",b.x,b.y,b.x,b.y,b.x,b.y];!(a[0]in{T:1,Q:1})&&(b.qx=b.qy=null);switch(a[0]){case"M":b.X=a[1],b.Y=a[2];break;case"A":a=["C"][n](bO[m](0,[b.x,b.y][n](a.slice(1))));break;case"S":c=b.x+(b.x-(b.bx||b.x)),d=b.y+(b.y-(b.by||b.y)),a=["C",c,d][n](a.slice(1));break;case"T":b.qx=b.x+(b.x-(b.qx||b.x)),b.qy=b.y+(b.y-(b.qy||b.y)),a=["C"][n](bN(b.x,b.y,b.qx,b.qy,a[1],a[2]));break;case"Q":b.qx=a[1],b.qy=a[2],a=["C"][n](bN(b.x,b.y,a[1],a[2],a[3],a[4]));break;case"L":a=["C"][n](bM(b.x,b.y,a[1],a[2]));break;case"H":a=["C"][n](bM(b.x,b.y,a[1],b.y));break;case"V":a=["C"][n](bM(b.x,b.y,b.x,a[1]));break;case"Z":a=["C"][n](bM(b.x,b.y,b.X,b.Y))}return a},i=function(a,b){if(a[b].length>7){a[b].shift();var c=a[b];while(c.length)a.splice(b++,0,["C"][n](c.splice(0,6)));a.splice(b,1),l=x(d.length,e&&e.length||0)}},j=function(a,b,c,f,g){a&&b&&a[g][0]=="M"&&b[g][0]!="M"&&(b.splice(g,0,["M",f.x,f.y]),c.bx=0,c.by=0,c.x=a[g][1],c.y=a[g][2],l=x(d.length,e&&e.length||0))};for(var k=0,l=x(d.length,e&&e.length||0);ke){if(c&&!l.start){m=cs(g,h,i[1],i[2],i[3],i[4],i[5],i[6],e-n),k+=["C"+m.start.x,m.start.y,m.m.x,m.m.y,m.x,m.y];if(f)return k;l.start=k,k=["M"+m.x,m.y+"C"+m.n.x,m.n.y,m.end.x,m.end.y,i[5],i[6]].join(),n+=j,g=+i[5],h=+i[6];continue}if(!b&&!c){m=cs(g,h,i[1],i[2],i[3],i[4],i[5],i[6],e-n);return{x:m.x,y:m.y,alpha:m.alpha}}}n+=j,g=+i[5],h=+i[6]}k+=i.shift()+i}l.end=k,m=b?n:c?l:a.findDotsAtSegment(g,h,i[0],i[1],i[2],i[3],i[4],i[5],1),m.alpha&&(m={x:m.x,y:m.y,alpha:m.alpha});return m}},cu=ct(1),cv=ct(),cw=ct(0,1);a.getTotalLength=cu,a.getPointAtLength=cv,a.getSubpath=function(a,b,c){if(this.getTotalLength(a)-c<1e-6)return cw(a,b).end;var d=cw(a,c,1);return b?cw(d,b).end:d},cl.getTotalLength=function(){if(this.type=="path"){if(this.node.getTotalLength)return this.node.getTotalLength();return cu(this.attrs.path)}},cl.getPointAtLength=function(a){if(this.type=="path")return cv(this.attrs.path,a)},cl.getSubpath=function(b,c){if(this.type=="path")return a.getSubpath(this.attrs.path,b,c)};var cx=a.easing_formulas={linear:function(a){return a},"<":function(a){return A(a,1.7)},">":function(a){return A(a,.48)},"<>":function(a){var b=.48-a/1.04,c=w.sqrt(.1734+b*b),d=c-b,e=A(z(d),1/3)*(d<0?-1:1),f=-c-b,g=A(z(f),1/3)*(f<0?-1:1),h=e+g+.5;return(1-h)*3*h*h+h*h*h},backIn:function(a){var b=1.70158;return a*a*((b+1)*a-b)},backOut:function(a){a=a-1;var b=1.70158;return a*a*((b+1)*a+b)+1},elastic:function(a){if(a==!!a)return a;return A(2,-10*a)*w.sin((a-.075)*2*B/.3)+1},bounce:function(a){var b=7.5625,c=2.75,d;a<1/c?d=b*a*a:a<2/c?(a-=1.5/c,d=b*a*a+.75):a<2.5/c?(a-=2.25/c,d=b*a*a+.9375):(a-=2.625/c,d=b*a*a+.984375);return d}};cx.easeIn=cx["ease-in"]=cx["<"],cx.easeOut=cx["ease-out"]=cx[">"],cx.easeInOut=cx["ease-in-out"]=cx["<>"],cx["back-in"]=cx.backIn,cx["back-out"]=cx.backOut;var cy=[],cz=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(a){setTimeout(a,16)},cA=function(){var b=+(new Date),c=0;for(;c1&&!d.next){for(s in k)k[g](s)&&(r[s]=d.totalOrigin[s]);d.el.attr(r),cE(d.anim,d.el,d.anim.percents[0],null,d.totalOrigin,d.repeat-1)}d.next&&!d.stop&&cE(d.anim,d.el,d.next,null,d.totalOrigin,d.repeat)}}a.svg&&m&&m.paper&&m.paper.safari(),cy.length&&cz(cA)},cB=function(a){return a>255?255:a<0?0:a};cl.animateWith=function(b,c,d,e,f,g){var h=this;if(h.removed){g&&g.call(h);return h}var i=d instanceof cD?d:a.animation(d,e,f,g),j,k;cE(i,h,i.percents[0],null,h.attr());for(var l=0,m=cy.length;l.5)*2-1;i(m-.5,2)+i(n-.5,2)>.25&&(n=f.sqrt(.25-i(m-.5,2))*e+.5)&&n!=.5&&(n=n.toFixed(5)-1e-5*e)}return l}),e=e.split(/\s*\-\s*/);if(j=="linear"){var t=e.shift();t=-d(t);if(isNaN(t))return null;var u=[0,0,f.cos(a.rad(t)),f.sin(a.rad(t))],v=1/(g(h(u[2]),h(u[3]))||1);u[2]*=v,u[3]*=v,u[2]<0&&(u[0]=-u[2],u[2]=0),u[3]<0&&(u[1]=-u[3],u[3]=0)}var w=a._parseDots(e);if(!w)return null;k=k.replace(/[\(\)\s,\xb0#]/g,"_"),b.gradient&&k!=b.gradient.id&&(p.defs.removeChild(b.gradient),delete b.gradient);if(!b.gradient){s=q(j+"Gradient",{id:k}),b.gradient=s,q(s,j=="radial"?{fx:m,fy:n}:{x1:u[0],y1:u[1],x2:u[2],y2:u[3],gradientTransform:b.matrix.invert()}),p.defs.appendChild(s);for(var x=0,y=w.length;x1?G.opacity/100:G.opacity});case"stroke":G=a.getRGB(p),i.setAttribute(o,G.hex),o=="stroke"&&G[b]("opacity")&&q(i,{"stroke-opacity":G.opacity>1?G.opacity/100:G.opacity}),o=="stroke"&&d._.arrows&&("startString"in d._.arrows&&t(d,d._.arrows.startString),"endString"in d._.arrows&&t(d,d._.arrows.endString,1));break;case"gradient":(d.type=="circle"||d.type=="ellipse"||c(p).charAt()!="r")&&r(d,p);break;case"opacity":k.gradient&&!k[b]("stroke-opacity")&&q(i,{"stroke-opacity":p>1?p/100:p});case"fill-opacity":if(k.gradient){H=a._g.doc.getElementById(i.getAttribute("fill").replace(/^url\(#|\)$/g,l)),H&&(I=H.getElementsByTagName("stop"),q(I[I.length-1],{"stop-opacity":p}));break};default:o=="font-size"&&(p=e(p,10)+"px");var J=o.replace(/(\-.)/g,function(a){return a.substring(1).toUpperCase()});i.style[J]=p,d._.dirty=1,i.setAttribute(o,p)}}y(d,f),i.style.visibility=m},x=1.2,y=function(d,f){if(d.type=="text"&&!!(f[b]("text")||f[b]("font")||f[b]("font-size")||f[b]("x")||f[b]("y"))){var g=d.attrs,h=d.node,i=h.firstChild?e(a._g.doc.defaultView.getComputedStyle(h.firstChild,l).getPropertyValue("font-size"),10):10;if(f[b]("text")){g.text=f.text;while(h.firstChild)h.removeChild(h.firstChild);var j=c(f.text).split("\n"),k=[],m;for(var n=0,o=j.length;n"));var $=X.getBoundingClientRect();t.W=m.w=($.right-$.left)/Y,t.H=m.h=($.bottom-$.top)/Y,t.X=m.x,t.Y=m.y+t.H/2,("x"in i||"y"in i)&&(t.path.v=a.format("m{0},{1}l{2},{1}",f(m.x*u),f(m.y*u),f(m.x*u)+1));var _=["x","y","text","font","font-family","font-weight","font-style","font-size"];for(var ba=0,bb=_.length;ba.25&&(c=e.sqrt(.25-i(b-.5,2))*((c>.5)*2-1)+.5),m=b+n+c);return o}),f=f.split(/\s*\-\s*/);if(l=="linear"){var p=f.shift();p=-d(p);if(isNaN(p))return null}var q=a._parseDots(f);if(!q)return null;b=b.shape||b.node;if(q.length){b.removeChild(g),g.on=!0,g.method="none",g.color=q[0].color,g.color2=q[q.length-1].color;var r=[];for(var s=0,t=q.length;s')}}catch(c){F=function(a){return b.createElement("<"+a+' xmlns="urn:schemas-microsoft.com:vml" class="rvml">')}}},a._engine.initWin(a._g.win),a._engine.create=function(){var b=a._getContainer.apply(0,arguments),c=b.container,d=b.height,e,f=b.width,g=b.x,h=b.y;if(!c)throw new Error("VML container not found.");var i=new a._Paper,j=i.canvas=a._g.doc.createElement("div"),k=j.style;g=g||0,h=h||0,f=f||512,d=d||342,i.width=f,i.height=d,f==+f&&(f+="px"),d==+d&&(d+="px"),i.coordsize=u*1e3+n+u*1e3,i.coordorigin="0 0",i.span=a._g.doc.createElement("span"),i.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;",j.appendChild(i.span),k.cssText=a.format("top:0;left:0;width:{0};height:{1};display:inline-block;position:relative;clip:rect(0 {0} {1} 0);overflow:hidden",f,d),c==1?(a._g.doc.body.appendChild(j),k.left=g+"px",k.top=h+"px",k.position="absolute"):c.firstChild?c.insertBefore(j,c.firstChild):c.appendChild(j),i.renderfix=function(){};return i},a.prototype.clear=function(){a.eve("raphael.clear",this),this.canvas.innerHTML=o,this.span=a._g.doc.createElement("span"),this.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;display:inline;",this.canvas.appendChild(this.span),this.bottom=this.top=null},a.prototype.remove=function(){a.eve("raphael.remove",this),this.canvas.parentNode.removeChild(this.canvas);for(var b in this)this[b]=typeof this[b]=="function"?a._removedFactory(b):null;return!0};var G=a.st;for(var H in E)E[b](H)&&!G[b](H)&&(G[H]=function(a){return function(){var b=arguments;return this.forEach(function(c){c[a].apply(c,b)})}}(H))}(window.Raphael) \ No newline at end of file diff --git a/lib/report/files/__postal_js/index.html b/lib/report/files/__postal_js/index.html new file mode 100755 index 0000000..0e7db98 --- /dev/null +++ b/lib/report/files/__postal_js/index.html @@ -0,0 +1,505 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+

./postal.js

+
+
+ +
+
+
+

Maintainability

+

122.72

+
+
+

Estimated # Bugs

+

3.97

+
+
+
+
+

Difficulty

+

78.78

+
+
+

SLOC/LSLOC

+

389 / 253

+
+
+
+ +
+
+

Function weight

+
+
+
+

By Complexity

+
+
+
+

By SLOC

+
+
+
+
+ +
+
+ +
+
+ +
+
+

.

+
+
+ + + + + + + + + + + diff --git a/lib/report/files/__postal_js/report.js b/lib/report/files/__postal_js/report.js new file mode 100755 index 0000000..6fe000a --- /dev/null +++ b/lib/report/files/__postal_js/report.js @@ -0,0 +1,2151 @@ +__report = { + "info": { + "file": "./postal.js", + "fileShort": "./postal.js", + "fileSafe": "__postal_js", + "link": "files/__postal_js/index.html" + }, + "complexity": { + "aggregate": { + "line": 7, + "complexity": { + "sloc": { + "physical": 389, + "logical": 253 + }, + "cyclomatic": 49, + "halstead": { + "operators": { + "distinct": 28, + "total": 728, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 153, + "total": 861, + "identifiers": [ + "__stripped__" + ] + }, + "length": 1589, + "vocabulary": 181, + "difficulty": 78.78431372549021, + "volume": 11917.255114575213, + "effort": 938892.7656933963, + "bugs": 3.972418371525071, + "time": 52160.70920518869 + } + } + }, + "functions": [ + { + "name": "", + "line": 23, + "complexity": { + "sloc": { + "physical": 373, + "logical": 54 + }, + "cyclomatic": 1, + "halstead": { + "operators": { + "distinct": 8, + "total": 114, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 46, + "total": 117, + "identifiers": [ + "__stripped__" + ] + }, + "length": 231, + "vocabulary": 54, + "difficulty": 10.173913043478262, + "volume": 1329.3790129997615, + "effort": 13524.986480084532, + "bugs": 0.44312633766658716, + "time": 751.388137782474 + } + } + }, + { + "name": "ConsecutiveDistinctPredicate", + "line": 28, + "complexity": { + "sloc": { + "physical": 15, + "logical": 2 + }, + "cyclomatic": 1, + "halstead": { + "operators": { + "distinct": 3, + "total": 3, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 2, + "total": 2, + "identifiers": [ + "__stripped__" + ] + }, + "length": 5, + "vocabulary": 5, + "difficulty": 1.5, + "volume": 11.60964047443681, + "effort": 17.414460711655217, + "bugs": 0.0038698801581456034, + "time": 0.9674700395364009 + } + } + }, + { + "name": "", + "line": 30, + "complexity": { + "sloc": { + "physical": 12, + "logical": 8 + }, + "cyclomatic": 2, + "halstead": { + "operators": { + "distinct": 9, + "total": 17, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 8, + "total": 21, + "identifiers": [ + "__stripped__" + ] + }, + "length": 38, + "vocabulary": 17, + "difficulty": 11.8125, + "volume": 155.3235879675129, + "effort": 1834.7598828662462, + "bugs": 0.0517745293225043, + "time": 101.93110460368035 + } + } + }, + { + "name": "DistinctPredicate", + "line": 43, + "complexity": { + "sloc": { + "physical": 16, + "logical": 2 + }, + "cyclomatic": 1, + "halstead": { + "operators": { + "distinct": 5, + "total": 5, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 2, + "total": 3, + "identifiers": [ + "__stripped__" + ] + }, + "length": 8, + "vocabulary": 7, + "difficulty": 3.75, + "volume": 22.458839376460833, + "effort": 84.22064766172812, + "bugs": 0.007486279792153611, + "time": 4.678924870096007 + } + } + }, + { + "name": "", + "line": 46, + "complexity": { + "sloc": { + "physical": 12, + "logical": 4 + }, + "cyclomatic": 2, + "halstead": { + "operators": { + "distinct": 8, + "total": 10, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 7, + "total": 11, + "identifiers": [ + "__stripped__" + ] + }, + "length": 21, + "vocabulary": 15, + "difficulty": 6.285714285714286, + "volume": 82.0447025077789, + "effort": 515.7095586203245, + "bugs": 0.02734823416925963, + "time": 28.650531034462475 + } + } + }, + { + "name": "", + "line": 47, + "complexity": { + "sloc": { + "physical": 6, + "logical": 3 + }, + "cyclomatic": 3, + "halstead": { + "operators": { + "distinct": 6, + "total": 11, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 6, + "total": 13, + "identifiers": [ + "__stripped__" + ] + }, + "length": 24, + "vocabulary": 12, + "difficulty": 6.5, + "volume": 86.03910001730776, + "effort": 559.2541501125004, + "bugs": 0.028679700005769252, + "time": 31.069675006250023 + } + } + }, + { + "name": "ChannelDefinition", + "line": 59, + "complexity": { + "sloc": { + "physical": 3, + "logical": 1 + }, + "cyclomatic": 2, + "halstead": { + "operators": { + "distinct": 3, + "total": 3, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 4, + "total": 5, + "identifiers": [ + "__stripped__" + ] + }, + "length": 8, + "vocabulary": 7, + "difficulty": 1.875, + "volume": 22.458839376460833, + "effort": 42.11032383086406, + "bugs": 0.007486279792153611, + "time": 2.3394624350480036 + } + } + }, + { + "name": ".subscribe", + "line": 63, + "complexity": { + "sloc": { + "physical": 5, + "logical": 1 + }, + "cyclomatic": 2, + "halstead": { + "operators": { + "distinct": 5, + "total": 14, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 9, + "total": 19, + "identifiers": [ + "__stripped__" + ] + }, + "length": 33, + "vocabulary": 14, + "difficulty": 5.277777777777778, + "volume": 125.64271242790092, + "effort": 663.1143155916993, + "bugs": 0.04188090414263364, + "time": 36.83968419953885 + } + } + }, + { + "name": ".publish", + "line": 69, + "complexity": { + "sloc": { + "physical": 7, + "logical": 6 + }, + "cyclomatic": 3, + "halstead": { + "operators": { + "distinct": 9, + "total": 29, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 19, + "total": 33, + "identifiers": [ + "__stripped__" + ] + }, + "length": 62, + "vocabulary": 28, + "difficulty": 7.815789473684211, + "volume": 298.0560051675714, + "effort": 2329.5429877570714, + "bugs": 0.0993520017225238, + "time": 129.41905487539285 + } + } + }, + { + "name": "SubscriptionDefinition", + "line": 76, + "complexity": { + "sloc": { + "physical": 17, + "logical": 13 + }, + "cyclomatic": 1, + "halstead": { + "operators": { + "distinct": 6, + "total": 27, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 17, + "total": 40, + "identifiers": [ + "__stripped__" + ] + }, + "length": 67, + "vocabulary": 23, + "difficulty": 7.0588235294117645, + "volume": 303.0786510558199, + "effort": 2139.378713335199, + "bugs": 0.10102621701860663, + "time": 118.85437296306661 + } + } + }, + { + "name": "unsubscribe", + "line": 95, + "complexity": { + "sloc": { + "physical": 12, + "logical": 8 + }, + "cyclomatic": 1, + "halstead": { + "operators": { + "distinct": 4, + "total": 18, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 13, + "total": 24, + "identifiers": [ + "__stripped__" + ] + }, + "length": 42, + "vocabulary": 17, + "difficulty": 3.6923076923076925, + "volume": 171.67343933251428, + "effort": 633.8711606123604, + "bugs": 0.05722447977750476, + "time": 35.21506447846447 + } + } + }, + { + "name": "defer", + "line": 108, + "complexity": { + "sloc": { + "physical": 7, + "logical": 3 + }, + "cyclomatic": 1, + "halstead": { + "operators": { + "distinct": 5, + "total": 7, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 4, + "total": 7, + "identifiers": [ + "__stripped__" + ] + }, + "length": 14, + "vocabulary": 9, + "difficulty": 4.375, + "volume": 44.37895002019238, + "effort": 194.15790633834166, + "bugs": 0.014792983340064125, + "time": 10.786550352130092 + } + } + }, + { + "name": ".callback", + "line": 110, + "complexity": { + "sloc": { + "physical": 3, + "logical": 1 + }, + "cyclomatic": 1, + "halstead": { + "operators": { + "distinct": 1, + "total": 1, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 4, + "total": 5, + "identifiers": [ + "__stripped__" + ] + }, + "length": 6, + "vocabulary": 5, + "difficulty": 0.625, + "volume": 13.931568569324174, + "effort": 8.707230355827608, + "bugs": 0.004643856189774725, + "time": 0.48373501976820044 + } + } + }, + { + "name": "disposeAfter", + "line": 116, + "complexity": { + "sloc": { + "physical": 15, + "logical": 6 + }, + "cyclomatic": 3, + "halstead": { + "operators": { + "distinct": 10, + "total": 20, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 12, + "total": 22, + "identifiers": [ + "__stripped__" + ] + }, + "length": 42, + "vocabulary": 22, + "difficulty": 9.166666666666666, + "volume": 187.29612798276648, + "effort": 1716.8811731753592, + "bugs": 0.06243204266092216, + "time": 95.38228739863106 + } + } + }, + { + "name": "", + "line": 121, + "complexity": { + "sloc": { + "physical": 3, + "logical": 1 + }, + "cyclomatic": 1, + "halstead": { + "operators": { + "distinct": 2, + "total": 2, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 2, + "total": 2, + "identifiers": [ + "__stripped__" + ] + }, + "length": 4, + "vocabulary": 4, + "difficulty": 1, + "volume": 8, + "effort": 8, + "bugs": 0.0026666666666666666, + "time": 0.4444444444444444 + } + } + }, + { + "name": ".callback", + "line": 125, + "complexity": { + "sloc": { + "physical": 4, + "logical": 2 + }, + "cyclomatic": 1, + "halstead": { + "operators": { + "distinct": 2, + "total": 4, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 6, + "total": 6, + "identifiers": [ + "__stripped__" + ] + }, + "length": 10, + "vocabulary": 8, + "difficulty": 1, + "volume": 30, + "effort": 30, + "bugs": 0.01, + "time": 1.6666666666666667 + } + } + }, + { + "name": "distinctUntilChanged", + "line": 132, + "complexity": { + "sloc": { + "physical": 4, + "logical": 2 + }, + "cyclomatic": 1, + "halstead": { + "operators": { + "distinct": 4, + "total": 4, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 3, + "total": 4, + "identifiers": [ + "__stripped__" + ] + }, + "length": 8, + "vocabulary": 7, + "difficulty": 2.6666666666666665, + "volume": 22.458839376460833, + "effort": 59.89023833722889, + "bugs": 0.007486279792153611, + "time": 3.327235463179383 + } + } + }, + { + "name": "distinct", + "line": 137, + "complexity": { + "sloc": { + "physical": 4, + "logical": 2 + }, + "cyclomatic": 1, + "halstead": { + "operators": { + "distinct": 4, + "total": 4, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 3, + "total": 4, + "identifiers": [ + "__stripped__" + ] + }, + "length": 8, + "vocabulary": 7, + "difficulty": 2.6666666666666665, + "volume": 22.458839376460833, + "effort": 59.89023833722889, + "bugs": 0.007486279792153611, + "time": 3.327235463179383 + } + } + }, + { + "name": "once", + "line": 142, + "complexity": { + "sloc": { + "physical": 3, + "logical": 1 + }, + "cyclomatic": 1, + "halstead": { + "operators": { + "distinct": 2, + "total": 2, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 3, + "total": 3, + "identifiers": [ + "__stripped__" + ] + }, + "length": 5, + "vocabulary": 5, + "difficulty": 1, + "volume": 11.60964047443681, + "effort": 11.60964047443681, + "bugs": 0.0038698801581456034, + "time": 0.6449800263576005 + } + } + }, + { + "name": "withConstraint", + "line": 146, + "complexity": { + "sloc": { + "physical": 7, + "logical": 4 + }, + "cyclomatic": 2, + "halstead": { + "operators": { + "distinct": 6, + "total": 9, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 7, + "total": 10, + "identifiers": [ + "__stripped__" + ] + }, + "length": 19, + "vocabulary": 13, + "difficulty": 4.285714285714286, + "volume": 70.30835464468075, + "effort": 301.3215199057746, + "bugs": 0.02343611821489358, + "time": 16.7400844392097 + } + } + }, + { + "name": "withConstraints", + "line": 154, + "complexity": { + "sloc": { + "physical": 9, + "logical": 4 + }, + "cyclomatic": 2, + "halstead": { + "operators": { + "distinct": 7, + "total": 9, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 7, + "total": 11, + "identifiers": [ + "__stripped__" + ] + }, + "length": 20, + "vocabulary": 14, + "difficulty": 5.5, + "volume": 76.14709844115208, + "effort": 418.8090414263364, + "bugs": 0.025382366147050694, + "time": 23.267168968129802 + } + } + }, + { + "name": "", + "line": 157, + "complexity": { + "sloc": { + "physical": 3, + "logical": 1 + }, + "cyclomatic": 1, + "halstead": { + "operators": { + "distinct": 2, + "total": 2, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 3, + "total": 4, + "identifiers": [ + "__stripped__" + ] + }, + "length": 6, + "vocabulary": 5, + "difficulty": 1.3333333333333333, + "volume": 13.931568569324174, + "effort": 18.575424759098897, + "bugs": 0.004643856189774725, + "time": 1.0319680421721609 + } + } + }, + { + "name": "withContext", + "line": 164, + "complexity": { + "sloc": { + "physical": 4, + "logical": 2 + }, + "cyclomatic": 1, + "halstead": { + "operators": { + "distinct": 3, + "total": 3, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 2, + "total": 5, + "identifiers": [ + "__stripped__" + ] + }, + "length": 8, + "vocabulary": 5, + "difficulty": 3.75, + "volume": 18.575424759098897, + "effort": 69.65784284662087, + "bugs": 0.006191808253032966, + "time": 3.8698801581456035 + } + } + }, + { + "name": "withDebounce", + "line": 169, + "complexity": { + "sloc": { + "physical": 8, + "logical": 5 + }, + "cyclomatic": 2, + "halstead": { + "operators": { + "distinct": 7, + "total": 12, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 8, + "total": 15, + "identifiers": [ + "__stripped__" + ] + }, + "length": 27, + "vocabulary": 15, + "difficulty": 6.5625, + "volume": 105.48604608143, + "effort": 692.2521774093844, + "bugs": 0.03516201536047667, + "time": 38.45845430052136 + } + } + }, + { + "name": "withDelay", + "line": 178, + "complexity": { + "sloc": { + "physical": 12, + "logical": 5 + }, + "cyclomatic": 2, + "halstead": { + "operators": { + "distinct": 8, + "total": 11, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 8, + "total": 12, + "identifiers": [ + "__stripped__" + ] + }, + "length": 23, + "vocabulary": 16, + "difficulty": 6, + "volume": 92, + "effort": 552, + "bugs": 0.030666666666666665, + "time": 30.666666666666668 + } + } + }, + { + "name": ".callback", + "line": 183, + "complexity": { + "sloc": { + "physical": 5, + "logical": 1 + }, + "cyclomatic": 1, + "halstead": { + "operators": { + "distinct": 2, + "total": 2, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 4, + "total": 4, + "identifiers": [ + "__stripped__" + ] + }, + "length": 6, + "vocabulary": 6, + "difficulty": 1, + "volume": 15.509775004326936, + "effort": 15.509775004326936, + "bugs": 0.005169925001442312, + "time": 0.861654166907052 + } + } + }, + { + "name": "", + "line": 184, + "complexity": { + "sloc": { + "physical": 3, + "logical": 1 + }, + "cyclomatic": 1, + "halstead": { + "operators": { + "distinct": 1, + "total": 1, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 2, + "total": 2, + "identifiers": [ + "__stripped__" + ] + }, + "length": 3, + "vocabulary": 3, + "difficulty": 0.5, + "volume": 4.754887502163469, + "effort": 2.3774437510817346, + "bugs": 0.0015849625007211565, + "time": 0.1320802083934297 + } + } + }, + { + "name": "withThrottle", + "line": 191, + "complexity": { + "sloc": { + "physical": 8, + "logical": 5 + }, + "cyclomatic": 2, + "halstead": { + "operators": { + "distinct": 7, + "total": 12, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 8, + "total": 15, + "identifiers": [ + "__stripped__" + ] + }, + "length": 27, + "vocabulary": 15, + "difficulty": 6.5625, + "volume": 105.48604608143, + "effort": 692.2521774093844, + "bugs": 0.03516201536047667, + "time": 38.45845430052136 + } + } + }, + { + "name": "subscribe", + "line": 200, + "complexity": { + "sloc": { + "physical": 4, + "logical": 2 + }, + "cyclomatic": 1, + "halstead": { + "operators": { + "distinct": 3, + "total": 3, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 2, + "total": 5, + "identifiers": [ + "__stripped__" + ] + }, + "length": 8, + "vocabulary": 5, + "difficulty": 3.75, + "volume": 18.575424759098897, + "effort": 69.65784284662087, + "bugs": 0.006191808253032966, + "time": 3.8698801581456035 + } + } + }, + { + "name": "compare", + "line": 208, + "complexity": { + "sloc": { + "physical": 19, + "logical": 10 + }, + "cyclomatic": 4, + "halstead": { + "operators": { + "distinct": 11, + "total": 43, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 24, + "total": 50, + "identifiers": [ + "__stripped__" + ] + }, + "length": 93, + "vocabulary": 35, + "difficulty": 11.458333333333334, + "volume": 477.0233205758819, + "effort": 5465.892214931981, + "bugs": 0.15900777352529397, + "time": 303.6606786073323 + } + } + }, + { + "name": "reset", + "line": 228, + "complexity": { + "sloc": { + "physical": 3, + "logical": 1 + }, + "cyclomatic": 1, + "halstead": { + "operators": { + "distinct": 3, + "total": 3, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 3, + "total": 3, + "identifiers": [ + "__stripped__" + ] + }, + "length": 6, + "vocabulary": 6, + "difficulty": 1.5, + "volume": 15.509775004326936, + "effort": 23.264662506490403, + "bugs": 0.005169925001442312, + "time": 1.292481250360578 + } + } + }, + { + "name": "fireSub", + "line": 232, + "complexity": { + "sloc": { + "physical": 11, + "logical": 4 + }, + "cyclomatic": 4, + "halstead": { + "operators": { + "distinct": 6, + "total": 21, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 16, + "total": 26, + "identifiers": [ + "__stripped__" + ] + }, + "length": 47, + "vocabulary": 22, + "difficulty": 4.875, + "volume": 209.59328607595296, + "effort": 1021.7672696202707, + "bugs": 0.06986442869198432, + "time": 56.76484831223726 + } + } + }, + { + "name": "", + "line": 234, + "complexity": { + "sloc": { + "physical": 3, + "logical": 1 + }, + "cyclomatic": 1, + "halstead": { + "operators": { + "distinct": 3, + "total": 5, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 6, + "total": 8, + "identifiers": [ + "__stripped__" + ] + }, + "length": 13, + "vocabulary": 9, + "difficulty": 2, + "volume": 41.20902501875006, + "effort": 82.41805003750012, + "bugs": 0.013736341672916687, + "time": 4.578780557638896 + } + } + }, + { + "name": "addWireTap", + "line": 245, + "complexity": { + "sloc": { + "physical": 10, + "logical": 3 + }, + "cyclomatic": 1, + "halstead": { + "operators": { + "distinct": 6, + "total": 7, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 6, + "total": 8, + "identifiers": [ + "__stripped__" + ] + }, + "length": 15, + "vocabulary": 12, + "difficulty": 4, + "volume": 53.77443751081735, + "effort": 215.0977500432694, + "bugs": 0.017924812503605784, + "time": 11.949875002403855 + } + } + }, + { + "name": "", + "line": 248, + "complexity": { + "sloc": { + "physical": 6, + "logical": 3 + }, + "cyclomatic": 2, + "halstead": { + "operators": { + "distinct": 7, + "total": 11, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 7, + "total": 12, + "identifiers": [ + "__stripped__" + ] + }, + "length": 23, + "vocabulary": 14, + "difficulty": 6, + "volume": 87.56916320732489, + "effort": 525.4149792439493, + "bugs": 0.029189721069108297, + "time": 29.1897210691083 + } + } + }, + { + "name": "publish", + "line": 256, + "complexity": { + "sloc": { + "physical": 17, + "logical": 5 + }, + "cyclomatic": 2, + "halstead": { + "operators": { + "distinct": 7, + "total": 18, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 10, + "total": 21, + "identifiers": [ + "__stripped__" + ] + }, + "length": 39, + "vocabulary": 17, + "difficulty": 7.3500000000000005, + "volume": 159.41105080876326, + "effort": 1171.67122344441, + "bugs": 0.05313701693625442, + "time": 65.09284574691168 + } + } + }, + { + "name": "", + "line": 258, + "complexity": { + "sloc": { + "physical": 3, + "logical": 1 + }, + "cyclomatic": 1, + "halstead": { + "operators": { + "distinct": 2, + "total": 2, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 3, + "total": 5, + "identifiers": [ + "__stripped__" + ] + }, + "length": 7, + "vocabulary": 5, + "difficulty": 1.6666666666666667, + "volume": 16.253496664211536, + "effort": 27.089161107019226, + "bugs": 0.005417832221403845, + "time": 1.5049533948344014 + } + } + }, + { + "name": "", + "line": 262, + "complexity": { + "sloc": { + "physical": 8, + "logical": 6 + }, + "cyclomatic": 3, + "halstead": { + "operators": { + "distinct": 8, + "total": 11, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 8, + "total": 15, + "identifiers": [ + "__stripped__" + ] + }, + "length": 26, + "vocabulary": 16, + "difficulty": 7.5, + "volume": 104, + "effort": 780, + "bugs": 0.034666666666666665, + "time": 43.333333333333336 + } + } + }, + { + "name": "reset", + "line": 274, + "complexity": { + "sloc": { + "physical": 12, + "logical": 3 + }, + "cyclomatic": 2, + "halstead": { + "operators": { + "distinct": 6, + "total": 9, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 5, + "total": 10, + "identifiers": [ + "__stripped__" + ] + }, + "length": 19, + "vocabulary": 11, + "difficulty": 6, + "volume": 65.72920075410866, + "effort": 394.37520452465196, + "bugs": 0.021909733584702887, + "time": 21.909733584702888 + } + } + }, + { + "name": "", + "line": 276, + "complexity": { + "sloc": { + "physical": 7, + "logical": 1 + }, + "cyclomatic": 1, + "halstead": { + "operators": { + "distinct": 3, + "total": 3, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 4, + "total": 5, + "identifiers": [ + "__stripped__" + ] + }, + "length": 8, + "vocabulary": 7, + "difficulty": 1.875, + "volume": 22.458839376460833, + "effort": 42.11032383086406, + "bugs": 0.007486279792153611, + "time": 2.3394624350480036 + } + } + }, + { + "name": "", + "line": 277, + "complexity": { + "sloc": { + "physical": 5, + "logical": 2 + }, + "cyclomatic": 2, + "halstead": { + "operators": { + "distinct": 3, + "total": 6, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 4, + "total": 6, + "identifiers": [ + "__stripped__" + ] + }, + "length": 12, + "vocabulary": 7, + "difficulty": 2.25, + "volume": 33.68825906469125, + "effort": 75.79858289555531, + "bugs": 0.011229419688230418, + "time": 4.2110323830864065 + } + } + }, + { + "name": "subscribe", + "line": 287, + "complexity": { + "sloc": { + "physical": 12, + "logical": 12 + }, + "cyclomatic": 3, + "halstead": { + "operators": { + "distinct": 9, + "total": 32, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 11, + "total": 37, + "identifiers": [ + "__stripped__" + ] + }, + "length": 69, + "vocabulary": 20, + "difficulty": 15.136363636363637, + "volume": 298.213038547228, + "effort": 4513.860992555769, + "bugs": 0.09940434618240933, + "time": 250.7700551419872 + } + } + }, + { + "name": "unsubscribe", + "line": 304, + "complexity": { + "sloc": { + "physical": 12, + "logical": 7 + }, + "cyclomatic": 4, + "halstead": { + "operators": { + "distinct": 10, + "total": 34, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 11, + "total": 37, + "identifiers": [ + "__stripped__" + ] + }, + "length": 71, + "vocabulary": 21, + "difficulty": 16.81818181818182, + "volume": 311.854537017292, + "effort": 5244.82630438173, + "bugs": 0.10395151233909733, + "time": 291.37923913231833 + } + } + }, + { + "name": "channel", + "line": 329, + "complexity": { + "sloc": { + "physical": 3, + "logical": 1 + }, + "cyclomatic": 1, + "halstead": { + "operators": { + "distinct": 2, + "total": 2, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 2, + "total": 3, + "identifiers": [ + "__stripped__" + ] + }, + "length": 5, + "vocabulary": 4, + "difficulty": 1.5, + "volume": 10, + "effort": 15, + "bugs": 0.0033333333333333335, + "time": 0.8333333333333334 + } + } + }, + { + "name": "subscribe", + "line": 333, + "complexity": { + "sloc": { + "physical": 3, + "logical": 1 + }, + "cyclomatic": 2, + "halstead": { + "operators": { + "distinct": 4, + "total": 6, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 6, + "total": 9, + "identifiers": [ + "__stripped__" + ] + }, + "length": 15, + "vocabulary": 10, + "difficulty": 3, + "volume": 49.82892142331044, + "effort": 149.4867642699313, + "bugs": 0.016609640474436815, + "time": 8.304820237218406 + } + } + }, + { + "name": "publish", + "line": 337, + "complexity": { + "sloc": { + "physical": 4, + "logical": 2 + }, + "cyclomatic": 2, + "halstead": { + "operators": { + "distinct": 5, + "total": 9, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 7, + "total": 11, + "identifiers": [ + "__stripped__" + ] + }, + "length": 20, + "vocabulary": 12, + "difficulty": 3.9285714285714284, + "volume": 71.69925001442313, + "effort": 281.6756250566623, + "bugs": 0.02389975000480771, + "time": 15.648645836481238 + } + } + }, + { + "name": "addWireTap", + "line": 342, + "complexity": { + "sloc": { + "physical": 3, + "logical": 1 + }, + "cyclomatic": 1, + "halstead": { + "operators": { + "distinct": 3, + "total": 5, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 5, + "total": 6, + "identifiers": [ + "__stripped__" + ] + }, + "length": 11, + "vocabulary": 8, + "difficulty": 1.7999999999999998, + "volume": 33, + "effort": 59.39999999999999, + "bugs": 0.011, + "time": 3.2999999999999994 + } + } + }, + { + "name": "linkChannels", + "line": 346, + "complexity": { + "sloc": { + "physical": 25, + "logical": 5 + }, + "cyclomatic": 3, + "halstead": { + "operators": { + "distinct": 9, + "total": 19, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 7, + "total": 23, + "identifiers": [ + "__stripped__" + ] + }, + "length": 42, + "vocabulary": 16, + "difficulty": 14.785714285714285, + "volume": 168, + "effort": 2484, + "bugs": 0.056, + "time": 138 + } + } + }, + { + "name": "", + "line": 350, + "complexity": { + "sloc": { + "physical": 19, + "logical": 2 + }, + "cyclomatic": 2, + "halstead": { + "operators": { + "distinct": 6, + "total": 7, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 8, + "total": 9, + "identifiers": [ + "__stripped__" + ] + }, + "length": 16, + "vocabulary": 14, + "difficulty": 3.375, + "volume": 60.91767875292166, + "effort": 205.5971657911106, + "bugs": 0.020305892917640553, + "time": 11.422064766172811 + } + } + }, + { + "name": "", + "line": 352, + "complexity": { + "sloc": { + "physical": 16, + "logical": 5 + }, + "cyclomatic": 4, + "halstead": { + "operators": { + "distinct": 8, + "total": 17, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 13, + "total": 20, + "identifiers": [ + "__stripped__" + ] + }, + "length": 37, + "vocabulary": 21, + "difficulty": 6.153846153846154, + "volume": 162.51574464281416, + "effort": 1000.0968901096256, + "bugs": 0.05417191488093805, + "time": 55.56093833942364 + } + } + }, + { + "name": "callback", + "line": 358, + "complexity": { + "sloc": { + "physical": 7, + "logical": 5 + }, + "cyclomatic": 3, + "halstead": { + "operators": { + "distinct": 6, + "total": 22, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 12, + "total": 29, + "identifiers": [ + "__stripped__" + ] + }, + "length": 51, + "vocabulary": 18, + "difficulty": 7.25, + "volume": 212.66617507355792, + "effort": 1541.829769283295, + "bugs": 0.0708887250245193, + "time": 85.65720940462751 + } + } + }, + { + "name": "getSubscribersFor", + "line": 373, + "complexity": { + "sloc": { + "physical": 13, + "logical": 8 + }, + "cyclomatic": 4, + "halstead": { + "operators": { + "distinct": 10, + "total": 37, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 14, + "total": 39, + "identifiers": [ + "__stripped__" + ] + }, + "length": 76, + "vocabulary": 24, + "difficulty": 13.928571428571427, + "volume": 348.4571500548079, + "effort": 4853.5103043348245, + "bugs": 0.11615238335160265, + "time": 269.6394613519347 + } + } + }, + { + "name": "reset", + "line": 387, + "complexity": { + "sloc": { + "physical": 4, + "logical": 2 + }, + "cyclomatic": 1, + "halstead": { + "operators": { + "distinct": 2, + "total": 8, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 5, + "total": 8, + "identifiers": [ + "__stripped__" + ] + }, + "length": 16, + "vocabulary": 7, + "difficulty": 1.6, + "volume": 44.91767875292167, + "effort": 71.86828600467467, + "bugs": 0.014972559584307222, + "time": 3.9926825558152594 + } + } + }, + { + "name": "", + "line": 7, + "complexity": { + "sloc": { + "physical": 17, + "logical": 7 + }, + "cyclomatic": 3, + "halstead": { + "operators": { + "distinct": 10, + "total": 22, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 12, + "total": 23, + "identifiers": [ + "__stripped__" + ] + }, + "length": 45, + "vocabulary": 22, + "difficulty": 9.583333333333334, + "volume": 200.67442283867837, + "effort": 1923.1298855373345, + "bugs": 0.06689147427955945, + "time": 106.84054919651858 + } + } + }, + { + "name": "module.exports", + "line": 10, + "complexity": { + "sloc": { + "physical": 4, + "logical": 2 + }, + "cyclomatic": 2, + "halstead": { + "operators": { + "distinct": 4, + "total": 5, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 4, + "total": 7, + "identifiers": [ + "__stripped__" + ] + }, + "length": 12, + "vocabulary": 8, + "difficulty": 3.5, + "volume": 36, + "effort": 126, + "bugs": 0.012, + "time": 7 + } + } + }, + { + "name": "", + "line": 16, + "complexity": { + "sloc": { + "physical": 3, + "logical": 1 + }, + "cyclomatic": 1, + "halstead": { + "operators": { + "distinct": 2, + "total": 2, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 3, + "total": 4, + "identifiers": [ + "__stripped__" + ] + }, + "length": 6, + "vocabulary": 5, + "difficulty": 1.3333333333333333, + "volume": 13.931568569324174, + "effort": 18.575424759098897, + "bugs": 0.004643856189774725, + "time": 1.0319680421721609 + } + } + } + ], + "maintainability": 122.7195452557921, + "module": "./postal.js" + }, + "jshint": { + "messages": [ + { + "severity": "error", + "line": 13, + "column": 10, + "message": "Missing semicolon.", + "source": "Missing semicolon." + }, + { + "severity": "error", + "line": 65, + "column": 2, + "message": "Mixed spaces and tabs.", + "source": "Mixed spaces and tabs." + }, + { + "severity": "error", + "line": 66, + "column": 2, + "message": "Mixed spaces and tabs.", + "source": "Mixed spaces and tabs." + }, + { + "severity": "error", + "line": 71, + "column": 2, + "message": "Mixed spaces and tabs.", + "source": "Mixed spaces and tabs." + }, + { + "severity": "error", + "line": 72, + "column": 1, + "message": "Mixed spaces and tabs.", + "source": "Mixed spaces and tabs." + }, + { + "severity": "error", + "line": 213, + "column": 4, + "message": "Mixed spaces and tabs.", + "source": "Mixed spaces and tabs." + }, + { + "severity": "error", + "line": 214, + "column": 4, + "message": "Mixed spaces and tabs.", + "source": "Mixed spaces and tabs." + }, + { + "severity": "error", + "line": 215, + "column": 4, + "message": "Mixed spaces and tabs.", + "source": "Mixed spaces and tabs." + }, + { + "severity": "error", + "line": 216, + "column": 4, + "message": "Mixed spaces and tabs.", + "source": "Mixed spaces and tabs." + }, + { + "severity": "error", + "line": 233, + "column": 1, + "message": "Mixed spaces and tabs.", + "source": "Mixed spaces and tabs." + }, + { + "severity": "error", + "line": 234, + "column": 1, + "message": "Mixed spaces and tabs.", + "source": "Mixed spaces and tabs." + }, + { + "severity": "error", + "line": 235, + "column": 1, + "message": "Mixed spaces and tabs.", + "source": "Mixed spaces and tabs." + }, + { + "severity": "error", + "line": 236, + "column": 1, + "message": "Mixed spaces and tabs.", + "source": "Mixed spaces and tabs." + }, + { + "severity": "error", + "line": 237, + "column": 1, + "message": "Mixed spaces and tabs.", + "source": "Mixed spaces and tabs." + }, + { + "severity": "error", + "line": 238, + "column": 1, + "message": "Mixed spaces and tabs.", + "source": "Mixed spaces and tabs." + }, + { + "severity": "error", + "line": 239, + "column": 1, + "message": "Mixed spaces and tabs.", + "source": "Mixed spaces and tabs." + }, + { + "severity": "error", + "line": 240, + "column": 1, + "message": "Mixed spaces and tabs.", + "source": "Mixed spaces and tabs." + }, + { + "severity": "error", + "line": 241, + "column": 1, + "message": "Mixed spaces and tabs.", + "source": "Mixed spaces and tabs." + }, + { + "severity": "error", + "line": 262, + "column": 1, + "message": "Mixed spaces and tabs.", + "source": "Mixed spaces and tabs." + }, + { + "severity": "error", + "line": 263, + "column": 1, + "message": "Mixed spaces and tabs.", + "source": "Mixed spaces and tabs." + }, + { + "severity": "error", + "line": 264, + "column": 1, + "message": "Mixed spaces and tabs.", + "source": "Mixed spaces and tabs." + }, + { + "severity": "error", + "line": 265, + "column": 1, + "message": "Mixed spaces and tabs.", + "source": "Mixed spaces and tabs." + }, + { + "severity": "error", + "line": 265, + "column": 26, + "message": "Expected a conditional expression and instead saw an assignment.", + "source": "Expected a conditional expression and instead saw an assignment." + }, + { + "severity": "error", + "line": 266, + "column": 1, + "message": "Mixed spaces and tabs.", + "source": "Mixed spaces and tabs." + }, + { + "severity": "error", + "line": 267, + "column": 1, + "message": "Mixed spaces and tabs.", + "source": "Mixed spaces and tabs." + }, + { + "severity": "error", + "line": 268, + "column": 1, + "message": "Mixed spaces and tabs.", + "source": "Mixed spaces and tabs." + }, + { + "severity": "error", + "line": 269, + "column": 1, + "message": "Mixed spaces and tabs.", + "source": "Mixed spaces and tabs." + }, + { + "severity": "error", + "line": 381, + "column": 4, + "message": "Mixed spaces and tabs.", + "source": "Mixed spaces and tabs." + } + ] + } +} \ No newline at end of file diff --git a/lib/report/files/__postal_js/report.json b/lib/report/files/__postal_js/report.json new file mode 100755 index 0000000..209ea81 --- /dev/null +++ b/lib/report/files/__postal_js/report.json @@ -0,0 +1,2151 @@ +{ + "info": { + "file": "./postal.js", + "fileShort": "./postal.js", + "fileSafe": "__postal_js", + "link": "files/__postal_js/index.html" + }, + "complexity": { + "aggregate": { + "line": 7, + "complexity": { + "sloc": { + "physical": 389, + "logical": 253 + }, + "cyclomatic": 49, + "halstead": { + "operators": { + "distinct": 28, + "total": 728, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 153, + "total": 861, + "identifiers": [ + "__stripped__" + ] + }, + "length": 1589, + "vocabulary": 181, + "difficulty": 78.78431372549021, + "volume": 11917.255114575213, + "effort": 938892.7656933963, + "bugs": 3.972418371525071, + "time": 52160.70920518869 + } + } + }, + "functions": [ + { + "name": "", + "line": 23, + "complexity": { + "sloc": { + "physical": 373, + "logical": 54 + }, + "cyclomatic": 1, + "halstead": { + "operators": { + "distinct": 8, + "total": 114, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 46, + "total": 117, + "identifiers": [ + "__stripped__" + ] + }, + "length": 231, + "vocabulary": 54, + "difficulty": 10.173913043478262, + "volume": 1329.3790129997615, + "effort": 13524.986480084532, + "bugs": 0.44312633766658716, + "time": 751.388137782474 + } + } + }, + { + "name": "ConsecutiveDistinctPredicate", + "line": 28, + "complexity": { + "sloc": { + "physical": 15, + "logical": 2 + }, + "cyclomatic": 1, + "halstead": { + "operators": { + "distinct": 3, + "total": 3, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 2, + "total": 2, + "identifiers": [ + "__stripped__" + ] + }, + "length": 5, + "vocabulary": 5, + "difficulty": 1.5, + "volume": 11.60964047443681, + "effort": 17.414460711655217, + "bugs": 0.0038698801581456034, + "time": 0.9674700395364009 + } + } + }, + { + "name": "", + "line": 30, + "complexity": { + "sloc": { + "physical": 12, + "logical": 8 + }, + "cyclomatic": 2, + "halstead": { + "operators": { + "distinct": 9, + "total": 17, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 8, + "total": 21, + "identifiers": [ + "__stripped__" + ] + }, + "length": 38, + "vocabulary": 17, + "difficulty": 11.8125, + "volume": 155.3235879675129, + "effort": 1834.7598828662462, + "bugs": 0.0517745293225043, + "time": 101.93110460368035 + } + } + }, + { + "name": "DistinctPredicate", + "line": 43, + "complexity": { + "sloc": { + "physical": 16, + "logical": 2 + }, + "cyclomatic": 1, + "halstead": { + "operators": { + "distinct": 5, + "total": 5, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 2, + "total": 3, + "identifiers": [ + "__stripped__" + ] + }, + "length": 8, + "vocabulary": 7, + "difficulty": 3.75, + "volume": 22.458839376460833, + "effort": 84.22064766172812, + "bugs": 0.007486279792153611, + "time": 4.678924870096007 + } + } + }, + { + "name": "", + "line": 46, + "complexity": { + "sloc": { + "physical": 12, + "logical": 4 + }, + "cyclomatic": 2, + "halstead": { + "operators": { + "distinct": 8, + "total": 10, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 7, + "total": 11, + "identifiers": [ + "__stripped__" + ] + }, + "length": 21, + "vocabulary": 15, + "difficulty": 6.285714285714286, + "volume": 82.0447025077789, + "effort": 515.7095586203245, + "bugs": 0.02734823416925963, + "time": 28.650531034462475 + } + } + }, + { + "name": "", + "line": 47, + "complexity": { + "sloc": { + "physical": 6, + "logical": 3 + }, + "cyclomatic": 3, + "halstead": { + "operators": { + "distinct": 6, + "total": 11, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 6, + "total": 13, + "identifiers": [ + "__stripped__" + ] + }, + "length": 24, + "vocabulary": 12, + "difficulty": 6.5, + "volume": 86.03910001730776, + "effort": 559.2541501125004, + "bugs": 0.028679700005769252, + "time": 31.069675006250023 + } + } + }, + { + "name": "ChannelDefinition", + "line": 59, + "complexity": { + "sloc": { + "physical": 3, + "logical": 1 + }, + "cyclomatic": 2, + "halstead": { + "operators": { + "distinct": 3, + "total": 3, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 4, + "total": 5, + "identifiers": [ + "__stripped__" + ] + }, + "length": 8, + "vocabulary": 7, + "difficulty": 1.875, + "volume": 22.458839376460833, + "effort": 42.11032383086406, + "bugs": 0.007486279792153611, + "time": 2.3394624350480036 + } + } + }, + { + "name": ".subscribe", + "line": 63, + "complexity": { + "sloc": { + "physical": 5, + "logical": 1 + }, + "cyclomatic": 2, + "halstead": { + "operators": { + "distinct": 5, + "total": 14, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 9, + "total": 19, + "identifiers": [ + "__stripped__" + ] + }, + "length": 33, + "vocabulary": 14, + "difficulty": 5.277777777777778, + "volume": 125.64271242790092, + "effort": 663.1143155916993, + "bugs": 0.04188090414263364, + "time": 36.83968419953885 + } + } + }, + { + "name": ".publish", + "line": 69, + "complexity": { + "sloc": { + "physical": 7, + "logical": 6 + }, + "cyclomatic": 3, + "halstead": { + "operators": { + "distinct": 9, + "total": 29, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 19, + "total": 33, + "identifiers": [ + "__stripped__" + ] + }, + "length": 62, + "vocabulary": 28, + "difficulty": 7.815789473684211, + "volume": 298.0560051675714, + "effort": 2329.5429877570714, + "bugs": 0.0993520017225238, + "time": 129.41905487539285 + } + } + }, + { + "name": "SubscriptionDefinition", + "line": 76, + "complexity": { + "sloc": { + "physical": 17, + "logical": 13 + }, + "cyclomatic": 1, + "halstead": { + "operators": { + "distinct": 6, + "total": 27, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 17, + "total": 40, + "identifiers": [ + "__stripped__" + ] + }, + "length": 67, + "vocabulary": 23, + "difficulty": 7.0588235294117645, + "volume": 303.0786510558199, + "effort": 2139.378713335199, + "bugs": 0.10102621701860663, + "time": 118.85437296306661 + } + } + }, + { + "name": "unsubscribe", + "line": 95, + "complexity": { + "sloc": { + "physical": 12, + "logical": 8 + }, + "cyclomatic": 1, + "halstead": { + "operators": { + "distinct": 4, + "total": 18, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 13, + "total": 24, + "identifiers": [ + "__stripped__" + ] + }, + "length": 42, + "vocabulary": 17, + "difficulty": 3.6923076923076925, + "volume": 171.67343933251428, + "effort": 633.8711606123604, + "bugs": 0.05722447977750476, + "time": 35.21506447846447 + } + } + }, + { + "name": "defer", + "line": 108, + "complexity": { + "sloc": { + "physical": 7, + "logical": 3 + }, + "cyclomatic": 1, + "halstead": { + "operators": { + "distinct": 5, + "total": 7, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 4, + "total": 7, + "identifiers": [ + "__stripped__" + ] + }, + "length": 14, + "vocabulary": 9, + "difficulty": 4.375, + "volume": 44.37895002019238, + "effort": 194.15790633834166, + "bugs": 0.014792983340064125, + "time": 10.786550352130092 + } + } + }, + { + "name": ".callback", + "line": 110, + "complexity": { + "sloc": { + "physical": 3, + "logical": 1 + }, + "cyclomatic": 1, + "halstead": { + "operators": { + "distinct": 1, + "total": 1, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 4, + "total": 5, + "identifiers": [ + "__stripped__" + ] + }, + "length": 6, + "vocabulary": 5, + "difficulty": 0.625, + "volume": 13.931568569324174, + "effort": 8.707230355827608, + "bugs": 0.004643856189774725, + "time": 0.48373501976820044 + } + } + }, + { + "name": "disposeAfter", + "line": 116, + "complexity": { + "sloc": { + "physical": 15, + "logical": 6 + }, + "cyclomatic": 3, + "halstead": { + "operators": { + "distinct": 10, + "total": 20, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 12, + "total": 22, + "identifiers": [ + "__stripped__" + ] + }, + "length": 42, + "vocabulary": 22, + "difficulty": 9.166666666666666, + "volume": 187.29612798276648, + "effort": 1716.8811731753592, + "bugs": 0.06243204266092216, + "time": 95.38228739863106 + } + } + }, + { + "name": "", + "line": 121, + "complexity": { + "sloc": { + "physical": 3, + "logical": 1 + }, + "cyclomatic": 1, + "halstead": { + "operators": { + "distinct": 2, + "total": 2, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 2, + "total": 2, + "identifiers": [ + "__stripped__" + ] + }, + "length": 4, + "vocabulary": 4, + "difficulty": 1, + "volume": 8, + "effort": 8, + "bugs": 0.0026666666666666666, + "time": 0.4444444444444444 + } + } + }, + { + "name": ".callback", + "line": 125, + "complexity": { + "sloc": { + "physical": 4, + "logical": 2 + }, + "cyclomatic": 1, + "halstead": { + "operators": { + "distinct": 2, + "total": 4, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 6, + "total": 6, + "identifiers": [ + "__stripped__" + ] + }, + "length": 10, + "vocabulary": 8, + "difficulty": 1, + "volume": 30, + "effort": 30, + "bugs": 0.01, + "time": 1.6666666666666667 + } + } + }, + { + "name": "distinctUntilChanged", + "line": 132, + "complexity": { + "sloc": { + "physical": 4, + "logical": 2 + }, + "cyclomatic": 1, + "halstead": { + "operators": { + "distinct": 4, + "total": 4, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 3, + "total": 4, + "identifiers": [ + "__stripped__" + ] + }, + "length": 8, + "vocabulary": 7, + "difficulty": 2.6666666666666665, + "volume": 22.458839376460833, + "effort": 59.89023833722889, + "bugs": 0.007486279792153611, + "time": 3.327235463179383 + } + } + }, + { + "name": "distinct", + "line": 137, + "complexity": { + "sloc": { + "physical": 4, + "logical": 2 + }, + "cyclomatic": 1, + "halstead": { + "operators": { + "distinct": 4, + "total": 4, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 3, + "total": 4, + "identifiers": [ + "__stripped__" + ] + }, + "length": 8, + "vocabulary": 7, + "difficulty": 2.6666666666666665, + "volume": 22.458839376460833, + "effort": 59.89023833722889, + "bugs": 0.007486279792153611, + "time": 3.327235463179383 + } + } + }, + { + "name": "once", + "line": 142, + "complexity": { + "sloc": { + "physical": 3, + "logical": 1 + }, + "cyclomatic": 1, + "halstead": { + "operators": { + "distinct": 2, + "total": 2, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 3, + "total": 3, + "identifiers": [ + "__stripped__" + ] + }, + "length": 5, + "vocabulary": 5, + "difficulty": 1, + "volume": 11.60964047443681, + "effort": 11.60964047443681, + "bugs": 0.0038698801581456034, + "time": 0.6449800263576005 + } + } + }, + { + "name": "withConstraint", + "line": 146, + "complexity": { + "sloc": { + "physical": 7, + "logical": 4 + }, + "cyclomatic": 2, + "halstead": { + "operators": { + "distinct": 6, + "total": 9, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 7, + "total": 10, + "identifiers": [ + "__stripped__" + ] + }, + "length": 19, + "vocabulary": 13, + "difficulty": 4.285714285714286, + "volume": 70.30835464468075, + "effort": 301.3215199057746, + "bugs": 0.02343611821489358, + "time": 16.7400844392097 + } + } + }, + { + "name": "withConstraints", + "line": 154, + "complexity": { + "sloc": { + "physical": 9, + "logical": 4 + }, + "cyclomatic": 2, + "halstead": { + "operators": { + "distinct": 7, + "total": 9, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 7, + "total": 11, + "identifiers": [ + "__stripped__" + ] + }, + "length": 20, + "vocabulary": 14, + "difficulty": 5.5, + "volume": 76.14709844115208, + "effort": 418.8090414263364, + "bugs": 0.025382366147050694, + "time": 23.267168968129802 + } + } + }, + { + "name": "", + "line": 157, + "complexity": { + "sloc": { + "physical": 3, + "logical": 1 + }, + "cyclomatic": 1, + "halstead": { + "operators": { + "distinct": 2, + "total": 2, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 3, + "total": 4, + "identifiers": [ + "__stripped__" + ] + }, + "length": 6, + "vocabulary": 5, + "difficulty": 1.3333333333333333, + "volume": 13.931568569324174, + "effort": 18.575424759098897, + "bugs": 0.004643856189774725, + "time": 1.0319680421721609 + } + } + }, + { + "name": "withContext", + "line": 164, + "complexity": { + "sloc": { + "physical": 4, + "logical": 2 + }, + "cyclomatic": 1, + "halstead": { + "operators": { + "distinct": 3, + "total": 3, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 2, + "total": 5, + "identifiers": [ + "__stripped__" + ] + }, + "length": 8, + "vocabulary": 5, + "difficulty": 3.75, + "volume": 18.575424759098897, + "effort": 69.65784284662087, + "bugs": 0.006191808253032966, + "time": 3.8698801581456035 + } + } + }, + { + "name": "withDebounce", + "line": 169, + "complexity": { + "sloc": { + "physical": 8, + "logical": 5 + }, + "cyclomatic": 2, + "halstead": { + "operators": { + "distinct": 7, + "total": 12, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 8, + "total": 15, + "identifiers": [ + "__stripped__" + ] + }, + "length": 27, + "vocabulary": 15, + "difficulty": 6.5625, + "volume": 105.48604608143, + "effort": 692.2521774093844, + "bugs": 0.03516201536047667, + "time": 38.45845430052136 + } + } + }, + { + "name": "withDelay", + "line": 178, + "complexity": { + "sloc": { + "physical": 12, + "logical": 5 + }, + "cyclomatic": 2, + "halstead": { + "operators": { + "distinct": 8, + "total": 11, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 8, + "total": 12, + "identifiers": [ + "__stripped__" + ] + }, + "length": 23, + "vocabulary": 16, + "difficulty": 6, + "volume": 92, + "effort": 552, + "bugs": 0.030666666666666665, + "time": 30.666666666666668 + } + } + }, + { + "name": ".callback", + "line": 183, + "complexity": { + "sloc": { + "physical": 5, + "logical": 1 + }, + "cyclomatic": 1, + "halstead": { + "operators": { + "distinct": 2, + "total": 2, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 4, + "total": 4, + "identifiers": [ + "__stripped__" + ] + }, + "length": 6, + "vocabulary": 6, + "difficulty": 1, + "volume": 15.509775004326936, + "effort": 15.509775004326936, + "bugs": 0.005169925001442312, + "time": 0.861654166907052 + } + } + }, + { + "name": "", + "line": 184, + "complexity": { + "sloc": { + "physical": 3, + "logical": 1 + }, + "cyclomatic": 1, + "halstead": { + "operators": { + "distinct": 1, + "total": 1, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 2, + "total": 2, + "identifiers": [ + "__stripped__" + ] + }, + "length": 3, + "vocabulary": 3, + "difficulty": 0.5, + "volume": 4.754887502163469, + "effort": 2.3774437510817346, + "bugs": 0.0015849625007211565, + "time": 0.1320802083934297 + } + } + }, + { + "name": "withThrottle", + "line": 191, + "complexity": { + "sloc": { + "physical": 8, + "logical": 5 + }, + "cyclomatic": 2, + "halstead": { + "operators": { + "distinct": 7, + "total": 12, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 8, + "total": 15, + "identifiers": [ + "__stripped__" + ] + }, + "length": 27, + "vocabulary": 15, + "difficulty": 6.5625, + "volume": 105.48604608143, + "effort": 692.2521774093844, + "bugs": 0.03516201536047667, + "time": 38.45845430052136 + } + } + }, + { + "name": "subscribe", + "line": 200, + "complexity": { + "sloc": { + "physical": 4, + "logical": 2 + }, + "cyclomatic": 1, + "halstead": { + "operators": { + "distinct": 3, + "total": 3, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 2, + "total": 5, + "identifiers": [ + "__stripped__" + ] + }, + "length": 8, + "vocabulary": 5, + "difficulty": 3.75, + "volume": 18.575424759098897, + "effort": 69.65784284662087, + "bugs": 0.006191808253032966, + "time": 3.8698801581456035 + } + } + }, + { + "name": "compare", + "line": 208, + "complexity": { + "sloc": { + "physical": 19, + "logical": 10 + }, + "cyclomatic": 4, + "halstead": { + "operators": { + "distinct": 11, + "total": 43, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 24, + "total": 50, + "identifiers": [ + "__stripped__" + ] + }, + "length": 93, + "vocabulary": 35, + "difficulty": 11.458333333333334, + "volume": 477.0233205758819, + "effort": 5465.892214931981, + "bugs": 0.15900777352529397, + "time": 303.6606786073323 + } + } + }, + { + "name": "reset", + "line": 228, + "complexity": { + "sloc": { + "physical": 3, + "logical": 1 + }, + "cyclomatic": 1, + "halstead": { + "operators": { + "distinct": 3, + "total": 3, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 3, + "total": 3, + "identifiers": [ + "__stripped__" + ] + }, + "length": 6, + "vocabulary": 6, + "difficulty": 1.5, + "volume": 15.509775004326936, + "effort": 23.264662506490403, + "bugs": 0.005169925001442312, + "time": 1.292481250360578 + } + } + }, + { + "name": "fireSub", + "line": 232, + "complexity": { + "sloc": { + "physical": 11, + "logical": 4 + }, + "cyclomatic": 4, + "halstead": { + "operators": { + "distinct": 6, + "total": 21, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 16, + "total": 26, + "identifiers": [ + "__stripped__" + ] + }, + "length": 47, + "vocabulary": 22, + "difficulty": 4.875, + "volume": 209.59328607595296, + "effort": 1021.7672696202707, + "bugs": 0.06986442869198432, + "time": 56.76484831223726 + } + } + }, + { + "name": "", + "line": 234, + "complexity": { + "sloc": { + "physical": 3, + "logical": 1 + }, + "cyclomatic": 1, + "halstead": { + "operators": { + "distinct": 3, + "total": 5, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 6, + "total": 8, + "identifiers": [ + "__stripped__" + ] + }, + "length": 13, + "vocabulary": 9, + "difficulty": 2, + "volume": 41.20902501875006, + "effort": 82.41805003750012, + "bugs": 0.013736341672916687, + "time": 4.578780557638896 + } + } + }, + { + "name": "addWireTap", + "line": 245, + "complexity": { + "sloc": { + "physical": 10, + "logical": 3 + }, + "cyclomatic": 1, + "halstead": { + "operators": { + "distinct": 6, + "total": 7, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 6, + "total": 8, + "identifiers": [ + "__stripped__" + ] + }, + "length": 15, + "vocabulary": 12, + "difficulty": 4, + "volume": 53.77443751081735, + "effort": 215.0977500432694, + "bugs": 0.017924812503605784, + "time": 11.949875002403855 + } + } + }, + { + "name": "", + "line": 248, + "complexity": { + "sloc": { + "physical": 6, + "logical": 3 + }, + "cyclomatic": 2, + "halstead": { + "operators": { + "distinct": 7, + "total": 11, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 7, + "total": 12, + "identifiers": [ + "__stripped__" + ] + }, + "length": 23, + "vocabulary": 14, + "difficulty": 6, + "volume": 87.56916320732489, + "effort": 525.4149792439493, + "bugs": 0.029189721069108297, + "time": 29.1897210691083 + } + } + }, + { + "name": "publish", + "line": 256, + "complexity": { + "sloc": { + "physical": 17, + "logical": 5 + }, + "cyclomatic": 2, + "halstead": { + "operators": { + "distinct": 7, + "total": 18, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 10, + "total": 21, + "identifiers": [ + "__stripped__" + ] + }, + "length": 39, + "vocabulary": 17, + "difficulty": 7.3500000000000005, + "volume": 159.41105080876326, + "effort": 1171.67122344441, + "bugs": 0.05313701693625442, + "time": 65.09284574691168 + } + } + }, + { + "name": "", + "line": 258, + "complexity": { + "sloc": { + "physical": 3, + "logical": 1 + }, + "cyclomatic": 1, + "halstead": { + "operators": { + "distinct": 2, + "total": 2, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 3, + "total": 5, + "identifiers": [ + "__stripped__" + ] + }, + "length": 7, + "vocabulary": 5, + "difficulty": 1.6666666666666667, + "volume": 16.253496664211536, + "effort": 27.089161107019226, + "bugs": 0.005417832221403845, + "time": 1.5049533948344014 + } + } + }, + { + "name": "", + "line": 262, + "complexity": { + "sloc": { + "physical": 8, + "logical": 6 + }, + "cyclomatic": 3, + "halstead": { + "operators": { + "distinct": 8, + "total": 11, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 8, + "total": 15, + "identifiers": [ + "__stripped__" + ] + }, + "length": 26, + "vocabulary": 16, + "difficulty": 7.5, + "volume": 104, + "effort": 780, + "bugs": 0.034666666666666665, + "time": 43.333333333333336 + } + } + }, + { + "name": "reset", + "line": 274, + "complexity": { + "sloc": { + "physical": 12, + "logical": 3 + }, + "cyclomatic": 2, + "halstead": { + "operators": { + "distinct": 6, + "total": 9, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 5, + "total": 10, + "identifiers": [ + "__stripped__" + ] + }, + "length": 19, + "vocabulary": 11, + "difficulty": 6, + "volume": 65.72920075410866, + "effort": 394.37520452465196, + "bugs": 0.021909733584702887, + "time": 21.909733584702888 + } + } + }, + { + "name": "", + "line": 276, + "complexity": { + "sloc": { + "physical": 7, + "logical": 1 + }, + "cyclomatic": 1, + "halstead": { + "operators": { + "distinct": 3, + "total": 3, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 4, + "total": 5, + "identifiers": [ + "__stripped__" + ] + }, + "length": 8, + "vocabulary": 7, + "difficulty": 1.875, + "volume": 22.458839376460833, + "effort": 42.11032383086406, + "bugs": 0.007486279792153611, + "time": 2.3394624350480036 + } + } + }, + { + "name": "", + "line": 277, + "complexity": { + "sloc": { + "physical": 5, + "logical": 2 + }, + "cyclomatic": 2, + "halstead": { + "operators": { + "distinct": 3, + "total": 6, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 4, + "total": 6, + "identifiers": [ + "__stripped__" + ] + }, + "length": 12, + "vocabulary": 7, + "difficulty": 2.25, + "volume": 33.68825906469125, + "effort": 75.79858289555531, + "bugs": 0.011229419688230418, + "time": 4.2110323830864065 + } + } + }, + { + "name": "subscribe", + "line": 287, + "complexity": { + "sloc": { + "physical": 12, + "logical": 12 + }, + "cyclomatic": 3, + "halstead": { + "operators": { + "distinct": 9, + "total": 32, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 11, + "total": 37, + "identifiers": [ + "__stripped__" + ] + }, + "length": 69, + "vocabulary": 20, + "difficulty": 15.136363636363637, + "volume": 298.213038547228, + "effort": 4513.860992555769, + "bugs": 0.09940434618240933, + "time": 250.7700551419872 + } + } + }, + { + "name": "unsubscribe", + "line": 304, + "complexity": { + "sloc": { + "physical": 12, + "logical": 7 + }, + "cyclomatic": 4, + "halstead": { + "operators": { + "distinct": 10, + "total": 34, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 11, + "total": 37, + "identifiers": [ + "__stripped__" + ] + }, + "length": 71, + "vocabulary": 21, + "difficulty": 16.81818181818182, + "volume": 311.854537017292, + "effort": 5244.82630438173, + "bugs": 0.10395151233909733, + "time": 291.37923913231833 + } + } + }, + { + "name": "channel", + "line": 329, + "complexity": { + "sloc": { + "physical": 3, + "logical": 1 + }, + "cyclomatic": 1, + "halstead": { + "operators": { + "distinct": 2, + "total": 2, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 2, + "total": 3, + "identifiers": [ + "__stripped__" + ] + }, + "length": 5, + "vocabulary": 4, + "difficulty": 1.5, + "volume": 10, + "effort": 15, + "bugs": 0.0033333333333333335, + "time": 0.8333333333333334 + } + } + }, + { + "name": "subscribe", + "line": 333, + "complexity": { + "sloc": { + "physical": 3, + "logical": 1 + }, + "cyclomatic": 2, + "halstead": { + "operators": { + "distinct": 4, + "total": 6, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 6, + "total": 9, + "identifiers": [ + "__stripped__" + ] + }, + "length": 15, + "vocabulary": 10, + "difficulty": 3, + "volume": 49.82892142331044, + "effort": 149.4867642699313, + "bugs": 0.016609640474436815, + "time": 8.304820237218406 + } + } + }, + { + "name": "publish", + "line": 337, + "complexity": { + "sloc": { + "physical": 4, + "logical": 2 + }, + "cyclomatic": 2, + "halstead": { + "operators": { + "distinct": 5, + "total": 9, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 7, + "total": 11, + "identifiers": [ + "__stripped__" + ] + }, + "length": 20, + "vocabulary": 12, + "difficulty": 3.9285714285714284, + "volume": 71.69925001442313, + "effort": 281.6756250566623, + "bugs": 0.02389975000480771, + "time": 15.648645836481238 + } + } + }, + { + "name": "addWireTap", + "line": 342, + "complexity": { + "sloc": { + "physical": 3, + "logical": 1 + }, + "cyclomatic": 1, + "halstead": { + "operators": { + "distinct": 3, + "total": 5, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 5, + "total": 6, + "identifiers": [ + "__stripped__" + ] + }, + "length": 11, + "vocabulary": 8, + "difficulty": 1.7999999999999998, + "volume": 33, + "effort": 59.39999999999999, + "bugs": 0.011, + "time": 3.2999999999999994 + } + } + }, + { + "name": "linkChannels", + "line": 346, + "complexity": { + "sloc": { + "physical": 25, + "logical": 5 + }, + "cyclomatic": 3, + "halstead": { + "operators": { + "distinct": 9, + "total": 19, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 7, + "total": 23, + "identifiers": [ + "__stripped__" + ] + }, + "length": 42, + "vocabulary": 16, + "difficulty": 14.785714285714285, + "volume": 168, + "effort": 2484, + "bugs": 0.056, + "time": 138 + } + } + }, + { + "name": "", + "line": 350, + "complexity": { + "sloc": { + "physical": 19, + "logical": 2 + }, + "cyclomatic": 2, + "halstead": { + "operators": { + "distinct": 6, + "total": 7, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 8, + "total": 9, + "identifiers": [ + "__stripped__" + ] + }, + "length": 16, + "vocabulary": 14, + "difficulty": 3.375, + "volume": 60.91767875292166, + "effort": 205.5971657911106, + "bugs": 0.020305892917640553, + "time": 11.422064766172811 + } + } + }, + { + "name": "", + "line": 352, + "complexity": { + "sloc": { + "physical": 16, + "logical": 5 + }, + "cyclomatic": 4, + "halstead": { + "operators": { + "distinct": 8, + "total": 17, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 13, + "total": 20, + "identifiers": [ + "__stripped__" + ] + }, + "length": 37, + "vocabulary": 21, + "difficulty": 6.153846153846154, + "volume": 162.51574464281416, + "effort": 1000.0968901096256, + "bugs": 0.05417191488093805, + "time": 55.56093833942364 + } + } + }, + { + "name": "callback", + "line": 358, + "complexity": { + "sloc": { + "physical": 7, + "logical": 5 + }, + "cyclomatic": 3, + "halstead": { + "operators": { + "distinct": 6, + "total": 22, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 12, + "total": 29, + "identifiers": [ + "__stripped__" + ] + }, + "length": 51, + "vocabulary": 18, + "difficulty": 7.25, + "volume": 212.66617507355792, + "effort": 1541.829769283295, + "bugs": 0.0708887250245193, + "time": 85.65720940462751 + } + } + }, + { + "name": "getSubscribersFor", + "line": 373, + "complexity": { + "sloc": { + "physical": 13, + "logical": 8 + }, + "cyclomatic": 4, + "halstead": { + "operators": { + "distinct": 10, + "total": 37, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 14, + "total": 39, + "identifiers": [ + "__stripped__" + ] + }, + "length": 76, + "vocabulary": 24, + "difficulty": 13.928571428571427, + "volume": 348.4571500548079, + "effort": 4853.5103043348245, + "bugs": 0.11615238335160265, + "time": 269.6394613519347 + } + } + }, + { + "name": "reset", + "line": 387, + "complexity": { + "sloc": { + "physical": 4, + "logical": 2 + }, + "cyclomatic": 1, + "halstead": { + "operators": { + "distinct": 2, + "total": 8, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 5, + "total": 8, + "identifiers": [ + "__stripped__" + ] + }, + "length": 16, + "vocabulary": 7, + "difficulty": 1.6, + "volume": 44.91767875292167, + "effort": 71.86828600467467, + "bugs": 0.014972559584307222, + "time": 3.9926825558152594 + } + } + }, + { + "name": "", + "line": 7, + "complexity": { + "sloc": { + "physical": 17, + "logical": 7 + }, + "cyclomatic": 3, + "halstead": { + "operators": { + "distinct": 10, + "total": 22, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 12, + "total": 23, + "identifiers": [ + "__stripped__" + ] + }, + "length": 45, + "vocabulary": 22, + "difficulty": 9.583333333333334, + "volume": 200.67442283867837, + "effort": 1923.1298855373345, + "bugs": 0.06689147427955945, + "time": 106.84054919651858 + } + } + }, + { + "name": "module.exports", + "line": 10, + "complexity": { + "sloc": { + "physical": 4, + "logical": 2 + }, + "cyclomatic": 2, + "halstead": { + "operators": { + "distinct": 4, + "total": 5, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 4, + "total": 7, + "identifiers": [ + "__stripped__" + ] + }, + "length": 12, + "vocabulary": 8, + "difficulty": 3.5, + "volume": 36, + "effort": 126, + "bugs": 0.012, + "time": 7 + } + } + }, + { + "name": "", + "line": 16, + "complexity": { + "sloc": { + "physical": 3, + "logical": 1 + }, + "cyclomatic": 1, + "halstead": { + "operators": { + "distinct": 2, + "total": 2, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 3, + "total": 4, + "identifiers": [ + "__stripped__" + ] + }, + "length": 6, + "vocabulary": 5, + "difficulty": 1.3333333333333333, + "volume": 13.931568569324174, + "effort": 18.575424759098897, + "bugs": 0.004643856189774725, + "time": 1.0319680421721609 + } + } + } + ], + "maintainability": 122.7195452557921, + "module": "./postal.js" + }, + "jshint": { + "messages": [ + { + "severity": "error", + "line": 13, + "column": 10, + "message": "Missing semicolon.", + "source": "Missing semicolon." + }, + { + "severity": "error", + "line": 65, + "column": 2, + "message": "Mixed spaces and tabs.", + "source": "Mixed spaces and tabs." + }, + { + "severity": "error", + "line": 66, + "column": 2, + "message": "Mixed spaces and tabs.", + "source": "Mixed spaces and tabs." + }, + { + "severity": "error", + "line": 71, + "column": 2, + "message": "Mixed spaces and tabs.", + "source": "Mixed spaces and tabs." + }, + { + "severity": "error", + "line": 72, + "column": 1, + "message": "Mixed spaces and tabs.", + "source": "Mixed spaces and tabs." + }, + { + "severity": "error", + "line": 213, + "column": 4, + "message": "Mixed spaces and tabs.", + "source": "Mixed spaces and tabs." + }, + { + "severity": "error", + "line": 214, + "column": 4, + "message": "Mixed spaces and tabs.", + "source": "Mixed spaces and tabs." + }, + { + "severity": "error", + "line": 215, + "column": 4, + "message": "Mixed spaces and tabs.", + "source": "Mixed spaces and tabs." + }, + { + "severity": "error", + "line": 216, + "column": 4, + "message": "Mixed spaces and tabs.", + "source": "Mixed spaces and tabs." + }, + { + "severity": "error", + "line": 233, + "column": 1, + "message": "Mixed spaces and tabs.", + "source": "Mixed spaces and tabs." + }, + { + "severity": "error", + "line": 234, + "column": 1, + "message": "Mixed spaces and tabs.", + "source": "Mixed spaces and tabs." + }, + { + "severity": "error", + "line": 235, + "column": 1, + "message": "Mixed spaces and tabs.", + "source": "Mixed spaces and tabs." + }, + { + "severity": "error", + "line": 236, + "column": 1, + "message": "Mixed spaces and tabs.", + "source": "Mixed spaces and tabs." + }, + { + "severity": "error", + "line": 237, + "column": 1, + "message": "Mixed spaces and tabs.", + "source": "Mixed spaces and tabs." + }, + { + "severity": "error", + "line": 238, + "column": 1, + "message": "Mixed spaces and tabs.", + "source": "Mixed spaces and tabs." + }, + { + "severity": "error", + "line": 239, + "column": 1, + "message": "Mixed spaces and tabs.", + "source": "Mixed spaces and tabs." + }, + { + "severity": "error", + "line": 240, + "column": 1, + "message": "Mixed spaces and tabs.", + "source": "Mixed spaces and tabs." + }, + { + "severity": "error", + "line": 241, + "column": 1, + "message": "Mixed spaces and tabs.", + "source": "Mixed spaces and tabs." + }, + { + "severity": "error", + "line": 262, + "column": 1, + "message": "Mixed spaces and tabs.", + "source": "Mixed spaces and tabs." + }, + { + "severity": "error", + "line": 263, + "column": 1, + "message": "Mixed spaces and tabs.", + "source": "Mixed spaces and tabs." + }, + { + "severity": "error", + "line": 264, + "column": 1, + "message": "Mixed spaces and tabs.", + "source": "Mixed spaces and tabs." + }, + { + "severity": "error", + "line": 265, + "column": 1, + "message": "Mixed spaces and tabs.", + "source": "Mixed spaces and tabs." + }, + { + "severity": "error", + "line": 265, + "column": 26, + "message": "Expected a conditional expression and instead saw an assignment.", + "source": "Expected a conditional expression and instead saw an assignment." + }, + { + "severity": "error", + "line": 266, + "column": 1, + "message": "Mixed spaces and tabs.", + "source": "Mixed spaces and tabs." + }, + { + "severity": "error", + "line": 267, + "column": 1, + "message": "Mixed spaces and tabs.", + "source": "Mixed spaces and tabs." + }, + { + "severity": "error", + "line": 268, + "column": 1, + "message": "Mixed spaces and tabs.", + "source": "Mixed spaces and tabs." + }, + { + "severity": "error", + "line": 269, + "column": 1, + "message": "Mixed spaces and tabs.", + "source": "Mixed spaces and tabs." + }, + { + "severity": "error", + "line": 381, + "column": 4, + "message": "Mixed spaces and tabs.", + "source": "Mixed spaces and tabs." + } + ] + } +} \ No newline at end of file diff --git a/lib/report/index.html b/lib/report/index.html new file mode 100755 index 0000000..99f6a9a --- /dev/null +++ b/lib/report/index.html @@ -0,0 +1,105 @@ + + + + + Plato - JavaScript Introspection + + + + + + + + + + + + + + + + + + + +
+
+

JavaScript Source Analysis

+
+
+ +
+
+

Summary

+
+
+
+

Total SLOC

+

389

+
+
+

Average Maintainability

+

122.72

+
+
+
+ + +
+
+

Maintainability

+
+
+
+

Lines of code

+
+
+
+

Estimated number of bugs

+
+
+
+ + + +
+
+

Files

+
+
+ +
+
+ + +
+
+

.

+
+
+ + + + + + + diff --git a/lib/report/report.js b/lib/report/report.js new file mode 100755 index 0000000..7f69962 --- /dev/null +++ b/lib/report/report.js @@ -0,0 +1,59 @@ +__report = { + "summary": { + "total": { + "sloc": 389, + "maintainability": 122.7195452557921 + }, + "average": { + "sloc": 389, + "maintainability": "122.72" + } + }, + "reports": [ + { + "info": { + "file": "./postal.js", + "fileShort": "./postal.js", + "fileSafe": "__postal_js", + "link": "files/__postal_js/index.html" + }, + "complexity": { + "aggregate": { + "line": 7, + "complexity": { + "sloc": { + "physical": 389, + "logical": 253 + }, + "cyclomatic": 49, + "halstead": { + "operators": { + "distinct": 28, + "total": 728, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 153, + "total": 861, + "identifiers": [ + "__stripped__" + ] + }, + "length": 1589, + "vocabulary": 181, + "difficulty": 78.78431372549021, + "volume": 11917.255114575213, + "effort": 938892.7656933963, + "bugs": 3.972418371525071, + "time": 52160.70920518869 + } + } + }, + "module": "./postal.js", + "maintainability": 122.7195452557921 + } + } + ] +} \ No newline at end of file diff --git a/lib/report/report.json b/lib/report/report.json new file mode 100755 index 0000000..77a7051 --- /dev/null +++ b/lib/report/report.json @@ -0,0 +1,59 @@ +{ + "summary": { + "total": { + "sloc": 389, + "maintainability": 122.7195452557921 + }, + "average": { + "sloc": 389, + "maintainability": "122.72" + } + }, + "reports": [ + { + "info": { + "file": "./postal.js", + "fileShort": "./postal.js", + "fileSafe": "__postal_js", + "link": "files/__postal_js/index.html" + }, + "complexity": { + "aggregate": { + "line": 7, + "complexity": { + "sloc": { + "physical": 389, + "logical": 253 + }, + "cyclomatic": 49, + "halstead": { + "operators": { + "distinct": 28, + "total": 728, + "identifiers": [ + "__stripped__" + ] + }, + "operands": { + "distinct": 153, + "total": 861, + "identifiers": [ + "__stripped__" + ] + }, + "length": 1589, + "vocabulary": 181, + "difficulty": 78.78431372549021, + "volume": 11917.255114575213, + "effort": 938892.7656933963, + "bugs": 3.972418371525071, + "time": 52160.70920518869 + } + } + }, + "module": "./postal.js", + "maintainability": 122.7195452557921 + } + } + ] +} \ No newline at end of file diff --git a/package.json b/package.json old mode 100644 new mode 100755 index 6438ab1..258793f --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name" : "postal", "description" : "Pub/Sub library providing wildcard subscriptions, complex message handling, etc. Works server and client-side.", - "version" : "0.8.2", + "version" : "0.8.3", "homepage" : "http://github.com/postaljs/postal.js", "repository" : { "type" : "git", diff --git a/pavlov b/pavlov deleted file mode 120000 index 884259e..0000000 --- a/pavlov +++ /dev/null @@ -1 +0,0 @@ -/home/jcowart/.nvm/v0.4.10/lib/node_modules/anvil.js/ext \ No newline at end of file