From 816eecb2561af8b9712f5feb1f131e20cd9b6395 Mon Sep 17 00:00:00 2001 From: Alex Kilgour Date: Mon, 1 Feb 2016 17:14:21 +0000 Subject: [PATCH] Add dashed lines to graph --- Gruntfile.js | 1 + public/js/site.js | 28 ++- public/js/site.min.js | 4 +- public/js/vendor/flot/jquery.flot.dashes.js | 228 ++++++++++++++++++++ 4 files changed, 256 insertions(+), 5 deletions(-) create mode 100644 public/js/vendor/flot/jquery.flot.dashes.js diff --git a/Gruntfile.js b/Gruntfile.js index a185182..8b3d233 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -94,6 +94,7 @@ module.exports = function (grunt) { 'public/js/vendor/bootstrap/js/transition.js', 'public/js/vendor/bootstrap/js/collapse.js', 'public/js/vendor/flot/jquery.flot.js', + 'public/js/vendor/flot/jquery.flot.dashes.js', 'public/js/vendor/flot/jquery.flot.time.js', 'public/js/vendor/flot/jquery.flot.selection.js', 'public/js/vendor/flot/jquery.flot.resize.js', diff --git a/public/js/site.js b/public/js/site.js index 80d446f..450285e 100644 --- a/public/js/site.js +++ b/public/js/site.js @@ -27,6 +27,7 @@ $(document).ready(function(){ var graphOptions = { series: { + dashes: { show: false, lineWidth: 3 }, lines: { show: true }, points: { show: true }, hoverable: true @@ -43,6 +44,11 @@ $(document).ready(function(){ lines: { lineWidth: 3 }, + points: { + fill: true, + fillColor: "rgb(255, 255, 255)" + }, + shadowSize: 0, grid: { backgroundColor: '#fff', borderColor: '#808080', @@ -168,9 +174,25 @@ $(document).ready(function(){ function getData() { return [ - { color: 'rgb(216, 61, 45)', label: 'Errors', data: data.error }, - { color: 'rgb(168, 103, 0)', label: 'Warnings', data: data.warning }, - { color: 'rgb(23, 123, 190)', label: 'Notices', data: data.notice } + { + color: 'rgb(216, 61, 45)', + label: 'Errors', + data: data.error + }, + { + color: 'rgb(168, 103, 0)', + label: 'Warnings', + data: data.warning, + lines: { show: false }, + dashes: { show: true } + }, + { + color: 'rgb(23, 123, 190)', + label: 'Notices', + data: data.notice, + lines: { show: false }, + dashes: { show: true, dashLength: 5 } + } ]; } diff --git a/public/js/site.min.js b/public/js/site.min.js index 28ea14e..76b3fd0 100644 --- a/public/js/site.min.js +++ b/public/js/site.min.js @@ -2,5 +2,5 @@ }if(h=[a?m.firstChild:m.lastChild],a&&v){for(c=m[b]||(m[b]={}),u=c[e]||[],d=u[0]===T&&u[1],f=u[0]===T&&u[2],p=d&&m.childNodes[d];p=++d&&p&&p[g]||(f=d=0)||h.pop();)if(1===p.nodeType&&++f&&p===t){c[e]=[T,d,f];break}}else if(v&&(u=(t[b]||(t[b]={}))[e])&&u[0]===T)f=u[1];else for(;(p=++d&&p&&p[g]||(f=d=0)||h.pop())&&((s?p.nodeName.toLowerCase()!==y:1!==p.nodeType)||!++f||(v&&((p[b]||(p[b]={}))[e]=[T,f]),p!==t)););return f-=i,f===r||0===f%r&&f/r>=0}}},PSEUDO:function(e,t){var n,r=o.pseudos[e]||o.setFilters[e.toLowerCase()]||at.error("unsupported pseudo: "+e);return r[b]?r(t):r.length>1?(n=[e,e,"",t],o.setFilters.hasOwnProperty(e.toLowerCase())?lt(function(e,n){for(var i,o=r(e,t),a=o.length;a--;)i=F.call(e,o[a]),e[i]=!(n[i]=o[a])}):function(e){return r(e,0,n)}):r}},pseudos:{not:lt(function(e){var t=[],n=[],r=l(e.replace(z,"$1"));return r[b]?lt(function(e,t,n,i){for(var o,a=r(e,null,i,[]),s=e.length;s--;)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),!n.pop()}}),has:lt(function(e){return function(t){return at(e,t).length>0}}),contains:lt(function(e){return function(t){return(t.textContent||t.innerText||a(t)).indexOf(e)>-1}}),lang:lt(function(e){return G.test(e||"")||at.error("unsupported lang: "+e),e=e.replace(rt,it).toLowerCase(),function(t){var n;do if(n=h?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===d},focus:function(e){return e===f.activeElement&&(!f.hasFocus||f.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeName>"@"||3===e.nodeType||4===e.nodeType)return!1;return!0},parent:function(e){return!o.pseudos.empty(e)},header:function(e){return tt.test(e.nodeName)},input:function(e){return et.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||t.toLowerCase()===e.type)},first:ht(function(){return[0]}),last:ht(function(e,t){return[t-1]}),eq:ht(function(e,t,n){return[0>n?n+t:n]}),even:ht(function(e,t){for(var n=0;t>n;n+=2)e.push(n);return e}),odd:ht(function(e,t){for(var n=1;t>n;n+=2)e.push(n);return e}),lt:ht(function(e,t,n){for(var r=0>n?n+t:n;--r>=0;)e.push(r);return e}),gt:ht(function(e,t,n){for(var r=0>n?n+t:n;t>++r;)e.push(r);return e})}},o.pseudos.nth=o.pseudos.eq;for(n in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})o.pseudos[n]=ft(n);for(n in{submit:!0,reset:!0})o.pseudos[n]=dt(n);gt.prototype=o.filters=o.pseudos,o.setFilters=new gt,l=at.compile=function(e,t){var n,r=[],i=[],o=E[e+" "];if(!o){for(t||(t=mt(e)),n=t.length;n--;)o=Tt(t[n]),o[b]?r.push(o):i.push(o);o=E(e,Ct(i,r))}return o},r.sortStable=b.split("").sort(A).join("")===b,r.detectDuplicates=S,p(),r.sortDetached=ut(function(e){return 1&e.compareDocumentPosition(f.createElement("div"))}),ut(function(e){return e.innerHTML="","#"===e.firstChild.getAttribute("href")})||ct("type|href|height|width",function(e,n,r){return r?t:e.getAttribute(n,"type"===n.toLowerCase()?1:2)}),r.attributes&&ut(function(e){return e.innerHTML="",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||ct("value",function(e,n,r){return r||"input"!==e.nodeName.toLowerCase()?t:e.defaultValue}),ut(function(e){return null==e.getAttribute("disabled")})||ct(B,function(e,n,r){var i;return r?t:(i=e.getAttributeNode(n))&&i.specified?i.value:e[n]===!0?n.toLowerCase():null}),x.find=at,x.expr=at.selectors,x.expr[":"]=x.expr.pseudos,x.unique=at.uniqueSort,x.text=at.getText,x.isXMLDoc=at.isXML,x.contains=at.contains}(e);var O={};x.Callbacks=function(e){e="string"==typeof e?O[e]||F(e):x.extend({},e);var n,r,i,o,a,s,l=[],u=!e.once&&[],c=function(t){for(r=e.memory&&t,i=!0,a=s||0,s=0,o=l.length,n=!0;l&&o>a;a++)if(l[a].apply(t[0],t[1])===!1&&e.stopOnFalse){r=!1;break}n=!1,l&&(u?u.length&&c(u.shift()):r?l=[]:p.disable())},p={add:function(){if(l){var t=l.length;!function i(t){x.each(t,function(t,n){var r=x.type(n);"function"===r?e.unique&&p.has(n)||l.push(n):n&&n.length&&"string"!==r&&i(n)})}(arguments),n?o=l.length:r&&(s=t,c(r))}return this},remove:function(){return l&&x.each(arguments,function(e,t){for(var r;(r=x.inArray(t,l,r))>-1;)l.splice(r,1),n&&(o>=r&&o--,a>=r&&a--)}),this},has:function(e){return e?x.inArray(e,l)>-1:!(!l||!l.length)},empty:function(){return l=[],o=0,this},disable:function(){return l=u=r=t,this},disabled:function(){return!l},lock:function(){return u=t,r||p.disable(),this},locked:function(){return!u},fireWith:function(e,t){return!l||i&&!u||(t=t||[],t=[e,t.slice?t.slice():t],n?u.push(t):c(t)),this},fire:function(){return p.fireWith(this,arguments),this},fired:function(){return!!i}};return p},x.extend({Deferred:function(e){var t=[["resolve","done",x.Callbacks("once memory"),"resolved"],["reject","fail",x.Callbacks("once memory"),"rejected"],["notify","progress",x.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return x.Deferred(function(n){x.each(t,function(t,o){var a=o[0],s=x.isFunction(e[t])&&e[t];i[o[1]](function(){var e=s&&s.apply(this,arguments);e&&x.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[a+"With"](this===r?n.promise():this,s?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?x.extend(e,r):r}},i={};return r.pipe=r.then,x.each(t,function(e,o){var a=o[2],s=o[3];r[o[1]]=a.add,s&&a.add(function(){n=s},t[1^e][2].disable,t[2][2].lock),i[o[0]]=function(){return i[o[0]+"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=a.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var s,l,u,t=0,n=g.call(arguments),r=n.length,i=1!==r||e&&x.isFunction(e.promise)?r:0,o=1===i?e:x.Deferred(),a=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?g.call(arguments):r,n===s?o.notifyWith(t,n):--i||o.resolveWith(t,n)}};if(r>1)for(s=Array(r),l=Array(r),u=Array(r);r>t;t++)n[t]&&x.isFunction(n[t].promise)?n[t].promise().done(a(t,u,n)).fail(o.reject).progress(a(t,l,s)):--i;return i||o.resolveWith(u,n),o.promise()}}),x.support=function(t){var n,r,o,s,l,u,c,p,f,d=a.createElement("div");if(d.setAttribute("className","t"),d.innerHTML="
a",n=d.getElementsByTagName("*")||[],r=d.getElementsByTagName("a")[0],!r||!r.style||!n.length)return t;s=a.createElement("select"),u=s.appendChild(a.createElement("option")),o=d.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t.getSetAttribute="t"!==d.className,t.leadingWhitespace=3===d.firstChild.nodeType,t.tbody=!d.getElementsByTagName("tbody").length,t.htmlSerialize=!!d.getElementsByTagName("link").length,t.style=/top/.test(r.getAttribute("style")),t.hrefNormalized="/a"===r.getAttribute("href"),t.opacity=/^0.5/.test(r.style.opacity),t.cssFloat=!!r.style.cssFloat,t.checkOn=!!o.value,t.optSelected=u.selected,t.enctype=!!a.createElement("form").enctype,t.html5Clone="<:nav>"!==a.createElement("nav").cloneNode(!0).outerHTML,t.inlineBlockNeedsLayout=!1,t.shrinkWrapBlocks=!1,t.pixelPosition=!1,t.deleteExpando=!0,t.noCloneEvent=!0,t.reliableMarginRight=!0,t.boxSizingReliable=!0,o.checked=!0,t.noCloneChecked=o.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!u.disabled;try{delete d.test}catch(h){t.deleteExpando=!1}o=a.createElement("input"),o.setAttribute("value",""),t.input=""===o.getAttribute("value"),o.value="t",o.setAttribute("type","radio"),t.radioValue="t"===o.value,o.setAttribute("checked","t"),o.setAttribute("name","t"),l=a.createDocumentFragment(),l.appendChild(o),t.appendChecked=o.checked,t.checkClone=l.cloneNode(!0).cloneNode(!0).lastChild.checked,d.attachEvent&&(d.attachEvent("onclick",function(){t.noCloneEvent=!1}),d.cloneNode(!0).click());for(f in{submit:!0,change:!0,focusin:!0})d.setAttribute(c="on"+f,"t"),t[f+"Bubbles"]=c in e||d.attributes[c].expando===!1;d.style.backgroundClip="content-box",d.cloneNode(!0).style.backgroundClip="",t.clearCloneStyle="content-box"===d.style.backgroundClip;for(f in x(t))break;return t.ownLast="0"!==f,x(function(){var n,r,o,s="padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",l=a.getElementsByTagName("body")[0];l&&(n=a.createElement("div"),n.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",l.appendChild(n).appendChild(d),d.innerHTML="
t
",o=d.getElementsByTagName("td"),o[0].style.cssText="padding:0;margin:0;border:0;display:none",p=0===o[0].offsetHeight,o[0].style.display="",o[1].style.display="none",t.reliableHiddenOffsets=p&&0===o[0].offsetHeight,d.innerHTML="",d.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%;",x.swap(l,null!=l.style.zoom?{zoom:1}:{},function(){t.boxSizing=4===d.offsetWidth}),e.getComputedStyle&&(t.pixelPosition="1%"!==(e.getComputedStyle(d,null)||{}).top,t.boxSizingReliable="4px"===(e.getComputedStyle(d,null)||{width:"4px"}).width,r=d.appendChild(a.createElement("div")),r.style.cssText=d.style.cssText=s,r.style.marginRight=r.style.width="0",d.style.width="1px",t.reliableMarginRight=!parseFloat((e.getComputedStyle(r,null)||{}).marginRight)),typeof d.style.zoom!==i&&(d.innerHTML="",d.style.cssText=s+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=3===d.offsetWidth,d.style.display="block",d.innerHTML="
",d.firstChild.style.width="5px",t.shrinkWrapBlocks=3!==d.offsetWidth,t.inlineBlockNeedsLayout&&(l.style.zoom=1)),l.removeChild(n),n=d=o=r=null)}),n=s=l=u=r=o=null,t}({});var B=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,P=/([A-Z])/g;x.extend({cache:{},noData:{applet:!0,embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(e){return e=e.nodeType?x.cache[e[x.expando]]:e[x.expando],!!e&&!I(e)},data:function(e,t,n){return R(e,t,n)},removeData:function(e,t){return W(e,t)},_data:function(e,t,n){return R(e,t,n,!0)},_removeData:function(e,t){return W(e,t,!0)},acceptData:function(e){if(e.nodeType&&1!==e.nodeType&&9!==e.nodeType)return!1;var t=e.nodeName&&x.noData[e.nodeName.toLowerCase()];return!t||t!==!0&&e.getAttribute("classid")===t}}),x.fn.extend({data:function(e,n){var r,i,o=null,a=0,s=this[0];if(e===t){if(this.length&&(o=x.data(s),1===s.nodeType&&!x._data(s,"parsedAttrs"))){for(r=s.attributes;r.length>a;a++)i=r[a].name,0===i.indexOf("data-")&&(i=x.camelCase(i.slice(5)),$(s,i,o[i]));x._data(s,"parsedAttrs",!0)}return o}return"object"==typeof e?this.each(function(){x.data(this,e)}):arguments.length>1?this.each(function(){x.data(this,e,n)}):s?$(s,e,x.data(s,e)):null},removeData:function(e){return this.each(function(){x.removeData(this,e)})}}),x.extend({queue:function(e,n,r){var i;return e?(n=(n||"fx")+"queue",i=x._data(e,n),r&&(!i||x.isArray(r)?i=x._data(e,n,x.makeArray(r)):i.push(r)),i||[]):t},dequeue:function(e,t){t=t||"fx";var n=x.queue(e,t),r=n.length,i=n.shift(),o=x._queueHooks(e,t),a=function(){x.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return x._data(e,n)||x._data(e,n,{empty:x.Callbacks("once memory").add(function(){x._removeData(e,t+"queue"),x._removeData(e,n)})})}}),x.fn.extend({queue:function(e,n){var r=2;return"string"!=typeof e&&(n=e,e="fx",r--),r>arguments.length?x.queue(this[0],e):n===t?this:this.each(function(){var t=x.queue(this,e,n);x._queueHooks(this,e),"fx"===e&&"inprogress"!==t[0]&&x.dequeue(this,e)})},dequeue:function(e){return this.each(function(){x.dequeue(this,e)})},delay:function(e,t){return e=x.fx?x.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,n){var r,i=1,o=x.Deferred(),a=this,s=this.length,l=function(){--i||o.resolveWith(a,[a])};for("string"!=typeof e&&(n=e,e=t),e=e||"fx";s--;)r=x._data(a[s],e+"queueHooks"),r&&r.empty&&(i++,r.empty.add(l));return l(),o.promise(n)}});var z,X,U=/[\t\r\n\f]/g,V=/\r/g,Y=/^(?:input|select|textarea|button|object)$/i,J=/^(?:a|area)$/i,G=/^(?:checked|selected)$/i,Q=x.support.getSetAttribute,K=x.support.input;x.fn.extend({attr:function(e,t){return x.access(this,x.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){x.removeAttr(this,e)})},prop:function(e,t){return x.access(this,x.prop,e,t,arguments.length>1)},removeProp:function(e){return e=x.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,o,a=0,s=this.length,l="string"==typeof e&&e;if(x.isFunction(e))return this.each(function(t){x(this).addClass(e.call(this,t,this.className))});if(l)for(t=(e||"").match(T)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(U," "):" ")){for(o=0;i=t[o++];)0>r.indexOf(" "+i+" ")&&(r+=i+" ");n.className=x.trim(r)}return this},removeClass:function(e){var t,n,r,i,o,a=0,s=this.length,l=0===arguments.length||"string"==typeof e&&e;if(x.isFunction(e))return this.each(function(t){x(this).removeClass(e.call(this,t,this.className))});if(l)for(t=(e||"").match(T)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(U," "):"")){for(o=0;i=t[o++];)for(;r.indexOf(" "+i+" ")>=0;)r=r.replace(" "+i+" "," ");n.className=e?x.trim(r):""}return this},toggleClass:function(e,t){var n=typeof e;return"boolean"==typeof t&&"string"===n?t?this.addClass(e):this.removeClass(e):x.isFunction(e)?this.each(function(n){x(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if("string"===n)for(var t,r=0,o=x(this),a=e.match(T)||[];t=a[r++];)o.hasClass(t)?o.removeClass(t):o.addClass(t);else(n===i||"boolean"===n)&&(this.className&&x._data(this,"__className__",this.className),this.className=this.className||e===!1?"":x._data(this,"__className__")||"")})},hasClass:function(e){for(var t=" "+e+" ",n=0,r=this.length;r>n;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(U," ").indexOf(t)>=0)return!0;return!1},val:function(e){var n,r,i,o=this[0];return arguments.length?(i=x.isFunction(e),this.each(function(n){var o;1===this.nodeType&&(o=i?e.call(this,n,x(this).val()):e,null==o?o="":"number"==typeof o?o+="":x.isArray(o)&&(o=x.map(o,function(e){return null==e?"":e+""})),r=x.valHooks[this.type]||x.valHooks[this.nodeName.toLowerCase()],r&&"set"in r&&r.set(this,o,"value")!==t||(this.value=o))})):o?(r=x.valHooks[o.type]||x.valHooks[o.nodeName.toLowerCase()],r&&"get"in r&&(n=r.get(o,"value"))!==t?n:(n=o.value,"string"==typeof n?n.replace(V,""):null==n?"":n)):void 0}}),x.extend({valHooks:{option:{get:function(e){var t=x.find.attr(e,"value");return null!=t?t:e.text}},select:{get:function(e){for(var t,n,r=e.options,i=e.selectedIndex,o="select-one"===e.type||0>i,a=o?null:[],s=o?i+1:r.length,l=0>i?s:o?i:0;s>l;l++)if(n=r[l],!(!n.selected&&l!==i||(x.support.optDisabled?n.disabled:null!==n.getAttribute("disabled"))||n.parentNode.disabled&&x.nodeName(n.parentNode,"optgroup"))){if(t=x(n).val(),o)return t;a.push(t)}return a},set:function(e,t){for(var n,r,i=e.options,o=x.makeArray(t),a=i.length;a--;)r=i[a],(r.selected=x.inArray(x(r).val(),o)>=0)&&(n=!0);return n||(e.selectedIndex=-1),o}}},attr:function(e,n,r){var o,a,s=e.nodeType;return e&&3!==s&&8!==s&&2!==s?typeof e.getAttribute===i?x.prop(e,n,r):(1===s&&x.isXMLDoc(e)||(n=n.toLowerCase(),o=x.attrHooks[n]||(x.expr.match.bool.test(n)?X:z)),r===t?o&&"get"in o&&null!==(a=o.get(e,n))?a:(a=x.find.attr(e,n),null==a?t:a):null!==r?o&&"set"in o&&(a=o.set(e,r,n))!==t?a:(e.setAttribute(n,r+""),r):(x.removeAttr(e,n),t)):void 0},removeAttr:function(e,t){var n,r,i=0,o=t&&t.match(T);if(o&&1===e.nodeType)for(;n=o[i++];)r=x.propFix[n]||n,x.expr.match.bool.test(n)?K&&Q||!G.test(n)?e[r]=!1:e[x.camelCase("default-"+n)]=e[r]=!1:x.attr(e,n,""),e.removeAttribute(Q?n:r)},attrHooks:{type:{set:function(e,t){if(!x.support.radioValue&&"radio"===t&&x.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},propFix:{"for":"htmlFor","class":"className"},prop:function(e,n,r){var i,o,a,s=e.nodeType;return e&&3!==s&&8!==s&&2!==s?(a=1!==s||!x.isXMLDoc(e),a&&(n=x.propFix[n]||n,o=x.propHooks[n]),r!==t?o&&"set"in o&&(i=o.set(e,r,n))!==t?i:e[n]=r:o&&"get"in o&&null!==(i=o.get(e,n))?i:e[n]):void 0},propHooks:{tabIndex:{get:function(e){var t=x.find.attr(e,"tabindex");return t?parseInt(t,10):Y.test(e.nodeName)||J.test(e.nodeName)&&e.href?0:-1}}}}),X={set:function(e,t,n){return t===!1?x.removeAttr(e,n):K&&Q||!G.test(n)?e.setAttribute(!Q&&x.propFix[n]||n,n):e[x.camelCase("default-"+n)]=e[n]=!0,n}},x.each(x.expr.match.bool.source.match(/\w+/g),function(e,n){var r=x.expr.attrHandle[n]||x.find.attr;x.expr.attrHandle[n]=K&&Q||!G.test(n)?function(e,n,i){var o=x.expr.attrHandle[n],a=i?t:(x.expr.attrHandle[n]=t)!=r(e,n,i)?n.toLowerCase():null;return x.expr.attrHandle[n]=o,a}:function(e,n,r){return r?t:e[x.camelCase("default-"+n)]?n.toLowerCase():null}}),K&&Q||(x.attrHooks.value={set:function(e,n,r){return x.nodeName(e,"input")?(e.defaultValue=n,t):z&&z.set(e,n,r)}}),Q||(z={set:function(e,n,r){var i=e.getAttributeNode(r);return i||e.setAttributeNode(i=e.ownerDocument.createAttribute(r)),i.value=n+="","value"===r||n===e.getAttribute(r)?n:t}},x.expr.attrHandle.id=x.expr.attrHandle.name=x.expr.attrHandle.coords=function(e,n,r){var i;return r?t:(i=e.getAttributeNode(n))&&""!==i.value?i.value:null},x.valHooks.button={get:function(e,n){var r=e.getAttributeNode(n);return r&&r.specified?r.value:t},set:z.set},x.attrHooks.contenteditable={set:function(e,t,n){z.set(e,""===t?!1:t,n)}},x.each(["width","height"],function(e,n){x.attrHooks[n]={set:function(e,r){return""===r?(e.setAttribute(n,"auto"),r):t}}})),x.support.hrefNormalized||x.each(["href","src"],function(e,t){x.propHooks[t]={get:function(e){return e.getAttribute(t,4)}}}),x.support.style||(x.attrHooks.style={get:function(e){return e.style.cssText||t},set:function(e,t){return e.style.cssText=t+""}}),x.support.optSelected||(x.propHooks.selected={get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}}),x.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){x.propFix[this.toLowerCase()]=this}),x.support.enctype||(x.propFix.enctype="encoding"),x.each(["radio","checkbox"],function(){x.valHooks[this]={set:function(e,n){return x.isArray(n)?e.checked=x.inArray(x(e).val(),n)>=0:t}},x.support.checkOn||(x.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})});var Z=/^(?:input|select|textarea)$/i,et=/^key/,tt=/^(?:mouse|contextmenu)|click/,nt=/^(?:focusinfocus|focusoutblur)$/,rt=/^([^.]*)(?:\.(.+)|)$/;x.event={global:{},add:function(e,n,r,o,a){var s,l,u,c,p,f,d,h,g,m,y,v=x._data(e);if(v){for(r.handler&&(c=r,r=c.handler,a=c.selector),r.guid||(r.guid=x.guid++),(l=v.events)||(l=v.events={}),(f=v.handle)||(f=v.handle=function(e){return typeof x===i||e&&x.event.triggered===e.type?t:x.event.dispatch.apply(f.elem,arguments)},f.elem=e),n=(n||"").match(T)||[""],u=n.length;u--;)s=rt.exec(n[u])||[],g=y=s[1],m=(s[2]||"").split(".").sort(),g&&(p=x.event.special[g]||{},g=(a?p.delegateType:p.bindType)||g,p=x.event.special[g]||{},d=x.extend({type:g,origType:y,data:o,handler:r,guid:r.guid,selector:a,needsContext:a&&x.expr.match.needsContext.test(a),namespace:m.join(".")},c),(h=l[g])||(h=l[g]=[],h.delegateCount=0,p.setup&&p.setup.call(e,o,m,f)!==!1||(e.addEventListener?e.addEventListener(g,f,!1):e.attachEvent&&e.attachEvent("on"+g,f))),p.add&&(p.add.call(e,d),d.handler.guid||(d.handler.guid=r.guid)),a?h.splice(h.delegateCount++,0,d):h.push(d),x.event.global[g]=!0);e=null}},remove:function(e,t,n,r,i){var o,a,s,l,u,c,p,f,d,h,g,m=x.hasData(e)&&x._data(e);if(m&&(c=m.events)){for(t=(t||"").match(T)||[""],u=t.length;u--;)if(s=rt.exec(t[u])||[],d=g=s[1],h=(s[2]||"").split(".").sort(),d){for(p=x.event.special[d]||{},d=(r?p.delegateType:p.bindType)||d,f=c[d]||[],s=s[2]&&RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),l=o=f.length;o--;)a=f[o],!i&&g!==a.origType||n&&n.guid!==a.guid||s&&!s.test(a.namespace)||r&&r!==a.selector&&("**"!==r||!a.selector)||(f.splice(o,1),a.selector&&f.delegateCount--,p.remove&&p.remove.call(e,a));l&&!f.length&&(p.teardown&&p.teardown.call(e,h,m.handle)!==!1||x.removeEvent(e,d,m.handle),delete c[d])}else for(d in c)x.event.remove(e,d+t[u],n,r,!0);x.isEmptyObject(c)&&(delete m.handle,x._removeData(e,"events"))}},trigger:function(n,r,i,o){var s,l,u,c,p,f,d,h=[i||a],g=v.call(n,"type")?n.type:n,m=v.call(n,"namespace")?n.namespace.split("."):[];if(u=f=i=i||a,3!==i.nodeType&&8!==i.nodeType&&!nt.test(g+x.event.triggered)&&(g.indexOf(".")>=0&&(m=g.split("."),g=m.shift(),m.sort()),l=0>g.indexOf(":")&&"on"+g,n=n[x.expando]?n:new x.Event(g,"object"==typeof n&&n),n.isTrigger=o?2:3,n.namespace=m.join("."),n.namespace_re=n.namespace?RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,n.result=t,n.target||(n.target=i),r=null==r?[n]:x.makeArray(r,[n]),p=x.event.special[g]||{},o||!p.trigger||p.trigger.apply(i,r)!==!1)){if(!o&&!p.noBubble&&!x.isWindow(i)){for(c=p.delegateType||g,nt.test(c+g)||(u=u.parentNode);u;u=u.parentNode)h.push(u),f=u;f===(i.ownerDocument||a)&&h.push(f.defaultView||f.parentWindow||e)}for(d=0;(u=h[d++])&&!n.isPropagationStopped();)n.type=d>1?c:p.bindType||g,s=(x._data(u,"events")||{})[n.type]&&x._data(u,"handle"),s&&s.apply(u,r),s=l&&u[l],s&&x.acceptData(u)&&s.apply&&s.apply(u,r)===!1&&n.preventDefault();if(n.type=g,!o&&!n.isDefaultPrevented()&&(!p._default||p._default.apply(h.pop(),r)===!1)&&x.acceptData(i)&&l&&i[g]&&!x.isWindow(i)){f=i[l],f&&(i[l]=null),x.event.triggered=g;try{i[g]()}catch(y){}x.event.triggered=t,f&&(i[l]=f)}return n.result}},dispatch:function(e){e=x.event.fix(e);var n,r,i,o,a,s=[],l=g.call(arguments),u=(x._data(this,"events")||{})[e.type]||[],c=x.event.special[e.type]||{};if(l[0]=e,e.delegateTarget=this,!c.preDispatch||c.preDispatch.call(this,e)!==!1){for(s=x.event.handlers.call(this,e,u),n=0;(o=s[n++])&&!e.isPropagationStopped();)for(e.currentTarget=o.elem,a=0;(i=o.handlers[a++])&&!e.isImmediatePropagationStopped();)(!e.namespace_re||e.namespace_re.test(i.namespace))&&(e.handleObj=i,e.data=i.data,r=((x.event.special[i.origType]||{}).handle||i.handler).apply(o.elem,l),r!==t&&(e.result=r)===!1&&(e.preventDefault(),e.stopPropagation()));return c.postDispatch&&c.postDispatch.call(this,e),e.result}},handlers:function(e,n){var r,i,o,a,s=[],l=n.delegateCount,u=e.target;if(l&&u.nodeType&&(!e.button||"click"!==e.type))for(;u!=this;u=u.parentNode||this)if(1===u.nodeType&&(u.disabled!==!0||"click"!==e.type)){for(o=[],a=0;l>a;a++)i=n[a],r=i.selector+" ",o[r]===t&&(o[r]=i.needsContext?x(r,this).index(u)>=0:x.find(r,this,null,[u]).length),o[r]&&o.push(i);o.length&&s.push({elem:u,handlers:o})}return n.length>l&&s.push({elem:this,handlers:n.slice(l)}),s},fix:function(e){if(e[x.expando])return e;var t,n,r,i=e.type,o=e,s=this.fixHooks[i];for(s||(this.fixHooks[i]=s=tt.test(i)?this.mouseHooks:et.test(i)?this.keyHooks:{}),r=s.props?this.props.concat(s.props):this.props,e=new x.Event(o),t=r.length;t--;)n=r[t],e[n]=o[n];return e.target||(e.target=o.srcElement||a),3===e.target.nodeType&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,s.filter?s.filter(e,o):e},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,n){var r,i,o,s=n.button,l=n.fromElement;return null==e.pageX&&null!=n.clientX&&(i=e.target.ownerDocument||a,o=i.documentElement,r=i.body,e.pageX=n.clientX+(o&&o.scrollLeft||r&&r.scrollLeft||0)-(o&&o.clientLeft||r&&r.clientLeft||0),e.pageY=n.clientY+(o&&o.scrollTop||r&&r.scrollTop||0)-(o&&o.clientTop||r&&r.clientTop||0)),!e.relatedTarget&&l&&(e.relatedTarget=l===e.target?n.toElement:l),e.which||s===t||(e.which=1&s?1:2&s?3:4&s?2:0),e}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==at()&&this.focus)try{return this.focus(),!1}catch(e){}},delegateType:"focusin"},blur:{trigger:function(){return this===at()&&this.blur?(this.blur(),!1):t},delegateType:"focusout"},click:{trigger:function(){return x.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):t},_default:function(e){return x.nodeName(e.target,"a")}},beforeunload:{postDispatch:function(e){e.result!==t&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,n,r){var i=x.extend(new x.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?x.event.trigger(i,null,t):x.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},x.removeEvent=a.removeEventListener?function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)}:function(e,t,n){var r="on"+t;e.detachEvent&&(typeof e[r]===i&&(e[r]=null),e.detachEvent(r,n))},x.Event=function(e,n){return this instanceof x.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.returnValue===!1||e.getPreventDefault&&e.getPreventDefault()?it:ot):this.type=e,n&&x.extend(this,n),this.timeStamp=e&&e.timeStamp||x.now(),this[x.expando]=!0,t):new x.Event(e,n)},x.Event.prototype={isDefaultPrevented:ot,isPropagationStopped:ot,isImmediatePropagationStopped:ot,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=it,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=it,e&&(e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=it,this.stopPropagation()}},x.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){x.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,o=e.handleObj;return(!i||i!==r&&!x.contains(r,i))&&(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}}),x.support.submitBubbles||(x.event.special.submit={setup:function(){return x.nodeName(this,"form")?!1:(x.event.add(this,"click._submit keypress._submit",function(e){var n=e.target,r=x.nodeName(n,"input")||x.nodeName(n,"button")?n.form:t;r&&!x._data(r,"submitBubbles")&&(x.event.add(r,"submit._submit",function(e){e._submit_bubble=!0}),x._data(r,"submitBubbles",!0))}),t)},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&x.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){return x.nodeName(this,"form")?!1:(x.event.remove(this,"._submit"),t)}}),x.support.changeBubbles||(x.event.special.change={setup:function(){return Z.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(x.event.add(this,"propertychange._change",function(e){"checked"===e.originalEvent.propertyName&&(this._just_changed=!0)}),x.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),x.event.simulate("change",this,e,!0)})),!1):(x.event.add(this,"beforeactivate._change",function(e){var t=e.target;Z.test(t.nodeName)&&!x._data(t,"changeBubbles")&&(x.event.add(t,"change._change",function(e){!this.parentNode||e.isSimulated||e.isTrigger||x.event.simulate("change",this.parentNode,e,!0)}),x._data(t,"changeBubbles",!0))}),t)},handle:function(e){var n=e.target;return this!==n||e.isSimulated||e.isTrigger||"radio"!==n.type&&"checkbox"!==n.type?e.handleObj.handler.apply(this,arguments):t},teardown:function(){return x.event.remove(this,"._change"),!Z.test(this.nodeName)}}),x.support.focusinBubbles||x.each({focus:"focusin",blur:"focusout"},function(e,t){var n=0,r=function(e){x.event.simulate(t,e.target,x.event.fix(e),!0)};x.event.special[t]={setup:function(){0===n++&&a.addEventListener(e,r,!0)},teardown:function(){0===--n&&a.removeEventListener(e,r,!0)}}}),x.fn.extend({on:function(e,n,r,i,o){var a,s;if("object"==typeof e){"string"!=typeof n&&(r=r||n,n=t);for(a in e)this.on(a,n,r,e[a],o);return this}if(null==r&&null==i?(i=n,r=n=t):null==i&&("string"==typeof n?(i=r,r=t):(i=r,r=n,n=t)),i===!1)i=ot;else if(!i)return this;return 1===o&&(s=i,i=function(e){return x().off(e),s.apply(this,arguments)},i.guid=s.guid||(s.guid=x.guid++)),this.each(function(){x.event.add(this,e,i,r,n)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,n,r){var i,o;if(e&&e.preventDefault&&e.handleObj)return i=e.handleObj,x(e.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if("object"==typeof e){for(o in e)this.off(o,n,e[o]);return this}return(n===!1||"function"==typeof n)&&(r=n,n=t),r===!1&&(r=ot),this.each(function(){x.event.remove(this,e,r,n)})},trigger:function(e,t){return this.each(function(){x.event.trigger(e,t,this)})},triggerHandler:function(e,n){var r=this[0];return r?x.event.trigger(e,n,r,!0):t}});var st=/^.[^:#\[\.,]*$/,lt=/^(?:parents|prev(?:Until|All))/,ut=x.expr.match.needsContext,ct={children:!0,contents:!0,next:!0,prev:!0};x.fn.extend({find:function(e){var t,n=[],r=this,i=r.length;if("string"!=typeof e)return this.pushStack(x(e).filter(function(){for(t=0;i>t;t++)if(x.contains(r[t],this))return!0}));for(t=0;i>t;t++)x.find(e,r[t],n);return n=this.pushStack(i>1?x.unique(n):n),n.selector=this.selector?this.selector+" "+e:e,n},has:function(e){var t,n=x(e,this),r=n.length;return this.filter(function(){for(t=0;r>t;t++)if(x.contains(this,n[t]))return!0})},not:function(e){return this.pushStack(ft(this,e||[],!0))},filter:function(e){return this.pushStack(ft(this,e||[],!1))},is:function(e){return!!ft(this,"string"==typeof e&&ut.test(e)?x(e):e||[],!1).length},closest:function(e,t){for(var n,r=0,i=this.length,o=[],a=ut.test(e)||"string"!=typeof e?x(e,t||this.context):0;i>r;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(11>n.nodeType&&(a?a.index(n)>-1:1===n.nodeType&&x.find.matchesSelector(n,e))){n=o.push(n);break}return this.pushStack(o.length>1?x.unique(o):o)},index:function(e){return e?"string"==typeof e?x.inArray(this[0],x(e)):x.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){var n="string"==typeof e?x(e,t):x.makeArray(e&&e.nodeType?[e]:e),r=x.merge(this.get(),n);return this.pushStack(x.unique(r))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),x.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return x.dir(e,"parentNode")},parentsUntil:function(e,t,n){return x.dir(e,"parentNode",n)},next:function(e){return pt(e,"nextSibling")},prev:function(e){return pt(e,"previousSibling")},nextAll:function(e){return x.dir(e,"nextSibling")},prevAll:function(e){return x.dir(e,"previousSibling")},nextUntil:function(e,t,n){return x.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return x.dir(e,"previousSibling",n)},siblings:function(e){return x.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return x.sibling(e.firstChild)},contents:function(e){return x.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:x.merge([],e.childNodes); }},function(e,t){x.fn[e]=function(n,r){var i=x.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=x.filter(r,i)),this.length>1&&(ct[e]||(i=x.unique(i)),lt.test(e)&&(i=i.reverse())),this.pushStack(i)}}),x.extend({filter:function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?x.find.matchesSelector(r,e)?[r]:[]:x.find.matches(e,x.grep(t,function(e){return 1===e.nodeType}))},dir:function(e,n,r){for(var i=[],o=e[n];o&&9!==o.nodeType&&(r===t||1!==o.nodeType||!x(o).is(r));)1===o.nodeType&&i.push(o),o=o[n];return i},sibling:function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}});var ht="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",gt=/ jQuery\d+="(?:null|\d+)"/g,mt=RegExp("<(?:"+ht+")[\\s/>]","i"),yt=/^\s+/,vt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bt=/<([\w:]+)/,xt=/\s*$/g,At={option:[1,""],legend:[1,"
","
"],area:[1,"",""],param:[1,"",""],thead:[1,"","
"],tr:[2,"","
"],col:[2,"","
"],td:[3,"","
"],_default:x.support.htmlSerialize?[0,"",""]:[1,"X
","
"]},jt=dt(a),Dt=jt.appendChild(a.createElement("div"));At.optgroup=At.option,At.tbody=At.tfoot=At.colgroup=At.caption=At.thead,At.th=At.td,x.fn.extend({text:function(e){return x.access(this,function(e){return e===t?x.text(this):this.empty().append((this[0]&&this[0].ownerDocument||a).createTextNode(e))},null,e,arguments.length)},append:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Lt(this,e);t.appendChild(e)}})},prepend:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Lt(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},remove:function(e,t){for(var n,r=e?x.filter(e,this):this,i=0;null!=(n=r[i]);i++)t||1!==n.nodeType||x.cleanData(Ft(n)),n.parentNode&&(t&&x.contains(n.ownerDocument,n)&&_t(Ft(n,"script")),n.parentNode.removeChild(n));return this},empty:function(){for(var e,t=0;null!=(e=this[t]);t++){for(1===e.nodeType&&x.cleanData(Ft(e,!1));e.firstChild;)e.removeChild(e.firstChild);e.options&&x.nodeName(e,"select")&&(e.options.length=0)}return this},clone:function(e,t){return e=null==e?!1:e,t=null==t?e:t,this.map(function(){return x.clone(this,e,t)})},html:function(e){return x.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return 1===n.nodeType?n.innerHTML.replace(gt,""):t;if(!("string"!=typeof e||Tt.test(e)||!x.support.htmlSerialize&&mt.test(e)||!x.support.leadingWhitespace&&yt.test(e)||At[(bt.exec(e)||["",""])[1].toLowerCase()])){e=e.replace(vt,"<$1>");try{for(;i>r;r++)n=this[r]||{},1===n.nodeType&&(x.cleanData(Ft(n,!1)),n.innerHTML=e);n=0}catch(o){}}n&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=x.map(this,function(e){return[e.nextSibling,e.parentNode]}),t=0;return this.domManip(arguments,function(n){var r=e[t++],i=e[t++];i&&(r&&r.parentNode!==i&&(r=this.nextSibling),x(this).remove(),i.insertBefore(n,r))},!0),t?this:this.remove()},detach:function(e){return this.remove(e,!0)},domManip:function(e,t,n){e=d.apply([],e);var r,i,o,a,s,l,u=0,c=this.length,p=this,f=c-1,h=e[0],g=x.isFunction(h);if(g||!(1>=c||"string"!=typeof h||x.support.checkClone)&&Nt.test(h))return this.each(function(r){var i=p.eq(r);g&&(e[0]=h.call(this,r,i.html())),i.domManip(e,t,n)});if(c&&(l=x.buildFragment(e,this[0].ownerDocument,!1,!n&&this),r=l.firstChild,1===l.childNodes.length&&(l=r),r)){for(a=x.map(Ft(l,"script"),Ht),o=a.length;c>u;u++)i=l,u!==f&&(i=x.clone(i,!0,!0),o&&x.merge(a,Ft(i,"script"))),t.call(this[u],i,u);if(o)for(s=a[a.length-1].ownerDocument,x.map(a,qt),u=0;o>u;u++)i=a[u],kt.test(i.type||"")&&!x._data(i,"globalEval")&&x.contains(s,i)&&(i.src?x._evalUrl(i.src):x.globalEval((i.text||i.textContent||i.innerHTML||"").replace(St,"")));l=r=null}return this}}),x.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){x.fn[e]=function(e){for(var n,r=0,i=[],o=x(e),a=o.length-1;a>=r;r++)n=r===a?this:this.clone(!0),x(o[r])[t](n),h.apply(i,n.get());return this.pushStack(i)}}),x.extend({clone:function(e,t,n){var r,i,o,a,s,l=x.contains(e.ownerDocument,e);if(x.support.html5Clone||x.isXMLDoc(e)||!mt.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(Dt.innerHTML=e.outerHTML,Dt.removeChild(o=Dt.firstChild)),!(x.support.noCloneEvent&&x.support.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||x.isXMLDoc(e)))for(r=Ft(o),s=Ft(e),a=0;null!=(i=s[a]);++a)r[a]&&Ot(i,r[a]);if(t)if(n)for(s=s||Ft(e),r=r||Ft(o),a=0;null!=(i=s[a]);a++)Mt(i,r[a]);else Mt(e,o);return r=Ft(o,"script"),r.length>0&&_t(r,!l&&Ft(e,"script")),r=s=i=null,o},buildFragment:function(e,t,n,r){for(var i,o,a,s,l,u,c,p=e.length,f=dt(t),d=[],h=0;p>h;h++)if(o=e[h],o||0===o)if("object"===x.type(o))x.merge(d,o.nodeType?[o]:o);else if(wt.test(o)){for(s=s||f.appendChild(t.createElement("div")),l=(bt.exec(o)||["",""])[1].toLowerCase(),c=At[l]||At._default,s.innerHTML=c[1]+o.replace(vt,"<$1>")+c[2],i=c[0];i--;)s=s.lastChild;if(!x.support.leadingWhitespace&&yt.test(o)&&d.push(t.createTextNode(yt.exec(o)[0])),!x.support.tbody)for(o="table"!==l||xt.test(o)?""!==c[1]||xt.test(o)?0:s:s.firstChild,i=o&&o.childNodes.length;i--;)x.nodeName(u=o.childNodes[i],"tbody")&&!u.childNodes.length&&o.removeChild(u);for(x.merge(d,s.childNodes),s.textContent="";s.firstChild;)s.removeChild(s.firstChild);s=f.lastChild}else d.push(t.createTextNode(o));for(s&&f.removeChild(s),x.support.appendChecked||x.grep(Ft(d,"input"),Bt),h=0;o=d[h++];)if((!r||-1===x.inArray(o,r))&&(a=x.contains(o.ownerDocument,o),s=Ft(f.appendChild(o),"script"),a&&_t(s),n))for(i=0;o=s[i++];)kt.test(o.type||"")&&n.push(o);return s=null,f},cleanData:function(e,t){for(var n,r,o,a,s=0,l=x.expando,u=x.cache,c=x.support.deleteExpando,f=x.event.special;null!=(n=e[s]);s++)if((t||x.acceptData(n))&&(o=n[l],a=o&&u[o])){if(a.events)for(r in a.events)f[r]?x.event.remove(n,r):x.removeEvent(n,r,a.handle);u[o]&&(delete u[o],c?delete n[l]:typeof n.removeAttribute!==i?n.removeAttribute(l):n[l]=null,p.push(o))}},_evalUrl:function(e){return x.ajax({url:e,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})}}),x.fn.extend({wrapAll:function(e){if(x.isFunction(e))return this.each(function(t){x(this).wrapAll(e.call(this,t))});if(this[0]){var t=x(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstChild&&1===e.firstChild.nodeType;)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return x.isFunction(e)?this.each(function(t){x(this).wrapInner(e.call(this,t))}):this.each(function(){var t=x(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=x.isFunction(e);return this.each(function(n){x(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){x.nodeName(this,"body")||x(this).replaceWith(this.childNodes)}).end()}});var Pt,Rt,Wt,$t=/alpha\([^)]*\)/i,It=/opacity\s*=\s*([^)]*)/,zt=/^(top|right|bottom|left)$/,Xt=/^(none|table(?!-c[ea]).+)/,Ut=/^margin/,Vt=RegExp("^("+w+")(.*)$","i"),Yt=RegExp("^("+w+")(?!px)[a-z%]+$","i"),Jt=RegExp("^([+-])=("+w+")","i"),Gt={BODY:"block"},Qt={position:"absolute",visibility:"hidden",display:"block"},Kt={letterSpacing:0,fontWeight:400},Zt=["Top","Right","Bottom","Left"],en=["Webkit","O","Moz","ms"];x.fn.extend({css:function(e,n){return x.access(this,function(e,n,r){var i,o,a={},s=0;if(x.isArray(n)){for(o=Rt(e),i=n.length;i>s;s++)a[n[s]]=x.css(e,n[s],!1,o);return a}return r!==t?x.style(e,n,r):x.css(e,n)},e,n,arguments.length>1)},show:function(){return rn(this,!0)},hide:function(){return rn(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){nn(this)?x(this).show():x(this).hide()})}}),x.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Wt(e,"opacity");return""===n?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":x.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var o,a,s,l=x.camelCase(n),u=e.style;if(n=x.cssProps[l]||(x.cssProps[l]=tn(u,l)),s=x.cssHooks[n]||x.cssHooks[l],r===t)return s&&"get"in s&&(o=s.get(e,!1,i))!==t?o:u[n];if(a=typeof r,"string"===a&&(o=Jt.exec(r))&&(r=(o[1]+1)*o[2]+parseFloat(x.css(e,n)),a="number"),!(null==r||"number"===a&&isNaN(r)||("number"!==a||x.cssNumber[l]||(r+="px"),x.support.clearCloneStyle||""!==r||0!==n.indexOf("background")||(u[n]="inherit"),s&&"set"in s&&(r=s.set(e,r,i))===t)))try{u[n]=r}catch(c){}}},css:function(e,n,r,i){var o,a,s,l=x.camelCase(n);return n=x.cssProps[l]||(x.cssProps[l]=tn(e.style,l)),s=x.cssHooks[n]||x.cssHooks[l],s&&"get"in s&&(a=s.get(e,!0,r)),a===t&&(a=Wt(e,n,i)),"normal"===a&&n in Kt&&(a=Kt[n]),""===r||r?(o=parseFloat(a),r===!0||x.isNumeric(o)?o||0:a):a}}),e.getComputedStyle?(Rt=function(t){return e.getComputedStyle(t,null)},Wt=function(e,n,r){var i,o,a,s=r||Rt(e),l=s?s.getPropertyValue(n)||s[n]:t,u=e.style;return s&&(""!==l||x.contains(e.ownerDocument,e)||(l=x.style(e,n)),Yt.test(l)&&Ut.test(n)&&(i=u.width,o=u.minWidth,a=u.maxWidth,u.minWidth=u.maxWidth=u.width=l,l=s.width,u.width=i,u.minWidth=o,u.maxWidth=a)),l}):a.documentElement.currentStyle&&(Rt=function(e){return e.currentStyle},Wt=function(e,n,r){var i,o,a,s=r||Rt(e),l=s?s[n]:t,u=e.style;return null==l&&u&&u[n]&&(l=u[n]),Yt.test(l)&&!zt.test(n)&&(i=u.left,o=e.runtimeStyle,a=o&&o.left,a&&(o.left=e.currentStyle.left),u.left="fontSize"===n?"1em":l,l=u.pixelLeft+"px",u.left=i,a&&(o.left=a)),""===l?"auto":l}),x.each(["height","width"],function(e,n){x.cssHooks[n]={get:function(e,r,i){return r?0===e.offsetWidth&&Xt.test(x.css(e,"display"))?x.swap(e,Qt,function(){return sn(e,n,i)}):sn(e,n,i):t},set:function(e,t,r){var i=r&&Rt(e);return on(e,t,r?an(e,n,r,x.support.boxSizing&&"border-box"===x.css(e,"boxSizing",!1,i),i):0)}}}),x.support.opacity||(x.cssHooks.opacity={get:function(e,t){return It.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=x.isNumeric(t)?"alpha(opacity="+100*t+")":"",o=r&&r.filter||n.filter||"";n.zoom=1,(t>=1||""===t)&&""===x.trim(o.replace($t,""))&&n.removeAttribute&&(n.removeAttribute("filter"),""===t||r&&!r.filter)||(n.filter=$t.test(o)?o.replace($t,i):o+" "+i)}}),x(function(){x.support.reliableMarginRight||(x.cssHooks.marginRight={get:function(e,n){return n?x.swap(e,{display:"inline-block"},Wt,[e,"marginRight"]):t}}),!x.support.pixelPosition&&x.fn.position&&x.each(["top","left"],function(e,n){x.cssHooks[n]={get:function(e,r){return r?(r=Wt(e,n),Yt.test(r)?x(e).position()[n]+"px":r):t}}})}),x.expr&&x.expr.filters&&(x.expr.filters.hidden=function(e){return 0>=e.offsetWidth&&0>=e.offsetHeight||!x.support.reliableHiddenOffsets&&"none"===(e.style&&e.style.display||x.css(e,"display"))},x.expr.filters.visible=function(e){return!x.expr.filters.hidden(e)}),x.each({margin:"",padding:"",border:"Width"},function(e,t){x.cssHooks[e+t]={expand:function(n){for(var r=0,i={},o="string"==typeof n?n.split(" "):[n];4>r;r++)i[e+Zt[r]+t]=o[r]||o[r-2]||o[0];return i}},Ut.test(e)||(x.cssHooks[e+t].set=on)});var cn=/%20/g,pn=/\[\]$/,fn=/\r?\n/g,dn=/^(?:submit|button|image|reset|file)$/i,hn=/^(?:input|select|textarea|keygen)/i;x.fn.extend({serialize:function(){return x.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=x.prop(this,"elements");return e?x.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!x(this).is(":disabled")&&hn.test(this.nodeName)&&!dn.test(e)&&(this.checked||!Ct.test(e))}).map(function(e,t){var n=x(this).val();return null==n?null:x.isArray(n)?x.map(n,function(e){return{name:t.name,value:e.replace(fn,"\r\n")}}):{name:t.name,value:n.replace(fn,"\r\n")}}).get()}}),x.param=function(e,n){var r,i=[],o=function(e,t){t=x.isFunction(t)?t():null==t?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(n===t&&(n=x.ajaxSettings&&x.ajaxSettings.traditional),x.isArray(e)||e.jquery&&!x.isPlainObject(e))x.each(e,function(){o(this.name,this.value)});else for(r in e)gn(r,e[r],n,o);return i.join("&").replace(cn,"+")},x.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(e,t){x.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),x.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)}});var mn,yn,vn=x.now(),bn=/\?/,xn=/#.*$/,wn=/([?&])_=[^&]*/,Tn=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Cn=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Nn=/^(?:GET|HEAD)$/,kn=/^\/\//,En=/^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,Sn=x.fn.load,An={},jn={},Dn="*/".concat("*");try{yn=o.href}catch(Ln){yn=a.createElement("a"),yn.href="",yn=yn.href}mn=En.exec(yn.toLowerCase())||[],x.fn.load=function(e,n,r){if("string"!=typeof e&&Sn)return Sn.apply(this,arguments);var i,o,a,s=this,l=e.indexOf(" ");return l>=0&&(i=e.slice(l,e.length),e=e.slice(0,l)),x.isFunction(n)?(r=n,n=t):n&&"object"==typeof n&&(a="POST"),s.length>0&&x.ajax({url:e,type:a,dataType:"html",data:n}).done(function(e){o=arguments,s.html(i?x("
").append(x.parseHTML(e)).find(i):e)}).complete(r&&function(e,t){s.each(r,o||[e.responseText,t,e])}),this},x.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){x.fn[t]=function(e){return this.on(t,e)}}),x.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:yn,type:"GET",isLocal:Cn.test(mn[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Dn,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":x.parseJSON,"text xml":x.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?_n(_n(e,x.ajaxSettings),t):_n(x.ajaxSettings,e)},ajaxPrefilter:Hn(An),ajaxTransport:Hn(jn),ajax:function(e,n){function k(e,n,r,i){var c,y,v,w,T,N=n;2!==b&&(b=2,s&&clearTimeout(s),u=t,a=i||"",C.readyState=e>0?4:0,c=e>=200&&300>e||304===e,r&&(w=Mn(p,C,r)),w=On(p,w,C,c),c?(p.ifModified&&(T=C.getResponseHeader("Last-Modified"),T&&(x.lastModified[o]=T),T=C.getResponseHeader("etag"),T&&(x.etag[o]=T)),204===e||"HEAD"===p.type?N="nocontent":304===e?N="notmodified":(N=w.state,y=w.data,v=w.error,c=!v)):(v=N,(e||!N)&&(N="error",0>e&&(e=0))),C.status=e,C.statusText=(n||N)+"",c?h.resolveWith(f,[y,N,C]):h.rejectWith(f,[C,N,v]),C.statusCode(m),m=t,l&&d.trigger(c?"ajaxSuccess":"ajaxError",[C,p,c?y:v]),g.fireWith(f,[C,N]),l&&(d.trigger("ajaxComplete",[C,p]),--x.active||x.event.trigger("ajaxStop")))}"object"==typeof e&&(n=e,e=t),n=n||{};var r,i,o,a,s,l,u,c,p=x.ajaxSetup({},n),f=p.context||p,d=p.context&&(f.nodeType||f.jquery)?x(f):x.event,h=x.Deferred(),g=x.Callbacks("once memory"),m=p.statusCode||{},y={},v={},b=0,w="canceled",C={readyState:0,getResponseHeader:function(e){var t;if(2===b){if(!c)for(c={};t=Tn.exec(a);)c[t[1].toLowerCase()]=t[2];t=c[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===b?a:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return b||(e=v[n]=v[n]||e,y[e]=t),this},overrideMimeType:function(e){return b||(p.mimeType=e),this},statusCode:function(e){var t;if(e)if(2>b)for(t in e)m[t]=[m[t],e[t]];else C.always(e[C.status]);return this},abort:function(e){var t=e||w;return u&&u.abort(t),k(0,t),this}};if(h.promise(C).complete=g.add,C.success=C.done,C.error=C.fail,p.url=((e||p.url||yn)+"").replace(xn,"").replace(kn,mn[1]+"//"),p.type=n.method||n.type||p.method||p.type,p.dataTypes=x.trim(p.dataType||"*").toLowerCase().match(T)||[""],null==p.crossDomain&&(r=En.exec(p.url.toLowerCase()),p.crossDomain=!(!r||r[1]===mn[1]&&r[2]===mn[2]&&(r[3]||("http:"===r[1]?"80":"443"))===(mn[3]||("http:"===mn[1]?"80":"443")))),p.data&&p.processData&&"string"!=typeof p.data&&(p.data=x.param(p.data,p.traditional)),qn(An,p,n,C),2===b)return C;l=p.global,l&&0===x.active++&&x.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!Nn.test(p.type),o=p.url,p.hasContent||(p.data&&(o=p.url+=(bn.test(o)?"&":"?")+p.data,delete p.data),p.cache===!1&&(p.url=wn.test(o)?o.replace(wn,"$1_="+vn++):o+(bn.test(o)?"&":"?")+"_="+vn++)),p.ifModified&&(x.lastModified[o]&&C.setRequestHeader("If-Modified-Since",x.lastModified[o]),x.etag[o]&&C.setRequestHeader("If-None-Match",x.etag[o])),(p.data&&p.hasContent&&p.contentType!==!1||n.contentType)&&C.setRequestHeader("Content-Type",p.contentType),C.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+Dn+"; q=0.01":""):p.accepts["*"]);for(i in p.headers)C.setRequestHeader(i,p.headers[i]);if(p.beforeSend&&(p.beforeSend.call(f,C,p)===!1||2===b))return C.abort();w="abort";for(i in{success:1,error:1,complete:1})C[i](p[i]);if(u=qn(jn,p,n,C)){C.readyState=1,l&&d.trigger("ajaxSend",[C,p]),p.async&&p.timeout>0&&(s=setTimeout(function(){C.abort("timeout")},p.timeout));try{b=1,u.send(y,k)}catch(N){if(!(2>b))throw N;k(-1,N)}}else k(-1,"No Transport");return C},getJSON:function(e,t,n){return x.get(e,t,n,"json")},getScript:function(e,n){return x.get(e,t,n,"script")}}),x.each(["get","post"],function(e,n){x[n]=function(e,r,i,o){return x.isFunction(r)&&(o=o||i,i=r,r=t),x.ajax({url:e,type:n,dataType:o,data:r,success:i})}}),x.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(e){return x.globalEval(e),e}}}),x.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),x.ajaxTransport("script",function(e){if(e.crossDomain){var n,r=a.head||x("head")[0]||a.documentElement;return{send:function(t,i){n=a.createElement("script"),n.async=!0,e.scriptCharset&&(n.charset=e.scriptCharset),n.src=e.url,n.onload=n.onreadystatechange=function(e,t){(t||!n.readyState||/loaded|complete/.test(n.readyState))&&(n.onload=n.onreadystatechange=null,n.parentNode&&n.parentNode.removeChild(n),n=null,t||i(200,"success"))},r.insertBefore(n,r.firstChild)},abort:function(){n&&n.onload(t,!0)}}}});var Fn=[],Bn=/(=)\?(?=&|$)|\?\?/;x.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Fn.pop()||x.expando+"_"+vn++;return this[e]=!0,e}}),x.ajaxPrefilter("json jsonp",function(n,r,i){var o,a,s,l=n.jsonp!==!1&&(Bn.test(n.url)?"url":"string"==typeof n.data&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&Bn.test(n.data)&&"data");return l||"jsonp"===n.dataTypes[0]?(o=n.jsonpCallback=x.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,l?n[l]=n[l].replace(Bn,"$1"+o):n.jsonp!==!1&&(n.url+=(bn.test(n.url)?"&":"?")+n.jsonp+"="+o),n.converters["script json"]=function(){return s||x.error(o+" was not called"),s[0]},n.dataTypes[0]="json",a=e[o],e[o]=function(){s=arguments},i.always(function(){e[o]=a,n[o]&&(n.jsonpCallback=r.jsonpCallback,Fn.push(o)),s&&x.isFunction(a)&&a(s[0]),s=a=t}),"script"):t});var Pn,Rn,Wn=0,$n=e.ActiveXObject&&function(){var e;for(e in Pn)Pn[e](t,!0)};x.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&In()||zn()}:In,Rn=x.ajaxSettings.xhr(),x.support.cors=!!Rn&&"withCredentials"in Rn,Rn=x.support.ajax=!!Rn,Rn&&x.ajaxTransport(function(n){if(!n.crossDomain||x.support.cors){var r;return{send:function(i,o){var a,s,l=n.xhr();if(n.username?l.open(n.type,n.url,n.async,n.username,n.password):l.open(n.type,n.url,n.async),n.xhrFields)for(s in n.xhrFields)l[s]=n.xhrFields[s];n.mimeType&&l.overrideMimeType&&l.overrideMimeType(n.mimeType),n.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest");try{for(s in i)l.setRequestHeader(s,i[s])}catch(u){}l.send(n.hasContent&&n.data||null),r=function(e,i){var s,u,c,p;try{if(r&&(i||4===l.readyState))if(r=t,a&&(l.onreadystatechange=x.noop,$n&&delete Pn[a]),i)4!==l.readyState&&l.abort();else{p={},s=l.status,u=l.getAllResponseHeaders(),"string"==typeof l.responseText&&(p.text=l.responseText);try{c=l.statusText}catch(f){c=""}s||!n.isLocal||n.crossDomain?1223===s&&(s=204):s=p.text?200:404}}catch(d){i||o(-1,d)}p&&o(s,c,p,u)},n.async?4===l.readyState?setTimeout(r):(a=++Wn,$n&&(Pn||(Pn={},x(e).unload($n)),Pn[a]=r),l.onreadystatechange=r):r()},abort:function(){r&&r(t,!0)}}}});var Xn,Un,Vn=/^(?:toggle|show|hide)$/,Yn=RegExp("^(?:([+-])=|)("+w+")([a-z%]*)$","i"),Jn=/queueHooks$/,Gn=[nr],Qn={"*":[function(e,t){var n=this.createTween(e,t),r=n.cur(),i=Yn.exec(t),o=i&&i[3]||(x.cssNumber[e]?"":"px"),a=(x.cssNumber[e]||"px"!==o&&+r)&&Yn.exec(x.css(n.elem,e)),s=1,l=20;if(a&&a[3]!==o){o=o||a[3],i=i||[],a=+r||1;do s=s||".5",a/=s,x.style(n.elem,e,a+o);while(s!==(s=n.cur()/r)&&1!==s&&--l)}return i&&(a=n.start=+a||+r||0,n.unit=o,n.end=i[1]?a+(i[1]+1)*i[2]:+i[2]),n}]};x.Animation=x.extend(er,{tweener:function(e,t){x.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");for(var n,r=0,i=e.length;i>r;r++)n=e[r],Qn[n]=Qn[n]||[],Qn[n].unshift(t)},prefilter:function(e,t){t?Gn.unshift(e):Gn.push(e)}}),x.Tween=rr,rr.prototype={constructor:rr,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||"swing",this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(x.cssNumber[n]?"":"px")},cur:function(){var e=rr.propHooks[this.prop];return e&&e.get?e.get(this):rr.propHooks._default.get(this)},run:function(e){var t,n=rr.propHooks[this.prop];return this.pos=t=this.options.duration?x.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):rr.propHooks._default.set(this),this}},rr.prototype.init.prototype=rr.prototype,rr.propHooks={_default:{get:function(e){var t;return null==e.elem[e.prop]||e.elem.style&&null!=e.elem.style[e.prop]?(t=x.css(e.elem,e.prop,""),t&&"auto"!==t?t:0):e.elem[e.prop]},set:function(e){x.fx.step[e.prop]?x.fx.step[e.prop](e):e.elem.style&&(null!=e.elem.style[x.cssProps[e.prop]]||x.cssHooks[e.prop])?x.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},rr.propHooks.scrollTop=rr.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},x.each(["toggle","show","hide"],function(e,t){var n=x.fn[t];x.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(ir(t,!0),e,r,i)}}),x.fn.extend({fadeTo:function(e,t,n,r){return this.filter(nn).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=x.isEmptyObject(e),o=x.speed(t,n,r),a=function(){var t=er(this,x.extend({},e),o);(i||x._data(this,"finish"))&&t.stop(!0)};return a.finish=a,i||o.queue===!1?this.each(a):this.queue(o.queue,a)},stop:function(e,n,r){var i=function(e){var t=e.stop;delete e.stop,t(r)};return"string"!=typeof e&&(r=n,n=e,e=t),n&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,n=null!=e&&e+"queueHooks",o=x.timers,a=x._data(this);if(n)a[n]&&a[n].stop&&i(a[n]);else for(n in a)a[n]&&a[n].stop&&Jn.test(n)&&i(a[n]);for(n=o.length;n--;)o[n].elem!==this||null!=e&&o[n].queue!==e||(o[n].anim.stop(r),t=!1,o.splice(n,1));(t||!r)&&x.dequeue(this,e)})},finish:function(e){return e!==!1&&(e=e||"fx"),this.each(function(){var t,n=x._data(this),r=n[e+"queue"],i=n[e+"queueHooks"],o=x.timers,a=r?r.length:0;for(n.finish=!0,x.queue(this,e,[]),i&&i.stop&&i.stop.call(this,!0),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;a>t;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish})}}),x.each({slideDown:ir("show"),slideUp:ir("hide"),slideToggle:ir("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){x.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),x.speed=function(e,t,n){var r=e&&"object"==typeof e?x.extend({},e):{complete:n||!n&&t||x.isFunction(e)&&e,duration:e,easing:n&&t||t&&!x.isFunction(t)&&t};return r.duration=x.fx.off?0:"number"==typeof r.duration?r.duration:r.duration in x.fx.speeds?x.fx.speeds[r.duration]:x.fx.speeds._default,(null==r.queue||r.queue===!0)&&(r.queue="fx"),r.old=r.complete,r.complete=function(){x.isFunction(r.old)&&r.old.call(this),r.queue&&x.dequeue(this,r.queue)},r},x.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},x.timers=[],x.fx=rr.prototype.init,x.fx.tick=function(){var e,n=x.timers,r=0;for(Xn=x.now();n.length>r;r++)e=n[r],e()||n[r]!==e||n.splice(r--,1);n.length||x.fx.stop(),Xn=t},x.fx.timer=function(e){e()&&x.timers.push(e)&&x.fx.start()},x.fx.interval=13,x.fx.start=function(){Un||(Un=setInterval(x.fx.tick,x.fx.interval))},x.fx.stop=function(){clearInterval(Un),Un=null},x.fx.speeds={slow:600,fast:200,_default:400},x.fx.step={},x.expr&&x.expr.filters&&(x.expr.filters.animated=function(e){return x.grep(x.timers,function(t){return e===t.elem}).length}),x.fn.offset=function(e){if(arguments.length)return e===t?this:this.each(function(t){x.offset.setOffset(this,e,t)});var n,r,o={top:0,left:0},a=this[0],s=a&&a.ownerDocument;return s?(n=s.documentElement,x.contains(n,a)?(typeof a.getBoundingClientRect!==i&&(o=a.getBoundingClientRect()),r=or(s),{top:o.top+(r.pageYOffset||n.scrollTop)-(n.clientTop||0),left:o.left+(r.pageXOffset||n.scrollLeft)-(n.clientLeft||0)}):o):void 0},x.offset={setOffset:function(e,t,n){var r=x.css(e,"position");"static"===r&&(e.style.position="relative");var p,f,i=x(e),o=i.offset(),a=x.css(e,"top"),s=x.css(e,"left"),l=("absolute"===r||"fixed"===r)&&x.inArray("auto",[a,s])>-1,u={},c={};l?(c=i.position(),p=c.top,f=c.left):(p=parseFloat(a)||0,f=parseFloat(s)||0),x.isFunction(t)&&(t=t.call(e,n,o)),null!=t.top&&(u.top=t.top-o.top+p),null!=t.left&&(u.left=t.left-o.left+f),"using"in t?t.using.call(e,u):i.css(u)}},x.fn.extend({position:function(){if(this[0]){var e,t,n={top:0,left:0},r=this[0];return"fixed"===x.css(r,"position")?t=r.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),x.nodeName(e[0],"html")||(n=e.offset()),n.top+=x.css(e[0],"borderTopWidth",!0),n.left+=x.css(e[0],"borderLeftWidth",!0)),{top:t.top-n.top-x.css(r,"marginTop",!0),left:t.left-n.left-x.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent||s;e&&!x.nodeName(e,"html")&&"static"===x.css(e,"position");)e=e.offsetParent;return e||s})}}),x.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r=/Y/.test(n);x.fn[e]=function(i){return x.access(this,function(e,i,o){var a=or(e);return o===t?a?n in a?a[n]:a.document.documentElement[i]:e[i]:(a?a.scrollTo(r?x(a).scrollLeft():o,r?o:x(a).scrollTop()):e[i]=o,t)},e,i,arguments.length,null)}}),x.each({Height:"height",Width:"width"},function(e,n){x.each({padding:"inner"+e,content:n,"":"outer"+e},function(r,i){x.fn[i]=function(i,o){var a=arguments.length&&(r||"boolean"!=typeof i),s=r||(i===!0||o===!0?"margin":"border");return x.access(this,function(n,r,i){var o;return x.isWindow(n)?n.document.documentElement["client"+e]:9===n.nodeType?(o=n.documentElement,Math.max(n.body["scroll"+e],o["scroll"+e],n.body["offset"+e],o["offset"+e],o["client"+e])):i===t?x.css(n,r,s):x.style(n,r,i,s)},n,a?i:t,a,null)}})}),x.fn.size=function(){return this.length},x.fn.andSelf=x.fn.addBack,"object"==typeof module&&module&&"object"==typeof module.exports?module.exports=x:(e.jQuery=e.$=x,"function"==typeof define&&define.amd&&define("jquery",[],function(){return x}))}(window),+function($){"use strict";var dismiss='[data-dismiss="alert"]',Alert=function(el){$(el).on("click",dismiss,this.close)};Alert.prototype.close=function(e){function removeElement(){$parent.trigger("closed.bs.alert").remove()}var $this=$(this),selector=$this.attr("data-target");selector||(selector=$this.attr("href"),selector=selector&&selector.replace(/.*(?=#[^\s]*$)/,""));var $parent=$(selector);e&&e.preventDefault(),$parent.length||($parent=$this.hasClass("alert")?$this:$this.parent()),$parent.trigger(e=$.Event("close.bs.alert")),e.isDefaultPrevented()||($parent.removeClass("in"),$.support.transition&&$parent.hasClass("fade")?$parent.one($.support.transition.end,removeElement).emulateTransitionEnd(150):removeElement())};var old=$.fn.alert;$.fn.alert=function(option){return this.each(function(){var $this=$(this),data=$this.data("bs.alert");data||$this.data("bs.alert",data=new Alert(this)),"string"==typeof option&&data[option].call($this)})},$.fn.alert.Constructor=Alert,$.fn.alert.noConflict=function(){return $.fn.alert=old,this},$(document).on("click.bs.alert.data-api",dismiss,Alert.prototype.close)}(window.jQuery),+function($){"use strict";function clearMenus(){$(backdrop).remove(),$(toggle).each(function(e){var $parent=getParent($(this));$parent.hasClass("open")&&($parent.trigger(e=$.Event("hide.bs.dropdown")),e.isDefaultPrevented()||$parent.removeClass("open").trigger("hidden.bs.dropdown"))})}function getParent($this){var selector=$this.attr("data-target");selector||(selector=$this.attr("href"),selector=selector&&/#/.test(selector)&&selector.replace(/.*(?=#[^\s]*$)/,""));var $parent=selector&&$(selector);return $parent&&$parent.length?$parent:$this.parent()}var backdrop=".dropdown-backdrop",toggle="[data-toggle=dropdown]",Dropdown=function(element){$(element).on("click.bs.dropdown",this.toggle)};Dropdown.prototype.toggle=function(e){var $this=$(this);if(!$this.is(".disabled, :disabled")){var $parent=getParent($this),isActive=$parent.hasClass("open");if(clearMenus(),!isActive){if("ontouchstart"in document.documentElement&&!$parent.closest(".navbar-nav").length&&$('
"),rowStarted=!0),fragments.push('")}if(rowStarted&&fragments.push(""),0!=fragments.length){var table='
'+entry.label+"
'+fragments.join("")+"
";if(null!=options.legend.container)$(options.legend.container).html(table);else{var pos="",p=options.legend.position,m=options.legend.margin;null==m[0]&&(m=[m,m]),"n"==p.charAt(0)?pos+="top:"+(m[1]+plotOffset.top)+"px;":"s"==p.charAt(0)&&(pos+="bottom:"+(m[1]+plotOffset.bottom)+"px;"),"e"==p.charAt(1)?pos+="right:"+(m[0]+plotOffset.right)+"px;":"w"==p.charAt(1)&&(pos+="left:"+(m[0]+plotOffset.left)+"px;");var legend=$('
'+table.replace('style="','style="position:absolute;'+pos+";")+"
").appendTo(placeholder);if(0!=options.legend.backgroundOpacity){var c=options.legend.backgroundColor;null==c&&(c=options.grid.backgroundColor,c=c&&"string"==typeof c?$.color.parse(c):$.color.extract(legend,"background-color"),c.a=1,c=c.toString());var div=legend.children();$('
').prependTo(legend).css("opacity",options.legend.backgroundOpacity)}}}}}function findNearbyItem(mouseX,mouseY,seriesFilter){var i,j,ps,maxDistance=options.grid.mouseActiveRadius,smallestDistance=maxDistance*maxDistance+1,item=null;for(i=series.length-1;i>=0;--i)if(seriesFilter(series[i])){var s=series[i],axisx=s.xaxis,axisy=s.yaxis,points=s.datapoints.points,mx=axisx.c2p(mouseX),my=axisy.c2p(mouseY),maxx=maxDistance/axisx.scale,maxy=maxDistance/axisy.scale;if(ps=s.datapoints.pointsize,axisx.options.inverseTransform&&(maxx=Number.MAX_VALUE),axisy.options.inverseTransform&&(maxy=Number.MAX_VALUE),s.lines.show||s.points.show)for(j=0;jmaxx||-maxx>x-mx||y-my>maxy||-maxy>y-my)){var dx=Math.abs(axisx.p2c(x)-mouseX),dy=Math.abs(axisy.p2c(y)-mouseY),dist=dx*dx+dy*dy;smallestDistance>dist&&(smallestDistance=dist,item=[i,j/ps])}}if(s.bars.show&&!item){var barLeft="left"==s.bars.align?0:-s.bars.barWidth/2,barRight=barLeft+s.bars.barWidth;for(j=0;j=Math.min(b,x)&&my>=y+barLeft&&y+barRight>=my:mx>=x+barLeft&&x+barRight>=mx&&my>=Math.min(b,y)&&my<=Math.max(b,y))&&(item=[i,j/ps])}}}return item?(i=item[0],j=item[1],ps=series[i].datapoints.pointsize,{datapoint:series[i].datapoints.points.slice(j*ps,(j+1)*ps),dataIndex:j,series:series[i],seriesIndex:i}):null}function onMouseMove(e){options.grid.hoverable&&triggerClickHoverEvent("plothover",e,function(s){return 0!=s.hoverable})}function onMouseLeave(e){options.grid.hoverable&&triggerClickHoverEvent("plothover",e,function(s){return!1})}function onClick(e){triggerClickHoverEvent("plotclick",e,function(s){return 0!=s.clickable})}function triggerClickHoverEvent(eventname,event,seriesFilter){var offset=eventHolder.offset(),canvasX=event.pageX-offset.left-plotOffset.left,canvasY=event.pageY-offset.top-plotOffset.top,pos=canvasToAxisCoords({left:canvasX,top:canvasY});pos.pageX=event.pageX,pos.pageY=event.pageY;var item=findNearbyItem(canvasX,canvasY,seriesFilter);if(item&&(item.pageX=parseInt(item.series.xaxis.p2c(item.datapoint[0])+offset.left+plotOffset.left,10),item.pageY=parseInt(item.series.yaxis.p2c(item.datapoint[1])+offset.top+plotOffset.top,10)),options.grid.autoHighlight){for(var i=0;iaxisx.max||yaxisy.max)){var pointRadius=series.points.radius+series.points.lineWidth/2;octx.lineWidth=pointRadius,octx.strokeStyle=highlightColor;var radius=1.5*pointRadius;x=axisx.p2c(x),y=axisy.p2c(y),octx.beginPath(),"circle"==series.points.symbol?octx.arc(x,y,radius,0,2*Math.PI,!1):series.points.symbol(octx,x,y,radius,!1),octx.closePath(),octx.stroke()}}function drawBarHighlight(series,point){var highlightColor="string"==typeof series.highlightColor?series.highlightColor:$.color.parse(series.color).scale("a",.5).toString(),fillStyle=highlightColor,barLeft="left"==series.bars.align?0:-series.bars.barWidth/2;octx.lineWidth=series.bars.lineWidth,octx.strokeStyle=highlightColor,drawBar(point[0],point[1],point[2]||0,barLeft,barLeft+series.bars.barWidth,0,function(){return fillStyle},series.xaxis,series.yaxis,octx,series.bars.horizontal,series.bars.lineWidth)}function getColorOrGradient(spec,bottom,top,defaultColor){if("string"==typeof spec)return spec;for(var gradient=ctx.createLinearGradient(0,top,0,bottom),i=0,l=spec.colors.length;l>i;++i){var c=spec.colors[i];if("string"!=typeof c){var co=$.color.parse(defaultColor);null!=c.brightness&&(co=co.scale("rgb",c.brightness)),null!=c.opacity&&(co.a*=c.opacity),c=co.toString()}gradient.addColorStop(i/(l-1),c)}return gradient}var series=[],options={colors:["#edc240","#afd8f8","#cb4b4b","#4da74d","#9440ed"],legend:{show:!0,noColumns:1,labelFormatter:null,labelBoxBorderColor:"#ccc",container:null,position:"ne",margin:5,backgroundColor:null,backgroundOpacity:.85,sorted:null},xaxis:{show:null,position:"bottom",mode:null,font:null,color:null,tickColor:null,transform:null,inverseTransform:null,min:null,max:null,autoscaleMargin:null,ticks:null,tickFormatter:null,labelWidth:null,labelHeight:null,reserveSpace:null,tickLength:null,alignTicksWithAxis:null,tickDecimals:null,tickSize:null,minTickSize:null},yaxis:{autoscaleMargin:.02,position:"left"},xaxes:[],yaxes:[],series:{points:{show:!1,radius:3,lineWidth:2,fill:!0,fillColor:"#ffffff",symbol:"circle"},lines:{lineWidth:2,fill:!1,fillColor:null,steps:!1},bars:{show:!1,lineWidth:2,barWidth:1,fill:!0,fillColor:null,align:"left",horizontal:!1,zero:!0},shadowSize:3,highlightColor:null},grid:{show:!0,aboveData:!1,color:"#545454",backgroundColor:null,borderColor:null,tickColor:null,margin:0,labelMargin:5,axisMargin:8,borderWidth:2,minBorderMargin:null,markings:null,markingsColor:"#f4f4f4",markingsLineWidth:2,clickable:!1,hoverable:!1,autoHighlight:!0,mouseActiveRadius:10},interaction:{redrawOverlayInterval:1e3/60},hooks:{}},surface=null,overlay=null,eventHolder=null,ctx=null,octx=null,xaxes=[],yaxes=[],plotOffset={left:0,right:0,top:0,bottom:0},plotWidth=0,plotHeight=0,hooks={processOptions:[],processRawData:[],processDatapoints:[],processOffset:[],drawBackground:[],drawSeries:[],draw:[],bindEvents:[],drawOverlay:[],shutdown:[]},plot=this;plot.setData=setData,plot.setupGrid=setupGrid,plot.draw=draw,plot.getPlaceholder=function(){return placeholder},plot.getCanvas=function(){return surface.element},plot.getPlotOffset=function(){return plotOffset},plot.width=function(){return plotWidth},plot.height=function(){return plotHeight},plot.offset=function(){var o=eventHolder.offset();return o.left+=plotOffset.left,o.top+=plotOffset.top,o},plot.getData=function(){return series},plot.getAxes=function(){var res={};return $.each(xaxes.concat(yaxes),function(_,axis){axis&&(res[axis.direction+(1!=axis.n?axis.n:"")+"axis"]=axis)}),res},plot.getXAxes=function(){return xaxes},plot.getYAxes=function(){return yaxes},plot.c2p=canvasToAxisCoords,plot.p2c=axisToCanvasCoords,plot.getOptions=function(){return options},plot.highlight=highlight,plot.unhighlight=unhighlight,plot.triggerRedrawOverlay=triggerRedrawOverlay,plot.pointOffset=function(point){return{left:parseInt(xaxes[axisNumber(point,"x")-1].p2c(+point.x)+plotOffset.left,10),top:parseInt(yaxes[axisNumber(point,"y")-1].p2c(+point.y)+plotOffset.top,10)}},plot.shutdown=shutdown,plot.resize=function(){var width=placeholder.width(),height=placeholder.height();surface.resize(width,height),overlay.resize(width,height)},plot.hooks=hooks,initPlugins(plot),parseOptions(options_),setupCanvases(),setData(data_),setupGrid(),draw(),bindEvents();var highlights=[],redrawTimeout=null}function floorInBase(n,base){return base*Math.floor(n/base)}var hasOwnProperty=Object.prototype.hasOwnProperty;Canvas.prototype.resize=function(width,height){if(0>=width||0>=height)throw new Error("Invalid dimensions for plot, width = "+width+", height = "+height);var element=this.element,context=this.context,pixelRatio=this.pixelRatio;this.width!=width&&(element.width=width*pixelRatio,element.style.width=width+"px",this.width=width),this.height!=height&&(element.height=height*pixelRatio,element.style.height=height+"px",this.height=height),context.restore(),context.save(),context.scale(pixelRatio,pixelRatio)},Canvas.prototype.clear=function(){this.context.clearRect(0,0,this.width,this.height)},Canvas.prototype.render=function(){var cache=this._textCache;for(var layerKey in cache)if(hasOwnProperty.call(cache,layerKey)){var layer=this.getTextLayer(layerKey),layerCache=cache[layerKey];layer.hide();for(var styleKey in layerCache)if(hasOwnProperty.call(layerCache,styleKey)){var styleCache=layerCache[styleKey];for(var key in styleCache)if(hasOwnProperty.call(styleCache,key)){for(var position,positions=styleCache[key].positions,i=0;position=positions[i];i++)position.active?position.rendered||(layer.append(position.element),position.rendered=!0):(positions.splice(i--,1),position.rendered&&position.element.detach());0==positions.length&&delete styleCache[key]}}layer.show()}},Canvas.prototype.getTextLayer=function(classes){var layer=this.text[classes];return null==layer&&(null==this.textContainer&&(this.textContainer=$("
").css({position:"absolute",top:0,left:0,bottom:0,right:0,"font-size":"smaller",color:"#545454"}).insertAfter(this.element)),layer=this.text[classes]=$("
").addClass(classes).css({position:"absolute",top:0,left:0,bottom:0,right:0}).appendTo(this.textContainer)),layer},Canvas.prototype.getTextInfo=function(layer,text,font,angle,width){var textStyle,layerCache,styleCache,info;if(text=""+text,textStyle="object"==typeof font?font.style+" "+font.variant+" "+font.weight+" "+font.size+"px/"+font.lineHeight+"px "+font.family:font,layerCache=this._textCache[layer],null==layerCache&&(layerCache=this._textCache[layer]={}),styleCache=layerCache[textStyle],null==styleCache&&(styleCache=layerCache[textStyle]={}),info=styleCache[text],null==info){var element=$("
").html(text).css({position:"absolute","max-width":width,top:-9999}).appendTo(this.getTextLayer(layer));"object"==typeof font?element.css({font:textStyle,color:font.color}):"string"==typeof font&&element.addClass(font),info=styleCache[text]={width:element.outerWidth(!0),height:element.outerHeight(!0),element:element,positions:[]},element.detach()}return info},Canvas.prototype.addText=function(layer,x,y,text,font,angle,width,halign,valign){var info=this.getTextInfo(layer,text,font,angle,width),positions=info.positions;"center"==halign?x-=info.width/2:"right"==halign&&(x-=info.width),"middle"==valign?y-=info.height/2:"bottom"==valign&&(y-=info.height);for(var position,i=0;position=positions[i];i++)if(position.x==x&&position.y==y)return void(position.active=!0);position={active:!0,rendered:!1,element:positions.length?info.element.clone():info.element,x:x,y:y},positions.push(position),position.element.css({top:Math.round(y),left:Math.round(x),"text-align":halign})},Canvas.prototype.removeText=function(layer,x,y,text,font,angle){if(null==text){var layerCache=this._textCache[layer];if(null!=layerCache)for(var styleKey in layerCache)if(hasOwnProperty.call(layerCache,styleKey)){var styleCache=layerCache[styleKey];for(var key in styleCache)if(hasOwnProperty.call(styleCache,key))for(var position,positions=styleCache[key].positions,i=0;position=positions[i];i++)position.active=!1}}else for(var position,positions=this.getTextInfo(layer,text,font,angle).positions,i=0;position=positions[i];i++)position.x==x&&position.y==y&&(position.active=!1)},$.plot=function(placeholder,data,options){var plot=new Plot($(placeholder),data,options,$.plot.plugins);return plot},$.plot.version="0.8.1",$.plot.plugins=[],$.fn.plot=function(data,options){return this.each(function(){$.plot(this,data,options)})}}(jQuery),function($){function floorInBase(n,base){return base*Math.floor(n/base)}function formatDate(d,fmt,monthNames,dayNames){if("function"==typeof d.strftime)return d.strftime(fmt);var leftPad=function(n,pad){return n=""+n,pad=""+(null==pad?"0":pad),1==n.length?pad+n:n},r=[],escape=!1,hours=d.getHours(),isAM=12>hours;null==monthNames&&(monthNames=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]),null==dayNames&&(dayNames=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]);var hours12;hours12=hours>12?hours-12:0==hours?12:hours;for(var i=0;i=minSize);++i);var size=spec[i][0],unit=spec[i][1];if("year"==unit){if(null!=opts.minTickSize&&"year"==opts.minTickSize[1])size=Math.floor(opts.minTickSize[0]);else{var magn=Math.pow(10,Math.floor(Math.log(axis.delta/timeUnitSize.year)/Math.LN10)),norm=axis.delta/timeUnitSize.year/magn;size=1.5>norm?1:3>norm?2:7.5>norm?5:10,size*=magn}1>size&&(size=1)}axis.tickSize=opts.tickSize||[size,unit];var tickSize=axis.tickSize[0];unit=axis.tickSize[1];var step=tickSize*timeUnitSize[unit];"second"==unit?d.setSeconds(floorInBase(d.getSeconds(),tickSize)):"minute"==unit?d.setMinutes(floorInBase(d.getMinutes(),tickSize)):"hour"==unit?d.setHours(floorInBase(d.getHours(),tickSize)):"month"==unit?d.setMonth(floorInBase(d.getMonth(),tickSize)):"quarter"==unit?d.setMonth(3*floorInBase(d.getMonth()/3,tickSize)):"year"==unit&&d.setFullYear(floorInBase(d.getFullYear(),tickSize)),d.setMilliseconds(0),step>=timeUnitSize.minute&&d.setSeconds(0),step>=timeUnitSize.hour&&d.setMinutes(0),step>=timeUnitSize.day&&d.setHours(0),step>=4*timeUnitSize.day&&d.setDate(1),step>=2*timeUnitSize.month&&d.setMonth(floorInBase(d.getMonth(),3)),step>=2*timeUnitSize.quarter&&d.setMonth(floorInBase(d.getMonth(),6)),step>=timeUnitSize.year&&d.setMonth(0);var prev,carry=0,v=Number.NaN;do if(prev=v,v=d.getTime(),ticks.push(v),"month"==unit||"quarter"==unit)if(1>tickSize){d.setDate(1);var start=d.getTime();d.setMonth(d.getMonth()+("quarter"==unit?3:1));var end=d.getTime();d.setTime(v+carry*timeUnitSize.hour+(end-start)*tickSize),carry=d.getHours(),d.setHours(0)}else d.setMonth(d.getMonth()+tickSize*("quarter"==unit?3:1));else"year"==unit?d.setFullYear(d.getFullYear()+tickSize):d.setTime(v+step);while(vvalue?min:value>max?max:value}function setSelectionPos(pos,e){var o=plot.getOptions(),offset=plot.getPlaceholder().offset(),plotOffset=plot.getPlotOffset();pos.x=clamp(0,e.pageX-offset.left-plotOffset.left,plot.width()),pos.y=clamp(0,e.pageY-offset.top-plotOffset.top,plot.height()),"y"==o.selection.mode&&(pos.x=pos==selection.first?0:plot.width()),"x"==o.selection.mode&&(pos.y=pos==selection.first?0:plot.height())}function updateSelection(pos){null!=pos.pageX&&(setSelectionPos(selection.second,pos),selectionIsSane()?(selection.show=!0,plot.triggerRedrawOverlay()):clearSelection(!0))}function clearSelection(preventEvent){selection.show&&(selection.show=!1,plot.triggerRedrawOverlay(),preventEvent||plot.getPlaceholder().trigger("plotunselected",[]))}function extractRange(ranges,coord){var axis,from,to,key,axes=plot.getAxes();for(var k in axes)if(axis=axes[k],axis.direction==coord&&(key=coord+axis.n+"axis",ranges[key]||1!=axis.n||(key=coord+"axis"),ranges[key])){from=ranges[key].from,to=ranges[key].to;break}if(ranges[key]||(axis="x"==coord?plot.getXAxes()[0]:plot.getYAxes()[0],from=ranges[coord+"1"],to=ranges[coord+"2"]),null!=from&&null!=to&&from>to){var tmp=from;from=to,to=tmp}return{from:from,to:to,axis:axis}}function setSelection(ranges,preventEvent){var range,o=plot.getOptions();"y"==o.selection.mode?(selection.first.x=0,selection.second.x=plot.width()):(range=extractRange(ranges,"x"),selection.first.x=range.axis.p2c(range.from),selection.second.x=range.axis.p2c(range.to)),"x"==o.selection.mode?(selection.first.y=0,selection.second.y=plot.height()):(range=extractRange(ranges,"y"),selection.first.y=range.axis.p2c(range.from),selection.second.y=range.axis.p2c(range.to)),selection.show=!0,plot.triggerRedrawOverlay(),!preventEvent&&selectionIsSane()&&triggerSelectedEvent()}function selectionIsSane(){var minSize=plot.getOptions().selection.minSize;return Math.abs(selection.second.x-selection.first.x)>=minSize&&Math.abs(selection.second.y-selection.first.y)>=minSize}var selection={first:{x:-1,y:-1},second:{x:-1,y:-1},show:!1,active:!1},savedhandlers={},mouseUpHandler=null;plot.clearSelection=clearSelection,plot.setSelection=setSelection,plot.getSelection=getSelection,plot.hooks.bindEvents.push(function(plot,eventHolder){var o=plot.getOptions();null!=o.selection.mode&&(eventHolder.mousemove(onMouseMove),eventHolder.mousedown(onMouseDown))}),plot.hooks.drawOverlay.push(function(plot,ctx){if(selection.show&&selectionIsSane()){var plotOffset=plot.getPlotOffset(),o=plot.getOptions();ctx.save(),ctx.translate(plotOffset.left,plotOffset.top);var c=$.color.parse(o.selection.color);ctx.strokeStyle=c.scale("a",.8).toString(),ctx.lineWidth=1,ctx.lineJoin=o.selection.shape,ctx.fillStyle=c.scale("a",.4).toString();var x=Math.min(selection.first.x,selection.second.x)+.5,y=Math.min(selection.first.y,selection.second.y)+.5,w=Math.abs(selection.second.x-selection.first.x)-1,h=Math.abs(selection.second.y-selection.first.y)-1;ctx.fillRect(x,y,w,h),ctx.strokeRect(x,y,w,h),ctx.restore()}}),plot.hooks.shutdown.push(function(plot,eventHolder){eventHolder.unbind("mousemove",onMouseMove),eventHolder.unbind("mousedown",onMouseDown),mouseUpHandler&&$(document).unbind("mouseup",mouseUpHandler)})}$.plot.plugins.push({init:init,options:{selection:{mode:null,color:"#e8cfac",shape:"round",minSize:5}},name:"selection",version:"1.1"})}(jQuery),function($,h,c){function g(){i=h[k](function(){a.each(function(){var n=$(this),m=n.width(),l=n.height(),o=$.data(this,d);(m!==o.w||l!==o.h)&&n.trigger(j,[o.w=m,o.h=l])}),g()},e[b])}var i,a=$([]),e=$.resize=$.extend($.resize,{}),k="setTimeout",j="resize",d=j+"-special-event",b="delay",f="throttleWindow";e[b]=250,e[f]=!0,$.event.special[j]={setup:function(){if(!e[f]&&this[k])return!1;var l=$(this);a=a.add(l),$.data(this,d,{w:l.width(),h:l.height()}),1===a.length&&g()},teardown:function(){if(!e[f]&&this[k])return!1;var l=$(this);a=a.not(l),l.removeData(d),a.length||clearTimeout(i)},add:function(l){function m(s,o,p){var q=$(this),r=$.data(this,d);r.w=o!==c?o:q.width(),r.h=p!==c?p:q.height(),n.apply(this,arguments)}if(!e[f]&&this[k])return!1;var n;return $.isFunction(l)?(n=l,m):(n=l.handler,void(l.handler=m))}}}(jQuery,this),function($){function init(plot){function onResize(){var placeholder=plot.getPlaceholder();0!=placeholder.width()&&0!=placeholder.height()&&(plot.resize(),plot.setupGrid(),plot.draw())}function bindEvents(plot,eventHolder){plot.getPlaceholder().resize(onResize)}function shutdown(plot,eventHolder){plot.getPlaceholder().unbind("resize",onResize)}plot.hooks.bindEvents.push(bindEvents),plot.hooks.shutdown.push(shutdown)}var options={};$.plot.plugins.push({init:init,options:options,name:"resize",version:"1.0"})}(jQuery),$(document).ready(function(){function animateSection(sectionName,offset){$("html,body").animate({scrollTop:$(sectionName).offset().top+offset},750)}function switchStandardsList(el){standardsList.hide(),chosenValue=el.val(),$('[data-attr="'+chosenValue+'"]').show()}function getGraphData(){$($('[data-role="url-stats"]').get().reverse()).each(function(){var el=$(this);storeDatum(el,getXAxisLabel(el))})}function getXAxisLabel(el){return el.find('[data-role="date"]').attr("data-value")}function storeDatum(el,label){$.each(el.find("[data-label]"),function(){var type=$(this).attr("data-label"),value=$(this).html();"undefined"==typeof data[type]&&(data[type]=[]),data[type].push([label,+value])})}function plotGraphData(){$.plot(graphContainer,getData(),graphOptions)}function getData(){return[{color:"rgb(216, 61, 45)",label:"Errors",data:data.error},{color:"rgb(168, 103, 0)",label:"Warnings",data:data.warning},{color:"rgb(23, 123, 190)",label:"Notices",data:data.notice}]}function toggleResetZoomButton(){zoomResetButton.toggleClass("hidden")}function plotAccordingToChoices(){var data=[];choiceContainer.find("input:checked").each(function(){var key=$(this).attr("name");key&&datasets[key]&&data.push(datasets[key])}),data.length>-1&&$.plot(graphContainer,data,graphOptions)}function showTooltip(x,y,contents){$('
'+contents+"
").css({top:y+5,left:x+5}).appendTo("body").fadeIn(200)}function initTaskFilter(container){var tasks=initTaskFilterTasks(container);initTaskFilterInput(container,tasks)}function initTaskFilterTasks(container){var tasks=container.find("[data-role=task]");return tasks}function initTaskFilterInput(container,tasks){var input=container.find("[data-role=input]");return input.on("keyup",function(){filterTasks(tasks,input.val())}),input}function filterTasks(tasks,query){if(query=$.trim(query.replace(/[^a-z0-9\s]+/gi,"")),tasks.removeClass("hidden"),!/^\s*$/.test(query)){var queryRegExp=new RegExp("("+query.replace(/\s+/gi,"|")+")","i");tasks.filter(function(){return!queryRegExp.test($(this).data("keywords"))}).addClass("hidden")}}var data={},standardsList=$('[data-role="standards-list"]'),standardSelect=$('[data-role="new-task-select"]'),expandLink=$('[data-role="expander"]'),taskListSelector=$('[data-role="task-list"] a'),toTopLinks=$('[data-role="top"]'),zoomResetButton=$('[data-role="zoom-reset"]'),graphContainer=$('[data-role="graph"]'),dateSelectDropdownMenu=$('[data-role="date-select-dropdown-menu"]'),graphOptions={series:{lines:{show:!0},points:{show:!0},hoverable:!0},xaxis:{mode:"time",tickLength:0,minTickSize:[1,"day"],timeformat:"%d %b"},yaxis:{tickDecimals:0},lines:{lineWidth:3},grid:{backgroundColor:"#fff",borderColor:"#808080",hoverable:!0,clickable:!0,borderWidth:{top:1,right:1,bottom:1,left:1}},selection:{mode:"x"}};expandLink.click(function(){$(this).next().slideToggle("slow",function(){}),$(this).hasClass("showing")?($(this).find("span.expander").html("+"),$(this).attr("aria-expanded",!1)):($(this).find("span.expander").html("-"),$(this).attr("aria-expanded",!0)),$(this).toggleClass("showing")}),$(document).on("keydown.lists",'[data-role="expander"]',function(e){var $this=$(this),k=e.which||e.keyCode;/(13|32)/.test(k)&&((13===k||32===k)&&$this.click(),e.preventDefault(),e.stopPropagation())}),toTopLinks.click(function(e){e.preventDefault(),$(animateSection($("#top"),-55))}),switchStandardsList(standardSelect),$(".rules-list-title").addClass("hidden"),$(".date-links").removeClass("list-group date-links").addClass("dropdown-menu"),$(".dropdown-menu a").removeClass("list-group-item"),dateSelectDropdownMenu.removeClass("hidden"),standardSelect.change(function(){switchStandardsList($(this))}),taskListSelector.click(function(e){e.preventDefault(),target=$(this).attr("href"),animateSection($(target),-25),$(target).hasClass("showing")||$(target).click()}),zoomResetButton.click(function(){plotGraphData(),toggleResetZoomButton()}),$.each(graphContainer,function(){getGraphData(),plotGraphData()}),$('[data-role="rules-tooltip"]').tooltip(),graphContainer.bind("plotselected",function(event,ranges){ranges.xaxis.to-ranges.xaxis.from<1e-5&&(ranges.xaxis.to=ranges.xaxis.from+1e-5),ranges.yaxis.to-ranges.yaxis.from<1e-5&&(ranges.yaxis.to=ranges.yaxis.from+1e-5),plot=$.plot(graphContainer,getData(ranges.xaxis.from,ranges.xaxis.to),$.extend(!0,{},graphOptions,{xaxis:{min:ranges.xaxis.from,max:ranges.xaxis.to},yaxis:{min:ranges.yaxis.from,max:ranges.yaxis.to}})),zoomResetButton.is(":visible")||toggleResetZoomButton()});var choiceContainer=$('[data-role="series-checkboxes"]'),datasets=getData();$.each(datasets,function(key,val){var lowerCaseValue=val.label.substring(0,val.label.length-1).toLowerCase();choiceContainer.append('
  • ")}),choiceContainer.find("input").click(plotAccordingToChoices),choiceContainer.find("[data-stat-type=errors]").click();var previousPoint=null;graphContainer.bind("plothover",function(event,pos,item){if(item){if(previousPoint!=item.dataIndex){previousPoint=item.dataIndex,$('[data-role="tooltip"]').remove();var count=item.datapoint[1].toFixed(0),date=$.plot.formatDate(new Date(item.datapoint[0]),"%d %b (%H:%M)"),contents='

    '+date+"
    "+count+" "+item.series.label+"";showTooltip(item.pageX,item.pageY,contents)}}else $('[data-role="tooltip"]').remove(),previousPoint=null});var taskLists=$("[data-control=task-list]");taskLists.length>0&&$("[data-control=task-list]").each(function(){initTaskFilter($(this))}),$.fn.collapse.Constructor.prototype.keydown=function(e){var $this=$(this),k=e.which||e.keyCode;/(13|32)/.test(k)&&((13===k||32===k)&&$this.click(),e.preventDefault(),e.stopPropagation())},$('[data-toggle="collapse"]').attr("role","button").attr("tabindex",0),$(document).on("keydown.collapse.data-api",'[data-toggle="collapse"]',$.fn.collapse.Constructor.prototype.keydown)}); \ No newline at end of file +return ticks},axis.tickFormatter=function(value,axis){var factor=axis.tickDecimals?Math.pow(10,axis.tickDecimals):1,formatted=""+Math.round(value*factor)/factor;if(null!=axis.tickDecimals){var decimal=formatted.indexOf("."),precision=-1==decimal?0:formatted.length-decimal-1;if(precision0&&(null==opts.min&&(axis.min=Math.min(axis.min,niceTicks[0])),null==opts.max&&niceTicks.length>1&&(axis.max=Math.max(axis.max,niceTicks[niceTicks.length-1]))),axis.tickGenerator=function(axis){var v,i,ticks=[];for(i=0;i1&&/\..*0$/.test((ts[1]-ts[0]).toFixed(extraDec))||(axis.tickDecimals=extraDec)}}}}function setTicks(axis){var oticks=axis.options.ticks,ticks=[];null==oticks||"number"==typeof oticks&&oticks>0?ticks=axis.tickGenerator(axis):oticks&&(ticks=$.isFunction(oticks)?oticks(axis):oticks);var i,v;for(axis.ticks=[],i=0;i1&&(label=t[1])):v=+t,null==label&&(label=axis.tickFormatter(v,axis)),isNaN(v)||axis.ticks.push({v:v,label:label})}}function snapRangeToTicks(axis,ticks){axis.options.autoscaleMargin&&ticks.length>0&&(null==axis.options.min&&(axis.min=Math.min(axis.min,ticks[0].v)),null==axis.options.max&&ticks.length>1&&(axis.max=Math.max(axis.max,ticks[ticks.length-1].v)))}function draw(){surface.clear(),executeHooks(hooks.drawBackground,[ctx]);var grid=options.grid;grid.show&&grid.backgroundColor&&drawBackground(),grid.show&&!grid.aboveData&&drawGrid();for(var i=0;ito){var tmp=from;from=to,to=tmp}return{from:from,to:to,axis:axis}}function drawBackground(){ctx.save(),ctx.translate(plotOffset.left,plotOffset.top),ctx.fillStyle=getColorOrGradient(options.grid.backgroundColor,plotHeight,0,"rgba(255, 255, 255, 0)"),ctx.fillRect(0,0,plotWidth,plotHeight),ctx.restore()}function drawGrid(){var i,axes,bw,bc;ctx.save(),ctx.translate(plotOffset.left,plotOffset.top);var markings=options.grid.markings;if(markings)for($.isFunction(markings)&&(axes=plot.getAxes(),axes.xmin=axes.xaxis.min,axes.xmax=axes.xaxis.max,axes.ymin=axes.yaxis.min,axes.ymax=axes.yaxis.max,markings=markings(axes)),i=0;ixrange.axis.max||yrange.toyrange.axis.max||(xrange.from=Math.max(xrange.from,xrange.axis.min),xrange.to=Math.min(xrange.to,xrange.axis.max),yrange.from=Math.max(yrange.from,yrange.axis.min),yrange.to=Math.min(yrange.to,yrange.axis.max),(xrange.from!=xrange.to||yrange.from!=yrange.to)&&(xrange.from=xrange.axis.p2c(xrange.from),xrange.to=xrange.axis.p2c(xrange.to),yrange.from=yrange.axis.p2c(yrange.from),yrange.to=yrange.axis.p2c(yrange.to),xrange.from==xrange.to||yrange.from==yrange.to?(ctx.beginPath(),ctx.strokeStyle=m.color||options.grid.markingsColor,ctx.lineWidth=m.lineWidth||options.grid.markingsLineWidth,ctx.moveTo(xrange.from,yrange.from),ctx.lineTo(xrange.to,yrange.to),ctx.stroke()):(ctx.fillStyle=m.color||options.grid.markingsColor,ctx.fillRect(xrange.from,yrange.to,xrange.to-xrange.from,yrange.from-yrange.to))))}axes=allAxes(),bw=options.grid.borderWidth;for(var j=0;jaxis.max||"full"==t&&("object"==typeof bw&&bw[axis.position]>0||bw>0)&&(v==axis.min||v==axis.max)||("x"==axis.direction?(x=axis.p2c(v),yoff="full"==t?-plotHeight:t,"top"==axis.position&&(yoff=-yoff)):(y=axis.p2c(v),xoff="full"==t?-plotWidth:t,"left"==axis.position&&(xoff=-xoff)),1==ctx.lineWidth&&("x"==axis.direction?x=Math.floor(x)+.5:y=Math.floor(y)+.5),ctx.moveTo(x,y),ctx.lineTo(x+xoff,y+yoff))}ctx.stroke()}}bw&&(bc=options.grid.borderColor,"object"==typeof bw||"object"==typeof bc?("object"!=typeof bw&&(bw={top:bw,right:bw,bottom:bw,left:bw}),"object"!=typeof bc&&(bc={top:bc,right:bc,bottom:bc,left:bc}),bw.top>0&&(ctx.strokeStyle=bc.top,ctx.lineWidth=bw.top,ctx.beginPath(),ctx.moveTo(0-bw.left,0-bw.top/2),ctx.lineTo(plotWidth,0-bw.top/2),ctx.stroke()),bw.right>0&&(ctx.strokeStyle=bc.right,ctx.lineWidth=bw.right,ctx.beginPath(),ctx.moveTo(plotWidth+bw.right/2,0-bw.top),ctx.lineTo(plotWidth+bw.right/2,plotHeight),ctx.stroke()),bw.bottom>0&&(ctx.strokeStyle=bc.bottom,ctx.lineWidth=bw.bottom,ctx.beginPath(),ctx.moveTo(plotWidth+bw.right,plotHeight+bw.bottom/2),ctx.lineTo(0,plotHeight+bw.bottom/2),ctx.stroke()),bw.left>0&&(ctx.strokeStyle=bc.left,ctx.lineWidth=bw.left,ctx.beginPath(),ctx.moveTo(0-bw.left/2,plotHeight+bw.bottom),ctx.lineTo(0-bw.left/2,0),ctx.stroke())):(ctx.lineWidth=bw,ctx.strokeStyle=options.grid.borderColor,ctx.strokeRect(-bw/2,-bw/2,plotWidth+bw,plotHeight+bw))),ctx.restore()}function drawAxisLabels(){$.each(allAxes(),function(_,axis){if(axis.show&&0!=axis.ticks.length){var tick,x,y,halign,valign,box=axis.box,legacyStyles=axis.direction+"Axis "+axis.direction+axis.n+"Axis",layer="flot-"+axis.direction+"-axis flot-"+axis.direction+axis.n+"-axis "+legacyStyles,font=axis.options.font||"flot-tick-label tickLabel";surface.removeText(layer);for(var i=0;iaxis.max||("x"==axis.direction?(halign="center",x=plotOffset.left+axis.p2c(tick.v),"bottom"==axis.position?y=box.top+box.padding:(y=box.top+box.height-box.padding,valign="bottom")):(valign="middle",y=plotOffset.top+axis.p2c(tick.v),"left"==axis.position?(x=box.left+box.width-box.padding,halign="right"):x=box.left+box.padding),surface.addText(layer,x,y,tick.label,font,null,null,halign,valign))}})}function drawSeries(series){series.lines.show&&drawSeriesLines(series),series.bars.show&&drawSeriesBars(series),series.points.show&&drawSeriesPoints(series)}function drawSeriesLines(series){function plotLine(datapoints,xoffset,yoffset,axisx,axisy){var points=datapoints.points,ps=datapoints.pointsize,prevx=null,prevy=null;ctx.beginPath();for(var i=ps;i=y1&&y1=y2&&y2=y2&&y1>axisy.max){if(y2>axisy.max)continue;x1=(axisy.max-y1)/(y2-y1)*(x2-x1)+x1,y1=axisy.max}else if(y2>=y1&&y2>axisy.max){if(y1>axisy.max)continue;x2=(axisy.max-y1)/(y2-y1)*(x2-x1)+x1,y2=axisy.max}if(x2>=x1&&x1=x2&&x2=x2&&x1>axisx.max){if(x2>axisx.max)continue;y1=(axisx.max-x1)/(x2-x1)*(y2-y1)+y1,x1=axisx.max}else if(x2>=x1&&x2>axisx.max){if(x1>axisx.max)continue;y2=(axisx.max-x1)/(x2-x1)*(y2-y1)+y1,x2=axisx.max}(x1!=prevx||y1!=prevy)&&ctx.moveTo(axisx.p2c(x1)+xoffset,axisy.p2c(y1)+yoffset),prevx=x2,prevy=y2,ctx.lineTo(axisx.p2c(x2)+xoffset,axisy.p2c(y2)+yoffset)}}ctx.stroke()}function plotLineArea(datapoints,axisx,axisy){for(var points=datapoints.points,ps=datapoints.pointsize,bottom=Math.min(Math.max(0,axisy.min),axisy.max),i=0,areaOpen=!1,ypos=1,segmentStart=0,segmentEnd=0;;){if(ps>0&&i>points.length+ps)break;i+=ps;var x1=points[i-ps],y1=points[i-ps+ypos],x2=points[i],y2=points[i+ypos];if(areaOpen){if(ps>0&&null!=x1&&null==x2){segmentEnd=i,ps=-ps,ypos=2;continue}if(0>ps&&i==segmentStart+ps){ctx.fill(),areaOpen=!1,ps=-ps,ypos=1,i=segmentStart=segmentEnd+ps;continue}}if(null!=x1&&null!=x2){if(x2>=x1&&x1=x2&&x2=x2&&x1>axisx.max){if(x2>axisx.max)continue;y1=(axisx.max-x1)/(x2-x1)*(y2-y1)+y1,x1=axisx.max}else if(x2>=x1&&x2>axisx.max){if(x1>axisx.max)continue;y2=(axisx.max-x1)/(x2-x1)*(y2-y1)+y1,x2=axisx.max}if(areaOpen||(ctx.beginPath(),ctx.moveTo(axisx.p2c(x1),axisy.p2c(bottom)),areaOpen=!0),y1>=axisy.max&&y2>=axisy.max)ctx.lineTo(axisx.p2c(x1),axisy.p2c(axisy.max)),ctx.lineTo(axisx.p2c(x2),axisy.p2c(axisy.max));else if(y1<=axisy.min&&y2<=axisy.min)ctx.lineTo(axisx.p2c(x1),axisy.p2c(axisy.min)),ctx.lineTo(axisx.p2c(x2),axisy.p2c(axisy.min));else{var x1old=x1,x2old=x2;y2>=y1&&y1=axisy.min?(x1=(axisy.min-y1)/(y2-y1)*(x2-x1)+x1,y1=axisy.min):y1>=y2&&y2=axisy.min&&(x2=(axisy.min-y1)/(y2-y1)*(x2-x1)+x1,y2=axisy.min),y1>=y2&&y1>axisy.max&&y2<=axisy.max?(x1=(axisy.max-y1)/(y2-y1)*(x2-x1)+x1,y1=axisy.max):y2>=y1&&y2>axisy.max&&y1<=axisy.max&&(x2=(axisy.max-y1)/(y2-y1)*(x2-x1)+x1,y2=axisy.max),x1!=x1old&&ctx.lineTo(axisx.p2c(x1old),axisy.p2c(y1)),ctx.lineTo(axisx.p2c(x1),axisy.p2c(y1)),ctx.lineTo(axisx.p2c(x2),axisy.p2c(y2)),x2!=x2old&&(ctx.lineTo(axisx.p2c(x2),axisy.p2c(y2)),ctx.lineTo(axisx.p2c(x2old),axisy.p2c(y2)))}}}}ctx.save(),ctx.translate(plotOffset.left,plotOffset.top),ctx.lineJoin="round";var lw=series.lines.lineWidth,sw=series.shadowSize;if(lw>0&&sw>0){ctx.lineWidth=sw,ctx.strokeStyle="rgba(0,0,0,0.1)";var angle=Math.PI/18;plotLine(series.datapoints,Math.sin(angle)*(lw/2+sw/2),Math.cos(angle)*(lw/2+sw/2),series.xaxis,series.yaxis),ctx.lineWidth=sw/2,plotLine(series.datapoints,Math.sin(angle)*(lw/2+sw/4),Math.cos(angle)*(lw/2+sw/4),series.xaxis,series.yaxis)}ctx.lineWidth=lw,ctx.strokeStyle=series.color;var fillStyle=getFillStyle(series.lines,series.color,0,plotHeight);fillStyle&&(ctx.fillStyle=fillStyle,plotLineArea(series.datapoints,series.xaxis,series.yaxis)),lw>0&&plotLine(series.datapoints,0,0,series.xaxis,series.yaxis),ctx.restore()}function drawSeriesPoints(series){function plotPoints(datapoints,radius,fillStyle,offset,shadow,axisx,axisy,symbol){for(var points=datapoints.points,ps=datapoints.pointsize,i=0;iaxisx.max||yaxisy.max||(ctx.beginPath(),x=axisx.p2c(x),y=axisy.p2c(y)+offset,"circle"==symbol?ctx.arc(x,y,radius,0,shadow?Math.PI:2*Math.PI,!1):symbol(ctx,x,y,radius,shadow),ctx.closePath(),fillStyle&&(ctx.fillStyle=fillStyle,ctx.fill()),ctx.stroke())}}ctx.save(),ctx.translate(plotOffset.left,plotOffset.top);var lw=series.points.lineWidth,sw=series.shadowSize,radius=series.points.radius,symbol=series.points.symbol;if(0==lw&&(lw=1e-4),lw>0&&sw>0){var w=sw/2;ctx.lineWidth=w,ctx.strokeStyle="rgba(0,0,0,0.1)",plotPoints(series.datapoints,radius,null,w+w/2,!0,series.xaxis,series.yaxis,symbol),ctx.strokeStyle="rgba(0,0,0,0.2)",plotPoints(series.datapoints,radius,null,w/2,!0,series.xaxis,series.yaxis,symbol)}ctx.lineWidth=lw,ctx.strokeStyle=series.color,plotPoints(series.datapoints,radius,getFillStyle(series.points,series.color),0,!1,series.xaxis,series.yaxis,symbol),ctx.restore()}function drawBar(x,y,b,barLeft,barRight,offset,fillStyleCallback,axisx,axisy,c,horizontal,lineWidth){var left,right,bottom,top,drawLeft,drawRight,drawTop,drawBottom,tmp;horizontal?(drawBottom=drawRight=drawTop=!0,drawLeft=!1,left=b,right=x,top=y+barLeft,bottom=y+barRight,left>right&&(tmp=right,right=left,left=tmp,drawLeft=!0,drawRight=!1)):(drawLeft=drawRight=drawTop=!0,drawBottom=!1,left=x+barLeft,right=x+barRight,bottom=b,top=y,bottom>top&&(tmp=top,top=bottom,bottom=tmp,drawBottom=!0,drawTop=!1)),rightaxisx.max||topaxisy.max||(leftaxisx.max&&(right=axisx.max,drawRight=!1),bottomaxisy.max&&(top=axisy.max,drawTop=!1),left=axisx.p2c(left),bottom=axisy.p2c(bottom),right=axisx.p2c(right),top=axisy.p2c(top),fillStyleCallback&&(c.beginPath(),c.moveTo(left,bottom),c.lineTo(left,top),c.lineTo(right,top),c.lineTo(right,bottom),c.fillStyle=fillStyleCallback(bottom,top),c.fill()),lineWidth>0&&(drawLeft||drawRight||drawTop||drawBottom)&&(c.beginPath(),c.moveTo(left,bottom+offset),drawLeft?c.lineTo(left,top+offset):c.moveTo(left,top+offset),drawTop?c.lineTo(right,top+offset):c.moveTo(right,top+offset),drawRight?c.lineTo(right,bottom+offset):c.moveTo(right,bottom+offset),drawBottom?c.lineTo(left,bottom+offset):c.moveTo(left,bottom+offset),c.stroke()))}function drawSeriesBars(series){function plotBars(datapoints,barLeft,barRight,offset,fillStyleCallback,axisx,axisy){for(var points=datapoints.points,ps=datapoints.pointsize,i=0;i"),fragments.push(""),rowStarted=!0),fragments.push('

    '+entry.label+"")}if(rowStarted&&fragments.push(""),0!=fragments.length){var table=''+fragments.join("")+"
    ";if(null!=options.legend.container)$(options.legend.container).html(table);else{var pos="",p=options.legend.position,m=options.legend.margin;null==m[0]&&(m=[m,m]),"n"==p.charAt(0)?pos+="top:"+(m[1]+plotOffset.top)+"px;":"s"==p.charAt(0)&&(pos+="bottom:"+(m[1]+plotOffset.bottom)+"px;"),"e"==p.charAt(1)?pos+="right:"+(m[0]+plotOffset.right)+"px;":"w"==p.charAt(1)&&(pos+="left:"+(m[0]+plotOffset.left)+"px;");var legend=$('
    '+table.replace('style="','style="position:absolute;'+pos+";")+"
    ").appendTo(placeholder);if(0!=options.legend.backgroundOpacity){var c=options.legend.backgroundColor;null==c&&(c=options.grid.backgroundColor,c=c&&"string"==typeof c?$.color.parse(c):$.color.extract(legend,"background-color"),c.a=1,c=c.toString());var div=legend.children();$('
    ').prependTo(legend).css("opacity",options.legend.backgroundOpacity)}}}}}function findNearbyItem(mouseX,mouseY,seriesFilter){var i,j,ps,maxDistance=options.grid.mouseActiveRadius,smallestDistance=maxDistance*maxDistance+1,item=null;for(i=series.length-1;i>=0;--i)if(seriesFilter(series[i])){var s=series[i],axisx=s.xaxis,axisy=s.yaxis,points=s.datapoints.points,mx=axisx.c2p(mouseX),my=axisy.c2p(mouseY),maxx=maxDistance/axisx.scale,maxy=maxDistance/axisy.scale;if(ps=s.datapoints.pointsize,axisx.options.inverseTransform&&(maxx=Number.MAX_VALUE),axisy.options.inverseTransform&&(maxy=Number.MAX_VALUE),s.lines.show||s.points.show)for(j=0;jmaxx||-maxx>x-mx||y-my>maxy||-maxy>y-my)){var dx=Math.abs(axisx.p2c(x)-mouseX),dy=Math.abs(axisy.p2c(y)-mouseY),dist=dx*dx+dy*dy;smallestDistance>dist&&(smallestDistance=dist,item=[i,j/ps])}}if(s.bars.show&&!item){var barLeft="left"==s.bars.align?0:-s.bars.barWidth/2,barRight=barLeft+s.bars.barWidth;for(j=0;j=Math.min(b,x)&&my>=y+barLeft&&y+barRight>=my:mx>=x+barLeft&&x+barRight>=mx&&my>=Math.min(b,y)&&my<=Math.max(b,y))&&(item=[i,j/ps])}}}return item?(i=item[0],j=item[1],ps=series[i].datapoints.pointsize,{datapoint:series[i].datapoints.points.slice(j*ps,(j+1)*ps),dataIndex:j,series:series[i],seriesIndex:i}):null}function onMouseMove(e){options.grid.hoverable&&triggerClickHoverEvent("plothover",e,function(s){return 0!=s.hoverable})}function onMouseLeave(e){options.grid.hoverable&&triggerClickHoverEvent("plothover",e,function(s){return!1})}function onClick(e){triggerClickHoverEvent("plotclick",e,function(s){return 0!=s.clickable})}function triggerClickHoverEvent(eventname,event,seriesFilter){var offset=eventHolder.offset(),canvasX=event.pageX-offset.left-plotOffset.left,canvasY=event.pageY-offset.top-plotOffset.top,pos=canvasToAxisCoords({left:canvasX,top:canvasY});pos.pageX=event.pageX,pos.pageY=event.pageY;var item=findNearbyItem(canvasX,canvasY,seriesFilter);if(item&&(item.pageX=parseInt(item.series.xaxis.p2c(item.datapoint[0])+offset.left+plotOffset.left,10),item.pageY=parseInt(item.series.yaxis.p2c(item.datapoint[1])+offset.top+plotOffset.top,10)),options.grid.autoHighlight){for(var i=0;iaxisx.max||yaxisy.max)){var pointRadius=series.points.radius+series.points.lineWidth/2;octx.lineWidth=pointRadius,octx.strokeStyle=highlightColor;var radius=1.5*pointRadius;x=axisx.p2c(x),y=axisy.p2c(y),octx.beginPath(),"circle"==series.points.symbol?octx.arc(x,y,radius,0,2*Math.PI,!1):series.points.symbol(octx,x,y,radius,!1),octx.closePath(),octx.stroke()}}function drawBarHighlight(series,point){var highlightColor="string"==typeof series.highlightColor?series.highlightColor:$.color.parse(series.color).scale("a",.5).toString(),fillStyle=highlightColor,barLeft="left"==series.bars.align?0:-series.bars.barWidth/2;octx.lineWidth=series.bars.lineWidth,octx.strokeStyle=highlightColor,drawBar(point[0],point[1],point[2]||0,barLeft,barLeft+series.bars.barWidth,0,function(){return fillStyle},series.xaxis,series.yaxis,octx,series.bars.horizontal,series.bars.lineWidth)}function getColorOrGradient(spec,bottom,top,defaultColor){if("string"==typeof spec)return spec;for(var gradient=ctx.createLinearGradient(0,top,0,bottom),i=0,l=spec.colors.length;l>i;++i){var c=spec.colors[i];if("string"!=typeof c){var co=$.color.parse(defaultColor);null!=c.brightness&&(co=co.scale("rgb",c.brightness)),null!=c.opacity&&(co.a*=c.opacity),c=co.toString()}gradient.addColorStop(i/(l-1),c)}return gradient}var series=[],options={colors:["#edc240","#afd8f8","#cb4b4b","#4da74d","#9440ed"],legend:{show:!0,noColumns:1,labelFormatter:null,labelBoxBorderColor:"#ccc",container:null,position:"ne",margin:5,backgroundColor:null,backgroundOpacity:.85,sorted:null},xaxis:{show:null,position:"bottom",mode:null,font:null,color:null,tickColor:null,transform:null,inverseTransform:null,min:null,max:null,autoscaleMargin:null,ticks:null,tickFormatter:null,labelWidth:null,labelHeight:null,reserveSpace:null,tickLength:null,alignTicksWithAxis:null,tickDecimals:null,tickSize:null,minTickSize:null},yaxis:{autoscaleMargin:.02,position:"left"},xaxes:[],yaxes:[],series:{points:{show:!1,radius:3,lineWidth:2,fill:!0,fillColor:"#ffffff",symbol:"circle"},lines:{lineWidth:2,fill:!1,fillColor:null,steps:!1},bars:{show:!1,lineWidth:2,barWidth:1,fill:!0,fillColor:null,align:"left",horizontal:!1,zero:!0},shadowSize:3,highlightColor:null},grid:{show:!0,aboveData:!1,color:"#545454",backgroundColor:null,borderColor:null,tickColor:null,margin:0,labelMargin:5,axisMargin:8,borderWidth:2,minBorderMargin:null,markings:null,markingsColor:"#f4f4f4",markingsLineWidth:2,clickable:!1,hoverable:!1,autoHighlight:!0,mouseActiveRadius:10},interaction:{redrawOverlayInterval:1e3/60},hooks:{}},surface=null,overlay=null,eventHolder=null,ctx=null,octx=null,xaxes=[],yaxes=[],plotOffset={left:0,right:0,top:0,bottom:0},plotWidth=0,plotHeight=0,hooks={processOptions:[],processRawData:[],processDatapoints:[],processOffset:[],drawBackground:[],drawSeries:[],draw:[],bindEvents:[],drawOverlay:[],shutdown:[]},plot=this;plot.setData=setData,plot.setupGrid=setupGrid,plot.draw=draw,plot.getPlaceholder=function(){return placeholder},plot.getCanvas=function(){return surface.element},plot.getPlotOffset=function(){return plotOffset},plot.width=function(){return plotWidth},plot.height=function(){return plotHeight},plot.offset=function(){var o=eventHolder.offset();return o.left+=plotOffset.left,o.top+=plotOffset.top,o},plot.getData=function(){return series},plot.getAxes=function(){var res={};return $.each(xaxes.concat(yaxes),function(_,axis){axis&&(res[axis.direction+(1!=axis.n?axis.n:"")+"axis"]=axis)}),res},plot.getXAxes=function(){return xaxes},plot.getYAxes=function(){return yaxes},plot.c2p=canvasToAxisCoords,plot.p2c=axisToCanvasCoords,plot.getOptions=function(){return options},plot.highlight=highlight,plot.unhighlight=unhighlight,plot.triggerRedrawOverlay=triggerRedrawOverlay,plot.pointOffset=function(point){return{left:parseInt(xaxes[axisNumber(point,"x")-1].p2c(+point.x)+plotOffset.left,10),top:parseInt(yaxes[axisNumber(point,"y")-1].p2c(+point.y)+plotOffset.top,10)}},plot.shutdown=shutdown,plot.resize=function(){var width=placeholder.width(),height=placeholder.height();surface.resize(width,height),overlay.resize(width,height)},plot.hooks=hooks,initPlugins(plot),parseOptions(options_),setupCanvases(),setData(data_),setupGrid(),draw(),bindEvents();var highlights=[],redrawTimeout=null}function floorInBase(n,base){return base*Math.floor(n/base)}var hasOwnProperty=Object.prototype.hasOwnProperty;Canvas.prototype.resize=function(width,height){if(0>=width||0>=height)throw new Error("Invalid dimensions for plot, width = "+width+", height = "+height);var element=this.element,context=this.context,pixelRatio=this.pixelRatio;this.width!=width&&(element.width=width*pixelRatio,element.style.width=width+"px",this.width=width),this.height!=height&&(element.height=height*pixelRatio,element.style.height=height+"px",this.height=height),context.restore(),context.save(),context.scale(pixelRatio,pixelRatio)},Canvas.prototype.clear=function(){this.context.clearRect(0,0,this.width,this.height)},Canvas.prototype.render=function(){var cache=this._textCache;for(var layerKey in cache)if(hasOwnProperty.call(cache,layerKey)){var layer=this.getTextLayer(layerKey),layerCache=cache[layerKey];layer.hide();for(var styleKey in layerCache)if(hasOwnProperty.call(layerCache,styleKey)){var styleCache=layerCache[styleKey];for(var key in styleCache)if(hasOwnProperty.call(styleCache,key)){for(var position,positions=styleCache[key].positions,i=0;position=positions[i];i++)position.active?position.rendered||(layer.append(position.element),position.rendered=!0):(positions.splice(i--,1),position.rendered&&position.element.detach());0==positions.length&&delete styleCache[key]}}layer.show()}},Canvas.prototype.getTextLayer=function(classes){var layer=this.text[classes];return null==layer&&(null==this.textContainer&&(this.textContainer=$("
    ").css({position:"absolute",top:0,left:0,bottom:0,right:0,"font-size":"smaller",color:"#545454"}).insertAfter(this.element)),layer=this.text[classes]=$("
    ").addClass(classes).css({position:"absolute",top:0,left:0,bottom:0,right:0}).appendTo(this.textContainer)),layer},Canvas.prototype.getTextInfo=function(layer,text,font,angle,width){var textStyle,layerCache,styleCache,info;if(text=""+text,textStyle="object"==typeof font?font.style+" "+font.variant+" "+font.weight+" "+font.size+"px/"+font.lineHeight+"px "+font.family:font,layerCache=this._textCache[layer],null==layerCache&&(layerCache=this._textCache[layer]={}),styleCache=layerCache[textStyle],null==styleCache&&(styleCache=layerCache[textStyle]={}),info=styleCache[text],null==info){var element=$("
    ").html(text).css({position:"absolute","max-width":width,top:-9999}).appendTo(this.getTextLayer(layer));"object"==typeof font?element.css({font:textStyle,color:font.color}):"string"==typeof font&&element.addClass(font),info=styleCache[text]={width:element.outerWidth(!0),height:element.outerHeight(!0),element:element,positions:[]},element.detach()}return info},Canvas.prototype.addText=function(layer,x,y,text,font,angle,width,halign,valign){var info=this.getTextInfo(layer,text,font,angle,width),positions=info.positions;"center"==halign?x-=info.width/2:"right"==halign&&(x-=info.width),"middle"==valign?y-=info.height/2:"bottom"==valign&&(y-=info.height);for(var position,i=0;position=positions[i];i++)if(position.x==x&&position.y==y)return void(position.active=!0);position={active:!0,rendered:!1,element:positions.length?info.element.clone():info.element,x:x,y:y},positions.push(position),position.element.css({top:Math.round(y),left:Math.round(x),"text-align":halign})},Canvas.prototype.removeText=function(layer,x,y,text,font,angle){if(null==text){var layerCache=this._textCache[layer];if(null!=layerCache)for(var styleKey in layerCache)if(hasOwnProperty.call(layerCache,styleKey)){var styleCache=layerCache[styleKey];for(var key in styleCache)if(hasOwnProperty.call(styleCache,key))for(var position,positions=styleCache[key].positions,i=0;position=positions[i];i++)position.active=!1}}else for(var position,positions=this.getTextInfo(layer,text,font,angle).positions,i=0;position=positions[i];i++)position.x==x&&position.y==y&&(position.active=!1)},$.plot=function(placeholder,data,options){var plot=new Plot($(placeholder),data,options,$.plot.plugins);return plot},$.plot.version="0.8.1",$.plot.plugins=[],$.fn.plot=function(data,options){return this.each(function(){$.plot(this,data,options)})}}(jQuery),function($){function init(plot){plot.hooks.drawSeries.push(function(plot,ctx,series){function plotDashes(xoffset,yoffset){function lineSegmentOffset(segmentLength){var c=Math.sqrt(Math.pow(ax2-ax1,2)+Math.pow(ay2-ay1,2));if(segmentLength>=c)return{deltaX:ax2-ax1,deltaY:ay2-ay1,distance:c,remainder:segmentLength-c};var xsign=ax2>ax1?1:-1,ysign=ay2>ay1?1:-1;return{deltaX:xsign*Math.sqrt(Math.pow(segmentLength,2)/(1+Math.pow((ay2-ay1)/(ax2-ax1),2))),deltaY:ysign*Math.sqrt(Math.pow(segmentLength,2)-Math.pow(segmentLength,2)/(1+Math.pow((ay2-ay1)/(ax2-ax1),2))),distance:segmentLength,remainder:0}}var dashOnLength,dashOffLength,points=series.datapoints.points,ps=series.datapoints.pointsize,prevx=null,prevy=null,dashRemainder=0,dashOn=!0;series.dashes.dashLength[0]?(dashOnLength=series.dashes.dashLength[0],dashOffLength=series.dashes.dashLength[1]?series.dashes.dashLength[1]:dashOnLength):dashOffLength=dashOnLength=series.dashes.dashLength,ctx.beginPath();for(var i=ps;i=y1&&y1=y2&&y2=y2&&y1>axisy.max){if(y2>axisy.max)continue;x1=(axisy.max-y1)/(y2-y1)*(x2-x1)+x1,y1=axisy.max}else if(y2>=y1&&y2>axisy.max){if(y1>axisy.max)continue;x2=(axisy.max-y1)/(y2-y1)*(x2-x1)+x1,y2=axisy.max}if(x2>=x1&&x1=x2&&x2=x2&&x1>axisx.max){if(x2>axisx.max)continue;y1=(axisx.max-x1)/(x2-x1)*(y2-y1)+y1,x1=axisx.max}else if(x2>=x1&&x2>axisx.max){if(x1>axisx.max)continue;y2=(axisx.max-x1)/(x2-x1)*(y2-y1)+y1,x2=axisx.max}(x1!=prevx||y1!=prevy)&&ctx.moveTo(axisx.p2c(x1)+xoffset,axisy.p2c(y1)+yoffset);var dashOffset,ax1=axisx.p2c(x1)+xoffset,ay1=axisy.p2c(y1)+yoffset,ax2=axisx.p2c(x2)+xoffset,ay2=axisy.p2c(y2)+yoffset;do dashOffset=lineSegmentOffset(dashRemainder>0?dashRemainder:dashOn?dashOnLength:dashOffLength),(0!=dashOffset.deltaX||0!=dashOffset.deltaY)&&(dashOn?ctx.lineTo(ax1+dashOffset.deltaX,ay1+dashOffset.deltaY):ctx.moveTo(ax1+dashOffset.deltaX,ay1+dashOffset.deltaY)),dashOn=!dashOn,dashRemainder=dashOffset.remainder,ax1+=dashOffset.deltaX,ay1+=dashOffset.deltaY;while(dashOffset.distance>0);prevx=x2,prevy=y2}}ctx.stroke()}if(series.dashes.show){var plotOffset=plot.getPlotOffset(),axisx=series.xaxis,axisy=series.yaxis;ctx.save(),ctx.translate(plotOffset.left,plotOffset.top),ctx.lineJoin="round";var lw=series.dashes.lineWidth,sw=series.shadowSize;if(lw>0&&sw>0){ctx.lineWidth=sw,ctx.strokeStyle="rgba(0,0,0,0.1)";var angle=Math.PI/18;plotDashes(Math.sin(angle)*(lw/2+sw/2),Math.cos(angle)*(lw/2+sw/2)),ctx.lineWidth=sw/2,plotDashes(Math.sin(angle)*(lw/2+sw/4),Math.cos(angle)*(lw/2+sw/4))}ctx.lineWidth=lw,ctx.strokeStyle=series.color,lw>0&&plotDashes(0,0),ctx.restore()}})}$.plot.plugins.push({init:init,options:{series:{dashes:{show:!1,lineWidth:2,dashLength:10}}},name:"dashes",version:"0.1"})}(jQuery),function($){function floorInBase(n,base){return base*Math.floor(n/base)}function formatDate(d,fmt,monthNames,dayNames){if("function"==typeof d.strftime)return d.strftime(fmt);var leftPad=function(n,pad){return n=""+n,pad=""+(null==pad?"0":pad),1==n.length?pad+n:n},r=[],escape=!1,hours=d.getHours(),isAM=12>hours;null==monthNames&&(monthNames=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]),null==dayNames&&(dayNames=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]);var hours12;hours12=hours>12?hours-12:0==hours?12:hours;for(var i=0;i=minSize);++i);var size=spec[i][0],unit=spec[i][1];if("year"==unit){if(null!=opts.minTickSize&&"year"==opts.minTickSize[1])size=Math.floor(opts.minTickSize[0]);else{var magn=Math.pow(10,Math.floor(Math.log(axis.delta/timeUnitSize.year)/Math.LN10)),norm=axis.delta/timeUnitSize.year/magn;size=1.5>norm?1:3>norm?2:7.5>norm?5:10,size*=magn}1>size&&(size=1)}axis.tickSize=opts.tickSize||[size,unit];var tickSize=axis.tickSize[0];unit=axis.tickSize[1];var step=tickSize*timeUnitSize[unit];"second"==unit?d.setSeconds(floorInBase(d.getSeconds(),tickSize)):"minute"==unit?d.setMinutes(floorInBase(d.getMinutes(),tickSize)):"hour"==unit?d.setHours(floorInBase(d.getHours(),tickSize)):"month"==unit?d.setMonth(floorInBase(d.getMonth(),tickSize)):"quarter"==unit?d.setMonth(3*floorInBase(d.getMonth()/3,tickSize)):"year"==unit&&d.setFullYear(floorInBase(d.getFullYear(),tickSize)),d.setMilliseconds(0),step>=timeUnitSize.minute&&d.setSeconds(0),step>=timeUnitSize.hour&&d.setMinutes(0),step>=timeUnitSize.day&&d.setHours(0),step>=4*timeUnitSize.day&&d.setDate(1),step>=2*timeUnitSize.month&&d.setMonth(floorInBase(d.getMonth(),3)),step>=2*timeUnitSize.quarter&&d.setMonth(floorInBase(d.getMonth(),6)),step>=timeUnitSize.year&&d.setMonth(0);var prev,carry=0,v=Number.NaN;do if(prev=v,v=d.getTime(),ticks.push(v),"month"==unit||"quarter"==unit)if(1>tickSize){d.setDate(1);var start=d.getTime();d.setMonth(d.getMonth()+("quarter"==unit?3:1));var end=d.getTime();d.setTime(v+carry*timeUnitSize.hour+(end-start)*tickSize),carry=d.getHours(),d.setHours(0)}else d.setMonth(d.getMonth()+tickSize*("quarter"==unit?3:1));else"year"==unit?d.setFullYear(d.getFullYear()+tickSize):d.setTime(v+step);while(vvalue?min:value>max?max:value}function setSelectionPos(pos,e){var o=plot.getOptions(),offset=plot.getPlaceholder().offset(),plotOffset=plot.getPlotOffset();pos.x=clamp(0,e.pageX-offset.left-plotOffset.left,plot.width()),pos.y=clamp(0,e.pageY-offset.top-plotOffset.top,plot.height()),"y"==o.selection.mode&&(pos.x=pos==selection.first?0:plot.width()),"x"==o.selection.mode&&(pos.y=pos==selection.first?0:plot.height())}function updateSelection(pos){null!=pos.pageX&&(setSelectionPos(selection.second,pos),selectionIsSane()?(selection.show=!0,plot.triggerRedrawOverlay()):clearSelection(!0))}function clearSelection(preventEvent){selection.show&&(selection.show=!1,plot.triggerRedrawOverlay(),preventEvent||plot.getPlaceholder().trigger("plotunselected",[]))}function extractRange(ranges,coord){var axis,from,to,key,axes=plot.getAxes();for(var k in axes)if(axis=axes[k],axis.direction==coord&&(key=coord+axis.n+"axis",ranges[key]||1!=axis.n||(key=coord+"axis"),ranges[key])){from=ranges[key].from,to=ranges[key].to;break}if(ranges[key]||(axis="x"==coord?plot.getXAxes()[0]:plot.getYAxes()[0],from=ranges[coord+"1"],to=ranges[coord+"2"]),null!=from&&null!=to&&from>to){var tmp=from;from=to,to=tmp}return{from:from,to:to,axis:axis}}function setSelection(ranges,preventEvent){var range,o=plot.getOptions();"y"==o.selection.mode?(selection.first.x=0,selection.second.x=plot.width()):(range=extractRange(ranges,"x"),selection.first.x=range.axis.p2c(range.from),selection.second.x=range.axis.p2c(range.to)),"x"==o.selection.mode?(selection.first.y=0,selection.second.y=plot.height()):(range=extractRange(ranges,"y"),selection.first.y=range.axis.p2c(range.from),selection.second.y=range.axis.p2c(range.to)),selection.show=!0,plot.triggerRedrawOverlay(),!preventEvent&&selectionIsSane()&&triggerSelectedEvent()}function selectionIsSane(){var minSize=plot.getOptions().selection.minSize;return Math.abs(selection.second.x-selection.first.x)>=minSize&&Math.abs(selection.second.y-selection.first.y)>=minSize}var selection={first:{x:-1,y:-1},second:{x:-1,y:-1},show:!1,active:!1},savedhandlers={},mouseUpHandler=null;plot.clearSelection=clearSelection,plot.setSelection=setSelection,plot.getSelection=getSelection,plot.hooks.bindEvents.push(function(plot,eventHolder){var o=plot.getOptions();null!=o.selection.mode&&(eventHolder.mousemove(onMouseMove),eventHolder.mousedown(onMouseDown))}),plot.hooks.drawOverlay.push(function(plot,ctx){if(selection.show&&selectionIsSane()){var plotOffset=plot.getPlotOffset(),o=plot.getOptions();ctx.save(),ctx.translate(plotOffset.left,plotOffset.top);var c=$.color.parse(o.selection.color);ctx.strokeStyle=c.scale("a",.8).toString(),ctx.lineWidth=1,ctx.lineJoin=o.selection.shape,ctx.fillStyle=c.scale("a",.4).toString();var x=Math.min(selection.first.x,selection.second.x)+.5,y=Math.min(selection.first.y,selection.second.y)+.5,w=Math.abs(selection.second.x-selection.first.x)-1,h=Math.abs(selection.second.y-selection.first.y)-1;ctx.fillRect(x,y,w,h),ctx.strokeRect(x,y,w,h),ctx.restore()}}),plot.hooks.shutdown.push(function(plot,eventHolder){eventHolder.unbind("mousemove",onMouseMove),eventHolder.unbind("mousedown",onMouseDown),mouseUpHandler&&$(document).unbind("mouseup",mouseUpHandler)})}$.plot.plugins.push({init:init,options:{selection:{mode:null,color:"#e8cfac",shape:"round",minSize:5}},name:"selection",version:"1.1"})}(jQuery),function($,h,c){function g(){i=h[k](function(){a.each(function(){var n=$(this),m=n.width(),l=n.height(),o=$.data(this,d);(m!==o.w||l!==o.h)&&n.trigger(j,[o.w=m,o.h=l])}),g()},e[b])}var i,a=$([]),e=$.resize=$.extend($.resize,{}),k="setTimeout",j="resize",d=j+"-special-event",b="delay",f="throttleWindow";e[b]=250,e[f]=!0,$.event.special[j]={setup:function(){if(!e[f]&&this[k])return!1;var l=$(this);a=a.add(l),$.data(this,d,{w:l.width(),h:l.height()}),1===a.length&&g()},teardown:function(){if(!e[f]&&this[k])return!1;var l=$(this);a=a.not(l),l.removeData(d),a.length||clearTimeout(i)},add:function(l){function m(s,o,p){var q=$(this),r=$.data(this,d);r.w=o!==c?o:q.width(),r.h=p!==c?p:q.height(),n.apply(this,arguments)}if(!e[f]&&this[k])return!1;var n;return $.isFunction(l)?(n=l,m):(n=l.handler,void(l.handler=m))}}}(jQuery,this),function($){function init(plot){function onResize(){var placeholder=plot.getPlaceholder();0!=placeholder.width()&&0!=placeholder.height()&&(plot.resize(),plot.setupGrid(),plot.draw())}function bindEvents(plot,eventHolder){plot.getPlaceholder().resize(onResize)}function shutdown(plot,eventHolder){plot.getPlaceholder().unbind("resize",onResize)}plot.hooks.bindEvents.push(bindEvents),plot.hooks.shutdown.push(shutdown)}var options={};$.plot.plugins.push({init:init,options:options,name:"resize",version:"1.0"})}(jQuery),$(document).ready(function(){function animateSection(sectionName,offset){$("html,body").animate({scrollTop:$(sectionName).offset().top+offset},750)}function switchStandardsList(el){standardsList.hide(),chosenValue=el.val(),$('[data-attr="'+chosenValue+'"]').show()}function getGraphData(){$($('[data-role="url-stats"]').get().reverse()).each(function(){var el=$(this);storeDatum(el,getXAxisLabel(el))})}function getXAxisLabel(el){return el.find('[data-role="date"]').attr("data-value")}function storeDatum(el,label){$.each(el.find("[data-label]"),function(){var type=$(this).attr("data-label"),value=$(this).html();"undefined"==typeof data[type]&&(data[type]=[]),data[type].push([label,+value])})}function plotGraphData(){$.plot(graphContainer,getData(),graphOptions)}function getData(){return[{color:"rgb(216, 61, 45)",label:"Errors",data:data.error},{color:"rgb(168, 103, 0)",label:"Warnings",data:data.warning,lines:{show:!1},dashes:{show:!0}},{color:"rgb(23, 123, 190)",label:"Notices",data:data.notice,lines:{show:!1},dashes:{show:!0,dashLength:5}}]}function toggleResetZoomButton(){zoomResetButton.toggleClass("hidden")}function plotAccordingToChoices(){var data=[];choiceContainer.find("input:checked").each(function(){var key=$(this).attr("name");key&&datasets[key]&&data.push(datasets[key])}),data.length>-1&&$.plot(graphContainer,data,graphOptions)}function showTooltip(x,y,contents){$('
    '+contents+"
    ").css({top:y+5,left:x+5}).appendTo("body").fadeIn(200)}function initTaskFilter(container){var tasks=initTaskFilterTasks(container);initTaskFilterInput(container,tasks)}function initTaskFilterTasks(container){var tasks=container.find("[data-role=task]");return tasks}function initTaskFilterInput(container,tasks){var input=container.find("[data-role=input]");return input.on("keyup",function(){filterTasks(tasks,input.val())}),input}function filterTasks(tasks,query){if(query=$.trim(query.replace(/[^a-z0-9\s]+/gi,"")),tasks.removeClass("hidden"),!/^\s*$/.test(query)){var queryRegExp=new RegExp("("+query.replace(/\s+/gi,"|")+")","i");tasks.filter(function(){return!queryRegExp.test($(this).data("keywords"))}).addClass("hidden")}}var data={},standardsList=$('[data-role="standards-list"]'),standardSelect=$('[data-role="new-task-select"]'),expandLink=$('[data-role="expander"]'),taskListSelector=$('[data-role="task-list"] a'),toTopLinks=$('[data-role="top"]'),zoomResetButton=$('[data-role="zoom-reset"]'),graphContainer=$('[data-role="graph"]'),dateSelectDropdownMenu=$('[data-role="date-select-dropdown-menu"]'),graphOptions={series:{dashes:{show:!1,lineWidth:3},lines:{show:!0},points:{show:!0},hoverable:!0},xaxis:{mode:"time",tickLength:0,minTickSize:[1,"day"],timeformat:"%d %b"},yaxis:{tickDecimals:0},lines:{lineWidth:3},points:{fill:!0,fillColor:"rgb(255, 255, 255)"},shadowSize:0,grid:{backgroundColor:"#fff",borderColor:"#808080",hoverable:!0,clickable:!0,borderWidth:{top:1,right:1,bottom:1,left:1}},selection:{mode:"x"}};expandLink.click(function(){$(this).next().slideToggle("slow",function(){}),$(this).hasClass("showing")?($(this).find("span.expander").html("+"),$(this).attr("aria-expanded",!1)):($(this).find("span.expander").html("-"),$(this).attr("aria-expanded",!0)),$(this).toggleClass("showing")}),$(document).on("keydown.lists",'[data-role="expander"]',function(e){var $this=$(this),k=e.which||e.keyCode;/(13|32)/.test(k)&&((13===k||32===k)&&$this.click(),e.preventDefault(),e.stopPropagation())}),toTopLinks.click(function(e){e.preventDefault(),$(animateSection($("#top"),-55))}),switchStandardsList(standardSelect),$(".rules-list-title").addClass("hidden"),$(".date-links").removeClass("list-group date-links").addClass("dropdown-menu"),$(".dropdown-menu a").removeClass("list-group-item"),dateSelectDropdownMenu.removeClass("hidden"),standardSelect.change(function(){switchStandardsList($(this))}),taskListSelector.click(function(e){e.preventDefault(),target=$(this).attr("href"),animateSection($(target),-25),$(target).hasClass("showing")||$(target).click()}),zoomResetButton.click(function(){plotGraphData(),toggleResetZoomButton()}),$.each(graphContainer,function(){getGraphData(),plotGraphData()}),$('[data-role="rules-tooltip"]').tooltip(),graphContainer.bind("plotselected",function(event,ranges){ranges.xaxis.to-ranges.xaxis.from<1e-5&&(ranges.xaxis.to=ranges.xaxis.from+1e-5),ranges.yaxis.to-ranges.yaxis.from<1e-5&&(ranges.yaxis.to=ranges.yaxis.from+1e-5),plot=$.plot(graphContainer,getData(ranges.xaxis.from,ranges.xaxis.to),$.extend(!0,{},graphOptions,{xaxis:{min:ranges.xaxis.from,max:ranges.xaxis.to},yaxis:{min:ranges.yaxis.from,max:ranges.yaxis.to}})),zoomResetButton.is(":visible")||toggleResetZoomButton()});var choiceContainer=$('[data-role="series-checkboxes"]'),datasets=getData();$.each(datasets,function(key,val){var lowerCaseValue=val.label.substring(0,val.label.length-1).toLowerCase();choiceContainer.append('
  • ")}),choiceContainer.find("input").click(plotAccordingToChoices),choiceContainer.find("[data-stat-type=errors]").click();var previousPoint=null;graphContainer.bind("plothover",function(event,pos,item){if(item){if(previousPoint!=item.dataIndex){previousPoint=item.dataIndex,$('[data-role="tooltip"]').remove();var count=item.datapoint[1].toFixed(0),date=$.plot.formatDate(new Date(item.datapoint[0]),"%d %b (%H:%M)"),contents='

    '+date+"
    "+count+" "+item.series.label+"";showTooltip(item.pageX,item.pageY,contents)}}else $('[data-role="tooltip"]').remove(),previousPoint=null});var taskLists=$("[data-control=task-list]");taskLists.length>0&&$("[data-control=task-list]").each(function(){initTaskFilter($(this))}),$.fn.collapse.Constructor.prototype.keydown=function(e){var $this=$(this),k=e.which||e.keyCode;/(13|32)/.test(k)&&((13===k||32===k)&&$this.click(),e.preventDefault(),e.stopPropagation())},$('[data-toggle="collapse"]').attr("role","button").attr("tabindex",0),$(document).on("keydown.collapse.data-api",'[data-toggle="collapse"]',$.fn.collapse.Constructor.prototype.keydown)}); \ No newline at end of file diff --git a/public/js/vendor/flot/jquery.flot.dashes.js b/public/js/vendor/flot/jquery.flot.dashes.js new file mode 100644 index 0000000..f18ab9c --- /dev/null +++ b/public/js/vendor/flot/jquery.flot.dashes.js @@ -0,0 +1,228 @@ +/* + * jQuery.flot.dashes + * + * options = { + * series: { + * dashes: { + * + * // show + * // default: false + * // Whether to show dashes for the series. + * show: , + * + * // lineWidth + * // default: 2 + * // The width of the dashed line in pixels. + * lineWidth: , + * + * // dashLength + * // default: 10 + * // Controls the length of the individual dashes and the amount of + * // space between them. + * // If this is a number, the dashes and spaces will have that length. + * // If this is an array, it is read as [ dashLength, spaceLength ] + * dashLength: or + * } + * } + * } + */ +(function($){ + + function init(plot) { + plot.hooks.drawSeries.push(function(plot, ctx, series) { + if (!series.dashes.show) return; + + var plotOffset = plot.getPlotOffset(), + axisx = series.xaxis, + axisy = series.yaxis; + + function plotDashes(xoffset, yoffset) { + + var points = series.datapoints.points, + ps = series.datapoints.pointsize, + prevx = null, + prevy = null, + dashRemainder = 0, + dashOn = true, + dashOnLength, + dashOffLength; + + if (series.dashes.dashLength[0]) { + dashOnLength = series.dashes.dashLength[0]; + if (series.dashes.dashLength[1]) { + dashOffLength = series.dashes.dashLength[1]; + } else { + dashOffLength = dashOnLength; + } + } else { + dashOffLength = dashOnLength = series.dashes.dashLength; + } + + ctx.beginPath(); + + for (var i = ps; i < points.length; i += ps) { + + var x1 = points[i - ps], + y1 = points[i - ps + 1], + x2 = points[i], + y2 = points[i + 1]; + + if (x1 == null || x2 == null) continue; + + // clip with ymin + if (y1 <= y2 && y1 < axisy.min) { + if (y2 < axisy.min) continue; // line segment is outside + // compute new intersection point + x1 = (axisy.min - y1) / (y2 - y1) * (x2 - x1) + x1; + y1 = axisy.min; + } else if (y2 <= y1 && y2 < axisy.min) { + if (y1 < axisy.min) continue; + x2 = (axisy.min - y1) / (y2 - y1) * (x2 - x1) + x1; + y2 = axisy.min; + } + + // clip with ymax + if (y1 >= y2 && y1 > axisy.max) { + if (y2 > axisy.max) continue; + x1 = (axisy.max - y1) / (y2 - y1) * (x2 - x1) + x1; + y1 = axisy.max; + } else if (y2 >= y1 && y2 > axisy.max) { + if (y1 > axisy.max) continue; + x2 = (axisy.max - y1) / (y2 - y1) * (x2 - x1) + x1; + y2 = axisy.max; + } + + // clip with xmin + if (x1 <= x2 && x1 < axisx.min) { + if (x2 < axisx.min) continue; + y1 = (axisx.min - x1) / (x2 - x1) * (y2 - y1) + y1; + x1 = axisx.min; + } else if (x2 <= x1 && x2 < axisx.min) { + if (x1 < axisx.min) continue; + y2 = (axisx.min - x1) / (x2 - x1) * (y2 - y1) + y1; + x2 = axisx.min; + } + + // clip with xmax + if (x1 >= x2 && x1 > axisx.max) { + if (x2 > axisx.max) continue; + y1 = (axisx.max - x1) / (x2 - x1) * (y2 - y1) + y1; + x1 = axisx.max; + } else if (x2 >= x1 && x2 > axisx.max) { + if (x1 > axisx.max) continue; + y2 = (axisx.max - x1) / (x2 - x1) * (y2 - y1) + y1; + x2 = axisx.max; + } + + if (x1 != prevx || y1 != prevy) { + ctx.moveTo(axisx.p2c(x1) + xoffset, axisy.p2c(y1) + yoffset); + } + + var ax1 = axisx.p2c(x1) + xoffset, + ay1 = axisy.p2c(y1) + yoffset, + ax2 = axisx.p2c(x2) + xoffset, + ay2 = axisy.p2c(y2) + yoffset, + dashOffset; + + function lineSegmentOffset(segmentLength) { + + var c = Math.sqrt(Math.pow(ax2 - ax1, 2) + Math.pow(ay2 - ay1, 2)); + + if (c <= segmentLength) { + return { + deltaX: ax2 - ax1, + deltaY: ay2 - ay1, + distance: c, + remainder: segmentLength - c + } + } else { + var xsign = ax2 > ax1 ? 1 : -1, + ysign = ay2 > ay1 ? 1 : -1; + return { + deltaX: xsign * Math.sqrt(Math.pow(segmentLength, 2) / (1 + Math.pow((ay2 - ay1)/(ax2 - ax1), 2))), + deltaY: ysign * Math.sqrt(Math.pow(segmentLength, 2) - Math.pow(segmentLength, 2) / (1 + Math.pow((ay2 - ay1)/(ax2 - ax1), 2))), + distance: segmentLength, + remainder: 0 + }; + } + } + //-end lineSegmentOffset + + do { + + dashOffset = lineSegmentOffset( + dashRemainder > 0 ? dashRemainder : + dashOn ? dashOnLength : dashOffLength); + + if (dashOffset.deltaX != 0 || dashOffset.deltaY != 0) { + if (dashOn) { + ctx.lineTo(ax1 + dashOffset.deltaX, ay1 + dashOffset.deltaY); + } else { + ctx.moveTo(ax1 + dashOffset.deltaX, ay1 + dashOffset.deltaY); + } + } + + dashOn = !dashOn; + dashRemainder = dashOffset.remainder; + ax1 += dashOffset.deltaX; + ay1 += dashOffset.deltaY; + + } while (dashOffset.distance > 0); + + prevx = x2; + prevy = y2; + } + + ctx.stroke(); + } + //-end plotDashes + + ctx.save(); + ctx.translate(plotOffset.left, plotOffset.top); + ctx.lineJoin = 'round'; + + var lw = series.dashes.lineWidth, + sw = series.shadowSize; + + // FIXME: consider another form of shadow when filling is turned on + if (lw > 0 && sw > 0) { + // draw shadow as a thick and thin line with transparency + ctx.lineWidth = sw; + ctx.strokeStyle = "rgba(0,0,0,0.1)"; + // position shadow at angle from the mid of line + var angle = Math.PI/18; + plotDashes(Math.sin(angle) * (lw/2 + sw/2), Math.cos(angle) * (lw/2 + sw/2)); + ctx.lineWidth = sw/2; + plotDashes(Math.sin(angle) * (lw/2 + sw/4), Math.cos(angle) * (lw/2 + sw/4)); + } + + ctx.lineWidth = lw; + ctx.strokeStyle = series.color; + + if (lw > 0) { + plotDashes(0, 0); + } + + ctx.restore(); + + }); + //-end draw hook + } + //-end init + + $.plot.plugins.push({ + init: init, + options: { + series: { + dashes: { + show: false, + lineWidth: 2, + dashLength: 10 + } + } + }, + name: 'dashes', + version: '0.1' + }); + +})(jQuery)