29 lines
898 KiB
JavaScript
29 lines
898 KiB
JavaScript
function FastClick(a){"use strict";var b,c=this;if(this.trackingClick=!1,this.trackingClickStart=0,this.targetElement=null,this.touchStartX=0,this.touchStartY=0,this.lastTouchIdentifier=0,this.touchBoundary=10,this.layer=a,!a||!a.nodeType)throw new TypeError("Layer must be a document node");this.onClick=function(){return FastClick.prototype.onClick.apply(c,arguments)},this.onMouse=function(){return FastClick.prototype.onMouse.apply(c,arguments)},this.onTouchStart=function(){return FastClick.prototype.onTouchStart.apply(c,arguments)},this.onTouchMove=function(){return FastClick.prototype.onTouchMove.apply(c,arguments)},this.onTouchEnd=function(){return FastClick.prototype.onTouchEnd.apply(c,arguments)},this.onTouchCancel=function(){return FastClick.prototype.onTouchCancel.apply(c,arguments)},FastClick.notNeeded(a)||(this.deviceIsAndroid&&(a.addEventListener("mouseover",this.onMouse,!0),a.addEventListener("mousedown",this.onMouse,!0),a.addEventListener("mouseup",this.onMouse,!0)),a.addEventListener("click",this.onClick,!0),a.addEventListener("touchstart",this.onTouchStart,!1),a.addEventListener("touchmove",this.onTouchMove,!1),a.addEventListener("touchend",this.onTouchEnd,!1),a.addEventListener("touchcancel",this.onTouchCancel,!1),Event.prototype.stopImmediatePropagation||(a.removeEventListener=function(b,c,d){var e=Node.prototype.removeEventListener;"click"===b?e.call(a,b,c.hijacked||c,d):e.call(a,b,c,d)},a.addEventListener=function(b,c,d){var e=Node.prototype.addEventListener;"click"===b?e.call(a,b,c.hijacked||(c.hijacked=function(a){a.propagationStopped||c(a)}),d):e.call(a,b,c,d)}),"function"==typeof a.onclick&&(b=a.onclick,a.addEventListener("click",function(a){b(a)},!1),a.onclick=null))}function Emitter(a){return a?mixin(a):void 0}function mixin(a){for(var b in Emitter.prototype)a[b]=Emitter.prototype[b];return a}(function(){String.prototype.endsWith||(String.prototype.endsWith=function(a){return-1!==this.indexOf(a,this.length-a.length)}),String.prototype.trim||(String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")}),Array.prototype.indexOf||(Array.prototype.indexOf=function(a,b){var c,d,e;if(void 0===this||null===this)throw new TypeError('"this" is null or not defined');for(d=this.length>>>0,b=+b||0,1/0===Math.abs(b)&&(b=0),0>b&&(b+=d,0>b&&(b=0)),c=e=b;d>=b?d>e:e>d;c=d>=b?++e:--e)if(this[c]===a)return c;return-1}),Function.prototype.bind||(Function.prototype.bind=function(a){var b,c,d,e;if("function"!=typeof this)throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");return b=Array.prototype.slice.call(arguments,1),e=this,d=function(){},c=function(){return e.apply(this instanceof d&&a?this:a,b.concat(Array.prototype.slice.call(arguments)))},d.prototype=this.prototype,c.prototype=new d,c}),Object.keys||(Object.keys=function(){"use strict";var a,b,c;return c=Object.prototype.hasOwnProperty,b={"toString":null}.propertyIsEnumerable("toString")?!1:!0,a=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],function(d){var e,f,g,h,i,j,k;if("object"!=typeof d&&("function"!=typeof d||null===d))throw new TypeError("Object.keys called on non-object");for(g=[],h=0,j=d.length;j>h;h++)f=d[h],c.call(d,f)&&g.push(f);if(b)for(i=0,k=a.length;k>i;i++)e=a[i],c.call(d,e)&&g.push(e);return g}}.call(this)),window.getScreenSize=function(a,b){return a.is(":visible")?"small":b.is(":visible")?"tablet":"desktop"},window.elHasClass=function(a,b){return(" "+a.className+" ").indexOf(" "+b+" ")>-1},window.elRemoveClass=function(a,b){return a.className=(" "+a.className+" ").replace(" "+b+" "," ").trim()}}).call(this),function(){var a,b;b={"is_mobile":!1,"resize_delay":400,"stored_values_prefix":"pa_","main_menu":{"accordion":!0,"animation_speed":250,"store_state":!0,"store_state_key":"mmstate","disable_animation_on":["small"],"dropdown_close_delay":300,"detect_active":!0,"detect_active_predicate":function(a,b){return a===b}},"consts":{"COLORS":["#71c73e","#77b7c5","#d54848","#6c42e5","#e8e64e","#dd56e6","#ecad3f","#618b9d","#b68b68","#36a766","#3156be","#00b3ff","#646464","#a946e8","#9d9d9d"]}},a=function(){return this.init=[],this.plugins={},this.settings={},this.localStorageSupported="undefined"!=typeof window.Storage?!0:!1,this},a.prototype.start=function(a,c){return null==a&&(a=[]),null==c&&(c={}),window.onload=function(d){return function(){var e,f,g,h;for($("html").addClass("pxajs"),a.length>0&&$.merge(d.init,a),d.settings=$.extend(!0,{},b,c||{}),d.settings.is_mobile=/iphone|ipad|ipod|android|blackberry|mini|windows\sce|palm/i.test(navigator.userAgent.toLowerCase()),d.settings.is_mobile&&FastClick&&FastClick.attach(document.body),h=d.init,f=0,g=h.length;g>f;f++)e=h[f],$.proxy(e,d)();return $(window).trigger("pa.loaded"),$(window).resize()}}(this),this},a.prototype.addInitializer=function(a){return this.init.push(a)},a.prototype.initPlugin=function(a,b){return this.plugins[a]=b,b.init?b.init():void 0},a.prototype.storeValue=function(a,b,c){var d;if(null==c&&(c=!1),this.localStorageSupported&&!c)try{return void window.localStorage.setItem(this.settings.stored_values_prefix+a,b)}catch(e){d=e}return document.cookie=this.settings.stored_values_prefix+a+"="+escape(b)},a.prototype.storeValues=function(a,b){var c,d,e,f;if(null==b&&(b=!1),this.localStorageSupported&&!b)try{for(d in a)e=a[d],window.localStorage.setItem(this.settings.stored_values_prefix+d,e);return}catch(g){c=g}f=[];for(d in a)e=a[d],f.push(document.cookie=this.settings.stored_values_prefix+d+"="+escape(e));return f},a.prototype.getStoredValue=function(a,b,c){var d,e,f,g,h,i,j,k,l;if(null==b&&(b=!1),null==c&&(c=null),this.localStorageSupported&&!b)try{return i=window.localStorage.getItem(this.settings.stored_values_prefix+a),i?i:c}catch(m){f=m}for(e=document.cookie.split(";"),k=0,l=e.length;l>k;k++)if(d=e[k],h=d.indexOf("="),g=d.substr(0,h).replace(/^\s+|\s+$/g,""),j=d.substr(h+1).replace(/^\s+|\s+$/g,""),g===this.settings.stored_values_prefix+a)return j;return c},a.prototype.getStoredValues=function(a,b,c){var d,e,f,g,h,i,j,k,l,m,n,o,p,q,r;for(null==b&&(b=!1),null==c&&(c=null),k={},m=0,p=a.length;p>m;m++)h=a[m],k[h]=c;if(this.localStorageSupported&&!b)try{for(n=0,q=a.length;q>n;n++)h=a[n],j=window.localStorage.getItem(this.settings.stored_values_prefix+h),j&&(k[h]=j);return k}catch(s){f=s}for(e=document.cookie.split(";"),o=0,r=e.length;r>o;o++)d=e[o],i=d.indexOf("="),g=d.substr(0,i).replace(/^\s+|\s+$/g,""),l=d.substr(i+1).replace(/^\s+|\s+$/g,""),g===this.settings.stored_values_prefix+h&&(k[h]=l);return k},a.Constructor=a,window.PixelAdmin=new a}.call(this),function(){var a;a=function(a){var b;return b=null,function(){return b&&clearTimeout(b),b=setTimeout(function(){return b=null,a.call(this)},PixelAdmin.settings.resize_delay)}},PixelAdmin.addInitializer(function(){var b,c,d,e;return e=null,d=$(window),b=$('<div id="small-screen-width-point" style="position:absolute;top:-10000px;width:10px;height:10px;background:#fff;"></div>'),c=$('<div id="tablet-screen-width-point" style="position:absolute;top:-10000px;width:10px;height:10px;background:#fff;"></div>'),$("body").append(b).append(c),d.on("resize",a(function(){return d.trigger("pa.resize"),b.is(":visible")?("small"!==e&&d.trigger("pa.screen.small"),e="small"):c.is(":visible")?("tablet"!==e&&d.trigger("pa.screen.tablet"),e="tablet"):("desktop"!==e&&d.trigger("pa.screen.desktop"),e="desktop")}))})}.call(this),FastClick.prototype.deviceIsAndroid=navigator.userAgent.indexOf("Android")>0,FastClick.prototype.deviceIsIOS=/iP(ad|hone|od)/.test(navigator.userAgent),FastClick.prototype.deviceIsIOS4=FastClick.prototype.deviceIsIOS&&/OS 4_\d(_\d)?/.test(navigator.userAgent),FastClick.prototype.deviceIsIOSWithBadTarget=FastClick.prototype.deviceIsIOS&&/OS ([6-9]|\d{2})_\d/.test(navigator.userAgent),FastClick.prototype.needsClick=function(a){"use strict";switch(a.nodeName.toLowerCase()){case"button":case"select":case"textarea":if(a.disabled)return!0;break;case"input":if(this.deviceIsIOS&&"file"===a.type||a.disabled)return!0;break;case"label":case"video":return!0}return/\bneedsclick\b/.test(a.className)},FastClick.prototype.needsFocus=function(a){"use strict";switch(a.nodeName.toLowerCase()){case"textarea":return!0;case"select":return!this.deviceIsAndroid;case"input":switch(a.type){case"button":case"checkbox":case"file":case"image":case"radio":case"submit":return!1}return!a.disabled&&!a.readOnly;default:return/\bneedsfocus\b/.test(a.className)}},FastClick.prototype.sendClick=function(a,b){"use strict";var c,d;document.activeElement&&document.activeElement!==a&&document.activeElement.blur(),d=b.changedTouches[0],c=document.createEvent("MouseEvents"),c.initMouseEvent(this.determineEventType(a),!0,!0,window,1,d.screenX,d.screenY,d.clientX,d.clientY,!1,!1,!1,!1,0,null),c.forwardedTouchEvent=!0,a.dispatchEvent(c)},FastClick.prototype.determineEventType=function(a){"use strict";return this.deviceIsAndroid&&"select"===a.tagName.toLowerCase()?"mousedown":"click"},FastClick.prototype.focus=function(a){"use strict";var b;this.deviceIsIOS&&a.setSelectionRange&&0!==a.type.indexOf("date")&&"time"!==a.type?(b=a.value.length,a.setSelectionRange(b,b)):a.focus()},FastClick.prototype.updateScrollParent=function(a){"use strict";var b,c;if(b=a.fastClickScrollParent,!b||!b.contains(a)){c=a;do{if(c.scrollHeight>c.offsetHeight){b=c,a.fastClickScrollParent=c;break}c=c.parentElement}while(c)}b&&(b.fastClickLastScrollTop=b.scrollTop)},FastClick.prototype.getTargetElementFromEventTarget=function(a){"use strict";return a.nodeType===Node.TEXT_NODE?a.parentNode:a},FastClick.prototype.onTouchStart=function(a){"use strict";var b,c,d;if(a.targetTouches.length>1)return!0;if(b=this.getTargetElementFromEventTarget(a.target),c=a.targetTouches[0],this.deviceIsIOS){if(d=window.getSelection(),d.rangeCount&&!d.isCollapsed)return!0;if(!this.deviceIsIOS4){if(c.identifier===this.lastTouchIdentifier)return a.preventDefault(),!1;this.lastTouchIdentifier=c.identifier,this.updateScrollParent(b)}}return this.trackingClick=!0,this.trackingClickStart=a.timeStamp,this.targetElement=b,this.touchStartX=c.pageX,this.touchStartY=c.pageY,a.timeStamp-this.lastClickTime<200&&a.preventDefault(),!0},FastClick.prototype.touchHasMoved=function(a){"use strict";var b=a.changedTouches[0],c=this.touchBoundary;return Math.abs(b.pageX-this.touchStartX)>c||Math.abs(b.pageY-this.touchStartY)>c?!0:!1},FastClick.prototype.onTouchMove=function(a){"use strict";return this.trackingClick?((this.targetElement!==this.getTargetElementFromEventTarget(a.target)||this.touchHasMoved(a))&&(this.trackingClick=!1,this.targetElement=null),!0):!0},FastClick.prototype.findControl=function(a){"use strict";return void 0!==a.control?a.control:a.htmlFor?document.getElementById(a.htmlFor):a.querySelector("button, input:not([type=hidden]), keygen, meter, output, progress, select, textarea")},FastClick.prototype.onTouchEnd=function(a){"use strict";var b,c,d,e,f,g=this.targetElement;if(!this.trackingClick)return!0;if(a.timeStamp-this.lastClickTime<200)return this.cancelNextClick=!0,!0;if(this.cancelNextClick=!1,this.lastClickTime=a.timeStamp,c=this.trackingClickStart,this.trackingClick=!1,this.trackingClickStart=0,this.deviceIsIOSWithBadTarget&&(f=a.changedTouches[0],g=document.elementFromPoint(f.pageX-window.pageXOffset,f.pageY-window.pageYOffset)||g,g.fastClickScrollParent=this.targetElement.fastClickScrollParent),d=g.tagName.toLowerCase(),"label"===d){if(b=this.findControl(g)){if(this.focus(g),this.deviceIsAndroid)return!1;g=b}}else if(this.needsFocus(g))return a.timeStamp-c>100||this.deviceIsIOS&&window.top!==window&&"input"===d?(this.targetElement=null,!1):(this.focus(g),this.deviceIsIOS4&&"select"===d||(this.targetElement=null,a.preventDefault()),!1);return this.deviceIsIOS&&!this.deviceIsIOS4&&(e=g.fastClickScrollParent,e&&e.fastClickLastScrollTop!==e.scrollTop)?!0:(this.needsClick(g)||(a.preventDefault(),this.sendClick(g,a)),!1)},FastClick.prototype.onTouchCancel=function(){"use strict";this.trackingClick=!1,this.targetElement=null},FastClick.prototype.onMouse=function(a){"use strict";return this.targetElement?a.forwardedTouchEvent?!0:a.cancelable&&(!this.needsClick(this.targetElement)||this.cancelNextClick)?(a.stopImmediatePropagation?a.stopImmediatePropagation():a.propagationStopped=!0,a.stopPropagation(),a.preventDefault(),!1):!0:!0},FastClick.prototype.onClick=function(a){"use strict";var b;return this.trackingClick?(this.targetElement=null,this.trackingClick=!1,!0):"submit"===a.target.type&&0===a.detail?!0:(b=this.onMouse(a),b||(this.targetElement=null),b)},FastClick.prototype.destroy=function(){"use strict";var a=this.layer;this.deviceIsAndroid&&(a.removeEventListener("mouseover",this.onMouse,!0),a.removeEventListener("mousedown",this.onMouse,!0),a.removeEventListener("mouseup",this.onMouse,!0)),a.removeEventListener("click",this.onClick,!0),a.removeEventListener("touchstart",this.onTouchStart,!1),a.removeEventListener("touchmove",this.onTouchMove,!1),a.removeEventListener("touchend",this.onTouchEnd,!1),a.removeEventListener("touchcancel",this.onTouchCancel,!1)},FastClick.notNeeded=function(a){"use strict";var b,c;if("undefined"==typeof window.ontouchstart)return!0;if(c=+(/Chrome\/([0-9]+)/.exec(navigator.userAgent)||[,0])[1]){if(!FastClick.prototype.deviceIsAndroid)return!0;if(b=document.querySelector("meta[name=viewport]")){if(-1!==b.content.indexOf("user-scalable=no"))return!0;if(c>31&&window.innerWidth<=window.screen.width)return!0}}return"none"===a.style.msTouchAction?!0:!1},FastClick.attach=function(a){"use strict";return new FastClick(a)},"undefined"!=typeof define&&define.amd?define(function(){"use strict";return FastClick}):"undefined"!=typeof module&&module.exports?(module.exports=FastClick.attach,module.exports.FastClick=FastClick):window.FastClick=FastClick,function(a,b,c){"use strict";var d={"filterId":0},e=function(e,f){var g={"intensity":5,"forceSVGUrl":!1},h=c.extend(g,f);this.$elm=e instanceof c?e:c(e);var i=!1,j=" -webkit- -moz- -o- -ms- ".split(" "),k={},l=function(a){if(k[a]||""===k[a])return k[a]+a;var c=b.createElement("div"),d=["","Moz","Webkit","O","ms","Khtml"];for(var e in d)if("undefined"!=typeof c.style[d[e]+a])return k[a]=d[e],d[e]+a;return a.toLowerCase()},m=function(){var a=b.createElement("div");return a.style.cssText=j.join("filter:blur(2px); "),!!a.style.length&&(void 0===b.documentMode||b.documentMode>9)}(),n=function(){var a=!1;try{a=void 0!==typeof SVGFEColorMatrixElement&&2==SVGFEColorMatrixElement.SVG_FECOLORMATRIX_TYPE_SATURATE}catch(b){}return a}(),o=function(){var a="<svg id='vague-svg-blur' style='position:absolute;' width='0' height='0' ><filter id='blur-effect-id-"+d.filterId+"'><feGaussianBlur stdDeviation='"+h.intensity+"' /></filter></svg>";c("body").append(a)};return this.init=function(){n&&o(),this.$elm.data("vague-filter-id",d.filterId),d.filterId++},this.blur=function(){var b,c=a.location,d=h.forceSVGUrl?c.protocol+"//"+c.host+c.pathname:"",e=this.$elm.data("vague-filter-id"),f={};b=m?"blur("+h.intensity+"px)":n?"url("+d+"#blur-effect-id-"+e+")":"progid:DXImageTransform.Microsoft.Blur(pixelradius="+h.intensity+")",f[l("Filter")]=b,this.$elm.css(f),i=!0},this.unblur=function(){var a={};a[l("Filter")]="none",this.$elm.css(a),i=!1},this.toggleblur=function(){i?this.unblur():this.blur()},this.destroy=function(){n&&c("filter#blur-effect-id-"+this.$elm.data("vague-filter-id")).parent().remove(),this.unblur()},this.init()};c.fn.Vague=function(a){return new e(this,a)},a.Vague=e}(window,document,jQuery),function(a){"undefined"==typeof a.fn.each2&&a.extend(a.fn,{"each2":function(b){for(var c=a([0]),d=-1,e=this.length;++d<e&&(c.context=c[0]=this[d])&&b.call(c[0],d,c)!==!1;);return this}})}(jQuery),function(a,b){"use strict";function c(a){var b,c,d,e;if(!a||a.length<1)return a;for(b="",c=0,d=a.length;d>c;c++)e=a.charAt(c),b+=N[e]||e;return b}function d(a,b){for(var c=0,d=b.length;d>c;c+=1)if(f(a,b[c]))return c;return-1}function e(){var b=a(M);b.appendTo("body");var c={"width":b.width()-b[0].clientWidth,"height":b.height()-b[0].clientHeight};return b.remove(),c}function f(a,c){return a===c?!0:a===b||c===b?!1:null===a||null===c?!1:a.constructor===String?a+""==c+"":c.constructor===String?c+""==a+"":!1}function g(b,c){var d,e,f;if(null===b||b.length<1)return[];for(d=b.split(c),e=0,f=d.length;f>e;e+=1)d[e]=a.trim(d[e]);return d}function h(a){return a.outerWidth(!1)-a.width()}function i(c){var d="keyup-change-value";c.on("keydown",function(){a.data(c,d)===b&&a.data(c,d,c.val())}),c.on("keyup",function(){var e=a.data(c,d);e!==b&&c.val()!==e&&(a.removeData(c,d),c.trigger("keyup-change"))})}function j(c){c.on("mousemove",function(c){var d=L;(d===b||d.x!==c.pageX||d.y!==c.pageY)&&a(c.target).trigger("mousemove-filtered",c)})}function k(a,c,d){d=d||b;var e;return function(){var b=arguments;window.clearTimeout(e),e=window.setTimeout(function(){c.apply(d,b)},a)}}function l(a){var b,c=!1;return function(){return c===!1&&(b=a(),c=!0),b}}function m(a,b){var c=k(a,function(a){b.trigger("scroll-debounced",a)});b.on("scroll",function(a){d(a.target,b.get())>=0&&c(a)})}function n(a){a[0]!==document.activeElement&&window.setTimeout(function(){var b,c=a[0],d=a.val().length;a.focus(),a.is(":visible")&&c===document.activeElement&&(c.setSelectionRange?c.setSelectionRange(d,d):c.createTextRange&&(b=c.createTextRange(),b.collapse(!1),b.select()))},0)}function o(b){b=a(b)[0];var c=0,d=0;if("selectionStart"in b)c=b.selectionStart,d=b.selectionEnd-c;else if("selection"in document){b.focus();var e=document.selection.createRange();d=document.selection.createRange().text.length,e.moveStart("character",-b.value.length),c=e.text.length-d}return{"offset":c,"length":d}}function p(a){a.preventDefault(),a.stopPropagation()}function q(a){a.preventDefault(),a.stopImmediatePropagation()}function r(b){if(!I){var c=b[0].currentStyle||window.getComputedStyle(b[0],null);I=a(document.createElement("div")).css({"position":"absolute","left":"-10000px","top":"-10000px","display":"none","fontSize":c.fontSize,"fontFamily":c.fontFamily,"fontStyle":c.fontStyle,"fontWeight":c.fontWeight,"letterSpacing":c.letterSpacing,"textTransform":c.textTransform,"whiteSpace":"nowrap"}),I.attr("class","select2-sizer"),a("body").append(I)}return I.text(b.val()),I.width()}function s(b,c,d){var e,f,g=[];e=b.attr("class"),e&&(e=""+e,a(e.split(" ")).each2(function(){0===this.indexOf("select2-")&&g.push(this)})),e=c.attr("class"),e&&(e=""+e,a(e.split(" ")).each2(function(){0!==this.indexOf("select2-")&&(f=d(this),f&&g.push(f))})),b.attr("class",g.join(" "))}function t(a,b,d,e){var f=c(a.toUpperCase()).indexOf(c(b.toUpperCase())),g=b.length;return 0>f?void d.push(e(a)):(d.push(e(a.substring(0,f))),d.push("<span class='select2-match'>"),d.push(e(a.substring(f,f+g))),d.push("</span>"),void d.push(e(a.substring(f+g,a.length))))}function u(a){var b={"\\":"\","&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};return String(a).replace(/[&<>"'\/\\]/g,function(a){return b[a]})}function v(c){var d,e=null,f=c.quietMillis||100,g=c.url,h=this;return function(i){window.clearTimeout(d),d=window.setTimeout(function(){var d=c.data,f=g,j=c.transport||a.fn.select2.ajaxDefaults.transport,k={"type":c.type||"GET","cache":c.cache||!1,"jsonpCallback":c.jsonpCallback||b,"dataType":c.dataType||"json"},l=a.extend({},a.fn.select2.ajaxDefaults.params,k);d=d?d.call(h,i.term,i.page,i.context):null,f="function"==typeof f?f.call(h,i.term,i.page,i.context):f,e&&e.abort(),c.params&&(a.isFunction(c.params)?a.extend(l,c.params.call(h)):a.extend(l,c.params)),a.extend(l,{"url":f,"dataType":c.dataType,"data":d,"success":function(a){var b=c.results(a,i.page);i.callback(b)}}),e=j.call(h,l)},f)}}function w(b){var c,d,e=b,f=function(a){return""+a.text};a.isArray(e)&&(d=e,e={"results":d}),a.isFunction(e)===!1&&(d=e,e=function(){return d});var g=e();return g.text&&(f=g.text,a.isFunction(f)||(c=g.text,f=function(a){return a[c]})),function(b){var c,d=b.term,g={"results":[]};return""===d?void b.callback(e()):(c=function(e,g){var h,i;if(e=e[0],e.children){h={};for(i in e)e.hasOwnProperty(i)&&(h[i]=e[i]);h.children=[],a(e.children).each2(function(a,b){c(b,h.children)}),(h.children.length||b.matcher(d,f(h),e))&&g.push(h)}else b.matcher(d,f(e),e)&&g.push(e)},a(e().results).each2(function(a,b){c(b,g.results)}),void b.callback(g))}}function x(c){var d=a.isFunction(c);return function(e){var f=e.term,g={"results":[]};a(d?c():c).each(function(){var a=this.text!==b,c=a?this.text:this;(""===f||e.matcher(f,c))&&g.results.push(a?this:{"id":this,"text":this})}),e.callback(g)}}function y(b,c){if(a.isFunction(b))return!0;if(!b)return!1;throw new Error(c+" must be a function or a falsy value")}function z(b){return a.isFunction(b)?b():b}function A(b){var c=0;return a.each(b,function(a,b){b.children?c+=A(b.children):c++}),c}function B(a,c,d,e){var g,h,i,j,k,l=a,m=!1;if(!e.createSearchChoice||!e.tokenSeparators||e.tokenSeparators.length<1)return b;for(;;){for(h=-1,i=0,j=e.tokenSeparators.length;j>i&&(k=e.tokenSeparators[i],h=a.indexOf(k),!(h>=0));i++);if(0>h)break;if(g=a.substring(0,h),a=a.substring(h+k.length),g.length>0&&(g=e.createSearchChoice.call(this,g,c),g!==b&&null!==g&&e.id(g)!==b&&null!==e.id(g))){for(m=!1,i=0,j=c.length;j>i;i++)if(f(e.id(g),e.id(c[i]))){m=!0;break}m||d(g)}}return l!==a?a:void 0}function C(b,c){var d=function(){};return d.prototype=new b,d.prototype.constructor=d,d.prototype.parent=b.prototype,d.prototype=a.extend(d.prototype,c),d}if(window.Select2===b){var D,E,F,G,H,I,J,K,L={"x":0,"y":0},D={"TAB":9,"ENTER":13,"ESC":27,"SPACE":32,"LEFT":37,"UP":38,"RIGHT":39,"DOWN":40,"SHIFT":16,"CTRL":17,"ALT":18,"PAGE_UP":33,"PAGE_DOWN":34,"HOME":36,"END":35,"BACKSPACE":8,"DELETE":46,"isArrow":function(a){switch(a=a.which?a.which:a){case D.LEFT:case D.RIGHT:case D.UP:case D.DOWN:return!0}return!1},"isControl":function(a){var b=a.which;switch(b){case D.SHIFT:case D.CTRL:case D.ALT:return!0}return a.metaKey?!0:!1},"isFunctionKey":function(a){return a=a.which?a.which:a,a>=112&&123>=a}},M="<div class='select2-measure-scrollbar'></div>",N={"\u24b6":"A","\uff21":"A","\xc0":"A","\xc1":"A","\xc2":"A","\u1ea6":"A","\u1ea4":"A","\u1eaa":"A","\u1ea8":"A","\xc3":"A","\u0100":"A","\u0102":"A","\u1eb0":"A","\u1eae":"A","\u1eb4":"A","\u1eb2":"A","\u0226":"A","\u01e0":"A","\xc4":"A","\u01de":"A","\u1ea2":"A","\xc5":"A","\u01fa":"A","\u01cd":"A","\u0200":"A","\u0202":"A","\u1ea0":"A","\u1eac":"A","\u1eb6":"A","\u1e00":"A","\u0104":"A","\u023a":"A","\u2c6f":"A","\ua732":"AA","\xc6":"AE","\u01fc":"AE","\u01e2":"AE","\ua734":"AO","\ua736":"AU","\ua738":"AV","\ua73a":"AV","\ua73c":"AY","\u24b7":"B","\uff22":"B","\u1e02":"B","\u1e04":"B","\u1e06":"B","\u0243":"B","\u0182":"B","\u0181":"B","\u24b8":"C","\uff23":"C","\u0106":"C","\u0108":"C","\u010a":"C","\u010c":"C","\xc7":"C","\u1e08":"C","\u0187":"C","\u023b":"C","\ua73e":"C","\u24b9":"D","\uff24":"D","\u1e0a":"D","\u010e":"D","\u1e0c":"D","\u1e10":"D","\u1e12":"D","\u1e0e":"D","\u0110":"D","\u018b":"D","\u018a":"D","\u0189":"D","\ua779":"D","\u01f1":"DZ","\u01c4":"DZ","\u01f2":"Dz","\u01c5":"Dz","\u24ba":"E","\uff25":"E","\xc8":"E","\xc9":"E","\xca":"E","\u1ec0":"E","\u1ebe":"E","\u1ec4":"E","\u1ec2":"E","\u1ebc":"E","\u0112":"E","\u1e14":"E","\u1e16":"E","\u0114":"E","\u0116":"E","\xcb":"E","\u1eba":"E","\u011a":"E","\u0204":"E","\u0206":"E","\u1eb8":"E","\u1ec6":"E","\u0228":"E","\u1e1c":"E","\u0118":"E","\u1e18":"E","\u1e1a":"E","\u0190":"E","\u018e":"E","\u24bb":"F","\uff26":"F","\u1e1e":"F","\u0191":"F","\ua77b":"F","\u24bc":"G","\uff27":"G","\u01f4":"G","\u011c":"G","\u1e20":"G","\u011e":"G","\u0120":"G","\u01e6":"G","\u0122":"G","\u01e4":"G","\u0193":"G","\ua7a0":"G","\ua77d":"G","\ua77e":"G","\u24bd":"H","\uff28":"H","\u0124":"H","\u1e22":"H","\u1e26":"H","\u021e":"H","\u1e24":"H","\u1e28":"H","\u1e2a":"H","\u0126":"H","\u2c67":"H","\u2c75":"H","\ua78d":"H","\u24be":"I","\uff29":"I","\xcc":"I","\xcd":"I","\xce":"I","\u0128":"I","\u012a":"I","\u012c":"I","\u0130":"I","\xcf":"I","\u1e2e":"I","\u1ec8":"I","\u01cf":"I","\u0208":"I","\u020a":"I","\u1eca":"I","\u012e":"I","\u1e2c":"I","\u0197":"I","\u24bf":"J","\uff2a":"J","\u0134":"J","\u0248":"J","\u24c0":"K","\uff2b":"K","\u1e30":"K","\u01e8":"K","\u1e32":"K","\u0136":"K","\u1e34":"K","\u0198":"K","\u2c69":"K","\ua740":"K","\ua742":"K","\ua744":"K","\ua7a2":"K","\u24c1":"L","\uff2c":"L","\u013f":"L","\u0139":"L","\u013d":"L","\u1e36":"L","\u1e38":"L","\u013b":"L","\u1e3c":"L","\u1e3a":"L","\u0141":"L","\u023d":"L","\u2c62":"L","\u2c60":"L","\ua748":"L","\ua746":"L","\ua780":"L","\u01c7":"LJ","\u01c8":"Lj","\u24c2":"M","\uff2d":"M","\u1e3e":"M","\u1e40":"M","\u1e42":"M","\u2c6e":"M","\u019c":"M","\u24c3":"N","\uff2e":"N","\u01f8":"N","\u0143":"N","\xd1":"N","\u1e44":"N","\u0147":"N","\u1e46":"N","\u0145":"N","\u1e4a":"N","\u1e48":"N","\u0220":"N","\u019d":"N","\ua790":"N","\ua7a4":"N","\u01ca":"NJ","\u01cb":"Nj","\u24c4":"O","\uff2f":"O","\xd2":"O","\xd3":"O","\xd4":"O","\u1ed2":"O","\u1ed0":"O","\u1ed6":"O","\u1ed4":"O","\xd5":"O","\u1e4c":"O","\u022c":"O","\u1e4e":"O","\u014c":"O","\u1e50":"O","\u1e52":"O","\u014e":"O","\u022e":"O","\u0230":"O","\xd6":"O","\u022a":"O","\u1ece":"O","\u0150":"O","\u01d1":"O","\u020c":"O","\u020e":"O","\u01a0":"O","\u1edc":"O","\u1eda":"O","\u1ee0":"O","\u1ede":"O","\u1ee2":"O","\u1ecc":"O","\u1ed8":"O","\u01ea":"O","\u01ec":"O","\xd8":"O","\u01fe":"O","\u0186":"O","\u019f":"O","\ua74a":"O","\ua74c":"O","\u01a2":"OI","\ua74e":"OO","\u0222":"OU","\u24c5":"P","\uff30":"P","\u1e54":"P","\u1e56":"P","\u01a4":"P","\u2c63":"P","\ua750":"P","\ua752":"P","\ua754":"P","\u24c6":"Q","\uff31":"Q","\ua756":"Q","\ua758":"Q","\u024a":"Q","\u24c7":"R","\uff32":"R","\u0154":"R","\u1e58":"R","\u0158":"R","\u0210":"R","\u0212":"R","\u1e5a":"R","\u1e5c":"R","\u0156":"R","\u1e5e":"R","\u024c":"R","\u2c64":"R","\ua75a":"R","\ua7a6":"R","\ua782":"R","\u24c8":"S","\uff33":"S","\u1e9e":"S","\u015a":"S","\u1e64":"S","\u015c":"S","\u1e60":"S","\u0160":"S","\u1e66":"S","\u1e62":"S","\u1e68":"S","\u0218":"S","\u015e":"S","\u2c7e":"S","\ua7a8":"S","\ua784":"S","\u24c9":"T","\uff34":"T","\u1e6a":"T","\u0164":"T","\u1e6c":"T","\u021a":"T","\u0162":"T","\u1e70":"T","\u1e6e":"T","\u0166":"T","\u01ac":"T","\u01ae":"T","\u023e":"T","\ua786":"T","\ua728":"TZ","\u24ca":"U","\uff35":"U","\xd9":"U","\xda":"U","\xdb":"U","\u0168":"U","\u1e78":"U","\u016a":"U","\u1e7a":"U","\u016c":"U","\xdc":"U","\u01db":"U","\u01d7":"U","\u01d5":"U","\u01d9":"U","\u1ee6":"U","\u016e":"U","\u0170":"U","\u01d3":"U","\u0214":"U","\u0216":"U","\u01af":"U","\u1eea":"U","\u1ee8":"U","\u1eee":"U","\u1eec":"U","\u1ef0":"U","\u1ee4":"U","\u1e72":"U","\u0172":"U","\u1e76":"U","\u1e74":"U","\u0244":"U","\u24cb":"V","\uff36":"V","\u1e7c":"V","\u1e7e":"V","\u01b2":"V","\ua75e":"V","\u0245":"V","\ua760":"VY","\u24cc":"W","\uff37":"W","\u1e80":"W","\u1e82":"W","\u0174":"W","\u1e86":"W","\u1e84":"W","\u1e88":"W","\u2c72":"W","\u24cd":"X","\uff38":"X","\u1e8a":"X","\u1e8c":"X","\u24ce":"Y","\uff39":"Y","\u1ef2":"Y","\xdd":"Y","\u0176":"Y","\u1ef8":"Y","\u0232":"Y","\u1e8e":"Y","\u0178":"Y","\u1ef6":"Y","\u1ef4":"Y","\u01b3":"Y","\u024e":"Y","\u1efe":"Y","\u24cf":"Z","\uff3a":"Z","\u0179":"Z","\u1e90":"Z","\u017b":"Z","\u017d":"Z","\u1e92":"Z","\u1e94":"Z","\u01b5":"Z","\u0224":"Z","\u2c7f":"Z","\u2c6b":"Z","\ua762":"Z","\u24d0":"a","\uff41":"a","\u1e9a":"a","\xe0":"a","\xe1":"a","\xe2":"a","\u1ea7":"a","\u1ea5":"a","\u1eab":"a","\u1ea9":"a","\xe3":"a","\u0101":"a","\u0103":"a","\u1eb1":"a","\u1eaf":"a","\u1eb5":"a","\u1eb3":"a","\u0227":"a","\u01e1":"a","\xe4":"a","\u01df":"a","\u1ea3":"a","\xe5":"a","\u01fb":"a","\u01ce":"a","\u0201":"a","\u0203":"a","\u1ea1":"a","\u1ead":"a","\u1eb7":"a","\u1e01":"a","\u0105":"a","\u2c65":"a","\u0250":"a","\ua733":"aa","\xe6":"ae","\u01fd":"ae","\u01e3":"ae","\ua735":"ao","\ua737":"au","\ua739":"av","\ua73b":"av","\ua73d":"ay","\u24d1":"b","\uff42":"b","\u1e03":"b","\u1e05":"b","\u1e07":"b","\u0180":"b","\u0183":"b","\u0253":"b","\u24d2":"c","\uff43":"c","\u0107":"c","\u0109":"c","\u010b":"c","\u010d":"c","\xe7":"c","\u1e09":"c","\u0188":"c","\u023c":"c","\ua73f":"c","\u2184":"c","\u24d3":"d","\uff44":"d","\u1e0b":"d","\u010f":"d","\u1e0d":"d","\u1e11":"d","\u1e13":"d","\u1e0f":"d","\u0111":"d","\u018c":"d","\u0256":"d","\u0257":"d","\ua77a":"d","\u01f3":"dz","\u01c6":"dz","\u24d4":"e","\uff45":"e","\xe8":"e","\xe9":"e","\xea":"e","\u1ec1":"e","\u1ebf":"e","\u1ec5":"e","\u1ec3":"e","\u1ebd":"e","\u0113":"e","\u1e15":"e","\u1e17":"e","\u0115":"e","\u0117":"e","\xeb":"e","\u1ebb":"e","\u011b":"e","\u0205":"e","\u0207":"e","\u1eb9":"e","\u1ec7":"e","\u0229":"e","\u1e1d":"e","\u0119":"e","\u1e19":"e","\u1e1b":"e","\u0247":"e","\u025b":"e","\u01dd":"e","\u24d5":"f","\uff46":"f","\u1e1f":"f","\u0192":"f","\ua77c":"f","\u24d6":"g","\uff47":"g","\u01f5":"g","\u011d":"g","\u1e21":"g","\u011f":"g","\u0121":"g","\u01e7":"g","\u0123":"g","\u01e5":"g","\u0260":"g","\ua7a1":"g","\u1d79":"g","\ua77f":"g","\u24d7":"h","\uff48":"h","\u0125":"h","\u1e23":"h","\u1e27":"h","\u021f":"h","\u1e25":"h","\u1e29":"h","\u1e2b":"h","\u1e96":"h","\u0127":"h","\u2c68":"h","\u2c76":"h","\u0265":"h","\u0195":"hv","\u24d8":"i","\uff49":"i","\xec":"i","\xed":"i","\xee":"i","\u0129":"i","\u012b":"i","\u012d":"i","\xef":"i","\u1e2f":"i","\u1ec9":"i","\u01d0":"i","\u0209":"i","\u020b":"i","\u1ecb":"i","\u012f":"i","\u1e2d":"i","\u0268":"i","\u0131":"i","\u24d9":"j","\uff4a":"j","\u0135":"j","\u01f0":"j","\u0249":"j","\u24da":"k","\uff4b":"k","\u1e31":"k","\u01e9":"k","\u1e33":"k","\u0137":"k","\u1e35":"k","\u0199":"k","\u2c6a":"k","\ua741":"k","\ua743":"k","\ua745":"k","\ua7a3":"k","\u24db":"l","\uff4c":"l","\u0140":"l","\u013a":"l","\u013e":"l","\u1e37":"l","\u1e39":"l","\u013c":"l","\u1e3d":"l","\u1e3b":"l","\u017f":"l","\u0142":"l","\u019a":"l","\u026b":"l","\u2c61":"l","\ua749":"l","\ua781":"l","\ua747":"l","\u01c9":"lj","\u24dc":"m","\uff4d":"m","\u1e3f":"m","\u1e41":"m","\u1e43":"m","\u0271":"m","\u026f":"m","\u24dd":"n","\uff4e":"n","\u01f9":"n","\u0144":"n","\xf1":"n","\u1e45":"n","\u0148":"n","\u1e47":"n","\u0146":"n","\u1e4b":"n","\u1e49":"n","\u019e":"n","\u0272":"n","\u0149":"n","\ua791":"n","\ua7a5":"n","\u01cc":"nj","\u24de":"o","\uff4f":"o","\xf2":"o","\xf3":"o","\xf4":"o","\u1ed3":"o","\u1ed1":"o","\u1ed7":"o","\u1ed5":"o","\xf5":"o","\u1e4d":"o","\u022d":"o","\u1e4f":"o","\u014d":"o","\u1e51":"o","\u1e53":"o","\u014f":"o","\u022f":"o","\u0231":"o","\xf6":"o","\u022b":"o","\u1ecf":"o","\u0151":"o","\u01d2":"o","\u020d":"o","\u020f":"o","\u01a1":"o","\u1edd":"o","\u1edb":"o","\u1ee1":"o","\u1edf":"o","\u1ee3":"o","\u1ecd":"o","\u1ed9":"o","\u01eb":"o","\u01ed":"o","\xf8":"o","\u01ff":"o","\u0254":"o","\ua74b":"o","\ua74d":"o","\u0275":"o","\u01a3":"oi","\u0223":"ou","\ua74f":"oo","\u24df":"p","\uff50":"p","\u1e55":"p","\u1e57":"p","\u01a5":"p","\u1d7d":"p","\ua751":"p","\ua753":"p","\ua755":"p","\u24e0":"q","\uff51":"q","\u024b":"q","\ua757":"q","\ua759":"q","\u24e1":"r","\uff52":"r","\u0155":"r","\u1e59":"r","\u0159":"r","\u0211":"r","\u0213":"r","\u1e5b":"r","\u1e5d":"r","\u0157":"r","\u1e5f":"r","\u024d":"r","\u027d":"r","\ua75b":"r","\ua7a7":"r","\ua783":"r","\u24e2":"s","\uff53":"s","\xdf":"s","\u015b":"s","\u1e65":"s","\u015d":"s","\u1e61":"s","\u0161":"s","\u1e67":"s","\u1e63":"s","\u1e69":"s","\u0219":"s","\u015f":"s","\u023f":"s","\ua7a9":"s","\ua785":"s","\u1e9b":"s","\u24e3":"t","\uff54":"t","\u1e6b":"t","\u1e97":"t","\u0165":"t","\u1e6d":"t","\u021b":"t","\u0163":"t","\u1e71":"t","\u1e6f":"t","\u0167":"t","\u01ad":"t","\u0288":"t","\u2c66":"t","\ua787":"t","\ua729":"tz","\u24e4":"u","\uff55":"u","\xf9":"u","\xfa":"u","\xfb":"u","\u0169":"u","\u1e79":"u","\u016b":"u","\u1e7b":"u","\u016d":"u","\xfc":"u","\u01dc":"u","\u01d8":"u","\u01d6":"u","\u01da":"u","\u1ee7":"u","\u016f":"u","\u0171":"u","\u01d4":"u","\u0215":"u","\u0217":"u","\u01b0":"u","\u1eeb":"u","\u1ee9":"u","\u1eef":"u","\u1eed":"u","\u1ef1":"u","\u1ee5":"u","\u1e73":"u","\u0173":"u","\u1e77":"u","\u1e75":"u","\u0289":"u","\u24e5":"v","\uff56":"v","\u1e7d":"v","\u1e7f":"v","\u028b":"v","\ua75f":"v","\u028c":"v","\ua761":"vy","\u24e6":"w","\uff57":"w","\u1e81":"w","\u1e83":"w","\u0175":"w","\u1e87":"w","\u1e85":"w","\u1e98":"w","\u1e89":"w","\u2c73":"w","\u24e7":"x","\uff58":"x","\u1e8b":"x","\u1e8d":"x","\u24e8":"y","\uff59":"y","\u1ef3":"y","\xfd":"y","\u0177":"y","\u1ef9":"y","\u0233":"y","\u1e8f":"y","\xff":"y","\u1ef7":"y","\u1e99":"y","\u1ef5":"y","\u01b4":"y","\u024f":"y","\u1eff":"y","\u24e9":"z","\uff5a":"z","\u017a":"z","\u1e91":"z","\u017c":"z","\u017e":"z","\u1e93":"z","\u1e95":"z","\u01b6":"z","\u0225":"z","\u0240":"z","\u2c6c":"z","\ua763":"z"};
|
|
J=a(document),H=function(){var a=1;return function(){return a++}}(),J.on("mousemove",function(a){L.x=a.pageX,L.y=a.pageY}),E=C(Object,{"bind":function(a){var b=this;return function(){a.apply(b,arguments)}},"init":function(c){var d,f,g=".select2-results";this.opts=c=this.prepareOpts(c),this.id=c.id,c.element.data("select2")!==b&&null!==c.element.data("select2")&&c.element.data("select2").destroy(),this.container=this.createContainer(),this.containerId="s2id_"+(c.element.attr("id")||"autogen"+H()),this.containerSelector="#"+this.containerId.replace(/([;&,\.\+\*\~':"\!\^#$%@\[\]\(\)=>\|])/g,"\\$1"),this.container.attr("id",this.containerId),this.body=l(function(){return c.element.closest("body")}),s(this.container,this.opts.element,this.opts.adaptContainerCssClass),this.container.attr("style",c.element.attr("style")),this.container.css(z(c.containerCss)),this.container.addClass(z(c.containerCssClass)),this.elementTabIndex=this.opts.element.attr("tabindex"),this.opts.element.data("select2",this).attr("tabindex","-1").before(this.container).on("click.select2",p),this.container.data("select2",this),this.dropdown=this.container.find(".select2-drop"),s(this.dropdown,this.opts.element,this.opts.adaptDropdownCssClass),this.dropdown.addClass(z(c.dropdownCssClass)),this.dropdown.data("select2",this),this.dropdown.on("click",p),this.results=d=this.container.find(g),this.search=f=this.container.find("input.select2-input"),this.queryCount=0,this.resultsPage=0,this.context=null,this.initContainer(),this.container.on("click",p),j(this.results),this.dropdown.on("mousemove-filtered touchstart touchmove touchend",g,this.bind(this.highlightUnderEvent)),m(80,this.results),this.dropdown.on("scroll-debounced",g,this.bind(this.loadMoreIfNeeded)),a(this.container).on("change",".select2-input",function(a){a.stopPropagation()}),a(this.dropdown).on("change",".select2-input",function(a){a.stopPropagation()}),a.fn.mousewheel&&d.mousewheel(function(a,b,c,e){var f=d.scrollTop();e>0&&0>=f-e?(d.scrollTop(0),p(a)):0>e&&d.get(0).scrollHeight-d.scrollTop()+e<=d.height()&&(d.scrollTop(d.get(0).scrollHeight-d.height()),p(a))}),i(f),f.on("keyup-change input paste",this.bind(this.updateResults)),f.on("focus",function(){f.addClass("select2-focused")}),f.on("blur",function(){f.removeClass("select2-focused")}),this.dropdown.on("mouseup",g,this.bind(function(b){a(b.target).closest(".select2-result-selectable").length>0&&(this.highlightUnderEvent(b),this.selectHighlighted(b))})),this.dropdown.on("click mouseup mousedown",function(a){a.stopPropagation()}),a.isFunction(this.opts.initSelection)&&(this.initSelection(),this.monitorSource()),null!==c.maximumInputLength&&this.search.attr("maxlength",c.maximumInputLength);var h=c.element.prop("disabled");h===b&&(h=!1),this.enable(!h);var k=c.element.prop("readonly");k===b&&(k=!1),this.readonly(k),K=K||e(),this.autofocus=c.element.prop("autofocus"),c.element.prop("autofocus",!1),this.autofocus&&this.focus(),this.nextSearchTerm=b},"destroy":function(){var a=this.opts.element,c=a.data("select2");this.close(),this.propertyObserver&&(delete this.propertyObserver,this.propertyObserver=null),c!==b&&(c.container.remove(),c.dropdown.remove(),a.removeClass("select2-offscreen").removeData("select2").off(".select2").prop("autofocus",this.autofocus||!1),this.elementTabIndex?a.attr({"tabindex":this.elementTabIndex}):a.removeAttr("tabindex"),a.show())},"optionToData":function(a){return a.is("option")?{"id":a.prop("value"),"text":a.text(),"element":a.get(),"css":a.attr("class"),"disabled":a.prop("disabled"),"locked":f(a.attr("locked"),"locked")||f(a.data("locked"),!0)}:a.is("optgroup")?{"text":a.attr("label"),"children":[],"element":a.get(),"css":a.attr("class")}:void 0},"prepareOpts":function(c){var d,e,h,i,j=this;if(d=c.element,"select"===d.get(0).tagName.toLowerCase()&&(this.select=e=c.element),e&&a.each(["id","multiple","ajax","query","createSearchChoice","initSelection","data","tags"],function(){if(this in c)throw new Error("Option '"+this+"' is not allowed for Select2 when attached to a <select> element.")}),c=a.extend({},{"populateResults":function(d,e,f){var g,h=this.opts.id;(g=function(d,e,i){var k,l,m,n,o,p,q,r,s,t;for(d=c.sortResults(d,e,f),k=0,l=d.length;l>k;k+=1)m=d[k],o=m.disabled===!0,n=!o&&h(m)!==b,p=m.children&&m.children.length>0,q=a("<li></li>"),q.addClass("select2-results-dept-"+i),q.addClass("select2-result"),q.addClass(n?"select2-result-selectable":"select2-result-unselectable"),o&&q.addClass("select2-disabled"),p&&q.addClass("select2-result-with-children"),q.addClass(j.opts.formatResultCssClass(m)),r=a(document.createElement("div")),r.addClass("select2-result-label"),t=c.formatResult(m,r,f,j.opts.escapeMarkup),t!==b&&r.html(t),q.append(r),p&&(s=a("<ul></ul>"),s.addClass("select2-result-sub"),g(m.children,s,i+1),q.append(s)),q.data("select2-data",m),e.append(q)})(e,d,0)}},a.fn.select2.defaults,c),"function"!=typeof c.id&&(h=c.id,c.id=function(a){return a[h]}),a.isArray(c.element.data("select2Tags"))){if("tags"in c)throw"tags specified as both an attribute 'data-select2-tags' and in options of Select2 "+c.element.attr("id");c.tags=c.element.data("select2Tags")}if(e?(c.query=this.bind(function(a){var c,e,f,g={"results":[],"more":!1},h=a.term;f=function(b,c){var d;b.is("option")?a.matcher(h,b.text(),b)&&c.push(j.optionToData(b)):b.is("optgroup")&&(d=j.optionToData(b),b.children().each2(function(a,b){f(b,d.children)}),d.children.length>0&&c.push(d))},c=d.children(),this.getPlaceholder()!==b&&c.length>0&&(e=this.getPlaceholderOption(),e&&(c=c.not(e))),c.each2(function(a,b){f(b,g.results)}),a.callback(g)}),c.id=function(a){return a.id},c.formatResultCssClass=function(a){return a.css}):"query"in c||("ajax"in c?(i=c.element.data("ajax-url"),i&&i.length>0&&(c.ajax.url=i),c.query=v.call(c.element,c.ajax)):"data"in c?c.query=w(c.data):"tags"in c&&(c.query=x(c.tags),c.createSearchChoice===b&&(c.createSearchChoice=function(b){return{"id":a.trim(b),"text":a.trim(b)}}),c.initSelection===b&&(c.initSelection=function(b,d){var e=[];a(g(b.val(),c.separator)).each(function(){var b={"id":this,"text":this},d=c.tags;a.isFunction(d)&&(d=d()),a(d).each(function(){return f(this.id,b.id)?(b=this,!1):void 0}),e.push(b)}),d(e)}))),"function"!=typeof c.query)throw"query function not defined for Select2 "+c.element.attr("id");return c},"monitorSource":function(){var a,c,d=this.opts.element;d.on("change.select2",this.bind(function(){this.opts.element.data("select2-change-triggered")!==!0&&this.initSelection()})),a=this.bind(function(){var a=d.prop("disabled");a===b&&(a=!1),this.enable(!a);var c=d.prop("readonly");c===b&&(c=!1),this.readonly(c),s(this.container,this.opts.element,this.opts.adaptContainerCssClass),this.container.addClass(z(this.opts.containerCssClass)),s(this.dropdown,this.opts.element,this.opts.adaptDropdownCssClass),this.dropdown.addClass(z(this.opts.dropdownCssClass))}),d.on("propertychange.select2",a),this.mutationCallback===b&&(this.mutationCallback=function(b){b.forEach(a)}),c=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver,c!==b&&(this.propertyObserver&&(delete this.propertyObserver,this.propertyObserver=null),this.propertyObserver=new c(this.mutationCallback),this.propertyObserver.observe(d.get(0),{"attributes":!0,"subtree":!1}))},"triggerSelect":function(b){var c=a.Event("select2-selecting",{"val":this.id(b),"object":b});return this.opts.element.trigger(c),!c.isDefaultPrevented()},"triggerChange":function(b){b=b||{},b=a.extend({},b,{"type":"change","val":this.val()}),this.opts.element.data("select2-change-triggered",!0),this.opts.element.trigger(b),this.opts.element.data("select2-change-triggered",!1),this.opts.element.click(),this.opts.blurOnChange&&this.opts.element.blur()},"isInterfaceEnabled":function(){return this.enabledInterface===!0},"enableInterface":function(){var a=this._enabled&&!this._readonly,b=!a;return a===this.enabledInterface?!1:(this.container.toggleClass("select2-container-disabled",b),this.close(),this.enabledInterface=a,!0)},"enable":function(a){a===b&&(a=!0),this._enabled!==a&&(this._enabled=a,this.opts.element.prop("disabled",!a),this.enableInterface())},"disable":function(){this.enable(!1)},"readonly":function(a){return a===b&&(a=!1),this._readonly===a?!1:(this._readonly=a,this.opts.element.prop("readonly",a),this.enableInterface(),!0)},"opened":function(){return this.container.hasClass("select2-dropdown-open")},"positionDropdown":function(){var b,c,d,e,f,g=this.dropdown,h=this.container.offset(),i=this.container.outerHeight(!1),j=this.container.outerWidth(!1),k=g.outerHeight(!1),l=a(window),m=l.width(),n=l.height(),o=l.scrollLeft()+m,p=l.scrollTop()+n,q=h.top+i,r=h.left,s=p>=q+k,t=h.top-k>=this.body().scrollTop(),u=g.outerWidth(!1),v=o>=r+u,w=g.hasClass("select2-drop-above");w?(c=!0,!t&&s&&(d=!0,c=!1)):(c=!1,!s&&t&&(d=!0,c=!0)),d&&(g.hide(),h=this.container.offset(),i=this.container.outerHeight(!1),j=this.container.outerWidth(!1),k=g.outerHeight(!1),o=l.scrollLeft()+m,p=l.scrollTop()+n,q=h.top+i,r=h.left,u=g.outerWidth(!1),v=o>=r+u,g.show()),this.opts.dropdownAutoWidth?(f=a(".select2-results",g)[0],g.addClass("select2-drop-auto-width"),g.css("width",""),u=g.outerWidth(!1)+(f.scrollHeight===f.clientHeight?0:K.width),u>j?j=u:u=j,v=o>=r+u):this.container.removeClass("select2-drop-auto-width"),"static"!==this.body().css("position")&&(b=this.body().offset(),q-=b.top,r-=b.left),v||(r=h.left+j-u),e={"left":r,"width":j},c?(e.bottom=n-h.top,e.top="auto",this.container.addClass("select2-drop-above"),g.addClass("select2-drop-above")):(e.top=q,e.bottom="auto",this.container.removeClass("select2-drop-above"),g.removeClass("select2-drop-above")),e=a.extend(e,z(this.opts.dropdownCss)),g.css(e)},"shouldOpen":function(){var b;return this.opened()?!1:this._enabled===!1||this._readonly===!0?!1:(b=a.Event("select2-opening"),this.opts.element.trigger(b),!b.isDefaultPrevented())},"clearDropdownAlignmentPreference":function(){this.container.removeClass("select2-drop-above"),this.dropdown.removeClass("select2-drop-above")},"open":function(){return this.shouldOpen()?(this.opening(),!0):!1},"opening":function(){var b,c=this.containerId,d="scroll."+c,e="resize."+c,f="orientationchange."+c;this.container.addClass("select2-dropdown-open").addClass("select2-container-active"),this.clearDropdownAlignmentPreference(),this.dropdown[0]!==this.body().children().last()[0]&&this.dropdown.detach().appendTo(this.body()),b=a("#select2-drop-mask"),0==b.length&&(b=a(document.createElement("div")),b.attr("id","select2-drop-mask").attr("class","select2-drop-mask"),b.hide(),b.appendTo(this.body()),b.on("mousedown touchstart click",function(b){var c,d=a("#select2-drop");d.length>0&&(c=d.data("select2"),c.opts.selectOnBlur&&c.selectHighlighted({"noFocus":!0}),c.close({"focus":!0}),b.preventDefault(),b.stopPropagation())})),this.dropdown.prev()[0]!==b[0]&&this.dropdown.before(b),a("#select2-drop").removeAttr("id"),this.dropdown.attr("id","select2-drop"),b.show(),this.positionDropdown(),this.dropdown.show(),this.positionDropdown(),this.dropdown.addClass("select2-drop-active");var g=this;this.container.parents().add(window).each(function(){a(this).on(e+" "+d+" "+f,function(){g.positionDropdown()})})},"close":function(){if(this.opened()){var b=this.containerId,c="scroll."+b,d="resize."+b,e="orientationchange."+b;this.container.parents().add(window).each(function(){a(this).off(c).off(d).off(e)}),this.clearDropdownAlignmentPreference(),a("#select2-drop-mask").hide(),this.dropdown.removeAttr("id"),this.dropdown.hide(),this.container.removeClass("select2-dropdown-open").removeClass("select2-container-active"),this.results.empty(),this.clearSearch(),this.search.removeClass("select2-active"),this.opts.element.trigger(a.Event("select2-close"))}},"externalSearch":function(a){this.open(),this.search.val(a),this.updateResults(!1)},"clearSearch":function(){},"getMaximumSelectionSize":function(){return z(this.opts.maximumSelectionSize)},"ensureHighlightVisible":function(){var b,c,d,e,f,g,h,i=this.results;if(c=this.highlight(),!(0>c)){if(0==c)return void i.scrollTop(0);b=this.findHighlightableChoices().find(".select2-result-label"),d=a(b[c]),e=d.offset().top+d.outerHeight(!0),c===b.length-1&&(h=i.find("li.select2-more-results"),h.length>0&&(e=h.offset().top+h.outerHeight(!0))),f=i.offset().top+i.outerHeight(!0),e>f&&i.scrollTop(i.scrollTop()+(e-f)),g=d.offset().top-i.offset().top,0>g&&"none"!=d.css("display")&&i.scrollTop(i.scrollTop()+g)}},"findHighlightableChoices":function(){return this.results.find(".select2-result-selectable:not(.select2-disabled, .select2-selected)")},"moveHighlight":function(b){for(var c=this.findHighlightableChoices(),d=this.highlight();d>-1&&d<c.length;){d+=b;var e=a(c[d]);if(e.hasClass("select2-result-selectable")&&!e.hasClass("select2-disabled")&&!e.hasClass("select2-selected")){this.highlight(d);break}}},"highlight":function(b){var c,e,f=this.findHighlightableChoices();return 0===arguments.length?d(f.filter(".select2-highlighted")[0],f.get()):(b>=f.length&&(b=f.length-1),0>b&&(b=0),this.removeHighlight(),c=a(f[b]),c.addClass("select2-highlighted"),this.ensureHighlightVisible(),e=c.data("select2-data"),void(e&&this.opts.element.trigger({"type":"select2-highlight","val":this.id(e),"choice":e})))},"removeHighlight":function(){this.results.find(".select2-highlighted").removeClass("select2-highlighted")},"countSelectableResults":function(){return this.findHighlightableChoices().length},"highlightUnderEvent":function(b){var c=a(b.target).closest(".select2-result-selectable");if(c.length>0&&!c.is(".select2-highlighted")){var d=this.findHighlightableChoices();this.highlight(d.index(c))}else 0==c.length&&this.removeHighlight()},"loadMoreIfNeeded":function(){var a,b=this.results,c=b.find("li.select2-more-results"),d=this.resultsPage+1,e=this,f=this.search.val(),g=this.context;0!==c.length&&(a=c.offset().top-b.offset().top-b.height(),a<=this.opts.loadMorePadding&&(c.addClass("select2-active"),this.opts.query({"element":this.opts.element,"term":f,"page":d,"context":g,"matcher":this.opts.matcher,"callback":this.bind(function(a){e.opened()&&(e.opts.populateResults.call(this,b,a.results,{"term":f,"page":d,"context":g}),e.postprocessResults(a,!1,!1),a.more===!0?(c.detach().appendTo(b).text(e.opts.formatLoadMore(d+1)),window.setTimeout(function(){e.loadMoreIfNeeded()},10)):c.remove(),e.positionDropdown(),e.resultsPage=d,e.context=a.context,this.opts.element.trigger({"type":"select2-loaded","items":a}))})})))},"tokenize":function(){},"updateResults":function(c){function d(){j.removeClass("select2-active"),m.positionDropdown()}function e(a){k.html(a),d()}var g,h,i,j=this.search,k=this.results,l=this.opts,m=this,n=j.val(),o=a.data(this.container,"select2-last-term");if((c===!0||!o||!f(n,o))&&(a.data(this.container,"select2-last-term",n),c===!0||this.showSearchInput!==!1&&this.opened())){i=++this.queryCount;var p=this.getMaximumSelectionSize();if(p>=1&&(g=this.data(),a.isArray(g)&&g.length>=p&&y(l.formatSelectionTooBig,"formatSelectionTooBig")))return void e("<li class='select2-selection-limit'>"+l.formatSelectionTooBig(p)+"</li>");if(j.val().length<l.minimumInputLength)return e(y(l.formatInputTooShort,"formatInputTooShort")?"<li class='select2-no-results'>"+l.formatInputTooShort(j.val(),l.minimumInputLength)+"</li>":""),void(c&&this.showSearch&&this.showSearch(!0));if(l.maximumInputLength&&j.val().length>l.maximumInputLength)return void e(y(l.formatInputTooLong,"formatInputTooLong")?"<li class='select2-no-results'>"+l.formatInputTooLong(j.val(),l.maximumInputLength)+"</li>":"");l.formatSearching&&0===this.findHighlightableChoices().length&&e("<li class='select2-searching'>"+l.formatSearching()+"</li>"),j.addClass("select2-active"),this.removeHighlight(),h=this.tokenize(),h!=b&&null!=h&&j.val(h),this.resultsPage=1,l.query({"element":l.element,"term":j.val(),"page":this.resultsPage,"context":null,"matcher":l.matcher,"callback":this.bind(function(g){var h;if(i==this.queryCount){if(!this.opened())return void this.search.removeClass("select2-active");if(this.context=g.context===b?null:g.context,this.opts.createSearchChoice&&""!==j.val()&&(h=this.opts.createSearchChoice.call(m,j.val(),g.results),h!==b&&null!==h&&m.id(h)!==b&&null!==m.id(h)&&0===a(g.results).filter(function(){return f(m.id(this),m.id(h))}).length&&g.results.unshift(h)),0===g.results.length&&y(l.formatNoMatches,"formatNoMatches"))return void e("<li class='select2-no-results'>"+l.formatNoMatches(j.val())+"</li>");k.empty(),m.opts.populateResults.call(this,k,g.results,{"term":j.val(),"page":this.resultsPage,"context":null}),g.more===!0&&y(l.formatLoadMore,"formatLoadMore")&&(k.append("<li class='select2-more-results'>"+m.opts.escapeMarkup(l.formatLoadMore(this.resultsPage))+"</li>"),window.setTimeout(function(){m.loadMoreIfNeeded()},10)),this.postprocessResults(g,c),d(),this.opts.element.trigger({"type":"select2-loaded","items":g})}})})}},"cancel":function(){this.close()},"blur":function(){this.opts.selectOnBlur&&this.selectHighlighted({"noFocus":!0}),this.close(),this.container.removeClass("select2-container-active"),this.search[0]===document.activeElement&&this.search.blur(),this.clearSearch(),this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus")},"focusSearch":function(){n(this.search)},"selectHighlighted":function(a){var b=this.highlight(),c=this.results.find(".select2-highlighted"),d=c.closest(".select2-result").data("select2-data");d?(this.highlight(b),this.onSelect(d,a)):a&&a.noFocus&&this.close()},"getPlaceholder":function(){var a;return this.opts.element.attr("placeholder")||this.opts.element.attr("data-placeholder")||this.opts.element.data("placeholder")||this.opts.placeholder||((a=this.getPlaceholderOption())!==b?a.text():b)},"getPlaceholderOption":function(){if(this.select){var a=this.select.children("option").first();if(this.opts.placeholderOption!==b)return"first"===this.opts.placeholderOption&&a||"function"==typeof this.opts.placeholderOption&&this.opts.placeholderOption(this.select);if(""===a.text()&&""===a.val())return a}},"initContainerWidth":function(){function c(){var c,d,e,f,g,h;if("off"===this.opts.width)return null;if("element"===this.opts.width)return 0===this.opts.element.outerWidth(!1)?"auto":this.opts.element.outerWidth(!1)+"px";if("copy"===this.opts.width||"resolve"===this.opts.width){if(c=this.opts.element.attr("style"),c!==b)for(d=c.split(";"),f=0,g=d.length;g>f;f+=1)if(h=d[f].replace(/\s/g,""),e=h.match(/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i),null!==e&&e.length>=1)return e[1];return"resolve"===this.opts.width?(c=this.opts.element.css("width"),c.indexOf("%")>0?c:0===this.opts.element.outerWidth(!1)?"auto":this.opts.element.outerWidth(!1)+"px"):null}return a.isFunction(this.opts.width)?this.opts.width():this.opts.width}var d=c.call(this);null!==d&&this.container.css("width",d)}}),F=C(E,{"createContainer":function(){var b=a(document.createElement("div")).attr({"class":"select2-container"}).html(["<a href='javascript:void(0)' onclick='return false;' class='select2-choice' tabindex='-1'>"," <span class='select2-chosen'> </span><abbr class='select2-search-choice-close'></abbr>"," <span class='select2-arrow'><b></b></span>","</a>","<input class='select2-focusser select2-offscreen' type='text'/>","<div class='select2-drop select2-display-none'>"," <div class='select2-search'>"," <input type='text' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' class='select2-input'/>"," </div>"," <ul class='select2-results'>"," </ul>","</div>"].join(""));return b},"enableInterface":function(){this.parent.enableInterface.apply(this,arguments)&&this.focusser.prop("disabled",!this.isInterfaceEnabled())},"opening":function(){var c,d,e;this.opts.minimumResultsForSearch>=0&&this.showSearch(!0),this.parent.opening.apply(this,arguments),this.showSearchInput!==!1&&this.search.val(this.focusser.val()),this.search.focus(),c=this.search.get(0),c.createTextRange?(d=c.createTextRange(),d.collapse(!1),d.select()):c.setSelectionRange&&(e=this.search.val().length,c.setSelectionRange(e,e)),""===this.search.val()&&this.nextSearchTerm!=b&&(this.search.val(this.nextSearchTerm),this.search.select()),this.focusser.prop("disabled",!0).val(""),this.updateResults(!0),this.opts.element.trigger(a.Event("select2-open"))},"close":function(a){this.opened()&&(this.parent.close.apply(this,arguments),a=a||{"focus":!0},this.focusser.removeAttr("disabled"),a.focus&&this.focusser.focus())},"focus":function(){this.opened()?this.close():(this.focusser.removeAttr("disabled"),this.focusser.focus())},"isFocused":function(){return this.container.hasClass("select2-container-active")},"cancel":function(){this.parent.cancel.apply(this,arguments),this.focusser.removeAttr("disabled"),this.focusser.focus()},"destroy":function(){a("label[for='"+this.focusser.attr("id")+"']").attr("for",this.opts.element.attr("id")),this.parent.destroy.apply(this,arguments)},"initContainer":function(){var b,c=this.container,d=this.dropdown;this.showSearch(this.opts.minimumResultsForSearch<0?!1:!0),this.selection=b=c.find(".select2-choice"),this.focusser=c.find(".select2-focusser"),this.focusser.attr("id","s2id_autogen"+H()),a("label[for='"+this.opts.element.attr("id")+"']").attr("for",this.focusser.attr("id")),this.focusser.attr("tabindex",this.elementTabIndex),this.search.on("keydown",this.bind(function(a){if(this.isInterfaceEnabled()){if(a.which===D.PAGE_UP||a.which===D.PAGE_DOWN)return void p(a);switch(a.which){case D.UP:case D.DOWN:return this.moveHighlight(a.which===D.UP?-1:1),void p(a);case D.ENTER:return this.selectHighlighted(),void p(a);case D.TAB:return void this.selectHighlighted({"noFocus":!0});case D.ESC:return this.cancel(a),void p(a)}}})),this.search.on("blur",this.bind(function(){document.activeElement===this.body().get(0)&&window.setTimeout(this.bind(function(){this.search.focus()}),0)})),this.focusser.on("keydown",this.bind(function(a){if(this.isInterfaceEnabled()&&a.which!==D.TAB&&!D.isControl(a)&&!D.isFunctionKey(a)&&a.which!==D.ESC){if(this.opts.openOnEnter===!1&&a.which===D.ENTER)return void p(a);if(a.which==D.DOWN||a.which==D.UP||a.which==D.ENTER&&this.opts.openOnEnter){if(a.altKey||a.ctrlKey||a.shiftKey||a.metaKey)return;return this.open(),void p(a)}return a.which==D.DELETE||a.which==D.BACKSPACE?(this.opts.allowClear&&this.clear(),void p(a)):void 0}})),i(this.focusser),this.focusser.on("keyup-change input",this.bind(function(a){if(this.opts.minimumResultsForSearch>=0){if(a.stopPropagation(),this.opened())return;this.open()}})),b.on("mousedown","abbr",this.bind(function(a){this.isInterfaceEnabled()&&(this.clear(),q(a),this.close(),this.selection.focus())})),b.on("mousedown",this.bind(function(b){this.container.hasClass("select2-container-active")||this.opts.element.trigger(a.Event("select2-focus")),this.opened()?this.close():this.isInterfaceEnabled()&&this.open(),p(b)})),d.on("mousedown",this.bind(function(){this.search.focus()})),b.on("focus",this.bind(function(a){p(a)})),this.focusser.on("focus",this.bind(function(){this.container.hasClass("select2-container-active")||this.opts.element.trigger(a.Event("select2-focus")),this.container.addClass("select2-container-active")})).on("blur",this.bind(function(){this.opened()||(this.container.removeClass("select2-container-active"),this.opts.element.trigger(a.Event("select2-blur")))})),this.search.on("focus",this.bind(function(){this.container.hasClass("select2-container-active")||this.opts.element.trigger(a.Event("select2-focus")),this.container.addClass("select2-container-active")})),this.initContainerWidth(),this.opts.element.addClass("select2-offscreen"),this.setPlaceholder()},"clear":function(b){var c=this.selection.data("select2-data");if(c){var d=a.Event("select2-clearing");if(this.opts.element.trigger(d),d.isDefaultPrevented())return;var e=this.getPlaceholderOption();this.opts.element.val(e?e.val():""),this.selection.find(".select2-chosen").empty(),this.selection.removeData("select2-data"),this.setPlaceholder(),b!==!1&&(this.opts.element.trigger({"type":"select2-removed","val":this.id(c),"choice":c}),this.triggerChange({"removed":c}))}},"initSelection":function(){if(this.isPlaceholderOptionSelected())this.updateSelection(null),this.close(),this.setPlaceholder();else{var a=this;this.opts.initSelection.call(null,this.opts.element,function(c){c!==b&&null!==c&&(a.updateSelection(c),a.close(),a.setPlaceholder())})}},"isPlaceholderOptionSelected":function(){var a;return this.getPlaceholder()?(a=this.getPlaceholderOption())!==b&&a.prop("selected")||""===this.opts.element.val()||this.opts.element.val()===b||null===this.opts.element.val():!1},"prepareOpts":function(){var b=this.parent.prepareOpts.apply(this,arguments),c=this;return"select"===b.element.get(0).tagName.toLowerCase()?b.initSelection=function(a,b){var d=a.find("option").filter(function(){return this.selected});b(c.optionToData(d))}:"data"in b&&(b.initSelection=b.initSelection||function(c,d){var e=c.val(),g=null;b.query({"matcher":function(a,c,d){var h=f(e,b.id(d));return h&&(g=d),h},"callback":a.isFunction(d)?function(){d(g)}:a.noop})}),b},"getPlaceholder":function(){return this.select&&this.getPlaceholderOption()===b?b:this.parent.getPlaceholder.apply(this,arguments)},"setPlaceholder":function(){var a=this.getPlaceholder();if(this.isPlaceholderOptionSelected()&&a!==b){if(this.select&&this.getPlaceholderOption()===b)return;this.selection.find(".select2-chosen").html(this.opts.escapeMarkup(a)),this.selection.addClass("select2-default"),this.container.removeClass("select2-allowclear")}},"postprocessResults":function(a,b,c){var d=0,e=this;if(this.findHighlightableChoices().each2(function(a,b){return f(e.id(b.data("select2-data")),e.opts.element.val())?(d=a,!1):void 0}),c!==!1&&this.highlight(b===!0&&d>=0?d:0),b===!0){var g=this.opts.minimumResultsForSearch;g>=0&&this.showSearch(A(a.results)>=g)}},"showSearch":function(b){this.showSearchInput!==b&&(this.showSearchInput=b,this.dropdown.find(".select2-search").toggleClass("select2-search-hidden",!b),this.dropdown.find(".select2-search").toggleClass("select2-offscreen",!b),a(this.dropdown,this.container).toggleClass("select2-with-searchbox",b))},"onSelect":function(a,b){if(this.triggerSelect(a)){var c=this.opts.element.val(),d=this.data();this.opts.element.val(this.id(a)),this.updateSelection(a),this.opts.element.trigger({"type":"select2-selected","val":this.id(a),"choice":a}),this.nextSearchTerm=this.opts.nextSearchTerm(a,this.search.val()),this.close(),b&&b.noFocus||this.focusser.focus(),f(c,this.id(a))||this.triggerChange({"added":a,"removed":d})}},"updateSelection":function(a){var c,d,e=this.selection.find(".select2-chosen");this.selection.data("select2-data",a),e.empty(),null!==a&&(c=this.opts.formatSelection(a,e,this.opts.escapeMarkup)),c!==b&&e.append(c),d=this.opts.formatSelectionCssClass(a,e),d!==b&&e.addClass(d),this.selection.removeClass("select2-default"),this.opts.allowClear&&this.getPlaceholder()!==b&&this.container.addClass("select2-allowclear")},"val":function(){var a,c=!1,d=null,e=this,f=this.data();if(0===arguments.length)return this.opts.element.val();if(a=arguments[0],arguments.length>1&&(c=arguments[1]),this.select)this.select.val(a).find("option").filter(function(){return this.selected}).each2(function(a,b){return d=e.optionToData(b),!1}),this.updateSelection(d),this.setPlaceholder(),c&&this.triggerChange({"added":d,"removed":f});else{if(!a&&0!==a)return void this.clear(c);if(this.opts.initSelection===b)throw new Error("cannot call val() if initSelection() is not defined");this.opts.element.val(a),this.opts.initSelection(this.opts.element,function(a){e.opts.element.val(a?e.id(a):""),e.updateSelection(a),e.setPlaceholder(),c&&e.triggerChange({"added":a,"removed":f})})}},"clearSearch":function(){this.search.val(""),this.focusser.val("")},"data":function(a){var c,d=!1;return 0===arguments.length?(c=this.selection.data("select2-data"),c==b&&(c=null),c):(arguments.length>1&&(d=arguments[1]),void(a?(c=this.data(),this.opts.element.val(a?this.id(a):""),this.updateSelection(a),d&&this.triggerChange({"added":a,"removed":c})):this.clear(d)))}}),G=C(E,{"createContainer":function(){var b=a(document.createElement("div")).attr({"class":"select2-container select2-container-multi"}).html(["<ul class='select2-choices'>"," <li class='select2-search-field'>"," <input type='text' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' class='select2-input'>"," </li>","</ul>","<div class='select2-drop select2-drop-multi select2-display-none'>"," <ul class='select2-results'>"," </ul>","</div>"].join(""));return b},"prepareOpts":function(){var b=this.parent.prepareOpts.apply(this,arguments),c=this;return"select"===b.element.get(0).tagName.toLowerCase()?b.initSelection=function(a,b){var d=[];a.find("option").filter(function(){return this.selected}).each2(function(a,b){d.push(c.optionToData(b))}),b(d)}:"data"in b&&(b.initSelection=b.initSelection||function(c,d){var e=g(c.val(),b.separator),h=[];b.query({"matcher":function(c,d,g){var i=a.grep(e,function(a){return f(a,b.id(g))}).length;return i&&h.push(g),i},"callback":a.isFunction(d)?function(){for(var a=[],c=0;c<e.length;c++)for(var g=e[c],i=0;i<h.length;i++){var j=h[i];if(f(g,b.id(j))){a.push(j),h.splice(i,1);break}}d(a)}:a.noop})}),b},"selectChoice":function(a){var b=this.container.find(".select2-search-choice-focus");b.length&&a&&a[0]==b[0]||(b.length&&this.opts.element.trigger("choice-deselected",b),b.removeClass("select2-search-choice-focus"),a&&a.length&&(this.close(),a.addClass("select2-search-choice-focus"),this.opts.element.trigger("choice-selected",a)))},"destroy":function(){a("label[for='"+this.search.attr("id")+"']").attr("for",this.opts.element.attr("id")),this.parent.destroy.apply(this,arguments)},"initContainer":function(){var b,c=".select2-choices";this.searchContainer=this.container.find(".select2-search-field"),this.selection=b=this.container.find(c);var d=this;this.selection.on("click",".select2-search-choice:not(.select2-locked)",function(){d.search[0].focus(),d.selectChoice(a(this))}),this.search.attr("id","s2id_autogen"+H()),a("label[for='"+this.opts.element.attr("id")+"']").attr("for",this.search.attr("id")),this.search.on("input paste",this.bind(function(){this.isInterfaceEnabled()&&(this.opened()||this.open())})),this.search.attr("tabindex",this.elementTabIndex),this.keydowns=0,this.search.on("keydown",this.bind(function(a){if(this.isInterfaceEnabled()){++this.keydowns;var c=b.find(".select2-search-choice-focus"),d=c.prev(".select2-search-choice:not(.select2-locked)"),e=c.next(".select2-search-choice:not(.select2-locked)"),f=o(this.search);if(c.length&&(a.which==D.LEFT||a.which==D.RIGHT||a.which==D.BACKSPACE||a.which==D.DELETE||a.which==D.ENTER)){var g=c;return a.which==D.LEFT&&d.length?g=d:a.which==D.RIGHT?g=e.length?e:null:a.which===D.BACKSPACE?(this.unselect(c.first()),this.search.width(10),g=d.length?d:e):a.which==D.DELETE?(this.unselect(c.first()),this.search.width(10),g=e.length?e:null):a.which==D.ENTER&&(g=null),this.selectChoice(g),p(a),void(g&&g.length||this.open())}if((a.which===D.BACKSPACE&&1==this.keydowns||a.which==D.LEFT)&&0==f.offset&&!f.length)return this.selectChoice(b.find(".select2-search-choice:not(.select2-locked)").last()),void p(a);if(this.selectChoice(null),this.opened())switch(a.which){case D.UP:case D.DOWN:return this.moveHighlight(a.which===D.UP?-1:1),void p(a);case D.ENTER:return this.selectHighlighted(),void p(a);case D.TAB:return this.selectHighlighted({"noFocus":!0}),void this.close();case D.ESC:return this.cancel(a),void p(a)}if(a.which!==D.TAB&&!D.isControl(a)&&!D.isFunctionKey(a)&&a.which!==D.BACKSPACE&&a.which!==D.ESC){if(a.which===D.ENTER){if(this.opts.openOnEnter===!1)return;if(a.altKey||a.ctrlKey||a.shiftKey||a.metaKey)return}this.open(),(a.which===D.PAGE_UP||a.which===D.PAGE_DOWN)&&p(a),a.which===D.ENTER&&p(a)}}})),this.search.on("keyup",this.bind(function(){this.keydowns=0,this.resizeSearch()
|
|
})),this.search.on("blur",this.bind(function(b){this.container.removeClass("select2-container-active"),this.search.removeClass("select2-focused"),this.selectChoice(null),this.opened()||this.clearSearch(),b.stopImmediatePropagation(),this.opts.element.trigger(a.Event("select2-blur"))})),this.container.on("click",c,this.bind(function(b){this.isInterfaceEnabled()&&(a(b.target).closest(".select2-search-choice").length>0||(this.selectChoice(null),this.clearPlaceholder(),this.container.hasClass("select2-container-active")||this.opts.element.trigger(a.Event("select2-focus")),this.open(),this.focusSearch(),b.preventDefault()))})),this.container.on("focus",c,this.bind(function(){this.isInterfaceEnabled()&&(this.container.hasClass("select2-container-active")||this.opts.element.trigger(a.Event("select2-focus")),this.container.addClass("select2-container-active"),this.dropdown.addClass("select2-drop-active"),this.clearPlaceholder())})),this.initContainerWidth(),this.opts.element.addClass("select2-offscreen"),this.clearSearch()},"enableInterface":function(){this.parent.enableInterface.apply(this,arguments)&&this.search.prop("disabled",!this.isInterfaceEnabled())},"initSelection":function(){if(""===this.opts.element.val()&&""===this.opts.element.text()&&(this.updateSelection([]),this.close(),this.clearSearch()),this.select||""!==this.opts.element.val()){var a=this;this.opts.initSelection.call(null,this.opts.element,function(c){c!==b&&null!==c&&(a.updateSelection(c),a.close(),a.clearSearch())})}},"clearSearch":function(){var a=this.getPlaceholder(),c=this.getMaxSearchWidth();a!==b&&0===this.getVal().length&&this.search.hasClass("select2-focused")===!1?(this.search.val(a).addClass("select2-default"),this.search.width(c>0?c:this.container.css("width"))):this.search.val("").width(10)},"clearPlaceholder":function(){this.search.hasClass("select2-default")&&this.search.val("").removeClass("select2-default")},"opening":function(){this.clearPlaceholder(),this.resizeSearch(),this.parent.opening.apply(this,arguments),this.focusSearch(),this.updateResults(!0),this.search.focus(),this.opts.element.trigger(a.Event("select2-open"))},"close":function(){this.opened()&&this.parent.close.apply(this,arguments)},"focus":function(){this.close(),this.search.focus()},"isFocused":function(){return this.search.hasClass("select2-focused")},"updateSelection":function(b){var c=[],e=[],f=this;a(b).each(function(){d(f.id(this),c)<0&&(c.push(f.id(this)),e.push(this))}),b=e,this.selection.find(".select2-search-choice").remove(),a(b).each(function(){f.addSelectedChoice(this)}),f.postprocessResults()},"tokenize":function(){var a=this.search.val();a=this.opts.tokenizer.call(this,a,this.data(),this.bind(this.onSelect),this.opts),null!=a&&a!=b&&(this.search.val(a),a.length>0&&this.open())},"onSelect":function(a,b){this.triggerSelect(a)&&(this.addSelectedChoice(a),this.opts.element.trigger({"type":"selected","val":this.id(a),"choice":a}),(this.select||!this.opts.closeOnSelect)&&this.postprocessResults(a,!1,this.opts.closeOnSelect===!0),this.opts.closeOnSelect?(this.close(),this.search.width(10)):this.countSelectableResults()>0?(this.search.width(10),this.resizeSearch(),this.getMaximumSelectionSize()>0&&this.val().length>=this.getMaximumSelectionSize()&&this.updateResults(!0),this.positionDropdown()):(this.close(),this.search.width(10)),this.triggerChange({"added":a}),b&&b.noFocus||this.focusSearch())},"cancel":function(){this.close(),this.focusSearch()},"addSelectedChoice":function(c){var d,e,f=!c.locked,g=a("<li class='select2-search-choice'> <div></div> <a href='#' onclick='return false;' class='select2-search-choice-close' tabindex='-1'></a></li>"),h=a("<li class='select2-search-choice select2-locked'><div></div></li>"),i=f?g:h,j=this.id(c),k=this.getVal();d=this.opts.formatSelection(c,i.find("div"),this.opts.escapeMarkup),d!=b&&i.find("div").replaceWith("<div>"+d+"</div>"),e=this.opts.formatSelectionCssClass(c,i.find("div")),e!=b&&i.addClass(e),f&&i.find(".select2-search-choice-close").on("mousedown",p).on("click dblclick",this.bind(function(b){this.isInterfaceEnabled()&&(a(b.target).closest(".select2-search-choice").fadeOut("fast",this.bind(function(){this.unselect(a(b.target)),this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus"),this.close(),this.focusSearch()})).dequeue(),p(b))})).on("focus",this.bind(function(){this.isInterfaceEnabled()&&(this.container.addClass("select2-container-active"),this.dropdown.addClass("select2-drop-active"))})),i.data("select2-data",c),i.insertBefore(this.searchContainer),k.push(j),this.setVal(k)},"unselect":function(b){var c,e,f=this.getVal();if(b=b.closest(".select2-search-choice"),0===b.length)throw"Invalid argument: "+b+". Must be .select2-search-choice";if(c=b.data("select2-data")){for(;(e=d(this.id(c),f))>=0;)f.splice(e,1),this.setVal(f),this.select&&this.postprocessResults();var g=a.Event("select2-removing");g.val=this.id(c),g.choice=c,this.opts.element.trigger(g),g.isDefaultPrevented()||(b.remove(),this.opts.element.trigger({"type":"select2-removed","val":this.id(c),"choice":c}),this.triggerChange({"removed":c}))}},"postprocessResults":function(a,b,c){var e=this.getVal(),f=this.results.find(".select2-result"),g=this.results.find(".select2-result-with-children"),h=this;f.each2(function(a,b){var c=h.id(b.data("select2-data"));d(c,e)>=0&&(b.addClass("select2-selected"),b.find(".select2-result-selectable").addClass("select2-selected"))}),g.each2(function(a,b){b.is(".select2-result-selectable")||0!==b.find(".select2-result-selectable:not(.select2-selected)").length||b.addClass("select2-selected")}),-1==this.highlight()&&c!==!1&&h.highlight(0),!this.opts.createSearchChoice&&!f.filter(".select2-result:not(.select2-selected)").length>0&&(!a||a&&!a.more&&0===this.results.find(".select2-no-results").length)&&y(h.opts.formatNoMatches,"formatNoMatches")&&this.results.append("<li class='select2-no-results'>"+h.opts.formatNoMatches(h.search.val())+"</li>")},"getMaxSearchWidth":function(){return this.selection.width()-h(this.search)},"resizeSearch":function(){var a,b,c,d,e,f=h(this.search);a=r(this.search)+10,b=this.search.offset().left,c=this.selection.width(),d=this.selection.offset().left,e=c-(b-d)-f,a>e&&(e=c-f),40>e&&(e=c-f),0>=e&&(e=a),this.search.width(Math.floor(e))},"getVal":function(){var a;return this.select?(a=this.select.val(),null===a?[]:a):(a=this.opts.element.val(),g(a,this.opts.separator))},"setVal":function(b){var c;this.select?this.select.val(b):(c=[],a(b).each(function(){d(this,c)<0&&c.push(this)}),this.opts.element.val(0===c.length?"":c.join(this.opts.separator)))},"buildChangeDetails":function(a,b){for(var b=b.slice(0),a=a.slice(0),c=0;c<b.length;c++)for(var d=0;d<a.length;d++)f(this.opts.id(b[c]),this.opts.id(a[d]))&&(b.splice(c,1),c>0&&c--,a.splice(d,1),d--);return{"added":b,"removed":a}},"val":function(c,d){var e,f=this;if(0===arguments.length)return this.getVal();if(e=this.data(),e.length||(e=[]),!c&&0!==c)return this.opts.element.val(""),this.updateSelection([]),this.clearSearch(),void(d&&this.triggerChange({"added":this.data(),"removed":e}));if(this.setVal(c),this.select)this.opts.initSelection(this.select,this.bind(this.updateSelection)),d&&this.triggerChange(this.buildChangeDetails(e,this.data()));else{if(this.opts.initSelection===b)throw new Error("val() cannot be called if initSelection() is not defined");this.opts.initSelection(this.opts.element,function(b){var c=a.map(b,f.id);f.setVal(c),f.updateSelection(b),f.clearSearch(),d&&f.triggerChange(f.buildChangeDetails(e,f.data()))})}this.clearSearch()},"onSortStart":function(){if(this.select)throw new Error("Sorting of elements is not supported when attached to <select>. Attach to <input type='hidden'/> instead.");this.search.width(0),this.searchContainer.hide()},"onSortEnd":function(){var b=[],c=this;this.searchContainer.show(),this.searchContainer.appendTo(this.searchContainer.parent()),this.resizeSearch(),this.selection.find(".select2-search-choice").each(function(){b.push(c.opts.id(a(this).data("select2-data")))}),this.setVal(b),this.triggerChange()},"data":function(b,c){var d,e,f=this;return 0===arguments.length?this.selection.find(".select2-search-choice").map(function(){return a(this).data("select2-data")}).get():(e=this.data(),b||(b=[]),d=a.map(b,function(a){return f.opts.id(a)}),this.setVal(d),this.updateSelection(b),this.clearSearch(),c&&this.triggerChange(this.buildChangeDetails(e,this.data())),void 0)}}),a.fn.select2=function(){var c,e,f,g,h,i=Array.prototype.slice.call(arguments,0),j=["val","destroy","opened","open","close","focus","isFocused","container","dropdown","onSortStart","onSortEnd","enable","disable","readonly","positionDropdown","data","search"],k=["opened","isFocused","container","dropdown"],l=["val","data"],m={"search":"externalSearch"};return this.each(function(){if(0===i.length||"object"==typeof i[0])c=0===i.length?{}:a.extend({},i[0]),c.element=a(this),"select"===c.element.get(0).tagName.toLowerCase()?h=c.element.prop("multiple"):(h=c.multiple||!1,"tags"in c&&(c.multiple=h=!0)),e=h?new G:new F,e.init(c);else{if("string"!=typeof i[0])throw"Invalid arguments to select2 plugin: "+i;if(d(i[0],j)<0)throw"Unknown method: "+i[0];if(g=b,e=a(this).data("select2"),e===b)return;if(f=i[0],"container"===f?g=e.container:"dropdown"===f?g=e.dropdown:(m[f]&&(f=m[f]),g=e[f].apply(e,i.slice(1))),d(i[0],k)>=0||d(i[0],l)&&1==i.length)return!1}}),g===b?this:g},a.fn.select2.defaults={"width":"copy","loadMorePadding":0,"closeOnSelect":!0,"openOnEnter":!0,"containerCss":{},"dropdownCss":{},"containerCssClass":"","dropdownCssClass":"","formatResult":function(a,b,c,d){var e=[];return t(a.text,c.term,e,d),e.join("")},"formatSelection":function(a,c,d){return a?d(a.text):b},"sortResults":function(a){return a},"formatResultCssClass":function(){return b},"formatSelectionCssClass":function(){return b},"formatNoMatches":function(){return"No matches found"},"formatInputTooShort":function(a,b){var c=b-a.length;return"Please enter "+c+" more character"+(1==c?"":"s")},"formatInputTooLong":function(a,b){var c=a.length-b;return"Please delete "+c+" character"+(1==c?"":"s")},"formatSelectionTooBig":function(a){return"You can only select "+a+" item"+(1==a?"":"s")},"formatLoadMore":function(){return"Loading more results..."},"formatSearching":function(){return"Searching..."},"minimumResultsForSearch":0,"minimumInputLength":0,"maximumInputLength":null,"maximumSelectionSize":0,"id":function(a){return a.id},"matcher":function(a,b){return c(""+b).toUpperCase().indexOf(c(""+a).toUpperCase())>=0},"separator":",","tokenSeparators":[],"tokenizer":B,"escapeMarkup":u,"blurOnChange":!1,"selectOnBlur":!1,"adaptContainerCssClass":function(a){return a},"adaptDropdownCssClass":function(){return null},"nextSearchTerm":function(){return b}},a.fn.select2.ajaxDefaults={"transport":a.ajax,"params":{"type":"GET","cache":!1,"dataType":"json"}},window.Select2={"query":{"ajax":v,"local":w,"tags":x},"util":{"debounce":k,"markMatch":t,"escapeMarkup":u,"stripDiacritics":c},"class":{"abstract":E,"single":F,"multi":G}}}}(jQuery),function(a,b){function c(b,c){var e,f,g,h=b.nodeName.toLowerCase();return"area"===h?(e=b.parentNode,f=e.name,b.href&&f&&"map"===e.nodeName.toLowerCase()?(g=a("img[usemap=#"+f+"]")[0],!!g&&d(g)):!1):(/input|select|textarea|button|object/.test(h)?!b.disabled:"a"===h?b.href||c:c)&&d(b)}function d(b){return a.expr.filters.visible(b)&&!a(b).parents().addBack().filter(function(){return"hidden"===a.css(this,"visibility")}).length}var e=0,f=/^ui-id-\d+$/;a.ui=a.ui||{},a.extend(a.ui,{"version":"1.10.4","keyCode":{"BACKSPACE":8,"COMMA":188,"DELETE":46,"DOWN":40,"END":35,"ENTER":13,"ESCAPE":27,"HOME":36,"LEFT":37,"NUMPAD_ADD":107,"NUMPAD_DECIMAL":110,"NUMPAD_DIVIDE":111,"NUMPAD_ENTER":108,"NUMPAD_MULTIPLY":106,"NUMPAD_SUBTRACT":109,"PAGE_DOWN":34,"PAGE_UP":33,"PERIOD":190,"RIGHT":39,"SPACE":32,"TAB":9,"UP":38}}),a.fn.extend({"focus":function(b){return function(c,d){return"number"==typeof c?this.each(function(){var b=this;setTimeout(function(){a(b).focus(),d&&d.call(b)},c)}):b.apply(this,arguments)}}(a.fn.focus),"scrollParent":function(){var b;return b=a.ui.ie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(a.css(this,"position"))&&/(auto|scroll)/.test(a.css(this,"overflow")+a.css(this,"overflow-y")+a.css(this,"overflow-x"))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(a.css(this,"overflow")+a.css(this,"overflow-y")+a.css(this,"overflow-x"))}).eq(0),/fixed/.test(this.css("position"))||!b.length?a(document):b},"zIndex":function(c){if(c!==b)return this.css("zIndex",c);if(this.length)for(var d,e,f=a(this[0]);f.length&&f[0]!==document;){if(d=f.css("position"),("absolute"===d||"relative"===d||"fixed"===d)&&(e=parseInt(f.css("zIndex"),10),!isNaN(e)&&0!==e))return e;f=f.parent()}return 0},"uniqueId":function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++e)})},"removeUniqueId":function(){return this.each(function(){f.test(this.id)&&a(this).removeAttr("id")})}}),a.extend(a.expr[":"],{"data":a.expr.createPseudo?a.expr.createPseudo(function(b){return function(c){return!!a.data(c,b)}}):function(b,c,d){return!!a.data(b,d[3])},"focusable":function(b){return c(b,!isNaN(a.attr(b,"tabindex")))},"tabbable":function(b){var d=a.attr(b,"tabindex"),e=isNaN(d);return(e||d>=0)&&c(b,!e)}}),a("<a>").outerWidth(1).jquery||a.each(["Width","Height"],function(c,d){function e(b,c,d,e){return a.each(f,function(){c-=parseFloat(a.css(b,"padding"+this))||0,d&&(c-=parseFloat(a.css(b,"border"+this+"Width"))||0),e&&(c-=parseFloat(a.css(b,"margin"+this))||0)}),c}var f="Width"===d?["Left","Right"]:["Top","Bottom"],g=d.toLowerCase(),h={"innerWidth":a.fn.innerWidth,"innerHeight":a.fn.innerHeight,"outerWidth":a.fn.outerWidth,"outerHeight":a.fn.outerHeight};a.fn["inner"+d]=function(c){return c===b?h["inner"+d].call(this):this.each(function(){a(this).css(g,e(this,c)+"px")})},a.fn["outer"+d]=function(b,c){return"number"!=typeof b?h["outer"+d].call(this,b):this.each(function(){a(this).css(g,e(this,b,!0,c)+"px")})}}),a.fn.addBack||(a.fn.addBack=function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}),a("<a>").data("a-b","a").removeData("a-b").data("a-b")&&(a.fn.removeData=function(b){return function(c){return arguments.length?b.call(this,a.camelCase(c)):b.call(this)}}(a.fn.removeData)),a.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),a.support.selectstart="onselectstart"in document.createElement("div"),a.fn.extend({"disableSelection":function(){return this.bind((a.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(a){a.preventDefault()})},"enableSelection":function(){return this.unbind(".ui-disableSelection")}}),a.extend(a.ui,{"plugin":{"add":function(b,c,d){var e,f=a.ui[b].prototype;for(e in d)f.plugins[e]=f.plugins[e]||[],f.plugins[e].push([c,d[e]])},"call":function(a,b,c){var d,e=a.plugins[b];if(e&&a.element[0].parentNode&&11!==a.element[0].parentNode.nodeType)for(d=0;d<e.length;d++)a.options[e[d][0]]&&e[d][1].apply(a.element,c)}},"hasScroll":function(b,c){if("hidden"===a(b).css("overflow"))return!1;var d=c&&"left"===c?"scrollLeft":"scrollTop",e=!1;return b[d]>0?!0:(b[d]=1,e=b[d]>0,b[d]=0,e)}})}(jQuery),function(a,b){var c=0,d=Array.prototype.slice,e=a.cleanData;a.cleanData=function(b){for(var c,d=0;null!=(c=b[d]);d++)try{a(c).triggerHandler("remove")}catch(f){}e(b)},a.widget=function(b,c,d){var e,f,g,h,i={},j=b.split(".")[0];b=b.split(".")[1],e=j+"-"+b,d||(d=c,c=a.Widget),a.expr[":"][e.toLowerCase()]=function(b){return!!a.data(b,e)},a[j]=a[j]||{},f=a[j][b],g=a[j][b]=function(a,b){return this._createWidget?void(arguments.length&&this._createWidget(a,b)):new g(a,b)},a.extend(g,f,{"version":d.version,"_proto":a.extend({},d),"_childConstructors":[]}),h=new c,h.options=a.widget.extend({},h.options),a.each(d,function(b,d){return a.isFunction(d)?void(i[b]=function(){var a=function(){return c.prototype[b].apply(this,arguments)},e=function(a){return c.prototype[b].apply(this,a)};return function(){var b,c=this._super,f=this._superApply;return this._super=a,this._superApply=e,b=d.apply(this,arguments),this._super=c,this._superApply=f,b}}()):void(i[b]=d)}),g.prototype=a.widget.extend(h,{"widgetEventPrefix":f?h.widgetEventPrefix||b:b},i,{"constructor":g,"namespace":j,"widgetName":b,"widgetFullName":e}),f?(a.each(f._childConstructors,function(b,c){var d=c.prototype;a.widget(d.namespace+"."+d.widgetName,g,c._proto)}),delete f._childConstructors):c._childConstructors.push(g),a.widget.bridge(b,g)},a.widget.extend=function(c){for(var e,f,g=d.call(arguments,1),h=0,i=g.length;i>h;h++)for(e in g[h])f=g[h][e],g[h].hasOwnProperty(e)&&f!==b&&(c[e]=a.isPlainObject(f)?a.isPlainObject(c[e])?a.widget.extend({},c[e],f):a.widget.extend({},f):f);return c},a.widget.bridge=function(c,e){var f=e.prototype.widgetFullName||c;a.fn[c]=function(g){var h="string"==typeof g,i=d.call(arguments,1),j=this;return g=!h&&i.length?a.widget.extend.apply(null,[g].concat(i)):g,this.each(h?function(){var d,e=a.data(this,f);return e?a.isFunction(e[g])&&"_"!==g.charAt(0)?(d=e[g].apply(e,i),d!==e&&d!==b?(j=d&&d.jquery?j.pushStack(d.get()):d,!1):void 0):a.error("no such method '"+g+"' for "+c+" widget instance"):a.error("cannot call methods on "+c+" prior to initialization; attempted to call method '"+g+"'")}:function(){var b=a.data(this,f);b?b.option(g||{})._init():a.data(this,f,new e(g,this))}),j}},a.Widget=function(){},a.Widget._childConstructors=[],a.Widget.prototype={"widgetName":"widget","widgetEventPrefix":"","defaultElement":"<div>","options":{"disabled":!1,"create":null},"_createWidget":function(b,d){d=a(d||this.defaultElement||this)[0],this.element=a(d),this.uuid=c++,this.eventNamespace="."+this.widgetName+this.uuid,this.options=a.widget.extend({},this.options,this._getCreateOptions(),b),this.bindings=a(),this.hoverable=a(),this.focusable=a(),d!==this&&(a.data(d,this.widgetFullName,this),this._on(!0,this.element,{"remove":function(a){a.target===d&&this.destroy()}}),this.document=a(d.style?d.ownerDocument:d.document||d),this.window=a(this.document[0].defaultView||this.document[0].parentWindow)),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},"_getCreateOptions":a.noop,"_getCreateEventData":a.noop,"_create":a.noop,"_init":a.noop,"destroy":function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetName).removeData(this.widgetFullName).removeData(a.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},"_destroy":a.noop,"widget":function(){return this.element},"option":function(c,d){var e,f,g,h=c;if(0===arguments.length)return a.widget.extend({},this.options);if("string"==typeof c)if(h={},e=c.split("."),c=e.shift(),e.length){for(f=h[c]=a.widget.extend({},this.options[c]),g=0;g<e.length-1;g++)f[e[g]]=f[e[g]]||{},f=f[e[g]];if(c=e.pop(),1===arguments.length)return f[c]===b?null:f[c];f[c]=d}else{if(1===arguments.length)return this.options[c]===b?null:this.options[c];h[c]=d}return this._setOptions(h),this},"_setOptions":function(a){var b;for(b in a)this._setOption(b,a[b]);return this},"_setOption":function(a,b){return this.options[a]=b,"disabled"===a&&(this.widget().toggleClass(this.widgetFullName+"-disabled ui-state-disabled",!!b).attr("aria-disabled",b),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")),this},"enable":function(){return this._setOption("disabled",!1)},"disable":function(){return this._setOption("disabled",!0)},"_on":function(b,c,d){var e,f=this;"boolean"!=typeof b&&(d=c,c=b,b=!1),d?(c=e=a(c),this.bindings=this.bindings.add(c)):(d=c,c=this.element,e=this.widget()),a.each(d,function(d,g){function h(){return b||f.options.disabled!==!0&&!a(this).hasClass("ui-state-disabled")?("string"==typeof g?f[g]:g).apply(f,arguments):void 0}"string"!=typeof g&&(h.guid=g.guid=g.guid||h.guid||a.guid++);var i=d.match(/^(\w+)\s*(.*)$/),j=i[1]+f.eventNamespace,k=i[2];k?e.delegate(k,j,h):c.bind(j,h)})},"_off":function(a,b){b=(b||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,a.unbind(b).undelegate(b)},"_delay":function(a,b){function c(){return("string"==typeof a?d[a]:a).apply(d,arguments)}var d=this;return setTimeout(c,b||0)},"_hoverable":function(b){this.hoverable=this.hoverable.add(b),this._on(b,{"mouseenter":function(b){a(b.currentTarget).addClass("ui-state-hover")},"mouseleave":function(b){a(b.currentTarget).removeClass("ui-state-hover")}})},"_focusable":function(b){this.focusable=this.focusable.add(b),this._on(b,{"focusin":function(b){a(b.currentTarget).addClass("ui-state-focus")},"focusout":function(b){a(b.currentTarget).removeClass("ui-state-focus")}})},"_trigger":function(b,c,d){var e,f,g=this.options[b];if(d=d||{},c=a.Event(c),c.type=(b===this.widgetEventPrefix?b:this.widgetEventPrefix+b).toLowerCase(),c.target=this.element[0],f=c.originalEvent)for(e in f)e in c||(c[e]=f[e]);return this.element.trigger(c,d),!(a.isFunction(g)&&g.apply(this.element[0],[c].concat(d))===!1||c.isDefaultPrevented())}},a.each({"show":"fadeIn","hide":"fadeOut"},function(b,c){a.Widget.prototype["_"+b]=function(d,e,f){"string"==typeof e&&(e={"effect":e});var g,h=e?e===!0||"number"==typeof e?c:e.effect||c:b;e=e||{},"number"==typeof e&&(e={"duration":e}),g=!a.isEmptyObject(e),e.complete=f,e.delay&&d.delay(e.delay),g&&a.effects&&a.effects.effect[h]?d[b](e):h!==b&&d[h]?d[h](e.duration,e.easing,f):d.queue(function(c){a(this)[b](),f&&f.call(d[0]),c()})}})}(jQuery),function(a){var b=!1;a(document).mouseup(function(){b=!1}),a.widget("ui.mouse",{"version":"1.10.4","options":{"cancel":"input,textarea,button,select,option","distance":1,"delay":0},"_mouseInit":function(){var b=this;this.element.bind("mousedown."+this.widgetName,function(a){return b._mouseDown(a)}).bind("click."+this.widgetName,function(c){return!0===a.data(c.target,b.widgetName+".preventClickEvent")?(a.removeData(c.target,b.widgetName+".preventClickEvent"),c.stopImmediatePropagation(),!1):void 0}),this.started=!1},"_mouseDestroy":function(){this.element.unbind("."+this.widgetName),this._mouseMoveDelegate&&a(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},"_mouseDown":function(c){if(!b){this._mouseStarted&&this._mouseUp(c),this._mouseDownEvent=c;var d=this,e=1===c.which,f="string"==typeof this.options.cancel&&c.target.nodeName?a(c.target).closest(this.options.cancel).length:!1;return e&&!f&&this._mouseCapture(c)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){d.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(c)&&this._mouseDelayMet(c)&&(this._mouseStarted=this._mouseStart(c)!==!1,!this._mouseStarted)?(c.preventDefault(),!0):(!0===a.data(c.target,this.widgetName+".preventClickEvent")&&a.removeData(c.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(a){return d._mouseMove(a)},this._mouseUpDelegate=function(a){return d._mouseUp(a)},a(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),c.preventDefault(),b=!0,!0)):!0}},"_mouseMove":function(b){return a.ui.ie&&(!document.documentMode||document.documentMode<9)&&!b.button?this._mouseUp(b):this._mouseStarted?(this._mouseDrag(b),b.preventDefault()):(this._mouseDistanceMet(b)&&this._mouseDelayMet(b)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,b)!==!1,this._mouseStarted?this._mouseDrag(b):this._mouseUp(b)),!this._mouseStarted)},"_mouseUp":function(b){return a(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,b.target===this._mouseDownEvent.target&&a.data(b.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(b)),!1},"_mouseDistanceMet":function(a){return Math.max(Math.abs(this._mouseDownEvent.pageX-a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance},"_mouseDelayMet":function(){return this.mouseDelayMet},"_mouseStart":function(){},"_mouseDrag":function(){},"_mouseStop":function(){},"_mouseCapture":function(){return!0}})}(jQuery),function(a,b){function c(a,b,c){return[parseFloat(a[0])*(n.test(a[0])?b/100:1),parseFloat(a[1])*(n.test(a[1])?c/100:1)]}function d(b,c){return parseInt(a.css(b,c),10)||0}function e(b){var c=b[0];return 9===c.nodeType?{"width":b.width(),"height":b.height(),"offset":{"top":0,"left":0}}:a.isWindow(c)?{"width":b.width(),"height":b.height(),"offset":{"top":b.scrollTop(),"left":b.scrollLeft()}}:c.preventDefault?{"width":0,"height":0,"offset":{"top":c.pageY,"left":c.pageX}}:{"width":b.outerWidth(),"height":b.outerHeight(),"offset":b.offset()}}a.ui=a.ui||{};var f,g=Math.max,h=Math.abs,i=Math.round,j=/left|center|right/,k=/top|center|bottom/,l=/[\+\-]\d+(\.[\d]+)?%?/,m=/^\w+/,n=/%$/,o=a.fn.position;a.position={"scrollbarWidth":function(){if(f!==b)return f;var c,d,e=a("<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),g=e.children()[0];return a("body").append(e),c=g.offsetWidth,e.css("overflow","scroll"),d=g.offsetWidth,c===d&&(d=e[0].clientWidth),e.remove(),f=c-d},"getScrollInfo":function(b){var c=b.isWindow||b.isDocument?"":b.element.css("overflow-x"),d=b.isWindow||b.isDocument?"":b.element.css("overflow-y"),e="scroll"===c||"auto"===c&&b.width<b.element[0].scrollWidth,f="scroll"===d||"auto"===d&&b.height<b.element[0].scrollHeight;return{"width":f?a.position.scrollbarWidth():0,"height":e?a.position.scrollbarWidth():0}},"getWithinInfo":function(b){var c=a(b||window),d=a.isWindow(c[0]),e=!!c[0]&&9===c[0].nodeType;return{"element":c,"isWindow":d,"isDocument":e,"offset":c.offset()||{"left":0,"top":0},"scrollLeft":c.scrollLeft(),"scrollTop":c.scrollTop(),"width":d?c.width():c.outerWidth(),"height":d?c.height():c.outerHeight()}}},a.fn.position=function(b){if(!b||!b.of)return o.apply(this,arguments);b=a.extend({},b);var f,n,p,q,r,s,t=a(b.of),u=a.position.getWithinInfo(b.within),v=a.position.getScrollInfo(u),w=(b.collision||"flip").split(" "),x={};return s=e(t),t[0].preventDefault&&(b.at="left top"),n=s.width,p=s.height,q=s.offset,r=a.extend({},q),a.each(["my","at"],function(){var a,c,d=(b[this]||"").split(" ");1===d.length&&(d=j.test(d[0])?d.concat(["center"]):k.test(d[0])?["center"].concat(d):["center","center"]),d[0]=j.test(d[0])?d[0]:"center",d[1]=k.test(d[1])?d[1]:"center",a=l.exec(d[0]),c=l.exec(d[1]),x[this]=[a?a[0]:0,c?c[0]:0],b[this]=[m.exec(d[0])[0],m.exec(d[1])[0]]}),1===w.length&&(w[1]=w[0]),"right"===b.at[0]?r.left+=n:"center"===b.at[0]&&(r.left+=n/2),"bottom"===b.at[1]?r.top+=p:"center"===b.at[1]&&(r.top+=p/2),f=c(x.at,n,p),r.left+=f[0],r.top+=f[1],this.each(function(){var e,j,k=a(this),l=k.outerWidth(),m=k.outerHeight(),o=d(this,"marginLeft"),s=d(this,"marginTop"),y=l+o+d(this,"marginRight")+v.width,z=m+s+d(this,"marginBottom")+v.height,A=a.extend({},r),B=c(x.my,k.outerWidth(),k.outerHeight());"right"===b.my[0]?A.left-=l:"center"===b.my[0]&&(A.left-=l/2),"bottom"===b.my[1]?A.top-=m:"center"===b.my[1]&&(A.top-=m/2),A.left+=B[0],A.top+=B[1],a.support.offsetFractions||(A.left=i(A.left),A.top=i(A.top)),e={"marginLeft":o,"marginTop":s},a.each(["left","top"],function(c,d){a.ui.position[w[c]]&&a.ui.position[w[c]][d](A,{"targetWidth":n,"targetHeight":p,"elemWidth":l,"elemHeight":m,"collisionPosition":e,"collisionWidth":y,"collisionHeight":z,"offset":[f[0]+B[0],f[1]+B[1]],"my":b.my,"at":b.at,"within":u,"elem":k})}),b.using&&(j=function(a){var c=q.left-A.left,d=c+n-l,e=q.top-A.top,f=e+p-m,i={"target":{"element":t,"left":q.left,"top":q.top,"width":n,"height":p},"element":{"element":k,"left":A.left,"top":A.top,"width":l,"height":m},"horizontal":0>d?"left":c>0?"right":"center","vertical":0>f?"top":e>0?"bottom":"middle"};l>n&&h(c+d)<n&&(i.horizontal="center"),m>p&&h(e+f)<p&&(i.vertical="middle"),i.important=g(h(c),h(d))>g(h(e),h(f))?"horizontal":"vertical",b.using.call(this,a,i)}),k.offset(a.extend(A,{"using":j}))})},a.ui.position={"fit":{"left":function(a,b){var c,d=b.within,e=d.isWindow?d.scrollLeft:d.offset.left,f=d.width,h=a.left-b.collisionPosition.marginLeft,i=e-h,j=h+b.collisionWidth-f-e;b.collisionWidth>f?i>0&&0>=j?(c=a.left+i+b.collisionWidth-f-e,a.left+=i-c):a.left=j>0&&0>=i?e:i>j?e+f-b.collisionWidth:e:i>0?a.left+=i:j>0?a.left-=j:a.left=g(a.left-h,a.left)},"top":function(a,b){var c,d=b.within,e=d.isWindow?d.scrollTop:d.offset.top,f=b.within.height,h=a.top-b.collisionPosition.marginTop,i=e-h,j=h+b.collisionHeight-f-e;b.collisionHeight>f?i>0&&0>=j?(c=a.top+i+b.collisionHeight-f-e,a.top+=i-c):a.top=j>0&&0>=i?e:i>j?e+f-b.collisionHeight:e:i>0?a.top+=i:j>0?a.top-=j:a.top=g(a.top-h,a.top)}},"flip":{"left":function(a,b){var c,d,e=b.within,f=e.offset.left+e.scrollLeft,g=e.width,i=e.isWindow?e.scrollLeft:e.offset.left,j=a.left-b.collisionPosition.marginLeft,k=j-i,l=j+b.collisionWidth-g-i,m="left"===b.my[0]?-b.elemWidth:"right"===b.my[0]?b.elemWidth:0,n="left"===b.at[0]?b.targetWidth:"right"===b.at[0]?-b.targetWidth:0,o=-2*b.offset[0];0>k?(c=a.left+m+n+o+b.collisionWidth-g-f,(0>c||c<h(k))&&(a.left+=m+n+o)):l>0&&(d=a.left-b.collisionPosition.marginLeft+m+n+o-i,(d>0||h(d)<l)&&(a.left+=m+n+o))},"top":function(a,b){var c,d,e=b.within,f=e.offset.top+e.scrollTop,g=e.height,i=e.isWindow?e.scrollTop:e.offset.top,j=a.top-b.collisionPosition.marginTop,k=j-i,l=j+b.collisionHeight-g-i,m="top"===b.my[1],n=m?-b.elemHeight:"bottom"===b.my[1]?b.elemHeight:0,o="top"===b.at[1]?b.targetHeight:"bottom"===b.at[1]?-b.targetHeight:0,p=-2*b.offset[1];0>k?(d=a.top+n+o+p+b.collisionHeight-g-f,a.top+n+o+p>k&&(0>d||d<h(k))&&(a.top+=n+o+p)):l>0&&(c=a.top-b.collisionPosition.marginTop+n+o+p-i,a.top+n+o+p>l&&(c>0||h(c)<l)&&(a.top+=n+o+p))}},"flipfit":{"left":function(){a.ui.position.flip.left.apply(this,arguments),a.ui.position.fit.left.apply(this,arguments)},"top":function(){a.ui.position.flip.top.apply(this,arguments),a.ui.position.fit.top.apply(this,arguments)}}},function(){var b,c,d,e,f,g=document.getElementsByTagName("body")[0],h=document.createElement("div");b=document.createElement(g?"div":"body"),d={"visibility":"hidden","width":0,"height":0,"border":0,"margin":0,"background":"none"},g&&a.extend(d,{"position":"absolute","left":"-1000px","top":"-1000px"});for(f in d)b.style[f]=d[f];b.appendChild(h),c=g||document.documentElement,c.insertBefore(b,c.firstChild),h.style.cssText="position: absolute; left: 10.7432222px;",e=a(h).offset().left,a.support.offsetFractions=e>10&&11>e,b.innerHTML="",c.removeChild(b)}()}(jQuery),function(a){function b(a,b,c){return a>b&&b+c>a}function c(a){return/left|right/.test(a.css("float"))||/inline|table-cell/.test(a.css("display"))}a.widget("ui.sortable",a.ui.mouse,{"version":"1.10.4","widgetEventPrefix":"sort","ready":!1,"options":{"appendTo":"parent","axis":!1,"connectWith":!1,"containment":!1,"cursor":"auto","cursorAt":!1,"dropOnEmpty":!0,"forcePlaceholderSize":!1,"forceHelperSize":!1,"grid":!1,"handle":!1,"helper":"original","items":"> *","opacity":!1,"placeholder":!1,"revert":!1,"scroll":!0,"scrollSensitivity":20,"scrollSpeed":20,"scope":"default","tolerance":"intersect","zIndex":1e3,"activate":null,"beforeStop":null,"change":null,"deactivate":null,"out":null,"over":null,"receive":null,"remove":null,"sort":null,"start":null,"stop":null,"update":null},"_create":function(){var a=this.options;this.containerCache={},this.element.addClass("ui-sortable"),this.refresh(),this.floating=this.items.length?"x"===a.axis||c(this.items[0].item):!1,this.offset=this.element.offset(),this._mouseInit(),this.ready=!0},"_destroy":function(){this.element.removeClass("ui-sortable ui-sortable-disabled"),this._mouseDestroy();
|
|
for(var a=this.items.length-1;a>=0;a--)this.items[a].item.removeData(this.widgetName+"-item");return this},"_setOption":function(b,c){"disabled"===b?(this.options[b]=c,this.widget().toggleClass("ui-sortable-disabled",!!c)):a.Widget.prototype._setOption.apply(this,arguments)},"_mouseCapture":function(b,c){var d=null,e=!1,f=this;return this.reverting?!1:this.options.disabled||"static"===this.options.type?!1:(this._refreshItems(b),a(b.target).parents().each(function(){return a.data(this,f.widgetName+"-item")===f?(d=a(this),!1):void 0}),a.data(b.target,f.widgetName+"-item")===f&&(d=a(b.target)),d&&(!this.options.handle||c||(a(this.options.handle,d).find("*").addBack().each(function(){this===b.target&&(e=!0)}),e))?(this.currentItem=d,this._removeCurrentsFromItems(),!0):!1)},"_mouseStart":function(b,c,d){var e,f,g=this.options;if(this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(b),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={"top":this.offset.top-this.margins.top,"left":this.offset.left-this.margins.left},a.extend(this.offset,{"click":{"left":b.pageX-this.offset.left,"top":b.pageY-this.offset.top},"parent":this._getParentOffset(),"relative":this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(b),this.originalPageX=b.pageX,this.originalPageY=b.pageY,g.cursorAt&&this._adjustOffsetFromHelper(g.cursorAt),this.domPosition={"prev":this.currentItem.prev()[0],"parent":this.currentItem.parent()[0]},this.helper[0]!==this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),g.containment&&this._setContainment(),g.cursor&&"auto"!==g.cursor&&(f=this.document.find("body"),this.storedCursor=f.css("cursor"),f.css("cursor",g.cursor),this.storedStylesheet=a("<style>*{ cursor: "+g.cursor+" !important; }</style>").appendTo(f)),g.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",g.opacity)),g.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",g.zIndex)),this.scrollParent[0]!==document&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",b,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!d)for(e=this.containers.length-1;e>=0;e--)this.containers[e]._trigger("activate",b,this._uiHash(this));return a.ui.ddmanager&&(a.ui.ddmanager.current=this),a.ui.ddmanager&&!g.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,b),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(b),!0},"_mouseDrag":function(b){var c,d,e,f,g=this.options,h=!1;for(this.position=this._generatePosition(b),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll&&(this.scrollParent[0]!==document&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-b.pageY<g.scrollSensitivity?this.scrollParent[0].scrollTop=h=this.scrollParent[0].scrollTop+g.scrollSpeed:b.pageY-this.overflowOffset.top<g.scrollSensitivity&&(this.scrollParent[0].scrollTop=h=this.scrollParent[0].scrollTop-g.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-b.pageX<g.scrollSensitivity?this.scrollParent[0].scrollLeft=h=this.scrollParent[0].scrollLeft+g.scrollSpeed:b.pageX-this.overflowOffset.left<g.scrollSensitivity&&(this.scrollParent[0].scrollLeft=h=this.scrollParent[0].scrollLeft-g.scrollSpeed)):(b.pageY-a(document).scrollTop()<g.scrollSensitivity?h=a(document).scrollTop(a(document).scrollTop()-g.scrollSpeed):a(window).height()-(b.pageY-a(document).scrollTop())<g.scrollSensitivity&&(h=a(document).scrollTop(a(document).scrollTop()+g.scrollSpeed)),b.pageX-a(document).scrollLeft()<g.scrollSensitivity?h=a(document).scrollLeft(a(document).scrollLeft()-g.scrollSpeed):a(window).width()-(b.pageX-a(document).scrollLeft())<g.scrollSensitivity&&(h=a(document).scrollLeft(a(document).scrollLeft()+g.scrollSpeed))),h!==!1&&a.ui.ddmanager&&!g.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,b)),this.positionAbs=this._convertPositionTo("absolute"),this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),c=this.items.length-1;c>=0;c--)if(d=this.items[c],e=d.item[0],f=this._intersectsWithPointer(d),f&&d.instance===this.currentContainer&&e!==this.currentItem[0]&&this.placeholder[1===f?"next":"prev"]()[0]!==e&&!a.contains(this.placeholder[0],e)&&("semi-dynamic"===this.options.type?!a.contains(this.element[0],e):!0)){if(this.direction=1===f?"down":"up","pointer"!==this.options.tolerance&&!this._intersectsWithSides(d))break;this._rearrange(b,d),this._trigger("change",b,this._uiHash());break}return this._contactContainers(b),a.ui.ddmanager&&a.ui.ddmanager.drag(this,b),this._trigger("sort",b,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},"_mouseStop":function(b,c){if(b){if(a.ui.ddmanager&&!this.options.dropBehaviour&&a.ui.ddmanager.drop(this,b),this.options.revert){var d=this,e=this.placeholder.offset(),f=this.options.axis,g={};f&&"x"!==f||(g.left=e.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollLeft)),f&&"y"!==f||(g.top=e.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollTop)),this.reverting=!0,a(this.helper).animate(g,parseInt(this.options.revert,10)||500,function(){d._clear(b)})}else this._clear(b,c);return!1}},"cancel":function(){if(this.dragging){this._mouseUp({"target":null}),"original"===this.options.helper?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var b=this.containers.length-1;b>=0;b--)this.containers[b]._trigger("deactivate",null,this._uiHash(this)),this.containers[b].containerCache.over&&(this.containers[b]._trigger("out",null,this._uiHash(this)),this.containers[b].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!==this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),a.extend(this,{"helper":null,"dragging":!1,"reverting":!1,"_noFinalSort":null}),this.domPosition.prev?a(this.domPosition.prev).after(this.currentItem):a(this.domPosition.parent).prepend(this.currentItem)),this},"serialize":function(b){var c=this._getItemsAsjQuery(b&&b.connected),d=[];return b=b||{},a(c).each(function(){var c=(a(b.item||this).attr(b.attribute||"id")||"").match(b.expression||/(.+)[\-=_](.+)/);c&&d.push((b.key||c[1]+"[]")+"="+(b.key&&b.expression?c[1]:c[2]))}),!d.length&&b.key&&d.push(b.key+"="),d.join("&")},"toArray":function(b){var c=this._getItemsAsjQuery(b&&b.connected),d=[];return b=b||{},c.each(function(){d.push(a(b.item||this).attr(b.attribute||"id")||"")}),d},"_intersectsWith":function(a){var b=this.positionAbs.left,c=b+this.helperProportions.width,d=this.positionAbs.top,e=d+this.helperProportions.height,f=a.left,g=f+a.width,h=a.top,i=h+a.height,j=this.offset.click.top,k=this.offset.click.left,l="x"===this.options.axis||d+j>h&&i>d+j,m="y"===this.options.axis||b+k>f&&g>b+k,n=l&&m;return"pointer"===this.options.tolerance||this.options.forcePointerForContainers||"pointer"!==this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>a[this.floating?"width":"height"]?n:f<b+this.helperProportions.width/2&&c-this.helperProportions.width/2<g&&h<d+this.helperProportions.height/2&&e-this.helperProportions.height/2<i},"_intersectsWithPointer":function(a){var c="x"===this.options.axis||b(this.positionAbs.top+this.offset.click.top,a.top,a.height),d="y"===this.options.axis||b(this.positionAbs.left+this.offset.click.left,a.left,a.width),e=c&&d,f=this._getDragVerticalDirection(),g=this._getDragHorizontalDirection();return e?this.floating?g&&"right"===g||"down"===f?2:1:f&&("down"===f?2:1):!1},"_intersectsWithSides":function(a){var c=b(this.positionAbs.top+this.offset.click.top,a.top+a.height/2,a.height),d=b(this.positionAbs.left+this.offset.click.left,a.left+a.width/2,a.width),e=this._getDragVerticalDirection(),f=this._getDragHorizontalDirection();return this.floating&&f?"right"===f&&d||"left"===f&&!d:e&&("down"===e&&c||"up"===e&&!c)},"_getDragVerticalDirection":function(){var a=this.positionAbs.top-this.lastPositionAbs.top;return 0!==a&&(a>0?"down":"up")},"_getDragHorizontalDirection":function(){var a=this.positionAbs.left-this.lastPositionAbs.left;return 0!==a&&(a>0?"right":"left")},"refresh":function(a){return this._refreshItems(a),this.refreshPositions(),this},"_connectWith":function(){var a=this.options;return a.connectWith.constructor===String?[a.connectWith]:a.connectWith},"_getItemsAsjQuery":function(b){function c(){h.push(this)}var d,e,f,g,h=[],i=[],j=this._connectWith();if(j&&b)for(d=j.length-1;d>=0;d--)for(f=a(j[d]),e=f.length-1;e>=0;e--)g=a.data(f[e],this.widgetFullName),g&&g!==this&&!g.options.disabled&&i.push([a.isFunction(g.options.items)?g.options.items.call(g.element):a(g.options.items,g.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),g]);for(i.push([a.isFunction(this.options.items)?this.options.items.call(this.element,null,{"options":this.options,"item":this.currentItem}):a(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]),d=i.length-1;d>=0;d--)i[d][0].each(c);return a(h)},"_removeCurrentsFromItems":function(){var b=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=a.grep(this.items,function(a){for(var c=0;c<b.length;c++)if(b[c]===a.item[0])return!1;return!0})},"_refreshItems":function(b){this.items=[],this.containers=[this];var c,d,e,f,g,h,i,j,k=this.items,l=[[a.isFunction(this.options.items)?this.options.items.call(this.element[0],b,{"item":this.currentItem}):a(this.options.items,this.element),this]],m=this._connectWith();if(m&&this.ready)for(c=m.length-1;c>=0;c--)for(e=a(m[c]),d=e.length-1;d>=0;d--)f=a.data(e[d],this.widgetFullName),f&&f!==this&&!f.options.disabled&&(l.push([a.isFunction(f.options.items)?f.options.items.call(f.element[0],b,{"item":this.currentItem}):a(f.options.items,f.element),f]),this.containers.push(f));for(c=l.length-1;c>=0;c--)for(g=l[c][1],h=l[c][0],d=0,j=h.length;j>d;d++)i=a(h[d]),i.data(this.widgetName+"-item",g),k.push({"item":i,"instance":g,"width":0,"height":0,"left":0,"top":0})},"refreshPositions":function(b){this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());var c,d,e,f;for(c=this.items.length-1;c>=0;c--)d=this.items[c],d.instance!==this.currentContainer&&this.currentContainer&&d.item[0]!==this.currentItem[0]||(e=this.options.toleranceElement?a(this.options.toleranceElement,d.item):d.item,b||(d.width=e.outerWidth(),d.height=e.outerHeight()),f=e.offset(),d.left=f.left,d.top=f.top);if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(c=this.containers.length-1;c>=0;c--)f=this.containers[c].element.offset(),this.containers[c].containerCache.left=f.left,this.containers[c].containerCache.top=f.top,this.containers[c].containerCache.width=this.containers[c].element.outerWidth(),this.containers[c].containerCache.height=this.containers[c].element.outerHeight();return this},"_createPlaceholder":function(b){b=b||this;var c,d=b.options;d.placeholder&&d.placeholder.constructor!==String||(c=d.placeholder,d.placeholder={"element":function(){var d=b.currentItem[0].nodeName.toLowerCase(),e=a("<"+d+">",b.document[0]).addClass(c||b.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper");return"tr"===d?b.currentItem.children().each(function(){a("<td> </td>",b.document[0]).attr("colspan",a(this).attr("colspan")||1).appendTo(e)}):"img"===d&&e.attr("src",b.currentItem.attr("src")),c||e.css("visibility","hidden"),e},"update":function(a,e){(!c||d.forcePlaceholderSize)&&(e.height()||e.height(b.currentItem.innerHeight()-parseInt(b.currentItem.css("paddingTop")||0,10)-parseInt(b.currentItem.css("paddingBottom")||0,10)),e.width()||e.width(b.currentItem.innerWidth()-parseInt(b.currentItem.css("paddingLeft")||0,10)-parseInt(b.currentItem.css("paddingRight")||0,10)))}}),b.placeholder=a(d.placeholder.element.call(b.element,b.currentItem)),b.currentItem.after(b.placeholder),d.placeholder.update(b,b.placeholder)},"_contactContainers":function(d){var e,f,g,h,i,j,k,l,m,n,o=null,p=null;for(e=this.containers.length-1;e>=0;e--)if(!a.contains(this.currentItem[0],this.containers[e].element[0]))if(this._intersectsWith(this.containers[e].containerCache)){if(o&&a.contains(this.containers[e].element[0],o.element[0]))continue;o=this.containers[e],p=e}else this.containers[e].containerCache.over&&(this.containers[e]._trigger("out",d,this._uiHash(this)),this.containers[e].containerCache.over=0);if(o)if(1===this.containers.length)this.containers[p].containerCache.over||(this.containers[p]._trigger("over",d,this._uiHash(this)),this.containers[p].containerCache.over=1);else{for(g=1e4,h=null,n=o.floating||c(this.currentItem),i=n?"left":"top",j=n?"width":"height",k=this.positionAbs[i]+this.offset.click[i],f=this.items.length-1;f>=0;f--)a.contains(this.containers[p].element[0],this.items[f].item[0])&&this.items[f].item[0]!==this.currentItem[0]&&(!n||b(this.positionAbs.top+this.offset.click.top,this.items[f].top,this.items[f].height))&&(l=this.items[f].item.offset()[i],m=!1,Math.abs(l-k)>Math.abs(l+this.items[f][j]-k)&&(m=!0,l+=this.items[f][j]),Math.abs(l-k)<g&&(g=Math.abs(l-k),h=this.items[f],this.direction=m?"up":"down"));if(!h&&!this.options.dropOnEmpty)return;if(this.currentContainer===this.containers[p])return;h?this._rearrange(d,h,null,!0):this._rearrange(d,null,this.containers[p].element,!0),this._trigger("change",d,this._uiHash()),this.containers[p]._trigger("change",d,this._uiHash(this)),this.currentContainer=this.containers[p],this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[p]._trigger("over",d,this._uiHash(this)),this.containers[p].containerCache.over=1}},"_createHelper":function(b){var c=this.options,d=a.isFunction(c.helper)?a(c.helper.apply(this.element[0],[b,this.currentItem])):"clone"===c.helper?this.currentItem.clone():this.currentItem;return d.parents("body").length||a("parent"!==c.appendTo?c.appendTo:this.currentItem[0].parentNode)[0].appendChild(d[0]),d[0]===this.currentItem[0]&&(this._storedCSS={"width":this.currentItem[0].style.width,"height":this.currentItem[0].style.height,"position":this.currentItem.css("position"),"top":this.currentItem.css("top"),"left":this.currentItem.css("left")}),(!d[0].style.width||c.forceHelperSize)&&d.width(this.currentItem.width()),(!d[0].style.height||c.forceHelperSize)&&d.height(this.currentItem.height()),d},"_adjustOffsetFromHelper":function(b){"string"==typeof b&&(b=b.split(" ")),a.isArray(b)&&(b={"left":+b[0],"top":+b[1]||0}),"left"in b&&(this.offset.click.left=b.left+this.margins.left),"right"in b&&(this.offset.click.left=this.helperProportions.width-b.right+this.margins.left),"top"in b&&(this.offset.click.top=b.top+this.margins.top),"bottom"in b&&(this.offset.click.top=this.helperProportions.height-b.bottom+this.margins.top)},"_getParentOffset":function(){this.offsetParent=this.helper.offsetParent();var b=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==document&&a.contains(this.scrollParent[0],this.offsetParent[0])&&(b.left+=this.scrollParent.scrollLeft(),b.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===document.body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&a.ui.ie)&&(b={"top":0,"left":0}),{"top":b.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),"left":b.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},"_getRelativeOffset":function(){if("relative"===this.cssPosition){var a=this.currentItem.position();return{"top":a.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),"left":a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{"top":0,"left":0}},"_cacheMargins":function(){this.margins={"left":parseInt(this.currentItem.css("marginLeft"),10)||0,"top":parseInt(this.currentItem.css("marginTop"),10)||0}},"_cacheHelperProportions":function(){this.helperProportions={"width":this.helper.outerWidth(),"height":this.helper.outerHeight()}},"_setContainment":function(){var b,c,d,e=this.options;"parent"===e.containment&&(e.containment=this.helper[0].parentNode),("document"===e.containment||"window"===e.containment)&&(this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,a("document"===e.containment?document:window).width()-this.helperProportions.width-this.margins.left,(a("document"===e.containment?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(e.containment)||(b=a(e.containment)[0],c=a(e.containment).offset(),d="hidden"!==a(b).css("overflow"),this.containment=[c.left+(parseInt(a(b).css("borderLeftWidth"),10)||0)+(parseInt(a(b).css("paddingLeft"),10)||0)-this.margins.left,c.top+(parseInt(a(b).css("borderTopWidth"),10)||0)+(parseInt(a(b).css("paddingTop"),10)||0)-this.margins.top,c.left+(d?Math.max(b.scrollWidth,b.offsetWidth):b.offsetWidth)-(parseInt(a(b).css("borderLeftWidth"),10)||0)-(parseInt(a(b).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,c.top+(d?Math.max(b.scrollHeight,b.offsetHeight):b.offsetHeight)-(parseInt(a(b).css("borderTopWidth"),10)||0)-(parseInt(a(b).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top])},"_convertPositionTo":function(b,c){c||(c=this.position);var d="absolute"===b?1:-1,e="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&a.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,f=/(html|body)/i.test(e[0].tagName);return{"top":c.top+this.offset.relative.top*d+this.offset.parent.top*d-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():f?0:e.scrollTop())*d,"left":c.left+this.offset.relative.left*d+this.offset.parent.left*d-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():f?0:e.scrollLeft())*d}},"_generatePosition":function(b){var c,d,e=this.options,f=b.pageX,g=b.pageY,h="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&a.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,i=/(html|body)/i.test(h[0].tagName);return"relative"!==this.cssPosition||this.scrollParent[0]!==document&&this.scrollParent[0]!==this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset()),this.originalPosition&&(this.containment&&(b.pageX-this.offset.click.left<this.containment[0]&&(f=this.containment[0]+this.offset.click.left),b.pageY-this.offset.click.top<this.containment[1]&&(g=this.containment[1]+this.offset.click.top),b.pageX-this.offset.click.left>this.containment[2]&&(f=this.containment[2]+this.offset.click.left),b.pageY-this.offset.click.top>this.containment[3]&&(g=this.containment[3]+this.offset.click.top)),e.grid&&(c=this.originalPageY+Math.round((g-this.originalPageY)/e.grid[1])*e.grid[1],g=this.containment?c-this.offset.click.top>=this.containment[1]&&c-this.offset.click.top<=this.containment[3]?c:c-this.offset.click.top>=this.containment[1]?c-e.grid[1]:c+e.grid[1]:c,d=this.originalPageX+Math.round((f-this.originalPageX)/e.grid[0])*e.grid[0],f=this.containment?d-this.offset.click.left>=this.containment[0]&&d-this.offset.click.left<=this.containment[2]?d:d-this.offset.click.left>=this.containment[0]?d-e.grid[0]:d+e.grid[0]:d)),{"top":g-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():i?0:h.scrollTop()),"left":f-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():i?0:h.scrollLeft())}},"_rearrange":function(a,b,c,d){c?c[0].appendChild(this.placeholder[0]):b.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?b.item[0]:b.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var e=this.counter;this._delay(function(){e===this.counter&&this.refreshPositions(!d)})},"_clear":function(a,b){function c(a,b,c){return function(d){c._trigger(a,d,b._uiHash(b))}}this.reverting=!1;var d,e=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(d in this._storedCSS)("auto"===this._storedCSS[d]||"static"===this._storedCSS[d])&&(this._storedCSS[d]="");this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();for(this.fromOutside&&!b&&e.push(function(a){this._trigger("receive",a,this._uiHash(this.fromOutside))}),!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||b||e.push(function(a){this._trigger("update",a,this._uiHash())}),this!==this.currentContainer&&(b||(e.push(function(a){this._trigger("remove",a,this._uiHash())}),e.push(function(a){return function(b){a._trigger("receive",b,this._uiHash(this))}}.call(this,this.currentContainer)),e.push(function(a){return function(b){a._trigger("update",b,this._uiHash(this))}}.call(this,this.currentContainer)))),d=this.containers.length-1;d>=0;d--)b||e.push(c("deactivate",this,this.containers[d])),this.containers[d].containerCache.over&&(e.push(c("out",this,this.containers[d])),this.containers[d].containerCache.over=0);if(this.storedCursor&&(this.document.find("body").css("cursor",this.storedCursor),this.storedStylesheet.remove()),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"===this._storedZIndex?"":this._storedZIndex),this.dragging=!1,this.cancelHelperRemoval){if(!b){for(this._trigger("beforeStop",a,this._uiHash()),d=0;d<e.length;d++)e[d].call(this,a);this._trigger("stop",a,this._uiHash())}return this.fromOutside=!1,!1}if(b||this._trigger("beforeStop",a,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null,!b){for(d=0;d<e.length;d++)e[d].call(this,a);this._trigger("stop",a,this._uiHash())}return this.fromOutside=!1,!0},"_trigger":function(){a.Widget.prototype._trigger.apply(this,arguments)===!1&&this.cancel()},"_uiHash":function(b){var c=b||this;return{"helper":c.helper,"placeholder":c.placeholder||a([]),"position":c.position,"originalPosition":c.originalPosition,"offset":c.positionAbs,"item":c.currentItem,"sender":b?b.element:null}}})}(jQuery),function(a){var b=5;a.widget("ui.slider",a.ui.mouse,{"version":"1.10.4","widgetEventPrefix":"slide","options":{"animate":!1,"distance":0,"max":100,"min":0,"orientation":"horizontal","range":!1,"step":1,"value":0,"values":null,"change":null,"slide":null,"start":null,"stop":null},"_create":function(){this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget ui-widget-content ui-corner-all"),this._refresh(),this._setOption("disabled",this.options.disabled),this._animateOff=!1},"_refresh":function(){this._createRange(),this._createHandles(),this._setupEvents(),this._refreshValue()},"_createHandles":function(){var b,c,d=this.options,e=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),f="<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>",g=[];for(c=d.values&&d.values.length||1,e.length>c&&(e.slice(c).remove(),e=e.slice(0,c)),b=e.length;c>b;b++)g.push(f);this.handles=e.add(a(g.join("")).appendTo(this.element)),this.handle=this.handles.eq(0),this.handles.each(function(b){a(this).data("ui-slider-handle-index",b)})},"_createRange":function(){var b=this.options,c="";b.range?(b.range===!0&&(b.values?b.values.length&&2!==b.values.length?b.values=[b.values[0],b.values[0]]:a.isArray(b.values)&&(b.values=b.values.slice(0)):b.values=[this._valueMin(),this._valueMin()]),this.range&&this.range.length?this.range.removeClass("ui-slider-range-min ui-slider-range-max").css({"left":"","bottom":""}):(this.range=a("<div></div>").appendTo(this.element),c="ui-slider-range ui-widget-header ui-corner-all"),this.range.addClass(c+("min"===b.range||"max"===b.range?" ui-slider-range-"+b.range:""))):(this.range&&this.range.remove(),this.range=null)},"_setupEvents":function(){var a=this.handles.add(this.range).filter("a");this._off(a),this._on(a,this._handleEvents),this._hoverable(a),this._focusable(a)},"_destroy":function(){this.handles.remove(),this.range&&this.range.remove(),this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-widget ui-widget-content ui-corner-all"),this._mouseDestroy()},"_mouseCapture":function(b){var c,d,e,f,g,h,i,j,k=this,l=this.options;return l.disabled?!1:(this.elementSize={"width":this.element.outerWidth(),"height":this.element.outerHeight()},this.elementOffset=this.element.offset(),c={"x":b.pageX,"y":b.pageY},d=this._normValueFromMouse(c),e=this._valueMax()-this._valueMin()+1,this.handles.each(function(b){var c=Math.abs(d-k.values(b));(e>c||e===c&&(b===k._lastChangedValue||k.values(b)===l.min))&&(e=c,f=a(this),g=b)}),h=this._start(b,g),h===!1?!1:(this._mouseSliding=!0,this._handleIndex=g,f.addClass("ui-state-active").focus(),i=f.offset(),j=!a(b.target).parents().addBack().is(".ui-slider-handle"),this._clickOffset=j?{"left":0,"top":0}:{"left":b.pageX-i.left-f.width()/2,"top":b.pageY-i.top-f.height()/2-(parseInt(f.css("borderTopWidth"),10)||0)-(parseInt(f.css("borderBottomWidth"),10)||0)+(parseInt(f.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(b,g,d),this._animateOff=!0,!0))},"_mouseStart":function(){return!0},"_mouseDrag":function(a){var b={"x":a.pageX,"y":a.pageY},c=this._normValueFromMouse(b);return this._slide(a,this._handleIndex,c),!1},"_mouseStop":function(a){return this.handles.removeClass("ui-state-active"),this._mouseSliding=!1,this._stop(a,this._handleIndex),this._change(a,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1,!1},"_detectOrientation":function(){this.orientation="vertical"===this.options.orientation?"vertical":"horizontal"},"_normValueFromMouse":function(a){var b,c,d,e,f;return"horizontal"===this.orientation?(b=this.elementSize.width,c=a.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(b=this.elementSize.height,c=a.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),d=c/b,d>1&&(d=1),0>d&&(d=0),"vertical"===this.orientation&&(d=1-d),e=this._valueMax()-this._valueMin(),f=this._valueMin()+d*e,this._trimAlignValue(f)},"_start":function(a,b){var c={"handle":this.handles[b],"value":this.value()};return this.options.values&&this.options.values.length&&(c.value=this.values(b),c.values=this.values()),this._trigger("start",a,c)},"_slide":function(a,b,c){var d,e,f;this.options.values&&this.options.values.length?(d=this.values(b?0:1),2===this.options.values.length&&this.options.range===!0&&(0===b&&c>d||1===b&&d>c)&&(c=d),c!==this.values(b)&&(e=this.values(),e[b]=c,f=this._trigger("slide",a,{"handle":this.handles[b],"value":c,"values":e}),d=this.values(b?0:1),f!==!1&&this.values(b,c))):c!==this.value()&&(f=this._trigger("slide",a,{"handle":this.handles[b],"value":c}),f!==!1&&this.value(c))},"_stop":function(a,b){var c={"handle":this.handles[b],"value":this.value()};this.options.values&&this.options.values.length&&(c.value=this.values(b),c.values=this.values()),this._trigger("stop",a,c)},"_change":function(a,b){if(!this._keySliding&&!this._mouseSliding){var c={"handle":this.handles[b],"value":this.value()};this.options.values&&this.options.values.length&&(c.value=this.values(b),c.values=this.values()),this._lastChangedValue=b,this._trigger("change",a,c)}},"value":function(a){return arguments.length?(this.options.value=this._trimAlignValue(a),this._refreshValue(),void this._change(null,0)):this._value()},"values":function(b,c){var d,e,f;if(arguments.length>1)return this.options.values[b]=this._trimAlignValue(c),this._refreshValue(),void this._change(null,b);if(!arguments.length)return this._values();if(!a.isArray(arguments[0]))return this.options.values&&this.options.values.length?this._values(b):this.value();for(d=this.options.values,e=arguments[0],f=0;f<d.length;f+=1)d[f]=this._trimAlignValue(e[f]),this._change(null,f);this._refreshValue()},"_setOption":function(b,c){var d,e=0;switch("range"===b&&this.options.range===!0&&("min"===c?(this.options.value=this._values(0),this.options.values=null):"max"===c&&(this.options.value=this._values(this.options.values.length-1),this.options.values=null)),a.isArray(this.options.values)&&(e=this.options.values.length),a.Widget.prototype._setOption.apply(this,arguments),b){case"orientation":this._detectOrientation(),this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation),this._refreshValue();break;case"value":this._animateOff=!0,this._refreshValue(),this._change(null,0),this._animateOff=!1;break;case"values":for(this._animateOff=!0,this._refreshValue(),d=0;e>d;d+=1)this._change(null,d);this._animateOff=!1;break;case"min":case"max":this._animateOff=!0,this._refreshValue(),this._animateOff=!1;break;case"range":this._animateOff=!0,this._refresh(),this._animateOff=!1}},"_value":function(){var a=this.options.value;return a=this._trimAlignValue(a)},"_values":function(a){var b,c,d;if(arguments.length)return b=this.options.values[a],b=this._trimAlignValue(b);if(this.options.values&&this.options.values.length){for(c=this.options.values.slice(),d=0;d<c.length;d+=1)c[d]=this._trimAlignValue(c[d]);return c}return[]},"_trimAlignValue":function(a){if(a<=this._valueMin())return this._valueMin();if(a>=this._valueMax())return this._valueMax();var b=this.options.step>0?this.options.step:1,c=(a-this._valueMin())%b,d=a-c;return 2*Math.abs(c)>=b&&(d+=c>0?b:-b),parseFloat(d.toFixed(5))},"_valueMin":function(){return this.options.min},"_valueMax":function(){return this.options.max},"_refreshValue":function(){var b,c,d,e,f,g=this.options.range,h=this.options,i=this,j=this._animateOff?!1:h.animate,k={};this.options.values&&this.options.values.length?this.handles.each(function(d){c=(i.values(d)-i._valueMin())/(i._valueMax()-i._valueMin())*100,k["horizontal"===i.orientation?"left":"bottom"]=c+"%",a(this).stop(1,1)[j?"animate":"css"](k,h.animate),i.options.range===!0&&("horizontal"===i.orientation?(0===d&&i.range.stop(1,1)[j?"animate":"css"]({"left":c+"%"},h.animate),1===d&&i.range[j?"animate":"css"]({"width":c-b+"%"},{"queue":!1,"duration":h.animate})):(0===d&&i.range.stop(1,1)[j?"animate":"css"]({"bottom":c+"%"},h.animate),1===d&&i.range[j?"animate":"css"]({"height":c-b+"%"},{"queue":!1,"duration":h.animate}))),b=c}):(d=this.value(),e=this._valueMin(),f=this._valueMax(),c=f!==e?(d-e)/(f-e)*100:0,k["horizontal"===this.orientation?"left":"bottom"]=c+"%",this.handle.stop(1,1)[j?"animate":"css"](k,h.animate),"min"===g&&"horizontal"===this.orientation&&this.range.stop(1,1)[j?"animate":"css"]({"width":c+"%"},h.animate),"max"===g&&"horizontal"===this.orientation&&this.range[j?"animate":"css"]({"width":100-c+"%"},{"queue":!1,"duration":h.animate}),"min"===g&&"vertical"===this.orientation&&this.range.stop(1,1)[j?"animate":"css"]({"height":c+"%"},h.animate),"max"===g&&"vertical"===this.orientation&&this.range[j?"animate":"css"]({"height":100-c+"%"},{"queue":!1,"duration":h.animate}))
|
|
},"_handleEvents":{"keydown":function(c){var d,e,f,g,h=a(c.target).data("ui-slider-handle-index");switch(c.keyCode){case a.ui.keyCode.HOME:case a.ui.keyCode.END:case a.ui.keyCode.PAGE_UP:case a.ui.keyCode.PAGE_DOWN:case a.ui.keyCode.UP:case a.ui.keyCode.RIGHT:case a.ui.keyCode.DOWN:case a.ui.keyCode.LEFT:if(c.preventDefault(),!this._keySliding&&(this._keySliding=!0,a(c.target).addClass("ui-state-active"),d=this._start(c,h),d===!1))return}switch(g=this.options.step,e=f=this.options.values&&this.options.values.length?this.values(h):this.value(),c.keyCode){case a.ui.keyCode.HOME:f=this._valueMin();break;case a.ui.keyCode.END:f=this._valueMax();break;case a.ui.keyCode.PAGE_UP:f=this._trimAlignValue(e+(this._valueMax()-this._valueMin())/b);break;case a.ui.keyCode.PAGE_DOWN:f=this._trimAlignValue(e-(this._valueMax()-this._valueMin())/b);break;case a.ui.keyCode.UP:case a.ui.keyCode.RIGHT:if(e===this._valueMax())return;f=this._trimAlignValue(e+g);break;case a.ui.keyCode.DOWN:case a.ui.keyCode.LEFT:if(e===this._valueMin())return;f=this._trimAlignValue(e-g)}this._slide(c,h,f)},"click":function(a){a.preventDefault()},"keyup":function(b){var c=a(b.target).data("ui-slider-handle-index");this._keySliding&&(this._keySliding=!1,this._stop(b,c),this._change(b,c),a(b.target).removeClass("ui-state-active"))}}})}(jQuery),function(a){var b=0,c={},d={};c.height=c.paddingTop=c.paddingBottom=c.borderTopWidth=c.borderBottomWidth="hide",d.height=d.paddingTop=d.paddingBottom=d.borderTopWidth=d.borderBottomWidth="show",a.widget("ui.accordion",{"version":"1.10.4","options":{"active":0,"animate":{},"collapsible":!1,"event":"click","header":"> li > :first-child,> :not(li):even","heightStyle":"auto","icons":{"activeHeader":"ui-icon-triangle-1-s","header":"ui-icon-triangle-1-e"},"activate":null,"beforeActivate":null},"_create":function(){var b=this.options;this.prevShow=this.prevHide=a(),this.element.addClass("ui-accordion ui-widget ui-helper-reset").attr("role","tablist"),b.collapsible||b.active!==!1&&null!=b.active||(b.active=0),this._processPanels(),b.active<0&&(b.active+=this.headers.length),this._refresh()},"_getCreateEventData":function(){return{"header":this.active,"panel":this.active.length?this.active.next():a(),"content":this.active.length?this.active.next():a()}},"_createIcons":function(){var b=this.options.icons;b&&(a("<span>").addClass("ui-accordion-header-icon ui-icon "+b.header).prependTo(this.headers),this.active.children(".ui-accordion-header-icon").removeClass(b.header).addClass(b.activeHeader),this.headers.addClass("ui-accordion-icons"))},"_destroyIcons":function(){this.headers.removeClass("ui-accordion-icons").children(".ui-accordion-header-icon").remove()},"_destroy":function(){var a;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role"),this.headers.removeClass("ui-accordion-header ui-accordion-header-active ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-selected").removeAttr("aria-controls").removeAttr("tabIndex").each(function(){/^ui-accordion/.test(this.id)&&this.removeAttribute("id")}),this._destroyIcons(),a=this.headers.next().css("display","").removeAttr("role").removeAttr("aria-hidden").removeAttr("aria-labelledby").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-state-disabled").each(function(){/^ui-accordion/.test(this.id)&&this.removeAttribute("id")}),"content"!==this.options.heightStyle&&a.css("height","")},"_setOption":function(a,b){return"active"===a?void this._activate(b):("event"===a&&(this.options.event&&this._off(this.headers,this.options.event),this._setupEvents(b)),this._super(a,b),"collapsible"!==a||b||this.options.active!==!1||this._activate(0),"icons"===a&&(this._destroyIcons(),b&&this._createIcons()),void("disabled"===a&&this.headers.add(this.headers.next()).toggleClass("ui-state-disabled",!!b)))},"_keydown":function(b){if(!b.altKey&&!b.ctrlKey){var c=a.ui.keyCode,d=this.headers.length,e=this.headers.index(b.target),f=!1;switch(b.keyCode){case c.RIGHT:case c.DOWN:f=this.headers[(e+1)%d];break;case c.LEFT:case c.UP:f=this.headers[(e-1+d)%d];break;case c.SPACE:case c.ENTER:this._eventHandler(b);break;case c.HOME:f=this.headers[0];break;case c.END:f=this.headers[d-1]}f&&(a(b.target).attr("tabIndex",-1),a(f).attr("tabIndex",0),f.focus(),b.preventDefault())}},"_panelKeyDown":function(b){b.keyCode===a.ui.keyCode.UP&&b.ctrlKey&&a(b.currentTarget).prev().focus()},"refresh":function(){var b=this.options;this._processPanels(),b.active===!1&&b.collapsible===!0||!this.headers.length?(b.active=!1,this.active=a()):b.active===!1?this._activate(0):this.active.length&&!a.contains(this.element[0],this.active[0])?this.headers.length===this.headers.find(".ui-state-disabled").length?(b.active=!1,this.active=a()):this._activate(Math.max(0,b.active-1)):b.active=this.headers.index(this.active),this._destroyIcons(),this._refresh()},"_processPanels":function(){this.headers=this.element.find(this.options.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all"),this.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom").filter(":not(.ui-accordion-content-active)").hide()},"_refresh":function(){var c,d=this.options,e=d.heightStyle,f=this.element.parent(),g=this.accordionId="ui-accordion-"+(this.element.attr("id")||++b);this.active=this._findActive(d.active).addClass("ui-accordion-header-active ui-state-active ui-corner-top").removeClass("ui-corner-all"),this.active.next().addClass("ui-accordion-content-active").show(),this.headers.attr("role","tab").each(function(b){var c=a(this),d=c.attr("id"),e=c.next(),f=e.attr("id");d||(d=g+"-header-"+b,c.attr("id",d)),f||(f=g+"-panel-"+b,e.attr("id",f)),c.attr("aria-controls",f),e.attr("aria-labelledby",d)}).next().attr("role","tabpanel"),this.headers.not(this.active).attr({"aria-selected":"false","aria-expanded":"false","tabIndex":-1}).next().attr({"aria-hidden":"true"}).hide(),this.active.length?this.active.attr({"aria-selected":"true","aria-expanded":"true","tabIndex":0}).next().attr({"aria-hidden":"false"}):this.headers.eq(0).attr("tabIndex",0),this._createIcons(),this._setupEvents(d.event),"fill"===e?(c=f.height(),this.element.siblings(":visible").each(function(){var b=a(this),d=b.css("position");"absolute"!==d&&"fixed"!==d&&(c-=b.outerHeight(!0))}),this.headers.each(function(){c-=a(this).outerHeight(!0)}),this.headers.next().each(function(){a(this).height(Math.max(0,c-a(this).innerHeight()+a(this).height()))}).css("overflow","auto")):"auto"===e&&(c=0,this.headers.next().each(function(){c=Math.max(c,a(this).css("height","").height())}).height(c))},"_activate":function(b){var c=this._findActive(b)[0];c!==this.active[0]&&(c=c||this.active[0],this._eventHandler({"target":c,"currentTarget":c,"preventDefault":a.noop}))},"_findActive":function(b){return"number"==typeof b?this.headers.eq(b):a()},"_setupEvents":function(b){var c={"keydown":"_keydown"};b&&a.each(b.split(" "),function(a,b){c[b]="_eventHandler"}),this._off(this.headers.add(this.headers.next())),this._on(this.headers,c),this._on(this.headers.next(),{"keydown":"_panelKeyDown"}),this._hoverable(this.headers),this._focusable(this.headers)},"_eventHandler":function(b){var c=this.options,d=this.active,e=a(b.currentTarget),f=e[0]===d[0],g=f&&c.collapsible,h=g?a():e.next(),i=d.next(),j={"oldHeader":d,"oldPanel":i,"newHeader":g?a():e,"newPanel":h};b.preventDefault(),f&&!c.collapsible||this._trigger("beforeActivate",b,j)===!1||(c.active=g?!1:this.headers.index(e),this.active=f?a():e,this._toggle(j),d.removeClass("ui-accordion-header-active ui-state-active"),c.icons&&d.children(".ui-accordion-header-icon").removeClass(c.icons.activeHeader).addClass(c.icons.header),f||(e.removeClass("ui-corner-all").addClass("ui-accordion-header-active ui-state-active ui-corner-top"),c.icons&&e.children(".ui-accordion-header-icon").removeClass(c.icons.header).addClass(c.icons.activeHeader),e.next().addClass("ui-accordion-content-active")))},"_toggle":function(b){var c=b.newPanel,d=this.prevShow.length?this.prevShow:b.oldPanel;this.prevShow.add(this.prevHide).stop(!0,!0),this.prevShow=c,this.prevHide=d,this.options.animate?this._animate(c,d,b):(d.hide(),c.show(),this._toggleComplete(b)),d.attr({"aria-hidden":"true"}),d.prev().attr("aria-selected","false"),c.length&&d.length?d.prev().attr({"tabIndex":-1,"aria-expanded":"false"}):c.length&&this.headers.filter(function(){return 0===a(this).attr("tabIndex")}).attr("tabIndex",-1),c.attr("aria-hidden","false").prev().attr({"aria-selected":"true","tabIndex":0,"aria-expanded":"true"})},"_animate":function(a,b,e){var f,g,h,i=this,j=0,k=a.length&&(!b.length||a.index()<b.index()),l=this.options.animate||{},m=k&&l.down||l,n=function(){i._toggleComplete(e)};return"number"==typeof m&&(h=m),"string"==typeof m&&(g=m),g=g||m.easing||l.easing,h=h||m.duration||l.duration,b.length?a.length?(f=a.show().outerHeight(),b.animate(c,{"duration":h,"easing":g,"step":function(a,b){b.now=Math.round(a)}}),void a.hide().animate(d,{"duration":h,"easing":g,"complete":n,"step":function(a,c){c.now=Math.round(a),"height"!==c.prop?j+=c.now:"content"!==i.options.heightStyle&&(c.now=Math.round(f-b.outerHeight()-j),j=0)}})):b.animate(c,h,g,n):a.animate(d,h,g,n)},"_toggleComplete":function(a){var b=a.oldPanel;b.removeClass("ui-accordion-content-active").prev().removeClass("ui-corner-top").addClass("ui-corner-all"),b.length&&(b.parent()[0].className=b.parent()[0].className),this._trigger("activate",null,a)}})}(jQuery),function(a){a.widget("ui.menu",{"version":"1.10.4","defaultElement":"<ul>","delay":300,"options":{"icons":{"submenu":"ui-icon-carat-1-e"},"menus":"ul","position":{"my":"left top","at":"right top"},"role":"menu","blur":null,"focus":null,"select":null},"_create":function(){this.activeMenu=this.element,this.mouseHandled=!1,this.element.uniqueId().addClass("ui-menu ui-widget ui-widget-content ui-corner-all").toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length).attr({"role":this.options.role,"tabIndex":0}).bind("click"+this.eventNamespace,a.proxy(function(a){this.options.disabled&&a.preventDefault()},this)),this.options.disabled&&this.element.addClass("ui-state-disabled").attr("aria-disabled","true"),this._on({"mousedown .ui-menu-item > a":function(a){a.preventDefault()},"click .ui-state-disabled > a":function(a){a.preventDefault()},"click .ui-menu-item:has(a)":function(b){var c=a(b.target).closest(".ui-menu-item");!this.mouseHandled&&c.not(".ui-state-disabled").length&&(this.select(b),b.isPropagationStopped()||(this.mouseHandled=!0),c.has(".ui-menu").length?this.expand(b):!this.element.is(":focus")&&a(this.document[0].activeElement).closest(".ui-menu").length&&(this.element.trigger("focus",[!0]),this.active&&1===this.active.parents(".ui-menu").length&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":function(b){var c=a(b.currentTarget);c.siblings().children(".ui-state-active").removeClass("ui-state-active"),this.focus(b,c)},"mouseleave":"collapseAll","mouseleave .ui-menu":"collapseAll","focus":function(a,b){var c=this.active||this.element.children(".ui-menu-item").eq(0);b||this.focus(a,c)},"blur":function(b){this._delay(function(){a.contains(this.element[0],this.document[0].activeElement)||this.collapseAll(b)})},"keydown":"_keydown"}),this.refresh(),this._on(this.document,{"click":function(b){a(b.target).closest(".ui-menu").length||this.collapseAll(b),this.mouseHandled=!1}})},"_destroy":function(){this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeClass("ui-menu ui-widget ui-widget-content ui-corner-all ui-menu-icons").removeAttr("role").removeAttr("tabIndex").removeAttr("aria-labelledby").removeAttr("aria-expanded").removeAttr("aria-hidden").removeAttr("aria-disabled").removeUniqueId().show(),this.element.find(".ui-menu-item").removeClass("ui-menu-item").removeAttr("role").removeAttr("aria-disabled").children("a").removeUniqueId().removeClass("ui-corner-all ui-state-hover").removeAttr("tabIndex").removeAttr("role").removeAttr("aria-haspopup").children().each(function(){var b=a(this);b.data("ui-menu-submenu-carat")&&b.remove()}),this.element.find(".ui-menu-divider").removeClass("ui-menu-divider ui-widget-content")},"_keydown":function(b){function c(a){return a.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}var d,e,f,g,h,i=!0;switch(b.keyCode){case a.ui.keyCode.PAGE_UP:this.previousPage(b);break;case a.ui.keyCode.PAGE_DOWN:this.nextPage(b);break;case a.ui.keyCode.HOME:this._move("first","first",b);break;case a.ui.keyCode.END:this._move("last","last",b);break;case a.ui.keyCode.UP:this.previous(b);break;case a.ui.keyCode.DOWN:this.next(b);break;case a.ui.keyCode.LEFT:this.collapse(b);break;case a.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(b);break;case a.ui.keyCode.ENTER:case a.ui.keyCode.SPACE:this._activate(b);break;case a.ui.keyCode.ESCAPE:this.collapse(b);break;default:i=!1,e=this.previousFilter||"",f=String.fromCharCode(b.keyCode),g=!1,clearTimeout(this.filterTimer),f===e?g=!0:f=e+f,h=new RegExp("^"+c(f),"i"),d=this.activeMenu.children(".ui-menu-item").filter(function(){return h.test(a(this).children("a").text())}),d=g&&-1!==d.index(this.active.next())?this.active.nextAll(".ui-menu-item"):d,d.length||(f=String.fromCharCode(b.keyCode),h=new RegExp("^"+c(f),"i"),d=this.activeMenu.children(".ui-menu-item").filter(function(){return h.test(a(this).children("a").text())})),d.length?(this.focus(b,d),d.length>1?(this.previousFilter=f,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter):delete this.previousFilter}i&&b.preventDefault()},"_activate":function(a){this.active.is(".ui-state-disabled")||(this.active.children("a[aria-haspopup='true']").length?this.expand(a):this.select(a))},"refresh":function(){var b,c=this.options.icons.submenu,d=this.element.find(this.options.menus);this.element.toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length),d.filter(":not(.ui-menu)").addClass("ui-menu ui-widget ui-widget-content ui-corner-all").hide().attr({"role":this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var b=a(this),d=b.prev("a"),e=a("<span>").addClass("ui-menu-icon ui-icon "+c).data("ui-menu-submenu-carat",!0);d.attr("aria-haspopup","true").prepend(e),b.attr("aria-labelledby",d.attr("id"))}),b=d.add(this.element),b.children(":not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","presentation").children("a").uniqueId().addClass("ui-corner-all").attr({"tabIndex":-1,"role":this._itemRole()}),b.children(":not(.ui-menu-item)").each(function(){var b=a(this);/[^\-\u2014\u2013\s]/.test(b.text())||b.addClass("ui-widget-content ui-menu-divider")}),b.children(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!a.contains(this.element[0],this.active[0])&&this.blur()},"_itemRole":function(){return{"menu":"menuitem","listbox":"option"}[this.options.role]},"_setOption":function(a,b){"icons"===a&&this.element.find(".ui-menu-icon").removeClass(this.options.icons.submenu).addClass(b.submenu),this._super(a,b)},"focus":function(a,b){var c,d;this.blur(a,a&&"focus"===a.type),this._scrollIntoView(b),this.active=b.first(),d=this.active.children("a").addClass("ui-state-focus"),this.options.role&&this.element.attr("aria-activedescendant",d.attr("id")),this.active.parent().closest(".ui-menu-item").children("a:first").addClass("ui-state-active"),a&&"keydown"===a.type?this._close():this.timer=this._delay(function(){this._close()},this.delay),c=b.children(".ui-menu"),c.length&&a&&/^mouse/.test(a.type)&&this._startOpening(c),this.activeMenu=b.parent(),this._trigger("focus",a,{"item":b})},"_scrollIntoView":function(b){var c,d,e,f,g,h;this._hasScroll()&&(c=parseFloat(a.css(this.activeMenu[0],"borderTopWidth"))||0,d=parseFloat(a.css(this.activeMenu[0],"paddingTop"))||0,e=b.offset().top-this.activeMenu.offset().top-c-d,f=this.activeMenu.scrollTop(),g=this.activeMenu.height(),h=b.height(),0>e?this.activeMenu.scrollTop(f+e):e+h>g&&this.activeMenu.scrollTop(f+e-g+h))},"blur":function(a,b){b||clearTimeout(this.timer),this.active&&(this.active.children("a").removeClass("ui-state-focus"),this.active=null,this._trigger("blur",a,{"item":this.active}))},"_startOpening":function(a){clearTimeout(this.timer),"true"===a.attr("aria-hidden")&&(this.timer=this._delay(function(){this._close(),this._open(a)},this.delay))},"_open":function(b){var c=a.extend({"of":this.active},this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu").not(b.parents(".ui-menu")).hide().attr("aria-hidden","true"),b.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(c)},"collapseAll":function(b,c){clearTimeout(this.timer),this.timer=this._delay(function(){var d=c?this.element:a(b&&b.target).closest(this.element.find(".ui-menu"));d.length||(d=this.element),this._close(d),this.blur(b),this.activeMenu=d},this.delay)},"_close":function(a){a||(a=this.active?this.active.parent():this.element),a.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false").end().find("a.ui-state-active").removeClass("ui-state-active")},"collapse":function(a){var b=this.active&&this.active.parent().closest(".ui-menu-item",this.element);b&&b.length&&(this._close(),this.focus(a,b))},"expand":function(a){var b=this.active&&this.active.children(".ui-menu ").children(".ui-menu-item").first();b&&b.length&&(this._open(b.parent()),this._delay(function(){this.focus(a,b)}))},"next":function(a){this._move("next","first",a)},"previous":function(a){this._move("prev","last",a)},"isFirstItem":function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},"isLastItem":function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},"_move":function(a,b,c){var d;this.active&&(d="first"===a||"last"===a?this.active["first"===a?"prevAll":"nextAll"](".ui-menu-item").eq(-1):this.active[a+"All"](".ui-menu-item").eq(0)),d&&d.length&&this.active||(d=this.activeMenu.children(".ui-menu-item")[b]()),this.focus(c,d)},"nextPage":function(b){var c,d,e;return this.active?void(this.isLastItem()||(this._hasScroll()?(d=this.active.offset().top,e=this.element.height(),this.active.nextAll(".ui-menu-item").each(function(){return c=a(this),c.offset().top-d-e<0}),this.focus(b,c)):this.focus(b,this.activeMenu.children(".ui-menu-item")[this.active?"last":"first"]()))):void this.next(b)},"previousPage":function(b){var c,d,e;return this.active?void(this.isFirstItem()||(this._hasScroll()?(d=this.active.offset().top,e=this.element.height(),this.active.prevAll(".ui-menu-item").each(function(){return c=a(this),c.offset().top-d+e>0}),this.focus(b,c)):this.focus(b,this.activeMenu.children(".ui-menu-item").first()))):void this.next(b)},"_hasScroll":function(){return this.element.outerHeight()<this.element.prop("scrollHeight")},"select":function(b){this.active=this.active||a(b.target).closest(".ui-menu-item");var c={"item":this.active};this.active.has(".ui-menu").length||this.collapseAll(b,!0),this._trigger("select",b,c)}})}(jQuery),function(a){a.widget("ui.autocomplete",{"version":"1.10.4","defaultElement":"<input>","options":{"appendTo":null,"autoFocus":!1,"delay":300,"minLength":1,"position":{"my":"left top","at":"left bottom","collision":"none"},"source":null,"change":null,"close":null,"focus":null,"open":null,"response":null,"search":null,"select":null},"requestIndex":0,"pending":0,"_create":function(){var b,c,d,e=this.element[0].nodeName.toLowerCase(),f="textarea"===e,g="input"===e;this.isMultiLine=f?!0:g?!1:this.element.prop("isContentEditable"),this.valueMethod=this.element[f||g?"val":"text"],this.isNewMenu=!0,this.element.addClass("ui-autocomplete-input").attr("autocomplete","off"),this._on(this.element,{"keydown":function(e){if(this.element.prop("readOnly"))return b=!0,d=!0,void(c=!0);b=!1,d=!1,c=!1;var f=a.ui.keyCode;switch(e.keyCode){case f.PAGE_UP:b=!0,this._move("previousPage",e);break;case f.PAGE_DOWN:b=!0,this._move("nextPage",e);break;case f.UP:b=!0,this._keyEvent("previous",e);break;case f.DOWN:b=!0,this._keyEvent("next",e);break;case f.ENTER:case f.NUMPAD_ENTER:this.menu.active&&(b=!0,e.preventDefault(),this.menu.select(e));break;case f.TAB:this.menu.active&&this.menu.select(e);break;case f.ESCAPE:this.menu.element.is(":visible")&&(this._value(this.term),this.close(e),e.preventDefault());break;default:c=!0,this._searchTimeout(e)}},"keypress":function(d){if(b)return b=!1,void((!this.isMultiLine||this.menu.element.is(":visible"))&&d.preventDefault());if(!c){var e=a.ui.keyCode;switch(d.keyCode){case e.PAGE_UP:this._move("previousPage",d);break;case e.PAGE_DOWN:this._move("nextPage",d);break;case e.UP:this._keyEvent("previous",d);break;case e.DOWN:this._keyEvent("next",d)}}},"input":function(a){return d?(d=!1,void a.preventDefault()):void this._searchTimeout(a)},"focus":function(){this.selectedItem=null,this.previous=this._value()},"blur":function(a){return this.cancelBlur?void delete this.cancelBlur:(clearTimeout(this.searching),this.close(a),void this._change(a))}}),this._initSource(),this.menu=a("<ul>").addClass("ui-autocomplete ui-front").appendTo(this._appendTo()).menu({"role":null}).hide().data("ui-menu"),this._on(this.menu.element,{"mousedown":function(b){b.preventDefault(),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur});var c=this.menu.element[0];a(b.target).closest(".ui-menu-item").length||this._delay(function(){var b=this;this.document.one("mousedown",function(d){d.target===b.element[0]||d.target===c||a.contains(c,d.target)||b.close()})})},"menufocus":function(b,c){if(this.isNewMenu&&(this.isNewMenu=!1,b.originalEvent&&/^mouse/.test(b.originalEvent.type)))return this.menu.blur(),void this.document.one("mousemove",function(){a(b.target).trigger(b.originalEvent)});var d=c.item.data("ui-autocomplete-item");!1!==this._trigger("focus",b,{"item":d})?b.originalEvent&&/^key/.test(b.originalEvent.type)&&this._value(d.value):this.liveRegion.text(d.value)},"menuselect":function(a,b){var c=b.item.data("ui-autocomplete-item"),d=this.previous;this.element[0]!==this.document[0].activeElement&&(this.element.focus(),this.previous=d,this._delay(function(){this.previous=d,this.selectedItem=c})),!1!==this._trigger("select",a,{"item":c})&&this._value(c.value),this.term=this._value(),this.close(a),this.selectedItem=c}}),this.liveRegion=a("<span>",{"role":"status","aria-live":"polite"}).addClass("ui-helper-hidden-accessible").insertBefore(this.element),this._on(this.window,{"beforeunload":function(){this.element.removeAttr("autocomplete")}})},"_destroy":function(){clearTimeout(this.searching),this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete"),this.menu.element.remove(),this.liveRegion.remove()},"_setOption":function(a,b){this._super(a,b),"source"===a&&this._initSource(),"appendTo"===a&&this.menu.element.appendTo(this._appendTo()),"disabled"===a&&b&&this.xhr&&this.xhr.abort()},"_appendTo":function(){var b=this.options.appendTo;return b&&(b=b.jquery||b.nodeType?a(b):this.document.find(b).eq(0)),b||(b=this.element.closest(".ui-front")),b.length||(b=this.document[0].body),b},"_initSource":function(){var b,c,d=this;a.isArray(this.options.source)?(b=this.options.source,this.source=function(c,d){d(a.ui.autocomplete.filter(b,c.term))}):"string"==typeof this.options.source?(c=this.options.source,this.source=function(b,e){d.xhr&&d.xhr.abort(),d.xhr=a.ajax({"url":c,"data":b,"dataType":"json","success":function(a){e(a)},"error":function(){e([])}})}):this.source=this.options.source},"_searchTimeout":function(a){clearTimeout(this.searching),this.searching=this._delay(function(){this.term!==this._value()&&(this.selectedItem=null,this.search(null,a))},this.options.delay)},"search":function(a,b){return a=null!=a?a:this._value(),this.term=this._value(),a.length<this.options.minLength?this.close(b):this._trigger("search",b)!==!1?this._search(a):void 0},"_search":function(a){this.pending++,this.element.addClass("ui-autocomplete-loading"),this.cancelSearch=!1,this.source({"term":a},this._response())},"_response":function(){var b=++this.requestIndex;return a.proxy(function(a){b===this.requestIndex&&this.__response(a),this.pending--,this.pending||this.element.removeClass("ui-autocomplete-loading")},this)},"__response":function(a){a&&(a=this._normalize(a)),this._trigger("response",null,{"content":a}),!this.options.disabled&&a&&a.length&&!this.cancelSearch?(this._suggest(a),this._trigger("open")):this._close()},"close":function(a){this.cancelSearch=!0,this._close(a)},"_close":function(a){this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.blur(),this.isNewMenu=!0,this._trigger("close",a))},"_change":function(a){this.previous!==this._value()&&this._trigger("change",a,{"item":this.selectedItem})},"_normalize":function(b){return b.length&&b[0].label&&b[0].value?b:a.map(b,function(b){return"string"==typeof b?{"label":b,"value":b}:a.extend({"label":b.label||b.value,"value":b.value||b.label},b)})},"_suggest":function(b){var c=this.menu.element.empty();this._renderMenu(c,b),this.isNewMenu=!0,this.menu.refresh(),c.show(),this._resizeMenu(),c.position(a.extend({"of":this.element},this.options.position)),this.options.autoFocus&&this.menu.next()},"_resizeMenu":function(){var a=this.menu.element;a.outerWidth(Math.max(a.width("").outerWidth()+1,this.element.outerWidth()))},"_renderMenu":function(b,c){var d=this;a.each(c,function(a,c){d._renderItemData(b,c)})},"_renderItemData":function(a,b){return this._renderItem(a,b).data("ui-autocomplete-item",b)},"_renderItem":function(b,c){return a("<li>").append(a("<a>").text(c.label)).appendTo(b)},"_move":function(a,b){return this.menu.element.is(":visible")?this.menu.isFirstItem()&&/^previous/.test(a)||this.menu.isLastItem()&&/^next/.test(a)?(this._value(this.term),void this.menu.blur()):void this.menu[a](b):void this.search(null,b)},"widget":function(){return this.menu.element},"_value":function(){return this.valueMethod.apply(this.element,arguments)},"_keyEvent":function(a,b){(!this.isMultiLine||this.menu.element.is(":visible"))&&(this._move(a,b),b.preventDefault())}}),a.extend(a.ui.autocomplete,{"escapeRegex":function(a){return a.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},"filter":function(b,c){var d=new RegExp(a.ui.autocomplete.escapeRegex(c),"i");return a.grep(b,function(a){return d.test(a.label||a.value||a)})}}),a.widget("ui.autocomplete",a.ui.autocomplete,{"options":{"messages":{"noResults":"No search results.","results":function(a){return a+(a>1?" results are":" result is")+" available, use up and down arrow keys to navigate."}}},"__response":function(a){var b;this._superApply(arguments),this.options.disabled||this.cancelSearch||(b=a&&a.length?this.options.messages.results(a.length):this.options.messages.noResults,this.liveRegion.text(b))}})}(jQuery),function(a){function b(a){return function(){var b=this.element.val();a.apply(this,arguments),this._refresh(),b!==this.element.val()&&this._trigger("change")}}a.widget("ui.spinner",{"version":"1.10.4","defaultElement":"<input>","widgetEventPrefix":"spin","options":{"culture":null,"icons":{"down":"ui-icon-triangle-1-s","up":"ui-icon-triangle-1-n"},"incremental":!0,"max":null,"min":null,"numberFormat":null,"page":10,"step":1,"change":null,"spin":null,"start":null,"stop":null},"_create":function(){this._setOption("max",this.options.max),this._setOption("min",this.options.min),this._setOption("step",this.options.step),""!==this.value()&&this._value(this.element.val(),!0),this._draw(),this._on(this._events),this._refresh(),this._on(this.window,{"beforeunload":function(){this.element.removeAttr("autocomplete")}})},"_getCreateOptions":function(){var b={},c=this.element;return a.each(["min","max","step"],function(a,d){var e=c.attr(d);void 0!==e&&e.length&&(b[d]=e)}),b},"_events":{"keydown":function(a){this._start(a)&&this._keydown(a)&&a.preventDefault()},"keyup":"_stop","focus":function(){this.previous=this.element.val()},"blur":function(a){return this.cancelBlur?void delete this.cancelBlur:(this._stop(),this._refresh(),void(this.previous!==this.element.val()&&this._trigger("change",a)))},"mousewheel":function(a,b){if(b){if(!this.spinning&&!this._start(a))return!1;this._spin((b>0?1:-1)*this.options.step,a),clearTimeout(this.mousewheelTimer),this.mousewheelTimer=this._delay(function(){this.spinning&&this._stop(a)},100),a.preventDefault()}},"mousedown .ui-spinner-button":function(b){function c(){var a=this.element[0]===this.document[0].activeElement;a||(this.element.focus(),this.previous=d,this._delay(function(){this.previous=d}))}var d;d=this.element[0]===this.document[0].activeElement?this.previous:this.element.val(),b.preventDefault(),c.call(this),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,c.call(this)}),this._start(b)!==!1&&this._repeat(null,a(b.currentTarget).hasClass("ui-spinner-up")?1:-1,b)},"mouseup .ui-spinner-button":"_stop","mouseenter .ui-spinner-button":function(b){return a(b.currentTarget).hasClass("ui-state-active")?this._start(b)===!1?!1:void this._repeat(null,a(b.currentTarget).hasClass("ui-spinner-up")?1:-1,b):void 0},"mouseleave .ui-spinner-button":"_stop"},"_draw":function(){var a=this.uiSpinner=this.element.addClass("ui-spinner-input").attr("autocomplete","off").wrap(this._uiSpinnerHtml()).parent().append(this._buttonHtml());this.element.attr("role","spinbutton"),this.buttons=a.find(".ui-spinner-button").attr("tabIndex",-1).button().removeClass("ui-corner-all"),this.buttons.height()>Math.ceil(.5*a.height())&&a.height()>0&&a.height(a.height()),this.options.disabled&&this.disable()},"_keydown":function(b){var c=this.options,d=a.ui.keyCode;switch(b.keyCode){case d.UP:return this._repeat(null,1,b),!0;case d.DOWN:return this._repeat(null,-1,b),!0;case d.PAGE_UP:return this._repeat(null,c.page,b),!0;case d.PAGE_DOWN:return this._repeat(null,-c.page,b),!0}return!1},"_uiSpinnerHtml":function(){return"<span class='ui-spinner ui-widget ui-widget-content ui-corner-all'></span>"},"_buttonHtml":function(){return"<a class='ui-spinner-button ui-spinner-up ui-corner-tr'><span class='ui-icon "+this.options.icons.up+"'>▲</span></a><a class='ui-spinner-button ui-spinner-down ui-corner-br'><span class='ui-icon "+this.options.icons.down+"'>▼</span></a>"},"_start":function(a){return this.spinning||this._trigger("start",a)!==!1?(this.counter||(this.counter=1),this.spinning=!0,!0):!1},"_repeat":function(a,b,c){a=a||500,clearTimeout(this.timer),this.timer=this._delay(function(){this._repeat(40,b,c)},a),this._spin(b*this.options.step,c)},"_spin":function(a,b){var c=this.value()||0;this.counter||(this.counter=1),c=this._adjustValue(c+a*this._increment(this.counter)),this.spinning&&this._trigger("spin",b,{"value":c})===!1||(this._value(c),this.counter++)},"_increment":function(b){var c=this.options.incremental;return c?a.isFunction(c)?c(b):Math.floor(b*b*b/5e4-b*b/500+17*b/200+1):1},"_precision":function(){var a=this._precisionOf(this.options.step);return null!==this.options.min&&(a=Math.max(a,this._precisionOf(this.options.min))),a},"_precisionOf":function(a){var b=a.toString(),c=b.indexOf(".");return-1===c?0:b.length-c-1},"_adjustValue":function(a){var b,c,d=this.options;return b=null!==d.min?d.min:0,c=a-b,c=Math.round(c/d.step)*d.step,a=b+c,a=parseFloat(a.toFixed(this._precision())),null!==d.max&&a>d.max?d.max:null!==d.min&&a<d.min?d.min:a},"_stop":function(a){this.spinning&&(clearTimeout(this.timer),clearTimeout(this.mousewheelTimer),this.counter=0,this.spinning=!1,this._trigger("stop",a))},"_setOption":function(a,b){if("culture"===a||"numberFormat"===a){var c=this._parse(this.element.val());return this.options[a]=b,void this.element.val(this._format(c))}("max"===a||"min"===a||"step"===a)&&"string"==typeof b&&(b=this._parse(b)),"icons"===a&&(this.buttons.first().find(".ui-icon").removeClass(this.options.icons.up).addClass(b.up),this.buttons.last().find(".ui-icon").removeClass(this.options.icons.down).addClass(b.down)),this._super(a,b),"disabled"===a&&(b?(this.element.prop("disabled",!0),this.buttons.button("disable")):(this.element.prop("disabled",!1),this.buttons.button("enable")))
|
|
},"_setOptions":b(function(a){this._super(a),this._value(this.element.val())}),"_parse":function(a){return"string"==typeof a&&""!==a&&(a=window.Globalize&&this.options.numberFormat?Globalize.parseFloat(a,10,this.options.culture):+a),""===a||isNaN(a)?null:a},"_format":function(a){return""===a?"":window.Globalize&&this.options.numberFormat?Globalize.format(a,this.options.numberFormat,this.options.culture):a},"_refresh":function(){this.element.attr({"aria-valuemin":this.options.min,"aria-valuemax":this.options.max,"aria-valuenow":this._parse(this.element.val())})},"_value":function(a,b){var c;""!==a&&(c=this._parse(a),null!==c&&(b||(c=this._adjustValue(c)),a=this._format(c))),this.element.val(a),this._refresh()},"_destroy":function(){this.element.removeClass("ui-spinner-input").prop("disabled",!1).removeAttr("autocomplete").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.uiSpinner.replaceWith(this.element)},"stepUp":b(function(a){this._stepUp(a)}),"_stepUp":function(a){this._start()&&(this._spin((a||1)*this.options.step),this._stop())},"stepDown":b(function(a){this._stepDown(a)}),"_stepDown":function(a){this._start()&&(this._spin((a||1)*-this.options.step),this._stop())},"pageUp":b(function(a){this._stepUp((a||1)*this.options.page)}),"pageDown":b(function(a){this._stepDown((a||1)*this.options.page)}),"value":function(a){return arguments.length?void b(this._value).call(this,a):this._parse(this.element.val())},"widget":function(){return this.uiSpinner}})}(jQuery),function(a,b){a.widget("ui.progressbar",{"version":"1.10.4","options":{"max":100,"value":0,"change":null,"complete":null},"min":0,"_create":function(){this.oldValue=this.options.value=this._constrainedValue(),this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({"role":"progressbar","aria-valuemin":this.min}),this.valueDiv=a("<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>").appendTo(this.element),this._refreshValue()},"_destroy":function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.valueDiv.remove()},"value":function(a){return a===b?this.options.value:(this.options.value=this._constrainedValue(a),void this._refreshValue())},"_constrainedValue":function(a){return a===b&&(a=this.options.value),this.indeterminate=a===!1,"number"!=typeof a&&(a=0),this.indeterminate?!1:Math.min(this.options.max,Math.max(this.min,a))},"_setOptions":function(a){var b=a.value;delete a.value,this._super(a),this.options.value=this._constrainedValue(b),this._refreshValue()},"_setOption":function(a,b){"max"===a&&(b=Math.max(this.min,b)),this._super(a,b)},"_percentage":function(){return this.indeterminate?100:100*(this.options.value-this.min)/(this.options.max-this.min)},"_refreshValue":function(){var b=this.options.value,c=this._percentage();this.valueDiv.toggle(this.indeterminate||b>this.min).toggleClass("ui-corner-right",b===this.options.max).width(c.toFixed(0)+"%"),this.element.toggleClass("ui-progressbar-indeterminate",this.indeterminate),this.indeterminate?(this.element.removeAttr("aria-valuenow"),this.overlayDiv||(this.overlayDiv=a("<div class='ui-progressbar-overlay'></div>").appendTo(this.valueDiv))):(this.element.attr({"aria-valuemax":this.options.max,"aria-valuenow":b}),this.overlayDiv&&(this.overlayDiv.remove(),this.overlayDiv=null)),this.oldValue!==b&&(this.oldValue=b,this._trigger("change")),b===this.options.max&&this._trigger("complete")}})}(jQuery),function(a,b){function c(){return++e}function d(a){return a=a.cloneNode(!1),a.hash.length>1&&decodeURIComponent(a.href.replace(f,""))===decodeURIComponent(location.href.replace(f,""))}var e=0,f=/#.*$/;a.widget("ui.tabs",{"version":"1.10.4","delay":300,"options":{"active":null,"collapsible":!1,"event":"click","heightStyle":"content","hide":null,"show":null,"activate":null,"beforeActivate":null,"beforeLoad":null,"load":null},"_create":function(){var b=this,c=this.options;this.running=!1,this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all").toggleClass("ui-tabs-collapsible",c.collapsible).delegate(".ui-tabs-nav > li","mousedown"+this.eventNamespace,function(b){a(this).is(".ui-state-disabled")&&b.preventDefault()}).delegate(".ui-tabs-anchor","focus"+this.eventNamespace,function(){a(this).closest("li").is(".ui-state-disabled")&&this.blur()}),this._processTabs(),c.active=this._initialActive(),a.isArray(c.disabled)&&(c.disabled=a.unique(c.disabled.concat(a.map(this.tabs.filter(".ui-state-disabled"),function(a){return b.tabs.index(a)}))).sort()),this.active=this.options.active!==!1&&this.anchors.length?this._findActive(c.active):a(),this._refresh(),this.active.length&&this.load(c.active)},"_initialActive":function(){var b=this.options.active,c=this.options.collapsible,d=location.hash.substring(1);return null===b&&(d&&this.tabs.each(function(c,e){return a(e).attr("aria-controls")===d?(b=c,!1):void 0}),null===b&&(b=this.tabs.index(this.tabs.filter(".ui-tabs-active"))),(null===b||-1===b)&&(b=this.tabs.length?0:!1)),b!==!1&&(b=this.tabs.index(this.tabs.eq(b)),-1===b&&(b=c?!1:0)),!c&&b===!1&&this.anchors.length&&(b=0),b},"_getCreateEventData":function(){return{"tab":this.active,"panel":this.active.length?this._getPanelForTab(this.active):a()}},"_tabKeydown":function(b){var c=a(this.document[0].activeElement).closest("li"),d=this.tabs.index(c),e=!0;if(!this._handlePageNav(b)){switch(b.keyCode){case a.ui.keyCode.RIGHT:case a.ui.keyCode.DOWN:d++;break;case a.ui.keyCode.UP:case a.ui.keyCode.LEFT:e=!1,d--;break;case a.ui.keyCode.END:d=this.anchors.length-1;break;case a.ui.keyCode.HOME:d=0;break;case a.ui.keyCode.SPACE:return b.preventDefault(),clearTimeout(this.activating),void this._activate(d);case a.ui.keyCode.ENTER:return b.preventDefault(),clearTimeout(this.activating),void this._activate(d===this.options.active?!1:d);default:return}b.preventDefault(),clearTimeout(this.activating),d=this._focusNextTab(d,e),b.ctrlKey||(c.attr("aria-selected","false"),this.tabs.eq(d).attr("aria-selected","true"),this.activating=this._delay(function(){this.option("active",d)},this.delay))}},"_panelKeydown":function(b){this._handlePageNav(b)||b.ctrlKey&&b.keyCode===a.ui.keyCode.UP&&(b.preventDefault(),this.active.focus())},"_handlePageNav":function(b){return b.altKey&&b.keyCode===a.ui.keyCode.PAGE_UP?(this._activate(this._focusNextTab(this.options.active-1,!1)),!0):b.altKey&&b.keyCode===a.ui.keyCode.PAGE_DOWN?(this._activate(this._focusNextTab(this.options.active+1,!0)),!0):void 0},"_findNextTab":function(b,c){function d(){return b>e&&(b=0),0>b&&(b=e),b}for(var e=this.tabs.length-1;-1!==a.inArray(d(),this.options.disabled);)b=c?b+1:b-1;return b},"_focusNextTab":function(a,b){return a=this._findNextTab(a,b),this.tabs.eq(a).focus(),a},"_setOption":function(a,b){return"active"===a?void this._activate(b):"disabled"===a?void this._setupDisabled(b):(this._super(a,b),"collapsible"===a&&(this.element.toggleClass("ui-tabs-collapsible",b),b||this.options.active!==!1||this._activate(0)),"event"===a&&this._setupEvents(b),void("heightStyle"===a&&this._setupHeightStyle(b)))},"_tabId":function(a){return a.attr("aria-controls")||"ui-tabs-"+c()},"_sanitizeSelector":function(a){return a?a.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):""},"refresh":function(){var b=this.options,c=this.tablist.children(":has(a[href])");b.disabled=a.map(c.filter(".ui-state-disabled"),function(a){return c.index(a)}),this._processTabs(),b.active!==!1&&this.anchors.length?this.active.length&&!a.contains(this.tablist[0],this.active[0])?this.tabs.length===b.disabled.length?(b.active=!1,this.active=a()):this._activate(this._findNextTab(Math.max(0,b.active-1),!1)):b.active=this.tabs.index(this.active):(b.active=!1,this.active=a()),this._refresh()},"_refresh":function(){this._setupDisabled(this.options.disabled),this._setupEvents(this.options.event),this._setupHeightStyle(this.options.heightStyle),this.tabs.not(this.active).attr({"aria-selected":"false","tabIndex":-1}),this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-expanded":"false","aria-hidden":"true"}),this.active.length?(this.active.addClass("ui-tabs-active ui-state-active").attr({"aria-selected":"true","tabIndex":0}),this._getPanelForTab(this.active).show().attr({"aria-expanded":"true","aria-hidden":"false"})):this.tabs.eq(0).attr("tabIndex",0)},"_processTabs":function(){var b=this;this.tablist=this._getList().addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").attr("role","tablist"),this.tabs=this.tablist.find("> li:has(a[href])").addClass("ui-state-default ui-corner-top").attr({"role":"tab","tabIndex":-1}),this.anchors=this.tabs.map(function(){return a("a",this)[0]}).addClass("ui-tabs-anchor").attr({"role":"presentation","tabIndex":-1}),this.panels=a(),this.anchors.each(function(c,e){var f,g,h,i=a(e).uniqueId().attr("id"),j=a(e).closest("li"),k=j.attr("aria-controls");d(e)?(f=e.hash,g=b.element.find(b._sanitizeSelector(f))):(h=b._tabId(j),f="#"+h,g=b.element.find(f),g.length||(g=b._createPanel(h),g.insertAfter(b.panels[c-1]||b.tablist)),g.attr("aria-live","polite")),g.length&&(b.panels=b.panels.add(g)),k&&j.data("ui-tabs-aria-controls",k),j.attr({"aria-controls":f.substring(1),"aria-labelledby":i}),g.attr("aria-labelledby",i)}),this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").attr("role","tabpanel")},"_getList":function(){return this.tablist||this.element.find("ol,ul").eq(0)},"_createPanel":function(b){return a("<div>").attr("id",b).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").data("ui-tabs-destroy",!0)},"_setupDisabled":function(b){a.isArray(b)&&(b.length?b.length===this.anchors.length&&(b=!0):b=!1);for(var c,d=0;c=this.tabs[d];d++)b===!0||-1!==a.inArray(d,b)?a(c).addClass("ui-state-disabled").attr("aria-disabled","true"):a(c).removeClass("ui-state-disabled").removeAttr("aria-disabled");this.options.disabled=b},"_setupEvents":function(b){var c={"click":function(a){a.preventDefault()}};b&&a.each(b.split(" "),function(a,b){c[b]="_eventHandler"}),this._off(this.anchors.add(this.tabs).add(this.panels)),this._on(this.anchors,c),this._on(this.tabs,{"keydown":"_tabKeydown"}),this._on(this.panels,{"keydown":"_panelKeydown"}),this._focusable(this.tabs),this._hoverable(this.tabs)},"_setupHeightStyle":function(b){var c,d=this.element.parent();"fill"===b?(c=d.height(),c-=this.element.outerHeight()-this.element.height(),this.element.siblings(":visible").each(function(){var b=a(this),d=b.css("position");"absolute"!==d&&"fixed"!==d&&(c-=b.outerHeight(!0))}),this.element.children().not(this.panels).each(function(){c-=a(this).outerHeight(!0)}),this.panels.each(function(){a(this).height(Math.max(0,c-a(this).innerHeight()+a(this).height()))}).css("overflow","auto")):"auto"===b&&(c=0,this.panels.each(function(){c=Math.max(c,a(this).height("").height())}).height(c))},"_eventHandler":function(b){var c=this.options,d=this.active,e=a(b.currentTarget),f=e.closest("li"),g=f[0]===d[0],h=g&&c.collapsible,i=h?a():this._getPanelForTab(f),j=d.length?this._getPanelForTab(d):a(),k={"oldTab":d,"oldPanel":j,"newTab":h?a():f,"newPanel":i};b.preventDefault(),f.hasClass("ui-state-disabled")||f.hasClass("ui-tabs-loading")||this.running||g&&!c.collapsible||this._trigger("beforeActivate",b,k)===!1||(c.active=h?!1:this.tabs.index(f),this.active=g?a():f,this.xhr&&this.xhr.abort(),j.length||i.length||a.error("jQuery UI Tabs: Mismatching fragment identifier."),i.length&&this.load(this.tabs.index(f),b),this._toggle(b,k))},"_toggle":function(b,c){function d(){f.running=!1,f._trigger("activate",b,c)}function e(){c.newTab.closest("li").addClass("ui-tabs-active ui-state-active"),g.length&&f.options.show?f._show(g,f.options.show,d):(g.show(),d())}var f=this,g=c.newPanel,h=c.oldPanel;this.running=!0,h.length&&this.options.hide?this._hide(h,this.options.hide,function(){c.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),e()}):(c.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),h.hide(),e()),h.attr({"aria-expanded":"false","aria-hidden":"true"}),c.oldTab.attr("aria-selected","false"),g.length&&h.length?c.oldTab.attr("tabIndex",-1):g.length&&this.tabs.filter(function(){return 0===a(this).attr("tabIndex")}).attr("tabIndex",-1),g.attr({"aria-expanded":"true","aria-hidden":"false"}),c.newTab.attr({"aria-selected":"true","tabIndex":0})},"_activate":function(b){var c,d=this._findActive(b);d[0]!==this.active[0]&&(d.length||(d=this.active),c=d.find(".ui-tabs-anchor")[0],this._eventHandler({"target":c,"currentTarget":c,"preventDefault":a.noop}))},"_findActive":function(b){return b===!1?a():this.tabs.eq(b)},"_getIndex":function(a){return"string"==typeof a&&(a=this.anchors.index(this.anchors.filter("[href$='"+a+"']"))),a},"_destroy":function(){this.xhr&&this.xhr.abort(),this.element.removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible"),this.tablist.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").removeAttr("role"),this.anchors.removeClass("ui-tabs-anchor").removeAttr("role").removeAttr("tabIndex").removeUniqueId(),this.tabs.add(this.panels).each(function(){a.data(this,"ui-tabs-destroy")?a(this).remove():a(this).removeClass("ui-state-default ui-state-active ui-state-disabled ui-corner-top ui-corner-bottom ui-widget-content ui-tabs-active ui-tabs-panel").removeAttr("tabIndex").removeAttr("aria-live").removeAttr("aria-busy").removeAttr("aria-selected").removeAttr("aria-labelledby").removeAttr("aria-hidden").removeAttr("aria-expanded").removeAttr("role")}),this.tabs.each(function(){var b=a(this),c=b.data("ui-tabs-aria-controls");c?b.attr("aria-controls",c).removeData("ui-tabs-aria-controls"):b.removeAttr("aria-controls")}),this.panels.show(),"content"!==this.options.heightStyle&&this.panels.css("height","")},"enable":function(c){var d=this.options.disabled;d!==!1&&(c===b?d=!1:(c=this._getIndex(c),d=a.isArray(d)?a.map(d,function(a){return a!==c?a:null}):a.map(this.tabs,function(a,b){return b!==c?b:null})),this._setupDisabled(d))},"disable":function(c){var d=this.options.disabled;if(d!==!0){if(c===b)d=!0;else{if(c=this._getIndex(c),-1!==a.inArray(c,d))return;d=a.isArray(d)?a.merge([c],d).sort():[c]}this._setupDisabled(d)}},"load":function(b,c){b=this._getIndex(b);var e=this,f=this.tabs.eq(b),g=f.find(".ui-tabs-anchor"),h=this._getPanelForTab(f),i={"tab":f,"panel":h};d(g[0])||(this.xhr=a.ajax(this._ajaxSettings(g,c,i)),this.xhr&&"canceled"!==this.xhr.statusText&&(f.addClass("ui-tabs-loading"),h.attr("aria-busy","true"),this.xhr.success(function(a){setTimeout(function(){h.html(a),e._trigger("load",c,i)},1)}).complete(function(a,b){setTimeout(function(){"abort"===b&&e.panels.stop(!1,!0),f.removeClass("ui-tabs-loading"),h.removeAttr("aria-busy"),a===e.xhr&&delete e.xhr},1)})))},"_ajaxSettings":function(b,c,d){var e=this;return{"url":b.attr("href"),"beforeSend":function(b,f){return e._trigger("beforeLoad",c,a.extend({"jqXHR":b,"ajaxSettings":f},d))}}},"_getPanelForTab":function(b){var c=a(b).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+c))}})}(jQuery),function(){PixelAdmin.MainNavbar=function(){return this._scroller=!1,this._wheight=null,this.scroll_pos=0,this},PixelAdmin.MainNavbar.prototype.init=function(){var a;return this.$navbar=$("#main-navbar"),this.$header=this.$navbar.find(".navbar-header"),this.$toggle=this.$navbar.find(".navbar-toggle:first"),this.$collapse=$("#main-navbar-collapse"),this.$collapse_div=this.$collapse.find("> div"),a=!1,$(window).on("pa.screen.small pa.screen.tablet",function(b){return function(){return"fixed"===b.$navbar.css("position")&&b._setupScroller(),a=!0}}(this)).on("pa.screen.desktop",function(b){return function(){return b._removeScroller(),a=!1}}(this)),this.$navbar.on("click",".nav-icon-btn.dropdown > .dropdown-toggle",function(b){return a?(b.preventDefault(),b.stopPropagation(),document.location.href=$(this).attr("href"),!1):void 0})},PixelAdmin.MainNavbar.prototype._setupScroller=function(){return this._scroller?void 0:(this._scroller=!0,this.$collapse_div.pixelSlimScroll({}),this.$navbar.on("shown.bs.collapse.mn_collapse",$.proxy(function(a){return function(){return a._updateCollapseHeight(),a._watchWindowHeight()}}(this),this)).on("hidden.bs.collapse.mn_collapse",$.proxy(function(a){return function(){return a._wheight=null,a.$collapse_div.pixelSlimScroll({"scrollTo":"0px"})}}(this),this)).on("shown.bs.dropdown.mn_collapse",$.proxy(this._updateCollapseHeight,this)).on("hidden.bs.dropdown.mn_collapse",$.proxy(this._updateCollapseHeight,this)),this._updateCollapseHeight())},PixelAdmin.MainNavbar.prototype._removeScroller=function(){return this._scroller?(this._wheight=null,this._scroller=!1,this.$collapse_div.pixelSlimScroll({"destroy":"destroy"}),this.$navbar.off("shown.bs.collapse.mn_collapse"),this.$navbar.off("hidden.bs.collapse.mn_collapse"),this.$navbar.off("shown.bs.dropdown.mn_collapse"),this.$navbar.off("hidden.bs.dropdown.mn_collapse"),this.$collapse.attr("style","")):void 0},PixelAdmin.MainNavbar.prototype._updateCollapseHeight=function(){var a,b,c;if(this._scroller)return c=$(window).innerHeight(),a=this.$header.outerHeight(),b=this.$collapse_div.scrollTop(),this.$collapse_div.css(a+this.$collapse_div.css({"max-height":"none"}).outerHeight()>c?{"max-height":c-a}:{"max-height":"none"}),this.$collapse_div.pixelSlimScroll({"scrollTo":b+"px"})},PixelAdmin.MainNavbar.prototype._watchWindowHeight=function(){var a;return this._wheight=$(window).innerHeight(),a=function(b){return function(){return null!==b._wheight?(b._wheight!==$(window).innerHeight()&&b._updateCollapseHeight(),b._wheight=$(window).innerHeight(),setTimeout(a,100)):void 0}}(this),window.setTimeout(a,100)},PixelAdmin.MainNavbar.Constructor=PixelAdmin.MainNavbar,PixelAdmin.addInitializer(function(){return PixelAdmin.initPlugin("main_navbar",new PixelAdmin.MainNavbar)})}.call(this),function(){PixelAdmin.MainMenu=function(){return this._screen=null,this._last_screen=null,this._animate=!1,this._close_timer=null,this._dropdown_li=null,this._dropdown=null,this},PixelAdmin.MainMenu.prototype.init=function(){var a,b;return this.$menu=$("#main-menu"),this.$menu.length?(this.$body=$("body"),this.menu=this.$menu[0],this.$ssw_point=$("#small-screen-width-point"),this.$tsw_point=$("#tablet-screen-width-point"),a=this,PixelAdmin.settings.main_menu.store_state&&(b=this._getMenuState(),document.body.className+=" disable-mm-animation",null!==b&&this.$body["collapsed"===b?"addClass":"removeClass"]("mmc"),setTimeout(function(){return function(){return elRemoveClass(document.body,"disable-mm-animation")}}(this),20)),this.setupAnimation(),$(window).on("resize.pa.mm",$.proxy(this.onResize,this)),this.onResize(),this.$menu.find(".navigation > .mm-dropdown").addClass("mm-dropdown-root"),PixelAdmin.settings.main_menu.detect_active&&this.detectActiveItem(),$.support.transition&&this.$menu.on("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd",$.proxy(this._onAnimationEnd,this)),$("#main-menu-toggle").on("click",$.proxy(this.toggle,this)),$("#main-menu-inner").slimScroll({"height":"100%"}).on("slimscrolling",function(a){return function(){return a.closeCurrentDropdown(!0)}}(this)),this.$menu.on("click",".mm-dropdown > a",function(){var b;return b=this.parentNode,elHasClass(b,"mm-dropdown-root")&&a._collapsed()?elHasClass(b,"mmc-dropdown-open")?elHasClass(b,"freeze")?a.closeCurrentDropdown(!0):a.freezeDropdown(b):a.openDropdown(b,!0):a.toggleSubmenu(b),!1}),this.$menu.find(".navigation").on("mouseenter.pa.mm-dropdown",".mm-dropdown-root",function(){return a.clearCloseTimer(),a._dropdown_li!==this?!a._collapsed()||a._dropdown_li&&elHasClass(a._dropdown_li,"freeze")?void 0:a.openDropdown(this):void 0}).on("mouseleave.pa.mm-dropdown",".mm-dropdown-root",function(){return a._close_timer=setTimeout(function(){return a.closeCurrentDropdown()},PixelAdmin.settings.main_menu.dropdown_close_delay)}),this):void 0},PixelAdmin.MainMenu.prototype._collapsed=function(){return"desktop"===this._screen&&elHasClass(document.body,"mmc")||"desktop"!==this._screen&&!elHasClass(document.body,"mme")},PixelAdmin.MainMenu.prototype.onResize=function(){return this._screen=getScreenSize(this.$ssw_point,this.$tsw_point),this._animate=-1===PixelAdmin.settings.main_menu.disable_animation_on.indexOf(screen),this._dropdown_li&&this.closeCurrentDropdown(!0),("small"===this._screen&&this._last_screen!==this._screen||"tablet"===this._screen&&"small"===this._last_screen)&&(document.body.className+=" disable-mm-animation",setTimeout(function(){return function(){return elRemoveClass(document.body,"disable-mm-animation")}}(this),20)),this._last_screen=this._screen},PixelAdmin.MainMenu.prototype.clearCloseTimer=function(){return this._close_timer?(clearTimeout(this._close_timer),this._close_timer=null):void 0},PixelAdmin.MainMenu.prototype._onAnimationEnd=function(a){return"desktop"===this._screen&&"main-menu"===a.target.id?$(window).trigger("resize"):void 0},PixelAdmin.MainMenu.prototype.toggle=function(){var a,b;return a="small"===this._screen||"tablet"===this._screen?"mme":"mmc",elHasClass(document.body,a)?elRemoveClass(document.body,a):document.body.className+=" "+a,"mmc"!==a?(b=document.getElementById(""),$("#main-navbar-collapse").stop().removeClass("in collapsing").addClass("collapse")[0].style.height="0px",$("#main-navbar .navbar-toggle").addClass("collapsed")):(PixelAdmin.settings.main_menu.store_state&&this._storeMenuState(elHasClass(document.body,"mmc")),$.support.transition?void 0:$(window).trigger("resize"))},PixelAdmin.MainMenu.prototype.toggleSubmenu=function(a){return this[elHasClass(a,"open")?"collapseSubmenu":"expandSubmenu"](a),!1},PixelAdmin.MainMenu.prototype.collapseSubmenu=function(a){var b,c;return b=$(a),c=b.find("> ul"),this._animate?c.animate({"height":0},PixelAdmin.settings.main_menu.animation_speed,function(){return function(){return elRemoveClass(a,"open"),c.attr("style",""),b.find(".mm-dropdown.open").removeClass("open").find("> ul").attr("style","")}}(this)):elRemoveClass(a,"open"),!1},PixelAdmin.MainMenu.prototype.expandSubmenu=function(a){var b,c,d,e;return b=$(a),PixelAdmin.settings.main_menu.accordion&&this.collapseAllSubmenus(a),this._animate?(c=b.find("> ul"),e=c[0],e.className+=" get-height",d=c.height(),elRemoveClass(e,"get-height"),e.style.display="block",e.style.height="0px",a.className+=" open",c.animate({"height":d},PixelAdmin.settings.main_menu.animation_speed,function(){return function(){return c.attr("style","")}}(this))):a.className+=" open"},PixelAdmin.MainMenu.prototype.collapseAllSubmenus=function(a){var b;return b=this,$(a).parent().find("> .mm-dropdown.open").each(function(){return b.collapseSubmenu(this)})},PixelAdmin.MainMenu.prototype.openDropdown=function(a,b){var c,d,e,f,g,h,i,j,k,l,m;return null==b&&(b=!1),this._dropdown_li&&this.closeCurrentDropdown(b),c=$(a),e=c.find("> ul"),k=e[0],this._dropdown_li=a,this._dropdown=k,d=e.find("> .mmc-title"),d.length||(d=$('<div class="mmc-title"></div>').text(c.find("> a > .mm-text").text()),k.insertBefore(d[0],k.firstChild)),a.className+=" mmc-dropdown-open",k.className+=" mmc-dropdown-open-ul",j=c.position().top,elHasClass(document.body,"main-menu-fixed")?(f=e.find(".mmc-wrapper"),f.length||(m=document.createElement("div"),m.className="mmc-wrapper",m.style.overflow="hidden",m.style.position="relative",f=$(m),f.append(e.find("> li")),k.appendChild(m)),l=$(window).innerHeight(),i=d.outerHeight(),h=i+3*e.find(".mmc-wrapper > li").first().outerHeight(),j+h>l?(g=j-$("#main-navbar").outerHeight(),k.className+=" top",k.style.bottom=l-j-i+"px"):(g=l-j-i,k.style.top=j+"px"),elHasClass(k,"top")?k.appendChild(d[0]):k.insertBefore(d[0],k.firstChild),a.className+=" slimscroll-attached",f[0].style.maxHeight=g-10+"px",f.pixelSlimScroll({})):k.style.top=j+"px",b&&this.freezeDropdown(a),b||e.on("mouseenter",function(a){return function(){return a.clearCloseTimer()}}(this)).on("mouseleave",function(a){return function(){return a._close_timer=setTimeout(function(){return a.closeCurrentDropdown()},PixelAdmin.settings.main_menu.dropdown_close_delay)}}(this)),this.menu.appendChild(k)},PixelAdmin.MainMenu.prototype.closeCurrentDropdown=function(a){var b,c;return null==a&&(a=!1),!this._dropdown_li||elHasClass(this._dropdown_li,"freeze")&&!a?void 0:(this.clearCloseTimer(),b=$(this._dropdown),elHasClass(this._dropdown_li,"slimscroll-attached")&&(elRemoveClass(this._dropdown_li,"slimscroll-attached"),c=b.find(".mmc-wrapper"),c.pixelSlimScroll({"destroy":"destroy"}).find("> *").appendTo(b),c.remove()),this._dropdown_li.appendChild(this._dropdown),elRemoveClass(this._dropdown,"mmc-dropdown-open-ul"),elRemoveClass(this._dropdown,"top"),elRemoveClass(this._dropdown_li,"mmc-dropdown-open"),elRemoveClass(this._dropdown_li,"freeze"),$(this._dropdown_li).attr("style",""),b.attr("style","").off("mouseenter").off("mouseleave"),this._dropdown=null,this._dropdown_li=null)},PixelAdmin.MainMenu.prototype.freezeDropdown=function(a){return a.className+=" freeze"},PixelAdmin.MainMenu.prototype.setupAnimation=function(){var a,b,c,d;return c=document.body,d=PixelAdmin.settings.main_menu.disable_animation_on,c.className+=" dont-animate-mm-content",a=$("#main-menu"),b=a.find(".navigation"),b.find("> .mm-dropdown > ul").addClass("mmc-dropdown-delay animated"),b.find("> li > a > .mm-text").addClass("mmc-dropdown-delay animated fadeIn"),a.find(".menu-content").addClass("animated fadeIn"),b.find("> .mm-dropdown > ul").addClass(elHasClass(c,"main-menu-right")||elHasClass(c,"right-to-left")&&!elHasClass(c,"main-menu-right")?"fadeInRight":"fadeInLeft"),c.className+=-1===d.indexOf("small")?" animate-mm-sm":" dont-animate-mm-content-sm",c.className+=-1===d.indexOf("tablet")?" animate-mm-md":" dont-animate-mm-content-md",c.className+=-1===d.indexOf("desktop")?" animate-mm-lg":" dont-animate-mm-content-lg",window.setTimeout(function(){return elRemoveClass(c,"dont-animate-mm-content")},500)},PixelAdmin.MainMenu.prototype.detectActiveItem=function(){var a,b,c,d,e,f,g,h,i;for(f=(document.location+"").replace(/\#.*?$/,""),e=PixelAdmin.settings.main_menu.detect_active_predicate,d=$("#main-menu .navigation"),d.find("li").removeClass("open active"),c=d[0].getElementsByTagName("a"),b=function(){return function(a){return a.className+=" active",elHasClass(a.parentNode,"navigation")?void 0:(a=a.parentNode.parentNode,a.className+=" open",b(a))}}(this),i=[],g=0,h=c.length;h>g;g++){if(a=c[g],-1===a.href.indexOf("#")&&e(a.href,f)){b(a.parentNode);break}i.push(void 0)}return i},PixelAdmin.MainMenu.prototype._getMenuState=function(){return PixelAdmin.getStoredValue(PixelAdmin.settings.main_menu.store_state_key,null)},PixelAdmin.MainMenu.prototype._storeMenuState=function(a){return PixelAdmin.settings.main_menu.store_state?PixelAdmin.storeValue(PixelAdmin.settings.main_menu.store_state_key,a?"collapsed":"expanded"):void 0},PixelAdmin.MainMenu.Constructor=PixelAdmin.MainMenu,PixelAdmin.addInitializer(function(){return PixelAdmin.initPlugin("main_menu",new PixelAdmin.MainMenu)})}.call(this),function(){var a,b;a="pa-page-alerts-box",b=function(){return this},b.DEFAULTS={"type":"warning","close_btn":!0,"classes":!1,"namespace":"pa_page_alerts","animate":!0,"auto_close":!1},b.TYPES_HASH={"warning":"","danger":"alert-danger","success":"alert-success","info":"alert-info"},b.prototype.init=function(){var b;return b=this,$("#main-wrapper").on("click.pa.alerts","#"+a+" .close",function(){return b.close($(this).parents(".alert")),!1})},b.prototype.add=function(c,d){var e,f,g,h,i,j;return d=$.extend({},b.DEFAULTS,d||{}),e=$('<div class="alert alert-page '+d.namespace+" "+b.TYPES_HASH[d.type]+'" />').html(c),d.classes&&e.addClass(d.classes),d.close_btn&&e.prepend($('<button type="button" class="close" />').html("×")),d.animate&&e.attr("data-animate","true"),g=$("#"+a),g.length||(g=$('<div id="'+a+'" />').prependTo($("#content-wrapper"))),f=$("#"+a+" ."+d.namespace),h=e.css({"visibility":"hidden","position":"absolute","width":"100%"}).appendTo("body").outerHeight(),j=e.css("padding-top"),i=e.css("padding-bottom"),d.animate&&e.attr("style","").css({"overflow":"hidden","height":0,"padding-top":0,"padding-bottom":0}),f.length?f.last().after(e):g.append(e),d.animate?e.animate({"height":h,"padding-top":j,"padding-bottom":i},500,function(a){return function(){return e.attr("style",""),d.auto_close?$.data(e,"timer",setTimeout(function(){return a.close(e)},1e3*d.auto_close)):void 0}}(this)):e.attr("style","")},b.prototype.close=function(a){return"true"===a.attr("data-animate")?a.animate({"height":0,"padding-top":0,"padding-bottom":0},500,function(){return $.data(a,"timer")&&clearTimeout($.data(a,"timer")),a.remove()}):($.data(a,"timer")&&clearTimeout($.data(a,"timer")),a.remove())},b.prototype.clear=function(b,c){var d,e;return null==b&&(b=!0),null==c&&(c="pa_page_alerts"),d=$("#"+a+" ."+c),d.length?(e=this,b?d.each(function(){return e.close($(this))}):d.remove()):void 0},b.prototype.clearAll=function(b){var c;return null==b&&(b=!0),b?(c=this,$("#"+a+" .alert").each(function(){return c.close($(this))})):$("#"+a).remove()},b.prototype.getContainerId=function(){return a},b.Constructor=b,PixelAdmin.addInitializer(function(){return PixelAdmin.initPlugin("alerts",new b)})}.call(this),function(){var a;a=function(b,c){var d;return null==c&&(c={}),this.options=$.extend({},a.DEFAULTS,c),this.$checkbox=null,this.$box=null,b.is('input[type="checkbox"]')?(d=b.attr("data-class"),this.$checkbox=b,this.$box=$('<div class="switcher"><div class="switcher-toggler"></div><div class="switcher-inner"><div class="switcher-state-on">'+this.options.on_state_content+'</div><div class="switcher-state-off">'+this.options.off_state_content+"</div></div></div>"),this.options.theme&&this.$box.addClass("switcher-theme-"+this.options.theme),d&&this.$box.addClass(d),this.$box.insertAfter(this.$checkbox).prepend(this.$checkbox)):(this.$box=b,this.$checkbox=$('input[type="checkbox"]',this.$box)),this.$checkbox.prop("disabled")&&this.$box.addClass("disabled"),this.$checkbox.is(":checked")&&this.$box.addClass("checked"),this.$checkbox.on("click",function(a){return a.stopPropagation()}),this.$box.on("touchend click",function(a){return function(b){return b.stopPropagation(),b.preventDefault(),a.toggle()}}(this)),this},a.prototype.enable=function(){return this.$checkbox.prop("disabled",!1),this.$box.removeClass("disabled")},a.prototype.disable=function(){return this.$checkbox.prop("disabled",!0),this.$box.addClass("disabled")},a.prototype.on=function(){return this.$checkbox.is(":checked")?void 0:(this.$checkbox.click(),this.$box.addClass("checked"))},a.prototype.off=function(){return this.$checkbox.is(":checked")?(this.$checkbox.click(),this.$box.removeClass("checked")):void 0},a.prototype.toggle=function(){return this.$checkbox.click().is(":checked")?this.$box.addClass("checked"):this.$box.removeClass("checked")},a.DEFAULTS={"theme":null,"on_state_content":"ON","off_state_content":"OFF"},$.fn.switcher=function(b){return $(this).each(function(){var c,d;return c=$(this),d=$.data(this,"Switcher"),d?"enable"===b?d.enable():"disable"===b?d.disable():"on"===b?d.on():"off"===b?d.off():"toggle"===b?d.toggle():void 0:$.data(this,"Switcher",new a(c,b))})},$.fn.switcher.Constructor=a}.call(this),function(){var a;a=function(b,c,d){return null==d&&(d={}),this.limit=c,this.$el=b,this.options=$.extend({},a.DEFAULTS,d||{}),this.$label=this.options.label&&$(this.options.label).length?$(".limiter-count",this.options.label):null,this.textarea=this.$el.is("textarea"),this.textarea||this.$el.attr("maxlength",this.limit),this.$el.on("keyup focus",$.proxy(this.updateCounter,this)),this.updateCounter()},a.prototype.updateCounter=function(){var a,b;return b=this.textarea?this.$el[0].value.replace(/\r?\n/g,"\n"):this.$el.val(),a=b.length,a>this.limit&&(this.$el.val(b.substr(0,this.limit)),a=this.limit),this.$label?this.$label.html(this.limit-a):void 0
|
|
},a.DEFAULTS={"label":null},$.fn.limiter=function(b,c){return this.each(function(){var d;return d=$(this),d.attr("data-limiter")?void 0:$.data(d,"limiter",new a(d,b,c))})},$.fn.limiter.Constructor=a}.call(this),function(){var a;a=function(b,c){return null==c&&(c={}),this.options=$.extend({},a.DEFAULTS,c||{}),this.$container=b,this.$target=this.options.target&&this.$container.find(this.options.target).length?this.$container.find(this.options.target):null,this.$content=this.options.hidden_content&&this.$container.find(this.options.hidden_content).length?this.$container.find(this.options.hidden_content):null,this.$container.addClass("expanding-input"),this.$target&&(this.$target.addClass("expanding-input-target"),this.$target.hasClass("input-sm")&&this.$container.addClass("expanding-input-sm"),this.$target.hasClass("input-lg")&&this.$container.addClass("expanding-input-lg")),this.$content&&this.$content.addClass("expanding-input-content"),this.$overlay=$('<div class="expanding-input-overlay"></div>').appendTo(this.$container),this.$target&&this.$target.attr("placeholder")&&(this.options.placeholder||(this.options.placeholder=this.$target.attr("placeholder")),this.$target.attr("placeholder","")),this.options.placeholder&&this.$overlay.append($('<div class="expanding-input-placeholder"></div>').html(this.options.placeholder)),this.$target&&this.$target.on("focus",$.proxy(this.expand,this)),this.$overlay.on("click.expanding_input",$.proxy(this.expand,this))},a.prototype.expand=function(){return this.$container.hasClass("expanded")?void 0:(this.options.onBeforeExpand&&this.options.onBeforeExpand.call(this),this.$overlay.remove(),this.$container.addClass("expanded"),this.$target&&setTimeout(function(a){return function(){return a.$target.focus()}}(this),1),this.$target&&this.options.placeholder&&this.$target.attr("placeholder",$("<div>"+this.options.placeholder+"</div>").text()),this.options.onAfterExpand?this.options.onAfterExpand.call(this):void 0)},a.DEFAULTS={"target":null,"hidden_content":null,"placeholder":null,"onBeforeExpand":null,"onAfterExpand":null},$.fn.expandingInput=function(b){return this.each(function(){var c;return c=$(this),c.attr("data-expandingInput")?void 0:$.data(c,"expandingInput",new a(c,b))})},$.fn.expandingInput.Constructor=a}.call(this),function(){var a,b;b=function(a,b){return a.css({"width":b,"max-width":b,"min-width":b})},a=function(b,c){var d,e;return null==c&&(c={}),this.options=$.extend({},a.DEFAULTS,c||{}),this.$element=b,this.$wrapper=$(".wizard-wrapper",this.$element),this.$steps=$(".wizard-steps",this.$wrapper),this.$step_items=$("> li",this.$steps),this.steps_count=this.$step_items.length,this.$content=$(".wizard-content",this.$element),this.current_step=null,this.$current_item=null,this.isFreeze=!1,this.isRtl=$("body").hasClass("right-to-left"),this.resizeStepItems(),d=$("> li.active",this.$steps),0===d.length&&(d=$("> li:first-child",this.$steps)),this.$current_item=d.addClass("active"),this.current_step=d.index()+1,$(d.attr("data-target"),this.$content).css({"display":"block"}),this.placeStepItems(),this._setPrevItemStates(this.current_step-1),$(window).on("pa.resize.wizard",function(a){return function(){return $.proxy(a.resizeStepItems,a)(),$.proxy(a.placeStepItems,a)()}}(this)),e=this,this.$steps.on("click","> li",function(){var a;return a=$(this),a.hasClass("completed")?e.setCurrentStep(a.index()+1):void 0}),this},a.DEFAULTS={"step_item_min_width":200,"onChange":null,"onFinish":null},a.prototype.resizeStepItems=function(){var c;return c=this.$element.width()>a.DEFAULTS.step_item_min_width*this.$step_items.length?Math.floor(this.$element.width()/this.$step_items.length):a.DEFAULTS.step_item_min_width,this.$step_items.each(function(){return b($(this),c)})},a.prototype.placeStepItems=function(){var a,b,c,d,e,f,g;return f=0,d=this.$current_item.position(),c=this.$element.outerWidth(),g=this.$steps.outerWidth(),a=this.$current_item.outerWidth(),b=(c-a)/2,this.isRtl?(e=g-d.left-a,g>c&&e>b&&(f=-1*e+b,c>g+f&&(f=-1*g+c)),this.$steps.css({"right":f})):(g>c&&d.left>b&&(f=-1*d.left+b,c>g+f&&(f=-1*g+c)),this.$steps.css({"left":f}))},a.prototype.setCurrentStep=function(a){return this.isFreeze?void 0:$(this.$current_item.attr("data-target"),this.$content).css({"opacity":1}).animate({"opacity":0},200,function(b){return function(){return $(b.$current_item.attr("data-target"),b.$content).attr("style",""),b._clearItemStates(a-1),b.$current_item=b.$step_items.eq(a-1).addClass("active"),b.current_step=a,b._setPrevItemStates(a-1),$(b.$current_item.attr("data-target"),b.$content).css({"display":"block","opacity":0}).animate({"opacity":1},200,function(){return b.options.onChange&&$.proxy(b.options.onChange,b)(),b.placeStepItems()})}}(this))},a.prototype.nextStep=function(){return this.isFreeze?void 0:this.current_step>=this.steps_count?void(this.options.onFinish&&$.proxy(this.options.onFinish,this)()):(this.$current_item.removeClass("active").addClass("completed"),this.setCurrentStep(this.current_step+1))},a.prototype.prevStep=function(){return this.isFreeze||this.current_step<=1?void 0:this.setCurrentStep(this.current_step-1)},a.prototype.currentStep=function(){return this.current_step},a.prototype._clearItemStates=function(a){var b,c,d,e;for(e=[],b=c=a,d=this.steps_count;d>=a?d>c:c>d;b=d>=a?++c:--c)e.push(this.$step_items.eq(b).removeClass("active").removeClass("completed"));return e},a.prototype._setPrevItemStates=function(a){var b,c,d;for(d=[],b=c=0;a>=0?a>c:c>a;b=a>=0?++c:--c)d.push(this.$step_items.eq(b).addClass("completed"));return d},a.prototype.freeze=function(){return this.isFreeze=!0,this.$element.addClass("freeze")},a.prototype.unfreeze=function(){return this.isFreeze=!1,this.$element.removeClass("freeze")},$.fn.pixelWizard=function(b,c){var d,e;return e=void 0,d=this.each(function(){var d,f;if(d=$(this),!$.data(this,"pixelWizard"))return $.data(this,"pixelWizard",new a(d,b));if(b&&"string"==typeof b){if(f=$.data(this,"pixelWizard"),"setCurrentStep"===b)return f.setCurrentStep(c);if("currentStep"===b)return e=f.currentStep();if("nextStep"===b)return f.nextStep();if("prevStep"===b)return f.prevStep();if("freeze"===b)return f.freeze();if("unfreeze"===b)return f.unfreeze();if("resizeSteps"===b)return f.resizeStepItems()}}),void 0===e?d:e},$.fn.pixelWizard.Constructor=a}.call(this),function(){var a;a=function(b,c){return null==c&&(c={}),this.options=$.extend({},a.DEFAULTS,c||{}),this.$input=b,this.$el=$('<div class="pixel-file-input"><span class="pfi-filename"></span><div class="pfi-actions"></div></div>').insertAfter(b).append(b),this.$filename=$(".pfi-filename",this.$el),this.$clear_btn=$(this.options.clear_btn_tmpl).addClass("pfi-clear").appendTo($(".pfi-actions",this.$el)),this.$choose_btn=$(this.options.choose_btn_tmpl).addClass("pfi-choose").appendTo($(".pfi-actions",this.$el)),this.onChange(),b.on("change",function(a){return function(){return $.proxy(a.onChange,a)()}}(this)).on("click",function(a){return a.stopPropagation()}),this.$el.on("click",function(){return b.click()}),this.$choose_btn.on("click",function(a){return a.preventDefault()}),this.$clear_btn.on("click",function(a){return function(c){return b.wrap("<form>").parent("form").trigger("reset"),b.unwrap(),$.proxy(a.onChange,a)(),c.stopPropagation(),c.preventDefault()}}(this))},a.DEFAULTS={"choose_btn_tmpl":'<a href="#" class="btn btn-xs btn-primary">Choose</a>',"clear_btn_tmpl":'<a href="#" class="btn btn-xs"><i class="fa fa-times"></i> Clear</a>',"placeholder":null},a.prototype.onChange=function(){var a;return a=this.$input.val().replace(/\\/g,"/"),""!==a?(this.$clear_btn.css("display","inline-block"),this.$filename.removeClass("pfi-placeholder"),this.$filename.text(a.split("/").pop())):(this.$clear_btn.css("display","none"),this.options.placeholder?(this.$filename.addClass("pfi-placeholder"),this.$filename.text(this.options.placeholder)):this.$filename.text(""))},$.fn.pixelFileInput=function(b){return this.each(function(){return $.data(this,"pixelFileInput")?void 0:$.data(this,"pixelFileInput",new a($(this),b))})},$.fn.pixelFileInput.Constructor=a}.call(this),function(){var a;a=function(b,c){var d;return null==c&&(c={}),this.$el=b,this.options=$.extend({},a.DEFAULTS,c),d=this,b.on("click",".task input[type=checkbox]",function(){return d.completeTask($(this))}).on("click",".task a",function(){return $(this).parents(".task").find("input[type=checkbox]").click(),!1}),this},a.prototype.completeTask=function(a){var b;return b=a.parents(".task"),b.toggleClass("completed").hasClass("completed")?this.options.onComplete.call(this):this.options.onCancel.call(this)},a.prototype.clearCompletedTasks=function(){return $(".completed",this.$el).hide(200,function(){return $(this).remove()}),this.options.onClear.call(this)},a.DEFAULTS={"onComplete":function(){},"onCancel":function(){},"onClear":function(){}},$.fn.pixelTasks=function(b){return $(this).each(function(){var c,d;return c=$(this),d=$.data(this,"pixelTasks"),d?"clearCompletedTasks"===b?d.clearCompletedTasks():void 0:$.data(this,"pixelTasks",new a(c,b))})},$.fn.pixelTasks.Constructor=a}.call(this),function(){var a;a=function(b,c){var d,e,f,g;for(null==c&&(c={}),this.options=$.extend({},a.DEFAULTS,c),this.$container=$('<ul class="widget-rating"></ul>'),d=f=0,g=this.options.stars_count;g>=0?g>f:f>g;d=g>=0?++f:--f)this.$container.append($('<li><a href="#" title="" class="widget-rating-item"></a></li>'));return b.append(this.$container),e=this,this.$container.find("a").on("mouseenter",function(){return e.$container.find("li").removeClass(e.options.class_active),$(this).parents("li").addClass(e.options.class_active).prevAll("li").addClass(e.options.class_active)}).on("mouseleave",function(){return e.setRating(e.options.rating)}).on("click",function(){return e.options.onRatingChange.call(e,$(this).parents("li").prevAll("li").length+1),!1}),this.setRating(this.options.rating),this},a.prototype.setRating=function(a){return this.options.rating=a,a=a-Math.floor(a)>this.options.lower_limit?Math.ceil(a):Math.floor(a),this.$container.find("li").removeClass(this.options.class_active).slice(0,a).addClass(this.options.class_active)},a.DEFAULTS={"stars_count":5,"rating":0,"class_active":"active","lower_limit":.35,"onRatingChange":function(){}},$.fn.pixelRating=function(b,c){return $(this).each(function(){var d,e;return d=$(this),e=$.data(this,"pixelRating"),e?"setRating"===b?e.setRating(c):void 0:$.data(this,"pixelRating",new a(d,b))})},$.fn.pixelRating.Constructor=a}.call(this),function(a){jQuery.fn.extend({"pixelSlimScroll":function(b){var c={"width":"auto","size":"2px","color":"#000","distance":"1px","start":"top","opacity":.4,"railColor":"#333","railOpacity":.2,"railClass":"slimScrollRail","barClass":"slimScrollBar","wrapperClass":"slimScrollDiv","allowPageScroll":!1,"wheelStep":20,"touchScrollStep":200,"borderRadius":"0px","railBorderRadius":"0px"},d=a.extend(c,b);return this.each(function(){function c(b){if(j){var b=b||window.event,c=0;b.wheelDelta&&(c=-b.wheelDelta/120),b.detail&&(c=b.detail/3);var f=b.target||b.srcTarget||b.srcElement;a(f).closest("."+d.wrapperClass).is(v.parent())&&e(c,!0),b.preventDefault&&!u&&b.preventDefault(),u||(b.returnValue=!1)}}function e(a,b,c){u=!1;var e=a,f=v.outerHeight()-z.outerHeight();if(b&&(e=parseInt(z.css("top"))+a*parseInt(d.wheelStep)/100*z.outerHeight(),e=Math.min(Math.max(e,0),f),e=a>0?Math.ceil(e):Math.floor(e),z.css({"top":e+"px"})),p=parseInt(z.css("top"))/(v.outerHeight()-z.outerHeight()),e=p*(v[0].scrollHeight-v.outerHeight()),c){e=a;var g=e/v[0].scrollHeight*v.outerHeight();g=Math.min(Math.max(g,0),f),z.css({"top":g+"px"})}v.scrollTop(e),v.trigger("slimscrolling",~~e),h(),i()}function f(){window.addEventListener?(this.addEventListener("DOMMouseScroll",c,!1),this.addEventListener("mousewheel",c,!1)):document.attachEvent("onmousewheel",c)}function g(){o=Math.max(v.outerHeight()/v[0].scrollHeight*v.outerHeight(),s),z.css({"height":o+"px"});var a=o==v.outerHeight()?"none":"block";z.css({"display":a})}function h(){if(g(),clearTimeout(m),p==~~p){if(u=d.allowPageScroll,q!=p){var a=0==~~p?"top":"bottom";v.trigger("slimscroll",a)}}else u=!1;return q=p,o>=v.outerHeight()?void(u=!0):void z.stop(!0,!0).fadeIn("fast")}function i(){}var j,k,l,m,n,o,p,q,r="<div></div>",s=30,u=!1,v=a(this);if(v.parent().hasClass(d.wrapperClass)){var w=v.scrollTop();if(z=v.parent().find("."+d.barClass),y=v.parent().find("."+d.railClass),g(),a.isPlainObject(b)){if("scrollTo"in b)w=parseInt(d.scrollTo);else if("scrollBy"in b)w+=parseInt(d.scrollBy);else if("destroy"in b)return z.remove(),y.remove(),void v.unwrap();e(w,!1,!0)}}else{var x=a(r).addClass(d.wrapperClass).css({"position":"relative","overflow":"hidden","width":d.width});v.css({"overflow":"hidden","width":d.width});var y=a(r).addClass(d.railClass).css({"width":d.size,"height":"100%","position":"absolute","top":0,"display":"none","border-radius":d.railBorderRadius,"background":d.railColor,"opacity":d.railOpacity,"zIndex":90}),z=a(r).addClass(d.barClass).css({"background":d.color,"width":d.size,"position":"absolute","top":0,"opacity":d.opacity,"display":"block","border-radius":d.borderRadius,"BorderRadius":d.borderRadius,"MozBorderRadius":d.borderRadius,"WebkitBorderRadius":d.borderRadius,"zIndex":99});y.css({"right":d.distance}),z.css({"right":d.distance}),v.wrap(x),v.parent().append(z),v.parent().append(y),z.bind("mousedown",function(b){var c=a(document);return l=!0,t=parseFloat(z.css("top")),pageY=b.pageY,c.bind("mousemove.slimscroll",function(a){currTop=t+a.pageY-pageY,z.css("top",currTop),e(0,z.position().top,!1)}),c.bind("mouseup.slimscroll",function(){l=!1,i(),c.unbind(".slimscroll")}),!1}).bind("selectstart.slimscroll",function(a){return a.stopPropagation(),a.preventDefault(),!1}),y.hover(function(){h()},function(){i()}),z.hover(function(){k=!0},function(){k=!1}),v.hover(function(){j=!0,h(),i()},function(){j=!1,i()}),v.bind("touchstart",function(a){a.originalEvent.touches.length&&(n=a.originalEvent.touches[0].pageY)}),v.bind("touchmove",function(a){if(u||a.originalEvent.preventDefault(),a.originalEvent.touches.length){var b=(n-a.originalEvent.touches[0].pageY)/d.touchScrollStep;e(b,!0),n=a.originalEvent.touches[0].pageY}}),g(),f()}}),this}}),jQuery.fn.extend({"pixelslimscroll":jQuery.fn.pixelSlimScroll})}(jQuery),function(a,b){function c(){return new Date(Date.UTC.apply(Date,arguments))}function d(){var a=new Date;return c(a.getFullYear(),a.getMonth(),a.getDate())}function e(a){return function(){return this[a].apply(this,arguments)}}function f(b,c){function d(a,b){return b.toLowerCase()}var e,f=a(b).data(),g={},h=new RegExp("^"+c.toLowerCase()+"([A-Z])");c=new RegExp("^"+c.toLowerCase());for(var i in f)c.test(i)&&(e=i.replace(h,d),g[e]=f[i]);return g}function g(b){var c={};if(o[b]||(b=b.split("-")[0],o[b])){var d=o[b];return a.each(n,function(a,b){b in d&&(c[b]=d[b])}),c}}var h=a(window),i=function(){var b={"get":function(a){return this.slice(a)[0]},"contains":function(a){for(var b=a&&a.valueOf(),c=0,d=this.length;d>c;c++)if(this[c].valueOf()===b)return c;return-1},"remove":function(a){this.splice(a,1)},"replace":function(b){b&&(a.isArray(b)||(b=[b]),this.clear(),this.push.apply(this,b))},"clear":function(){this.splice(0)},"copy":function(){var a=new i;return a.replace(this),a}};return function(){var c=[];return c.push.apply(c,arguments),a.extend(c,b),c}}(),j=function(b,c){this.dates=new i,this.viewDate=d(),this.focusDate=null,this._process_options(c),this.element=a(b),this.isInline=!1,this.isInput=this.element.is("input"),this.component=this.element.is(".date")?this.element.find(".add-on, .input-group-addon, .btn"):!1,this.hasInput=this.component&&this.element.find("input").length,this.component&&0===this.component.length&&(this.component=!1),this.picker=a(p.template),this._buildEvents(),this._attachEvents(),this.isInline?this.picker.addClass("datepicker-inline").appendTo(this.element):this.picker.addClass("datepicker-dropdown dropdown-menu"),this.o.rtl&&this.picker.addClass("datepicker-rtl"),this.viewMode=this.o.startView,this.o.calendarWeeks&&this.picker.find("tfoot th.today").attr("colspan",function(a,b){return parseInt(b)+1}),this._allow_update=!1,this.setStartDate(this._o.startDate),this.setEndDate(this._o.endDate),this.setDaysOfWeekDisabled(this.o.daysOfWeekDisabled),this.fillDow(),this.fillMonths(),this._allow_update=!0,this.update(),this.showMode(),this.isInline&&this.show()};j.prototype={"constructor":j,"_process_options":function(b){this._o=a.extend({},this._o,b);var c=this.o=a.extend({},this._o),d=c.language;switch(o[d]||(d=d.split("-")[0],o[d]||(d=m.language)),c.language=d,c.startView){case 2:case"decade":c.startView=2;break;case 1:case"year":c.startView=1;break;default:c.startView=0}switch(c.minViewMode){case 1:case"months":c.minViewMode=1;break;case 2:case"years":c.minViewMode=2;break;default:c.minViewMode=0}c.startView=Math.max(c.startView,c.minViewMode),c.multidate!==!0&&(c.multidate=Number(c.multidate)||!1,c.multidate=c.multidate!==!1?Math.max(0,c.multidate):1),c.multidateSeparator=String(c.multidateSeparator),c.weekStart%=7,c.weekEnd=(c.weekStart+6)%7;var e=p.parseFormat(c.format);c.startDate!==-1/0&&(c.startDate=c.startDate?c.startDate instanceof Date?this._local_to_utc(this._zero_time(c.startDate)):p.parseDate(c.startDate,e,c.language):-1/0),1/0!==c.endDate&&(c.endDate=c.endDate?c.endDate instanceof Date?this._local_to_utc(this._zero_time(c.endDate)):p.parseDate(c.endDate,e,c.language):1/0),c.daysOfWeekDisabled=c.daysOfWeekDisabled||[],a.isArray(c.daysOfWeekDisabled)||(c.daysOfWeekDisabled=c.daysOfWeekDisabled.split(/[,\s]*/)),c.daysOfWeekDisabled=a.map(c.daysOfWeekDisabled,function(a){return parseInt(a,10)});var f=String(c.orientation).toLowerCase().split(/\s+/g),g=c.orientation.toLowerCase();if(f=a.grep(f,function(a){return/^auto|left|right|top|bottom$/.test(a)}),c.orientation={"x":"auto","y":"auto"},g&&"auto"!==g)if(1===f.length)switch(f[0]){case"top":case"bottom":c.orientation.y=f[0];break;case"left":case"right":c.orientation.x=f[0]}else g=a.grep(f,function(a){return/^left|right$/.test(a)}),c.orientation.x=g[0]||"auto",g=a.grep(f,function(a){return/^top|bottom$/.test(a)}),c.orientation.y=g[0]||"auto";else;},"_events":[],"_secondaryEvents":[],"_applyEvents":function(a){for(var c,d,e,f=0;f<a.length;f++)c=a[f][0],2===a[f].length?(d=b,e=a[f][1]):3===a[f].length&&(d=a[f][1],e=a[f][2]),c.on(e,d)},"_unapplyEvents":function(a){for(var c,d,e,f=0;f<a.length;f++)c=a[f][0],2===a[f].length?(e=b,d=a[f][1]):3===a[f].length&&(e=a[f][1],d=a[f][2]),c.off(d,e)},"_buildEvents":function(){this.isInput?this._events=[[this.element,{"focus":a.proxy(this.show,this),"keyup":a.proxy(function(b){-1===a.inArray(b.keyCode,[27,37,39,38,40,32,13,9])&&this.update()},this),"keydown":a.proxy(this.keydown,this)}]]:this.component&&this.hasInput?this._events=[[this.element.find("input"),{"focus":a.proxy(this.show,this),"keyup":a.proxy(function(b){-1===a.inArray(b.keyCode,[27,37,39,38,40,32,13,9])&&this.update()},this),"keydown":a.proxy(this.keydown,this)}],[this.component,{"click":a.proxy(this.show,this)}]]:this.element.is("div")?this.isInline=!0:this._events=[[this.element,{"click":a.proxy(this.show,this)}]],this._events.push([this.element,"*",{"blur":a.proxy(function(a){this._focused_from=a.target},this)}],[this.element,{"blur":a.proxy(function(a){this._focused_from=a.target},this)}]),this._secondaryEvents=[[this.picker,{"click":a.proxy(this.click,this)}],[a(window),{"resize":a.proxy(this.place,this)}],[a(document),{"mousedown touchstart":a.proxy(function(a){this.element.is(a.target)||this.element.find(a.target).length||this.picker.is(a.target)||this.picker.find(a.target).length||this.hide()},this)}]]},"_attachEvents":function(){this._detachEvents(),this._applyEvents(this._events)},"_detachEvents":function(){this._unapplyEvents(this._events)},"_attachSecondaryEvents":function(){this._detachSecondaryEvents(),this._applyEvents(this._secondaryEvents)},"_detachSecondaryEvents":function(){this._unapplyEvents(this._secondaryEvents)},"_trigger":function(b,c){var d=c||this.dates.get(-1),e=this._utc_to_local(d);this.element.trigger({"type":b,"date":e,"dates":a.map(this.dates,this._utc_to_local),"format":a.proxy(function(a,b){0===arguments.length?(a=this.dates.length-1,b=this.o.format):"string"==typeof a&&(b=a,a=this.dates.length-1),b=b||this.o.format;var c=this.dates.get(a);return p.formatDate(c,b,this.o.language)},this)})},"show":function(){this.isInline||this.picker.appendTo("body"),this.picker.show(),this.place(),this._attachSecondaryEvents(),this._trigger("show")},"hide":function(){this.isInline||this.picker.is(":visible")&&(this.focusDate=null,this.picker.hide().detach(),this._detachSecondaryEvents(),this.viewMode=this.o.startView,this.showMode(),this.o.forceParse&&(this.isInput&&this.element.val()||this.hasInput&&this.element.find("input").val())&&this.setValue(),this._trigger("hide"))},"remove":function(){this.hide(),this._detachEvents(),this._detachSecondaryEvents(),this.picker.remove(),delete this.element.data().datepicker,this.isInput||delete this.element.data().date},"_utc_to_local":function(a){return a&&new Date(a.getTime()+6e4*a.getTimezoneOffset())},"_local_to_utc":function(a){return a&&new Date(a.getTime()-6e4*a.getTimezoneOffset())},"_zero_time":function(a){return a&&new Date(a.getFullYear(),a.getMonth(),a.getDate())},"_zero_utc_time":function(a){return a&&new Date(Date.UTC(a.getUTCFullYear(),a.getUTCMonth(),a.getUTCDate()))},"getDates":function(){return a.map(this.dates,this._utc_to_local)},"getUTCDates":function(){return a.map(this.dates,function(a){return new Date(a)})},"getDate":function(){return this._utc_to_local(this.getUTCDate())},"getUTCDate":function(){return new Date(this.dates.get(-1))},"setDates":function(){var b=a.isArray(arguments[0])?arguments[0]:arguments;this.update.apply(this,b),this._trigger("changeDate"),this.setValue()},"setUTCDates":function(){var b=a.isArray(arguments[0])?arguments[0]:arguments;this.update.apply(this,a.map(b,this._utc_to_local)),this._trigger("changeDate"),this.setValue()},"setDate":e("setDates"),"setUTCDate":e("setUTCDates"),"setValue":function(){var a=this.getFormattedDate();this.isInput?this.element.val(a).change():this.component&&this.element.find("input").val(a).change()},"getFormattedDate":function(c){c===b&&(c=this.o.format);var d=this.o.language;return a.map(this.dates,function(a){return p.formatDate(a,c,d)}).join(this.o.multidateSeparator)},"setStartDate":function(a){this._process_options({"startDate":a}),this.update(),this.updateNavArrows()},"setEndDate":function(a){this._process_options({"endDate":a}),this.update(),this.updateNavArrows()},"setDaysOfWeekDisabled":function(a){this._process_options({"daysOfWeekDisabled":a}),this.update(),this.updateNavArrows()},"place":function(){if(!this.isInline){var b=this.picker.outerWidth(),c=this.picker.outerHeight(),d=10,e=h.width(),f=h.height(),g=h.scrollTop(),i=parseInt(this.element.parents().filter(function(){return"auto"!==a(this).css("z-index")}).first().css("z-index"))+10,j=this.component?this.component.parent().offset():this.element.offset(),k=this.component?this.component.outerHeight(!0):this.element.outerHeight(!1),l=this.component?this.component.outerWidth(!0):this.element.outerWidth(!1),m=j.left,n=j.top;this.picker.removeClass("datepicker-orient-top datepicker-orient-bottom datepicker-orient-right datepicker-orient-left"),"auto"!==this.o.orientation.x?(this.picker.addClass("datepicker-orient-"+this.o.orientation.x),"right"===this.o.orientation.x&&(m-=b-l)):(this.picker.addClass("datepicker-orient-left"),j.left<0?m-=j.left-d:j.left+b>e&&(m=e-b-d));var o,p,q=this.o.orientation.y;"auto"===q&&(o=-g+j.top-c,p=g+f-(j.top+k+c),q=Math.max(o,p)===p?"top":"bottom"),this.picker.addClass("datepicker-orient-"+q),"top"===q?n+=k:n-=c+parseInt(this.picker.css("padding-top")),this.picker.css({"top":n,"left":m,"zIndex":i})}},"_allow_update":!0,"update":function(){if(this._allow_update){var b=this.dates.copy(),c=[],d=!1;arguments.length?(a.each(arguments,a.proxy(function(a,b){b instanceof Date&&(b=this._local_to_utc(b)),c.push(b)},this)),d=!0):(c=this.isInput?this.element.val():this.element.data("date")||this.element.find("input").val(),c=c&&this.o.multidate?c.split(this.o.multidateSeparator):[c],delete this.element.data().date),c=a.map(c,a.proxy(function(a){return p.parseDate(a,this.o.format,this.o.language)},this)),c=a.grep(c,a.proxy(function(a){return a<this.o.startDate||a>this.o.endDate||!a},this),!0),this.dates.replace(c),this.dates.length?this.viewDate=new Date(this.dates.get(-1)):this.viewDate<this.o.startDate?this.viewDate=new Date(this.o.startDate):this.viewDate>this.o.endDate&&(this.viewDate=new Date(this.o.endDate)),d?this.setValue():c.length&&String(b)!==String(this.dates)&&this._trigger("changeDate"),!this.dates.length&&b.length&&this._trigger("clearDate"),this.fill()}},"fillDow":function(){var a=this.o.weekStart,b="<tr>";if(this.o.calendarWeeks){var c='<th class="cw"> </th>';b+=c,this.picker.find(".datepicker-days thead tr:first-child").prepend(c)}for(;a<this.o.weekStart+7;)b+='<th class="dow">'+o[this.o.language].daysMin[a++%7]+"</th>";b+="</tr>",this.picker.find(".datepicker-days thead").append(b)},"fillMonths":function(){for(var a="",b=0;12>b;)a+='<span class="month">'+o[this.o.language].monthsShort[b++]+"</span>";this.picker.find(".datepicker-months td").html(a)},"setRange":function(b){b&&b.length?this.range=a.map(b,function(a){return a.valueOf()}):delete this.range,this.fill()},"getClassNames":function(b){var c=[],d=this.viewDate.getUTCFullYear(),e=this.viewDate.getUTCMonth(),f=new Date;return b.getUTCFullYear()<d||b.getUTCFullYear()===d&&b.getUTCMonth()<e?c.push("old"):(b.getUTCFullYear()>d||b.getUTCFullYear()===d&&b.getUTCMonth()>e)&&c.push("new"),this.focusDate&&b.valueOf()===this.focusDate.valueOf()&&c.push("focused"),this.o.todayHighlight&&b.getUTCFullYear()===f.getFullYear()&&b.getUTCMonth()===f.getMonth()&&b.getUTCDate()===f.getDate()&&c.push("today"),-1!==this.dates.contains(b)&&c.push("active"),(b.valueOf()<this.o.startDate||b.valueOf()>this.o.endDate||-1!==a.inArray(b.getUTCDay(),this.o.daysOfWeekDisabled))&&c.push("disabled"),this.range&&(b>this.range[0]&&b<this.range[this.range.length-1]&&c.push("range"),-1!==a.inArray(b.valueOf(),this.range)&&c.push("selected")),c},"fill":function(){var d,e=new Date(this.viewDate),f=e.getUTCFullYear(),g=e.getUTCMonth(),h=this.o.startDate!==-1/0?this.o.startDate.getUTCFullYear():-1/0,i=this.o.startDate!==-1/0?this.o.startDate.getUTCMonth():-1/0,j=1/0!==this.o.endDate?this.o.endDate.getUTCFullYear():1/0,k=1/0!==this.o.endDate?this.o.endDate.getUTCMonth():1/0,l=o[this.o.language].today||o.en.today||"",m=o[this.o.language].clear||o.en.clear||"";this.picker.find(".datepicker-days thead th.datepicker-switch").text(o[this.o.language].months[g]+" "+f),this.picker.find("tfoot th.today").text(l).toggle(this.o.todayBtn!==!1),this.picker.find("tfoot th.clear").text(m).toggle(this.o.clearBtn!==!1),this.updateNavArrows(),this.fillMonths();var n=c(f,g-1,28),q=p.getDaysInMonth(n.getUTCFullYear(),n.getUTCMonth());n.setUTCDate(q),n.setUTCDate(q-(n.getUTCDay()-this.o.weekStart+7)%7);var r=new Date(n);r.setUTCDate(r.getUTCDate()+42),r=r.valueOf();for(var s,t=[];n.valueOf()<r;){if(n.getUTCDay()===this.o.weekStart&&(t.push("<tr>"),this.o.calendarWeeks)){var u=new Date(+n+(this.o.weekStart-n.getUTCDay()-7)%7*864e5),v=new Date(Number(u)+(11-u.getUTCDay())%7*864e5),w=new Date(Number(w=c(v.getUTCFullYear(),0,1))+(11-w.getUTCDay())%7*864e5),x=(v-w)/864e5/7+1;t.push('<td class="cw">'+x+"</td>")}if(s=this.getClassNames(n),s.push("day"),this.o.beforeShowDay!==a.noop){var y=this.o.beforeShowDay(this._utc_to_local(n));y===b?y={}:"boolean"==typeof y?y={"enabled":y}:"string"==typeof y&&(y={"classes":y}),y.enabled===!1&&s.push("disabled"),y.classes&&(s=s.concat(y.classes.split(/\s+/))),y.tooltip&&(d=y.tooltip)}s=a.unique(s),t.push('<td class="'+s.join(" ")+'"'+(d?' title="'+d+'"':"")+">"+n.getUTCDate()+"</td>"),n.getUTCDay()===this.o.weekEnd&&t.push("</tr>"),n.setUTCDate(n.getUTCDate()+1)}this.picker.find(".datepicker-days tbody").empty().append(t.join(""));var z=this.picker.find(".datepicker-months").find("th:eq(1)").text(f).end().find("span").removeClass("active");a.each(this.dates,function(a,b){b.getUTCFullYear()===f&&z.eq(b.getUTCMonth()).addClass("active")}),(h>f||f>j)&&z.addClass("disabled"),f===h&&z.slice(0,i).addClass("disabled"),f===j&&z.slice(k+1).addClass("disabled"),t="",f=10*parseInt(f/10,10);var A=this.picker.find(".datepicker-years").find("th:eq(1)").text(f+"-"+(f+9)).end().find("td");f-=1;for(var B,C=a.map(this.dates,function(a){return a.getUTCFullYear()}),D=-1;11>D;D++)B=["year"],-1===D?B.push("old"):10===D&&B.push("new"),-1!==a.inArray(f,C)&&B.push("active"),(h>f||f>j)&&B.push("disabled"),t+='<span class="'+B.join(" ")+'">'+f+"</span>",f+=1;A.html(t)},"updateNavArrows":function(){if(this._allow_update){var a=new Date(this.viewDate),b=a.getUTCFullYear(),c=a.getUTCMonth();switch(this.viewMode){case 0:this.picker.find(".prev").css(this.o.startDate!==-1/0&&b<=this.o.startDate.getUTCFullYear()&&c<=this.o.startDate.getUTCMonth()?{"visibility":"hidden"}:{"visibility":"visible"}),this.picker.find(".next").css(1/0!==this.o.endDate&&b>=this.o.endDate.getUTCFullYear()&&c>=this.o.endDate.getUTCMonth()?{"visibility":"hidden"}:{"visibility":"visible"});break;case 1:case 2:this.picker.find(".prev").css(this.o.startDate!==-1/0&&b<=this.o.startDate.getUTCFullYear()?{"visibility":"hidden"}:{"visibility":"visible"}),this.picker.find(".next").css(1/0!==this.o.endDate&&b>=this.o.endDate.getUTCFullYear()?{"visibility":"hidden"}:{"visibility":"visible"})}}},"click":function(b){b.preventDefault();var d,e,f,g=a(b.target).closest("span, td, th");if(1===g.length)switch(g[0].nodeName.toLowerCase()){case"th":switch(g[0].className){case"datepicker-switch":this.showMode(1);break;case"prev":case"next":var h=p.modes[this.viewMode].navStep*("prev"===g[0].className?-1:1);switch(this.viewMode){case 0:this.viewDate=this.moveMonth(this.viewDate,h),this._trigger("changeMonth",this.viewDate);break;case 1:case 2:this.viewDate=this.moveYear(this.viewDate,h),1===this.viewMode&&this._trigger("changeYear",this.viewDate)}this.fill();break;case"today":var i=new Date;i=c(i.getFullYear(),i.getMonth(),i.getDate(),0,0,0),this.showMode(-2);var j="linked"===this.o.todayBtn?null:"view";this._setDate(i,j);break;case"clear":var k;this.isInput?k=this.element:this.component&&(k=this.element.find("input")),k&&k.val("").change(),this.update(),this._trigger("changeDate"),this.o.autoclose&&this.hide()}break;case"span":g.is(".disabled")||(this.viewDate.setUTCDate(1),g.is(".month")?(f=1,e=g.parent().find("span").index(g),d=this.viewDate.getUTCFullYear(),this.viewDate.setUTCMonth(e),this._trigger("changeMonth",this.viewDate),1===this.o.minViewMode&&this._setDate(c(d,e,f))):(f=1,e=0,d=parseInt(g.text(),10)||0,this.viewDate.setUTCFullYear(d),this._trigger("changeYear",this.viewDate),2===this.o.minViewMode&&this._setDate(c(d,e,f))),this.showMode(-1),this.fill());break;case"td":g.is(".day")&&!g.is(".disabled")&&(f=parseInt(g.text(),10)||1,d=this.viewDate.getUTCFullYear(),e=this.viewDate.getUTCMonth(),g.is(".old")?0===e?(e=11,d-=1):e-=1:g.is(".new")&&(11===e?(e=0,d+=1):e+=1),this._setDate(c(d,e,f)))}this.picker.is(":visible")&&this._focused_from&&a(this._focused_from).focus(),delete this._focused_from},"_toggle_multidate":function(a){var b=this.dates.contains(a);if(a?-1!==b?this.dates.remove(b):this.dates.push(a):this.dates.clear(),"number"==typeof this.o.multidate)for(;this.dates.length>this.o.multidate;)this.dates.remove(0)},"_setDate":function(a,b){b&&"date"!==b||this._toggle_multidate(a&&new Date(a)),b&&"view"!==b||(this.viewDate=a&&new Date(a)),this.fill(),this.setValue(),this._trigger("changeDate");var c;this.isInput?c=this.element:this.component&&(c=this.element.find("input")),c&&c.change(),!this.o.autoclose||b&&"date"!==b||this.hide()},"moveMonth":function(a,c){if(!a)return b;if(!c)return a;var d,e,f=new Date(a.valueOf()),g=f.getUTCDate(),h=f.getUTCMonth(),i=Math.abs(c);
|
|
if(c=c>0?1:-1,1===i)e=-1===c?function(){return f.getUTCMonth()===h}:function(){return f.getUTCMonth()!==d},d=h+c,f.setUTCMonth(d),(0>d||d>11)&&(d=(d+12)%12);else{for(var j=0;i>j;j++)f=this.moveMonth(f,c);d=f.getUTCMonth(),f.setUTCDate(g),e=function(){return d!==f.getUTCMonth()}}for(;e();)f.setUTCDate(--g),f.setUTCMonth(d);return f},"moveYear":function(a,b){return this.moveMonth(a,12*b)},"dateWithinRange":function(a){return a>=this.o.startDate&&a<=this.o.endDate},"keydown":function(a){if(this.picker.is(":not(:visible)"))return void(27===a.keyCode&&this.show());var b,c,e,f=!1,g=this.focusDate||this.viewDate;switch(a.keyCode){case 27:this.focusDate?(this.focusDate=null,this.viewDate=this.dates.get(-1)||this.viewDate,this.fill()):this.hide(),a.preventDefault();break;case 37:case 39:if(!this.o.keyboardNavigation)break;b=37===a.keyCode?-1:1,a.ctrlKey?(c=this.moveYear(this.dates.get(-1)||d(),b),e=this.moveYear(g,b),this._trigger("changeYear",this.viewDate)):a.shiftKey?(c=this.moveMonth(this.dates.get(-1)||d(),b),e=this.moveMonth(g,b),this._trigger("changeMonth",this.viewDate)):(c=new Date(this.dates.get(-1)||d()),c.setUTCDate(c.getUTCDate()+b),e=new Date(g),e.setUTCDate(g.getUTCDate()+b)),this.dateWithinRange(c)&&(this.focusDate=this.viewDate=e,this.setValue(),this.fill(),a.preventDefault());break;case 38:case 40:if(!this.o.keyboardNavigation)break;b=38===a.keyCode?-1:1,a.ctrlKey?(c=this.moveYear(this.dates.get(-1)||d(),b),e=this.moveYear(g,b),this._trigger("changeYear",this.viewDate)):a.shiftKey?(c=this.moveMonth(this.dates.get(-1)||d(),b),e=this.moveMonth(g,b),this._trigger("changeMonth",this.viewDate)):(c=new Date(this.dates.get(-1)||d()),c.setUTCDate(c.getUTCDate()+7*b),e=new Date(g),e.setUTCDate(g.getUTCDate()+7*b)),this.dateWithinRange(c)&&(this.focusDate=this.viewDate=e,this.setValue(),this.fill(),a.preventDefault());break;case 32:break;case 13:g=this.focusDate||this.dates.get(-1)||this.viewDate,this._toggle_multidate(g),f=!0,this.focusDate=null,this.viewDate=this.dates.get(-1)||this.viewDate,this.setValue(),this.fill(),this.picker.is(":visible")&&(a.preventDefault(),this.o.autoclose&&this.hide());break;case 9:this.focusDate=null,this.viewDate=this.dates.get(-1)||this.viewDate,this.fill(),this.hide()}if(f){this._trigger(this.dates.length?"changeDate":"clearDate");var h;this.isInput?h=this.element:this.component&&(h=this.element.find("input")),h&&h.change()}},"showMode":function(a){a&&(this.viewMode=Math.max(this.o.minViewMode,Math.min(2,this.viewMode+a))),this.picker.find(">div").hide().filter(".datepicker-"+p.modes[this.viewMode].clsName).css("display","block"),this.updateNavArrows()}};var k=function(b,c){this.element=a(b),this.inputs=a.map(c.inputs,function(a){return a.jquery?a[0]:a}),delete c.inputs,a(this.inputs).datepicker(c).bind("changeDate",a.proxy(this.dateUpdated,this)),this.pickers=a.map(this.inputs,function(b){return a(b).data("datepicker")}),this.updateDates()};k.prototype={"updateDates":function(){this.dates=a.map(this.pickers,function(a){return a.getUTCDate()}),this.updateRanges()},"updateRanges":function(){var b=a.map(this.dates,function(a){return a.valueOf()});a.each(this.pickers,function(a,c){c.setRange(b)})},"dateUpdated":function(b){if(!this.updating){this.updating=!0;var c=a(b.target).data("datepicker"),d=c.getUTCDate(),e=a.inArray(b.target,this.inputs),f=this.inputs.length;if(-1!==e){if(a.each(this.pickers,function(a,b){b.getUTCDate()||b.setUTCDate(d)}),d<this.dates[e])for(;e>=0&&d<this.dates[e];)this.pickers[e--].setUTCDate(d);else if(d>this.dates[e])for(;f>e&&d>this.dates[e];)this.pickers[e++].setUTCDate(d);this.updateDates(),delete this.updating}}},"remove":function(){a.map(this.pickers,function(a){a.remove()}),delete this.element.data().datepicker}};var l=a.fn.datepicker;a.fn.datepicker=function(c){var d=Array.apply(null,arguments);d.shift();var e;return this.each(function(){var h=a(this),i=h.data("datepicker"),l="object"==typeof c&&c;if(!i){var n=f(this,"date"),o=a.extend({},m,n,l),p=g(o.language),q=a.extend({},m,p,n,l);if(h.is(".input-daterange")||q.inputs){var r={"inputs":q.inputs||h.find("input").toArray()};h.data("datepicker",i=new k(this,a.extend(q,r)))}else h.data("datepicker",i=new j(this,q))}return"string"==typeof c&&"function"==typeof i[c]&&(e=i[c].apply(i,d),e!==b)?!1:void 0}),e!==b?e:this};var m=a.fn.datepicker.defaults={"autoclose":!1,"beforeShowDay":a.noop,"calendarWeeks":!1,"clearBtn":!1,"daysOfWeekDisabled":[],"endDate":1/0,"forceParse":!0,"format":"mm/dd/yyyy","keyboardNavigation":!0,"language":"en","minViewMode":0,"multidate":!1,"multidateSeparator":",","orientation":"auto","rtl":!1,"startDate":-1/0,"startView":0,"todayBtn":!1,"todayHighlight":!1,"weekStart":0},n=a.fn.datepicker.locale_opts=["format","rtl","weekStart"];a.fn.datepicker.Constructor=j;var o=a.fn.datepicker.dates={"en":{"days":["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],"daysShort":["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sun"],"daysMin":["Su","Mo","Tu","We","Th","Fr","Sa","Su"],"months":["January","February","March","April","May","June","July","August","September","October","November","December"],"monthsShort":["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],"today":"Today","clear":"Clear"}},p={"modes":[{"clsName":"days","navFnc":"Month","navStep":1},{"clsName":"months","navFnc":"FullYear","navStep":1},{"clsName":"years","navFnc":"FullYear","navStep":10}],"isLeapYear":function(a){return a%4===0&&a%100!==0||a%400===0},"getDaysInMonth":function(a,b){return[31,p.isLeapYear(a)?29:28,31,30,31,30,31,31,30,31,30,31][b]},"validParts":/dd?|DD?|mm?|MM?|yy(?:yy)?/g,"nonpunctuation":/[^ -\/:-@\[\u3400-\u9fff-`{-~\t\n\r]+/g,"parseFormat":function(a){var b=a.replace(this.validParts,"\x00").split("\x00"),c=a.match(this.validParts);if(!b||!b.length||!c||0===c.length)throw new Error("Invalid date format.");return{"separators":b,"parts":c}},"parseDate":function(d,e,f){function g(){var a=this.slice(0,m[k].length),b=m[k].slice(0,a.length);return a===b}if(!d)return b;if(d instanceof Date)return d;"string"==typeof e&&(e=p.parseFormat(e));var h,i,k,l=/([\-+]\d+)([dmwy])/,m=d.match(/([\-+]\d+)([dmwy])/g);if(/^[\-+]\d+[dmwy]([\s,]+[\-+]\d+[dmwy])*$/.test(d)){for(d=new Date,k=0;k<m.length;k++)switch(h=l.exec(m[k]),i=parseInt(h[1]),h[2]){case"d":d.setUTCDate(d.getUTCDate()+i);break;case"m":d=j.prototype.moveMonth.call(j.prototype,d,i);break;case"w":d.setUTCDate(d.getUTCDate()+7*i);break;case"y":d=j.prototype.moveYear.call(j.prototype,d,i)}return c(d.getUTCFullYear(),d.getUTCMonth(),d.getUTCDate(),0,0,0)}m=d&&d.match(this.nonpunctuation)||[],d=new Date;var n,q,r={},s=["yyyy","yy","M","MM","m","mm","d","dd"],t={"yyyy":function(a,b){return a.setUTCFullYear(b)},"yy":function(a,b){return a.setUTCFullYear(2e3+b)},"m":function(a,b){if(isNaN(a))return a;for(b-=1;0>b;)b+=12;for(b%=12,a.setUTCMonth(b);a.getUTCMonth()!==b;)a.setUTCDate(a.getUTCDate()-1);return a},"d":function(a,b){return a.setUTCDate(b)}};t.M=t.MM=t.mm=t.m,t.dd=t.d,d=c(d.getFullYear(),d.getMonth(),d.getDate(),0,0,0);var u=e.parts.slice();if(m.length!==u.length&&(u=a(u).filter(function(b,c){return-1!==a.inArray(c,s)}).toArray()),m.length===u.length){var v;for(k=0,v=u.length;v>k;k++){if(n=parseInt(m[k],10),h=u[k],isNaN(n))switch(h){case"MM":q=a(o[f].months).filter(g),n=a.inArray(q[0],o[f].months)+1;break;case"M":q=a(o[f].monthsShort).filter(g),n=a.inArray(q[0],o[f].monthsShort)+1}r[h]=n}var w,x;for(k=0;k<s.length;k++)x=s[k],x in r&&!isNaN(r[x])&&(w=new Date(d),t[x](w,r[x]),isNaN(w)||(d=w))}return d},"formatDate":function(b,c,d){if(!b)return"";"string"==typeof c&&(c=p.parseFormat(c));var e={"d":b.getUTCDate(),"D":o[d].daysShort[b.getUTCDay()],"DD":o[d].days[b.getUTCDay()],"m":b.getUTCMonth()+1,"M":o[d].monthsShort[b.getUTCMonth()],"MM":o[d].months[b.getUTCMonth()],"yy":b.getUTCFullYear().toString().substring(2),"yyyy":b.getUTCFullYear()};e.dd=(e.d<10?"0":"")+e.d,e.mm=(e.m<10?"0":"")+e.m,b=[];for(var f=a.extend([],c.separators),g=0,h=c.parts.length;h>=g;g++)f.length&&b.push(f.shift()),b.push(e[c.parts[g]]);return b.join("")},"headTemplate":'<thead><tr><th class="prev">«</th><th colspan="5" class="datepicker-switch"></th><th class="next">»</th></tr></thead>',"contTemplate":'<tbody><tr><td colspan="7"></td></tr></tbody>',"footTemplate":'<tfoot><tr><th colspan="7" class="today"></th></tr><tr><th colspan="7" class="clear"></th></tr></tfoot>'};p.template='<div class="datepicker"><div class="datepicker-days"><table class=" table-condensed">'+p.headTemplate+"<tbody></tbody>"+p.footTemplate+'</table></div><div class="datepicker-months"><table class="table-condensed">'+p.headTemplate+p.contTemplate+p.footTemplate+'</table></div><div class="datepicker-years"><table class="table-condensed">'+p.headTemplate+p.contTemplate+p.footTemplate+"</table></div></div>",a.fn.datepicker.DPGlobal=p,a.fn.datepicker.noConflict=function(){return a.fn.datepicker=l,this},a(document).on("focus.datepicker.data-api click.datepicker.data-api",'[data-provide="datepicker"]',function(b){var c=a(this);c.data("datepicker")||(b.preventDefault(),c.datepicker("show"))}),a(function(){a('[data-provide="datepicker-inline"]').datepicker()})}(window.jQuery),function(a,b,c){"use strict";var d=function(b,c){this.widget="",this.$element=a(b),this.defaultTime=c.defaultTime,this.disableFocus=c.disableFocus,this.disableMousewheel=c.disableMousewheel,this.isOpen=c.isOpen,this.minuteStep=c.minuteStep,this.modalBackdrop=c.modalBackdrop,this.orientation=c.orientation,this.secondStep=c.secondStep,this.showInputs=c.showInputs,this.showMeridian=c.showMeridian,this.showSeconds=c.showSeconds,this.template=c.template,this.appendWidgetTo=c.appendWidgetTo,this.showWidgetOnAddonClick=c.showWidgetOnAddonClick,this._init()};d.prototype={"constructor":d,"_init":function(){var b=this;this.showWidgetOnAddonClick&&(this.$element.parent().hasClass("input-append")||this.$element.parent().hasClass("input-prepend"))?(this.$element.parent(".input-append, .input-prepend").find(".add-on").on({"click.timepicker":a.proxy(this.showWidget,this)}),this.$element.on({"focus.timepicker":a.proxy(this.highlightUnit,this),"click.timepicker":a.proxy(this.highlightUnit,this),"keydown.timepicker":a.proxy(this.elementKeydown,this),"blur.timepicker":a.proxy(this.blurElement,this),"mousewheel.timepicker DOMMouseScroll.timepicker":a.proxy(this.mousewheel,this)})):this.$element.on(this.template?{"focus.timepicker":a.proxy(this.showWidget,this),"click.timepicker":a.proxy(this.showWidget,this),"blur.timepicker":a.proxy(this.blurElement,this),"mousewheel.timepicker DOMMouseScroll.timepicker":a.proxy(this.mousewheel,this)}:{"focus.timepicker":a.proxy(this.highlightUnit,this),"click.timepicker":a.proxy(this.highlightUnit,this),"keydown.timepicker":a.proxy(this.elementKeydown,this),"blur.timepicker":a.proxy(this.blurElement,this),"mousewheel.timepicker DOMMouseScroll.timepicker":a.proxy(this.mousewheel,this)}),this.$widget=this.template!==!1?a(this.getTemplate()).on("click",a.proxy(this.widgetClick,this)):!1,this.showInputs&&this.$widget!==!1&&this.$widget.find("input").each(function(){a(this).on({"click.timepicker":function(){a(this).select()},"keydown.timepicker":a.proxy(b.widgetKeydown,b),"keyup.timepicker":a.proxy(b.widgetKeyup,b)})}),this.setDefaultTime(this.defaultTime)},"blurElement":function(){this.highlightedUnit=null,this.updateFromElementVal()},"clear":function(){this.hour="",this.minute="",this.second="",this.meridian="",this.$element.val("")},"decrementHour":function(){if(this.showMeridian)if(1===this.hour)this.hour=12;else{if(12===this.hour)return this.hour--,this.toggleMeridian();if(0===this.hour)return this.hour=11,this.toggleMeridian();this.hour--}else this.hour<=0?this.hour=23:this.hour--},"decrementMinute":function(a){var b;b=a?this.minute-a:this.minute-this.minuteStep,0>b?(this.decrementHour(),this.minute=b+60):this.minute=b},"decrementSecond":function(){var a=this.second-this.secondStep;0>a?(this.decrementMinute(!0),this.second=a+60):this.second=a},"elementKeydown":function(a){switch(a.keyCode){case 9:case 27:this.updateFromElementVal();break;case 37:a.preventDefault(),this.highlightPrevUnit();break;case 38:switch(a.preventDefault(),this.highlightedUnit){case"hour":this.incrementHour(),this.highlightHour();break;case"minute":this.incrementMinute(),this.highlightMinute();break;case"second":this.incrementSecond(),this.highlightSecond();break;case"meridian":this.toggleMeridian(),this.highlightMeridian()}this.update();break;case 39:a.preventDefault(),this.highlightNextUnit();break;case 40:switch(a.preventDefault(),this.highlightedUnit){case"hour":this.decrementHour(),this.highlightHour();break;case"minute":this.decrementMinute(),this.highlightMinute();break;case"second":this.decrementSecond(),this.highlightSecond();break;case"meridian":this.toggleMeridian(),this.highlightMeridian()}this.update()}},"getCursorPosition":function(){var a=this.$element.get(0);if("selectionStart"in a)return a.selectionStart;if(c.selection){a.focus();var b=c.selection.createRange(),d=c.selection.createRange().text.length;return b.moveStart("character",-a.value.length),b.text.length-d}},"getTemplate":function(){var a,b,c,d,e,f;switch(this.showInputs?(b='<input type="text" class="bootstrap-timepicker-hour" maxlength="2"/>',c='<input type="text" class="bootstrap-timepicker-minute" maxlength="2"/>',d='<input type="text" class="bootstrap-timepicker-second" maxlength="2"/>',e='<input type="text" class="bootstrap-timepicker-meridian" maxlength="2"/>'):(b='<span class="bootstrap-timepicker-hour"></span>',c='<span class="bootstrap-timepicker-minute"></span>',d='<span class="bootstrap-timepicker-second"></span>',e='<span class="bootstrap-timepicker-meridian"></span>'),f='<table><tr><td><a href="#" data-action="incrementHour"><i class="icon-chevron-up"></i></a></td><td class="separator"> </td><td><a href="#" data-action="incrementMinute"><i class="icon-chevron-up"></i></a></td>'+(this.showSeconds?'<td class="separator"> </td><td><a href="#" data-action="incrementSecond"><i class="icon-chevron-up"></i></a></td>':"")+(this.showMeridian?'<td class="separator"> </td><td class="meridian-column"><a href="#" data-action="toggleMeridian"><i class="icon-chevron-up"></i></a></td>':"")+"</tr><tr><td>"+b+'</td> <td class="separator">:</td><td>'+c+"</td> "+(this.showSeconds?'<td class="separator">:</td><td>'+d+"</td>":"")+(this.showMeridian?'<td class="separator"> </td><td>'+e+"</td>":"")+'</tr><tr><td><a href="#" data-action="decrementHour"><i class="icon-chevron-down"></i></a></td><td class="separator"></td><td><a href="#" data-action="decrementMinute"><i class="icon-chevron-down"></i></a></td>'+(this.showSeconds?'<td class="separator"> </td><td><a href="#" data-action="decrementSecond"><i class="icon-chevron-down"></i></a></td>':"")+(this.showMeridian?'<td class="separator"> </td><td><a href="#" data-action="toggleMeridian"><i class="icon-chevron-down"></i></a></td>':"")+"</tr></table>",this.template){case"modal":a='<div class="bootstrap-timepicker-widget modal hide fade in" data-backdrop="'+(this.modalBackdrop?"true":"false")+'"><div class="modal-header"><a href="#" class="close" data-dismiss="modal">\xd7</a><h3>Pick a Time</h3></div><div class="modal-content">'+f+'</div><div class="modal-footer"><a href="#" class="btn btn-primary" data-dismiss="modal">OK</a></div></div>';break;case"dropdown":a='<div class="bootstrap-timepicker-widget dropdown-menu">'+f+"</div>"}return a},"getTime":function(){return""===this.hour?"":this.hour+":"+(1===this.minute.toString().length?"0"+this.minute:this.minute)+(this.showSeconds?":"+(1===this.second.toString().length?"0"+this.second:this.second):"")+(this.showMeridian?" "+this.meridian:"")},"hideWidget":function(){this.isOpen!==!1&&(this.$element.trigger({"type":"hide.timepicker","time":{"value":this.getTime(),"hours":this.hour,"minutes":this.minute,"seconds":this.second,"meridian":this.meridian}}),"modal"===this.template&&this.$widget.modal?this.$widget.modal("hide"):this.$widget.removeClass("open"),a(c).off("mousedown.timepicker, touchend.timepicker"),this.isOpen=!1,this.$widget.detach())},"highlightUnit":function(){this.position=this.getCursorPosition(),this.position>=0&&this.position<=2?this.highlightHour():this.position>=3&&this.position<=5?this.highlightMinute():this.position>=6&&this.position<=8?this.showSeconds?this.highlightSecond():this.highlightMeridian():this.position>=9&&this.position<=11&&this.highlightMeridian()},"highlightNextUnit":function(){switch(this.highlightedUnit){case"hour":this.highlightMinute();break;case"minute":this.showSeconds?this.highlightSecond():this.showMeridian?this.highlightMeridian():this.highlightHour();break;case"second":this.showMeridian?this.highlightMeridian():this.highlightHour();break;case"meridian":this.highlightHour()}},"highlightPrevUnit":function(){switch(this.highlightedUnit){case"hour":this.showMeridian?this.highlightMeridian():this.showSeconds?this.highlightSecond():this.highlightMinute();break;case"minute":this.highlightHour();break;case"second":this.highlightMinute();break;case"meridian":this.showSeconds?this.highlightSecond():this.highlightMinute()}},"highlightHour":function(){var a=this.$element.get(0),b=this;this.highlightedUnit="hour",a.setSelectionRange&&setTimeout(function(){b.hour<10?a.setSelectionRange(0,1):a.setSelectionRange(0,2)},0)},"highlightMinute":function(){var a=this.$element.get(0),b=this;this.highlightedUnit="minute",a.setSelectionRange&&setTimeout(function(){b.hour<10?a.setSelectionRange(2,4):a.setSelectionRange(3,5)},0)},"highlightSecond":function(){var a=this.$element.get(0),b=this;this.highlightedUnit="second",a.setSelectionRange&&setTimeout(function(){b.hour<10?a.setSelectionRange(5,7):a.setSelectionRange(6,8)},0)},"highlightMeridian":function(){var a=this.$element.get(0),b=this;this.highlightedUnit="meridian",a.setSelectionRange&&(this.showSeconds?setTimeout(function(){b.hour<10?a.setSelectionRange(8,10):a.setSelectionRange(9,11)},0):setTimeout(function(){b.hour<10?a.setSelectionRange(5,7):a.setSelectionRange(6,8)},0))},"incrementHour":function(){if(this.showMeridian){if(11===this.hour)return this.hour++,this.toggleMeridian();12===this.hour&&(this.hour=0)}return 23===this.hour?void(this.hour=0):void this.hour++},"incrementMinute":function(a){var b;b=a?this.minute+a:this.minute+this.minuteStep-this.minute%this.minuteStep,b>59?(this.incrementHour(),this.minute=b-60):this.minute=b},"incrementSecond":function(){var a=this.second+this.secondStep-this.second%this.secondStep;a>59?(this.incrementMinute(!0),this.second=a-60):this.second=a},"mousewheel":function(b){if(!this.disableMousewheel){b.preventDefault(),b.stopPropagation();var c=b.originalEvent.wheelDelta||-b.originalEvent.detail,d=null;switch("mousewheel"===b.type?d=-1*b.originalEvent.wheelDelta:"DOMMouseScroll"===b.type&&(d=40*b.originalEvent.detail),d&&(b.preventDefault(),a(this).scrollTop(d+a(this).scrollTop())),this.highlightedUnit){case"minute":c>0?this.incrementMinute():this.decrementMinute(),this.highlightMinute();break;case"second":c>0?this.incrementSecond():this.decrementSecond(),this.highlightSecond();break;case"meridian":this.toggleMeridian(),this.highlightMeridian();break;default:c>0?this.incrementHour():this.decrementHour(),this.highlightHour()}return!1}},"place":function(){if(!this.isInline){var c=this.$widget.outerWidth(),d=this.$widget.outerHeight(),e=10,f=a(b).width(),g=a(b).height(),h=a(b).scrollTop(),i=parseInt(this.$element.parents().filter(function(){}).first().css("z-index"),10)+10,j=this.component?this.component.parent().offset():this.$element.offset(),k=this.component?this.component.outerHeight(!0):this.$element.outerHeight(!1),l=this.component?this.component.outerWidth(!0):this.$element.outerWidth(!1),m=j.left,n=j.top;this.$widget.removeClass("timepicker-orient-top timepicker-orient-bottom timepicker-orient-right timepicker-orient-left"),"auto"!==this.orientation.x?(this.$widget.addClass("timepicker-orient-"+this.orientation.x),"right"===this.orientation.x&&(m-=c-l)):(this.$widget.addClass("timepicker-orient-left"),j.left<0?m-=j.left-e:j.left+c>f&&(m=f-c-e));var o,p,q=this.orientation.y;"auto"===q&&(o=-h+j.top-d,p=h+g-(j.top+k+d),q=Math.max(o,p)===p?"top":"bottom"),this.$widget.addClass("timepicker-orient-"+q),"top"===q?n+=k:n-=d+parseInt(this.$widget.css("padding-top"),10),this.$widget.css({"top":n,"left":m,"zIndex":i})}},"remove":function(){a("document").off(".timepicker"),this.$widget&&this.$widget.remove(),delete this.$element.data().timepicker},"setDefaultTime":function(a){if(this.$element.val())this.updateFromElementVal();else if("current"===a){var b=new Date,c=b.getHours(),d=b.getMinutes(),e=b.getSeconds(),f="AM";0!==e&&(e=Math.ceil(b.getSeconds()/this.secondStep)*this.secondStep,60===e&&(d+=1,e=0)),0!==d&&(d=Math.ceil(b.getMinutes()/this.minuteStep)*this.minuteStep,60===d&&(c+=1,d=0)),this.showMeridian&&(0===c?c=12:c>=12?(c>12&&(c-=12),f="PM"):f="AM"),this.hour=c,this.minute=d,this.second=e,this.meridian=f,this.update()}else a===!1?(this.hour=0,this.minute=0,this.second=0,this.meridian="AM"):this.setTime(a)},"setTime":function(a,b){if(!a)return void this.clear();var c,d,e,f,g;"object"==typeof a&&a.getMonth?(d=a.getHours(),e=a.getMinutes(),f=a.getSeconds(),this.showMeridian&&(g="AM",d>12&&(g="PM",d%=12),12===d&&(g="PM"))):(g=null!==a.match(/p/i)?"PM":"AM",a=a.replace(/[^0-9\:]/g,""),c=a.split(":"),d=c[0]?c[0].toString():c.toString(),e=c[1]?c[1].toString():"",f=c[2]?c[2].toString():"",d.length>4&&(f=d.substr(4,2)),d.length>2&&(e=d.substr(2,2),d=d.substr(0,2)),e.length>2&&(f=e.substr(2,2),e=e.substr(0,2)),f.length>2&&(f=f.substr(2,2)),d=parseInt(d,10),e=parseInt(e,10),f=parseInt(f,10),isNaN(d)&&(d=0),isNaN(e)&&(e=0),isNaN(f)&&(f=0),this.showMeridian?1>d?d=1:d>12&&(d=12):(d>=24?d=23:0>d&&(d=0),13>d&&"PM"===g&&(d+=12)),0>e?e=0:e>=60&&(e=59),this.showSeconds&&(isNaN(f)?f=0:0>f?f=0:f>=60&&(f=59))),this.hour=d,this.minute=e,this.second=f,this.meridian=g,this.update(b)},"showWidget":function(){if(!this.isOpen&&!this.$element.is(":disabled")){this.$widget.appendTo(this.appendWidgetTo);var b=this;a(c).on("mousedown.timepicker, touchend.timepicker",function(a){b.$element.parent().find(a.target).length||b.$widget.is(a.target)||b.$widget.find(a.target).length||b.hideWidget()}),this.$element.trigger({"type":"show.timepicker","time":{"value":this.getTime(),"hours":this.hour,"minutes":this.minute,"seconds":this.second,"meridian":this.meridian}}),"modal"!==this.template&&this.place(),this.disableFocus&&this.$element.blur(),""===this.hour&&(this.defaultTime?this.setDefaultTime(this.defaultTime):this.setTime("0:0:0")),"modal"===this.template&&this.$widget.modal?this.$widget.modal("show").on("hidden",a.proxy(this.hideWidget,this)):this.isOpen===!1&&this.$widget.addClass("open"),this.isOpen=!0}},"toggleMeridian":function(){this.meridian="AM"===this.meridian?"PM":"AM"},"update":function(a){this.updateElement(),a||this.updateWidget(),this.$element.trigger({"type":"changeTime.timepicker","time":{"value":this.getTime(),"hours":this.hour,"minutes":this.minute,"seconds":this.second,"meridian":this.meridian}})},"updateElement":function(){this.$element.val(this.getTime()).change()},"updateFromElementVal":function(){this.setTime(this.$element.val())},"updateWidget":function(){if(this.$widget!==!1){var a=this.hour,b=1===this.minute.toString().length?"0"+this.minute:this.minute,c=1===this.second.toString().length?"0"+this.second:this.second;this.showInputs?(this.$widget.find("input.bootstrap-timepicker-hour").val(a),this.$widget.find("input.bootstrap-timepicker-minute").val(b),this.showSeconds&&this.$widget.find("input.bootstrap-timepicker-second").val(c),this.showMeridian&&this.$widget.find("input.bootstrap-timepicker-meridian").val(this.meridian)):(this.$widget.find("span.bootstrap-timepicker-hour").text(a),this.$widget.find("span.bootstrap-timepicker-minute").text(b),this.showSeconds&&this.$widget.find("span.bootstrap-timepicker-second").text(c),this.showMeridian&&this.$widget.find("span.bootstrap-timepicker-meridian").text(this.meridian))}},"updateFromWidgetInputs":function(){if(this.$widget!==!1){var a=this.$widget.find("input.bootstrap-timepicker-hour").val()+":"+this.$widget.find("input.bootstrap-timepicker-minute").val()+(this.showSeconds?":"+this.$widget.find("input.bootstrap-timepicker-second").val():"")+(this.showMeridian?this.$widget.find("input.bootstrap-timepicker-meridian").val():"");this.setTime(a,!0)}},"widgetClick":function(b){b.stopPropagation(),b.preventDefault();var c=a(b.target),d=c.closest("a").data("action");d&&this[d](),this.update(),c.is("input")&&c.get(0).setSelectionRange(0,2)},"widgetKeydown":function(b){var c=a(b.target),d=c.attr("class").replace("bootstrap-timepicker-","");switch(b.keyCode){case 9:if(this.showMeridian&&"meridian"===d||this.showSeconds&&"second"===d||!this.showMeridian&&!this.showSeconds&&"minute"===d)return this.hideWidget();break;case 27:this.hideWidget();break;case 38:switch(b.preventDefault(),d){case"hour":this.incrementHour();break;case"minute":this.incrementMinute();break;case"second":this.incrementSecond();break;case"meridian":this.toggleMeridian()}this.setTime(this.getTime()),c.get(0).setSelectionRange(0,2);break;case 40:switch(b.preventDefault(),d){case"hour":this.decrementHour();break;case"minute":this.decrementMinute();break;case"second":this.decrementSecond();break;case"meridian":this.toggleMeridian()}this.setTime(this.getTime()),c.get(0).setSelectionRange(0,2)}},"widgetKeyup":function(a){(65===a.keyCode||77===a.keyCode||80===a.keyCode||46===a.keyCode||8===a.keyCode||a.keyCode>=46&&a.keyCode<=57)&&this.updateFromWidgetInputs()}},a.fn.timepicker=function(b){var c=Array.apply(null,arguments);return c.shift(),this.each(function(){var e=a(this),f=e.data("timepicker"),g="object"==typeof b&&b;f||e.data("timepicker",f=new d(this,a.extend({},a.fn.timepicker.defaults,g,a(this).data()))),"string"==typeof b&&f[b].apply(f,c)})},a.fn.timepicker.defaults={"defaultTime":"current","disableFocus":!1,"disableMousewheel":!1,"isOpen":!1,"minuteStep":15,"modalBackdrop":!1,"orientation":{"x":"auto","y":"auto"},"secondStep":15,"showSeconds":!1,"showInputs":!0,"showMeridian":!0,"template":"dropdown","appendWidgetTo":"body","showWidgetOnAddonClick":!0},a.fn.timepicker.Constructor=d}(jQuery,window,document),!function(a){var b=function(){var b,c=[],d=!1,e=function(){clearTimeout(b),b=setTimeout(f,100)},f=function(){for(var a=0,b=c.length;b>a;a++)c[a].apply()};return{"register":function(b){c.push(b),d===!1&&(a(window).bind("resize",e),d=!0)},"unregister":function(a){for(var b=0,d=c.length;d>b;b++)if(c[b]==a){delete c[b];break}}}}(),c=function(c,d){this.element=a(c),this.dropdown=a('<li class="dropdown hide pull-right tabdrop"><a class="dropdown-toggle" data-toggle="dropdown" href="#">'+d.text+' <b class="caret"></b></a><ul class="dropdown-menu"></ul></li>').prependTo(this.element),this.element.parent().is(".tabs-below")&&this.dropdown.addClass("dropup"),b.register(a.proxy(this.layout,this)),this.layout()};c.prototype={"constructor":c,"layout":function(){var b=[];this.dropdown.removeClass("hide"),this.element.append(this.dropdown.find("li")).find(">li").not(".tabdrop").each(function(){this.offsetTop>0&&b.push(this)}),b.length>0?(b=a(b),this.dropdown.find("ul").empty().append(b),1==this.dropdown.find(".active").length?this.dropdown.addClass("active"):this.dropdown.removeClass("active")):this.dropdown.addClass("hide")}},a.fn.tabdrop=function(b){return this.each(function(){var d=a(this),e=d.data("tabdrop"),f="object"==typeof b&&b;e||d.data("tabdrop",e=new c(this,a.extend({},a.fn.tabdrop.defaults,f))),"string"==typeof b&&e[b]()})},a.fn.tabdrop.defaults={"text":'<i class="icon-align-justify"></i>'},a.fn.tabdrop.Constructor=c}(window.jQuery),jQuery&&function(a){function b(b,c){var d=a('<div class="minicolors" />'),e=a.minicolors.defaults;b.data("minicolors-initialized")||(c=a.extend(!0,{},e,c),d.addClass("minicolors-theme-"+c.theme).toggleClass("minicolors-with-opacity",c.opacity),void 0!==c.position&&a.each(c.position.split(" "),function(){d.addClass("minicolors-position-"+this)}),b.addClass("minicolors-input").data("minicolors-initialized",!1).data("minicolors-settings",c).prop("size",7).wrap(d).after('<div class="minicolors-panel minicolors-slider-'+c.control+'"><div class="minicolors-slider"><div class="minicolors-picker"></div></div><div class="minicolors-opacity-slider"><div class="minicolors-picker"></div></div><div class="minicolors-grid"><div class="minicolors-grid-inner"></div><div class="minicolors-picker"><div></div></div></div></div>'),c.inline||(b.after('<span class="minicolors-swatch"><span class="minicolors-swatch-color"></span></span>'),b.next(".minicolors-swatch").on("click",function(a){a.preventDefault(),b.focus()})),b.parent().find(".minicolors-panel").on("selectstart",function(){return!1}).end(),c.inline&&b.parent().addClass("minicolors-inline"),h(b,!1),b.data("minicolors-initialized",!0))}function c(a){var b=a.parent();a.removeData("minicolors-initialized").removeData("minicolors-settings").removeProp("size").removeClass("minicolors-input"),b.before(a).remove()}function d(a){var b=a.parent(),c=b.find(".minicolors-panel"),d=a.data("minicolors-settings");!a.data("minicolors-initialized")||a.prop("disabled")||b.hasClass("minicolors-inline")||b.hasClass("minicolors-focus")||(e(),b.addClass("minicolors-focus"),c.stop(!0,!0).fadeIn(d.showSpeed,function(){d.show&&d.show.call(a.get(0))}))}function e(){a(".minicolors-focus").each(function(){var b=a(this),c=b.find(".minicolors-input"),d=b.find(".minicolors-panel"),e=c.data("minicolors-settings");d.fadeOut(e.hideSpeed,function(){e.hide&&e.hide.call(c.get(0)),b.removeClass("minicolors-focus")})})}function f(a,b,c){var d,e,f,h,i=a.parents(".minicolors").find(".minicolors-input"),j=i.data("minicolors-settings"),k=a.find("[class$=-picker]"),l=a.offset().left,m=a.offset().top,n=Math.round(b.pageX-l),o=Math.round(b.pageY-m),p=c?j.animationSpeed:0;b.originalEvent.changedTouches&&(n=b.originalEvent.changedTouches[0].pageX-l,o=b.originalEvent.changedTouches[0].pageY-m),0>n&&(n=0),0>o&&(o=0),n>a.width()&&(n=a.width()),o>a.height()&&(o=a.height()),a.parent().is(".minicolors-slider-wheel")&&k.parent().is(".minicolors-grid")&&(d=75-n,e=75-o,f=Math.sqrt(d*d+e*e),h=Math.atan2(e,d),0>h&&(h+=2*Math.PI),f>75&&(f=75,n=75-75*Math.cos(h),o=75-75*Math.sin(h)),n=Math.round(n),o=Math.round(o)),a.is(".minicolors-grid")?k.stop(!0).animate({"top":o+"px","left":n+"px"},p,j.animationEasing,function(){g(i,a)}):k.stop(!0).animate({"top":o+"px"},p,j.animationEasing,function(){g(i,a)})}function g(a,b){function c(a,b){var c,d;return a.length&&b?(c=a.offset().left,d=a.offset().top,{"x":c-b.offset().left+a.outerWidth()/2,"y":d-b.offset().top+a.outerHeight()/2}):null}var d,e,f,g,h,j,k,m=a.val(),o=a.attr("data-opacity"),p=a.parent(),r=a.data("minicolors-settings"),s=p.find(".minicolors-swatch"),t=p.find(".minicolors-grid"),u=p.find(".minicolors-slider"),v=p.find(".minicolors-opacity-slider"),w=t.find("[class$=-picker]"),x=u.find("[class$=-picker]"),y=v.find("[class$=-picker]"),z=c(w,t),A=c(x,u),B=c(y,v);if(b.is(".minicolors-grid, .minicolors-slider")){switch(r.control){case"wheel":g=t.width()/2-z.x,h=t.height()/2-z.y,j=Math.sqrt(g*g+h*h),k=Math.atan2(h,g),0>k&&(k+=2*Math.PI),j>75&&(j=75,z.x=69-75*Math.cos(k),z.y=69-75*Math.sin(k)),e=n(j/.75,0,100),d=n(180*k/Math.PI,0,360),f=n(100-Math.floor(A.y*(100/u.height())),0,100),m=q({"h":d,"s":e,"b":f}),u.css("backgroundColor",q({"h":d,"s":e,"b":100}));break;case"saturation":d=n(parseInt(z.x*(360/t.width()),10),0,360),e=n(100-Math.floor(A.y*(100/u.height())),0,100),f=n(100-Math.floor(z.y*(100/t.height())),0,100),m=q({"h":d,"s":e,"b":f}),u.css("backgroundColor",q({"h":d,"s":100,"b":f})),p.find(".minicolors-grid-inner").css("opacity",e/100);break;case"brightness":d=n(parseInt(z.x*(360/t.width()),10),0,360),e=n(100-Math.floor(z.y*(100/t.height())),0,100),f=n(100-Math.floor(A.y*(100/u.height())),0,100),m=q({"h":d,"s":e,"b":f}),u.css("backgroundColor",q({"h":d,"s":e,"b":100})),p.find(".minicolors-grid-inner").css("opacity",1-f/100);
|
|
break;default:d=n(360-parseInt(A.y*(360/u.height()),10),0,360),e=n(Math.floor(z.x*(100/t.width())),0,100),f=n(100-Math.floor(z.y*(100/t.height())),0,100),m=q({"h":d,"s":e,"b":f}),t.css("backgroundColor",q({"h":d,"s":100,"b":100}))}a.val(l(m,r.letterCase))}b.is(".minicolors-opacity-slider")&&(o=r.opacity?parseFloat(1-B.y/v.height()).toFixed(2):1,r.opacity&&a.attr("data-opacity",o)),s.find("SPAN").css({"backgroundColor":m,"opacity":o}),i(a,m,o)}function h(a,b){var c,d,e,f,g,h,j,k=a.parent(),o=a.data("minicolors-settings"),p=k.find(".minicolors-swatch"),s=k.find(".minicolors-grid"),t=k.find(".minicolors-slider"),u=k.find(".minicolors-opacity-slider"),v=s.find("[class$=-picker]"),w=t.find("[class$=-picker]"),x=u.find("[class$=-picker]");switch(c=l(m(a.val(),!0),o.letterCase),c||(c=l(m(o.defaultValue,!0),o.letterCase)),d=r(c),b||a.val(c),o.opacity&&(e=""===a.attr("data-opacity")?1:n(parseFloat(a.attr("data-opacity")).toFixed(2),0,1),isNaN(e)&&(e=1),a.attr("data-opacity",e),p.find("SPAN").css("opacity",e),g=n(u.height()-u.height()*e,0,u.height()),x.css("top",g+"px")),p.find("SPAN").css("backgroundColor",c),o.control){case"wheel":h=n(Math.ceil(.75*d.s),0,s.height()/2),j=d.h*Math.PI/180,f=n(75-Math.cos(j)*h,0,s.width()),g=n(75-Math.sin(j)*h,0,s.height()),v.css({"top":g+"px","left":f+"px"}),g=150-d.b/(100/s.height()),""===c&&(g=0),w.css("top",g+"px"),t.css("backgroundColor",q({"h":d.h,"s":d.s,"b":100}));break;case"saturation":f=n(5*d.h/12,0,150),g=n(s.height()-Math.ceil(d.b/(100/s.height())),0,s.height()),v.css({"top":g+"px","left":f+"px"}),g=n(t.height()-d.s*(t.height()/100),0,t.height()),w.css("top",g+"px"),t.css("backgroundColor",q({"h":d.h,"s":100,"b":d.b})),k.find(".minicolors-grid-inner").css("opacity",d.s/100);break;case"brightness":f=n(5*d.h/12,0,150),g=n(s.height()-Math.ceil(d.s/(100/s.height())),0,s.height()),v.css({"top":g+"px","left":f+"px"}),g=n(t.height()-d.b*(t.height()/100),0,t.height()),w.css("top",g+"px"),t.css("backgroundColor",q({"h":d.h,"s":d.s,"b":100})),k.find(".minicolors-grid-inner").css("opacity",1-d.b/100);break;default:f=n(Math.ceil(d.s/(100/s.width())),0,s.width()),g=n(s.height()-Math.ceil(d.b/(100/s.height())),0,s.height()),v.css({"top":g+"px","left":f+"px"}),g=n(t.height()-d.h/(360/t.height()),0,t.height()),w.css("top",g+"px"),s.css("backgroundColor",q({"h":d.h,"s":100,"b":100}))}a.data("minicolors-initialized")&&i(a,c,e)}function i(a,b,c){var d=a.data("minicolors-settings"),e=a.data("minicolors-lastChange");e&&e.hex===b&&e.opacity===c||(a.data("minicolors-lastChange",{"hex":b,"opacity":c}),d.change&&(d.changeDelay?(clearTimeout(a.data("minicolors-changeTimeout")),a.data("minicolors-changeTimeout",setTimeout(function(){d.change.call(a.get(0),b,c)},d.changeDelay))):d.change.call(a.get(0),b,c)),a.trigger("change").trigger("input"))}function j(b){var c=m(a(b).val(),!0),d=t(c),e=a(b).attr("data-opacity");return d?(void 0!==e&&a.extend(d,{"a":parseFloat(e)}),d):null}function k(b,c){var d=m(a(b).val(),!0),e=t(d),f=a(b).attr("data-opacity");return e?(void 0===f&&(f=1),c?"rgba("+e.r+", "+e.g+", "+e.b+", "+parseFloat(f)+")":"rgb("+e.r+", "+e.g+", "+e.b+")"):null}function l(a,b){return"uppercase"===b?a.toUpperCase():a.toLowerCase()}function m(a,b){return a=a.replace(/[^A-F0-9]/gi,""),3!==a.length&&6!==a.length?"":(3===a.length&&b&&(a=a[0]+a[0]+a[1]+a[1]+a[2]+a[2]),"#"+a)}function n(a,b,c){return b>a&&(a=b),a>c&&(a=c),a}function o(a){var b={},c=Math.round(a.h),d=Math.round(255*a.s/100),e=Math.round(255*a.b/100);if(0===d)b.r=b.g=b.b=e;else{var f=e,g=(255-d)*e/255,h=(f-g)*(c%60)/60;360===c&&(c=0),60>c?(b.r=f,b.b=g,b.g=g+h):120>c?(b.g=f,b.b=g,b.r=f-h):180>c?(b.g=f,b.r=g,b.b=g+h):240>c?(b.b=f,b.r=g,b.g=f-h):300>c?(b.b=f,b.g=g,b.r=g+h):360>c?(b.r=f,b.g=g,b.b=f-h):(b.r=0,b.g=0,b.b=0)}return{"r":Math.round(b.r),"g":Math.round(b.g),"b":Math.round(b.b)}}function p(b){var c=[b.r.toString(16),b.g.toString(16),b.b.toString(16)];return a.each(c,function(a,b){1===b.length&&(c[a]="0"+b)}),"#"+c.join("")}function q(a){return p(o(a))}function r(a){var b=s(t(a));return 0===b.s&&(b.h=360),b}function s(a){var b={"h":0,"s":0,"b":0},c=Math.min(a.r,a.g,a.b),d=Math.max(a.r,a.g,a.b),e=d-c;return b.b=d,b.s=0!==d?255*e/d:0,b.h=0!==b.s?a.r===d?(a.g-a.b)/e:a.g===d?2+(a.b-a.r)/e:4+(a.r-a.g)/e:-1,b.h*=60,b.h<0&&(b.h+=360),b.s*=100/255,b.b*=100/255,b}function t(a){return a=parseInt(a.indexOf("#")>-1?a.substring(1):a,16),{"r":a>>16,"g":(65280&a)>>8,"b":255&a}}a.minicolors={"defaults":{"animationSpeed":50,"animationEasing":"swing","change":null,"changeDelay":0,"control":"hue","defaultValue":"","hide":null,"hideSpeed":100,"inline":!1,"letterCase":"lowercase","opacity":!1,"position":"bottom left","show":null,"showSpeed":100,"theme":"default"}},a.extend(a.fn,{"minicolors":function(f,g){switch(f){case"destroy":return a(this).each(function(){c(a(this))}),a(this);case"hide":return e(),a(this);case"opacity":return void 0===g?a(this).attr("data-opacity"):(a(this).each(function(){h(a(this).attr("data-opacity",g))}),a(this));case"rgbObject":return j(a(this),"rgbaObject"===f);case"rgbString":case"rgbaString":return k(a(this),"rgbaString"===f);case"settings":return void 0===g?a(this).data("minicolors-settings"):(a(this).each(function(){var b=a(this).data("minicolors-settings")||{};c(a(this)),a(this).minicolors(a.extend(!0,b,g))}),a(this));case"show":return d(a(this).eq(0)),a(this);case"value":return void 0===g?a(this).val():(a(this).each(function(){h(a(this).val(g))}),a(this));default:return"create"!==f&&(g=f),a(this).each(function(){b(a(this),g)}),a(this)}}}),a(document).on("mousedown.minicolors touchstart.minicolors",function(b){a(b.target).parents().add(b.target).hasClass("minicolors")||e()}).on("mousedown.minicolors touchstart.minicolors",".minicolors-grid, .minicolors-slider, .minicolors-opacity-slider",function(b){var c=a(this);b.preventDefault(),a(document).data("minicolors-target",c),f(c,b,!0)}).on("mousemove.minicolors touchmove.minicolors",function(b){var c=a(document).data("minicolors-target");c&&f(c,b)}).on("mouseup.minicolors touchend.minicolors",function(){a(this).removeData("minicolors-target")}).on("mousedown.minicolors touchstart.minicolors",".minicolors-swatch",function(b){var c=a(this).parent().find(".minicolors-input");b.preventDefault(),d(c)}).on("focus.minicolors",".minicolors-input",function(){var b=a(this);b.data("minicolors-initialized")&&d(b)}).on("blur.minicolors",".minicolors-input",function(){var b=a(this),c=b.data("minicolors-settings");b.data("minicolors-initialized")&&(b.val(m(b.val(),!0)),""===b.val()&&b.val(m(c.defaultValue,!0)),b.val(l(b.val(),c.letterCase)))}).on("keydown.minicolors",".minicolors-input",function(b){var c=a(this);if(c.data("minicolors-initialized"))switch(b.keyCode){case 9:e();break;case 13:case 27:e(),c.blur()}}).on("keyup.minicolors",".minicolors-input",function(){var b=a(this);b.data("minicolors-initialized")&&h(b,!0)}).on("paste.minicolors",".minicolors-input",function(){var b=a(this);b.data("minicolors-initialized")&&setTimeout(function(){h(b,!0)},1)})}(jQuery),!function(a){function b(){var a=document.createElement("input"),b="onpaste";return a.setAttribute(b,""),"function"==typeof a[b]?"paste":"input"}var c,d=b()+".mask",e=navigator.userAgent,f=/iphone/i.test(e),g=/chrome/i.test(e),h=/android/i.test(e);a.mask={"definitions":{"9":"[0-9]","a":"[A-Za-z]","*":"[A-Za-z0-9]"},"autoclear":!0,"dataName":"rawMaskFn","placeholder":"_"},a.fn.extend({"caret":function(a,b){var c;return 0===this.length||this.is(":hidden")?void 0:"number"==typeof a?(b="number"==typeof b?b:a,this.each(function(){this.setSelectionRange?this.setSelectionRange(a,b):this.createTextRange&&(c=this.createTextRange(),c.collapse(!0),c.moveEnd("character",b),c.moveStart("character",a),c.select())})):(this[0].setSelectionRange?(a=this[0].selectionStart,b=this[0].selectionEnd):document.selection&&document.selection.createRange&&(c=document.selection.createRange(),a=0-c.duplicate().moveStart("character",-1e5),b=a+c.text.length),{"begin":a,"end":b})},"unmask":function(){return this.trigger("unmask")},"mask":function(b,e){var i,j,k,l,m,n;return!b&&this.length>0?(i=a(this[0]),i.data(a.mask.dataName)()):(e=a.extend({"autoclear":a.mask.autoclear,"placeholder":a.mask.placeholder,"completed":null},e),j=a.mask.definitions,k=[],l=n=b.length,m=null,a.each(b.split(""),function(a,b){"?"==b?(n--,l=a):j[b]?(k.push(new RegExp(j[b])),null===m&&(m=k.length-1)):k.push(null)}),this.trigger("unmask").each(function(){function i(a){for(;++a<n&&!k[a];);return a}function o(a){for(;--a>=0&&!k[a];);return a}function p(a,b){var c,d;if(!(0>a)){for(c=a,d=i(b);n>c;c++)if(k[c]){if(!(n>d&&k[c].test(x[d])))break;x[c]=x[d],x[d]=e.placeholder,d=i(d)}u(),w.caret(Math.max(m,a))}}function q(a){var b,c,d,f;for(b=a,c=e.placeholder;n>b;b++)if(k[b]){if(d=i(b),f=x[b],x[b]=c,!(n>d&&k[d].test(f)))break;c=f}}function r(a){var b,c,d,e=a.which;8===e||46===e||f&&127===e?(b=w.caret(),c=b.begin,d=b.end,0===d-c&&(c=46!==e?o(c):d=i(c-1),d=46===e?i(d):d),t(c,d),p(c,d-1),a.preventDefault()):27==e&&(w.val(z),w.caret(0,v()),a.preventDefault())}function s(b){var c,d,f,g=b.which,j=w.caret();if(0==g){if(j.begin>=n)return w.val(w.val().substr(0,n)),b.preventDefault(),!1;j.begin==j.end&&(g=w.val().charCodeAt(j.begin-1),j.begin--,j.end--)}b.ctrlKey||b.altKey||b.metaKey||32>g||g&&(0!==j.end-j.begin&&(t(j.begin,j.end),p(j.begin,j.end-1)),c=i(j.begin-1),n>c&&(d=String.fromCharCode(g),k[c].test(d)&&(q(c),x[c]=d,u(),f=i(c),h?setTimeout(a.proxy(a.fn.caret,w,f),0):w.caret(f),e.completed&&f>=n&&e.completed.call(w))),b.preventDefault())}function t(a,b){var c;for(c=a;b>c&&n>c;c++)k[c]&&(x[c]=e.placeholder)}function u(){w.val(x.join(""))}function v(a){var b,c,d,f=w.val(),g=-1;for(b=0,d=0;n>b;b++)if(k[b]){for(x[b]=e.placeholder;d++<f.length;)if(c=f.charAt(d-1),k[b].test(c)){x[b]=c,g=b;break}if(d>f.length)break}else x[b]===f.charAt(d)&&b!==l&&(d++,g=b);return a?u():l>g+1?e.autoclear||x.join("")===y?(w.val(""),t(0,n)):u():(u(),w.val(w.val().substring(0,g+1))),l?b:m}var w=a(this),x=a.map(b.split(""),function(a){return"?"!=a?j[a]?e.placeholder:a:void 0}),y=x.join(""),z=w.val();w.data(a.mask.dataName,function(){return a.map(x,function(a,b){return k[b]&&a!=e.placeholder?a:null}).join("")}),w.attr("readonly")||w.one("unmask",function(){w.unbind(".mask").removeData(a.mask.dataName)}).bind("focus.mask",function(){clearTimeout(c);var a;z=w.val(),a=v(),c=setTimeout(function(){u(),a==b.length?w.caret(0,a):w.caret(a)},10)}).bind("blur.mask",function(){v(),w.val()!=z&&w.change()}).bind("keydown.mask",r).bind("keypress.mask",s).bind(d,function(){setTimeout(function(){var a=v(!0);w.caret(a),e.completed&&a==w.val().length&&e.completed.call(w)},0)}),g&&h&&w.bind("keyup.mask",s),v()}))}})}(jQuery),function(a){var b,c={"className":"autosizejs","append":"","callback":!1,"resizeDelay":10,"placeholder":!0},d='<textarea tabindex="-1" style="position:absolute; top:-999px; left:0; right:auto; bottom:auto; border:0; padding: 0; -moz-box-sizing:content-box; -webkit-box-sizing:content-box; box-sizing:content-box; word-wrap:break-word; height:0 !important; min-height:0 !important; overflow:hidden; transition:none; -webkit-transition:none; -moz-transition:none;"/>',e=["fontFamily","fontSize","fontWeight","fontStyle","letterSpacing","textTransform","wordSpacing","textIndent"],f=a(d).data("autosize",!0)[0];f.style.lineHeight="99px","99px"===a(f).css("lineHeight")&&e.push("lineHeight"),f.style.lineHeight="",a.fn.autosize=function(d){return this.length?(d=a.extend({},c,d||{}),f.parentNode!==document.body&&a(document.body).append(f),this.each(function(){function c(){var b,c=window.getComputedStyle?window.getComputedStyle(m,null):!1;c?(b=m.getBoundingClientRect().width,0===b&&(b=parseInt(c.width,10)),a.each(["paddingLeft","paddingRight","borderLeftWidth","borderRightWidth"],function(a,d){b-=parseInt(c[d],10)})):b=Math.max(n.width(),0),f.style.width=b+"px"}function g(){var g={};if(b=m,f.className=d.className,j=parseInt(n.css("maxHeight"),10),a.each(e,function(a,b){g[b]=n.css(b)}),a(f).css(g),c(),window.chrome){var h=m.style.width;m.style.width="0px";{m.offsetWidth}m.style.width=h}}function h(){var e,h;b!==m?g():c(),f.value=!m.value&&d.placeholder?(a(m).attr("placeholder")||"")+d.append:m.value+d.append,f.style.overflowY=m.style.overflowY,h=parseInt(m.style.height,10),f.scrollTop=0,f.scrollTop=9e4,e=f.scrollTop,j&&e>j?(m.style.overflowY="scroll",e=j):(m.style.overflowY="hidden",k>e&&(e=k)),e+=o,h!==e&&(m.style.height=e+"px",p&&d.callback.call(m,m))}function i(){clearTimeout(l),l=setTimeout(function(){var a=n.width();a!==r&&(r=a,h())},parseInt(d.resizeDelay,10))}var j,k,l,m=this,n=a(m),o=0,p=a.isFunction(d.callback),q={"height":m.style.height,"overflow":m.style.overflow,"overflowY":m.style.overflowY,"wordWrap":m.style.wordWrap,"resize":m.style.resize},r=n.width();n.data("autosize")||(n.data("autosize",!0),("border-box"===n.css("box-sizing")||"border-box"===n.css("-moz-box-sizing")||"border-box"===n.css("-webkit-box-sizing"))&&(o=n.outerHeight()-n.height()),k=Math.max(parseInt(n.css("minHeight"),10)-o||0,n.height()),n.css({"overflow":"hidden","overflowY":"hidden","wordWrap":"break-word","resize":"none"===n.css("resize")||"vertical"===n.css("resize")?"none":"horizontal"}),"onpropertychange"in m?"oninput"in m?n.on("input.autosize keyup.autosize",h):n.on("propertychange.autosize",function(){"value"===event.propertyName&&h()}):n.on("input.autosize",h),d.resizeDelay!==!1&&a(window).on("resize.autosize",i),n.on("autosize.resize",h),n.on("autosize.resizeIncludeStyle",function(){b=null,h()}),n.on("autosize.destroy",function(){b=null,clearTimeout(l),a(window).off("resize",i),n.off("autosize").off(".autosize").css(q).removeData("autosize")}),h())})):this}}(window.jQuery||window.$),!function(a,b){"use strict";"function"==typeof define&&define.amd?define(["jquery"],b):"object"==typeof exports?module.exports=b(require("jquery")):a.bootbox=b(a.jQuery)}(this,function b(a,c){"use strict";function d(a){var b=q[o.locale];return b?b[a]:q.en[a]}function e(b,c,d){b.stopPropagation(),b.preventDefault();var e=a.isFunction(d)&&d(b)===!1;e||c.modal("hide")}function f(a){var b,c=0;for(b in a)c++;return c}function g(b,c){var d=0;a.each(b,function(a,b){c(a,b,d++)})}function h(b){var c,d;if("object"!=typeof b)throw new Error("Please supply an object of options");if(!b.message)throw new Error("Please specify a message");return b=a.extend({},o,b),b.buttons||(b.buttons={}),b.backdrop=b.backdrop?"static":!1,c=b.buttons,d=f(c),g(c,function(b,e,f){if(a.isFunction(e)&&(e=c[b]={"callback":e}),"object"!==a.type(e))throw new Error("button with key "+b+" must be an object");e.label||(e.label=b),e.className||(e.className=2>=d&&f===d-1?"btn-primary":"btn-default")}),b}function i(a,b){var c=a.length,d={};if(1>c||c>2)throw new Error("Invalid argument length");return 2===c||"string"==typeof a[0]?(d[b[0]]=a[0],d[b[1]]=a[1]):d=a[0],d}function j(b,c,d){return a.extend(!0,{},b,i(c,d))}function k(a,b,c,d){var e={"className":"bootbox-"+a,"buttons":l.apply(null,b)};return m(j(e,d,c),b)}function l(){for(var a={},b=0,c=arguments.length;c>b;b++){var e=arguments[b],f=e.toLowerCase(),g=e.toUpperCase();a[f]={"label":d(g)}}return a}function m(a,b){var d={};return g(b,function(a,b){d[b]=!0}),g(a.buttons,function(a){if(d[a]===c)throw new Error("button key "+a+" is not allowed (options are "+b.join("\n")+")")}),a}var n={"dialog":"<div class='bootbox modal' tabindex='-1' role='dialog'><div class='modal-dialog'><div class='modal-content'><div class='modal-body'><div class='bootbox-body'></div></div></div></div></div>","header":"<div class='modal-header'><h4 class='modal-title'></h4></div>","footer":"<div class='modal-footer'></div>","closeButton":"<button type='button' class='bootbox-close-button close' data-dismiss='modal' aria-hidden='true'>×</button>","form":"<form class='bootbox-form'></form>","inputs":{"text":"<input class='bootbox-input bootbox-input-text form-control' autocomplete=off type=text />","textarea":"<textarea class='bootbox-input bootbox-input-textarea form-control'></textarea>","email":"<input class='bootbox-input bootbox-input-email form-control' autocomplete='off' type='email' />","select":"<select class='bootbox-input bootbox-input-select form-control'></select>","checkbox":"<div class='checkbox'><label><input class='bootbox-input bootbox-input-checkbox' type='checkbox' /></label></div>","date":"<input class='bootbox-input bootbox-input-date form-control' autocomplete=off type='date' />","time":"<input class='bootbox-input bootbox-input-time form-control' autocomplete=off type='time' />","number":"<input class='bootbox-input bootbox-input-number form-control' autocomplete=off type='number' />","password":"<input class='bootbox-input bootbox-input-password form-control' autocomplete='off' type='password' />"}},o={"locale":"en","backdrop":!0,"animate":!0,"className":null,"closeButton":!0,"show":!0,"container":"body"},p={};p.alert=function(){var b;if(b=k("alert",["ok"],["message","callback"],arguments),b.callback&&!a.isFunction(b.callback))throw new Error("alert requires callback property to be a function when provided");return b.buttons.ok.callback=b.onEscape=function(){return a.isFunction(b.callback)?b.callback():!0},p.dialog(b)},p.confirm=function(){var b;if(b=k("confirm",["cancel","confirm"],["message","callback"],arguments),b.buttons.cancel.callback=b.onEscape=function(){return b.callback(!1)},b.buttons.confirm.callback=function(){return b.callback(!0)},!a.isFunction(b.callback))throw new Error("confirm requires a callback");return p.dialog(b)},p.prompt=function(){var b,d,e,f,h,i,k;f=a(n.form),d={"className":"bootbox-prompt","buttons":l("cancel","confirm"),"value":"","inputType":"text"},b=m(j(d,arguments,["title","callback"]),["cancel","confirm"]),i=b.show===c?!0:b.show;var o=["date","time","number"],q=document.createElement("input");if(q.setAttribute("type",b.inputType),o[b.inputType]&&(b.inputType=q.type),b.message=f,b.buttons.cancel.callback=b.onEscape=function(){return b.callback(null)},b.buttons.confirm.callback=function(){var c;switch(b.inputType){case"text":case"textarea":case"email":case"select":case"date":case"time":case"number":case"password":c=h.val();break;case"checkbox":var d=h.find("input:checked");c=[],g(d,function(b,d){c.push(a(d).val())})}return b.callback(c)},b.show=!1,!b.title)throw new Error("prompt requires a title");if(!a.isFunction(b.callback))throw new Error("prompt requires a callback");if(!n.inputs[b.inputType])throw new Error("invalid prompt type");switch(h=a(n.inputs[b.inputType]),b.inputType){case"text":case"textarea":case"email":case"date":case"time":case"number":case"password":h.val(b.value);break;case"select":var r={};if(k=b.inputOptions||[],!k.length)throw new Error("prompt with select requires options");g(k,function(b,d){var e=h;if(d.value===c||d.text===c)throw new Error("given options in wrong format");d.group&&(r[d.group]||(r[d.group]=a("<optgroup/>").attr("label",d.group)),e=r[d.group]),e.append("<option value='"+d.value+"'>"+d.text+"</option>")}),g(r,function(a,b){h.append(b)}),h.val(b.value);break;case"checkbox":var s=a.isArray(b.value)?b.value:[b.value];if(k=b.inputOptions||[],!k.length)throw new Error("prompt with checkbox requires options");if(!k[0].value||!k[0].text)throw new Error("given options in wrong format");h=a("<div/>"),g(k,function(c,d){var e=a(n.inputs[b.inputType]);e.find("input").attr("value",d.value),e.find("label").append(d.text),g(s,function(a,b){b===d.value&&e.find("input").prop("checked",!0)}),h.append(e)})}return b.placeholder&&h.attr("placeholder",b.placeholder),b.pattern&&h.attr("pattern",b.pattern),f.append(h),f.on("submit",function(a){a.preventDefault(),e.find(".btn-primary").click()}),e=p.dialog(b),e.off("shown.bs.modal"),e.on("shown.bs.modal",function(){h.focus()}),i===!0&&e.modal("show"),e},p.dialog=function(b){b=h(b);var c=a(n.dialog),d=c.find(".modal-body"),f=b.buttons,i="",j={"onEscape":b.onEscape};if(g(f,function(a,b){i+="<button data-bb-handler='"+a+"' type='button' class='btn "+b.className+"'>"+b.label+"</button>",j[a]=b.callback}),d.find(".bootbox-body").html(b.message),b.animate===!0&&c.addClass("fade"),b.className&&c.addClass(b.className),b.title&&d.before(n.header),b.closeButton){var k=a(n.closeButton);b.title?c.find(".modal-header").prepend(k):k.css("margin-top","-10px").prependTo(d)}return b.title&&c.find(".modal-title").html(b.title),i.length&&(d.after(n.footer),c.find(".modal-footer").html(i)),c.on("hidden.bs.modal",function(a){a.target===this&&c.remove()}),c.on("shown.bs.modal",function(){c.find(".btn-primary:first").focus()}),c.on("escape.close.bb",function(a){j.onEscape&&e(a,c,j.onEscape)}),c.on("click",".modal-footer button",function(b){var d=a(this).data("bb-handler");e(b,c,j[d])}),c.on("click",".bootbox-close-button",function(a){e(a,c,j.onEscape)}),c.on("keyup",function(a){27===a.which&&c.trigger("escape.close.bb")}),a(b.container).append(c),c.modal({"backdrop":b.backdrop,"keyboard":!1,"show":!1}),b.show&&c.modal("show"),c},p.setDefaults=function(){var b={};2===arguments.length?b[arguments[0]]=arguments[1]:b=arguments[0],a.extend(o,b)},p.hideAll=function(){a(".bootbox").modal("hide")};var q={"br":{"OK":"OK","CANCEL":"Cancelar","CONFIRM":"Sim"},"da":{"OK":"OK","CANCEL":"Annuller","CONFIRM":"Accepter"},"de":{"OK":"OK","CANCEL":"Abbrechen","CONFIRM":"Akzeptieren"},"en":{"OK":"OK","CANCEL":"Cancel","CONFIRM":"OK"},"es":{"OK":"OK","CANCEL":"Cancelar","CONFIRM":"Aceptar"},"fi":{"OK":"OK","CANCEL":"Peruuta","CONFIRM":"OK"},"fr":{"OK":"OK","CANCEL":"Annuler","CONFIRM":"D'accord"},"he":{"OK":"\u05d0\u05d9\u05e9\u05d5\u05e8","CANCEL":"\u05d1\u05d9\u05d8\u05d5\u05dc","CONFIRM":"\u05d0\u05d9\u05e9\u05d5\u05e8"},"it":{"OK":"OK","CANCEL":"Annulla","CONFIRM":"Conferma"},"lt":{"OK":"Gerai","CANCEL":"At\u0161aukti","CONFIRM":"Patvirtinti"},"lv":{"OK":"Labi","CANCEL":"Atcelt","CONFIRM":"Apstiprin\u0101t"},"nl":{"OK":"OK","CANCEL":"Annuleren","CONFIRM":"Accepteren"},"no":{"OK":"OK","CANCEL":"Avbryt","CONFIRM":"OK"},"pl":{"OK":"OK","CANCEL":"Anuluj","CONFIRM":"Potwierd\u017a"},"ru":{"OK":"OK","CANCEL":"\u041e\u0442\u043c\u0435\u043d\u0430","CONFIRM":"\u041f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c"},"sv":{"OK":"OK","CANCEL":"Avbryt","CONFIRM":"OK"},"tr":{"OK":"Tamam","CANCEL":"\u0130ptal","CONFIRM":"Onayla"},"zh_CN":{"OK":"OK","CANCEL":"\u53d6\u6d88","CONFIRM":"\u786e\u8ba4"},"zh_TW":{"OK":"OK","CANCEL":"\u53d6\u6d88","CONFIRM":"\u78ba\u8a8d"}};return p.init=function(c){return b(c||a)},p}),function(){"use strict";var a,b,c,d=function(a,b){return function(){return a.apply(b,arguments)}};a=jQuery,b=function(){function a(){}return a.transitions={"webkitTransition":"webkitTransitionEnd","mozTransition":"mozTransitionEnd","oTransition":"oTransitionEnd","transition":"transitionend"},a.transition=function(a){var b,c,d,e;b=a[0],e=this.transitions;for(d in e)if(c=e[d],null!=b.style[d])return c},a}(),c=function(){function c(b){null==b&&(b={}),this.html=d(this.html,this),this.$growl=d(this.$growl,this),this.$growls=d(this.$growls,this),this.animate=d(this.animate,this),this.remove=d(this.remove,this),this.dismiss=d(this.dismiss,this),this.present=d(this.present,this),this.close=d(this.close,this),this.cycle=d(this.cycle,this),this.unbind=d(this.unbind,this),this.bind=d(this.bind,this),this.render=d(this.render,this),this.settings=a.extend({},c.settings,b),this.$growls().attr("class",this.settings.location),this.render()}return c.settings={"namespace":"growl","duration":3200,"close":"×","location":"default","style":"default","size":"medium"},c.growl=function(a){return null==a&&(a={}),this.initialize(),new c(a)},c.initialize=function(){return a("body:not(:has(#growls))").append('<div id="growls" />')},c.prototype.render=function(){var a;a=this.$growl(),this.$growls().append(a),this.cycle(a)},c.prototype.bind=function(a){return null==a&&(a=this.$growl()),a.find("."+this.settings.namespace+"-close").on("click",this.close)},c.prototype.unbind=function(a){return null==a&&(a=this.$growl()),a.find("."+(this.settings.namespace-close)).off("click",this.close)},c.prototype.cycle=function(a){return null==a&&(a=this.$growl()),a.queue(this.present).delay(this.settings.duration).queue(this.dismiss).queue(this.remove)},c.prototype.close=function(a){var b;return a.preventDefault(),a.stopPropagation(),b=this.$growl(),b.stop().queue(this.dismiss).queue(this.remove)},c.prototype.present=function(a){var b;return b=this.$growl(),this.bind(b),this.animate(b,""+this.settings.namespace+"-incoming","out",a)},c.prototype.dismiss=function(a){var b;return b=this.$growl(),this.unbind(b),this.animate(b,""+this.settings.namespace+"-outgoing","in",a)},c.prototype.remove=function(a){return this.$growl().remove(),a()},c.prototype.animate=function(a,c,d,e){var f;null==d&&(d="in"),f=b.transition(a),a["in"===d?"removeClass":"addClass"](c),a.offset().position,a["in"===d?"addClass":"removeClass"](c),null!=e&&(null!=f?a.one(f,e):e())},c.prototype.$growls=function(){return null!=this.$_growls?this.$_growls:this.$_growls=a("#growls")},c.prototype.$growl=function(){return null!=this.$_growl?this.$_growl:this.$_growl=a(this.html())},c.prototype.html=function(){return"<div class='"+this.settings.namespace+" "+this.settings.namespace+"-"+this.settings.style+" "+this.settings.namespace+"-"+this.settings.size+"'>\n <div class='"+this.settings.namespace+"-close'>"+this.settings.close+"</div>\n <div class='"+this.settings.namespace+"-title'>"+this.settings.title+"</div>\n <div class='"+this.settings.namespace+"-message'>"+this.settings.message+"</div>\n</div>"},c}(),a.growl=function(a){return null==a&&(a={}),c.growl(a)},a.growl.error=function(b){var c;return null==b&&(b={}),c={"title":"Error!","style":"error"},a.growl(a.extend(c,b))},a.growl.notice=function(b){var c;return null==b&&(b={}),c={"title":"Notice!","style":"notice"},a.growl(a.extend(c,b))},a.growl.warning=function(b){var c;return null==b&&(b={}),c={"title":"Warning!","style":"warning"},a.growl(a.extend(c,b))}}.call(this),function(a){"use strict";var b={},c=Math.max,d=Math.min;b.c={},b.c.d=a(document),b.c.t=function(a){return a.originalEvent.touches.length-1},b.o=function(){var c=this;this.o=null,this.$=null,this.i=null,this.g=null,this.v=null,this.cv=null,this.x=0,this.y=0,this.w=0,this.h=0,this.$c=null,this.c=null,this.t=0,this.isInit=!1,this.fgColor=null,this.pColor=null,this.dH=null,this.cH=null,this.eH=null,this.rH=null,this.scale=1,this.relative=!1,this.relativeWidth=!1,this.relativeHeight=!1,this.$div=null,this.run=function(){var b=function(a,b){var d;for(d in b)c.o[d]=b[d];c._carve().init(),c._configure()._draw()};if(!this.$.data("kontroled")){if(this.$.data("kontroled",!0),this.extend(),this.o=a.extend({"min":void 0!==this.$.data("min")?this.$.data("min"):0,"max":void 0!==this.$.data("max")?this.$.data("max"):100,"stopper":!0,"readOnly":this.$.data("readonly")||"readonly"===this.$.attr("readonly"),"cursor":this.$.data("cursor")===!0&&30||this.$.data("cursor")||0,"thickness":this.$.data("thickness")&&Math.max(Math.min(this.$.data("thickness"),1),.01)||.35,"lineCap":this.$.data("linecap")||"butt","width":this.$.data("width")||200,"height":this.$.data("height")||200,"displayInput":null==this.$.data("displayinput")||this.$.data("displayinput"),"displayPrevious":this.$.data("displayprevious"),"fgColor":this.$.data("fgcolor")||"#87CEEB","inputColor":this.$.data("inputcolor"),"font":this.$.data("font")||"Arial","fontWeight":this.$.data("font-weight")||"bold","inline":!1,"step":this.$.data("step")||1,"draw":null,"change":null,"cancel":null,"release":null,"format":function(a){return a},"parse":function(a){return parseFloat(a)}},this.o),this.o.inputColor||(this.o.inputColor=this.o.fgColor),this.$.is("fieldset")?(this.v={},this.i=this.$.find("input"),this.i.each(function(b){var d=a(this);c.i[b]=d,c.v[b]=c.o.parse(d.val()),d.bind("change blur",function(){var a={};a[b]=d.val(),c.val(a)})}),this.$.find("legend").remove()):(this.i=this.$,this.v=this.o.parse(this.$.val()),""===this.v&&(this.v=this.o.min),this.$.bind("change blur",function(){c.val(c._validate(c.o.parse(c.$.val())))})),!this.o.displayInput&&this.$.hide(),this.$c=a(document.createElement("canvas")).attr({"width":this.o.width,"height":this.o.height}),this.$div=a('<div style="'+(this.o.inline?"display:inline;":"")+"width:"+this.o.width+"px;height:"+this.o.height+'px;"></div>'),this.$.wrap(this.$div).before(this.$c),this.$div=this.$.parent(),"undefined"!=typeof G_vmlCanvasManager&&G_vmlCanvasManager.initElement(this.$c[0]),this.c=this.$c[0].getContext?this.$c[0].getContext("2d"):null,!this.c)throw{"name":"CanvasNotSupportedException","message":"Canvas not supported. Please use excanvas on IE8.0.","toString":function(){return this.name+": "+this.message}};return this.scale=(window.devicePixelRatio||1)/(this.c.webkitBackingStorePixelRatio||this.c.mozBackingStorePixelRatio||this.c.msBackingStorePixelRatio||this.c.oBackingStorePixelRatio||this.c.backingStorePixelRatio||1),this.relativeWidth=this.o.width%1!==0&&this.o.width.indexOf("%"),this.relativeHeight=this.o.height%1!==0&&this.o.height.indexOf("%"),this.relative=this.relativeWidth||this.relativeHeight,this._carve(),this.v instanceof Object?(this.cv={},this.copy(this.v,this.cv)):this.cv=this.v,this.$.bind("configure",b).parent().bind("configure",b),this._listen()._configure()._xy().init(),this.isInit=!0,this.$.val(this.o.format(this.v)),this._draw(),this}},this._carve=function(){if(this.relative){var a=this.relativeWidth?this.$div.parent().width()*parseInt(this.o.width)/100:this.$div.parent().width(),b=this.relativeHeight?this.$div.parent().height()*parseInt(this.o.height)/100:this.$div.parent().height();this.w=this.h=Math.min(a,b)}else this.w=this.o.width,this.h=this.o.height;return this.$div.css({"width":this.w+"px","height":this.h+"px"}),this.$c.attr({"width":this.w,"height":this.h}),1!==this.scale&&(this.$c[0].width=this.$c[0].width*this.scale,this.$c[0].height=this.$c[0].height*this.scale,this.$c.width(this.w),this.$c.height(this.h)),this},this._draw=function(){var a=!0;c.g=c.c,c.clear(),c.dH&&(a=c.dH()),a!==!1&&c.draw()},this._touch=function(a){var d=function(a){var b=c.xy2val(a.originalEvent.touches[c.t].pageX,a.originalEvent.touches[c.t].pageY);b!=c.cv&&(c.cH&&c.cH(b)===!1||(c.change(c._validate(b)),c._draw()))};return this.t=b.c.t(a),d(a),b.c.d.bind("touchmove.k",d).bind("touchend.k",function(){b.c.d.unbind("touchmove.k touchend.k"),c.val(c.cv)}),this},this._mouse=function(a){var d=function(a){var b=c.xy2val(a.pageX,a.pageY);b!=c.cv&&(c.cH&&c.cH(b)===!1||(c.change(c._validate(b)),c._draw()))};return d(a),b.c.d.bind("mousemove.k",d).bind("keyup.k",function(a){if(27===a.keyCode){if(b.c.d.unbind("mouseup.k mousemove.k keyup.k"),c.eH&&c.eH()===!1)return;c.cancel()}}).bind("mouseup.k",function(){b.c.d.unbind("mousemove.k mouseup.k keyup.k"),c.val(c.cv)}),this},this._xy=function(){var a=this.$c.offset();return this.x=a.left,this.y=a.top,this},this._listen=function(){return this.o.readOnly?this.$.attr("readonly","readonly"):(this.$c.bind("mousedown",function(a){a.preventDefault(),c._xy()._mouse(a)}).bind("touchstart",function(a){a.preventDefault(),c._xy()._touch(a)}),this.listen()),this.relative&&a(window).resize(function(){c._carve().init(),c._draw()}),this},this._configure=function(){return this.o.draw&&(this.dH=this.o.draw),this.o.change&&(this.cH=this.o.change),this.o.cancel&&(this.eH=this.o.cancel),this.o.release&&(this.rH=this.o.release),this.o.displayPrevious?(this.pColor=this.h2rgba(this.o.fgColor,"0.4"),this.fgColor=this.h2rgba(this.o.fgColor,"0.6")):this.fgColor=this.o.fgColor,this},this._clear=function(){this.$c[0].width=this.$c[0].width},this._validate=function(a){return~~((0>a?-.5:.5)+a/this.o.step)*this.o.step},this.listen=function(){},this.extend=function(){},this.init=function(){},this.change=function(){},this.val=function(){},this.xy2val=function(){},this.draw=function(){},this.clear=function(){this._clear()},this.h2rgba=function(a,b){var c;return a=a.substring(1,7),c=[parseInt(a.substring(0,2),16),parseInt(a.substring(2,4),16),parseInt(a.substring(4,6),16)],"rgba("+c[0]+","+c[1]+","+c[2]+","+b+")"
|
|
},this.copy=function(a,b){for(var c in a)b[c]=a[c]}},b.Dial=function(){b.o.call(this),this.startAngle=null,this.xy=null,this.radius=null,this.lineWidth=null,this.cursorExt=null,this.w2=null,this.PI2=2*Math.PI,this.extend=function(){this.o=a.extend({"bgColor":this.$.data("bgcolor")||"#EEEEEE","angleOffset":this.$.data("angleoffset")||0,"angleArc":this.$.data("anglearc")||360,"inline":!0},this.o)},this.val=function(a,b){return null==a?this.v:(a=this.o.parse(a),void(b!==!1&&a!=this.v&&this.rH&&this.rH(a)===!1||(this.cv=this.o.stopper?c(d(a,this.o.max),this.o.min):a,this.v=this.cv,this.$.val(this.o.format(this.v)),this._draw())))},this.xy2val=function(a,b){var e,f;return e=Math.atan2(a-(this.x+this.w2),-(b-this.y-this.w2))-this.angleOffset,this.angleArc!=this.PI2&&0>e&&e>-.5?e=0:0>e&&(e+=this.PI2),f=~~(.5+e*(this.o.max-this.o.min)/this.angleArc)+this.o.min,this.o.stopper&&(f=c(d(f,this.o.max),this.o.min)),f},this.listen=function(){var b,e,f,g,h=this,i=function(a){a.preventDefault();var f=a.originalEvent,g=f.detail||f.wheelDeltaX,i=f.detail||f.wheelDeltaY,j=h._validate(h.o.parse(h.$.val()))+(g>0||i>0?h.o.step:0>g||0>i?-h.o.step:0);j=c(d(j,h.o.max),h.o.min),h.val(j,!1),h.rH&&(clearTimeout(b),b=setTimeout(function(){h.rH(j),b=null},100),e||(e=setTimeout(function(){b&&h.rH(j),e=null},200)))},j=1,k={"37":-h.o.step,"38":h.o.step,"39":h.o.step,"40":-h.o.step};this.$.bind("keydown",function(b){var e=b.keyCode;if(e>=96&&105>=e&&(e=b.keyCode=e-48),f=parseInt(String.fromCharCode(e)),isNaN(f)&&(13!==e&&8!==e&&9!==e&&189!==e&&(190!==e||h.$.val().match(/\./))&&b.preventDefault(),a.inArray(e,[37,38,39,40])>-1)){b.preventDefault();var i=h.o.parse(h.$.val())+k[e]*j;h.o.stopper&&(i=c(d(i,h.o.max),h.o.min)),h.change(i),h._draw(),g=window.setTimeout(function(){j*=2},30)}}).bind("keyup",function(){isNaN(f)?g&&(window.clearTimeout(g),g=null,j=1,h.val(h.$.val())):h.$.val()>h.o.max&&h.$.val(h.o.max)||h.$.val()<h.o.min&&h.$.val(h.o.min)}),this.$c.bind("mousewheel DOMMouseScroll",i),this.$.bind("mousewheel DOMMouseScroll",i)},this.init=function(){(this.v<this.o.min||this.v>this.o.max)&&(this.v=this.o.min),this.$.val(this.v),this.w2=this.w/2,this.cursorExt=this.o.cursor/100,this.xy=this.w2*this.scale,this.lineWidth=this.xy*this.o.thickness,this.lineCap=this.o.lineCap,this.radius=this.xy-this.lineWidth/2,this.o.angleOffset&&(this.o.angleOffset=isNaN(this.o.angleOffset)?0:this.o.angleOffset),this.o.angleArc&&(this.o.angleArc=isNaN(this.o.angleArc)?this.PI2:this.o.angleArc),this.angleOffset=this.o.angleOffset*Math.PI/180,this.angleArc=this.o.angleArc*Math.PI/180,this.startAngle=1.5*Math.PI+this.angleOffset,this.endAngle=1.5*Math.PI+this.angleOffset+this.angleArc;var a=c(String(Math.abs(this.o.max)).length,String(Math.abs(this.o.min)).length,2)+2;this.o.displayInput&&this.i.css({"width":(this.w/2+4>>0)+"px","height":(this.w/3>>0)+"px","position":"absolute","vertical-align":"middle","margin-top":(this.w/3>>0)+"px","margin-left":"-"+(3*this.w/4+2>>0)+"px","border":0,"background":"none","font":this.o.fontWeight+" "+(this.w/a>>0)+"px "+this.o.font,"text-align":"center","color":this.o.inputColor||this.o.fgColor,"padding":"0px","-webkit-appearance":"none"})||this.i.css({"width":"0px","visibility":"hidden"})},this.change=function(a){this.cv=a,this.$.val(this.o.format(a))},this.angle=function(a){return(a-this.o.min)*this.angleArc/(this.o.max-this.o.min)},this.draw=function(){var a,b,c=this.g,d=this.angle(this.cv),e=this.startAngle,f=e+d,g=1;c.lineWidth=this.lineWidth,c.lineCap=this.lineCap,this.o.cursor&&(e=f-this.cursorExt)&&(f+=this.cursorExt),c.beginPath(),c.strokeStyle=this.o.bgColor,c.arc(this.xy,this.xy,this.radius,this.endAngle-1e-5,this.startAngle+1e-5,!0),c.stroke(),this.o.displayPrevious&&(b=this.startAngle+this.angle(this.v),a=this.startAngle,this.o.cursor&&(a=b-this.cursorExt)&&(b+=this.cursorExt),c.beginPath(),c.strokeStyle=this.pColor,c.arc(this.xy,this.xy,this.radius,a-1e-5,b+1e-5,!1),c.stroke(),g=this.cv==this.v),c.beginPath(),c.strokeStyle=g?this.o.fgColor:this.fgColor,c.arc(this.xy,this.xy,this.radius,e-1e-5,f+1e-5,!1),c.stroke()},this.cancel=function(){this.val(this.v)}},a.fn.dial=a.fn.knob=function(c){return this.each(function(){var d=new b.Dial;d.o=c,d.$=a(this),d.run()}).parent()}}(jQuery),function(a,b,c){!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):jQuery&&!jQuery.fn.sparkline&&a(jQuery)}(function(d){"use strict";var e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K={},L=0;e=function(){return{"common":{"type":"line","lineColor":"#00f","fillColor":"#cdf","defaultPixelsPerValue":3,"width":"auto","height":"auto","composite":!1,"tagValuesAttribute":"values","tagOptionsPrefix":"spark","enableTagOptions":!1,"enableHighlight":!0,"highlightLighten":1.4,"tooltipSkipNull":!0,"tooltipPrefix":"","tooltipSuffix":"","disableHiddenCheck":!1,"numberFormatter":!1,"numberDigitGroupCount":3,"numberDigitGroupSep":",","numberDecimalMark":".","disableTooltips":!1,"disableInteraction":!1},"line":{"spotColor":"#f80","highlightSpotColor":"#5f5","highlightLineColor":"#f22","spotRadius":1.5,"minSpotColor":"#f80","maxSpotColor":"#f80","lineWidth":1,"normalRangeMin":c,"normalRangeMax":c,"normalRangeColor":"#ccc","drawNormalOnTop":!1,"chartRangeMin":c,"chartRangeMax":c,"chartRangeMinX":c,"chartRangeMaxX":c,"tooltipFormat":new g('<span style="color: {{color}}">●</span> {{prefix}}{{y}}{{suffix}}')},"bar":{"barColor":"#3366cc","negBarColor":"#f44","stackedBarColor":["#3366cc","#dc3912","#ff9900","#109618","#66aa00","#dd4477","#0099c6","#990099"],"zeroColor":c,"nullColor":c,"zeroAxis":!0,"barWidth":4,"barSpacing":1,"chartRangeMax":c,"chartRangeMin":c,"chartRangeClip":!1,"colorMap":c,"tooltipFormat":new g('<span style="color: {{color}}">●</span> {{prefix}}{{value}}{{suffix}}')},"tristate":{"barWidth":4,"barSpacing":1,"posBarColor":"#6f6","negBarColor":"#f44","zeroBarColor":"#999","colorMap":{},"tooltipFormat":new g('<span style="color: {{color}}">●</span> {{value:map}}'),"tooltipValueLookups":{"map":{"-1":"Loss","0":"Draw","1":"Win"}}},"discrete":{"lineHeight":"auto","thresholdColor":c,"thresholdValue":0,"chartRangeMax":c,"chartRangeMin":c,"chartRangeClip":!1,"tooltipFormat":new g("{{prefix}}{{value}}{{suffix}}")},"bullet":{"targetColor":"#f33","targetWidth":3,"performanceColor":"#33f","rangeColors":["#d3dafe","#a8b6ff","#7f94ff"],"base":c,"tooltipFormat":new g("{{fieldkey:fields}} - {{value}}"),"tooltipValueLookups":{"fields":{"r":"Range","p":"Performance","t":"Target"}}},"pie":{"offset":0,"sliceColors":["#3366cc","#dc3912","#ff9900","#109618","#66aa00","#dd4477","#0099c6","#990099"],"borderWidth":0,"borderColor":"#000","tooltipFormat":new g('<span style="color: {{color}}">●</span> {{value}} ({{percent.1}}%)')},"box":{"raw":!1,"boxLineColor":"#000","boxFillColor":"#cdf","whiskerColor":"#000","outlierLineColor":"#333","outlierFillColor":"#fff","medianColor":"#f00","showOutliers":!0,"outlierIQR":1.5,"spotRadius":1.5,"target":c,"targetColor":"#4a2","chartRangeMax":c,"chartRangeMin":c,"tooltipFormat":new g("{{field:fields}}: {{value}}"),"tooltipFormatFieldlistKey":"field","tooltipValueLookups":{"fields":{"lq":"Lower Quartile","med":"Median","uq":"Upper Quartile","lo":"Left Outlier","ro":"Right Outlier","lw":"Left Whisker","rw":"Right Whisker"}}}}},D='.jqstooltip { position: absolute;left: 0px;top: 0px;visibility: hidden;background: rgb(0, 0, 0) transparent;background-color: rgba(0,0,0,0.6);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000);-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000)";color: white;font: 10px arial, san serif;text-align: left;white-space: nowrap;padding: 5px;border: 1px solid white;z-index: 10000;}.jqsfield { color: white;font: 10px arial, san serif;text-align: left;}',f=function(){var a,b;return a=function(){this.init.apply(this,arguments)},arguments.length>1?(arguments[0]?(a.prototype=d.extend(new arguments[0],arguments[arguments.length-1]),a._super=arguments[0].prototype):a.prototype=arguments[arguments.length-1],arguments.length>2&&(b=Array.prototype.slice.call(arguments,1,-1),b.unshift(a.prototype),d.extend.apply(d,b))):a.prototype=arguments[0],a.prototype.cls=a,a},d.SPFormatClass=g=f({"fre":/\{\{([\w.]+?)(:(.+?))?\}\}/g,"precre":/(\w+)\.(\d+)/,"init":function(a,b){this.format=a,this.fclass=b},"render":function(a,b,d){var e,f,g,h,i,j=this,k=a;return this.format.replace(this.fre,function(){var a;return f=arguments[1],g=arguments[3],e=j.precre.exec(f),e?(i=e[2],f=e[1]):i=!1,h=k[f],h===c?"":g&&b&&b[g]?(a=b[g],a.get?b[g].get(h)||h:b[g][h]||h):(m(h)&&(h=d.get("numberFormatter")?d.get("numberFormatter")(h):r(h,i,d.get("numberDigitGroupCount"),d.get("numberDigitGroupSep"),d.get("numberDecimalMark"))),h)})}}),d.spformat=function(a,b){return new g(a,b)},h=function(a,b,c){return b>a?b:a>c?c:a},i=function(a,c){var d;return 2===c?(d=b.floor(a.length/2),a.length%2?a[d]:(a[d-1]+a[d])/2):a.length%2?(d=(a.length*c+c)/4,d%1?(a[b.floor(d)]+a[b.floor(d)-1])/2:a[d-1]):(d=(a.length*c+2)/4,d%1?(a[b.floor(d)]+a[b.floor(d)-1])/2:a[d-1])},j=function(a){var b;switch(a){case"undefined":a=c;break;case"null":a=null;break;case"true":a=!0;break;case"false":a=!1;break;default:b=parseFloat(a),a==b&&(a=b)}return a},k=function(a){var b,c=[];for(b=a.length;b--;)c[b]=j(a[b]);return c},l=function(a,b){var c,d,e=[];for(c=0,d=a.length;d>c;c++)a[c]!==b&&e.push(a[c]);return e},m=function(a){return!isNaN(parseFloat(a))&&isFinite(a)},r=function(a,b,c,e,f){var g,h;for(a=(b===!1?parseFloat(a).toString():a.toFixed(b)).split(""),g=(g=d.inArray(".",a))<0?a.length:g,g<a.length&&(a[g]=f),h=g-c;h>0;h-=c)a.splice(h,0,e);return a.join("")},n=function(a,b,c){var d;for(d=b.length;d--;)if((!c||null!==b[d])&&b[d]!==a)return!1;return!0},o=function(a){var b,c=0;for(b=a.length;b--;)c+="number"==typeof a[b]?a[b]:0;return c},q=function(a){return d.isArray(a)?a:[a]},p=function(b){var c;a.createStyleSheet?a.createStyleSheet().cssText=b:(c=a.createElement("style"),c.type="text/css",a.getElementsByTagName("head")[0].appendChild(c),c["string"==typeof a.body.style.WebkitAppearance?"innerText":"innerHTML"]=b)},d.fn.simpledraw=function(b,e,f,g){var h,i;if(f&&(h=this.data("_jqs_vcanvas")))return h;if(d.fn.sparkline.canvas===!1)return!1;if(d.fn.sparkline.canvas===c){var j=a.createElement("canvas");if(j.getContext&&j.getContext("2d"))d.fn.sparkline.canvas=function(a,b,c,d){return new H(a,b,c,d)};else{if(!a.namespaces||a.namespaces.v)return d.fn.sparkline.canvas=!1,!1;a.namespaces.add("v","urn:schemas-microsoft-com:vml","#default#VML"),d.fn.sparkline.canvas=function(a,b,c){return new I(a,b,c)}}}return b===c&&(b=d(this).innerWidth()),e===c&&(e=d(this).innerHeight()),h=d.fn.sparkline.canvas(b,e,this,g),i=d(this).data("_jqs_mhandler"),i&&i.registerCanvas(h),h},d.fn.cleardraw=function(){var a=this.data("_jqs_vcanvas");a&&a.reset()},d.RangeMapClass=s=f({"init":function(a){var b,c,d=[];for(b in a)a.hasOwnProperty(b)&&"string"==typeof b&&b.indexOf(":")>-1&&(c=b.split(":"),c[0]=0===c[0].length?-1/0:parseFloat(c[0]),c[1]=0===c[1].length?1/0:parseFloat(c[1]),c[2]=a[b],d.push(c));this.map=a,this.rangelist=d||!1},"get":function(a){var b,d,e,f=this.rangelist;if((e=this.map[a])!==c)return e;if(f)for(b=f.length;b--;)if(d=f[b],d[0]<=a&&d[1]>=a)return d[2];return c}}),d.range_map=function(a){return new s(a)},t=f({"init":function(a,b){var c=d(a);this.$el=c,this.options=b,this.currentPageX=0,this.currentPageY=0,this.el=a,this.splist=[],this.tooltip=null,this.over=!1,this.displayTooltips=!b.get("disableTooltips"),this.highlightEnabled=!b.get("disableHighlight")},"registerSparkline":function(a){this.splist.push(a),this.over&&this.updateDisplay()},"registerCanvas":function(a){var b=d(a.canvas);this.canvas=a,this.$canvas=b,b.mouseenter(d.proxy(this.mouseenter,this)),b.mouseleave(d.proxy(this.mouseleave,this)),b.click(d.proxy(this.mouseclick,this))},"reset":function(a){this.splist=[],this.tooltip&&a&&(this.tooltip.remove(),this.tooltip=c)},"mouseclick":function(a){var b=d.Event("sparklineClick");b.originalEvent=a,b.sparklines=this.splist,this.$el.trigger(b)},"mouseenter":function(b){d(a.body).unbind("mousemove.jqs"),d(a.body).bind("mousemove.jqs",d.proxy(this.mousemove,this)),this.over=!0,this.currentPageX=b.pageX,this.currentPageY=b.pageY,this.currentEl=b.target,!this.tooltip&&this.displayTooltips&&(this.tooltip=new u(this.options),this.tooltip.updatePosition(b.pageX,b.pageY)),this.updateDisplay()},"mouseleave":function(){d(a.body).unbind("mousemove.jqs");var b,c,e=this.splist,f=e.length,g=!1;for(this.over=!1,this.currentEl=null,this.tooltip&&(this.tooltip.remove(),this.tooltip=null),c=0;f>c;c++)b=e[c],b.clearRegionHighlight()&&(g=!0);g&&this.canvas.render()},"mousemove":function(a){this.currentPageX=a.pageX,this.currentPageY=a.pageY,this.currentEl=a.target,this.tooltip&&this.tooltip.updatePosition(a.pageX,a.pageY),this.updateDisplay()},"updateDisplay":function(){var a,b,c,e,f,g=this.splist,h=g.length,i=!1,j=this.$canvas.offset(),k=this.currentPageX-j.left,l=this.currentPageY-j.top;if(this.over){for(c=0;h>c;c++)b=g[c],e=b.setRegionHighlight(this.currentEl,k,l),e&&(i=!0);if(i){if(f=d.Event("sparklineRegionChange"),f.sparklines=this.splist,this.$el.trigger(f),this.tooltip){for(a="",c=0;h>c;c++)b=g[c],a+=b.getCurrentRegionTooltip();this.tooltip.setContent(a)}this.disableHighlight||this.canvas.render()}null===e&&this.mouseleave()}}}),u=f({"sizeStyle":"position: static !important;display: block !important;visibility: hidden !important;float: left !important;","init":function(b){var c,e=b.get("tooltipClassname","jqstooltip"),f=this.sizeStyle;this.container=b.get("tooltipContainer")||a.body,this.tooltipOffsetX=b.get("tooltipOffsetX",10),this.tooltipOffsetY=b.get("tooltipOffsetY",12),d("#jqssizetip").remove(),d("#jqstooltip").remove(),this.sizetip=d("<div/>",{"id":"jqssizetip","style":f,"class":e}),this.tooltip=d("<div/>",{"id":"jqstooltip","class":e}).appendTo(this.container),c=this.tooltip.offset(),this.offsetLeft=c.left,this.offsetTop=c.top,this.hidden=!0,d(window).unbind("resize.jqs scroll.jqs"),d(window).bind("resize.jqs scroll.jqs",d.proxy(this.updateWindowDims,this)),this.updateWindowDims()},"updateWindowDims":function(){this.scrollTop=d(window).scrollTop(),this.scrollLeft=d(window).scrollLeft(),this.scrollRight=this.scrollLeft+d(window).width(),this.updatePosition()},"getSize":function(a){this.sizetip.html(a).appendTo(this.container),this.width=this.sizetip.width()+1,this.height=this.sizetip.height(),this.sizetip.remove()},"setContent":function(a){return a?(this.getSize(a),this.tooltip.html(a).css({"width":this.width,"height":this.height,"visibility":"visible"}),void(this.hidden&&(this.hidden=!1,this.updatePosition()))):(this.tooltip.css("visibility","hidden"),void(this.hidden=!0))},"updatePosition":function(a,b){if(a===c){if(this.mousex===c)return;a=this.mousex-this.offsetLeft,b=this.mousey-this.offsetTop}else this.mousex=a-=this.offsetLeft,this.mousey=b-=this.offsetTop;this.height&&this.width&&!this.hidden&&(b-=this.height+this.tooltipOffsetY,a+=this.tooltipOffsetX,b<this.scrollTop&&(b=this.scrollTop),a<this.scrollLeft?a=this.scrollLeft:a+this.width>this.scrollRight&&(a=this.scrollRight-this.width),this.tooltip.css({"left":a,"top":b}))},"remove":function(){this.tooltip.remove(),this.sizetip.remove(),this.sizetip=this.tooltip=c,d(window).unbind("resize.jqs scroll.jqs")}}),E=function(){p(D)},d(E),J=[],d.fn.sparkline=function(b,e){return this.each(function(){var f,g,h=new d.fn.sparkline.options(this,e),i=d(this);if(f=function(){var e,f,g,j,k,l,m;return"html"===b||b===c?(m=this.getAttribute(h.get("tagValuesAttribute")),(m===c||null===m)&&(m=i.html()),e=m.replace(/(^\s*<!--)|(-->\s*$)|\s+/g,"").split(",")):e=b,f="auto"===h.get("width")?e.length*h.get("defaultPixelsPerValue"):h.get("width"),"auto"===h.get("height")?h.get("composite")&&d.data(this,"_jqs_vcanvas")||(j=a.createElement("span"),j.innerHTML="a",i.html(j),g=d(j).innerHeight()||d(j).height(),d(j).remove(),j=null):g=h.get("height"),h.get("disableInteraction")?k=!1:(k=d.data(this,"_jqs_mhandler"),k?h.get("composite")||k.reset():(k=new t(this,h),d.data(this,"_jqs_mhandler",k))),h.get("composite")&&!d.data(this,"_jqs_vcanvas")?void(d.data(this,"_jqs_errnotify")||(alert("Attempted to attach a composite sparkline to an element with no existing sparkline"),d.data(this,"_jqs_errnotify",!0))):(l=new(d.fn.sparkline[h.get("type")])(this,e,h,f,g),l.render(),void(k&&k.registerSparkline(l)))},d(this).html()&&!h.get("disableHiddenCheck")&&d(this).is(":hidden")||!d(this).parents("body").length){if(!h.get("composite")&&d.data(this,"_jqs_pending"))for(g=J.length;g;g--)J[g-1][0]==this&&J.splice(g-1,1);J.push([this,f]),d.data(this,"_jqs_pending",!0)}else f.call(this)})},d.fn.sparkline.defaults=e(),d.sparkline_display_visible=function(){var a,b,c,e=[];for(b=0,c=J.length;c>b;b++)a=J[b][0],d(a).is(":visible")&&!d(a).parents().is(":hidden")?(J[b][1].call(a),d.data(J[b][0],"_jqs_pending",!1),e.push(b)):d(a).closest("html").length||d.data(a,"_jqs_pending")||(d.data(J[b][0],"_jqs_pending",!1),e.push(b));for(b=e.length;b;b--)J.splice(e[b-1],1)},d.fn.sparkline.options=f({"init":function(a,b){var c,e,f,g;this.userOptions=b=b||{},this.tag=a,this.tagValCache={},e=d.fn.sparkline.defaults,f=e.common,this.tagOptionsPrefix=b.enableTagOptions&&(b.tagOptionsPrefix||f.tagOptionsPrefix),g=this.getTagSetting("type"),c=g===K?e[b.type||f.type]:e[g],this.mergedOptions=d.extend({},f,c,b)},"getTagSetting":function(a){var b,d,e,f,g=this.tagOptionsPrefix;if(g===!1||g===c)return K;if(this.tagValCache.hasOwnProperty(a))b=this.tagValCache.key;else{if(b=this.tag.getAttribute(g+a),b===c||null===b)b=K;else if("["===b.substr(0,1))for(b=b.substr(1,b.length-2).split(","),d=b.length;d--;)b[d]=j(b[d].replace(/(^\s*)|(\s*$)/g,""));else if("{"===b.substr(0,1))for(e=b.substr(1,b.length-2).split(","),b={},d=e.length;d--;)f=e[d].split(":",2),b[f[0].replace(/(^\s*)|(\s*$)/g,"")]=j(f[1].replace(/(^\s*)|(\s*$)/g,""));else b=j(b);this.tagValCache.key=b}return b},"get":function(a,b){var d,e=this.getTagSetting(a);return e!==K?e:(d=this.mergedOptions[a])===c?b:d}}),d.fn.sparkline._base=f({"disabled":!1,"init":function(a,b,e,f,g){this.el=a,this.$el=d(a),this.values=b,this.options=e,this.width=f,this.height=g,this.currentRegion=c},"initTarget":function(){var a=!this.options.get("disableInteraction");(this.target=this.$el.simpledraw(this.width,this.height,this.options.get("composite"),a))?(this.canvasWidth=this.target.pixelWidth,this.canvasHeight=this.target.pixelHeight):this.disabled=!0},"render":function(){return this.disabled?(this.el.innerHTML="",!1):!0},"getRegion":function(){},"setRegionHighlight":function(a,b,d){var e,f=this.currentRegion,g=!this.options.get("disableHighlight");return b>this.canvasWidth||d>this.canvasHeight||0>b||0>d?null:(e=this.getRegion(a,b,d),f!==e?(f!==c&&g&&this.removeHighlight(),this.currentRegion=e,e!==c&&g&&this.renderHighlight(),!0):!1)},"clearRegionHighlight":function(){return this.currentRegion!==c?(this.removeHighlight(),this.currentRegion=c,!0):!1},"renderHighlight":function(){this.changeHighlight(!0)},"removeHighlight":function(){this.changeHighlight(!1)},"changeHighlight":function(){},"getCurrentRegionTooltip":function(){var a,b,e,f,h,i,j,k,l,m,n,o,p,q,r=this.options,s="",t=[];if(this.currentRegion===c)return"";if(a=this.getCurrentRegionFields(),n=r.get("tooltipFormatter"))return n(this,r,a);if(r.get("tooltipChartTitle")&&(s+='<div class="jqs jqstitle">'+r.get("tooltipChartTitle")+"</div>\n"),b=this.options.get("tooltipFormat"),!b)return"";if(d.isArray(b)||(b=[b]),d.isArray(a)||(a=[a]),j=this.options.get("tooltipFormatFieldlist"),k=this.options.get("tooltipFormatFieldlistKey"),j&&k){for(l=[],i=a.length;i--;)m=a[i][k],-1!=(q=d.inArray(m,j))&&(l[q]=a[i]);a=l}for(e=b.length,p=a.length,i=0;e>i;i++)for(o=b[i],"string"==typeof o&&(o=new g(o)),f=o.fclass||"jqsfield",q=0;p>q;q++)a[q].isNull&&r.get("tooltipSkipNull")||(d.extend(a[q],{"prefix":r.get("tooltipPrefix"),"suffix":r.get("tooltipSuffix")}),h=o.render(a[q],r.get("tooltipValueLookups"),r),t.push('<div class="'+f+'">'+h+"</div>"));return t.length?s+t.join("\n"):""},"getCurrentRegionFields":function(){},"calcHighlightColor":function(a,c){var d,e,f,g,i=c.get("highlightColor"),j=c.get("highlightLighten");if(i)return i;if(j&&(d=/^#([0-9a-f])([0-9a-f])([0-9a-f])$/i.exec(a)||/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(a))){for(f=[],e=4===a.length?16:1,g=0;3>g;g++)f[g]=h(b.round(parseInt(d[g+1],16)*e*j),0,255);return"rgb("+f.join(",")+")"}return a}}),v={"changeHighlight":function(a){var b,c=this.currentRegion,e=this.target,f=this.regionShapes[c];f&&(b=this.renderRegion(c,a),d.isArray(b)||d.isArray(f)?(e.replaceWithShapes(f,b),this.regionShapes[c]=d.map(b,function(a){return a.id})):(e.replaceWithShape(f,b),this.regionShapes[c]=b.id))},"render":function(){var a,b,c,e,f=this.values,g=this.target,h=this.regionShapes;if(this.cls._super.render.call(this)){for(c=f.length;c--;)if(a=this.renderRegion(c))if(d.isArray(a)){for(b=[],e=a.length;e--;)a[e].append(),b.push(a[e].id);h[c]=b}else a.append(),h[c]=a.id;else h[c]=null;g.render()}}},d.fn.sparkline.line=w=f(d.fn.sparkline._base,{"type":"line","init":function(a,b,c,d,e){w._super.init.call(this,a,b,c,d,e),this.vertices=[],this.regionMap=[],this.xvalues=[],this.yvalues=[],this.yminmax=[],this.hightlightSpotId=null,this.lastShapeId=null,this.initTarget()},"getRegion":function(a,b){var d,e=this.regionMap;for(d=e.length;d--;)if(null!==e[d]&&b>=e[d][0]&&b<=e[d][1])return e[d][2];return c},"getCurrentRegionFields":function(){var a=this.currentRegion;return{"isNull":null===this.yvalues[a],"x":this.xvalues[a],"y":this.yvalues[a],"color":this.options.get("lineColor"),"fillColor":this.options.get("fillColor"),"offset":a}},"renderHighlight":function(){var a,b,d=this.currentRegion,e=this.target,f=this.vertices[d],g=this.options,h=g.get("spotRadius"),i=g.get("highlightSpotColor"),j=g.get("highlightLineColor");f&&(h&&i&&(a=e.drawCircle(f[0],f[1],h,c,i),this.highlightSpotId=a.id,e.insertAfterShape(this.lastShapeId,a)),j&&(b=e.drawLine(f[0],this.canvasTop,f[0],this.canvasTop+this.canvasHeight,j),this.highlightLineId=b.id,e.insertAfterShape(this.lastShapeId,b)))},"removeHighlight":function(){var a=this.target;this.highlightSpotId&&(a.removeShapeId(this.highlightSpotId),this.highlightSpotId=null),this.highlightLineId&&(a.removeShapeId(this.highlightLineId),this.highlightLineId=null)},"scanValues":function(){var a,c,d,e,f,g=this.values,h=g.length,i=this.xvalues,j=this.yvalues,k=this.yminmax;for(a=0;h>a;a++)c=g[a],d="string"==typeof g[a],e="object"==typeof g[a]&&g[a]instanceof Array,f=d&&g[a].split(":"),d&&2===f.length?(i.push(Number(f[0])),j.push(Number(f[1])),k.push(Number(f[1]))):e?(i.push(c[0]),j.push(c[1]),k.push(c[1])):(i.push(a),null===g[a]||"null"===g[a]?j.push(null):(j.push(Number(c)),k.push(Number(c))));this.options.get("xvalues")&&(i=this.options.get("xvalues")),this.maxy=this.maxyorg=b.max.apply(b,k),this.miny=this.minyorg=b.min.apply(b,k),this.maxx=b.max.apply(b,i),this.minx=b.min.apply(b,i),this.xvalues=i,this.yvalues=j,this.yminmax=k},"processRangeOptions":function(){var a=this.options,b=a.get("normalRangeMin"),d=a.get("normalRangeMax");b!==c&&(b<this.miny&&(this.miny=b),d>this.maxy&&(this.maxy=d)),a.get("chartRangeMin")!==c&&(a.get("chartRangeClip")||a.get("chartRangeMin")<this.miny)&&(this.miny=a.get("chartRangeMin")),a.get("chartRangeMax")!==c&&(a.get("chartRangeClip")||a.get("chartRangeMax")>this.maxy)&&(this.maxy=a.get("chartRangeMax")),a.get("chartRangeMinX")!==c&&(a.get("chartRangeClipX")||a.get("chartRangeMinX")<this.minx)&&(this.minx=a.get("chartRangeMinX")),a.get("chartRangeMaxX")!==c&&(a.get("chartRangeClipX")||a.get("chartRangeMaxX")>this.maxx)&&(this.maxx=a.get("chartRangeMaxX"))},"drawNormalRange":function(a,d,e,f,g){var h=this.options.get("normalRangeMin"),i=this.options.get("normalRangeMax"),j=d+b.round(e-e*((i-this.miny)/g)),k=b.round(e*(i-h)/g);this.target.drawRect(a,j,f,k,c,this.options.get("normalRangeColor")).append()},"render":function(){var a,e,f,g,h,i,j,k,l,m,n,o,p,q,r,t,u,v,x,y,z,A,B,C,D,E=this.options,F=this.target,G=this.canvasWidth,H=this.canvasHeight,I=this.vertices,J=E.get("spotRadius"),K=this.regionMap;if(w._super.render.call(this)&&(this.scanValues(),this.processRangeOptions(),B=this.xvalues,C=this.yvalues,this.yminmax.length&&!(this.yvalues.length<2))){for(g=h=0,a=this.maxx-this.minx===0?1:this.maxx-this.minx,e=this.maxy-this.miny===0?1:this.maxy-this.miny,f=this.yvalues.length-1,J&&(4*J>G||4*J>H)&&(J=0),J&&(z=E.get("highlightSpotColor")&&!E.get("disableInteraction"),(z||E.get("minSpotColor")||E.get("spotColor")&&C[f]===this.miny)&&(H-=b.ceil(J)),(z||E.get("maxSpotColor")||E.get("spotColor")&&C[f]===this.maxy)&&(H-=b.ceil(J),g+=b.ceil(J)),(z||(E.get("minSpotColor")||E.get("maxSpotColor"))&&(C[0]===this.miny||C[0]===this.maxy))&&(h+=b.ceil(J),G-=b.ceil(J)),(z||E.get("spotColor")||E.get("minSpotColor")||E.get("maxSpotColor")&&(C[f]===this.miny||C[f]===this.maxy))&&(G-=b.ceil(J))),H--,E.get("normalRangeMin")===c||E.get("drawNormalOnTop")||this.drawNormalRange(h,g,H,G,e),j=[],k=[j],q=r=null,t=C.length,D=0;t>D;D++)l=B[D],n=B[D+1],m=C[D],o=h+b.round((l-this.minx)*(G/a)),p=t-1>D?h+b.round((n-this.minx)*(G/a)):G,r=o+(p-o)/2,K[D]=[q||0,r,D],q=r,null===m?D&&(null!==C[D-1]&&(j=[],k.push(j)),I.push(null)):(m<this.miny&&(m=this.miny),m>this.maxy&&(m=this.maxy),j.length||j.push([o,g+H]),i=[o,g+b.round(H-H*((m-this.miny)/e))],j.push(i),I.push(i));for(u=[],v=[],x=k.length,D=0;x>D;D++)j=k[D],j.length&&(E.get("fillColor")&&(j.push([j[j.length-1][0],g+H]),v.push(j.slice(0)),j.pop()),j.length>2&&(j[0]=[j[0][0],j[1][1]]),u.push(j));for(x=v.length,D=0;x>D;D++)F.drawShape(v[D],E.get("fillColor"),E.get("fillColor")).append();for(E.get("normalRangeMin")!==c&&E.get("drawNormalOnTop")&&this.drawNormalRange(h,g,H,G,e),x=u.length,D=0;x>D;D++)F.drawShape(u[D],E.get("lineColor"),c,E.get("lineWidth")).append();if(J&&E.get("valueSpots"))for(y=E.get("valueSpots"),y.get===c&&(y=new s(y)),D=0;t>D;D++)A=y.get(C[D]),A&&F.drawCircle(h+b.round((B[D]-this.minx)*(G/a)),g+b.round(H-H*((C[D]-this.miny)/e)),J,c,A).append();J&&E.get("spotColor")&&null!==C[f]&&F.drawCircle(h+b.round((B[B.length-1]-this.minx)*(G/a)),g+b.round(H-H*((C[f]-this.miny)/e)),J,c,E.get("spotColor")).append(),this.maxy!==this.minyorg&&(J&&E.get("minSpotColor")&&(l=B[d.inArray(this.minyorg,C)],F.drawCircle(h+b.round((l-this.minx)*(G/a)),g+b.round(H-H*((this.minyorg-this.miny)/e)),J,c,E.get("minSpotColor")).append()),J&&E.get("maxSpotColor")&&(l=B[d.inArray(this.maxyorg,C)],F.drawCircle(h+b.round((l-this.minx)*(G/a)),g+b.round(H-H*((this.maxyorg-this.miny)/e)),J,c,E.get("maxSpotColor")).append())),this.lastShapeId=F.getLastShapeId(),this.canvasTop=g,F.render()}}}),d.fn.sparkline.bar=x=f(d.fn.sparkline._base,v,{"type":"bar","init":function(a,e,f,g,i){var m,n,o,p,q,r,t,u,v,w,y,z,A,B,C,D,E,F,G,H,I,J,K=parseInt(f.get("barWidth"),10),L=parseInt(f.get("barSpacing"),10),M=f.get("chartRangeMin"),N=f.get("chartRangeMax"),O=f.get("chartRangeClip"),P=1/0,Q=-1/0;for(x._super.init.call(this,a,e,f,g,i),r=0,t=e.length;t>r;r++)H=e[r],m="string"==typeof H&&H.indexOf(":")>-1,(m||d.isArray(H))&&(C=!0,m&&(H=e[r]=k(H.split(":"))),H=l(H,null),n=b.min.apply(b,H),o=b.max.apply(b,H),P>n&&(P=n),o>Q&&(Q=o));this.stacked=C,this.regionShapes={},this.barWidth=K,this.barSpacing=L,this.totalBarWidth=K+L,this.width=g=e.length*K+(e.length-1)*L,this.initTarget(),O&&(A=M===c?-1/0:M,B=N===c?1/0:N),q=[],p=C?[]:q;var R=[],S=[];for(r=0,t=e.length;t>r;r++)if(C)for(D=e[r],e[r]=G=[],R[r]=0,p[r]=S[r]=0,E=0,F=D.length;F>E;E++)H=G[E]=O?h(D[E],A,B):D[E],null!==H&&(H>0&&(R[r]+=H),0>P&&Q>0?0>H?S[r]+=b.abs(H):p[r]+=H:p[r]+=b.abs(H-(0>H?Q:P)),q.push(H));else H=O?h(e[r],A,B):e[r],H=e[r]=j(H),null!==H&&q.push(H);this.max=z=b.max.apply(b,q),this.min=y=b.min.apply(b,q),this.stackMax=Q=C?b.max.apply(b,R):z,this.stackMin=P=C?b.min.apply(b,q):y,f.get("chartRangeMin")!==c&&(f.get("chartRangeClip")||f.get("chartRangeMin")<y)&&(y=f.get("chartRangeMin")),f.get("chartRangeMax")!==c&&(f.get("chartRangeClip")||f.get("chartRangeMax")>z)&&(z=f.get("chartRangeMax")),this.zeroAxis=v=f.get("zeroAxis",!0),w=0>=y&&z>=0&&v?0:0==v?y:y>0?y:z,this.xaxisOffset=w,u=C?b.max.apply(b,p)+b.max.apply(b,S):z-y,this.canvasHeightEf=v&&0>y?this.canvasHeight-2:this.canvasHeight-1,w>y?(J=C&&z>=0?Q:z,I=(J-w)/u*this.canvasHeight,I!==b.ceil(I)&&(this.canvasHeightEf-=2,I=b.ceil(I))):I=this.canvasHeight,this.yoffset=I,d.isArray(f.get("colorMap"))?(this.colorMapByIndex=f.get("colorMap"),this.colorMapByValue=null):(this.colorMapByIndex=null,this.colorMapByValue=f.get("colorMap"),this.colorMapByValue&&this.colorMapByValue.get===c&&(this.colorMapByValue=new s(this.colorMapByValue))),this.range=u},"getRegion":function(a,d){var e=b.floor(d/this.totalBarWidth);return 0>e||e>=this.values.length?c:e},"getCurrentRegionFields":function(){var a,b,c=this.currentRegion,d=q(this.values[c]),e=[];for(b=d.length;b--;)a=d[b],e.push({"isNull":null===a,"value":a,"color":this.calcColor(b,a,c),"offset":c});return e},"calcColor":function(a,b,e){var f,g,h=this.colorMapByIndex,i=this.colorMapByValue,j=this.options;return f=j.get(this.stacked?"stackedBarColor":0>b?"negBarColor":"barColor"),0===b&&j.get("zeroColor")!==c&&(f=j.get("zeroColor")),i&&(g=i.get(b))?f=g:h&&h.length>e&&(f=h[e]),d.isArray(f)?f[a%f.length]:f},"renderRegion":function(a,e){var f,g,h,i,j,k,l,m,o,p,q=this.values[a],r=this.options,s=this.xaxisOffset,t=[],u=this.range,v=this.stacked,w=this.target,x=a*this.totalBarWidth,y=this.canvasHeightEf,z=this.yoffset;if(q=d.isArray(q)?q:[q],l=q.length,m=q[0],i=n(null,q),p=n(s,q,!0),i)return r.get("nullColor")?(h=e?r.get("nullColor"):this.calcHighlightColor(r.get("nullColor"),r),f=z>0?z-1:z,w.drawRect(x,f,this.barWidth-1,0,h,h)):c;for(j=z,k=0;l>k;k++){if(m=q[k],v&&m===s){if(!p||o)continue;o=!0}g=u>0?b.floor(y*(b.abs(m-s)/u))+1:1,s>m||m===s&&0===z?(f=j,j+=g):(f=z-g,z-=g),h=this.calcColor(k,m,a),e&&(h=this.calcHighlightColor(h,r)),t.push(w.drawRect(x,f,this.barWidth-1,g-1,h,h))}return 1===t.length?t[0]:t}}),d.fn.sparkline.tristate=y=f(d.fn.sparkline._base,v,{"type":"tristate","init":function(a,b,e,f,g){var h=parseInt(e.get("barWidth"),10),i=parseInt(e.get("barSpacing"),10);y._super.init.call(this,a,b,e,f,g),this.regionShapes={},this.barWidth=h,this.barSpacing=i,this.totalBarWidth=h+i,this.values=d.map(b,Number),this.width=f=b.length*h+(b.length-1)*i,d.isArray(e.get("colorMap"))?(this.colorMapByIndex=e.get("colorMap"),this.colorMapByValue=null):(this.colorMapByIndex=null,this.colorMapByValue=e.get("colorMap"),this.colorMapByValue&&this.colorMapByValue.get===c&&(this.colorMapByValue=new s(this.colorMapByValue))),this.initTarget()},"getRegion":function(a,c){return b.floor(c/this.totalBarWidth)},"getCurrentRegionFields":function(){var a=this.currentRegion;return{"isNull":this.values[a]===c,"value":this.values[a],"color":this.calcColor(this.values[a],a),"offset":a}},"calcColor":function(a,b){var c,d,e=this.values,f=this.options,g=this.colorMapByIndex,h=this.colorMapByValue;return c=h&&(d=h.get(a))?d:g&&g.length>b?g[b]:f.get(e[b]<0?"negBarColor":e[b]>0?"posBarColor":"zeroBarColor")},"renderRegion":function(a,c){var d,e,f,g,h,i,j=this.values,k=this.options,l=this.target;return d=l.pixelHeight,f=b.round(d/2),g=a*this.totalBarWidth,j[a]<0?(h=f,e=f-1):j[a]>0?(h=0,e=f-1):(h=f-1,e=2),i=this.calcColor(j[a],a),null!==i?(c&&(i=this.calcHighlightColor(i,k)),l.drawRect(g,h,this.barWidth-1,e-1,i,i)):void 0}}),d.fn.sparkline.discrete=z=f(d.fn.sparkline._base,v,{"type":"discrete","init":function(a,e,f,g,h){z._super.init.call(this,a,e,f,g,h),this.regionShapes={},this.values=e=d.map(e,Number),this.min=b.min.apply(b,e),this.max=b.max.apply(b,e),this.range=this.max-this.min,this.width=g="auto"===f.get("width")?2*e.length:this.width,this.interval=b.floor(g/e.length),this.itemWidth=g/e.length,f.get("chartRangeMin")!==c&&(f.get("chartRangeClip")||f.get("chartRangeMin")<this.min)&&(this.min=f.get("chartRangeMin")),f.get("chartRangeMax")!==c&&(f.get("chartRangeClip")||f.get("chartRangeMax")>this.max)&&(this.max=f.get("chartRangeMax")),this.initTarget(),this.target&&(this.lineHeight="auto"===f.get("lineHeight")?b.round(.3*this.canvasHeight):f.get("lineHeight"))
|
|
},"getRegion":function(a,c){return b.floor(c/this.itemWidth)},"getCurrentRegionFields":function(){var a=this.currentRegion;return{"isNull":this.values[a]===c,"value":this.values[a],"offset":a}},"renderRegion":function(a,c){var d,e,f,g,i=this.values,j=this.options,k=this.min,l=this.max,m=this.range,n=this.interval,o=this.target,p=this.canvasHeight,q=this.lineHeight,r=p-q;return e=h(i[a],k,l),g=a*n,d=b.round(r-r*((e-k)/m)),f=j.get(j.get("thresholdColor")&&e<j.get("thresholdValue")?"thresholdColor":"lineColor"),c&&(f=this.calcHighlightColor(f,j)),o.drawLine(g,d,g,d+q,f)}}),d.fn.sparkline.bullet=A=f(d.fn.sparkline._base,{"type":"bullet","init":function(a,d,e,f,g){var h,i,j;A._super.init.call(this,a,d,e,f,g),this.values=d=k(d),j=d.slice(),j[0]=null===j[0]?j[2]:j[0],j[1]=null===d[1]?j[2]:j[1],h=b.min.apply(b,d),i=b.max.apply(b,d),h=e.get("base")===c?0>h?h:0:e.get("base"),this.min=h,this.max=i,this.range=i-h,this.shapes={},this.valueShapes={},this.regiondata={},this.width=f="auto"===e.get("width")?"4.0em":f,this.target=this.$el.simpledraw(f,g,e.get("composite")),d.length||(this.disabled=!0),this.initTarget()},"getRegion":function(a,b,d){var e=this.target.getShapeAt(a,b,d);return e!==c&&this.shapes[e]!==c?this.shapes[e]:c},"getCurrentRegionFields":function(){var a=this.currentRegion;return{"fieldkey":a.substr(0,1),"value":this.values[a.substr(1)],"region":a}},"changeHighlight":function(a){var b,c=this.currentRegion,d=this.valueShapes[c];switch(delete this.shapes[d],c.substr(0,1)){case"r":b=this.renderRange(c.substr(1),a);break;case"p":b=this.renderPerformance(a);break;case"t":b=this.renderTarget(a)}this.valueShapes[c]=b.id,this.shapes[b.id]=c,this.target.replaceWithShape(d,b)},"renderRange":function(a,c){var d=this.values[a],e=b.round(this.canvasWidth*((d-this.min)/this.range)),f=this.options.get("rangeColors")[a-2];return c&&(f=this.calcHighlightColor(f,this.options)),this.target.drawRect(0,0,e-1,this.canvasHeight-1,f,f)},"renderPerformance":function(a){var c=this.values[1],d=b.round(this.canvasWidth*((c-this.min)/this.range)),e=this.options.get("performanceColor");return a&&(e=this.calcHighlightColor(e,this.options)),this.target.drawRect(0,b.round(.3*this.canvasHeight),d-1,b.round(.4*this.canvasHeight)-1,e,e)},"renderTarget":function(a){var c=this.values[0],d=b.round(this.canvasWidth*((c-this.min)/this.range)-this.options.get("targetWidth")/2),e=b.round(.1*this.canvasHeight),f=this.canvasHeight-2*e,g=this.options.get("targetColor");return a&&(g=this.calcHighlightColor(g,this.options)),this.target.drawRect(d,e,this.options.get("targetWidth")-1,f-1,g,g)},"render":function(){var a,b,c=this.values.length,d=this.target;if(A._super.render.call(this)){for(a=2;c>a;a++)b=this.renderRange(a).append(),this.shapes[b.id]="r"+a,this.valueShapes["r"+a]=b.id;null!==this.values[1]&&(b=this.renderPerformance().append(),this.shapes[b.id]="p1",this.valueShapes.p1=b.id),null!==this.values[0]&&(b=this.renderTarget().append(),this.shapes[b.id]="t0",this.valueShapes.t0=b.id),d.render()}}}),d.fn.sparkline.pie=B=f(d.fn.sparkline._base,{"type":"pie","init":function(a,c,e,f,g){var h,i=0;if(B._super.init.call(this,a,c,e,f,g),this.shapes={},this.valueShapes={},this.values=c=d.map(c,Number),"auto"===e.get("width")&&(this.width=this.height),c.length>0)for(h=c.length;h--;)i+=c[h];this.total=i,this.initTarget(),this.radius=b.floor(b.min(this.canvasWidth,this.canvasHeight)/2)},"getRegion":function(a,b,d){var e=this.target.getShapeAt(a,b,d);return e!==c&&this.shapes[e]!==c?this.shapes[e]:c},"getCurrentRegionFields":function(){var a=this.currentRegion;return{"isNull":this.values[a]===c,"value":this.values[a],"percent":this.values[a]/this.total*100,"color":this.options.get("sliceColors")[a%this.options.get("sliceColors").length],"offset":a}},"changeHighlight":function(a){var b=this.currentRegion,c=this.renderSlice(b,a),d=this.valueShapes[b];delete this.shapes[d],this.target.replaceWithShape(d,c),this.valueShapes[b]=c.id,this.shapes[c.id]=b},"renderSlice":function(a,d){var e,f,g,h,i,j=this.target,k=this.options,l=this.radius,m=k.get("borderWidth"),n=k.get("offset"),o=2*b.PI,p=this.values,q=this.total,r=n?2*b.PI*(n/360):0;for(h=p.length,g=0;h>g;g++){if(e=r,f=r,q>0&&(f=r+o*(p[g]/q)),a===g)return i=k.get("sliceColors")[g%k.get("sliceColors").length],d&&(i=this.calcHighlightColor(i,k)),j.drawPieSlice(l,l,l-m,e,f,c,i);r=f}},"render":function(){var a,d,e=this.target,f=this.values,g=this.options,h=this.radius,i=g.get("borderWidth");if(B._super.render.call(this)){for(i&&e.drawCircle(h,h,b.floor(h-i/2),g.get("borderColor"),c,i).append(),d=f.length;d--;)f[d]&&(a=this.renderSlice(d).append(),this.valueShapes[d]=a.id,this.shapes[a.id]=d);e.render()}}}),d.fn.sparkline.box=C=f(d.fn.sparkline._base,{"type":"box","init":function(a,b,c,e,f){C._super.init.call(this,a,b,c,e,f),this.values=d.map(b,Number),this.width="auto"===c.get("width")?"4.0em":e,this.initTarget(),this.values.length||(this.disabled=1)},"getRegion":function(){return 1},"getCurrentRegionFields":function(){var a=[{"field":"lq","value":this.quartiles[0]},{"field":"med","value":this.quartiles[1]},{"field":"uq","value":this.quartiles[2]}];return this.loutlier!==c&&a.push({"field":"lo","value":this.loutlier}),this.routlier!==c&&a.push({"field":"ro","value":this.routlier}),this.lwhisker!==c&&a.push({"field":"lw","value":this.lwhisker}),this.rwhisker!==c&&a.push({"field":"rw","value":this.rwhisker}),a},"render":function(){var a,d,e,f,g,h,j,k,l,m,n,o=this.target,p=this.values,q=p.length,r=this.options,s=this.canvasWidth,t=this.canvasHeight,u=r.get("chartRangeMin")===c?b.min.apply(b,p):r.get("chartRangeMin"),v=r.get("chartRangeMax")===c?b.max.apply(b,p):r.get("chartRangeMax"),w=0;if(C._super.render.call(this)){if(r.get("raw"))r.get("showOutliers")&&p.length>5?(d=p[0],a=p[1],f=p[2],g=p[3],h=p[4],j=p[5],k=p[6]):(a=p[0],f=p[1],g=p[2],h=p[3],j=p[4]);else if(p.sort(function(a,b){return a-b}),f=i(p,1),g=i(p,2),h=i(p,3),e=h-f,r.get("showOutliers")){for(a=j=c,l=0;q>l;l++)a===c&&p[l]>f-e*r.get("outlierIQR")&&(a=p[l]),p[l]<h+e*r.get("outlierIQR")&&(j=p[l]);d=p[0],k=p[q-1]}else a=p[0],j=p[q-1];this.quartiles=[f,g,h],this.lwhisker=a,this.rwhisker=j,this.loutlier=d,this.routlier=k,n=s/(v-u+1),r.get("showOutliers")&&(w=b.ceil(r.get("spotRadius")),s-=2*b.ceil(r.get("spotRadius")),n=s/(v-u+1),a>d&&o.drawCircle((d-u)*n+w,t/2,r.get("spotRadius"),r.get("outlierLineColor"),r.get("outlierFillColor")).append(),k>j&&o.drawCircle((k-u)*n+w,t/2,r.get("spotRadius"),r.get("outlierLineColor"),r.get("outlierFillColor")).append()),o.drawRect(b.round((f-u)*n+w),b.round(.1*t),b.round((h-f)*n),b.round(.8*t),r.get("boxLineColor"),r.get("boxFillColor")).append(),o.drawLine(b.round((a-u)*n+w),b.round(t/2),b.round((f-u)*n+w),b.round(t/2),r.get("lineColor")).append(),o.drawLine(b.round((a-u)*n+w),b.round(t/4),b.round((a-u)*n+w),b.round(t-t/4),r.get("whiskerColor")).append(),o.drawLine(b.round((j-u)*n+w),b.round(t/2),b.round((h-u)*n+w),b.round(t/2),r.get("lineColor")).append(),o.drawLine(b.round((j-u)*n+w),b.round(t/4),b.round((j-u)*n+w),b.round(t-t/4),r.get("whiskerColor")).append(),o.drawLine(b.round((g-u)*n+w),b.round(.1*t),b.round((g-u)*n+w),b.round(.9*t),r.get("medianColor")).append(),r.get("target")&&(m=b.ceil(r.get("spotRadius")),o.drawLine(b.round((r.get("target")-u)*n+w),b.round(t/2-m),b.round((r.get("target")-u)*n+w),b.round(t/2+m),r.get("targetColor")).append(),o.drawLine(b.round((r.get("target")-u)*n+w-m),b.round(t/2),b.round((r.get("target")-u)*n+w+m),b.round(t/2),r.get("targetColor")).append()),o.render()}}}),F=f({"init":function(a,b,c,d){this.target=a,this.id=b,this.type=c,this.args=d},"append":function(){return this.target.appendShape(this),this}}),G=f({"_pxregex":/(\d+)(px)?\s*$/i,"init":function(a,b,c){a&&(this.width=a,this.height=b,this.target=c,this.lastShapeId=null,c[0]&&(c=c[0]),d.data(c,"_jqs_vcanvas",this))},"drawLine":function(a,b,c,d,e,f){return this.drawShape([[a,b],[c,d]],e,f)},"drawShape":function(a,b,c,d){return this._genShape("Shape",[a,b,c,d])},"drawCircle":function(a,b,c,d,e,f){return this._genShape("Circle",[a,b,c,d,e,f])},"drawPieSlice":function(a,b,c,d,e,f,g){return this._genShape("PieSlice",[a,b,c,d,e,f,g])},"drawRect":function(a,b,c,d,e,f){return this._genShape("Rect",[a,b,c,d,e,f])},"getElement":function(){return this.canvas},"getLastShapeId":function(){return this.lastShapeId},"reset":function(){alert("reset not implemented")},"_insert":function(a,b){d(b).html(a)},"_calculatePixelDims":function(a,b,c){var e;e=this._pxregex.exec(b),this.pixelHeight=e?e[1]:d(c).height(),e=this._pxregex.exec(a),this.pixelWidth=e?e[1]:d(c).width()},"_genShape":function(a,b){var c=L++;return b.unshift(c),new F(this,c,a,b)},"appendShape":function(){alert("appendShape not implemented")},"replaceWithShape":function(){alert("replaceWithShape not implemented")},"insertAfterShape":function(){alert("insertAfterShape not implemented")},"removeShapeId":function(){alert("removeShapeId not implemented")},"getShapeAt":function(){alert("getShapeAt not implemented")},"render":function(){alert("render not implemented")}}),H=f(G,{"init":function(b,e,f,g){H._super.init.call(this,b,e,f),this.canvas=a.createElement("canvas"),f[0]&&(f=f[0]),d.data(f,"_jqs_vcanvas",this),d(this.canvas).css({"display":"inline-block","width":b,"height":e,"verticalAlign":"top"}),this._insert(this.canvas,f),this._calculatePixelDims(b,e,this.canvas),this.canvas.width=this.pixelWidth,this.canvas.height=this.pixelHeight,this.interact=g,this.shapes={},this.shapeseq=[],this.currentTargetShapeId=c,d(this.canvas).css({"width":this.pixelWidth,"height":this.pixelHeight})},"_getContext":function(a,b,d){var e=this.canvas.getContext("2d");return a!==c&&(e.strokeStyle=a),e.lineWidth=d===c?1:d,b!==c&&(e.fillStyle=b),e},"reset":function(){var a=this._getContext();a.clearRect(0,0,this.pixelWidth,this.pixelHeight),this.shapes={},this.shapeseq=[],this.currentTargetShapeId=c},"_drawShape":function(a,b,d,e,f){var g,h,i=this._getContext(d,e,f);for(i.beginPath(),i.moveTo(b[0][0]+.5,b[0][1]+.5),g=1,h=b.length;h>g;g++)i.lineTo(b[g][0]+.5,b[g][1]+.5);d!==c&&i.stroke(),e!==c&&i.fill(),this.targetX!==c&&this.targetY!==c&&i.isPointInPath(this.targetX,this.targetY)&&(this.currentTargetShapeId=a)},"_drawCircle":function(a,d,e,f,g,h,i){var j=this._getContext(g,h,i);j.beginPath(),j.arc(d,e,f,0,2*b.PI,!1),this.targetX!==c&&this.targetY!==c&&j.isPointInPath(this.targetX,this.targetY)&&(this.currentTargetShapeId=a),g!==c&&j.stroke(),h!==c&&j.fill()},"_drawPieSlice":function(a,b,d,e,f,g,h,i){var j=this._getContext(h,i);j.beginPath(),j.moveTo(b,d),j.arc(b,d,e,f,g,!1),j.lineTo(b,d),j.closePath(),h!==c&&j.stroke(),i&&j.fill(),this.targetX!==c&&this.targetY!==c&&j.isPointInPath(this.targetX,this.targetY)&&(this.currentTargetShapeId=a)},"_drawRect":function(a,b,c,d,e,f,g){return this._drawShape(a,[[b,c],[b+d,c],[b+d,c+e],[b,c+e],[b,c]],f,g)},"appendShape":function(a){return this.shapes[a.id]=a,this.shapeseq.push(a.id),this.lastShapeId=a.id,a.id},"replaceWithShape":function(a,b){var c,d=this.shapeseq;for(this.shapes[b.id]=b,c=d.length;c--;)d[c]==a&&(d[c]=b.id);delete this.shapes[a]},"replaceWithShapes":function(a,b){var c,d,e,f=this.shapeseq,g={};for(d=a.length;d--;)g[a[d]]=!0;for(d=f.length;d--;)c=f[d],g[c]&&(f.splice(d,1),delete this.shapes[c],e=d);for(d=b.length;d--;)f.splice(e,0,b[d].id),this.shapes[b[d].id]=b[d]},"insertAfterShape":function(a,b){var c,d=this.shapeseq;for(c=d.length;c--;)if(d[c]===a)return d.splice(c+1,0,b.id),void(this.shapes[b.id]=b)},"removeShapeId":function(a){var b,c=this.shapeseq;for(b=c.length;b--;)if(c[b]===a){c.splice(b,1);break}delete this.shapes[a]},"getShapeAt":function(a,b,c){return this.targetX=b,this.targetY=c,this.render(),this.currentTargetShapeId},"render":function(){var a,b,c,d=this.shapeseq,e=this.shapes,f=d.length,g=this._getContext();for(g.clearRect(0,0,this.pixelWidth,this.pixelHeight),c=0;f>c;c++)a=d[c],b=e[a],this["_draw"+b.type].apply(this,b.args);this.interact||(this.shapes={},this.shapeseq=[])}}),I=f(G,{"init":function(b,c,e){var f;I._super.init.call(this,b,c,e),e[0]&&(e=e[0]),d.data(e,"_jqs_vcanvas",this),this.canvas=a.createElement("span"),d(this.canvas).css({"display":"inline-block","position":"relative","overflow":"hidden","width":b,"height":c,"margin":"0px","padding":"0px","verticalAlign":"top"}),this._insert(this.canvas,e),this._calculatePixelDims(b,c,this.canvas),this.canvas.width=this.pixelWidth,this.canvas.height=this.pixelHeight,f='<v:group coordorigin="0 0" coordsize="'+this.pixelWidth+" "+this.pixelHeight+'" style="position:absolute;top:0;left:0;width:'+this.pixelWidth+"px;height="+this.pixelHeight+'px;"></v:group>',this.canvas.insertAdjacentHTML("beforeEnd",f),this.group=d(this.canvas).children()[0],this.rendered=!1,this.prerender=""},"_drawShape":function(a,b,d,e,f){var g,h,i,j,k,l,m,n=[];for(m=0,l=b.length;l>m;m++)n[m]=""+b[m][0]+","+b[m][1];return g=n.splice(0,1),f=f===c?1:f,h=d===c?' stroked="false" ':' strokeWeight="'+f+'px" strokeColor="'+d+'" ',i=e===c?' filled="false"':' fillColor="'+e+'" filled="true" ',j=n[0]===n[n.length-1]?"x ":"",k='<v:shape coordorigin="0 0" coordsize="'+this.pixelWidth+" "+this.pixelHeight+'" id="jqsshape'+a+'" '+h+i+' style="position:absolute;left:0px;top:0px;height:'+this.pixelHeight+"px;width:"+this.pixelWidth+'px;padding:0px;margin:0px;" path="m '+g+" l "+n.join(", ")+" "+j+'e"> </v:shape>'},"_drawCircle":function(a,b,d,e,f,g,h){var i,j,k;return b-=e,d-=e,i=f===c?' stroked="false" ':' strokeWeight="'+h+'px" strokeColor="'+f+'" ',j=g===c?' filled="false"':' fillColor="'+g+'" filled="true" ',k='<v:oval id="jqsshape'+a+'" '+i+j+' style="position:absolute;top:'+d+"px; left:"+b+"px; width:"+2*e+"px; height:"+2*e+'px"></v:oval>'},"_drawPieSlice":function(a,d,e,f,g,h,i,j){var k,l,m,n,o,p,q,r;if(g===h)return"";if(h-g===2*b.PI&&(g=0,h=2*b.PI),l=d+b.round(b.cos(g)*f),m=e+b.round(b.sin(g)*f),n=d+b.round(b.cos(h)*f),o=e+b.round(b.sin(h)*f),l===n&&m===o){if(h-g<b.PI)return"";l=n=d+f,m=o=e}return l===n&&m===o&&h-g<b.PI?"":(k=[d-f,e-f,d+f,e+f,l,m,n,o],p=i===c?' stroked="false" ':' strokeWeight="1px" strokeColor="'+i+'" ',q=j===c?' filled="false"':' fillColor="'+j+'" filled="true" ',r='<v:shape coordorigin="0 0" coordsize="'+this.pixelWidth+" "+this.pixelHeight+'" id="jqsshape'+a+'" '+p+q+' style="position:absolute;left:0px;top:0px;height:'+this.pixelHeight+"px;width:"+this.pixelWidth+'px;padding:0px;margin:0px;" path="m '+d+","+e+" wa "+k.join(", ")+' x e"> </v:shape>')},"_drawRect":function(a,b,c,d,e,f,g){return this._drawShape(a,[[b,c],[b,c+e],[b+d,c+e],[b+d,c],[b,c]],f,g)},"reset":function(){this.group.innerHTML=""},"appendShape":function(a){var b=this["_draw"+a.type].apply(this,a.args);return this.rendered?this.group.insertAdjacentHTML("beforeEnd",b):this.prerender+=b,this.lastShapeId=a.id,a.id},"replaceWithShape":function(a,b){var c=d("#jqsshape"+a),e=this["_draw"+b.type].apply(this,b.args);c[0].outerHTML=e},"replaceWithShapes":function(a,b){var c,e=d("#jqsshape"+a[0]),f="",g=b.length;for(c=0;g>c;c++)f+=this["_draw"+b[c].type].apply(this,b[c].args);for(e[0].outerHTML=f,c=1;c<a.length;c++)d("#jqsshape"+a[c]).remove()},"insertAfterShape":function(a,b){var c=d("#jqsshape"+a),e=this["_draw"+b.type].apply(this,b.args);c[0].insertAdjacentHTML("afterEnd",e)},"removeShapeId":function(a){var b=d("#jqsshape"+a);this.group.removeChild(b[0])},"getShapeAt":function(a){var b=a.id.substr(8);return b},"render":function(){this.rendered||(this.group.innerHTML=this.prerender,this.rendered=!0)}})})}(document,Math),function(a,b){"object"==typeof exports?module.exports=b(require("jquery")):"function"==typeof define&&define.amd?define(["jquery"],b):b(a.jQuery)}(this,function(a){var b=function(a,b){var c,d=document.createElement("canvas");a.appendChild(d),"undefined"!=typeof G_vmlCanvasManager&&G_vmlCanvasManager.initElement(d);var e=d.getContext("2d");d.width=d.height=b.size;var f=1;window.devicePixelRatio>1&&(f=window.devicePixelRatio,d.style.width=d.style.height=[b.size,"px"].join(""),d.width=d.height=b.size*f,e.scale(f,f)),e.translate(b.size/2,b.size/2),e.rotate((-0.5+b.rotate/180)*Math.PI);var g=(b.size-b.lineWidth)/2;b.scaleColor&&b.scaleLength&&(g-=b.scaleLength+2),Date.now=Date.now||function(){return+new Date};var h=function(a,b,c){c=Math.min(Math.max(-1,c||0),1);var d=0>=c?!0:!1;e.beginPath(),e.arc(0,0,g,0,2*Math.PI*c,d),e.strokeStyle=a,e.lineWidth=b,e.stroke()},i=function(){var a,c;e.lineWidth=1,e.fillStyle=b.scaleColor,e.save();for(var d=24;d>0;--d)d%6===0?(c=b.scaleLength,a=0):(c=.6*b.scaleLength,a=b.scaleLength-c),e.fillRect(-b.size/2+a,0,c,1),e.rotate(Math.PI/12);e.restore()},j=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(a){window.setTimeout(a,1e3/60)}}(),k=function(){b.scaleColor&&i(),b.trackColor&&h(b.trackColor,b.lineWidth,1)};this.getCanvas=function(){return d},this.getCtx=function(){return e},this.clear=function(){e.clearRect(b.size/-2,b.size/-2,b.size,b.size)},this.draw=function(a){b.scaleColor||b.trackColor?e.getImageData&&e.putImageData?c?e.putImageData(c,0,0):(k(),c=e.getImageData(0,0,b.size*f,b.size*f)):(this.clear(),k()):this.clear(),e.lineCap=b.lineCap;var d;d="function"==typeof b.barColor?b.barColor(a):b.barColor,h(d,b.lineWidth,a/100)}.bind(this),this.animate=function(a,c){var d=Date.now();b.onStart(a,c);var e=function(){var f=Math.min(Date.now()-d,b.animate.duration),g=b.easing(this,f,a,c-a,b.animate.duration);this.draw(g),b.onStep(a,c,g),f>=b.animate.duration?b.onStop(a,c):j(e)}.bind(this);j(e)}.bind(this)},c=function(a,c){var d={"barColor":"#ef1e25","trackColor":"#f9f9f9","scaleColor":"#dfe0e0","scaleLength":5,"lineCap":"round","lineWidth":3,"size":110,"rotate":0,"animate":{"duration":1e3,"enabled":!0},"easing":function(a,b,c,d,e){return b/=e/2,1>b?d/2*b*b+c:-d/2*(--b*(b-2)-1)+c},"onStart":function(){},"onStep":function(){},"onStop":function(){}};if("undefined"!=typeof b)d.renderer=b;else{if("undefined"==typeof SVGRenderer)throw new Error("Please load either the SVG- or the CanvasRenderer");d.renderer=SVGRenderer}var e={},f=0,g=function(){this.el=a,this.options=e;for(var b in d)d.hasOwnProperty(b)&&(e[b]=c&&"undefined"!=typeof c[b]?c[b]:d[b],"function"==typeof e[b]&&(e[b]=e[b].bind(this)));e.easing="string"==typeof e.easing&&"undefined"!=typeof jQuery&&jQuery.isFunction(jQuery.easing[e.easing])?jQuery.easing[e.easing]:d.easing,"number"==typeof e.animate&&(e.animate={"duration":e.animate,"enabled":!0}),"boolean"!=typeof e.animate||e.animate||(e.animate={"duration":1e3,"enabled":e.animate}),this.renderer=new e.renderer(a,e),this.renderer.draw(f),a.dataset&&a.dataset.percent?this.update(parseFloat(a.dataset.percent)):a.getAttribute&&a.getAttribute("data-percent")&&this.update(parseFloat(a.getAttribute("data-percent")))}.bind(this);this.update=function(a){return a=parseFloat(a),e.animate.enabled?this.renderer.animate(f,a):this.renderer.draw(a),f=a,this}.bind(this),this.disableAnimation=function(){return e.animate.enabled=!1,this},this.enableAnimation=function(){return e.animate.enabled=!0,this},g()};a.fn.easyPieChart=function(b){return this.each(function(){var d;a.data(this,"easyPieChart")||(d=a.extend({},b,a(this).data()),a.data(this,"easyPieChart",new c(this,d)))})}}),function(a){jQuery.fn.extend({"slimScroll":function(b){var c={"width":"auto","height":"250px","size":"7px","color":"#000","position":"right","distance":"1px","start":"top","opacity":.4,"alwaysVisible":!1,"disableFadeOut":!1,"railVisible":!1,"railColor":"#333","railOpacity":.2,"railDraggable":!0,"railClass":"slimScrollRail","barClass":"slimScrollBar","wrapperClass":"slimScrollDiv","allowPageScroll":!1,"wheelStep":20,"touchScrollStep":200,"borderRadius":"7px","railBorderRadius":"7px"},d=a.extend(c,b);return this.each(function(){function c(b){if(j){var b=b||window.event,c=0;b.wheelDelta&&(c=-b.wheelDelta/120),b.detail&&(c=b.detail/3);var f=b.target||b.srcTarget||b.srcElement;a(f).closest("."+d.wrapperClass).is(v.parent())&&e(c,!0),b.preventDefault&&!u&&b.preventDefault(),u||(b.returnValue=!1)}}function e(a,b,c){u=!1;var e=a,f=v.outerHeight()-A.outerHeight();if(b&&(e=parseInt(A.css("top"))+a*parseInt(d.wheelStep)/100*A.outerHeight(),e=Math.min(Math.max(e,0),f),e=a>0?Math.ceil(e):Math.floor(e),A.css({"top":e+"px"})),p=parseInt(A.css("top"))/(v.outerHeight()-A.outerHeight()),e=p*(v[0].scrollHeight-v.outerHeight()),c){e=a;var g=e/v[0].scrollHeight*v.outerHeight();g=Math.min(Math.max(g,0),f),A.css({"top":g+"px"})}v.scrollTop(e),v.trigger("slimscrolling",~~e),h(),i()}function f(){window.addEventListener?(this.addEventListener("DOMMouseScroll",c,!1),this.addEventListener("mousewheel",c,!1)):document.attachEvent("onmousewheel",c)}function g(){o=Math.max(v.outerHeight()/v[0].scrollHeight*v.outerHeight(),s),A.css({"height":o+"px"});var a=o==v.outerHeight()?"none":"block";A.css({"display":a})}function h(){if(g(),clearTimeout(m),p==~~p){if(u=d.allowPageScroll,q!=p){var a=0==~~p?"top":"bottom";v.trigger("slimscroll",a)}}else u=!1;return q=p,o>=v.outerHeight()?void(u=!0):(A.stop(!0,!0).fadeIn("fast"),void(d.railVisible&&z.stop(!0,!0).fadeIn("fast")))}function i(){d.alwaysVisible||(m=setTimeout(function(){d.disableFadeOut&&j||k||l||(A.fadeOut("slow"),z.fadeOut("slow"))},1e3))}var j,k,l,m,n,o,p,q,r="<div></div>",s=30,u=!1,v=a(this);if(v.parent().hasClass(d.wrapperClass)){var w=v.scrollTop();if(A=v.parent().find("."+d.barClass),z=v.parent().find("."+d.railClass),g(),a.isPlainObject(b)){if("height"in b&&"auto"==b.height){v.parent().css("height","auto"),v.css("height","auto");var x=v.parent().parent().height();v.parent().css("height",x),v.css("height",x)}if("scrollTo"in b)w=parseInt(d.scrollTo);else if("scrollBy"in b)w+=parseInt(d.scrollBy);else if("destroy"in b)return A.remove(),z.remove(),void v.unwrap();e(w,!1,!0)}}else{d.height="auto"==b.height?v.parent().height():b.height;var y=a(r).addClass(d.wrapperClass).css({"position":"relative","overflow":"hidden","width":d.width,"height":d.height});v.css({"overflow":"hidden","width":d.width,"height":d.height});var z=a(r).addClass(d.railClass).css({"width":d.size,"height":"100%","position":"absolute","top":0,"display":d.alwaysVisible&&d.railVisible?"block":"none","border-radius":d.railBorderRadius,"background":d.railColor,"opacity":d.railOpacity,"zIndex":90}),A=a(r).addClass(d.barClass).css({"background":d.color,"width":d.size,"position":"absolute","top":0,"opacity":d.opacity,"display":d.alwaysVisible?"block":"none","border-radius":d.borderRadius,"BorderRadius":d.borderRadius,"MozBorderRadius":d.borderRadius,"WebkitBorderRadius":d.borderRadius,"zIndex":99}),B="right"==d.position?{"right":d.distance}:{"left":d.distance};z.css(B),A.css(B),v.wrap(y),v.parent().append(A),v.parent().append(z),d.railDraggable&&A.bind("mousedown",function(b){var c=a(document);return l=!0,t=parseFloat(A.css("top")),pageY=b.pageY,c.bind("mousemove.slimscroll",function(a){currTop=t+a.pageY-pageY,A.css("top",currTop),e(0,A.position().top,!1)}),c.bind("mouseup.slimscroll",function(){l=!1,i(),c.unbind(".slimscroll")}),!1}).bind("selectstart.slimscroll",function(a){return a.stopPropagation(),a.preventDefault(),!1}),z.hover(function(){h()},function(){i()}),A.hover(function(){k=!0},function(){k=!1}),v.hover(function(){j=!0,h(),i()},function(){j=!1,i()}),v.bind("touchstart",function(a){a.originalEvent.touches.length&&(n=a.originalEvent.touches[0].pageY)}),v.bind("touchmove",function(a){if(u||a.originalEvent.preventDefault(),a.originalEvent.touches.length){var b=(n-a.originalEvent.touches[0].pageY)/d.touchScrollStep;e(b,!0),n=a.originalEvent.touches[0].pageY}}),g(),"bottom"===d.start?(A.css({"top":v.outerHeight()-A.outerHeight()}),e(0,!0)):"top"!==d.start&&(e(a(d.start).position().top,null,!0),d.alwaysVisible||A.hide()),f()}}),this}}),jQuery.fn.extend({"slimscroll":jQuery.fn.slimScroll})}(jQuery),function(a){function b(){return{"empty":!1,"unusedTokens":[],"unusedInput":[],"overflow":-2,"charsLeftOver":0,"nullInput":!1,"invalidMonth":null,"invalidFormat":!1,"userInvalidated":!1,"iso":!1}}function c(a,b){return function(c){return k(a.call(this,c),b)}}function d(a,b){return function(c){return this.lang().ordinal(a.call(this,c),b)}}function e(){}function f(a){x(a),h(this,a)}function g(a){var b=q(a),c=b.year||0,d=b.month||0,e=b.week||0,f=b.day||0,g=b.hour||0,h=b.minute||0,i=b.second||0,j=b.millisecond||0;this._milliseconds=+j+1e3*i+6e4*h+36e5*g,this._days=+f+7*e,this._months=+d+12*c,this._data={},this._bubble()}function h(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c]);return b.hasOwnProperty("toString")&&(a.toString=b.toString),b.hasOwnProperty("valueOf")&&(a.valueOf=b.valueOf),a}function i(a){var b,c={};for(b in a)a.hasOwnProperty(b)&&rb.hasOwnProperty(b)&&(c[b]=a[b]);return c}function j(a){return 0>a?Math.ceil(a):Math.floor(a)}function k(a,b,c){for(var d=""+Math.abs(a),e=a>=0;d.length<b;)d="0"+d;return(e?c?"+":"":"-")+d}function l(a,b,c,d){var e,f,g=b._milliseconds,h=b._days,i=b._months;g&&a._d.setTime(+a._d+g*c),(h||i)&&(e=a.minute(),f=a.hour()),h&&a.date(a.date()+h*c),i&&a.month(a.month()+i*c),g&&!d&&eb.updateOffset(a,h||i),(h||i)&&(a.minute(e),a.hour(f))}function m(a){return"[object Array]"===Object.prototype.toString.call(a)}function n(a){return"[object Date]"===Object.prototype.toString.call(a)||a instanceof Date}function o(a,b,c){var d,e=Math.min(a.length,b.length),f=Math.abs(a.length-b.length),g=0;for(d=0;e>d;d++)(c&&a[d]!==b[d]||!c&&s(a[d])!==s(b[d]))&&g++;return g+f}function p(a){if(a){var b=a.toLowerCase().replace(/(.)s$/,"$1");a=Vb[a]||Wb[b]||b}return a}function q(a){var b,c,d={};for(c in a)a.hasOwnProperty(c)&&(b=p(c),b&&(d[b]=a[c]));return d}function r(b){var c,d;if(0===b.indexOf("week"))c=7,d="day";else{if(0!==b.indexOf("month"))return;c=12,d="month"}eb[b]=function(e,f){var g,h,i=eb.fn._lang[b],j=[];if("number"==typeof e&&(f=e,e=a),h=function(a){var b=eb().utc().set(d,a);return i.call(eb.fn._lang,b,e||"")},null!=f)return h(f);for(g=0;c>g;g++)j.push(h(g));return j}}function s(a){var b=+a,c=0;return 0!==b&&isFinite(b)&&(c=b>=0?Math.floor(b):Math.ceil(b)),c}function t(a,b){return new Date(Date.UTC(a,b+1,0)).getUTCDate()}function u(a,b,c){return Z(eb([a,11,31+b-c]),b,c).week}function v(a){return w(a)?366:365}function w(a){return a%4===0&&a%100!==0||a%400===0}function x(a){var b;a._a&&-2===a._pf.overflow&&(b=a._a[kb]<0||a._a[kb]>11?kb:a._a[lb]<1||a._a[lb]>t(a._a[jb],a._a[kb])?lb:a._a[mb]<0||a._a[mb]>23?mb:a._a[nb]<0||a._a[nb]>59?nb:a._a[ob]<0||a._a[ob]>59?ob:a._a[pb]<0||a._a[pb]>999?pb:-1,a._pf._overflowDayOfYear&&(jb>b||b>lb)&&(b=lb),a._pf.overflow=b)}function y(a){return null==a._isValid&&(a._isValid=!isNaN(a._d.getTime())&&a._pf.overflow<0&&!a._pf.empty&&!a._pf.invalidMonth&&!a._pf.nullInput&&!a._pf.invalidFormat&&!a._pf.userInvalidated,a._strict&&(a._isValid=a._isValid&&0===a._pf.charsLeftOver&&0===a._pf.unusedTokens.length)),a._isValid}function z(a){return a?a.toLowerCase().replace("_","-"):a}function A(a,b){return b._isUTC?eb(a).zone(b._offset||0):eb(a).local()}function B(a,b){return b.abbr=a,qb[a]||(qb[a]=new e),qb[a].set(b),qb[a]}function C(a){delete qb[a]}function D(a){var b,c,d,e,f=0,g=function(a){if(!qb[a]&&sb)try{require("./lang/"+a)}catch(b){}return qb[a]};if(!a)return eb.fn._lang;if(!m(a)){if(c=g(a))return c;a=[a]}for(;f<a.length;){for(e=z(a[f]).split("-"),b=e.length,d=z(a[f+1]),d=d?d.split("-"):null;b>0;){if(c=g(e.slice(0,b).join("-")))return c;if(d&&d.length>=b&&o(e,d,!0)>=b-1)break;b--}f++}return eb.fn._lang}function E(a){return a.match(/\[[\s\S]/)?a.replace(/^\[|\]$/g,""):a.replace(/\\/g,"")}function F(a){var b,c,d=a.match(wb);for(b=0,c=d.length;c>b;b++)d[b]=$b[d[b]]?$b[d[b]]:E(d[b]);return function(e){var f="";for(b=0;c>b;b++)f+=d[b]instanceof Function?d[b].call(e,a):d[b];return f}}function G(a,b){return a.isValid()?(b=H(b,a.lang()),Xb[b]||(Xb[b]=F(b)),Xb[b](a)):a.lang().invalidDate()}function H(a,b){function c(a){return b.longDateFormat(a)||a}var d=5;for(xb.lastIndex=0;d>=0&&xb.test(a);)a=a.replace(xb,c),xb.lastIndex=0,d-=1;return a}function I(a,b){var c,d=b._strict;switch(a){case"DDDD":return Kb;case"YYYY":case"GGGG":case"gggg":return d?Lb:Ab;case"Y":case"G":case"g":return Nb;case"YYYYYY":case"YYYYY":case"GGGGG":case"ggggg":return d?Mb:Bb;case"S":if(d)return Ib;case"SS":if(d)return Jb;case"SSS":if(d)return Kb;case"DDD":return zb;case"MMM":case"MMMM":case"dd":case"ddd":case"dddd":return Db;case"a":case"A":return D(b._l)._meridiemParse;case"X":return Gb;case"Z":case"ZZ":return Eb;case"T":return Fb;case"SSSS":return Cb;case"MM":case"DD":case"YY":case"GG":case"gg":case"HH":case"hh":case"mm":case"ss":case"ww":case"WW":return d?Jb:yb;case"M":case"D":case"d":case"H":case"h":case"m":case"s":case"w":case"W":case"e":case"E":return yb;case"Do":return Hb;default:return c=new RegExp(Q(P(a.replace("\\","")),"i"))}}function J(a){a=a||"";var b=a.match(Eb)||[],c=b[b.length-1]||[],d=(c+"").match(Sb)||["-",0,0],e=+(60*d[1])+s(d[2]);return"+"===d[0]?-e:e}function K(a,b,c){var d,e=c._a;switch(a){case"M":case"MM":null!=b&&(e[kb]=s(b)-1);break;case"MMM":case"MMMM":d=D(c._l).monthsParse(b),null!=d?e[kb]=d:c._pf.invalidMonth=b;break;case"D":case"DD":null!=b&&(e[lb]=s(b));break;case"Do":null!=b&&(e[lb]=s(parseInt(b,10)));break;case"DDD":case"DDDD":null!=b&&(c._dayOfYear=s(b));break;case"YY":e[jb]=s(b)+(s(b)>68?1900:2e3);break;case"YYYY":case"YYYYY":case"YYYYYY":e[jb]=s(b);break;case"a":case"A":c._isPm=D(c._l).isPM(b);break;case"H":case"HH":case"h":case"hh":e[mb]=s(b);break;case"m":case"mm":e[nb]=s(b);break;case"s":case"ss":e[ob]=s(b);break;case"S":case"SS":case"SSS":case"SSSS":e[pb]=s(1e3*("0."+b));break;case"X":c._d=new Date(1e3*parseFloat(b));break;case"Z":case"ZZ":c._useUTC=!0,c._tzm=J(b);break;case"w":case"ww":case"W":case"WW":case"d":case"dd":case"ddd":case"dddd":case"e":case"E":a=a.substr(0,1);case"gg":case"gggg":case"GG":case"GGGG":case"GGGGG":a=a.substr(0,2),b&&(c._w=c._w||{},c._w[a]=b)}}function L(a){var b,c,d,e,f,g,h,i,j,k,l=[];if(!a._d){for(d=N(a),a._w&&null==a._a[lb]&&null==a._a[kb]&&(f=function(b){var c=parseInt(b,10);return b?b.length<3?c>68?1900+c:2e3+c:c:null==a._a[jb]?eb().weekYear():a._a[jb]},g=a._w,null!=g.GG||null!=g.W||null!=g.E?h=$(f(g.GG),g.W||1,g.E,4,1):(i=D(a._l),j=null!=g.d?W(g.d,i):null!=g.e?parseInt(g.e,10)+i._week.dow:0,k=parseInt(g.w,10)||1,null!=g.d&&j<i._week.dow&&k++,h=$(f(g.gg),k,j,i._week.doy,i._week.dow)),a._a[jb]=h.year,a._dayOfYear=h.dayOfYear),a._dayOfYear&&(e=null==a._a[jb]?d[jb]:a._a[jb],a._dayOfYear>v(e)&&(a._pf._overflowDayOfYear=!0),c=V(e,0,a._dayOfYear),a._a[kb]=c.getUTCMonth(),a._a[lb]=c.getUTCDate()),b=0;3>b&&null==a._a[b];++b)a._a[b]=l[b]=d[b];for(;7>b;b++)a._a[b]=l[b]=null==a._a[b]?2===b?1:0:a._a[b];l[mb]+=s((a._tzm||0)/60),l[nb]+=s((a._tzm||0)%60),a._d=(a._useUTC?V:U).apply(null,l)}}function M(a){var b;a._d||(b=q(a._i),a._a=[b.year,b.month,b.day,b.hour,b.minute,b.second,b.millisecond],L(a))}function N(a){var b=new Date;return a._useUTC?[b.getUTCFullYear(),b.getUTCMonth(),b.getUTCDate()]:[b.getFullYear(),b.getMonth(),b.getDate()]}function O(a){a._a=[],a._pf.empty=!0;var b,c,d,e,f,g=D(a._l),h=""+a._i,i=h.length,j=0;for(d=H(a._f,g).match(wb)||[],b=0;b<d.length;b++)e=d[b],c=(h.match(I(e,a))||[])[0],c&&(f=h.substr(0,h.indexOf(c)),f.length>0&&a._pf.unusedInput.push(f),h=h.slice(h.indexOf(c)+c.length),j+=c.length),$b[e]?(c?a._pf.empty=!1:a._pf.unusedTokens.push(e),K(e,c,a)):a._strict&&!c&&a._pf.unusedTokens.push(e);a._pf.charsLeftOver=i-j,h.length>0&&a._pf.unusedInput.push(h),a._isPm&&a._a[mb]<12&&(a._a[mb]+=12),a._isPm===!1&&12===a._a[mb]&&(a._a[mb]=0),L(a),x(a)}function P(a){return a.replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(a,b,c,d,e){return b||c||d||e})}function Q(a){return a.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function R(a){var c,d,e,f,g;if(0===a._f.length)return a._pf.invalidFormat=!0,void(a._d=new Date(0/0));for(f=0;f<a._f.length;f++)g=0,c=h({},a),c._pf=b(),c._f=a._f[f],O(c),y(c)&&(g+=c._pf.charsLeftOver,g+=10*c._pf.unusedTokens.length,c._pf.score=g,(null==e||e>g)&&(e=g,d=c));h(a,d||c)}function S(a){var b,c,d=a._i,e=Ob.exec(d);if(e){for(a._pf.iso=!0,b=0,c=Qb.length;c>b;b++)if(Qb[b][1].exec(d)){a._f=Qb[b][0]+(e[6]||" ");
|
|
break}for(b=0,c=Rb.length;c>b;b++)if(Rb[b][1].exec(d)){a._f+=Rb[b][0];break}d.match(Eb)&&(a._f+="Z"),O(a)}else a._d=new Date(d)}function T(b){var c=b._i,d=tb.exec(c);c===a?b._d=new Date:d?b._d=new Date(+d[1]):"string"==typeof c?S(b):m(c)?(b._a=c.slice(0),L(b)):n(c)?b._d=new Date(+c):"object"==typeof c?M(b):b._d=new Date(c)}function U(a,b,c,d,e,f,g){var h=new Date(a,b,c,d,e,f,g);return 1970>a&&h.setFullYear(a),h}function V(a){var b=new Date(Date.UTC.apply(null,arguments));return 1970>a&&b.setUTCFullYear(a),b}function W(a,b){if("string"==typeof a)if(isNaN(a)){if(a=b.weekdaysParse(a),"number"!=typeof a)return null}else a=parseInt(a,10);return a}function X(a,b,c,d,e){return e.relativeTime(b||1,!!c,a,d)}function Y(a,b,c){var d=ib(Math.abs(a)/1e3),e=ib(d/60),f=ib(e/60),g=ib(f/24),h=ib(g/365),i=45>d&&["s",d]||1===e&&["m"]||45>e&&["mm",e]||1===f&&["h"]||22>f&&["hh",f]||1===g&&["d"]||25>=g&&["dd",g]||45>=g&&["M"]||345>g&&["MM",ib(g/30)]||1===h&&["y"]||["yy",h];return i[2]=b,i[3]=a>0,i[4]=c,X.apply({},i)}function Z(a,b,c){var d,e=c-b,f=c-a.day();return f>e&&(f-=7),e-7>f&&(f+=7),d=eb(a).add("d",f),{"week":Math.ceil(d.dayOfYear()/7),"year":d.year()}}function $(a,b,c,d,e){var f,g,h=V(a,0,1).getUTCDay();return c=null!=c?c:e,f=e-h+(h>d?7:0)-(e>h?7:0),g=7*(b-1)+(c-e)+f+1,{"year":g>0?a:a-1,"dayOfYear":g>0?g:v(a-1)+g}}function _(a){var b=a._i,c=a._f;return null===b?eb.invalid({"nullInput":!0}):("string"==typeof b&&(a._i=b=D().preparse(b)),eb.isMoment(b)?(a=i(b),a._d=new Date(+b._d)):c?m(c)?R(a):O(a):T(a),new f(a))}function ab(a,b){var c="date"===b||"month"===b||"year"===b;eb.fn[a]=eb.fn[a+"s"]=function(a,d){var e=this._isUTC?"UTC":"";return null==d&&(d=c),null!=a?(this._d["set"+e+b](a),eb.updateOffset(this,d),this):this._d["get"+e+b]()}}function bb(a){eb.duration.fn[a]=function(){return this._data[a]}}function cb(a,b){eb.duration.fn["as"+a]=function(){return+this/b}}function db(a){var b=!1,c=eb;"undefined"==typeof ender&&(a?(hb.moment=function(){return!b&&console&&console.warn&&(b=!0),c.apply(null,arguments)},h(hb.moment,c)):hb.moment=eb)}for(var eb,fb,gb="2.5.1",hb=this,ib=Math.round,jb=0,kb=1,lb=2,mb=3,nb=4,ob=5,pb=6,qb={},rb={"_isAMomentObject":null,"_i":null,"_f":null,"_l":null,"_strict":null,"_isUTC":null,"_offset":null,"_pf":null,"_lang":null},sb="undefined"!=typeof module&&module.exports&&"undefined"!=typeof require,tb=/^\/?Date\((\-?\d+)/i,ub=/(\-)?(?:(\d*)\.)?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/,vb=/^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/,wb=/(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,4}|X|zz?|ZZ?|.)/g,xb=/(\[[^\[]*\])|(\\)?(LT|LL?L?L?|l{1,4})/g,yb=/\d\d?/,zb=/\d{1,3}/,Ab=/\d{1,4}/,Bb=/[+\-]?\d{1,6}/,Cb=/\d+/,Db=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,Eb=/Z|[\+\-]\d\d:?\d\d/gi,Fb=/T/i,Gb=/[\+\-]?\d+(\.\d{1,3})?/,Hb=/\d{1,2}/,Ib=/\d/,Jb=/\d\d/,Kb=/\d{3}/,Lb=/\d{4}/,Mb=/[+-]?\d{6}/,Nb=/[+-]?\d+/,Ob=/^\s*(?:[+-]\d{6}|\d{4})-(?:(\d\d-\d\d)|(W\d\d$)|(W\d\d-\d)|(\d\d\d))((T| )(\d\d(:\d\d(:\d\d(\.\d+)?)?)?)?([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Pb="YYYY-MM-DDTHH:mm:ssZ",Qb=[["YYYYYY-MM-DD",/[+-]\d{6}-\d{2}-\d{2}/],["YYYY-MM-DD",/\d{4}-\d{2}-\d{2}/],["GGGG-[W]WW-E",/\d{4}-W\d{2}-\d/],["GGGG-[W]WW",/\d{4}-W\d{2}/],["YYYY-DDD",/\d{4}-\d{3}/]],Rb=[["HH:mm:ss.SSSS",/(T| )\d\d:\d\d:\d\d\.\d{1,3}/],["HH:mm:ss",/(T| )\d\d:\d\d:\d\d/],["HH:mm",/(T| )\d\d:\d\d/],["HH",/(T| )\d\d/]],Sb=/([\+\-]|\d\d)/gi,Tb="Date|Hours|Minutes|Seconds|Milliseconds".split("|"),Ub={"Milliseconds":1,"Seconds":1e3,"Minutes":6e4,"Hours":36e5,"Days":864e5,"Months":2592e6,"Years":31536e6},Vb={"ms":"millisecond","s":"second","m":"minute","h":"hour","d":"day","D":"date","w":"week","W":"isoWeek","M":"month","y":"year","DDD":"dayOfYear","e":"weekday","E":"isoWeekday","gg":"weekYear","GG":"isoWeekYear"},Wb={"dayofyear":"dayOfYear","isoweekday":"isoWeekday","isoweek":"isoWeek","weekyear":"weekYear","isoweekyear":"isoWeekYear"},Xb={},Yb="DDD w W M D d".split(" "),Zb="M D H h m s w W".split(" "),$b={"M":function(){return this.month()+1},"MMM":function(a){return this.lang().monthsShort(this,a)},"MMMM":function(a){return this.lang().months(this,a)},"D":function(){return this.date()},"DDD":function(){return this.dayOfYear()},"d":function(){return this.day()},"dd":function(a){return this.lang().weekdaysMin(this,a)},"ddd":function(a){return this.lang().weekdaysShort(this,a)},"dddd":function(a){return this.lang().weekdays(this,a)},"w":function(){return this.week()},"W":function(){return this.isoWeek()},"YY":function(){return k(this.year()%100,2)},"YYYY":function(){return k(this.year(),4)},"YYYYY":function(){return k(this.year(),5)},"YYYYYY":function(){var a=this.year(),b=a>=0?"+":"-";return b+k(Math.abs(a),6)},"gg":function(){return k(this.weekYear()%100,2)},"gggg":function(){return k(this.weekYear(),4)},"ggggg":function(){return k(this.weekYear(),5)},"GG":function(){return k(this.isoWeekYear()%100,2)},"GGGG":function(){return k(this.isoWeekYear(),4)},"GGGGG":function(){return k(this.isoWeekYear(),5)},"e":function(){return this.weekday()},"E":function(){return this.isoWeekday()},"a":function(){return this.lang().meridiem(this.hours(),this.minutes(),!0)},"A":function(){return this.lang().meridiem(this.hours(),this.minutes(),!1)},"H":function(){return this.hours()},"h":function(){return this.hours()%12||12},"m":function(){return this.minutes()},"s":function(){return this.seconds()},"S":function(){return s(this.milliseconds()/100)},"SS":function(){return k(s(this.milliseconds()/10),2)},"SSS":function(){return k(this.milliseconds(),3)},"SSSS":function(){return k(this.milliseconds(),3)},"Z":function(){var a=-this.zone(),b="+";return 0>a&&(a=-a,b="-"),b+k(s(a/60),2)+":"+k(s(a)%60,2)},"ZZ":function(){var a=-this.zone(),b="+";return 0>a&&(a=-a,b="-"),b+k(s(a/60),2)+k(s(a)%60,2)},"z":function(){return this.zoneAbbr()},"zz":function(){return this.zoneName()},"X":function(){return this.unix()},"Q":function(){return this.quarter()}},_b=["months","monthsShort","weekdays","weekdaysShort","weekdaysMin"];Yb.length;)fb=Yb.pop(),$b[fb+"o"]=d($b[fb],fb);for(;Zb.length;)fb=Zb.pop(),$b[fb+fb]=c($b[fb],2);for($b.DDDD=c($b.DDD,3),h(e.prototype,{"set":function(a){var b,c;for(c in a)b=a[c],"function"==typeof b?this[c]=b:this["_"+c]=b},"_months":"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),"months":function(a){return this._months[a.month()]},"_monthsShort":"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),"monthsShort":function(a){return this._monthsShort[a.month()]},"monthsParse":function(a){var b,c,d;for(this._monthsParse||(this._monthsParse=[]),b=0;12>b;b++)if(this._monthsParse[b]||(c=eb.utc([2e3,b]),d="^"+this.months(c,"")+"|^"+this.monthsShort(c,""),this._monthsParse[b]=new RegExp(d.replace(".",""),"i")),this._monthsParse[b].test(a))return b},"_weekdays":"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),"weekdays":function(a){return this._weekdays[a.day()]},"_weekdaysShort":"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),"weekdaysShort":function(a){return this._weekdaysShort[a.day()]},"_weekdaysMin":"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),"weekdaysMin":function(a){return this._weekdaysMin[a.day()]},"weekdaysParse":function(a){var b,c,d;for(this._weekdaysParse||(this._weekdaysParse=[]),b=0;7>b;b++)if(this._weekdaysParse[b]||(c=eb([2e3,1]).day(b),d="^"+this.weekdays(c,"")+"|^"+this.weekdaysShort(c,"")+"|^"+this.weekdaysMin(c,""),this._weekdaysParse[b]=new RegExp(d.replace(".",""),"i")),this._weekdaysParse[b].test(a))return b},"_longDateFormat":{"LT":"h:mm A","L":"MM/DD/YYYY","LL":"MMMM D YYYY","LLL":"MMMM D YYYY LT","LLLL":"dddd, MMMM D YYYY LT"},"longDateFormat":function(a){var b=this._longDateFormat[a];return!b&&this._longDateFormat[a.toUpperCase()]&&(b=this._longDateFormat[a.toUpperCase()].replace(/MMMM|MM|DD|dddd/g,function(a){return a.slice(1)}),this._longDateFormat[a]=b),b},"isPM":function(a){return"p"===(a+"").toLowerCase().charAt(0)},"_meridiemParse":/[ap]\.?m?\.?/i,"meridiem":function(a,b,c){return a>11?c?"pm":"PM":c?"am":"AM"},"_calendar":{"sameDay":"[Today at] LT","nextDay":"[Tomorrow at] LT","nextWeek":"dddd [at] LT","lastDay":"[Yesterday at] LT","lastWeek":"[Last] dddd [at] LT","sameElse":"L"},"calendar":function(a,b){var c=this._calendar[a];return"function"==typeof c?c.apply(b):c},"_relativeTime":{"future":"in %s","past":"%s ago","s":"a few seconds","m":"a minute","mm":"%d minutes","h":"an hour","hh":"%d hours","d":"a day","dd":"%d days","M":"a month","MM":"%d months","y":"a year","yy":"%d years"},"relativeTime":function(a,b,c,d){var e=this._relativeTime[c];return"function"==typeof e?e(a,b,c,d):e.replace(/%d/i,a)},"pastFuture":function(a,b){var c=this._relativeTime[a>0?"future":"past"];return"function"==typeof c?c(b):c.replace(/%s/i,b)},"ordinal":function(a){return this._ordinal.replace("%d",a)},"_ordinal":"%d","preparse":function(a){return a},"postformat":function(a){return a},"week":function(a){return Z(a,this._week.dow,this._week.doy).week},"_week":{"dow":0,"doy":6},"_invalidDate":"Invalid date","invalidDate":function(){return this._invalidDate}}),eb=function(c,d,e,f){var g;return"boolean"==typeof e&&(f=e,e=a),g={},g._isAMomentObject=!0,g._i=c,g._f=d,g._l=e,g._strict=f,g._isUTC=!1,g._pf=b(),_(g)},eb.utc=function(c,d,e,f){var g;return"boolean"==typeof e&&(f=e,e=a),g={},g._isAMomentObject=!0,g._useUTC=!0,g._isUTC=!0,g._l=e,g._i=c,g._f=d,g._strict=f,g._pf=b(),_(g).utc()},eb.unix=function(a){return eb(1e3*a)},eb.duration=function(a,b){var c,d,e,f=a,h=null;return eb.isDuration(a)?f={"ms":a._milliseconds,"d":a._days,"M":a._months}:"number"==typeof a?(f={},b?f[b]=a:f.milliseconds=a):(h=ub.exec(a))?(c="-"===h[1]?-1:1,f={"y":0,"d":s(h[lb])*c,"h":s(h[mb])*c,"m":s(h[nb])*c,"s":s(h[ob])*c,"ms":s(h[pb])*c}):(h=vb.exec(a))&&(c="-"===h[1]?-1:1,e=function(a){var b=a&&parseFloat(a.replace(",","."));return(isNaN(b)?0:b)*c},f={"y":e(h[2]),"M":e(h[3]),"d":e(h[4]),"h":e(h[5]),"m":e(h[6]),"s":e(h[7]),"w":e(h[8])}),d=new g(f),eb.isDuration(a)&&a.hasOwnProperty("_lang")&&(d._lang=a._lang),d},eb.version=gb,eb.defaultFormat=Pb,eb.updateOffset=function(){},eb.lang=function(a,b){var c;return a?(b?B(z(a),b):null===b?(C(a),a="en"):qb[a]||D(a),c=eb.duration.fn._lang=eb.fn._lang=D(a),c._abbr):eb.fn._lang._abbr},eb.langData=function(a){return a&&a._lang&&a._lang._abbr&&(a=a._lang._abbr),D(a)},eb.isMoment=function(a){return a instanceof f||null!=a&&a.hasOwnProperty("_isAMomentObject")},eb.isDuration=function(a){return a instanceof g},fb=_b.length-1;fb>=0;--fb)r(_b[fb]);for(eb.normalizeUnits=function(a){return p(a)},eb.invalid=function(a){var b=eb.utc(0/0);return null!=a?h(b._pf,a):b._pf.userInvalidated=!0,b},eb.parseZone=function(){return eb.apply(null,arguments).parseZone()},h(eb.fn=f.prototype,{"clone":function(){return eb(this)},"valueOf":function(){return+this._d+6e4*(this._offset||0)},"unix":function(){return Math.floor(+this/1e3)},"toString":function(){return this.clone().lang("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},"toDate":function(){return this._offset?new Date(+this):this._d},"toISOString":function(){var a=eb(this).utc();return 0<a.year()&&a.year()<=9999?G(a,"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]"):G(a,"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]")},"toArray":function(){var a=this;return[a.year(),a.month(),a.date(),a.hours(),a.minutes(),a.seconds(),a.milliseconds()]},"isValid":function(){return y(this)},"isDSTShifted":function(){return this._a?this.isValid()&&o(this._a,(this._isUTC?eb.utc(this._a):eb(this._a)).toArray())>0:!1},"parsingFlags":function(){return h({},this._pf)},"invalidAt":function(){return this._pf.overflow},"utc":function(){return this.zone(0)},"local":function(){return this.zone(0),this._isUTC=!1,this},"format":function(a){var b=G(this,a||eb.defaultFormat);return this.lang().postformat(b)},"add":function(a,b){var c;return c="string"==typeof a?eb.duration(+b,a):eb.duration(a,b),l(this,c,1),this},"subtract":function(a,b){var c;return c="string"==typeof a?eb.duration(+b,a):eb.duration(a,b),l(this,c,-1),this},"diff":function(a,b,c){var d,e,f=A(a,this),g=6e4*(this.zone()-f.zone());return b=p(b),"year"===b||"month"===b?(d=432e5*(this.daysInMonth()+f.daysInMonth()),e=12*(this.year()-f.year())+(this.month()-f.month()),e+=(this-eb(this).startOf("month")-(f-eb(f).startOf("month")))/d,e-=6e4*(this.zone()-eb(this).startOf("month").zone()-(f.zone()-eb(f).startOf("month").zone()))/d,"year"===b&&(e/=12)):(d=this-f,e="second"===b?d/1e3:"minute"===b?d/6e4:"hour"===b?d/36e5:"day"===b?(d-g)/864e5:"week"===b?(d-g)/6048e5:d),c?e:j(e)},"from":function(a,b){return eb.duration(this.diff(a)).lang(this.lang()._abbr).humanize(!b)},"fromNow":function(a){return this.from(eb(),a)},"calendar":function(){var a=A(eb(),this).startOf("day"),b=this.diff(a,"days",!0),c=-6>b?"sameElse":-1>b?"lastWeek":0>b?"lastDay":1>b?"sameDay":2>b?"nextDay":7>b?"nextWeek":"sameElse";return this.format(this.lang().calendar(c,this))},"isLeapYear":function(){return w(this.year())},"isDST":function(){return this.zone()<this.clone().month(0).zone()||this.zone()<this.clone().month(5).zone()},"day":function(a){var b=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=a?(a=W(a,this.lang()),this.add({"d":a-b})):b},"month":function(a){var b,c=this._isUTC?"UTC":"";return null!=a?"string"==typeof a&&(a=this.lang().monthsParse(a),"number"!=typeof a)?this:(b=Math.min(this.date(),t(this.year(),a)),this._d["set"+c+"Month"](a,b),eb.updateOffset(this,!0),this):this._d["get"+c+"Month"]()},"startOf":function(a){switch(a=p(a)){case"year":this.month(0);case"month":this.date(1);case"week":case"isoWeek":case"day":this.hours(0);case"hour":this.minutes(0);case"minute":this.seconds(0);case"second":this.milliseconds(0)}return"week"===a?this.weekday(0):"isoWeek"===a&&this.isoWeekday(1),this},"endOf":function(a){return a=p(a),this.startOf(a).add("isoWeek"===a?"week":a,1).subtract("ms",1)},"isAfter":function(a,b){return b="undefined"!=typeof b?b:"millisecond",+this.clone().startOf(b)>+eb(a).startOf(b)},"isBefore":function(a,b){return b="undefined"!=typeof b?b:"millisecond",+this.clone().startOf(b)<+eb(a).startOf(b)},"isSame":function(a,b){return b=b||"ms",+this.clone().startOf(b)===+A(a,this).startOf(b)},"min":function(a){return a=eb.apply(null,arguments),this>a?this:a},"max":function(a){return a=eb.apply(null,arguments),a>this?this:a},"zone":function(a,b){b=null==b?!0:!1;var c=this._offset||0;return null==a?this._isUTC?c:this._d.getTimezoneOffset():("string"==typeof a&&(a=J(a)),Math.abs(a)<16&&(a=60*a),this._offset=a,this._isUTC=!0,c!==a&&b&&l(this,eb.duration(c-a,"m"),1,!0),this)},"zoneAbbr":function(){return this._isUTC?"UTC":""},"zoneName":function(){return this._isUTC?"Coordinated Universal Time":""},"parseZone":function(){return this._tzm?this.zone(this._tzm):"string"==typeof this._i&&this.zone(this._i),this},"hasAlignedHourOffset":function(a){return a=a?eb(a).zone():0,(this.zone()-a)%60===0},"daysInMonth":function(){return t(this.year(),this.month())},"dayOfYear":function(a){var b=ib((eb(this).startOf("day")-eb(this).startOf("year"))/864e5)+1;return null==a?b:this.add("d",a-b)},"quarter":function(){return Math.ceil((this.month()+1)/3)},"weekYear":function(a){var b=Z(this,this.lang()._week.dow,this.lang()._week.doy).year;return null==a?b:this.add("y",a-b)},"isoWeekYear":function(a){var b=Z(this,1,4).year;return null==a?b:this.add("y",a-b)},"week":function(a){var b=this.lang().week(this);return null==a?b:this.add("d",7*(a-b))},"isoWeek":function(a){var b=Z(this,1,4).week;return null==a?b:this.add("d",7*(a-b))},"weekday":function(a){var b=(this.day()+7-this.lang()._week.dow)%7;return null==a?b:this.add("d",a-b)},"isoWeekday":function(a){return null==a?this.day()||7:this.day(this.day()%7?a:a-7)},"isoWeeksInYear":function(){return u(this.year(),1,4)},"weeksInYear":function(){var a=this._lang._week;return u(this.year(),a.dow,a.doy)},"get":function(a){return a=p(a),this[a]()},"set":function(a,b){return a=p(a),"function"==typeof this[a]&&this[a](b),this},"lang":function(b){return b===a?this._lang:(this._lang=D(b),this)}}),fb=0;fb<Tb.length;fb++)ab(Tb[fb].toLowerCase().replace(/s$/,""),Tb[fb]);ab("year","FullYear"),eb.fn.days=eb.fn.day,eb.fn.months=eb.fn.month,eb.fn.weeks=eb.fn.week,eb.fn.isoWeeks=eb.fn.isoWeek,eb.fn.toJSON=eb.fn.toISOString,h(eb.duration.fn=g.prototype,{"_bubble":function(){var a,b,c,d,e=this._milliseconds,f=this._days,g=this._months,h=this._data;h.milliseconds=e%1e3,a=j(e/1e3),h.seconds=a%60,b=j(a/60),h.minutes=b%60,c=j(b/60),h.hours=c%24,f+=j(c/24),h.days=f%30,g+=j(f/30),h.months=g%12,d=j(g/12),h.years=d},"weeks":function(){return j(this.days()/7)},"valueOf":function(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*s(this._months/12)},"humanize":function(a){var b=+this,c=Y(b,!a,this.lang());return a&&(c=this.lang().pastFuture(b,c)),this.lang().postformat(c)},"add":function(a,b){var c=eb.duration(a,b);return this._milliseconds+=c._milliseconds,this._days+=c._days,this._months+=c._months,this._bubble(),this},"subtract":function(a,b){var c=eb.duration(a,b);return this._milliseconds-=c._milliseconds,this._days-=c._days,this._months-=c._months,this._bubble(),this},"get":function(a){return a=p(a),this[a.toLowerCase()+"s"]()},"as":function(a){return a=p(a),this["as"+a.charAt(0).toUpperCase()+a.slice(1)+"s"]()},"lang":eb.fn.lang,"toIsoString":function(){var a=Math.abs(this.years()),b=Math.abs(this.months()),c=Math.abs(this.days()),d=Math.abs(this.hours()),e=Math.abs(this.minutes()),f=Math.abs(this.seconds()+this.milliseconds()/1e3);return this.asSeconds()?(this.asSeconds()<0?"-":"")+"P"+(a?a+"Y":"")+(b?b+"M":"")+(c?c+"D":"")+(d||e||f?"T":"")+(d?d+"H":"")+(e?e+"M":"")+(f?f+"S":""):"P0D"}});for(fb in Ub)Ub.hasOwnProperty(fb)&&(cb(fb,Ub[fb]),bb(fb.toLowerCase()));cb("Weeks",6048e5),eb.duration.fn.asMonths=function(){return(+this-31536e6*this.years())/2592e6+12*this.years()},eb.lang("en",{"ordinal":function(a){var b=a%10,c=1===s(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th";return a+c}}),sb?(module.exports=eb,db(!0)):"function"==typeof define&&define.amd?define("moment",function(b,c,d){return d.config&&d.config()&&d.config().noGlobal!==!0&&db(d.config().noGlobal===a),eb}):db()}.call(this),function(a,b,c,d){"use strict";var e="datepaginator",f=function(b,c){this._element=b,this.$element=a(b),this._init(c)};f.defaults={"fillWidth":!0,"highlightSelectedDate":!0,"highlightToday":!0,"hint":"dddd, Do MMMM YYYY","injectStyle":!0,"itemWidth":35,"navItemWidth":20,"offDays":"Sat,Sun","offDaysFormat":"ddd","onSelectedDateChanged":null,"selectedDate":moment().clone().startOf("day"),"selectedDateFormat":"YYYY-MM-DD","selectedItemWidth":140,"showCalendar":!0,"showOffDays":!0,"showStartOfWeek":!0,"size":d,"startOfWeek":"Mon","startOfWeekFormat":"ddd","squareEdges":!1,"text":"ddd<br/>Do","textSelected":"dddd<br/>Do, MMMM YYYY","width":0,"startDate":moment(new Date(-864e13)),"startDateFormat":"YYYY-MM-DD","endDate":moment(new Date(864e13)),"endDateFormat":"YYYY-MM-DD"},f.prototype={"setSelectedDate":function(a,b){this._setSelectedDate(moment(a,b?b:this.options.selectedDateFormat)),this._render()},"remove":function(){this._destroy(),a.removeData(this,"plugin_"+e)},"_init":function(b){this.options=a.extend({},f.defaults,b),this.options.width?this.options.fillWidth=!1:(this.options.width=this.$element.width(),this.options.fillWidth=!0),"string"==typeof this.options.startDate&&(this.options.startDate=moment(this.options.startDate,this.options.startDateFormat).clone().startOf("day")),"string"==typeof this.options.endDate&&(this.options.endDate=moment(this.options.endDate,this.options.endDateFormat).clone().startOf("day")),"string"==typeof this.options.selectedDate&&(this.options.selectedDate=moment(this.options.selectedDate,this.options.selectedDateFormat).clone().startOf("day")),this.options.selectedDate.isBefore(this.options.startDate)&&(this.options.selectedDate=this.options.startDate.clone()),this.options.selectedDate.isAfter(this.options.endDate)&&(this.options.selectedDate=this.options.endDate.clone()),"small"===this.options.size?this.options.size="sm":"large"===this.options.size&&(this.options.size="lg"),this._destroy(),this._subscribeEvents(),this._render()},"_unsubscribeEvents":function(){this.$element.off("click"),this.$element.off("selectedDateChanged")},"_subscribeEvents":function(){this._unsubscribeEvents(),this.$element.on("click",a.proxy(this._clickedHandler,this)),"function"==typeof this.options.onSelectedDateChanged&&this.$element.on("selectedDateChanged",this.options.onSelectedDateChanged),this.options.fillWidth&&a(b).on("resize",a.proxy(this._resize,this))},"_destroy":function(){this.initialized&&(this.$calendar&&this.$calendar.datepicker("remove"),this.$wrapper.remove(),this.$wrapper=null,this._unsubscribeEvents()),this.initialized=!1},"_clickedHandler":function(b){b.preventDefault();var c=a(b.target),d=c.attr("class");-1!=d.indexOf("dp-nav-left")?this._back():-1!=d.indexOf("dp-nav-right")?this._forward():-1!=d.indexOf("dp-item")&&this._select(c.attr("data-moment"))},"_setSelectedDate":function(a){a.isSame(this.options.selectedDate)||a.isBefore(this.options.startDate)||a.isAfter(this.options.endDate)||(this.options.selectedDate=a.startOf("day"),this.$element.trigger("selectedDateChanged",[a.clone()]))},"_back":function(){this._setSelectedDate(this.options.selectedDate.clone().subtract("day",1)),this._render()},"_forward":function(){this._setSelectedDate(this.options.selectedDate.clone().add("day",1)),this._render()},"_select":function(a){this._setSelectedDate(moment(a,this.options.selectedDateFormat)),this._render()},"_calendarSelect":function(a){this._setSelectedDate(moment(a.date)),this._render()},"_resize":function(){this.options.width=this.$element.width(),this._render()},"_render":function(){var b=this;this.initialized?this.$calendar&&this.$calendar.datepicker("remove"):(this.$element.removeClass("datepaginator datepaginator-sm datepaginator-lg").addClass("sm"===this.options.size?"datepaginator-sm":"lg"===this.options.size?"datepaginator-lg":"datepaginator"),this.$wrapper=a(this._template.list),this.$leftNav=a(this._template.navItem).addClass("dp-nav-left").addClass("sm"===this.options.size?"dp-nav-sm":"lg"===this.options.size?"dp-nav-lg":"").addClass(this.options.squareEdges?"dp-nav-square-edges":"").append(a(this._template.icon).addClass("glyphicon-chevron-left").addClass("dp-nav-left")).width(this.options.navItemWidth),this.$rightNav=a(this._template.navItem).addClass("dp-nav-right").addClass("sm"===this.options.size?"dp-nav-sm":"lg"===this.options.size?"dp-nav-lg":"").addClass(this.options.squareEdges?"dp-nav-square-edges":"").append(a(this._template.icon).addClass("glyphicon-chevron-right").addClass("dp-nav-right")).width(this.options.navItemWidth),this.$calendar=this.options.showCalendar?a(this._template.calendar):d,this._injectStyle(),this.initialized=!0);var c=this._buildData();this.$element.empty().append(this.$wrapper.empty()),this.$leftNav.removeClass("dp-no-select").attr("title",""),c.isSelectedStartDate&&this.$leftNav.addClass("dp-no-select").attr("title","Start of valid date range"),this.$wrapper.append(a(b._template.listItem).append(this.$leftNav)),a.each(c.items,function(c,d){var e=a(b._template.dateItem).attr("data-moment",d.m).attr("title",d.hint).width(d.itemWidth);d.isSelected&&b.options.highlightSelectedDate&&e.addClass("dp-selected"),d.isToday&&b.options.highlightToday&&e.addClass("dp-today"),d.isStartOfWeek&&b.options.showStartOfWeek&&e.addClass("dp-divider"),d.isOffDay&&b.options.showOffDays&&e.addClass("dp-off"),d.isSelected&&b.options.showCalendar&&e.append(b.$calendar),"sm"===b.options.size?e.addClass("dp-item-sm"):"lg"===b.options.size&&e.addClass("dp-item-lg"),d.isValid||e.addClass("dp-no-select"),e.append(d.text),b.$wrapper.append(a(b._template.listItem).append(e))}),this.$rightNav.removeClass("dp-no-select").attr("title",""),c.isSelectedEndDate&&this.$rightNav.addClass("dp-no-select").attr("title","End of valid date range"),this.$wrapper.append(a(b._template.listItem).append(this.$rightNav)),this.$calendar&&this.$calendar.datepicker({"autoclose":!0,"forceParse":!0,"startView":0,"minView":0,"todayHighlight":!0,"startDate":this.options.startDate.toDate(),"endDate":this.options.endDate.toDate()}).datepicker("update",this.options.selectedDate.toDate()).on("changeDate",a.proxy(this._calendarSelect,this))},"_injectStyle":function(){this.options.injectStyle&&!c.getElementById("bootstrap-datepaginator-style")&&a('<style type="text/css" id="bootstrap-datepaginator-style">'+this._css+"</style>").appendTo("head")},"_buildData":function(){for(var a=this.options.width-(this.options.selectedItemWidth-this.options.itemWidth+2*this.options.navItemWidth),b=Math.floor(a/this.options.itemWidth),c=parseInt(b/2),d=Math.floor(a/b),e=Math.floor(this.options.selectedItemWidth+(a-b*d)),f=moment().startOf("day"),g=this.options.selectedDate.clone().subtract("days",c),h=this.options.selectedDate.clone().add("days",b-c),i={"isSelectedStartDate":this.options.selectedDate.isSame(this.options.startDate)?!0:!1,"isSelectedEndDate":this.options.selectedDate.isSame(this.options.endDate)?!0:!1,"items":[]},j=g;j.isBefore(h);j.add("days",1)){var k=(j.isSame(this.options.startDate)||j.isAfter(this.options.startDate))&&(j.isSame(this.options.endDate)||j.isBefore(this.options.endDate))?!0:!1;i.items[i.items.length]={"m":j.clone().format(this.options.selectedDateFormat),"isValid":k,"isSelected":j.isSame(this.options.selectedDate)?!0:!1,"isToday":j.isSame(f)?!0:!1,"isOffDay":-1!==this.options.offDays.split(",").indexOf(j.format(this.options.offDaysFormat))?!0:!1,"isStartOfWeek":-1!==this.options.startOfWeek.split(",").indexOf(j.format(this.options.startOfWeekFormat))?!0:!1,"text":j.format(j.isSame(this.options.selectedDate)?this.options.textSelected:this.options.text),"hint":k?j.format(this.options.hint):"Invalid date","itemWidth":j.isSame(this.options.selectedDate)?e:d}}return i},"_template":{"list":'<ul class="pagination"></ul>',"listItem":"<li></li>","navItem":'<a href="#" class="dp-nav"></a>',"dateItem":'<a href="#" class="dp-item"></a>',"icon":'<i class="glyphicon"></i>',"calendar":'<i id="dp-calendar" class="glyphicon glyphicon-calendar"></i>'},"_css":".datepaginator{font-size:12px;height:60px}.datepaginator-sm{font-size:10px;height:40px}.datepaginator-lg{font-size:14px;height:80px}.pagination{margin:0;padding:0;white-space:nowrap}.dp-nav{height:60px;padding:22px 0!important;width:20px;margin:0!important;text-align:center}.dp-nav-square-edges{border-radius:0!important}.dp-item{height:60px;padding:13px 0!important;width:35px;margin:0!important;border-left-style:hidden!important;text-align:center}.dp-item-sm{height:40px!important;padding:5px!important}.dp-item-lg{height:80px!important;padding:22px 0!important}.dp-nav-sm{height:40px!important;padding:11px 0!important}.dp-nav-lg{height:80px!important;padding:33px 0!important}a.dp-nav-right{border-left-style:hidden!important}.dp-divider{border-left:2px solid #ddd!important}.dp-off{background-color:#F0F0F0!important}.dp-no-select{color:#ccc!important;background-color:#F0F0F0!important}.dp-no-select:hover{background-color:#F0F0F0!important}.dp-today{background-color:#88B5DB!important;color:#fff!important}.dp-selected{background-color:#428bca!important;color:#fff!important;width:140px}#dp-calendar{padding:3px 5px 0 0!important;margin-right:3px;position:absolute;right:0;top:10}"};var g=function(a){b.console&&b.console.error(a)};a.fn[e]=function(b,c){return this.each(function(){var d=a.data(this,"plugin_"+e);"string"==typeof b?d?a.isFunction(d[b])&&"_"!==b.charAt(0)?("string"==typeof c&&(c=[c]),d[b].apply(d,c)):g("No such method : "+b):g("Not initialized, can not call method : "+b):d?d._init(b):a.data(this,"plugin_"+e,new f(this,b))})}}(jQuery,window,document),function(a){"use strict";var b=function(b,c){this.options=a.extend({},a.fn.editableform.defaults,c),this.$div=a(b),this.options.scope||(this.options.scope=this)};b.prototype={"constructor":b,"initInput":function(){this.input=this.options.input,this.value=this.input.str2value(this.options.value),this.input.prerender()},"initTemplate":function(){this.$form=a(a.fn.editableform.template)},"initButtons":function(){var b=this.$form.find(".editable-buttons");b.append(a.fn.editableform.buttons),"bottom"===this.options.showbuttons&&b.addClass("editable-buttons-bottom")},"render":function(){this.$loading=a(a.fn.editableform.loading),this.$div.empty().append(this.$loading),this.initTemplate(),this.options.showbuttons?this.initButtons():this.$form.find(".editable-buttons").remove(),this.showLoading(),this.isSaving=!1,this.$div.triggerHandler("rendering"),this.initInput(),this.$form.find("div.editable-input").append(this.input.$tpl),this.$div.append(this.$form),a.when(this.input.render()).then(a.proxy(function(){if(this.options.showbuttons||this.input.autosubmit(),this.$form.find(".editable-cancel").click(a.proxy(this.cancel,this)),this.input.error)this.error(this.input.error),this.$form.find(".editable-submit").attr("disabled",!0),this.input.$input.attr("disabled",!0),this.$form.submit(function(a){a.preventDefault()});else{this.error(!1),this.input.$input.removeAttr("disabled"),this.$form.find(".editable-submit").removeAttr("disabled");var b=null===this.value||void 0===this.value||""===this.value?this.options.defaultValue:this.value;this.input.value2input(b),this.$form.submit(a.proxy(this.submit,this))}this.$div.triggerHandler("rendered"),this.showForm(),this.input.postrender&&this.input.postrender()},this))},"cancel":function(){this.$div.triggerHandler("cancel")},"showLoading":function(){var a,b;this.$form?(a=this.$form.outerWidth(),b=this.$form.outerHeight(),a&&this.$loading.width(a),b&&this.$loading.height(b),this.$form.hide()):(a=this.$loading.parent().width(),a&&this.$loading.width(a)),this.$loading.show()},"showForm":function(a){this.$loading.hide(),this.$form.show(),a!==!1&&this.input.activate(),this.$div.triggerHandler("show")},"error":function(b){var c,d=this.$form.find(".control-group"),e=this.$form.find(".editable-error-block");if(b===!1)d.removeClass(a.fn.editableform.errorGroupClass),e.removeClass(a.fn.editableform.errorBlockClass).empty().hide();else{if(b){c=(""+b).split("\n");for(var f=0;f<c.length;f++)c[f]=a("<div>").text(c[f]).html();b=c.join("<br>")}d.addClass(a.fn.editableform.errorGroupClass),e.addClass(a.fn.editableform.errorBlockClass).html(b).show()}},"submit":function(b){b.stopPropagation(),b.preventDefault();var c=this.input.input2value(),d=this.validate(c);if("object"===a.type(d)&&void 0!==d.newValue){if(c=d.newValue,this.input.value2input(c),"string"==typeof d.msg)return this.error(d.msg),void this.showForm()}else if(d)return this.error(d),void this.showForm();if(!this.options.savenochange&&this.input.value2str(c)==this.input.value2str(this.value))return void this.$div.triggerHandler("nochange");var e=this.input.value2submit(c);this.isSaving=!0,a.when(this.save(e)).done(a.proxy(function(a){this.isSaving=!1;var b="function"==typeof this.options.success?this.options.success.call(this.options.scope,a,c):null;return b===!1?(this.error(!1),void this.showForm(!1)):"string"==typeof b?(this.error(b),void this.showForm()):(b&&"object"==typeof b&&b.hasOwnProperty("newValue")&&(c=b.newValue),this.error(!1),this.value=c,void this.$div.triggerHandler("save",{"newValue":c,"submitValue":e,"response":a}))},this)).fail(a.proxy(function(a){this.isSaving=!1;var b;b="function"==typeof this.options.error?this.options.error.call(this.options.scope,a,c):"string"==typeof a?a:a.responseText||a.statusText||"Unknown error!",this.error(b),this.showForm()},this))},"save":function(b){this.options.pk=a.fn.editableutils.tryParseJson(this.options.pk,!0);var c,d="function"==typeof this.options.pk?this.options.pk.call(this.options.scope):this.options.pk,e=!!("function"==typeof this.options.url||this.options.url&&("always"===this.options.send||"auto"===this.options.send&&null!==d&&void 0!==d));
|
|
return e?(this.showLoading(),c={"name":this.options.name||"","value":b,"pk":d},"function"==typeof this.options.params?c=this.options.params.call(this.options.scope,c):(this.options.params=a.fn.editableutils.tryParseJson(this.options.params,!0),a.extend(c,this.options.params)),"function"==typeof this.options.url?this.options.url.call(this.options.scope,c):a.ajax(a.extend({"url":this.options.url,"data":c,"type":"POST"},this.options.ajaxOptions))):void 0},"validate":function(a){return void 0===a&&(a=this.value),"function"==typeof this.options.validate?this.options.validate.call(this.options.scope,a):void 0},"option":function(a,b){a in this.options&&(this.options[a]=b),"value"===a&&this.setValue(b)},"setValue":function(a,b){this.value=b?this.input.str2value(a):a,this.$form&&this.$form.is(":visible")&&this.input.value2input(this.value)}},a.fn.editableform=function(c){var d=arguments;return this.each(function(){var e=a(this),f=e.data("editableform"),g="object"==typeof c&&c;f||e.data("editableform",f=new b(this,g)),"string"==typeof c&&f[c].apply(f,Array.prototype.slice.call(d,1))})},a.fn.editableform.Constructor=b,a.fn.editableform.defaults={"type":"text","url":null,"params":null,"name":null,"pk":null,"value":null,"defaultValue":null,"send":"auto","validate":null,"success":null,"error":null,"ajaxOptions":null,"showbuttons":!0,"scope":null,"savenochange":!1},a.fn.editableform.template='<form class="form-inline editableform"><div class="control-group"><div><div class="editable-input"></div><div class="editable-buttons"></div></div><div class="editable-error-block"></div></div></form>',a.fn.editableform.loading='<div class="editableform-loading"></div>',a.fn.editableform.buttons='<button type="submit" class="editable-submit">ok</button><button type="button" class="editable-cancel">cancel</button>',a.fn.editableform.errorGroupClass=null,a.fn.editableform.errorBlockClass="editable-error",a.fn.editableform.engine="jquery"}(window.jQuery),function(a){"use strict";a.fn.editableutils={"inherit":function(a,b){var c=function(){};c.prototype=b.prototype,a.prototype=new c,a.prototype.constructor=a,a.superclass=b.prototype},"setCursorPosition":function(a,b){if(a.setSelectionRange)a.setSelectionRange(b,b);else if(a.createTextRange){var c=a.createTextRange();c.collapse(!0),c.moveEnd("character",b),c.moveStart("character",b),c.select()}},"tryParseJson":function(a,b){if("string"==typeof a&&a.length&&a.match(/^[\{\[].*[\}\]]$/))if(b)try{a=new Function("return "+a)()}catch(c){}finally{return a}else a=new Function("return "+a)();return a},"sliceObj":function(b,c,d){var e,f,g={};if(!a.isArray(c)||!c.length)return g;for(var h=0;h<c.length;h++)e=c[h],b.hasOwnProperty(e)&&(g[e]=b[e]),d!==!0&&(f=e.toLowerCase(),b.hasOwnProperty(f)&&(g[e]=b[f]));return g},"getConfigData":function(b){var c={};return a.each(b.data(),function(a,b){("object"!=typeof b||b&&"object"==typeof b&&(b.constructor===Object||b.constructor===Array))&&(c[a]=b)}),c},"objectKeys":function(a){if(Object.keys)return Object.keys(a);if(a!==Object(a))throw new TypeError("Object.keys called on a non-object");var b,c=[];for(b in a)Object.prototype.hasOwnProperty.call(a,b)&&c.push(b);return c},"escape":function(b){return a("<div>").text(b).html()},"itemsByValue":function(b,c,d){if(!c||null===b)return[];if("function"!=typeof d){var e=d||"value";d=function(a){return a[e]}}var f=a.isArray(b),g=[],h=this;return a.each(c,function(c,e){if(e.children)g=g.concat(h.itemsByValue(b,e.children,d));else if(f)a.grep(b,function(a){return a==(e&&"object"==typeof e?d(e):e)}).length&&g.push(e);else{var i=e&&"object"==typeof e?d(e):e;b==i&&g.push(e)}}),g},"createInput":function(b){var c,d,e,f=b.type;return"date"===f&&("inline"===b.mode?a.fn.editabletypes.datefield?f="datefield":a.fn.editabletypes.dateuifield&&(f="dateuifield"):a.fn.editabletypes.date?f="date":a.fn.editabletypes.dateui&&(f="dateui"),"date"!==f||a.fn.editabletypes.date||(f="combodate")),"datetime"===f&&"inline"===b.mode&&(f="datetimefield"),"wysihtml5"!==f||a.fn.editabletypes[f]||(f="textarea"),"function"==typeof a.fn.editabletypes[f]?(c=a.fn.editabletypes[f],d=this.sliceObj(b,this.objectKeys(c.defaults)),e=new c(d)):(a.error("Unknown type: "+f),!1)},"supportsTransitions":function(){var a=document.body||document.documentElement,b=a.style,c="transition",d=["Moz","Webkit","Khtml","O","ms"];if("string"==typeof b[c])return!0;c=c.charAt(0).toUpperCase()+c.substr(1);for(var e=0;e<d.length;e++)if("string"==typeof b[d[e]+c])return!0;return!1}}}(window.jQuery),function(a){"use strict";var b=function(a,b){this.init(a,b)},c=function(a,b){this.init(a,b)};b.prototype={"containerName":null,"containerDataName":null,"innerCss":null,"containerClass":"editable-container editable-popup","defaults":{},"init":function(c,d){this.$element=a(c),this.options=a.extend({},a.fn.editableContainer.defaults,d),this.splitOptions(),this.formOptions.scope=this.$element[0],this.initContainer(),this.delayedHide=!1,this.$element.on("destroyed",a.proxy(function(){this.destroy()},this)),a(document).data("editable-handlers-attached")||(a(document).on("keyup.editable",function(b){27===b.which&&a(".editable-open").editableContainer("hide")}),a(document).on("click.editable",function(c){var d,e=a(c.target),f=[".editable-container",".ui-datepicker-header",".datepicker",".modal-backdrop",".bootstrap-wysihtml5-insert-image-modal",".bootstrap-wysihtml5-insert-link-modal"];if(a.contains(document.documentElement,c.target)&&!e.is(document)){for(d=0;d<f.length;d++)if(e.is(f[d])||e.parents(f[d]).length)return;b.prototype.closeOthers(c.target)}}),a(document).data("editable-handlers-attached",!0))},"splitOptions":function(){if(this.containerOptions={},this.formOptions={},!a.fn[this.containerName])throw new Error(this.containerName+" not found. Have you included corresponding js file?");for(var b in this.options)b in this.defaults?this.containerOptions[b]=this.options[b]:this.formOptions[b]=this.options[b]},"tip":function(){return this.container()?this.container().$tip:null},"container":function(){var a;return this.containerDataName&&(a=this.$element.data(this.containerDataName))?a:a=this.$element.data(this.containerName)},"call":function(){this.$element[this.containerName].apply(this.$element,arguments)},"initContainer":function(){this.call(this.containerOptions)},"renderForm":function(){this.$form.editableform(this.formOptions).on({"save":a.proxy(this.save,this),"nochange":a.proxy(function(){this.hide("nochange")},this),"cancel":a.proxy(function(){this.hide("cancel")},this),"show":a.proxy(function(){this.delayedHide?(this.hide(this.delayedHide.reason),this.delayedHide=!1):this.setPosition()},this),"rendering":a.proxy(this.setPosition,this),"resize":a.proxy(this.setPosition,this),"rendered":a.proxy(function(){this.$element.triggerHandler("shown",a(this.options.scope).data("editable"))},this)}).editableform("render")},"show":function(b){this.$element.addClass("editable-open"),b!==!1&&this.closeOthers(this.$element[0]),this.innerShow(),this.tip().addClass(this.containerClass),this.$form,this.$form=a("<div>"),this.tip().is(this.innerCss)?this.tip().append(this.$form):this.tip().find(this.innerCss).append(this.$form),this.renderForm()},"hide":function(a){if(this.tip()&&this.tip().is(":visible")&&this.$element.hasClass("editable-open")){if(this.$form.data("editableform").isSaving)return void(this.delayedHide={"reason":a});this.delayedHide=!1,this.$element.removeClass("editable-open"),this.innerHide(),this.$element.triggerHandler("hidden",a||"manual")}},"innerShow":function(){},"innerHide":function(){},"toggle":function(a){this.container()&&this.tip()&&this.tip().is(":visible")?this.hide():this.show(a)},"setPosition":function(){},"save":function(a,b){this.$element.triggerHandler("save",b),this.hide("save")},"option":function(a,b){this.options[a]=b,a in this.containerOptions?(this.containerOptions[a]=b,this.setContainerOption(a,b)):(this.formOptions[a]=b,this.$form&&this.$form.editableform("option",a,b))},"setContainerOption":function(a,b){this.call("option",a,b)},"destroy":function(){this.hide(),this.innerDestroy(),this.$element.off("destroyed"),this.$element.removeData("editableContainer")},"innerDestroy":function(){},"closeOthers":function(b){a(".editable-open").each(function(c,d){if(d!==b&&!a(d).find(b).length){var e=a(d),f=e.data("editableContainer");f&&("cancel"===f.options.onblur?e.data("editableContainer").hide("onblur"):"submit"===f.options.onblur&&e.data("editableContainer").tip().find("form").submit())}})},"activate":function(){this.tip&&this.tip().is(":visible")&&this.$form&&this.$form.data("editableform").input.activate()}},a.fn.editableContainer=function(d){var e=arguments;return this.each(function(){var f=a(this),g="editableContainer",h=f.data(g),i="object"==typeof d&&d,j="inline"===i.mode?c:b;h||f.data(g,h=new j(this,i)),"string"==typeof d&&h[d].apply(h,Array.prototype.slice.call(e,1))})},a.fn.editableContainer.Popup=b,a.fn.editableContainer.Inline=c,a.fn.editableContainer.defaults={"value":null,"placement":"top","autohide":!0,"onblur":"cancel","anim":!1,"mode":"popup"},jQuery.event.special.destroyed={"remove":function(a){a.handler&&a.handler()}}}(window.jQuery),function(a){"use strict";a.extend(a.fn.editableContainer.Inline.prototype,a.fn.editableContainer.Popup.prototype,{"containerName":"editableform","innerCss":".editable-inline","containerClass":"editable-container editable-inline","initContainer":function(){this.$tip=a("<span></span>"),this.options.anim||(this.options.anim=0)},"splitOptions":function(){this.containerOptions={},this.formOptions=this.options},"tip":function(){return this.$tip},"innerShow":function(){this.$element.hide(),this.tip().insertAfter(this.$element).show()},"innerHide":function(){this.$tip.hide(this.options.anim,a.proxy(function(){this.$element.show(),this.innerDestroy()},this))},"innerDestroy":function(){this.tip()&&this.tip().empty().remove()}})}(window.jQuery),function(a){"use strict";var b=function(b,c){this.$element=a(b),this.options=a.extend({},a.fn.editable.defaults,c,a.fn.editableutils.getConfigData(this.$element)),this.options.selector?this.initLive():this.init(),this.options.highlight&&!a.fn.editableutils.supportsTransitions()&&(this.options.highlight=!1)};b.prototype={"constructor":b,"init":function(){var b,c=!1;if(this.options.name=this.options.name||this.$element.attr("id"),this.options.scope=this.$element[0],this.input=a.fn.editableutils.createInput(this.options),this.input){switch(void 0===this.options.value||null===this.options.value?(this.value=this.input.html2value(a.trim(this.$element.html())),c=!0):(this.options.value=a.fn.editableutils.tryParseJson(this.options.value,!0),this.value="string"==typeof this.options.value?this.input.str2value(this.options.value):this.options.value),this.$element.addClass("editable"),"textarea"===this.input.type&&this.$element.addClass("editable-pre-wrapped"),"manual"!==this.options.toggle?(this.$element.addClass("editable-click"),this.$element.on(this.options.toggle+".editable",a.proxy(function(a){if(this.options.disabled||a.preventDefault(),"mouseenter"===this.options.toggle)this.show();else{var b="click"!==this.options.toggle;this.toggle(b)}},this))):this.$element.attr("tabindex",-1),"function"==typeof this.options.display&&(this.options.autotext="always"),this.options.autotext){case"always":b=!0;break;case"auto":b=!a.trim(this.$element.text()).length&&null!==this.value&&void 0!==this.value&&!c;break;default:b=!1}a.when(b?this.render():!0).then(a.proxy(function(){this.options.disabled?this.disable():this.enable(),this.$element.triggerHandler("init",this)},this))}},"initLive":function(){var b=this.options.selector;this.options.selector=!1,this.options.autotext="never",this.$element.on(this.options.toggle+".editable",b,a.proxy(function(b){var c=a(b.target);c.data("editable")||(c.hasClass(this.options.emptyclass)&&c.empty(),c.editable(this.options).trigger(b))},this))},"render":function(a){return this.options.display!==!1?this.input.value2htmlFinal?this.input.value2html(this.value,this.$element[0],this.options.display,a):"function"==typeof this.options.display?this.options.display.call(this.$element[0],this.value,a):this.input.value2html(this.value,this.$element[0]):void 0},"enable":function(){this.options.disabled=!1,this.$element.removeClass("editable-disabled"),this.handleEmpty(this.isEmpty),"manual"!==this.options.toggle&&"-1"===this.$element.attr("tabindex")&&this.$element.removeAttr("tabindex")},"disable":function(){this.options.disabled=!0,this.hide(),this.$element.addClass("editable-disabled"),this.handleEmpty(this.isEmpty),this.$element.attr("tabindex",-1)},"toggleDisabled":function(){this.options.disabled?this.enable():this.disable()},"option":function(b,c){return b&&"object"==typeof b?void a.each(b,a.proxy(function(b,c){this.option(a.trim(b),c)},this)):(this.options[b]=c,"disabled"===b?c?this.disable():this.enable():("value"===b&&this.setValue(c),this.container&&this.container.option(b,c),void(this.input.option&&this.input.option(b,c))))},"handleEmpty":function(b){this.options.display!==!1&&(this.isEmpty=void 0!==b?b:"function"==typeof this.input.isEmpty?this.input.isEmpty(this.$element):""===a.trim(this.$element.html()),this.options.disabled?this.isEmpty&&(this.$element.empty(),this.options.emptyclass&&this.$element.removeClass(this.options.emptyclass)):this.isEmpty?(this.$element.html(this.options.emptytext),this.options.emptyclass&&this.$element.addClass(this.options.emptyclass)):this.options.emptyclass&&this.$element.removeClass(this.options.emptyclass))},"show":function(b){if(!this.options.disabled){if(this.container){if(this.container.tip().is(":visible"))return}else{var c=a.extend({},this.options,{"value":this.value,"input":this.input});this.$element.editableContainer(c),this.$element.on("save.internal",a.proxy(this.save,this)),this.container=this.$element.data("editableContainer")}this.container.show(b)}},"hide":function(){this.container&&this.container.hide()},"toggle":function(a){this.container&&this.container.tip().is(":visible")?this.hide():this.show(a)},"save":function(a,b){if(this.options.unsavedclass){var c=!1;c=c||"function"==typeof this.options.url,c=c||this.options.display===!1,c=c||void 0!==b.response,c=c||this.options.savenochange&&this.input.value2str(this.value)!==this.input.value2str(b.newValue),c?this.$element.removeClass(this.options.unsavedclass):this.$element.addClass(this.options.unsavedclass)}if(this.options.highlight){var d=this.$element,e=d.css("background-color");d.css("background-color",this.options.highlight),setTimeout(function(){"transparent"===e&&(e=""),d.css("background-color",e),d.addClass("editable-bg-transition"),setTimeout(function(){d.removeClass("editable-bg-transition")},1700)},10)}this.setValue(b.newValue,!1,b.response)},"validate":function(){return"function"==typeof this.options.validate?this.options.validate.call(this,this.value):void 0},"setValue":function(b,c,d){this.value=c?this.input.str2value(b):b,this.container&&this.container.option("value",this.value),a.when(this.render(d)).then(a.proxy(function(){this.handleEmpty()},this))},"activate":function(){this.container&&this.container.activate()},"destroy":function(){this.disable(),this.container&&this.container.destroy(),this.input.destroy(),"manual"!==this.options.toggle&&(this.$element.removeClass("editable-click"),this.$element.off(this.options.toggle+".editable")),this.$element.off("save.internal"),this.$element.removeClass("editable editable-open editable-disabled"),this.$element.removeData("editable")}},a.fn.editable=function(c){var d={},e=arguments,f="editable";switch(c){case"validate":return this.each(function(){var b,c=a(this),e=c.data(f);e&&(b=e.validate())&&(d[e.options.name]=b)}),d;case"getValue":return 2===arguments.length&&arguments[1]===!0?d=this.eq(0).data(f).value:this.each(function(){var b=a(this),c=b.data(f);c&&void 0!==c.value&&null!==c.value&&(d[c.options.name]=c.input.value2submit(c.value))}),d;case"submit":var g=arguments[1]||{},h=this,i=this.editable("validate");if(a.isEmptyObject(i)){var j={};if(1===h.length){var k=h.data("editable"),l={"name":k.options.name||"","value":k.input.value2submit(k.value),"pk":"function"==typeof k.options.pk?k.options.pk.call(k.options.scope):k.options.pk};"function"==typeof k.options.params?l=k.options.params.call(k.options.scope,l):(k.options.params=a.fn.editableutils.tryParseJson(k.options.params,!0),a.extend(l,k.options.params)),j={"url":k.options.url,"data":l,"type":"POST"},g.success=g.success||k.options.success,g.error=g.error||k.options.error}else{var m=this.editable("getValue");j={"url":g.url,"data":m,"type":"POST"}}j.success="function"==typeof g.success?function(a){g.success.call(h,a,g)}:a.noop,j.error="function"==typeof g.error?function(){g.error.apply(h,arguments)}:a.noop,g.ajaxOptions&&a.extend(j,g.ajaxOptions),g.data&&a.extend(j.data,g.data),a.ajax(j)}else"function"==typeof g.error&&g.error.call(h,i);return this}return this.each(function(){var d=a(this),g=d.data(f),h="object"==typeof c&&c;return h&&h.selector?void(g=new b(this,h)):(g||d.data(f,g=new b(this,h)),void("string"==typeof c&&g[c].apply(g,Array.prototype.slice.call(e,1))))})},a.fn.editable.defaults={"type":"text","disabled":!1,"toggle":"click","emptytext":"Empty","autotext":"auto","value":null,"display":null,"emptyclass":"editable-empty","unsavedclass":"editable-unsaved","selector":null,"highlight":"#FFFF80"}}(window.jQuery),function(a){"use strict";a.fn.editabletypes={};var b=function(){};b.prototype={"init":function(b,c,d){this.type=b,this.options=a.extend({},d,c)},"prerender":function(){this.$tpl=a(this.options.tpl),this.$input=this.$tpl,this.$clear=null,this.error=null},"render":function(){},"value2html":function(b,c){a(c)[this.options.escape?"text":"html"](a.trim(b))},"html2value":function(b){return a("<div>").html(b).text()},"value2str":function(a){return a},"str2value":function(a){return a},"value2submit":function(a){return a},"value2input":function(a){this.$input.val(a)},"input2value":function(){return this.$input.val()},"activate":function(){this.$input.is(":visible")&&this.$input.focus()},"clear":function(){this.$input.val(null)},"escape":function(b){return a("<div>").text(b).html()},"autosubmit":function(){},"destroy":function(){},"setClass":function(){this.options.inputclass&&this.$input.addClass(this.options.inputclass)},"setAttr":function(a){void 0!==this.options[a]&&null!==this.options[a]&&this.$input.attr(a,this.options[a])},"option":function(a,b){this.options[a]=b}},b.defaults={"tpl":"","inputclass":null,"escape":!0,"scope":null,"showbuttons":!0},a.extend(a.fn.editabletypes,{"abstractinput":b})}(window.jQuery),function(a){"use strict";var b=function(){};a.fn.editableutils.inherit(b,a.fn.editabletypes.abstractinput),a.extend(b.prototype,{"render":function(){var b=a.Deferred();return this.error=null,this.onSourceReady(function(){this.renderList(),b.resolve()},function(){this.error=this.options.sourceError,b.resolve()}),b.promise()},"html2value":function(){return null},"value2html":function(b,c,d,e){var f=a.Deferred(),g=function(){"function"==typeof d?d.call(c,b,this.sourceData,e):this.value2htmlFinal(b,c),f.resolve()};return null===b?g.call(this):this.onSourceReady(g,function(){f.resolve()}),f.promise()},"onSourceReady":function(b,c){var d;if(a.isFunction(this.options.source)?(d=this.options.source.call(this.options.scope),this.sourceData=null):d=this.options.source,this.options.sourceCache&&a.isArray(this.sourceData))return void b.call(this);try{d=a.fn.editableutils.tryParseJson(d,!1)}catch(e){return void c.call(this)}if("string"==typeof d){if(this.options.sourceCache){var f,g=d;if(a(document).data(g)||a(document).data(g,{}),f=a(document).data(g),f.loading===!1&&f.sourceData)return this.sourceData=f.sourceData,this.doPrepend(),void b.call(this);if(f.loading===!0)return f.callbacks.push(a.proxy(function(){this.sourceData=f.sourceData,this.doPrepend(),b.call(this)},this)),void f.err_callbacks.push(a.proxy(c,this));f.loading=!0,f.callbacks=[],f.err_callbacks=[]}var h=a.extend({"url":d,"type":"get","cache":!1,"dataType":"json","success":a.proxy(function(d){f&&(f.loading=!1),this.sourceData=this.makeArray(d),a.isArray(this.sourceData)?(f&&(f.sourceData=this.sourceData,a.each(f.callbacks,function(){this.call()})),this.doPrepend(),b.call(this)):(c.call(this),f&&a.each(f.err_callbacks,function(){this.call()}))},this),"error":a.proxy(function(){c.call(this),f&&(f.loading=!1,a.each(f.err_callbacks,function(){this.call()}))},this)},this.options.sourceOptions);a.ajax(h)}else this.sourceData=this.makeArray(d),a.isArray(this.sourceData)?(this.doPrepend(),b.call(this)):c.call(this)},"doPrepend":function(){null!==this.options.prepend&&void 0!==this.options.prepend&&(a.isArray(this.prependData)||(a.isFunction(this.options.prepend)&&(this.options.prepend=this.options.prepend.call(this.options.scope)),this.options.prepend=a.fn.editableutils.tryParseJson(this.options.prepend,!0),"string"==typeof this.options.prepend&&(this.options.prepend={"":this.options.prepend}),this.prependData=this.makeArray(this.options.prepend)),a.isArray(this.prependData)&&a.isArray(this.sourceData)&&(this.sourceData=this.prependData.concat(this.sourceData)))},"renderList":function(){},"value2htmlFinal":function(){},"makeArray":function(b){var c,d,e,f,g=[];if(!b||"string"==typeof b)return null;if(a.isArray(b)){f=function(a,b){return d={"value":a,"text":b},c++>=2?!1:void 0};for(var h=0;h<b.length;h++)e=b[h],"object"==typeof e?(c=0,a.each(e,f),1===c?g.push(d):c>1&&(e.children&&(e.children=this.makeArray(e.children)),g.push(e))):g.push({"value":e,"text":e})}else a.each(b,function(a,b){g.push({"value":a,"text":b})});return g},"option":function(a,b){this.options[a]=b,"source"===a&&(this.sourceData=null),"prepend"===a&&(this.prependData=null)}}),b.defaults=a.extend({},a.fn.editabletypes.abstractinput.defaults,{"source":null,"prepend":!1,"sourceError":"Error when loading list","sourceCache":!0,"sourceOptions":null}),a.fn.editabletypes.list=b}(window.jQuery),function(a){"use strict";var b=function(a){this.init("text",a,b.defaults)};a.fn.editableutils.inherit(b,a.fn.editabletypes.abstractinput),a.extend(b.prototype,{"render":function(){this.renderClear(),this.setClass(),this.setAttr("placeholder")},"activate":function(){this.$input.is(":visible")&&(this.$input.focus(),a.fn.editableutils.setCursorPosition(this.$input.get(0),this.$input.val().length),this.toggleClear&&this.toggleClear())},"renderClear":function(){this.options.clear&&(this.$clear=a('<span class="editable-clear-x"></span>'),this.$input.after(this.$clear).css("padding-right",24).keyup(a.proxy(function(b){if(!~a.inArray(b.keyCode,[40,38,9,13,27])){clearTimeout(this.t);var c=this;this.t=setTimeout(function(){c.toggleClear(b)},100)}},this)).parent().css("position","relative"),this.$clear.click(a.proxy(this.clear,this)))},"postrender":function(){},"toggleClear":function(){if(this.$clear){var a=this.$input.val().length,b=this.$clear.is(":visible");a&&!b&&this.$clear.show(),!a&&b&&this.$clear.hide()}},"clear":function(){this.$clear.hide(),this.$input.val("").focus()}}),b.defaults=a.extend({},a.fn.editabletypes.abstractinput.defaults,{"tpl":'<input type="text">',"placeholder":null,"clear":!0}),a.fn.editabletypes.text=b}(window.jQuery),function(a){"use strict";var b=function(a){this.init("textarea",a,b.defaults)};a.fn.editableutils.inherit(b,a.fn.editabletypes.abstractinput),a.extend(b.prototype,{"render":function(){this.setClass(),this.setAttr("placeholder"),this.setAttr("rows"),this.$input.keydown(function(b){b.ctrlKey&&13===b.which&&a(this).closest("form").submit()})},"activate":function(){a.fn.editabletypes.text.prototype.activate.call(this)}}),b.defaults=a.extend({},a.fn.editabletypes.abstractinput.defaults,{"tpl":"<textarea></textarea>","inputclass":"input-large","placeholder":null,"rows":7}),a.fn.editabletypes.textarea=b}(window.jQuery),function(a){"use strict";var b=function(a){this.init("select",a,b.defaults)};a.fn.editableutils.inherit(b,a.fn.editabletypes.list),a.extend(b.prototype,{"renderList":function(){this.$input.empty();var b=function(c,d){var e;if(a.isArray(d))for(var f=0;f<d.length;f++)e={},d[f].children?(e.label=d[f].text,c.append(b(a("<optgroup>",e),d[f].children))):(e.value=d[f].value,d[f].disabled&&(e.disabled=!0),c.append(a("<option>",e).text(d[f].text)));return c};b(this.$input,this.sourceData),this.setClass(),this.$input.on("keydown.editable",function(b){13===b.which&&a(this).closest("form").submit()})},"value2htmlFinal":function(b,c){var d="",e=a.fn.editableutils.itemsByValue(b,this.sourceData);e.length&&(d=e[0].text),a.fn.editabletypes.abstractinput.prototype.value2html.call(this,d,c)},"autosubmit":function(){this.$input.off("keydown.editable").on("change.editable",function(){a(this).closest("form").submit()})}}),b.defaults=a.extend({},a.fn.editabletypes.list.defaults,{"tpl":"<select></select>"}),a.fn.editabletypes.select=b}(window.jQuery),function(a){"use strict";var b=function(a){this.init("checklist",a,b.defaults)};a.fn.editableutils.inherit(b,a.fn.editabletypes.list),a.extend(b.prototype,{"renderList":function(){var b;if(this.$tpl.empty(),a.isArray(this.sourceData)){for(var c=0;c<this.sourceData.length;c++)b=a("<label>").append(a("<input>",{"type":"checkbox","value":this.sourceData[c].value})).append(a("<span>").text(" "+this.sourceData[c].text)),a("<div>").append(b).appendTo(this.$tpl);this.$input=this.$tpl.find('input[type="checkbox"]'),this.setClass()}},"value2str":function(b){return a.isArray(b)?b.sort().join(a.trim(this.options.separator)):""},"str2value":function(b){var c,d=null;return"string"==typeof b&&b.length?(c=new RegExp("\\s*"+a.trim(this.options.separator)+"\\s*"),d=b.split(c)):d=a.isArray(b)?b:[b],d},"value2input":function(b){this.$input.prop("checked",!1),a.isArray(b)&&b.length&&this.$input.each(function(c,d){var e=a(d);a.each(b,function(a,b){e.val()==b&&e.prop("checked",!0)})})},"input2value":function(){var b=[];return this.$input.filter(":checked").each(function(c,d){b.push(a(d).val())}),b},"value2htmlFinal":function(b,c){var d=[],e=a.fn.editableutils.itemsByValue(b,this.sourceData),f=this.options.escape;e.length?(a.each(e,function(b,c){var e=f?a.fn.editableutils.escape(c.text):c.text;d.push(e)}),a(c).html(d.join("<br>"))):a(c).empty()},"activate":function(){this.$input.first().focus()},"autosubmit":function(){this.$input.on("keydown",function(b){13===b.which&&a(this).closest("form").submit()})}}),b.defaults=a.extend({},a.fn.editabletypes.list.defaults,{"tpl":'<div class="editable-checklist"></div>',"inputclass":null,"separator":","}),a.fn.editabletypes.checklist=b}(window.jQuery),function(a){"use strict";var b=function(a){this.init("password",a,b.defaults)};a.fn.editableutils.inherit(b,a.fn.editabletypes.text),a.extend(b.prototype,{"value2html":function(b,c){b?a(c).text("[hidden]"):a(c).empty()},"html2value":function(){return null}}),b.defaults=a.extend({},a.fn.editabletypes.text.defaults,{"tpl":'<input type="password">'}),a.fn.editabletypes.password=b}(window.jQuery),function(a){"use strict";var b=function(a){this.init("email",a,b.defaults)};a.fn.editableutils.inherit(b,a.fn.editabletypes.text),b.defaults=a.extend({},a.fn.editabletypes.text.defaults,{"tpl":'<input type="email">'}),a.fn.editabletypes.email=b}(window.jQuery),function(a){"use strict";var b=function(a){this.init("url",a,b.defaults)};a.fn.editableutils.inherit(b,a.fn.editabletypes.text),b.defaults=a.extend({},a.fn.editabletypes.text.defaults,{"tpl":'<input type="url">'}),a.fn.editabletypes.url=b}(window.jQuery),function(a){"use strict";var b=function(a){this.init("tel",a,b.defaults)};a.fn.editableutils.inherit(b,a.fn.editabletypes.text),b.defaults=a.extend({},a.fn.editabletypes.text.defaults,{"tpl":'<input type="tel">'}),a.fn.editabletypes.tel=b}(window.jQuery),function(a){"use strict";var b=function(a){this.init("number",a,b.defaults)};a.fn.editableutils.inherit(b,a.fn.editabletypes.text),a.extend(b.prototype,{"render":function(){b.superclass.render.call(this),this.setAttr("min"),this.setAttr("max"),this.setAttr("step")},"postrender":function(){this.$clear&&this.$clear.css({"right":24})}}),b.defaults=a.extend({},a.fn.editabletypes.text.defaults,{"tpl":'<input type="number">',"inputclass":"input-mini","min":null,"max":null,"step":null}),a.fn.editabletypes.number=b}(window.jQuery),function(a){"use strict";var b=function(a){this.init("range",a,b.defaults)};a.fn.editableutils.inherit(b,a.fn.editabletypes.number),a.extend(b.prototype,{"render":function(){this.$input=this.$tpl.filter("input"),this.setClass(),this.setAttr("min"),this.setAttr("max"),this.setAttr("step"),this.$input.on("input",function(){a(this).siblings("output").text(a(this).val())})},"activate":function(){this.$input.focus()}}),b.defaults=a.extend({},a.fn.editabletypes.number.defaults,{"tpl":'<input type="range"><output style="width: 30px; display: inline-block"></output>',"inputclass":"input-medium"}),a.fn.editabletypes.range=b}(window.jQuery),function(a){"use strict";var b=function(a){this.init("time",a,b.defaults)};a.fn.editableutils.inherit(b,a.fn.editabletypes.abstractinput),a.extend(b.prototype,{"render":function(){this.setClass()}}),b.defaults=a.extend({},a.fn.editabletypes.abstractinput.defaults,{"tpl":'<input type="time">'}),a.fn.editabletypes.time=b}(window.jQuery),function(a){"use strict";var b=function(c){if(this.init("select2",c,b.defaults),c.select2=c.select2||{},this.sourceData=null,c.placeholder&&(c.select2.placeholder=c.placeholder),!c.select2.tags&&c.source){var d=c.source;a.isFunction(c.source)&&(d=c.source.call(c.scope)),"string"==typeof d?(c.select2.ajax=c.select2.ajax||{},c.select2.ajax.data||(c.select2.ajax.data=function(a){return{"query":a}}),c.select2.ajax.results||(c.select2.ajax.results=function(a){return{"results":a}}),c.select2.ajax.url=d):(this.sourceData=this.convertSource(d),c.select2.data=this.sourceData)}if(this.options.select2=a.extend({},b.defaults.select2,c.select2),this.isMultiple=this.options.select2.tags||this.options.select2.multiple,this.isRemote="ajax"in this.options.select2,this.idFunc=this.options.select2.id,"function"!=typeof this.idFunc){var e=this.idFunc||"id";this.idFunc=function(a){return a[e]}}this.formatSelection=this.options.select2.formatSelection,"function"!=typeof this.formatSelection&&(this.formatSelection=function(a){return a.text})};a.fn.editableutils.inherit(b,a.fn.editabletypes.abstractinput),a.extend(b.prototype,{"render":function(){this.setClass(),this.isRemote&&this.$input.on("select2-loaded",a.proxy(function(a){this.sourceData=a.items.results},this)),this.isMultiple&&this.$input.on("change",function(){a(this).closest("form").parent().triggerHandler("resize")})},"value2html":function(c,d){var e,f="",g=this;this.options.select2.tags?e=c:this.sourceData&&(e=a.fn.editableutils.itemsByValue(c,this.sourceData,this.idFunc)),a.isArray(e)?(f=[],a.each(e,function(a,b){f.push(b&&"object"==typeof b?g.formatSelection(b):b)})):e&&(f=g.formatSelection(e)),f=a.isArray(f)?f.join(this.options.viewseparator):f,b.superclass.value2html.call(this,f,d)},"html2value":function(a){return this.options.select2.tags?this.str2value(a,this.options.viewseparator):null},"value2input":function(b){if(a.isArray(b)&&(b=b.join(this.getSeparator())),this.$input.data("select2")?this.$input.val(b).trigger("change",!0):(this.$input.val(b),this.$input.select2(this.options.select2)),this.isRemote&&!this.isMultiple&&!this.options.select2.initSelection){var c=this.options.select2.id,d=this.options.select2.formatSelection;if(!c&&!d){var e=a(this.options.scope);if(!e.data("editable").isEmpty){var f={"id":b,"text":e.text()};this.$input.select2("data",f)}}}},"input2value":function(){return this.$input.select2("val")},"str2value":function(b,c){if("string"!=typeof b||!this.isMultiple)return b;c=c||this.getSeparator();var d,e,f;if(null===b||b.length<1)return null;for(d=b.split(c),e=0,f=d.length;f>e;e+=1)d[e]=a.trim(d[e]);return d},"autosubmit":function(){this.$input.on("change",function(b,c){c||a(this).closest("form").submit()})},"getSeparator":function(){return this.options.select2.separator||a.fn.select2.defaults.separator
|
|
},"convertSource":function(b){if(a.isArray(b)&&b.length&&void 0!==b[0].value)for(var c=0;c<b.length;c++)void 0!==b[c].value&&(b[c].id=b[c].value,delete b[c].value);return b},"destroy":function(){this.$input.data("select2")&&this.$input.select2("destroy")}}),b.defaults=a.extend({},a.fn.editabletypes.abstractinput.defaults,{"tpl":'<input type="hidden">',"select2":null,"placeholder":null,"source":null,"viewseparator":", "}),a.fn.editabletypes.select2=b}(window.jQuery),function(a){var b=function(b,c){return this.$element=a(b),this.$element.is("input")?(this.options=a.extend({},a.fn.combodate.defaults,c,this.$element.data()),void this.init()):void a.error("Combodate should be applied to INPUT element")};b.prototype={"constructor":b,"init":function(){this.map={"day":["D","date"],"month":["M","month"],"year":["Y","year"],"hour":["[Hh]","hours"],"minute":["m","minutes"],"second":["s","seconds"],"ampm":["[Aa]",""]},this.$widget=a('<span class="combodate"></span>').html(this.getTemplate()),this.initCombos(),this.$widget.on("change","select",a.proxy(function(b){this.$element.val(this.getValue()).change(),this.options.smartDays&&(a(b.target).is(".month")||a(b.target).is(".year"))&&this.fillCombo("day")},this)),this.$widget.find("select").css("width","auto"),this.$element.hide().after(this.$widget),this.setValue(this.$element.val()||this.options.value)},"getTemplate":function(){var b=this.options.template;return a.each(this.map,function(a,c){c=c[0];var d=new RegExp(c+"+"),e=c.length>1?c.substring(1,2):c;b=b.replace(d,"{"+e+"}")}),b=b.replace(/ /g," "),a.each(this.map,function(a,c){c=c[0];var d=c.length>1?c.substring(1,2):c;b=b.replace("{"+d+"}",'<select class="'+a+'"></select>')}),b},"initCombos":function(){for(var a in this.map){var b=this.$widget.find("."+a);this["$"+a]=b.length?b:null,this.fillCombo(a)}},"fillCombo":function(a){var b=this["$"+a];if(b){var c="fill"+a.charAt(0).toUpperCase()+a.slice(1),d=this[c](),e=b.val();b.empty();for(var f=0;f<d.length;f++)b.append('<option value="'+d[f][0]+'">'+d[f][1]+"</option>");b.val(e)}},"fillCommon":function(a){var b,c=[];if("name"===this.options.firstItem){b=moment.relativeTime||moment.langData()._relativeTime;var d="function"==typeof b[a]?b[a](1,!0,a,!1):b[a];d=d.split(" ").reverse()[0],c.push(["",d])}else"empty"===this.options.firstItem&&c.push(["",""]);return c},"fillDay":function(){var a,b,c=this.fillCommon("d"),d=-1!==this.options.template.indexOf("DD"),e=31;if(this.options.smartDays&&this.$month&&this.$year){var f=parseInt(this.$month.val(),10),g=parseInt(this.$year.val(),10);isNaN(f)||isNaN(g)||(e=moment([g,f]).daysInMonth())}for(b=1;e>=b;b++)a=d?this.leadZero(b):b,c.push([b,a]);return c},"fillMonth":function(){var a,b,c=this.fillCommon("M"),d=-1!==this.options.template.indexOf("MMMM"),e=-1!==this.options.template.indexOf("MMM"),f=-1!==this.options.template.indexOf("MM");for(b=0;11>=b;b++)a=d?moment().date(1).month(b).format("MMMM"):e?moment().date(1).month(b).format("MMM"):f?this.leadZero(b+1):b+1,c.push([b,a]);return c},"fillYear":function(){var a,b,c=[],d=-1!==this.options.template.indexOf("YYYY");for(b=this.options.maxYear;b>=this.options.minYear;b--)a=d?b:(b+"").substring(2),c[this.options.yearDescending?"push":"unshift"]([b,a]);return c=this.fillCommon("y").concat(c)},"fillHour":function(){var a,b,c=this.fillCommon("h"),d=-1!==this.options.template.indexOf("h"),e=(-1!==this.options.template.indexOf("H"),-1!==this.options.template.toLowerCase().indexOf("hh")),f=d?1:0,g=d?12:23;for(b=f;g>=b;b++)a=e?this.leadZero(b):b,c.push([b,a]);return c},"fillMinute":function(){var a,b,c=this.fillCommon("m"),d=-1!==this.options.template.indexOf("mm");for(b=0;59>=b;b+=this.options.minuteStep)a=d?this.leadZero(b):b,c.push([b,a]);return c},"fillSecond":function(){var a,b,c=this.fillCommon("s"),d=-1!==this.options.template.indexOf("ss");for(b=0;59>=b;b+=this.options.secondStep)a=d?this.leadZero(b):b,c.push([b,a]);return c},"fillAmpm":function(){var a=-1!==this.options.template.indexOf("a"),b=(-1!==this.options.template.indexOf("A"),[["am",a?"am":"AM"],["pm",a?"pm":"PM"]]);return b},"getValue":function(b){var c,d={},e=this,f=!1;return a.each(this.map,function(a){if("ampm"!==a){var b="day"===a?1:0;return d[a]=e["$"+a]?parseInt(e["$"+a].val(),10):b,isNaN(d[a])?(f=!0,!1):void 0}}),f?"":(this.$ampm&&(d.hour=12===d.hour?"am"===this.$ampm.val()?0:12:"am"===this.$ampm.val()?d.hour:d.hour+12),c=moment([d.year,d.month,d.day,d.hour,d.minute,d.second]),this.highlight(c),b=void 0===b?this.options.format:b,null===b?c.isValid()?c:null:c.isValid()?c.format(b):"")},"setValue":function(b){function c(b,c){var d={};return b.children("option").each(function(b,e){var f,g=a(e).attr("value");""!==g&&(f=Math.abs(g-c),("undefined"==typeof d.distance||f<d.distance)&&(d={"value":g,"distance":f}))}),d.value}if(b){var d="string"==typeof b?moment(b,this.options.format):moment(b),e=this,f={};d.isValid()&&(a.each(this.map,function(a,b){"ampm"!==a&&(f[a]=d[b[1]]())}),this.$ampm&&(f.hour>=12?(f.ampm="pm",f.hour>12&&(f.hour-=12)):(f.ampm="am",0===f.hour&&(f.hour=12))),a.each(f,function(a,b){e["$"+a]&&("minute"===a&&e.options.minuteStep>1&&e.options.roundTime&&(b=c(e["$"+a],b)),"second"===a&&e.options.secondStep>1&&e.options.roundTime&&(b=c(e["$"+a],b)),e["$"+a].val(b))}),this.options.smartDays&&this.fillCombo("day"),this.$element.val(d.format(this.options.format)).change())}},"highlight":function(a){a.isValid()?this.options.errorClass?this.$widget.removeClass(this.options.errorClass):this.$widget.find("select").css("border-color",this.borderColor):this.options.errorClass?this.$widget.addClass(this.options.errorClass):(this.borderColor||(this.borderColor=this.$widget.find("select").css("border-color")),this.$widget.find("select").css("border-color","red"))},"leadZero":function(a){return 9>=a?"0"+a:a},"destroy":function(){this.$widget.remove(),this.$element.removeData("combodate").show()}},a.fn.combodate=function(c){var d,e=Array.apply(null,arguments);return e.shift(),"getValue"===c&&this.length&&(d=this.eq(0).data("combodate"))?d.getValue.apply(d,e):this.each(function(){var d=a(this),f=d.data("combodate"),g="object"==typeof c&&c;f||d.data("combodate",f=new b(this,g)),"string"==typeof c&&"function"==typeof f[c]&&f[c].apply(f,e)})},a.fn.combodate.defaults={"format":"DD-MM-YYYY HH:mm","template":"D / MMM / YYYY H : mm","value":null,"minYear":1970,"maxYear":2015,"yearDescending":!0,"minuteStep":5,"secondStep":1,"firstItem":"empty","errorClass":null,"roundTime":!0,"smartDays":!1}}(window.jQuery),function(a){"use strict";var b=function(c){this.init("combodate",c,b.defaults),this.options.viewformat||(this.options.viewformat=this.options.format),c.combodate=a.fn.editableutils.tryParseJson(c.combodate,!0),this.options.combodate=a.extend({},b.defaults.combodate,c.combodate,{"format":this.options.format,"template":this.options.template})};a.fn.editableutils.inherit(b,a.fn.editabletypes.abstractinput),a.extend(b.prototype,{"render":function(){this.$input.combodate(this.options.combodate),"bs3"===a.fn.editableform.engine&&this.$input.siblings().find("select").addClass("form-control"),this.options.inputclass&&this.$input.siblings().find("select").addClass(this.options.inputclass)},"value2html":function(a,c){var d=a?a.format(this.options.viewformat):"";b.superclass.value2html.call(this,d,c)},"html2value":function(a){return a?moment(a,this.options.viewformat):null},"value2str":function(a){return a?a.format(this.options.format):""},"str2value":function(a){return a?moment(a,this.options.format):null},"value2submit":function(a){return this.value2str(a)},"value2input":function(a){this.$input.combodate("setValue",a)},"input2value":function(){return this.$input.combodate("getValue",null)},"activate":function(){this.$input.siblings(".combodate").find("select").eq(0).focus()},"autosubmit":function(){}}),b.defaults=a.extend({},a.fn.editabletypes.abstractinput.defaults,{"tpl":'<input type="text">',"inputclass":null,"format":"YYYY-MM-DD","viewformat":null,"template":"D / MMM / YYYY","combodate":null}),a.fn.editabletypes.combodate=b}(window.jQuery),function(a){"use strict";var b=a.fn.editableform.Constructor.prototype.initInput;a.extend(a.fn.editableform.Constructor.prototype,{"initTemplate":function(){this.$form=a(a.fn.editableform.template),this.$form.find(".control-group").addClass("form-group"),this.$form.find(".editable-error-block").addClass("help-block")},"initInput":function(){b.apply(this);var c=null===this.input.options.inputclass||this.input.options.inputclass===!1,d="input-sm",e="text,select,textarea,password,email,url,tel,number,range,time,typeaheadjs".split(",");~a.inArray(this.input.type,e)&&(this.input.$input.addClass("form-control"),c&&(this.input.options.inputclass=d,this.input.$input.addClass(d)));for(var f=this.$form.find(".editable-buttons"),g=c?[d]:this.input.options.inputclass.split(" "),h=0;h<g.length;h++)"input-lg"===g[h].toLowerCase()&&f.find("button").removeClass("btn-sm").addClass("btn-lg")}}),a.fn.editableform.buttons='<button type="submit" class="btn btn-primary btn-sm editable-submit"><i class="glyphicon glyphicon-ok"></i></button><button type="button" class="btn btn-default btn-sm editable-cancel"><i class="glyphicon glyphicon-remove"></i></button>',a.fn.editableform.errorGroupClass="has-error",a.fn.editableform.errorBlockClass=null,a.fn.editableform.engine="bs3"}(window.jQuery),function(a){"use strict";a.extend(a.fn.editableContainer.Popup.prototype,{"containerName":"popover","containerDataName":"bs.popover","innerCss":".popover-content","defaults":a.fn.popover.Constructor.DEFAULTS,"initContainer":function(){a.extend(this.containerOptions,{"trigger":"manual","selector":!1,"content":" ","template":this.defaults.template});var b;this.$element.data("template")&&(b=this.$element.data("template"),this.$element.removeData("template")),this.call(this.containerOptions),b&&this.$element.data("template",b)},"innerShow":function(){this.call("show")},"innerHide":function(){this.call("hide")},"innerDestroy":function(){this.call("destroy")},"setContainerOption":function(a,b){this.container().options[a]=b},"setPosition":function(){(function(){var a=this.tip(),b="function"==typeof this.options.placement?this.options.placement.call(this,a[0],this.$element[0]):this.options.placement,c=/\s?auto?\s?/i,d=c.test(b);d&&(b=b.replace(c,"")||"top");var e=this.getPosition(),f=a[0].offsetWidth,g=a[0].offsetHeight;if(d){var h=this.$element.parent(),i=b,j=document.documentElement.scrollTop||document.body.scrollTop,k="body"==this.options.container?window.innerWidth:h.outerWidth(),l="body"==this.options.container?window.innerHeight:h.outerHeight(),m="body"==this.options.container?0:h.offset().left;b="bottom"==b&&e.top+e.height+g-j>l?"top":"top"==b&&e.top-j-g<0?"bottom":"right"==b&&e.right+f>k?"left":"left"==b&&e.left-f<m?"right":b,a.removeClass(i).addClass(b)}var n=this.getCalculatedOffset(b,e,f,g);this.applyPlacement(n,b)}).call(this.container())}})}(window.jQuery),function(a){function b(){return new Date(Date.UTC.apply(Date,arguments))}function c(b,c){var d,e=a(b).data(),f={},g=new RegExp("^"+c.toLowerCase()+"([A-Z])"),c=new RegExp("^"+c.toLowerCase());for(var h in e)c.test(h)&&(d=h.replace(g,function(a,b){return b.toLowerCase()}),f[d]=e[h]);return f}function d(b){var c={};if(k[b]||(b=b.split("-")[0],k[b])){var d=k[b];return a.each(j,function(a,b){b in d&&(c[b]=d[b])}),c}}var e=function(b,c){this._process_options(c),this.element=a(b),this.isInline=!1,this.isInput=this.element.is("input"),this.component=this.element.is(".date")?this.element.find(".add-on, .btn"):!1,this.hasInput=this.component&&this.element.find("input").length,this.component&&0===this.component.length&&(this.component=!1),this.picker=a(l.template),this._buildEvents(),this._attachEvents(),this.isInline?this.picker.addClass("datepicker-inline").appendTo(this.element):this.picker.addClass("datepicker-dropdown dropdown-menu"),this.o.rtl&&(this.picker.addClass("datepicker-rtl"),this.picker.find(".prev i, .next i").toggleClass("icon-arrow-left icon-arrow-right")),this.viewMode=this.o.startView,this.o.calendarWeeks&&this.picker.find("tfoot th.today").attr("colspan",function(a,b){return parseInt(b)+1}),this._allow_update=!1,this.setStartDate(this.o.startDate),this.setEndDate(this.o.endDate),this.setDaysOfWeekDisabled(this.o.daysOfWeekDisabled),this.fillDow(),this.fillMonths(),this._allow_update=!0,this.update(),this.showMode(),this.isInline&&this.show()};e.prototype={"constructor":e,"_process_options":function(b){this._o=a.extend({},this._o,b);var c=this.o=a.extend({},this._o),d=c.language;switch(k[d]||(d=d.split("-")[0],k[d]||(d=i.language)),c.language=d,c.startView){case 2:case"decade":c.startView=2;break;case 1:case"year":c.startView=1;break;default:c.startView=0}switch(c.minViewMode){case 1:case"months":c.minViewMode=1;break;case 2:case"years":c.minViewMode=2;break;default:c.minViewMode=0}c.startView=Math.max(c.startView,c.minViewMode),c.weekStart%=7,c.weekEnd=(c.weekStart+6)%7;var e=l.parseFormat(c.format);c.startDate!==-1/0&&(c.startDate=l.parseDate(c.startDate,e,c.language)),1/0!==c.endDate&&(c.endDate=l.parseDate(c.endDate,e,c.language)),c.daysOfWeekDisabled=c.daysOfWeekDisabled||[],a.isArray(c.daysOfWeekDisabled)||(c.daysOfWeekDisabled=c.daysOfWeekDisabled.split(/[,\s]*/)),c.daysOfWeekDisabled=a.map(c.daysOfWeekDisabled,function(a){return parseInt(a,10)})},"_events":[],"_secondaryEvents":[],"_applyEvents":function(a){for(var b,c,d=0;d<a.length;d++)b=a[d][0],c=a[d][1],b.on(c)},"_unapplyEvents":function(a){for(var b,c,d=0;d<a.length;d++)b=a[d][0],c=a[d][1],b.off(c)},"_buildEvents":function(){this.isInput?this._events=[[this.element,{"focus":a.proxy(this.show,this),"keyup":a.proxy(this.update,this),"keydown":a.proxy(this.keydown,this)}]]:this.component&&this.hasInput?this._events=[[this.element.find("input"),{"focus":a.proxy(this.show,this),"keyup":a.proxy(this.update,this),"keydown":a.proxy(this.keydown,this)}],[this.component,{"click":a.proxy(this.show,this)}]]:this.element.is("div")?this.isInline=!0:this._events=[[this.element,{"click":a.proxy(this.show,this)}]],this._secondaryEvents=[[this.picker,{"click":a.proxy(this.click,this)}],[a(window),{"resize":a.proxy(this.place,this)}],[a(document),{"mousedown":a.proxy(function(a){this.element.is(a.target)||this.element.find(a.target).size()||this.picker.is(a.target)||this.picker.find(a.target).size()||this.hide()},this)}]]},"_attachEvents":function(){this._detachEvents(),this._applyEvents(this._events)},"_detachEvents":function(){this._unapplyEvents(this._events)},"_attachSecondaryEvents":function(){this._detachSecondaryEvents(),this._applyEvents(this._secondaryEvents)},"_detachSecondaryEvents":function(){this._unapplyEvents(this._secondaryEvents)},"_trigger":function(b,c){var d=c||this.date,e=new Date(d.getTime()+6e4*d.getTimezoneOffset());this.element.trigger({"type":b,"date":e,"format":a.proxy(function(a){var b=a||this.o.format;return l.formatDate(d,b,this.o.language)},this)})},"show":function(a){this.isInline||this.picker.appendTo("body"),this.picker.show(),this.height=this.component?this.component.outerHeight():this.element.outerHeight(),this.place(),this._attachSecondaryEvents(),a&&a.preventDefault(),this._trigger("show")},"hide":function(){this.isInline||this.picker.is(":visible")&&(this.picker.hide().detach(),this._detachSecondaryEvents(),this.viewMode=this.o.startView,this.showMode(),this.o.forceParse&&(this.isInput&&this.element.val()||this.hasInput&&this.element.find("input").val())&&this.setValue(),this._trigger("hide"))},"remove":function(){this.hide(),this._detachEvents(),this._detachSecondaryEvents(),this.picker.remove(),delete this.element.data().datepicker,this.isInput||delete this.element.data().date},"getDate":function(){var a=this.getUTCDate();return new Date(a.getTime()+6e4*a.getTimezoneOffset())},"getUTCDate":function(){return this.date},"setDate":function(a){this.setUTCDate(new Date(a.getTime()-6e4*a.getTimezoneOffset()))},"setUTCDate":function(a){this.date=a,this.setValue()},"setValue":function(){var a=this.getFormattedDate();this.isInput?this.element.val(a):this.component&&this.element.find("input").val(a)},"getFormattedDate":function(a){return void 0===a&&(a=this.o.format),l.formatDate(this.date,a,this.o.language)},"setStartDate":function(a){this._process_options({"startDate":a}),this.update(),this.updateNavArrows()},"setEndDate":function(a){this._process_options({"endDate":a}),this.update(),this.updateNavArrows()},"setDaysOfWeekDisabled":function(a){this._process_options({"daysOfWeekDisabled":a}),this.update(),this.updateNavArrows()},"place":function(){if(!this.isInline){var b=parseInt(this.element.parents().filter(function(){return"auto"!=a(this).css("z-index")}).first().css("z-index"))+10,c=this.component?this.component.parent().offset():this.element.offset(),d=this.component?this.component.outerHeight(!0):this.element.outerHeight(!0);this.picker.css({"top":c.top+d,"left":c.left,"zIndex":b})}},"_allow_update":!0,"update":function(){if(this._allow_update){var a,b=!1;arguments&&arguments.length&&("string"==typeof arguments[0]||arguments[0]instanceof Date)?(a=arguments[0],b=!0):(a=this.isInput?this.element.val():this.element.data("date")||this.element.find("input").val(),delete this.element.data().date),this.date=l.parseDate(a,this.o.format,this.o.language),b&&this.setValue(),this.viewDate=new Date(this.date<this.o.startDate?this.o.startDate:this.date>this.o.endDate?this.o.endDate:this.date),this.fill()}},"fillDow":function(){var a=this.o.weekStart,b="<tr>";if(this.o.calendarWeeks){var c='<th class="cw"> </th>';b+=c,this.picker.find(".datepicker-days thead tr:first-child").prepend(c)}for(;a<this.o.weekStart+7;)b+='<th class="dow">'+k[this.o.language].daysMin[a++%7]+"</th>";b+="</tr>",this.picker.find(".datepicker-days thead").append(b)},"fillMonths":function(){for(var a="",b=0;12>b;)a+='<span class="month">'+k[this.o.language].monthsShort[b++]+"</span>";this.picker.find(".datepicker-months td").html(a)},"setRange":function(b){b&&b.length?this.range=a.map(b,function(a){return a.valueOf()}):delete this.range,this.fill()},"getClassNames":function(b){var c=[],d=this.viewDate.getUTCFullYear(),e=this.viewDate.getUTCMonth(),f=this.date.valueOf(),g=new Date;return b.getUTCFullYear()<d||b.getUTCFullYear()==d&&b.getUTCMonth()<e?c.push("old"):(b.getUTCFullYear()>d||b.getUTCFullYear()==d&&b.getUTCMonth()>e)&&c.push("new"),this.o.todayHighlight&&b.getUTCFullYear()==g.getFullYear()&&b.getUTCMonth()==g.getMonth()&&b.getUTCDate()==g.getDate()&&c.push("today"),f&&b.valueOf()==f&&c.push("active"),(b.valueOf()<this.o.startDate||b.valueOf()>this.o.endDate||-1!==a.inArray(b.getUTCDay(),this.o.daysOfWeekDisabled))&&c.push("disabled"),this.range&&(b>this.range[0]&&b<this.range[this.range.length-1]&&c.push("range"),-1!=a.inArray(b.valueOf(),this.range)&&c.push("selected")),c},"fill":function(){{var c,d=new Date(this.viewDate),e=d.getUTCFullYear(),f=d.getUTCMonth(),g=this.o.startDate!==-1/0?this.o.startDate.getUTCFullYear():-1/0,h=this.o.startDate!==-1/0?this.o.startDate.getUTCMonth():-1/0,i=1/0!==this.o.endDate?this.o.endDate.getUTCFullYear():1/0,j=1/0!==this.o.endDate?this.o.endDate.getUTCMonth():1/0;this.date&&this.date.valueOf()}this.picker.find(".datepicker-days thead th.datepicker-switch").text(k[this.o.language].months[f]+" "+e),this.picker.find("tfoot th.today").text(k[this.o.language].today).toggle(this.o.todayBtn!==!1),this.picker.find("tfoot th.clear").text(k[this.o.language].clear).toggle(this.o.clearBtn!==!1),this.updateNavArrows(),this.fillMonths();var m=b(e,f-1,28,0,0,0,0),n=l.getDaysInMonth(m.getUTCFullYear(),m.getUTCMonth());m.setUTCDate(n),m.setUTCDate(n-(m.getUTCDay()-this.o.weekStart+7)%7);var o=new Date(m);o.setUTCDate(o.getUTCDate()+42),o=o.valueOf();for(var p,q=[];m.valueOf()<o;){if(m.getUTCDay()==this.o.weekStart&&(q.push("<tr>"),this.o.calendarWeeks)){var r=new Date(+m+(this.o.weekStart-m.getUTCDay()-7)%7*864e5),s=new Date(+r+(11-r.getUTCDay())%7*864e5),t=new Date(+(t=b(s.getUTCFullYear(),0,1))+(11-t.getUTCDay())%7*864e5),u=(s-t)/864e5/7+1;q.push('<td class="cw">'+u+"</td>")}p=this.getClassNames(m),p.push("day");var v=this.o.beforeShowDay(m);void 0===v?v={}:"boolean"==typeof v?v={"enabled":v}:"string"==typeof v&&(v={"classes":v}),v.enabled===!1&&p.push("disabled"),v.classes&&(p=p.concat(v.classes.split(/\s+/))),v.tooltip&&(c=v.tooltip),p=a.unique(p),q.push('<td class="'+p.join(" ")+'"'+(c?' title="'+c+'"':"")+">"+m.getUTCDate()+"</td>"),m.getUTCDay()==this.o.weekEnd&&q.push("</tr>"),m.setUTCDate(m.getUTCDate()+1)}this.picker.find(".datepicker-days tbody").empty().append(q.join(""));var w=this.date&&this.date.getUTCFullYear(),x=this.picker.find(".datepicker-months").find("th:eq(1)").text(e).end().find("span").removeClass("active");w&&w==e&&x.eq(this.date.getUTCMonth()).addClass("active"),(g>e||e>i)&&x.addClass("disabled"),e==g&&x.slice(0,h).addClass("disabled"),e==i&&x.slice(j+1).addClass("disabled"),q="",e=10*parseInt(e/10,10);var y=this.picker.find(".datepicker-years").find("th:eq(1)").text(e+"-"+(e+9)).end().find("td");e-=1;for(var z=-1;11>z;z++)q+='<span class="year'+(-1==z?" old":10==z?" new":"")+(w==e?" active":"")+(g>e||e>i?" disabled":"")+'">'+e+"</span>",e+=1;y.html(q)},"updateNavArrows":function(){if(this._allow_update){var a=new Date(this.viewDate),b=a.getUTCFullYear(),c=a.getUTCMonth();switch(this.viewMode){case 0:this.picker.find(".prev").css(this.o.startDate!==-1/0&&b<=this.o.startDate.getUTCFullYear()&&c<=this.o.startDate.getUTCMonth()?{"visibility":"hidden"}:{"visibility":"visible"}),this.picker.find(".next").css(1/0!==this.o.endDate&&b>=this.o.endDate.getUTCFullYear()&&c>=this.o.endDate.getUTCMonth()?{"visibility":"hidden"}:{"visibility":"visible"});break;case 1:case 2:this.picker.find(".prev").css(this.o.startDate!==-1/0&&b<=this.o.startDate.getUTCFullYear()?{"visibility":"hidden"}:{"visibility":"visible"}),this.picker.find(".next").css(1/0!==this.o.endDate&&b>=this.o.endDate.getUTCFullYear()?{"visibility":"hidden"}:{"visibility":"visible"})}}},"click":function(c){c.preventDefault();var d=a(c.target).closest("span, td, th");if(1==d.length)switch(d[0].nodeName.toLowerCase()){case"th":switch(d[0].className){case"datepicker-switch":this.showMode(1);break;case"prev":case"next":var e=l.modes[this.viewMode].navStep*("prev"==d[0].className?-1:1);switch(this.viewMode){case 0:this.viewDate=this.moveMonth(this.viewDate,e);break;case 1:case 2:this.viewDate=this.moveYear(this.viewDate,e)}this.fill();break;case"today":var f=new Date;f=b(f.getFullYear(),f.getMonth(),f.getDate(),0,0,0),this.showMode(-2);var g="linked"==this.o.todayBtn?null:"view";this._setDate(f,g);break;case"clear":var h;this.isInput?h=this.element:this.component&&(h=this.element.find("input")),h&&h.val("").change(),this._trigger("changeDate"),this.update(),this.o.autoclose&&this.hide()}break;case"span":if(!d.is(".disabled")){if(this.viewDate.setUTCDate(1),d.is(".month")){var i=1,j=d.parent().find("span").index(d),k=this.viewDate.getUTCFullYear();this.viewDate.setUTCMonth(j),this._trigger("changeMonth",this.viewDate),1===this.o.minViewMode&&this._setDate(b(k,j,i,0,0,0,0))}else{var k=parseInt(d.text(),10)||0,i=1,j=0;this.viewDate.setUTCFullYear(k),this._trigger("changeYear",this.viewDate),2===this.o.minViewMode&&this._setDate(b(k,j,i,0,0,0,0))}this.showMode(-1),this.fill()}break;case"td":if(d.is(".day")&&!d.is(".disabled")){var i=parseInt(d.text(),10)||1,k=this.viewDate.getUTCFullYear(),j=this.viewDate.getUTCMonth();d.is(".old")?0===j?(j=11,k-=1):j-=1:d.is(".new")&&(11==j?(j=0,k+=1):j+=1),this._setDate(b(k,j,i,0,0,0,0))}}},"_setDate":function(a,b){b&&"date"!=b||(this.date=new Date(a)),b&&"view"!=b||(this.viewDate=new Date(a)),this.fill(),this.setValue(),this._trigger("changeDate");var c;this.isInput?c=this.element:this.component&&(c=this.element.find("input")),c&&(c.change(),!this.o.autoclose||b&&"date"!=b||this.hide())},"moveMonth":function(a,b){if(!b)return a;var c,d,e=new Date(a.valueOf()),f=e.getUTCDate(),g=e.getUTCMonth(),h=Math.abs(b);if(b=b>0?1:-1,1==h)d=-1==b?function(){return e.getUTCMonth()==g}:function(){return e.getUTCMonth()!=c},c=g+b,e.setUTCMonth(c),(0>c||c>11)&&(c=(c+12)%12);else{for(var i=0;h>i;i++)e=this.moveMonth(e,b);c=e.getUTCMonth(),e.setUTCDate(f),d=function(){return c!=e.getUTCMonth()}}for(;d();)e.setUTCDate(--f),e.setUTCMonth(c);return e},"moveYear":function(a,b){return this.moveMonth(a,12*b)},"dateWithinRange":function(a){return a>=this.o.startDate&&a<=this.o.endDate},"keydown":function(a){if(this.picker.is(":not(:visible)"))return void(27==a.keyCode&&this.show());var b,c,d,e=!1;switch(a.keyCode){case 27:this.hide(),a.preventDefault();break;case 37:case 39:if(!this.o.keyboardNavigation)break;b=37==a.keyCode?-1:1,a.ctrlKey?(c=this.moveYear(this.date,b),d=this.moveYear(this.viewDate,b)):a.shiftKey?(c=this.moveMonth(this.date,b),d=this.moveMonth(this.viewDate,b)):(c=new Date(this.date),c.setUTCDate(this.date.getUTCDate()+b),d=new Date(this.viewDate),d.setUTCDate(this.viewDate.getUTCDate()+b)),this.dateWithinRange(c)&&(this.date=c,this.viewDate=d,this.setValue(),this.update(),a.preventDefault(),e=!0);break;case 38:case 40:if(!this.o.keyboardNavigation)break;b=38==a.keyCode?-1:1,a.ctrlKey?(c=this.moveYear(this.date,b),d=this.moveYear(this.viewDate,b)):a.shiftKey?(c=this.moveMonth(this.date,b),d=this.moveMonth(this.viewDate,b)):(c=new Date(this.date),c.setUTCDate(this.date.getUTCDate()+7*b),d=new Date(this.viewDate),d.setUTCDate(this.viewDate.getUTCDate()+7*b)),this.dateWithinRange(c)&&(this.date=c,this.viewDate=d,this.setValue(),this.update(),a.preventDefault(),e=!0);break;case 13:this.hide(),a.preventDefault();break;case 9:this.hide()}if(e){this._trigger("changeDate");var f;this.isInput?f=this.element:this.component&&(f=this.element.find("input")),f&&f.change()}},"showMode":function(a){a&&(this.viewMode=Math.max(this.o.minViewMode,Math.min(2,this.viewMode+a))),this.picker.find(">div").hide().filter(".datepicker-"+l.modes[this.viewMode].clsName).css("display","block"),this.updateNavArrows()}};var f=function(b,c){this.element=a(b),this.inputs=a.map(c.inputs,function(a){return a.jquery?a[0]:a}),delete c.inputs,a(this.inputs).datepicker(c).bind("changeDate",a.proxy(this.dateUpdated,this)),this.pickers=a.map(this.inputs,function(b){return a(b).data("datepicker")}),this.updateDates()};f.prototype={"updateDates":function(){this.dates=a.map(this.pickers,function(a){return a.date}),this.updateRanges()},"updateRanges":function(){var b=a.map(this.dates,function(a){return a.valueOf()});a.each(this.pickers,function(a,c){c.setRange(b)})},"dateUpdated":function(b){var c=a(b.target).data("datepicker"),d=c.getUTCDate(),e=a.inArray(b.target,this.inputs),f=this.inputs.length;if(-1!=e){if(d<this.dates[e])for(;e>=0&&d<this.dates[e];)this.pickers[e--].setUTCDate(d);else if(d>this.dates[e])for(;f>e&&d>this.dates[e];)this.pickers[e++].setUTCDate(d);this.updateDates()}},"remove":function(){a.map(this.pickers,function(a){a.remove()}),delete this.element.data().datepicker}};var g=a.fn.datepicker,h=a.fn.datepicker=function(b){var g=Array.apply(null,arguments);g.shift();var h;return this.each(function(){var j=a(this),k=j.data("datepicker"),l="object"==typeof b&&b;if(!k){var m=c(this,"date"),n=a.extend({},i,m,l),o=d(n.language),p=a.extend({},i,o,m,l);if(j.is(".input-daterange")||p.inputs){var q={"inputs":p.inputs||j.find("input").toArray()};j.data("datepicker",k=new f(this,a.extend(p,q)))}else j.data("datepicker",k=new e(this,p))}return"string"==typeof b&&"function"==typeof k[b]&&(h=k[b].apply(k,g),void 0!==h)?!1:void 0}),void 0!==h?h:this},i=a.fn.datepicker.defaults={"autoclose":!1,"beforeShowDay":a.noop,"calendarWeeks":!1,"clearBtn":!1,"daysOfWeekDisabled":[],"endDate":1/0,"forceParse":!0,"format":"mm/dd/yyyy","keyboardNavigation":!0,"language":"en","minViewMode":0,"rtl":!1,"startDate":-1/0,"startView":0,"todayBtn":!1,"todayHighlight":!1,"weekStart":0},j=a.fn.datepicker.locale_opts=["format","rtl","weekStart"];a.fn.datepicker.Constructor=e;var k=a.fn.datepicker.dates={"en":{"days":["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],"daysShort":["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sun"],"daysMin":["Su","Mo","Tu","We","Th","Fr","Sa","Su"],"months":["January","February","March","April","May","June","July","August","September","October","November","December"],"monthsShort":["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],"today":"Today","clear":"Clear"}},l={"modes":[{"clsName":"days","navFnc":"Month","navStep":1},{"clsName":"months","navFnc":"FullYear","navStep":1},{"clsName":"years","navFnc":"FullYear","navStep":10}],"isLeapYear":function(a){return a%4===0&&a%100!==0||a%400===0},"getDaysInMonth":function(a,b){return[31,l.isLeapYear(a)?29:28,31,30,31,30,31,31,30,31,30,31][b]},"validParts":/dd?|DD?|mm?|MM?|yy(?:yy)?/g,"nonpunctuation":/[^ -\/:-@\[\u3400-\u9fff-`{-~\t\n\r]+/g,"parseFormat":function(a){var b=a.replace(this.validParts,"\x00").split("\x00"),c=a.match(this.validParts);if(!b||!b.length||!c||0===c.length)throw new Error("Invalid date format.");return{"separators":b,"parts":c}},"parseDate":function(c,d,f){if(c instanceof Date)return c;if("string"==typeof d&&(d=l.parseFormat(d)),/^[\-+]\d+[dmwy]([\s,]+[\-+]\d+[dmwy])*$/.test(c)){var g,h,i=/([\-+]\d+)([dmwy])/,j=c.match(/([\-+]\d+)([dmwy])/g);c=new Date;for(var m=0;m<j.length;m++)switch(g=i.exec(j[m]),h=parseInt(g[1]),g[2]){case"d":c.setUTCDate(c.getUTCDate()+h);break;case"m":c=e.prototype.moveMonth.call(e.prototype,c,h);break;case"w":c.setUTCDate(c.getUTCDate()+7*h);break;case"y":c=e.prototype.moveYear.call(e.prototype,c,h)}return b(c.getUTCFullYear(),c.getUTCMonth(),c.getUTCDate(),0,0,0)}var n,o,g,j=c&&c.match(this.nonpunctuation)||[],c=new Date,p={},q=["yyyy","yy","M","MM","m","mm","d","dd"],r={"yyyy":function(a,b){return a.setUTCFullYear(b)},"yy":function(a,b){return a.setUTCFullYear(2e3+b)},"m":function(a,b){for(b-=1;0>b;)b+=12;for(b%=12,a.setUTCMonth(b);a.getUTCMonth()!=b;)a.setUTCDate(a.getUTCDate()-1);return a},"d":function(a,b){return a.setUTCDate(b)}};r.M=r.MM=r.mm=r.m,r.dd=r.d,c=b(c.getFullYear(),c.getMonth(),c.getDate(),0,0,0);var s=d.parts.slice();if(j.length!=s.length&&(s=a(s).filter(function(b,c){return-1!==a.inArray(c,q)}).toArray()),j.length==s.length){for(var m=0,t=s.length;t>m;m++){if(n=parseInt(j[m],10),g=s[m],isNaN(n))switch(g){case"MM":o=a(k[f].months).filter(function(){var a=this.slice(0,j[m].length),b=j[m].slice(0,a.length);return a==b}),n=a.inArray(o[0],k[f].months)+1;break;case"M":o=a(k[f].monthsShort).filter(function(){var a=this.slice(0,j[m].length),b=j[m].slice(0,a.length);return a==b}),n=a.inArray(o[0],k[f].monthsShort)+1}p[g]=n}for(var u,m=0;m<q.length;m++)u=q[m],u in p&&!isNaN(p[u])&&r[u](c,p[u])}return c},"formatDate":function(b,c,d){"string"==typeof c&&(c=l.parseFormat(c));var e={"d":b.getUTCDate(),"D":k[d].daysShort[b.getUTCDay()],"DD":k[d].days[b.getUTCDay()],"m":b.getUTCMonth()+1,"M":k[d].monthsShort[b.getUTCMonth()],"MM":k[d].months[b.getUTCMonth()],"yy":b.getUTCFullYear().toString().substring(2),"yyyy":b.getUTCFullYear()};e.dd=(e.d<10?"0":"")+e.d,e.mm=(e.m<10?"0":"")+e.m;for(var b=[],f=a.extend([],c.separators),g=0,h=c.parts.length;h>=g;g++)f.length&&b.push(f.shift()),b.push(e[c.parts[g]]);return b.join("")},"headTemplate":'<thead><tr><th class="prev"><i class="icon-arrow-left"/></th><th colspan="5" class="datepicker-switch"></th><th class="next"><i class="icon-arrow-right"/></th></tr></thead>',"contTemplate":'<tbody><tr><td colspan="7"></td></tr></tbody>',"footTemplate":'<tfoot><tr><th colspan="7" class="today"></th></tr><tr><th colspan="7" class="clear"></th></tr></tfoot>'};l.template='<div class="datepicker"><div class="datepicker-days"><table class=" table-condensed">'+l.headTemplate+"<tbody></tbody>"+l.footTemplate+'</table></div><div class="datepicker-months"><table class="table-condensed">'+l.headTemplate+l.contTemplate+l.footTemplate+'</table></div><div class="datepicker-years"><table class="table-condensed">'+l.headTemplate+l.contTemplate+l.footTemplate+"</table></div></div>",a.fn.datepicker.DPGlobal=l,a.fn.datepicker.noConflict=function(){return a.fn.datepicker=g,this
|
|
},a(document).on("focus.datepicker.data-api click.datepicker.data-api",'[data-provide="datepicker"]',function(b){var c=a(this);c.data("datepicker")||(b.preventDefault(),h.call(c,"show"))}),a(function(){h.call(a('[data-provide="datepicker-inline"]'))})}(window.jQuery),function(a){"use strict";a.fn.bdatepicker=a.fn.datepicker.noConflict(),a.fn.datepicker||(a.fn.datepicker=a.fn.bdatepicker);var b=function(a){this.init("date",a,b.defaults),this.initPicker(a,b.defaults)};a.fn.editableutils.inherit(b,a.fn.editabletypes.abstractinput),a.extend(b.prototype,{"initPicker":function(b,c){this.options.viewformat||(this.options.viewformat=this.options.format),b.datepicker=a.fn.editableutils.tryParseJson(b.datepicker,!0),this.options.datepicker=a.extend({},c.datepicker,b.datepicker,{"format":this.options.viewformat}),this.options.datepicker.language=this.options.datepicker.language||"en",this.dpg=a.fn.bdatepicker.DPGlobal,this.parsedFormat=this.dpg.parseFormat(this.options.format),this.parsedViewFormat=this.dpg.parseFormat(this.options.viewformat)},"render":function(){this.$input.bdatepicker(this.options.datepicker),this.options.clear&&(this.$clear=a('<a href="#"></a>').html(this.options.clear).click(a.proxy(function(a){a.preventDefault(),a.stopPropagation(),this.clear()},this)),this.$tpl.parent().append(a('<div class="editable-clear">').append(this.$clear)))},"value2html":function(a,c){var d=a?this.dpg.formatDate(a,this.parsedViewFormat,this.options.datepicker.language):"";b.superclass.value2html.call(this,d,c)},"html2value":function(a){return this.parseDate(a,this.parsedViewFormat)},"value2str":function(a){return a?this.dpg.formatDate(a,this.parsedFormat,this.options.datepicker.language):""},"str2value":function(a){return this.parseDate(a,this.parsedFormat)},"value2submit":function(a){return this.value2str(a)},"value2input":function(a){this.$input.bdatepicker("update",a)},"input2value":function(){return this.$input.data("datepicker").date},"activate":function(){},"clear":function(){this.$input.data("datepicker").date=null,this.$input.find(".active").removeClass("active"),this.options.showbuttons||this.$input.closest("form").submit()},"autosubmit":function(){this.$input.on("mouseup",".day",function(b){if(!a(b.currentTarget).is(".old")&&!a(b.currentTarget).is(".new")){var c=a(this).closest("form");setTimeout(function(){c.submit()},200)}})},"parseDate":function(a,b){var c,d=null;return a&&(d=this.dpg.parseDate(a,b,this.options.datepicker.language),"string"==typeof a&&(c=this.dpg.formatDate(d,b,this.options.datepicker.language),a!==c&&(d=null))),d}}),b.defaults=a.extend({},a.fn.editabletypes.abstractinput.defaults,{"tpl":'<div class="editable-date well"></div>',"inputclass":null,"format":"yyyy-mm-dd","viewformat":null,"datepicker":{"weekStart":0,"startView":0,"minViewMode":0,"autoclose":!1},"clear":"× clear"}),a.fn.editabletypes.date=b}(window.jQuery),function(a){"use strict";var b=function(a){this.init("datefield",a,b.defaults),this.initPicker(a,b.defaults)};a.fn.editableutils.inherit(b,a.fn.editabletypes.date),a.extend(b.prototype,{"render":function(){this.$input=this.$tpl.find("input"),this.setClass(),this.setAttr("placeholder"),this.$tpl.bdatepicker(this.options.datepicker),this.$input.off("focus keydown"),this.$input.keyup(a.proxy(function(){this.$tpl.removeData("date"),this.$tpl.bdatepicker("update")},this))},"value2input":function(a){this.$input.val(a?this.dpg.formatDate(a,this.parsedViewFormat,this.options.datepicker.language):""),this.$tpl.bdatepicker("update")},"input2value":function(){return this.html2value(this.$input.val())},"activate":function(){a.fn.editabletypes.text.prototype.activate.call(this)},"autosubmit":function(){}}),b.defaults=a.extend({},a.fn.editabletypes.date.defaults,{"tpl":'<div class="input-append date"><input type="text"/><span class="add-on"><i class="icon-th"></i></span></div>',"inputclass":"input-small","datepicker":{"weekStart":0,"startView":0,"minViewMode":0,"autoclose":!0}}),a.fn.editabletypes.datefield=b}(window.jQuery),function(a){"use strict";var b=function(a){this.init("datetime",a,b.defaults),this.initPicker(a,b.defaults)};a.fn.editableutils.inherit(b,a.fn.editabletypes.abstractinput),a.extend(b.prototype,{"initPicker":function(b,c){this.options.viewformat||(this.options.viewformat=this.options.format),b.datetimepicker=a.fn.editableutils.tryParseJson(b.datetimepicker,!0),this.options.datetimepicker=a.extend({},c.datetimepicker,b.datetimepicker,{"format":this.options.viewformat}),this.options.datetimepicker.language=this.options.datetimepicker.language||"en",this.dpg=a.fn.datetimepicker.DPGlobal,this.parsedFormat=this.dpg.parseFormat(this.options.format,this.options.formatType),this.parsedViewFormat=this.dpg.parseFormat(this.options.viewformat,this.options.formatType)},"render":function(){this.$input.datetimepicker(this.options.datetimepicker),this.$input.on("changeMode",function(){var b=a(this).closest("form").parent();setTimeout(function(){b.triggerHandler("resize")},0)}),this.options.clear&&(this.$clear=a('<a href="#"></a>').html(this.options.clear).click(a.proxy(function(a){a.preventDefault(),a.stopPropagation(),this.clear()},this)),this.$tpl.parent().append(a('<div class="editable-clear">').append(this.$clear)))},"value2html":function(a,c){var d=a?this.dpg.formatDate(this.toUTC(a),this.parsedViewFormat,this.options.datetimepicker.language,this.options.formatType):"";return c?void b.superclass.value2html.call(this,d,c):d},"html2value":function(a){var b=this.parseDate(a,this.parsedViewFormat);return b?this.fromUTC(b):null},"value2str":function(a){return a?this.dpg.formatDate(this.toUTC(a),this.parsedFormat,this.options.datetimepicker.language,this.options.formatType):""},"str2value":function(a){var b=this.parseDate(a,this.parsedFormat);return b?this.fromUTC(b):null},"value2submit":function(a){return this.value2str(a)},"value2input":function(a){a&&this.$input.data("datetimepicker").setDate(a)},"input2value":function(){var a=this.$input.data("datetimepicker");return a.date?a.getDate():null},"activate":function(){},"clear":function(){this.$input.data("datetimepicker").date=null,this.$input.find(".active").removeClass("active"),this.options.showbuttons||this.$input.closest("form").submit()},"autosubmit":function(){this.$input.on("mouseup",".minute",function(){var b=a(this).closest("form");setTimeout(function(){b.submit()},200)})},"toUTC":function(a){return a?new Date(a.valueOf()-6e4*a.getTimezoneOffset()):a},"fromUTC":function(a){return a?new Date(a.valueOf()+6e4*a.getTimezoneOffset()):a},"parseDate":function(a,b){var c,d=null;return a&&(d=this.dpg.parseDate(a,b,this.options.datetimepicker.language,this.options.formatType),"string"==typeof a&&(c=this.dpg.formatDate(d,b,this.options.datetimepicker.language,this.options.formatType),a!==c&&(d=null))),d}}),b.defaults=a.extend({},a.fn.editabletypes.abstractinput.defaults,{"tpl":'<div class="editable-date well"></div>',"inputclass":null,"format":"yyyy-mm-dd hh:ii","formatType":"standard","viewformat":null,"datetimepicker":{"todayHighlight":!1,"autoclose":!1},"clear":"× clear"}),a.fn.editabletypes.datetime=b}(window.jQuery),function(a){"use strict";var b=function(a){this.init("datetimefield",a,b.defaults),this.initPicker(a,b.defaults)};a.fn.editableutils.inherit(b,a.fn.editabletypes.datetime),a.extend(b.prototype,{"render":function(){this.$input=this.$tpl.find("input"),this.setClass(),this.setAttr("placeholder"),this.$tpl.datetimepicker(this.options.datetimepicker),this.$input.off("focus keydown"),this.$input.keyup(a.proxy(function(){this.$tpl.removeData("date"),this.$tpl.datetimepicker("update")},this))},"value2input":function(a){this.$input.val(this.value2html(a)),this.$tpl.datetimepicker("update")},"input2value":function(){return this.html2value(this.$input.val())},"activate":function(){a.fn.editabletypes.text.prototype.activate.call(this)},"autosubmit":function(){}}),b.defaults=a.extend({},a.fn.editabletypes.datetime.defaults,{"tpl":'<div class="input-append date"><input type="text"/><span class="add-on"><i class="icon-th"></i></span></div>',"inputclass":"input-medium","datetimepicker":{"todayHighlight":!1,"autoclose":!0}}),a.fn.editabletypes.datetimefield=b}(window.jQuery),function(a){"use strict";var b=function(a){this.init("address",a,b.defaults)};a.fn.editableutils.inherit(b,a.fn.editabletypes.abstractinput),a.extend(b.prototype,{"render":function(){this.$input=this.$tpl.find("input")},"value2html":function(b,c){if(!b)return void a(c).empty();var d=a("<div>").text(b.city).html()+", "+a("<div>").text(b.street).html()+" st., bld. "+a("<div>").text(b.building).html();a(c).html(d)},"html2value":function(){return null},"value2str":function(a){var b="";if(a)for(var c in a)b=b+c+":"+a[c]+";";return b},"str2value":function(a){return a},"value2input":function(a){a&&(this.$input.filter('[name="city"]').val(a.city),this.$input.filter('[name="street"]').val(a.street),this.$input.filter('[name="building"]').val(a.building))},"input2value":function(){return{"city":this.$input.filter('[name="city"]').val(),"street":this.$input.filter('[name="street"]').val(),"building":this.$input.filter('[name="building"]').val()}},"activate":function(){this.$input.filter('[name="city"]').focus()},"autosubmit":function(){this.$input.keydown(function(b){13===b.which&&a(this).closest("form").submit()})}}),b.defaults=a.extend({},a.fn.editabletypes.abstractinput.defaults,{"tpl":'<div class="editable-address"><label><span>City: </span><input type="text" name="city" class="input-small form-control"></label></div><div class="editable-address"><label><span>Street: </span><input type="text" name="street" class="input-small form-control"></label></div><div class="editable-address"><label><span>Building: </span><input type="text" name="building" class="input-mini form-control"></label></div>',"inputclass":""}),a.fn.editabletypes.address=b}(window.jQuery),function(a){var b="0.9.3",c={"isMsie":function(){var a=/(msie) ([\w.]+)/i.exec(navigator.userAgent);return a?parseInt(a[2],10):!1},"isBlankString":function(a){return!a||/^\s*$/.test(a)},"escapeRegExChars":function(a){return a.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},"isString":function(a){return"string"==typeof a},"isNumber":function(a){return"number"==typeof a},"isArray":a.isArray,"isFunction":a.isFunction,"isObject":a.isPlainObject,"isUndefined":function(a){return"undefined"==typeof a},"bind":a.proxy,"bindAll":function(b){var c;for(var d in b)a.isFunction(c=b[d])&&(b[d]=a.proxy(c,b))},"indexOf":function(a,b){for(var c=0;c<a.length;c++)if(a[c]===b)return c;return-1},"each":a.each,"map":a.map,"filter":a.grep,"every":function(b,c){var d=!0;return b?(a.each(b,function(a,e){return(d=c.call(null,e,a,b))?void 0:!1}),!!d):d},"some":function(b,c){var d=!1;return b?(a.each(b,function(a,e){return(d=c.call(null,e,a,b))?!1:void 0}),!!d):d},"mixin":a.extend,"getUniqueId":function(){var a=0;return function(){return a++}}(),"defer":function(a){setTimeout(a,0)},"debounce":function(a,b,c){var d,e;return function(){var f,g,h=this,i=arguments;return f=function(){d=null,c||(e=a.apply(h,i))},g=c&&!d,clearTimeout(d),d=setTimeout(f,b),g&&(e=a.apply(h,i)),e}},"throttle":function(a,b){var c,d,e,f,g,h;return g=0,h=function(){g=new Date,e=null,f=a.apply(c,d)},function(){var i=new Date,j=b-(i-g);return c=this,d=arguments,0>=j?(clearTimeout(e),e=null,g=i,f=a.apply(c,d)):e||(e=setTimeout(h,j)),f}},"tokenizeQuery":function(b){return a.trim(b).toLowerCase().split(/[\s]+/)},"tokenizeText":function(b){return a.trim(b).toLowerCase().split(/[\s\-_]+/)},"getProtocol":function(){return location.protocol},"noop":function(){}},d=function(){var a=/\s+/;return{"on":function(b,c){var d;if(!c)return this;for(this._callbacks=this._callbacks||{},b=b.split(a);d=b.shift();)this._callbacks[d]=this._callbacks[d]||[],this._callbacks[d].push(c);return this},"trigger":function(b,c){var d,e;if(!this._callbacks)return this;for(b=b.split(a);d=b.shift();)if(e=this._callbacks[d])for(var f=0;f<e.length;f+=1)e[f].call(this,{"type":d,"data":c});return this}}}(),e=function(){function b(b){b&&b.el||a.error("EventBus initialized without el"),this.$el=a(b.el)}var d="typeahead:";return c.mixin(b.prototype,{"trigger":function(a){var b=[].slice.call(arguments,1);this.$el.trigger(d+a,b)}}),b}(),f=function(){function a(a){this.prefix=["__",a,"__"].join(""),this.ttlKey="__ttl__",this.keyMatcher=new RegExp("^"+this.prefix)}function b(){return(new Date).getTime()}function d(a){return JSON.stringify(c.isUndefined(a)?null:a)}function e(a){return JSON.parse(a)}var f,g;try{f=window.localStorage,f.setItem("~~~","!"),f.removeItem("~~~")}catch(h){f=null}return g=f&&window.JSON?{"_prefix":function(a){return this.prefix+a},"_ttlKey":function(a){return this._prefix(a)+this.ttlKey},"get":function(a){return this.isExpired(a)&&this.remove(a),e(f.getItem(this._prefix(a)))},"set":function(a,e,g){return c.isNumber(g)?f.setItem(this._ttlKey(a),d(b()+g)):f.removeItem(this._ttlKey(a)),f.setItem(this._prefix(a),d(e))},"remove":function(a){return f.removeItem(this._ttlKey(a)),f.removeItem(this._prefix(a)),this},"clear":function(){var a,b,c=[],d=f.length;for(a=0;d>a;a++)(b=f.key(a)).match(this.keyMatcher)&&c.push(b.replace(this.keyMatcher,""));for(a=c.length;a--;)this.remove(c[a]);return this},"isExpired":function(a){var d=e(f.getItem(this._ttlKey(a)));return c.isNumber(d)&&b()>d?!0:!1}}:{"get":c.noop,"set":c.noop,"remove":c.noop,"clear":c.noop,"isExpired":c.noop},c.mixin(a.prototype,g),a}(),g=function(){function a(a){c.bindAll(this),a=a||{},this.sizeLimit=a.sizeLimit||10,this.cache={},this.cachedKeysByAge=[]}return c.mixin(a.prototype,{"get":function(a){return this.cache[a]},"set":function(a,b){var c;this.cachedKeysByAge.length===this.sizeLimit&&(c=this.cachedKeysByAge.shift(),delete this.cache[c]),this.cache[a]=b,this.cachedKeysByAge.push(a)}}),a}(),h=function(){function b(a){c.bindAll(this),a=c.isString(a)?{"url":a}:a,i=i||new g,h=c.isNumber(a.maxParallelRequests)?a.maxParallelRequests:h||6,this.url=a.url,this.wildcard=a.wildcard||"%QUERY",this.filter=a.filter,this.replace=a.replace,this.ajaxSettings={"type":"get","cache":a.cache,"timeout":a.timeout,"dataType":a.dataType||"json","beforeSend":a.beforeSend},this._get=(/^throttle$/i.test(a.rateLimitFn)?c.throttle:c.debounce)(this._get,a.rateLimitWait||300)}function d(){j++}function e(){j--}function f(){return h>j}var h,i,j=0,k={};return c.mixin(b.prototype,{"_get":function(a,b){function c(c){var e=d.filter?d.filter(c):c;b&&b(e),i.set(a,c)}var d=this;f()?this._sendRequest(a).done(c):this.onDeckRequestArgs=[].slice.call(arguments,0)},"_sendRequest":function(b){function c(){e(),k[b]=null,f.onDeckRequestArgs&&(f._get.apply(f,f.onDeckRequestArgs),f.onDeckRequestArgs=null)}var f=this,g=k[b];return g||(d(),g=k[b]=a.ajax(b,this.ajaxSettings).always(c)),g},"get":function(a,b){var d,e,f=this,g=encodeURIComponent(a||"");return b=b||c.noop,d=this.replace?this.replace(this.url,g):this.url.replace(this.wildcard,g),(e=i.get(d))?c.defer(function(){b(f.filter?f.filter(e):e)}):this._get(d,b),!!e}}),b}(),i=function(){function d(b){c.bindAll(this),c.isString(b.template)&&!b.engine&&a.error("no template engine specified"),b.local||b.prefetch||b.remote||a.error("one of local, prefetch, or remote is required"),this.name=b.name||c.getUniqueId(),this.limit=b.limit||5,this.minLength=b.minLength||1,this.header=b.header,this.footer=b.footer,this.valueKey=b.valueKey||"value",this.template=e(b.template,b.engine,this.valueKey),this.local=b.local,this.prefetch=b.prefetch,this.remote=b.remote,this.itemHash={},this.adjacencyList={},this.storage=b.name?new f(b.name):null}function e(a,b,d){var e,f;return c.isFunction(a)?e=a:c.isString(a)?(f=b.compile(a),e=c.bind(f.render,f)):e=function(a){return"<p>"+a[d]+"</p>"},e}var g={"thumbprint":"thumbprint","protocol":"protocol","itemHash":"itemHash","adjacencyList":"adjacencyList"};return c.mixin(d.prototype,{"_processLocalData":function(a){this._mergeProcessedData(this._processData(a))},"_loadPrefetchData":function(d){function e(a){var b=d.filter?d.filter(a):a,e=m._processData(b),f=e.itemHash,h=e.adjacencyList;m.storage&&(m.storage.set(g.itemHash,f,d.ttl),m.storage.set(g.adjacencyList,h,d.ttl),m.storage.set(g.thumbprint,n,d.ttl),m.storage.set(g.protocol,c.getProtocol(),d.ttl)),m._mergeProcessedData(e)}var f,h,i,j,k,l,m=this,n=b+(d.thumbprint||"");return this.storage&&(f=this.storage.get(g.thumbprint),h=this.storage.get(g.protocol),i=this.storage.get(g.itemHash),j=this.storage.get(g.adjacencyList)),k=f!==n||h!==c.getProtocol(),d=c.isString(d)?{"url":d}:d,d.ttl=c.isNumber(d.ttl)?d.ttl:864e5,i&&j&&!k?(this._mergeProcessedData({"itemHash":i,"adjacencyList":j}),l=a.Deferred().resolve()):l=a.getJSON(d.url).done(e),l},"_transformDatum":function(a){var b=c.isString(a)?a:a[this.valueKey],d=a.tokens||c.tokenizeText(b),e={"value":b,"tokens":d};return c.isString(a)?(e.datum={},e.datum[this.valueKey]=a):e.datum=a,e.tokens=c.filter(e.tokens,function(a){return!c.isBlankString(a)}),e.tokens=c.map(e.tokens,function(a){return a.toLowerCase()}),e},"_processData":function(a){var b=this,d={},e={};return c.each(a,function(a,f){var g=b._transformDatum(f),h=c.getUniqueId(g.value);d[h]=g,c.each(g.tokens,function(a,b){var d=b.charAt(0),f=e[d]||(e[d]=[h]);!~c.indexOf(f,h)&&f.push(h)})}),{"itemHash":d,"adjacencyList":e}},"_mergeProcessedData":function(a){var b=this;c.mixin(this.itemHash,a.itemHash),c.each(a.adjacencyList,function(a,c){var d=b.adjacencyList[a];b.adjacencyList[a]=d?d.concat(c):c})},"_getLocalSuggestions":function(a){var b,d=this,e=[],f=[],g=[];return c.each(a,function(a,b){var d=b.charAt(0);!~c.indexOf(e,d)&&e.push(d)}),c.each(e,function(a,c){var e=d.adjacencyList[c];return e?(f.push(e),void((!b||e.length<b.length)&&(b=e))):!1}),f.length<e.length?[]:(c.each(b,function(b,e){var h,i,j=d.itemHash[e];h=c.every(f,function(a){return~c.indexOf(a,e)}),i=h&&c.every(a,function(a){return c.some(j.tokens,function(b){return 0===b.indexOf(a)})}),i&&g.push(j)}),g)},"initialize":function(){var b;return this.local&&this._processLocalData(this.local),this.transport=this.remote?new h(this.remote):null,b=this.prefetch?this._loadPrefetchData(this.prefetch):a.Deferred().resolve(),this.local=this.prefetch=this.remote=null,this.initialize=function(){return b},b},"getSuggestions":function(a,b){function d(a){f=f.slice(0),c.each(a,function(a,b){var d,e=g._transformDatum(b);return d=c.some(f,function(a){return e.value===a.value}),!d&&f.push(e),f.length<g.limit}),b&&b(f)}var e,f,g=this,h=!1;a.length<this.minLength||(e=c.tokenizeQuery(a),f=this._getLocalSuggestions(e).slice(0,this.limit),f.length<this.limit&&this.transport&&(h=this.transport.get(a,d)),!h&&b&&b(f))}}),d}(),j=function(){function b(b){var d=this;c.bindAll(this),this.specialKeyCodeMap={"9":"tab","27":"esc","37":"left","39":"right","13":"enter","38":"up","40":"down"},this.$hint=a(b.hint),this.$input=a(b.input).on("blur.tt",this._handleBlur).on("focus.tt",this._handleFocus).on("keydown.tt",this._handleSpecialKeyEvent),c.isMsie()?this.$input.on("keydown.tt keypress.tt cut.tt paste.tt",function(a){d.specialKeyCodeMap[a.which||a.keyCode]||c.defer(d._compareQueryToInputValue)}):this.$input.on("input.tt",this._compareQueryToInputValue),this.query=this.$input.val(),this.$overflowHelper=e(this.$input)}function e(b){return a("<span></span>").css({"position":"absolute","left":"-9999px","visibility":"hidden","whiteSpace":"nowrap","fontFamily":b.css("font-family"),"fontSize":b.css("font-size"),"fontStyle":b.css("font-style"),"fontVariant":b.css("font-variant"),"fontWeight":b.css("font-weight"),"wordSpacing":b.css("word-spacing"),"letterSpacing":b.css("letter-spacing"),"textIndent":b.css("text-indent"),"textRendering":b.css("text-rendering"),"textTransform":b.css("text-transform")}).insertAfter(b)}function f(a,b){return a=(a||"").replace(/^\s*/g,"").replace(/\s{2,}/g," "),b=(b||"").replace(/^\s*/g,"").replace(/\s{2,}/g," "),a===b}return c.mixin(b.prototype,d,{"_handleFocus":function(){this.trigger("focused")},"_handleBlur":function(){this.trigger("blured")},"_handleSpecialKeyEvent":function(a){var b=this.specialKeyCodeMap[a.which||a.keyCode];b&&this.trigger(b+"Keyed",a)},"_compareQueryToInputValue":function(){var a=this.getInputValue(),b=f(this.query,a),c=b?this.query.length!==a.length:!1;c?this.trigger("whitespaceChanged",{"value":this.query}):b||this.trigger("queryChanged",{"value":this.query=a})},"destroy":function(){this.$hint.off(".tt"),this.$input.off(".tt"),this.$hint=this.$input=this.$overflowHelper=null},"focus":function(){this.$input.focus()},"blur":function(){this.$input.blur()},"getQuery":function(){return this.query},"setQuery":function(a){this.query=a},"getInputValue":function(){return this.$input.val()},"setInputValue":function(a,b){this.$input.val(a),!b&&this._compareQueryToInputValue()},"getHintValue":function(){return this.$hint.val()},"setHintValue":function(a){this.$hint.val(a)},"getLanguageDirection":function(){return(this.$input.css("direction")||"ltr").toLowerCase()},"isOverflow":function(){return this.$overflowHelper.text(this.getInputValue()),this.$overflowHelper.width()>this.$input.width()},"isCursorAtEnd":function(){var a,b=this.$input.val().length,d=this.$input[0].selectionStart;return c.isNumber(d)?d===b:document.selection?(a=document.selection.createRange(),a.moveStart("character",-b),b===a.text.length):!0}}),b}(),k=function(){function b(b){c.bindAll(this),this.isOpen=!1,this.isEmpty=!0,this.isMouseOverDropdown=!1,this.$menu=a(b.menu).on("mouseenter.tt",this._handleMouseenter).on("mouseleave.tt",this._handleMouseleave).on("click.tt",".tt-suggestion",this._handleSelection).on("mouseover.tt",".tt-suggestion",this._handleMouseover)}function e(a){return a.data("suggestion")}var f={"suggestionsList":'<span class="tt-suggestions"></span>'},g={"suggestionsList":{"display":"block"},"suggestion":{"whiteSpace":"nowrap","cursor":"pointer"},"suggestionChild":{"whiteSpace":"normal"}};return c.mixin(b.prototype,d,{"_handleMouseenter":function(){this.isMouseOverDropdown=!0},"_handleMouseleave":function(){this.isMouseOverDropdown=!1},"_handleMouseover":function(b){var c=a(b.currentTarget);this._getSuggestions().removeClass("tt-is-under-cursor"),c.addClass("tt-is-under-cursor")},"_handleSelection":function(b){var c=a(b.currentTarget);this.trigger("suggestionSelected",e(c))},"_show":function(){this.$menu.css("display","block")},"_hide":function(){this.$menu.hide()},"_moveCursor":function(a){var b,c,d,f;if(this.isVisible()){if(b=this._getSuggestions(),c=b.filter(".tt-is-under-cursor"),c.removeClass("tt-is-under-cursor"),d=b.index(c)+a,d=(d+1)%(b.length+1)-1,-1===d)return void this.trigger("cursorRemoved");-1>d&&(d=b.length-1),f=b.eq(d).addClass("tt-is-under-cursor"),this._ensureVisibility(f),this.trigger("cursorMoved",e(f))}},"_getSuggestions":function(){return this.$menu.find(".tt-suggestions > .tt-suggestion")},"_ensureVisibility":function(a){var b=this.$menu.height()+parseInt(this.$menu.css("paddingTop"),10)+parseInt(this.$menu.css("paddingBottom"),10),c=this.$menu.scrollTop(),d=a.position().top,e=d+a.outerHeight(!0);0>d?this.$menu.scrollTop(c+d):e>b&&this.$menu.scrollTop(c+(e-b))},"destroy":function(){this.$menu.off(".tt"),this.$menu=null},"isVisible":function(){return this.isOpen&&!this.isEmpty},"closeUnlessMouseIsOverDropdown":function(){this.isMouseOverDropdown||this.close()},"close":function(){this.isOpen&&(this.isOpen=!1,this.isMouseOverDropdown=!1,this._hide(),this.$menu.find(".tt-suggestions > .tt-suggestion").removeClass("tt-is-under-cursor"),this.trigger("closed"))},"open":function(){this.isOpen||(this.isOpen=!0,!this.isEmpty&&this._show(),this.trigger("opened"))},"setLanguageDirection":function(a){var b={"left":"0","right":"auto"},c={"left":"auto","right":" 0"};this.$menu.css("ltr"===a?b:c)},"moveCursorUp":function(){this._moveCursor(-1)},"moveCursorDown":function(){this._moveCursor(1)},"getSuggestionUnderCursor":function(){var a=this._getSuggestions().filter(".tt-is-under-cursor").first();return a.length>0?e(a):null},"getFirstSuggestion":function(){var a=this._getSuggestions().first();return a.length>0?e(a):null},"renderSuggestions":function(b,d){var e,h,i,j,k,l="tt-dataset-"+b.name,m='<div class="tt-suggestion">%body</div>',n=this.$menu.find("."+l);0===n.length&&(h=a(f.suggestionsList).css(g.suggestionsList),n=a("<div></div>").addClass(l).append(b.header).append(h).append(b.footer).appendTo(this.$menu)),d.length>0?(this.isEmpty=!1,this.isOpen&&this._show(),i=document.createElement("div"),j=document.createDocumentFragment(),c.each(d,function(c,d){d.dataset=b.name,e=b.template(d.datum),i.innerHTML=m.replace("%body",e),k=a(i.firstChild).css(g.suggestion).data("suggestion",d),k.children().each(function(){a(this).css(g.suggestionChild)}),j.appendChild(k[0])}),n.show().find(".tt-suggestions").html(j)):this.clearSuggestions(b.name),this.trigger("suggestionsRendered")},"clearSuggestions":function(a){var b=this.$menu.find(a?".tt-dataset-"+a:'[class^="tt-dataset-"]'),c=b.find(".tt-suggestions");b.hide(),c.empty(),0===this._getSuggestions().length&&(this.isEmpty=!0,this._hide())}}),b}(),l=function(){function b(a){var b,d,f;c.bindAll(this),this.$node=e(a.input),this.datasets=a.datasets,this.dir=null,this.eventBus=a.eventBus,b=this.$node.find(".tt-dropdown-menu"),d=this.$node.find(".tt-query"),f=this.$node.find(".tt-hint"),this.dropdownView=new k({"menu":b}).on("suggestionSelected",this._handleSelection).on("cursorMoved",this._clearHint).on("cursorMoved",this._setInputValueToSuggestionUnderCursor).on("cursorRemoved",this._setInputValueToQuery).on("cursorRemoved",this._updateHint).on("suggestionsRendered",this._updateHint).on("opened",this._updateHint).on("closed",this._clearHint).on("opened closed",this._propagateEvent),this.inputView=new j({"input":d,"hint":f}).on("focused",this._openDropdown).on("blured",this._closeDropdown).on("blured",this._setInputValueToQuery).on("enterKeyed tabKeyed",this._handleSelection).on("queryChanged",this._clearHint).on("queryChanged",this._clearSuggestions).on("queryChanged",this._getSuggestions).on("whitespaceChanged",this._updateHint).on("queryChanged whitespaceChanged",this._openDropdown).on("queryChanged whitespaceChanged",this._setLanguageDirection).on("escKeyed",this._closeDropdown).on("escKeyed",this._setInputValueToQuery).on("tabKeyed upKeyed downKeyed",this._managePreventDefault).on("upKeyed downKeyed",this._moveDropdownCursor).on("upKeyed downKeyed",this._openDropdown).on("tabKeyed leftKeyed rightKeyed",this._autocomplete)}function e(b){var c=a(g.wrapper),d=a(g.dropdown),e=a(b),f=a(g.hint);c=c.css(h.wrapper),d=d.css(h.dropdown),f.css(h.hint).css({"backgroundAttachment":e.css("background-attachment"),"backgroundClip":e.css("background-clip"),"backgroundColor":e.css("background-color"),"backgroundImage":e.css("background-image"),"backgroundOrigin":e.css("background-origin"),"backgroundPosition":e.css("background-position"),"backgroundRepeat":e.css("background-repeat"),"backgroundSize":e.css("background-size")}),e.data("ttAttrs",{"dir":e.attr("dir"),"autocomplete":e.attr("autocomplete"),"spellcheck":e.attr("spellcheck"),"style":e.attr("style")}),e.addClass("tt-query").attr({"autocomplete":"off","spellcheck":!1}).css(h.query);try{!e.attr("dir")&&e.attr("dir","auto")}catch(i){}return e.wrap(c).parent().prepend(f).append(d)}function f(a){var b=a.find(".tt-query");c.each(b.data("ttAttrs"),function(a,d){c.isUndefined(d)?b.removeAttr(a):b.attr(a,d)}),b.detach().removeData("ttAttrs").removeClass("tt-query").insertAfter(a),a.remove()}var g={"wrapper":'<span class="twitter-typeahead"></span>',"hint":'<input class="tt-hint" type="text" autocomplete="off" spellcheck="off" disabled>',"dropdown":'<span class="tt-dropdown-menu"></span>'},h={"wrapper":{"position":"relative","display":"inline-block"},"hint":{"position":"absolute","top":"0","left":"0","borderColor":"transparent","boxShadow":"none"},"query":{"position":"relative","verticalAlign":"top","backgroundColor":"transparent"},"dropdown":{"position":"absolute","top":"100%","left":"0","zIndex":"100","display":"none"}};return c.isMsie()&&c.mixin(h.query,{"backgroundImage":"url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)"}),c.isMsie()&&c.isMsie()<=7&&(c.mixin(h.wrapper,{"display":"inline","zoom":"1"}),c.mixin(h.query,{"marginTop":"-1px"})),c.mixin(b.prototype,d,{"_managePreventDefault":function(a){var b,c,d=a.data,e=!1;switch(a.type){case"tabKeyed":b=this.inputView.getHintValue(),c=this.inputView.getInputValue(),e=b&&b!==c;break;case"upKeyed":case"downKeyed":e=!d.shiftKey&&!d.ctrlKey&&!d.metaKey}e&&d.preventDefault()},"_setLanguageDirection":function(){var a=this.inputView.getLanguageDirection();a!==this.dir&&(this.dir=a,this.$node.css("direction",a),this.dropdownView.setLanguageDirection(a))},"_updateHint":function(){var a,b,d,e,f,g=this.dropdownView.getFirstSuggestion(),h=g?g.value:null,i=this.dropdownView.isVisible(),j=this.inputView.isOverflow();h&&i&&!j&&(a=this.inputView.getInputValue(),b=a.replace(/\s{2,}/g," ").replace(/^\s+/g,""),d=c.escapeRegExChars(b),e=new RegExp("^(?:"+d+")(.*$)","i"),f=e.exec(h),this.inputView.setHintValue(a+(f?f[1]:"")))},"_clearHint":function(){this.inputView.setHintValue("")},"_clearSuggestions":function(){this.dropdownView.clearSuggestions()},"_setInputValueToQuery":function(){this.inputView.setInputValue(this.inputView.getQuery())},"_setInputValueToSuggestionUnderCursor":function(a){var b=a.data;this.inputView.setInputValue(b.value,!0)},"_openDropdown":function(){this.dropdownView.open()},"_closeDropdown":function(a){this.dropdownView["blured"===a.type?"closeUnlessMouseIsOverDropdown":"close"]()},"_moveDropdownCursor":function(a){var b=a.data;b.shiftKey||b.ctrlKey||b.metaKey||this.dropdownView["upKeyed"===a.type?"moveCursorUp":"moveCursorDown"]()},"_handleSelection":function(a){var b="suggestionSelected"===a.type,d=b?a.data:this.dropdownView.getSuggestionUnderCursor();d&&(this.inputView.setInputValue(d.value),b?this.inputView.focus():a.data.preventDefault(),b&&c.isMsie()?c.defer(this.dropdownView.close):this.dropdownView.close(),this.eventBus.trigger("selected",d.datum,d.dataset))},"_getSuggestions":function(){var a=this,b=this.inputView.getQuery();c.isBlankString(b)||c.each(this.datasets,function(c,d){d.getSuggestions(b,function(c){b===a.inputView.getQuery()&&a.dropdownView.renderSuggestions(d,c)})})},"_autocomplete":function(a){var b,c,d,e,f;("rightKeyed"!==a.type&&"leftKeyed"!==a.type||(b=this.inputView.isCursorAtEnd(),c="ltr"===this.inputView.getLanguageDirection()?"leftKeyed"===a.type:"rightKeyed"===a.type,b&&!c))&&(d=this.inputView.getQuery(),e=this.inputView.getHintValue(),""!==e&&d!==e&&(f=this.dropdownView.getFirstSuggestion(),this.inputView.setInputValue(f.value),this.eventBus.trigger("autocompleted",f.datum,f.dataset)))},"_propagateEvent":function(a){this.eventBus.trigger(a.type)},"destroy":function(){this.inputView.destroy(),this.dropdownView.destroy(),f(this.$node),this.$node=null},"setQuery":function(a){this.inputView.setQuery(a),this.inputView.setInputValue(a),this._clearHint(),this._clearSuggestions(),this._getSuggestions()}}),b}();!function(){var b,d={},f="ttView";b={"initialize":function(b){function g(){var b,d=a(this),g=new e({"el":d});b=c.map(h,function(a){return a.initialize()}),d.data(f,new l({"input":d,"eventBus":g=new e({"el":d}),"datasets":h})),a.when.apply(a,b).always(function(){c.defer(function(){g.trigger("initialized")})})}var h;return b=c.isArray(b)?b:[b],0===b.length&&a.error("no datasets provided"),h=c.map(b,function(a){var b=d[a.name]?d[a.name]:new i(a);return a.name&&(d[a.name]=b),b}),this.each(g)},"destroy":function(){function b(){var b=a(this),c=b.data(f);c&&(c.destroy(),b.removeData(f))}return this.each(b)},"setQuery":function(b){function c(){var c=a(this).data(f);c&&c.setQuery(b)}return this.each(c)}},jQuery.fn.typeahead=function(a){return b[a]?b[a].apply(this,[].slice.call(arguments,1)):b.initialize.apply(this,arguments)}}()}(window.jQuery),function(a){"use strict";var b=function(a){this.init("typeaheadjs",a,b.defaults)
|
|
};a.fn.editableutils.inherit(b,a.fn.editabletypes.text),a.extend(b.prototype,{"render":function(){this.renderClear(),this.setClass(),this.setAttr("placeholder"),this.$input.typeahead(this.options.typeahead),"bs3"===a.fn.editableform.engine&&(this.$input.hasClass("input-sm")&&this.$input.siblings("input.tt-hint").addClass("input-sm"),this.$input.hasClass("input-lg")&&this.$input.siblings("input.tt-hint").addClass("input-lg"))}}),b.defaults=a.extend({},a.fn.editabletypes.list.defaults,{"tpl":'<input type="text">',"typeahead":null,"clear":!0}),a.fn.editabletypes.typeaheadjs=b}(window.jQuery),function(a){a.extend(a.fn,{"validate":function(b){if(!this.length)return void(b&&b.debug&&window.console);var c=a.data(this[0],"validator");return c?c:(this.attr("novalidate","novalidate"),c=new a.validator(b,this[0]),a.data(this[0],"validator",c),c.settings.onsubmit&&(this.validateDelegate(":submit","click",function(b){c.settings.submitHandler&&(c.submitButton=b.target),a(b.target).hasClass("cancel")&&(c.cancelSubmit=!0),void 0!==a(b.target).attr("formnovalidate")&&(c.cancelSubmit=!0)}),this.submit(function(b){function d(){var d;return c.settings.submitHandler?(c.submitButton&&(d=a("<input type='hidden'/>").attr("name",c.submitButton.name).val(a(c.submitButton).val()).appendTo(c.currentForm)),c.settings.submitHandler.call(c,c.currentForm,b),c.submitButton&&d.remove(),!1):!0}return c.settings.debug&&b.preventDefault(),c.cancelSubmit?(c.cancelSubmit=!1,d()):c.form()?c.pendingRequest?(c.formSubmitted=!0,!1):d():(c.focusInvalid(),!1)})),c)},"valid":function(){if(a(this[0]).is("form"))return this.validate().form();var b=!0,c=a(this[0].form).validate();return this.each(function(){b=b&&c.element(this)}),b},"removeAttrs":function(b){var c={},d=this;return a.each(b.split(/\s/),function(a,b){c[b]=d.attr(b),d.removeAttr(b)}),c},"rules":function(b,c){var d=this[0];if(b){var e=a.data(d.form,"validator").settings,f=e.rules,g=a.validator.staticRules(d);switch(b){case"add":a.extend(g,a.validator.normalizeRule(c)),delete g.messages,f[d.name]=g,c.messages&&(e.messages[d.name]=a.extend(e.messages[d.name],c.messages));break;case"remove":if(!c)return delete f[d.name],g;var h={};return a.each(c.split(/\s/),function(a,b){h[b]=g[b],delete g[b]}),h}}var i=a.validator.normalizeRules(a.extend({},a.validator.classRules(d),a.validator.attributeRules(d),a.validator.dataRules(d),a.validator.staticRules(d)),d);if(i.required){var j=i.required;delete i.required,i=a.extend({"required":j},i)}return i}}),a.extend(a.expr[":"],{"blank":function(b){return!a.trim(""+a(b).val())},"filled":function(b){return!!a.trim(""+a(b).val())},"unchecked":function(b){return!a(b).prop("checked")}}),a.validator=function(b,c){this.settings=a.extend(!0,{},a.validator.defaults,b),this.currentForm=c,this.init()},a.validator.format=function(b,c){return 1===arguments.length?function(){var c=a.makeArray(arguments);return c.unshift(b),a.validator.format.apply(this,c)}:(arguments.length>2&&c.constructor!==Array&&(c=a.makeArray(arguments).slice(1)),c.constructor!==Array&&(c=[c]),a.each(c,function(a,c){b=b.replace(new RegExp("\\{"+a+"\\}","g"),function(){return c})}),b)},a.extend(a.validator,{"defaults":{"messages":{},"groups":{},"rules":{},"errorClass":"error","validClass":"valid","errorElement":"label","focusInvalid":!0,"errorContainer":a([]),"errorLabelContainer":a([]),"onsubmit":!0,"ignore":":hidden","ignoreTitle":!1,"onfocusin":function(a){this.lastActive=a,this.settings.focusCleanup&&!this.blockFocusCleanup&&(this.settings.unhighlight&&this.settings.unhighlight.call(this,a,this.settings.errorClass,this.settings.validClass),this.addWrapper(this.errorsFor(a)).hide())},"onfocusout":function(a){this.checkable(a)||!(a.name in this.submitted)&&this.optional(a)||this.element(a)},"onkeyup":function(a,b){(9!==b.which||""!==this.elementValue(a))&&(a.name in this.submitted||a===this.lastElement)&&this.element(a)},"onclick":function(a){a.name in this.submitted?this.element(a):a.parentNode.name in this.submitted&&this.element(a.parentNode)},"highlight":function(b,c,d){"radio"===b.type?this.findByName(b.name).addClass(c).removeClass(d):a(b).addClass(c).removeClass(d)},"unhighlight":function(b,c,d){"radio"===b.type?this.findByName(b.name).removeClass(c).addClass(d):a(b).removeClass(c).addClass(d)}},"setDefaults":function(b){a.extend(a.validator.defaults,b)},"messages":{"required":"This field is required.","remote":"Please fix this field.","email":"Please enter a valid email address.","url":"Please enter a valid URL.","date":"Please enter a valid date.","dateISO":"Please enter a valid date (ISO).","number":"Please enter a valid number.","digits":"Please enter only digits.","creditcard":"Please enter a valid credit card number.","equalTo":"Please enter the same value again.","maxlength":a.validator.format("Please enter no more than {0} characters."),"minlength":a.validator.format("Please enter at least {0} characters."),"rangelength":a.validator.format("Please enter a value between {0} and {1} characters long."),"range":a.validator.format("Please enter a value between {0} and {1}."),"max":a.validator.format("Please enter a value less than or equal to {0}."),"min":a.validator.format("Please enter a value greater than or equal to {0}.")},"autoCreateRanges":!1,"prototype":{"init":function(){function b(b){var c=a.data(this[0].form,"validator"),d="on"+b.type.replace(/^validate/,"");c.settings[d]&&c.settings[d].call(c,this[0],b)}this.labelContainer=a(this.settings.errorLabelContainer),this.errorContext=this.labelContainer.length&&this.labelContainer||a(this.currentForm),this.containers=a(this.settings.errorContainer).add(this.settings.errorLabelContainer),this.submitted={},this.valueCache={},this.pendingRequest=0,this.pending={},this.invalid={},this.reset();var c=this.groups={};a.each(this.settings.groups,function(b,d){"string"==typeof d&&(d=d.split(/\s/)),a.each(d,function(a,d){c[d]=b})});var d=this.settings.rules;a.each(d,function(b,c){d[b]=a.validator.normalizeRule(c)}),a(this.currentForm).validateDelegate(":text, [type='password'], [type='file'], select, textarea, [type='number'], [type='search'] ,[type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], [type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'] ","focusin focusout keyup",b).validateDelegate("[type='radio'], [type='checkbox'], select, option","click",b),this.settings.invalidHandler&&a(this.currentForm).bind("invalid-form.validate",this.settings.invalidHandler)},"form":function(){return this.checkForm(),a.extend(this.submitted,this.errorMap),this.invalid=a.extend({},this.errorMap),this.valid()||a(this.currentForm).triggerHandler("invalid-form",[this]),this.showErrors(),this.valid()},"checkForm":function(){this.prepareForm();for(var a=0,b=this.currentElements=this.elements();b[a];a++)this.check(b[a]);return this.valid()},"element":function(b){b=this.validationTargetFor(this.clean(b)),this.lastElement=b,this.prepareElement(b),this.currentElements=a(b);var c=this.check(b)!==!1;return c?delete this.invalid[b.name]:this.invalid[b.name]=!0,this.numberOfInvalids()||(this.toHide=this.toHide.add(this.containers)),this.showErrors(),c},"showErrors":function(b){if(b){a.extend(this.errorMap,b),this.errorList=[];for(var c in b)this.errorList.push({"message":b[c],"element":this.findByName(c)[0]});this.successList=a.grep(this.successList,function(a){return!(a.name in b)})}this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors()},"resetForm":function(){a.fn.resetForm&&a(this.currentForm).resetForm(),this.submitted={},this.lastElement=null,this.prepareForm(),this.hideErrors(),this.elements().removeClass(this.settings.errorClass).removeData("previousValue")},"numberOfInvalids":function(){return this.objectLength(this.invalid)},"objectLength":function(a){var b=0;for(var c in a)b++;return b},"hideErrors":function(){this.addWrapper(this.toHide).hide()},"valid":function(){return 0===this.size()},"size":function(){return this.errorList.length},"focusInvalid":function(){if(this.settings.focusInvalid)try{a(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus().trigger("focusin")}catch(b){}},"findLastActive":function(){var b=this.lastActive;return b&&1===a.grep(this.errorList,function(a){return a.element.name===b.name}).length&&b},"elements":function(){var b=this,c={};return a(this.currentForm).find("input, select, textarea").not(":submit, :reset, :image, [disabled]").not(this.settings.ignore).filter(function(){return!this.name&&b.settings.debug&&window.console,this.name in c||!b.objectLength(a(this).rules())?!1:(c[this.name]=!0,!0)})},"clean":function(b){return a(b)[0]},"errors":function(){var b=this.settings.errorClass.replace(" ",".");return a(this.settings.errorElement+"."+b,this.errorContext)},"reset":function(){this.successList=[],this.errorList=[],this.errorMap={},this.toShow=a([]),this.toHide=a([]),this.currentElements=a([])},"prepareForm":function(){this.reset(),this.toHide=this.errors().add(this.containers)},"prepareElement":function(a){this.reset(),this.toHide=this.errorsFor(a)},"elementValue":function(b){var c=a(b).attr("type"),d=a(b).val();return"radio"===c||"checkbox"===c?a("input[name='"+a(b).attr("name")+"']:checked").val():"string"==typeof d?d.replace(/\r/g,""):d},"check":function(b){b=this.validationTargetFor(this.clean(b));var c,d=a(b).rules(),e=!1,f=this.elementValue(b);for(var g in d){var h={"method":g,"parameters":d[g]};try{if(c=a.validator.methods[g].call(this,f,b,h.parameters),"dependency-mismatch"===c){e=!0;continue}if(e=!1,"pending"===c)return void(this.toHide=this.toHide.not(this.errorsFor(b)));if(!c)return this.formatAndAdd(b,h),!1}catch(i){throw this.settings.debug&&window.console,i}}return e?void 0:(this.objectLength(d)&&this.successList.push(b),!0)},"customDataMessage":function(b,c){return a(b).data("msg-"+c.toLowerCase())||b.attributes&&a(b).attr("data-msg-"+c.toLowerCase())},"customMessage":function(a,b){var c=this.settings.messages[a];return c&&(c.constructor===String?c:c[b])},"findDefined":function(){for(var a=0;a<arguments.length;a++)if(void 0!==arguments[a])return arguments[a];return void 0},"defaultMessage":function(b,c){return this.findDefined(this.customMessage(b.name,c),this.customDataMessage(b,c),!this.settings.ignoreTitle&&b.title||void 0,a.validator.messages[c],"<strong>Warning: No message defined for "+b.name+"</strong>")},"formatAndAdd":function(b,c){var d=this.defaultMessage(b,c.method),e=/\$?\{(\d+)\}/g;"function"==typeof d?d=d.call(this,c.parameters,b):e.test(d)&&(d=a.validator.format(d.replace(e,"{$1}"),c.parameters)),this.errorList.push({"message":d,"element":b}),this.errorMap[b.name]=d,this.submitted[b.name]=d},"addWrapper":function(a){return this.settings.wrapper&&(a=a.add(a.parent(this.settings.wrapper))),a},"defaultShowErrors":function(){var a,b;for(a=0;this.errorList[a];a++){var c=this.errorList[a];this.settings.highlight&&this.settings.highlight.call(this,c.element,this.settings.errorClass,this.settings.validClass),this.showLabel(c.element,c.message)}if(this.errorList.length&&(this.toShow=this.toShow.add(this.containers)),this.settings.success)for(a=0;this.successList[a];a++)this.showLabel(this.successList[a]);if(this.settings.unhighlight)for(a=0,b=this.validElements();b[a];a++)this.settings.unhighlight.call(this,b[a],this.settings.errorClass,this.settings.validClass);this.toHide=this.toHide.not(this.toShow),this.hideErrors(),this.addWrapper(this.toShow).show()},"validElements":function(){return this.currentElements.not(this.invalidElements())},"invalidElements":function(){return a(this.errorList).map(function(){return this.element})},"showLabel":function(b,c){var d=this.errorsFor(b);d.length?(d.removeClass(this.settings.validClass).addClass(this.settings.errorClass),d.html(c)):(d=a("<"+this.settings.errorElement+">").attr("for",this.idOrName(b)).addClass(this.settings.errorClass).html(c||""),this.settings.wrapper&&(d=d.hide().show().wrap("<"+this.settings.wrapper+"/>").parent()),this.labelContainer.append(d).length||(this.settings.errorPlacement?this.settings.errorPlacement(d,a(b)):d.insertAfter(b))),!c&&this.settings.success&&(d.text(""),"string"==typeof this.settings.success?d.addClass(this.settings.success):this.settings.success(d,b)),this.toShow=this.toShow.add(d)},"errorsFor":function(b){var c=this.idOrName(b);return this.errors().filter(function(){return a(this).attr("for")===c})},"idOrName":function(a){return this.groups[a.name]||(this.checkable(a)?a.name:a.id||a.name)},"validationTargetFor":function(a){return this.checkable(a)&&(a=this.findByName(a.name).not(this.settings.ignore)[0]),a},"checkable":function(a){return/radio|checkbox/i.test(a.type)},"findByName":function(b){return a(this.currentForm).find("[name='"+b+"']")},"getLength":function(b,c){switch(c.nodeName.toLowerCase()){case"select":return a("option:selected",c).length;case"input":if(this.checkable(c))return this.findByName(c.name).filter(":checked").length}return b.length},"depend":function(a,b){return this.dependTypes[typeof a]?this.dependTypes[typeof a](a,b):!0},"dependTypes":{"boolean":function(a){return a},"string":function(b,c){return!!a(b,c.form).length},"function":function(a,b){return a(b)}},"optional":function(b){var c=this.elementValue(b);return!a.validator.methods.required.call(this,c,b)&&"dependency-mismatch"},"startRequest":function(a){this.pending[a.name]||(this.pendingRequest++,this.pending[a.name]=!0)},"stopRequest":function(b,c){this.pendingRequest--,this.pendingRequest<0&&(this.pendingRequest=0),delete this.pending[b.name],c&&0===this.pendingRequest&&this.formSubmitted&&this.form()?(a(this.currentForm).submit(),this.formSubmitted=!1):!c&&0===this.pendingRequest&&this.formSubmitted&&(a(this.currentForm).triggerHandler("invalid-form",[this]),this.formSubmitted=!1)},"previousValue":function(b){return a.data(b,"previousValue")||a.data(b,"previousValue",{"old":null,"valid":!0,"message":this.defaultMessage(b,"remote")})}},"classRuleSettings":{"required":{"required":!0},"email":{"email":!0},"url":{"url":!0},"date":{"date":!0},"dateISO":{"dateISO":!0},"number":{"number":!0},"digits":{"digits":!0},"creditcard":{"creditcard":!0}},"addClassRules":function(b,c){b.constructor===String?this.classRuleSettings[b]=c:a.extend(this.classRuleSettings,b)},"classRules":function(b){var c={},d=a(b).attr("class");return d&&a.each(d.split(" "),function(){this in a.validator.classRuleSettings&&a.extend(c,a.validator.classRuleSettings[this])}),c},"attributeRules":function(b){var c={},d=a(b),e=d[0].getAttribute("type");for(var f in a.validator.methods){var g;"required"===f?(g=d.get(0).getAttribute(f),""===g&&(g=!0),g=!!g):g=d.attr(f),/min|max/.test(f)&&(null===e||/number|range|text/.test(e))&&(g=Number(g)),g?c[f]=g:e===f&&"range"!==e&&(c[f]=!0)}return c.maxlength&&/-1|2147483647|524288/.test(c.maxlength)&&delete c.maxlength,c},"dataRules":function(b){var c,d,e={},f=a(b);for(c in a.validator.methods)d=f.data("rule-"+c.toLowerCase()),void 0!==d&&(e[c]=d);return e},"staticRules":function(b){var c={},d=a.data(b.form,"validator");return d.settings.rules&&(c=a.validator.normalizeRule(d.settings.rules[b.name])||{}),c},"normalizeRules":function(b,c){return a.each(b,function(d,e){if(e===!1)return void delete b[d];if(e.param||e.depends){var f=!0;switch(typeof e.depends){case"string":f=!!a(e.depends,c.form).length;break;case"function":f=e.depends.call(c,c)}f?b[d]=void 0!==e.param?e.param:!0:delete b[d]}}),a.each(b,function(d,e){b[d]=a.isFunction(e)?e(c):e}),a.each(["minlength","maxlength"],function(){b[this]&&(b[this]=Number(b[this]))}),a.each(["rangelength","range"],function(){var c;b[this]&&(a.isArray(b[this])?b[this]=[Number(b[this][0]),Number(b[this][1])]:"string"==typeof b[this]&&(c=b[this].split(/[\s,]+/),b[this]=[Number(c[0]),Number(c[1])]))}),a.validator.autoCreateRanges&&(b.min&&b.max&&(b.range=[b.min,b.max],delete b.min,delete b.max),b.minlength&&b.maxlength&&(b.rangelength=[b.minlength,b.maxlength],delete b.minlength,delete b.maxlength)),b},"normalizeRule":function(b){if("string"==typeof b){var c={};a.each(b.split(/\s/),function(){c[this]=!0}),b=c}return b},"addMethod":function(b,c,d){a.validator.methods[b]=c,a.validator.messages[b]=void 0!==d?d:a.validator.messages[b],c.length<3&&a.validator.addClassRules(b,a.validator.normalizeRule(b))},"methods":{"required":function(b,c,d){if(!this.depend(d,c))return"dependency-mismatch";if("select"===c.nodeName.toLowerCase()){var e=a(c).val();return e&&e.length>0}return this.checkable(c)?this.getLength(b,c)>0:a.trim(b).length>0},"email":function(a,b){return this.optional(b)||/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i.test(a)},"url":function(a,b){return this.optional(b)||/^(https?|s?ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(a)},"date":function(a,b){return this.optional(b)||!/Invalid|NaN/.test(new Date(a).toString())},"dateISO":function(a,b){return this.optional(b)||/^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}$/.test(a)},"number":function(a,b){return this.optional(b)||/^-?(?:\d+|\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(a)},"digits":function(a,b){return this.optional(b)||/^\d+$/.test(a)},"creditcard":function(a,b){if(this.optional(b))return"dependency-mismatch";if(/[^0-9 \-]+/.test(a))return!1;var c=0,d=0,e=!1;a=a.replace(/\D/g,"");for(var f=a.length-1;f>=0;f--){var g=a.charAt(f);d=parseInt(g,10),e&&(d*=2)>9&&(d-=9),c+=d,e=!e}return c%10===0},"minlength":function(b,c,d){var e=a.isArray(b)?b.length:this.getLength(a.trim(b),c);return this.optional(c)||e>=d},"maxlength":function(b,c,d){var e=a.isArray(b)?b.length:this.getLength(a.trim(b),c);return this.optional(c)||d>=e},"rangelength":function(b,c,d){var e=a.isArray(b)?b.length:this.getLength(a.trim(b),c);return this.optional(c)||e>=d[0]&&e<=d[1]},"min":function(a,b,c){return this.optional(b)||a>=c},"max":function(a,b,c){return this.optional(b)||c>=a},"range":function(a,b,c){return this.optional(b)||a>=c[0]&&a<=c[1]},"equalTo":function(b,c,d){var e=a(d);return this.settings.onfocusout&&e.unbind(".validate-equalTo").bind("blur.validate-equalTo",function(){a(c).valid()}),b===e.val()},"remote":function(b,c,d){if(this.optional(c))return"dependency-mismatch";var e=this.previousValue(c);if(this.settings.messages[c.name]||(this.settings.messages[c.name]={}),e.originalMessage=this.settings.messages[c.name].remote,this.settings.messages[c.name].remote=e.message,d="string"==typeof d&&{"url":d}||d,e.old===b)return e.valid;e.old=b;var f=this;this.startRequest(c);var g={};return g[c.name]=b,a.ajax(a.extend(!0,{"url":d,"mode":"abort","port":"validate"+c.name,"dataType":"json","data":g,"success":function(d){f.settings.messages[c.name].remote=e.originalMessage;var g=d===!0||"true"===d;if(g){var h=f.formSubmitted;f.prepareElement(c),f.formSubmitted=h,f.successList.push(c),delete f.invalid[c.name],f.showErrors()}else{var i={},j=d||f.defaultMessage(c,"remote");i[c.name]=e.message=a.isFunction(j)?j(b):j,f.invalid[c.name]=!0,f.showErrors(i)}e.valid=g,f.stopRequest(c,g)}},d)),"pending"}}}),a.format=a.validator.format}(jQuery),function(a){var b={};if(a.ajaxPrefilter)a.ajaxPrefilter(function(a,c,d){var e=a.port;"abort"===a.mode&&(b[e]&&b[e].abort(),b[e]=d)});else{var c=a.ajax;a.ajax=function(d){var e=("mode"in d?d:a.ajaxSettings).mode,f=("port"in d?d:a.ajaxSettings).port;return"abort"===e?(b[f]&&b[f].abort(),b[f]=c.apply(this,arguments),b[f]):c.apply(this,arguments)}}}(jQuery),function(a){a.extend(a.fn,{"validateDelegate":function(b,c,d){return this.bind(c,function(c){var e=a(c.target);return e.is(b)?d.apply(e,arguments):void 0})}})}(jQuery),function(){function a(a){return a.replace(/<.[^<>]*?>/g," ").replace(/ | /gi," ").replace(/[.(),;:!?%#$'"_+=\/\-]*/g,"")}jQuery.validator.addMethod("maxWords",function(b,c,d){return this.optional(c)||a(b).match(/\b\w+\b/g).length<=d},jQuery.validator.format("Please enter {0} words or less.")),jQuery.validator.addMethod("minWords",function(b,c,d){return this.optional(c)||a(b).match(/\b\w+\b/g).length>=d},jQuery.validator.format("Please enter at least {0} words.")),jQuery.validator.addMethod("rangeWords",function(b,c,d){var e=a(b),f=/\b\w+\b/g;return this.optional(c)||e.match(f).length>=d[0]&&e.match(f).length<=d[1]},jQuery.validator.format("Please enter between {0} and {1} words."))}(),jQuery.validator.addMethod("letterswithbasicpunc",function(a,b){return this.optional(b)||/^[a-z\-.,()'"\s]+$/i.test(a)},"Letters or punctuation only please"),jQuery.validator.addMethod("alphanumeric",function(a,b){return this.optional(b)||/^\w+$/i.test(a)},"Letters, numbers, and underscores only please"),jQuery.validator.addMethod("lettersonly",function(a,b){return this.optional(b)||/^[a-z]+$/i.test(a)},"Letters only please"),jQuery.validator.addMethod("nowhitespace",function(a,b){return this.optional(b)||/^\S+$/i.test(a)},"No white space please"),jQuery.validator.addMethod("ziprange",function(a,b){return this.optional(b)||/^90[2-5]\d\{2\}-\d{4}$/.test(a)},"Your ZIP-code must be in the range 902xx-xxxx to 905-xx-xxxx"),jQuery.validator.addMethod("zipcodeUS",function(a,b){return this.optional(b)||/\d{5}-\d{4}$|^\d{5}$/.test(a)},"The specified US ZIP Code is invalid"),jQuery.validator.addMethod("integer",function(a,b){return this.optional(b)||/^-?\d+$/.test(a)},"A positive or negative non-decimal number please"),jQuery.validator.addMethod("vinUS",function(a){if(17!==a.length)return!1;var b,c,d,e,f,g,h=["A","B","C","D","E","F","G","H","J","K","L","M","N","P","R","S","T","U","V","W","X","Y","Z"],i=[1,2,3,4,5,6,7,8,1,2,3,4,5,7,9,2,3,4,5,6,7,8,9],j=[8,7,6,5,4,3,2,10,0,9,8,7,6,5,4,3,2],k=0;for(b=0;17>b;b++){if(e=j[b],d=a.slice(b,b+1),8===b&&(g=d),isNaN(d)){for(c=0;c<h.length;c++)if(d.toUpperCase()===h[c]){d=i[c],d*=e,isNaN(g)&&8===c&&(g=h[c]);break}}else d*=e;k+=d}return f=k%11,10===f&&(f="X"),f===g?!0:!1},"The specified vehicle identification number (VIN) is invalid."),jQuery.validator.addMethod("dateITA",function(a,b){var c=!1,d=/^\d{1,2}\/\d{1,2}\/\d{4}$/;if(d.test(a)){var e=a.split("/"),f=parseInt(e[0],10),g=parseInt(e[1],10),h=parseInt(e[2],10),i=new Date(h,g-1,f);c=i.getFullYear()===h&&i.getMonth()===g-1&&i.getDate()===f?!0:!1}else c=!1;return this.optional(b)||c},"Please enter a correct date"),jQuery.validator.addMethod("iban",function(a,b){if(this.optional(b))return!0;if(!/^([a-zA-Z0-9]{4} ){2,8}[a-zA-Z0-9]{1,4}|[a-zA-Z0-9]{12,34}$/.test(a))return!1;var c=a.replace(/ /g,"").toUpperCase(),d=c.substring(0,2),e={"AL":"\\d{8}[\\dA-Z]{16}","AD":"\\d{8}[\\dA-Z]{12}","AT":"\\d{16}","AZ":"[\\dA-Z]{4}\\d{20}","BE":"\\d{12}","BH":"[A-Z]{4}[\\dA-Z]{14}","BA":"\\d{16}","BR":"\\d{23}[A-Z][\\dA-Z]","BG":"[A-Z]{4}\\d{6}[\\dA-Z]{8}","CR":"\\d{17}","HR":"\\d{17}","CY":"\\d{8}[\\dA-Z]{16}","CZ":"\\d{20}","DK":"\\d{14}","DO":"[A-Z]{4}\\d{20}","EE":"\\d{16}","FO":"\\d{14}","FI":"\\d{14}","FR":"\\d{10}[\\dA-Z]{11}\\d{2}","GE":"[\\dA-Z]{2}\\d{16}","DE":"\\d{18}","GI":"[A-Z]{4}[\\dA-Z]{15}","GR":"\\d{7}[\\dA-Z]{16}","GL":"\\d{14}","GT":"[\\dA-Z]{4}[\\dA-Z]{20}","HU":"\\d{24}","IS":"\\d{22}","IE":"[\\dA-Z]{4}\\d{14}","IL":"\\d{19}","IT":"[A-Z]\\d{10}[\\dA-Z]{12}","KZ":"\\d{3}[\\dA-Z]{13}","KW":"[A-Z]{4}[\\dA-Z]{22}","LV":"[A-Z]{4}[\\dA-Z]{13}","LB":"\\d{4}[\\dA-Z]{20}","LI":"\\d{5}[\\dA-Z]{12}","LT":"\\d{16}","LU":"\\d{3}[\\dA-Z]{13}","MK":"\\d{3}[\\dA-Z]{10}\\d{2}","MT":"[A-Z]{4}\\d{5}[\\dA-Z]{18}","MR":"\\d{23}","MU":"[A-Z]{4}\\d{19}[A-Z]{3}","MC":"\\d{10}[\\dA-Z]{11}\\d{2}","MD":"[\\dA-Z]{2}\\d{18}","ME":"\\d{18}","NL":"[A-Z]{4}\\d{10}","NO":"\\d{11}","PK":"[\\dA-Z]{4}\\d{16}","PS":"[\\dA-Z]{4}\\d{21}","PL":"\\d{24}","PT":"\\d{21}","RO":"[A-Z]{4}[\\dA-Z]{16}","SM":"[A-Z]\\d{10}[\\dA-Z]{12}","SA":"\\d{2}[\\dA-Z]{18}","RS":"\\d{18}","SK":"\\d{20}","SI":"\\d{15}","ES":"\\d{20}","SE":"\\d{20}","CH":"\\d{5}[\\dA-Z]{12}","TN":"\\d{20}","TR":"\\d{5}[\\dA-Z]{17}","AE":"\\d{3}\\d{16}","GB":"[A-Z]{4}\\d{14}","VG":"[\\dA-Z]{4}\\d{16}"},f=e[d];if("undefined"!=typeof f){var g=new RegExp("^[A-Z]{2}\\d{2}"+f+"$","");if(!g.test(c))return!1}for(var h,i=c.substring(4,c.length)+c.substring(0,4),j="",k=!0,l=0;l<i.length;l++)h=i.charAt(l),"0"!==h&&(k=!1),k||(j+="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".indexOf(h));for(var m="",n="",o=0;o<j.length;o++){var p=j.charAt(o);n=""+m+p,m=n%97}return 1===m},"Please specify a valid IBAN"),jQuery.validator.addMethod("dateNL",function(a,b){return this.optional(b)||/^(0?[1-9]|[12]\d|3[01])[\.\/\-](0?[1-9]|1[012])[\.\/\-]([12]\d)?(\d\d)$/.test(a)},"Please enter a correct date"),jQuery.validator.addMethod("phoneNL",function(a,b){return this.optional(b)||/^((\+|00(\s|\s?\-\s?)?)31(\s|\s?\-\s?)?(\(0\)[\-\s]?)?|0)[1-9]((\s|\s?\-\s?)?[0-9]){8}$/.test(a)},"Please specify a valid phone number."),jQuery.validator.addMethod("mobileNL",function(a,b){return this.optional(b)||/^((\+|00(\s|\s?\-\s?)?)31(\s|\s?\-\s?)?(\(0\)[\-\s]?)?|0)6((\s|\s?\-\s?)?[0-9]){8}$/.test(a)},"Please specify a valid mobile number"),jQuery.validator.addMethod("postalcodeNL",function(a,b){return this.optional(b)||/^[1-9][0-9]{3}\s?[a-zA-Z]{2}$/.test(a)},"Please specify a valid postal code"),jQuery.validator.addMethod("bankaccountNL",function(a,b){if(this.optional(b))return!0;if(!/^[0-9]{9}|([0-9]{2} ){3}[0-9]{3}$/.test(a))return!1;for(var c=a.replace(/ /g,""),d=0,e=c.length,f=0;e>f;f++){var g=e-f,h=c.substring(f,f+1);d+=g*h}return d%11===0},"Please specify a valid bank account number"),jQuery.validator.addMethod("giroaccountNL",function(a,b){return this.optional(b)||/^[0-9]{1,7}$/.test(a)},"Please specify a valid giro account number"),jQuery.validator.addMethod("bankorgiroaccountNL",function(a,b){return this.optional(b)||$.validator.methods.bankaccountNL.call(this,a,b)||$.validator.methods.giroaccountNL.call(this,a,b)},"Please specify a valid bank or giro account number"),jQuery.validator.addMethod("time",function(a,b){return this.optional(b)||/^([01]\d|2[0-3])(:[0-5]\d){1,2}$/.test(a)},"Please enter a valid time, between 00:00 and 23:59"),jQuery.validator.addMethod("time12h",function(a,b){return this.optional(b)||/^((0?[1-9]|1[012])(:[0-5]\d){1,2}(\ ?[AP]M))$/i.test(a)},"Please enter a valid time in 12-hour am/pm format"),jQuery.validator.addMethod("phoneUS",function(a,b){return a=a.replace(/\s+/g,""),this.optional(b)||a.length>9&&a.match(/^(\+?1-?)?(\([2-9]\d{2}\)|[2-9]\d{2})-?[2-9]\d{2}-?\d{4}$/)},"Please specify a valid phone number"),jQuery.validator.addMethod("phoneUK",function(a,b){return a=a.replace(/\(|\)|\s+|-/g,""),this.optional(b)||a.length>9&&a.match(/^(?:(?:(?:00\s?|\+)44\s?)|(?:\(?0))(?:\d{2}\)?\s?\d{4}\s?\d{4}|\d{3}\)?\s?\d{3}\s?\d{3,4}|\d{4}\)?\s?(?:\d{5}|\d{3}\s?\d{3})|\d{5}\)?\s?\d{4,5})$/)},"Please specify a valid phone number"),jQuery.validator.addMethod("mobileUK",function(a,b){return a=a.replace(/\(|\)|\s+|-/g,""),this.optional(b)||a.length>9&&a.match(/^(?:(?:(?:00\s?|\+)44\s?|0)7(?:[45789]\d{2}|624)\s?\d{3}\s?\d{3})$/)},"Please specify a valid mobile number"),jQuery.validator.addMethod("phonesUK",function(a,b){return a=a.replace(/\(|\)|\s+|-/g,""),this.optional(b)||a.length>9&&a.match(/^(?:(?:(?:00\s?|\+)44\s?|0)(?:1\d{8,9}|[23]\d{9}|7(?:[45789]\d{8}|624\d{6})))$/)},"Please specify a valid uk phone number"),jQuery.validator.addMethod("postcodeUK",function(a,b){return this.optional(b)||/^((([A-PR-UWYZ][0-9])|([A-PR-UWYZ][0-9][0-9])|([A-PR-UWYZ][A-HK-Y][0-9])|([A-PR-UWYZ][A-HK-Y][0-9][0-9])|([A-PR-UWYZ][0-9][A-HJKSTUW])|([A-PR-UWYZ][A-HK-Y][0-9][ABEHMNPRVWXY]))\s?([0-9][ABD-HJLNP-UW-Z]{2})|(GIR)\s?(0AA))$/i.test(a)},"Please specify a valid UK postcode"),jQuery.validator.addMethod("strippedminlength",function(a,b,c){return jQuery(a).text().length>=c},jQuery.validator.format("Please enter at least {0} characters")),jQuery.validator.addMethod("email2",function(a,b){return this.optional(b)||/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)*(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test(a)},jQuery.validator.messages.email),jQuery.validator.addMethod("url2",function(a,b){return this.optional(b)||/^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)*(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(a)},jQuery.validator.messages.url),jQuery.validator.addMethod("creditcardtypes",function(a,b,c){if(/[^0-9\-]+/.test(a))return!1;
|
|
a=a.replace(/\D/g,"");var d=0;return c.mastercard&&(d|=1),c.visa&&(d|=2),c.amex&&(d|=4),c.dinersclub&&(d|=8),c.enroute&&(d|=16),c.discover&&(d|=32),c.jcb&&(d|=64),c.unknown&&(d|=128),c.all&&(d=255),1&d&&/^(5[12345])/.test(a)?16===a.length:2&d&&/^(4)/.test(a)?16===a.length:4&d&&/^(3[47])/.test(a)?15===a.length:8&d&&/^(3(0[012345]|[68]))/.test(a)?14===a.length:16&d&&/^(2(014|149))/.test(a)?15===a.length:32&d&&/^(6011)/.test(a)?16===a.length:64&d&&/^(3)/.test(a)?16===a.length:64&d&&/^(2131|1800)/.test(a)?15===a.length:128&d?!0:!1},"Please enter a valid credit card number."),jQuery.validator.addMethod("ipv4",function(a,b){return this.optional(b)||/^(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)$/i.test(a)},"Please enter a valid IP v4 address."),jQuery.validator.addMethod("ipv6",function(a,b){return this.optional(b)||/^((([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}:([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){4}:([0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){3}:([0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){2}:([0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(([0-9A-Fa-f]{1,4}:){0,5}:((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(::([0-9A-Fa-f]{1,4}:){0,5}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|([0-9A-Fa-f]{1,4}::([0-9A-Fa-f]{1,4}:){0,5}[0-9A-Fa-f]{1,4})|(::([0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:))$/i.test(a)},"Please enter a valid IP v6 address."),jQuery.validator.addMethod("pattern",function(a,b,c){return this.optional(b)?!0:("string"==typeof c&&(c=new RegExp("^(?:"+c+")$")),c.test(a))},"Invalid format."),jQuery.validator.addMethod("require_from_group",function(a,b,c){var d=this,e=c[1],f=$(e,b.form).filter(function(){return d.elementValue(this)}).length>=c[0];if(!$(b).data("being_validated")){var g=$(e,b.form);g.data("being_validated",!0),g.valid(),$(b.form).valid(),g.data("being_validated",!1)}return f},jQuery.format("Please fill at least {0} of these fields.")),jQuery.validator.addMethod("skip_or_fill_minimum",function(a,b,c){var d=this,e=c[0],f=c[1],g=$(f,b.form).filter(function(){return d.elementValue(this)}).length,h=g>=e||0===g;if(!$(b).data("being_validated")){var i=$(f,b.form);i.data("being_validated",!0),i.valid(),i.data("being_validated",!1)}return h},jQuery.format("Please either skip these fields or fill at least {0} of them.")),jQuery.validator.addMethod("accept",function(a,b,c){var d,e,f="string"==typeof c?c.replace(/\s/g,"").replace(/,/g,"|"):"image/*",g=this.optional(b);if(g)return g;if("file"===$(b).attr("type")&&(f=f.replace(/\*/g,".*"),b.files&&b.files.length))for(d=0;d<b.files.length;d++)if(e=b.files[d],!e.type.match(new RegExp(".?("+f+")$","i")))return!1;return!0},jQuery.format("Please enter a value with a valid mimetype.")),jQuery.validator.addMethod("extension",function(a,b,c){return c="string"==typeof c?c.replace(/,/g,"|"):"png|jpe?g|gif",this.optional(b)||a.match(new RegExp(".("+c+")$","i"))},jQuery.format("Please enter a value with a valid extension.")),function(a,b,c){!function(a){"use strict";"function"==typeof define&&define.amd?define("datatables",["jquery"],a):jQuery&&!jQuery.fn.dataTable&&a(jQuery)}(function(d){"use strict";function e(a){var b,c,f="a aa ai ao as b fn i m o s ",g={};d.each(a,function(d){b=d.match(/^([^A-Z]+?)([A-Z])/),b&&-1!==f.indexOf(b[1]+" ")&&(c=d.replace(b[0],b[2].toLowerCase()),g[c]=d,"o"===b[1]&&e(a[d]))}),a._hungarianMap=g}function f(a,b,g){a._hungarianMap||e(a);var h;d.each(b,function(d){h=a._hungarianMap[d],h===c||!g&&b[h]!==c||(b[h]=b[d],"o"===h.charAt(0)&&f(a[h],b[d]))})}function g(a){var b=Ub.defaults.oLanguage,c=a.sZeroRecords;!a.sEmptyTable&&c&&"No data available in table"===b.sEmptyTable&&Jb(a,a,"sZeroRecords","sEmptyTable"),!a.sLoadingRecords&&c&&"Loading..."===b.sLoadingRecords&&Jb(a,a,"sZeroRecords","sLoadingRecords"),a.sInfoThousands&&(a.sThousands=a.sInfoThousands);var d=a.sDecimal;d&&Sb(d)}function h(a){oc(a,"ordering","bSort"),oc(a,"orderMulti","bSortMulti"),oc(a,"orderClasses","bSortClasses"),oc(a,"orderCellsTop","bSortCellsTop"),oc(a,"order","aaSorting"),oc(a,"orderFixed","aaSortingFixed"),oc(a,"paging","bPaginate"),oc(a,"pagingType","sPaginationType"),oc(a,"pageLength","iDisplayLength"),oc(a,"searching","bFilter")}function i(a){oc(a,"orderable","bSortable"),oc(a,"orderData","aDataSort"),oc(a,"orderSequence","asSorting"),oc(a,"orderDataType","sortDataType")}function j(a){var b=a.oBrowser,c=d("<div/>").css({"position":"absolute","top":0,"left":0,"height":1,"width":1,"overflow":"hidden"}).append(d("<div/>").css({"position":"absolute","top":1,"left":1,"width":100,"overflow":"scroll"}).append(d('<div class="test"/>').css({"width":"100%","height":10}))).appendTo("body"),e=c.find(".test");b.bScrollOversize=100===e[0].offsetWidth,b.bScrollbarLeft=1!==e.offset().left,c.remove()}function k(a,e){var f=Ub.defaults.column,g=a.aoColumns.length,h=d.extend({},Ub.models.oColumn,f,{"sSortingClass":a.oClasses.sSortable,"sSortingClassJUI":a.oClasses.sSortJUI,"nTh":e?e:b.createElement("th"),"sTitle":f.sTitle?f.sTitle:e?e.innerHTML:"","aDataSort":f.aDataSort?f.aDataSort:[g],"mData":f.mData?f.mData:g,"idx":g});if(a.aoColumns.push(h),a.aoPreSearchCols[g]===c||null===a.aoPreSearchCols[g])a.aoPreSearchCols[g]=d.extend(!0,{},Ub.models.oSearch);else{var i=a.aoPreSearchCols[g];i.bRegex===c&&(i.bRegex=!0),i.bSmart===c&&(i.bSmart=!0),i.bCaseInsensitive===c&&(i.bCaseInsensitive=!0)}l(a,g,null)}function l(a,b,e){var g=a.aoColumns[b],h=a.oClasses;if(!g.sWidthOrig){var j=d(g.nTh);g.sWidthOrig=j.attr("width")||null;var k=(j.attr("style")||"").match(/width:\s*(\d+[pxem%])/);k&&(g.sWidthOrig=k[1])}e!==c&&null!==e&&(i(e),f(Ub.defaults.column,e),e.mDataProp===c||e.mData||(e.mData=e.mDataProp),g._sManualType=e.sType,e.className&&!e.sClass&&(e.sClass=e.className),d.extend(g,e),Jb(g,e,"sWidth","sWidthOrig"),"number"==typeof e.iDataSort&&(g.aDataSort=[e.iDataSort]),Jb(g,e,"aDataSort"));var l=g.mData,m=B(l),n=g.mRender?B(g.mRender):null,o=function(a){return"string"==typeof a&&-1!==a.indexOf("@")};g._bAttrSrc=d.isPlainObject(l)&&(o(l.sort)||o(l.type)||o(l.filter)),g.fnGetData=function(a,b){var c=m(a,b);return g.mRender&&b&&""!==b?n(c,b,a):c},g.fnSetData=C(l),a.oFeatures.bSort||(g.bSortable=!1);var p=-1!==d.inArray("asc",g.asSorting),q=-1!==d.inArray("desc",g.asSorting);g.bSortable&&(p||q)?p&&!q?(g.sSortingClass=h.sSortableAsc,g.sSortingClassJUI=h.sSortJUIAscAllowed):!p&&q&&(g.sSortingClass=h.sSortableDesc,g.sSortingClassJUI=h.sSortJUIDescAllowed):(g.sSortingClass=h.sSortableNone,g.sSortingClassJUI="")}function m(a){if(a.oFeatures.bAutoWidth!==!1){var b=a.aoColumns;qb(a);for(var c=0,d=b.length;d>c;c++)b[c].nTh.style.width=b[c].sWidth}var e=a.oScroll;(""!==e.sY||""!==e.sX)&&ob(a),Nb(a,null,"column-sizing",[a])}function n(a,b){var c=q(a,"bVisible");return"number"==typeof c[b]?c[b]:null}function o(a,b){var c=q(a,"bVisible"),e=d.inArray(b,c);return-1!==e?e:null}function p(a){return q(a,"bVisible").length}function q(a,b){var c=[];return d.map(a.aoColumns,function(a,d){a[b]&&c.push(d)}),c}function r(a){var b,d,e,f,g,h,i,j,k,l=a.aoColumns,m=a.aoData,n=Ub.ext.type.detect;for(b=0,d=l.length;d>b;b++)if(i=l[b],k=[],!i.sType&&i._sManualType)i.sType=i._sManualType;else if(!i.sType){for(e=0,f=n.length;f>e;e++){for(g=0,h=m.length;h>g&&(k[g]===c&&(k[g]=y(a,g,b,"type")),j=n[e](k[g],a),j&&"html"!==j);g++);if(j){i.sType=j;break}}i.sType||(i.sType="string")}}function s(a,b,e,f){var g,h,i,j,l,m,n;if(b)for(g=b.length-1;g>=0;g--){n=b[g];var o=n.targets!==c?n.targets:n.aTargets;for(d.isArray(o)||(o=[o]),i=0,j=o.length;j>i;i++)if("number"==typeof o[i]&&o[i]>=0){for(;a.aoColumns.length<=o[i];)k(a);f(o[i],n)}else if("number"==typeof o[i]&&o[i]<0)f(a.aoColumns.length+o[i],n);else if("string"==typeof o[i])for(l=0,m=a.aoColumns.length;m>l;l++)("_all"==o[i]||d(a.aoColumns[l].nTh).hasClass(o[i]))&&f(l,n)}if(e)for(g=0,h=e.length;h>g;g++)f(g,e[g])}function t(a,b,c,e){var f=a.aoData.length,g=d.extend(!0,{},Ub.models.oRow,{"src":c?"dom":"data"});g._aData=b,a.aoData.push(g);for(var h=a.aoColumns,i=0,j=h.length;j>i;i++)c&&z(a,f,i,y(a,f,i)),h[i].sType=null;return a.aiDisplayMaster.push(f),a.oFeatures.bDeferRender||I(a,f,c,e),f}function u(a,b){var c;return b instanceof d||(b=d(b)),b.map(function(b,d){return c=H(a,d),t(a,c.data,d,c.cells)})}function v(a,b){return b._DT_RowIndex!==c?b._DT_RowIndex:null}function w(a,b,c){return d.inArray(c,a.aoData[b].anCells)}function x(a,b,c,d){for(var e=[],f=0,g=d.length;g>f;f++)e.push(y(a,b,d[f],c));return e}function y(a,b,d,e){var f=a.aoColumns[d],g=a.aoData[b]._aData,h=f.fnGetData(g,e);if(h===c)return a.iDrawError!=a.iDraw&&null===f.sDefaultContent&&(Ib(a,0,"Requested unknown parameter "+("function"==typeof f.mData?"{function}":"'"+f.mData+"'")+" for row "+b,4),a.iDrawError=a.iDraw),f.sDefaultContent;if(h!==g&&null!==h||null===f.sDefaultContent){if("function"==typeof h)return h()}else h=f.sDefaultContent;return null===h&&"display"==e?"":h}function z(a,b,c,d){var e=a.aoColumns[c],f=a.aoData[b]._aData;e.fnSetData(f,d)}function A(a){return d.map(a.match(/(\\.|[^\.])+/g),function(a){return a.replace("\\.",".")})}function B(a){if(d.isPlainObject(a)){var b={};return d.each(a,function(a,c){c&&(b[a]=B(c))}),function(a,d,e){return b[b[d]!==c?d:"_"](a,d,e)}}if(null===a)return function(a){return a};if("function"==typeof a)return function(b,c,d){return a(b,c,d)};if("string"!=typeof a||-1===a.indexOf(".")&&-1===a.indexOf("[")&&-1===a.indexOf("("))return function(b){return b[a]};var e=function(a,b,d){var f,g,h,i;if(""!==d)for(var j=A(d),k=0,l=j.length;l>k;k++){if(f=j[k].match(pc),g=j[k].match(qc),f){j[k]=j[k].replace(pc,""),""!==j[k]&&(a=a[j[k]]),h=[],j.splice(0,k+1),i=j.join(".");for(var m=0,n=a.length;n>m;m++)h.push(e(a[m],b,i));var o=f[0].substring(1,f[0].length-1);a=""===o?h:h.join(o);break}if(g)j[k]=j[k].replace(qc,""),a=a[j[k]]();else{if(null===a||a[j[k]]===c)return c;a=a[j[k]]}}return a};return function(b,c){return e(b,c,a)}}function C(a){if(d.isPlainObject(a))return C(a._);if(null===a)return function(){};if("function"==typeof a)return function(b,c){a(b,"set",c)};if("string"!=typeof a||-1===a.indexOf(".")&&-1===a.indexOf("[")&&-1===a.indexOf("("))return function(b,c){b[a]=c};var b=function(a,d,e){for(var f,g,h,i,j,k=A(e),l=k[k.length-1],m=0,n=k.length-1;n>m;m++){if(g=k[m].match(pc),h=k[m].match(qc),g){k[m]=k[m].replace(pc,""),a[k[m]]=[],f=k.slice(),f.splice(0,m+1),j=f.join(".");for(var o=0,p=d.length;p>o;o++)i={},b(i,d[o],j),a[k[m]].push(i);return}h&&(k[m]=k[m].replace(qc,""),a=a[k[m]](d)),(null===a[k[m]]||a[k[m]]===c)&&(a[k[m]]={}),a=a[k[m]]}l.match(qc)?a=a[l.replace(qc,"")](d):a[l.replace(pc,"")]=d};return function(c,d){return b(c,d,a)}}function D(a){return jc(a.aoData,"_aData")}function E(a){a.aoData.length=0,a.aiDisplayMaster.length=0,a.aiDisplay.length=0}function F(a,b,d){for(var e=-1,f=0,g=a.length;g>f;f++)a[f]==b?e=f:a[f]>b&&a[f]--;-1!=e&&d===c&&a.splice(e,1)}function G(a,b,d,e){var f,g,h=a.aoData[b];if("dom"!==d&&(d&&"auto"!==d||"dom"!==h.src)){var i=h.anCells;for(f=0,g=i.length;g>f;f++)i[f].innerHTML=y(a,b,f,"display")}else h._aData=H(a,h.nTr).data;h._aSortData=null,h._aFilterData=null;var j=a.aoColumns;if(e!==c)j[e].sType=null;else for(f=0,g=j.length;g>f;f++)j[f].sType=null;J(h)}function H(a,b){for(var c,e,f,g,h=[],i=[],j=b.firstChild,k=0,l=a.aoColumns,m=function(a,b,c){if("string"==typeof a){var d=a.indexOf("@");if(-1!==d){var e=a.substring(d+1);f["@"+e]=c.getAttribute(e)}}};j;)c=j.nodeName.toUpperCase(),("TD"==c||"TH"==c)&&(e=l[k],g=d.trim(j.innerHTML),e&&e._bAttrSrc?(f={"display":g},m(e.mData.sort,f,j),m(e.mData.type,f,j),m(e.mData.filter,f,j),h.push(f)):h.push(g),i.push(j),k++),j=j.nextSibling;return{"data":h,"cells":i}}function I(a,c,d,e){var f,g,h,i,j,k=a.aoData[c],l=k._aData,m=[];if(null===k.nTr){for(f=d||b.createElement("tr"),k.nTr=f,k.anCells=m,f._DT_RowIndex=c,J(k),i=0,j=a.aoColumns.length;j>i;i++)h=a.aoColumns[i],g=d?e[i]:b.createElement(h.sCellType),m.push(g),(!d||h.mRender||h.mData!==i)&&(g.innerHTML=y(a,c,i,"display")),h.sClass&&(g.className+=" "+h.sClass),h.bVisible&&!d?f.appendChild(g):!h.bVisible&&d&&g.parentNode.removeChild(g),h.fnCreatedCell&&h.fnCreatedCell.call(a.oInstance,g,y(a,c,i,"display"),l,c,i);Nb(a,"aoRowCreatedCallback",null,[f,l,c])}}function J(a){var b=a.nTr,c=a._aData;if(b){if(c.DT_RowId&&(b.id=c.DT_RowId),c.DT_RowClass){var e=c.DT_RowClass.split(" ");a.__rowc=a.__rowc?nc(a.__rowc.concat(e)):e,d(b).removeClass(a.__rowc.join(" ")).addClass(c.DT_RowClass)}c.DT_RowData&&d(b).data(c.DT_RowData)}}function K(a){var b,c,e,f,g,h=a.nTHead,i=a.nTFoot,j=0===d("th, td",h).length,k=a.oClasses,l=a.aoColumns;for(j&&(f=d("<tr/>").appendTo(h)),b=0,c=l.length;c>b;b++)g=l[b],e=d(g.nTh).addClass(g.sClass),j&&e.appendTo(f),a.oFeatures.bSort&&(e.addClass(g.sSortingClass),g.bSortable!==!1&&(e.attr("tabindex",a.iTabIndex).attr("aria-controls",a.sTableId),Cb(a,g.nTh,b))),g.sTitle!=e.html()&&e.html(g.sTitle),Pb(a,"header")(a,e,g,k);if(j&&P(a.aoHeader,h),d(h).find(">tr").attr("role","row"),d(h).find(">tr>th, >tr>td").addClass(k.sHeaderTH),d(i).find(">tr>th, >tr>td").addClass(k.sFooterTH),null!==i){var m=a.aoFooter[0];for(b=0,c=m.length;c>b;b++)g=l[b],g.nTf=m[b].cell,g.sClass&&d(g.nTf).addClass(g.sClass)}}function L(a,b,e){var f,g,h,i,j,k,l,m,n,o=[],p=[],q=a.aoColumns.length;if(b){for(e===c&&(e=!1),f=0,g=b.length;g>f;f++){for(o[f]=b[f].slice(),o[f].nTr=b[f].nTr,h=q-1;h>=0;h--)a.aoColumns[h].bVisible||e||o[f].splice(h,1);p.push([])}for(f=0,g=o.length;g>f;f++){if(l=o[f].nTr)for(;k=l.firstChild;)l.removeChild(k);for(h=0,i=o[f].length;i>h;h++)if(m=1,n=1,p[f][h]===c){for(l.appendChild(o[f][h].cell),p[f][h]=1;o[f+m]!==c&&o[f][h].cell==o[f+m][h].cell;)p[f+m][h]=1,m++;for(;o[f][h+n]!==c&&o[f][h].cell==o[f][h+n].cell;){for(j=0;m>j;j++)p[f+j][h+n]=1;n++}d(o[f][h].cell).attr("rowspan",m).attr("colspan",n)}}}}function M(a){var b=Nb(a,"aoPreDrawCallback","preDraw",[a]);if(-1!==d.inArray(!1,b))return void mb(a,!1);var e=[],f=0,g=a.asStripeClasses,h=g.length,i=(a.aoOpenRows.length,a.oLanguage),j=a.iInitDisplayStart,k="ssp"==Qb(a),l=a.aiDisplay;a.bDrawing=!0,j!==c&&-1!==j&&(a._iDisplayStart=k?j:j>=a.fnRecordsDisplay()?0:j,a.iInitDisplayStart=-1);var m=a._iDisplayStart,n=a.fnDisplayEnd();if(a.bDeferLoading)a.bDeferLoading=!1,a.iDraw++,mb(a,!1);else if(k){if(!a.bDestroying&&!S(a))return}else a.iDraw++;if(0!==l.length)for(var o=k?0:m,q=k?a.aoData.length:n,r=o;q>r;r++){var s=l[r],t=a.aoData[s];null===t.nTr&&I(a,s);var u=t.nTr;if(0!==h){var v=g[f%h];t._sRowStripe!=v&&(d(u).removeClass(t._sRowStripe).addClass(v),t._sRowStripe=v)}Nb(a,"aoRowCallback",null,[u,t._aData,f,r]),e.push(u),f++}else{var w=i.sZeroRecords;1==a.iDraw&&"ajax"==Qb(a)?w=i.sLoadingRecords:i.sEmptyTable&&0===a.fnRecordsTotal()&&(w=i.sEmptyTable),e[0]=d("<tr/>",{"class":h?g[0]:""}).append(d("<td />",{"valign":"top","colSpan":p(a),"class":a.oClasses.sRowEmpty}).html(w))[0]}Nb(a,"aoHeaderCallback","header",[d(a.nTHead).children("tr")[0],D(a),m,n,l]),Nb(a,"aoFooterCallback","footer",[d(a.nTFoot).children("tr")[0],D(a),m,n,l]);var x=d(a.nTBody);x.children().detach(),x.append(d(e)),Nb(a,"aoDrawCallback","draw",[a]),a.bSorted=!1,a.bFiltered=!1,a.bDrawing=!1}function N(a,b){var c=a.oFeatures,d=c.bSort,e=c.bFilter;d&&zb(a),e?X(a,a.oPreviousSearch):a.aiDisplay=a.aiDisplayMaster.slice(),b!==!0&&(a._iDisplayStart=0),M(a)}function O(a){var b=a.oClasses,c=d(a.nTable),e=d("<div/>").insertBefore(c),f=a.oFeatures,g=d("<div/>",{"role":"grid","id":a.sTableId+"_wrapper","class":b.sWrapper+(a.nTFoot?"":" "+b.sNoFooter)});a.nTableWrapper=g[0],a.nTableReinsertBefore=a.nTable.nextSibling;for(var h,i,j,k,l,m,n=a.sDom.split(""),o=0;o<n.length;o++){if(h=null,i=n[o],"<"==i){if(j=d("<div/>")[0],k=n[o+1],"'"==k||'"'==k){for(l="",m=2;n[o+m]!=k;)l+=n[o+m],m++;if("H"==l?l=b.sJUIHeader:"F"==l&&(l=b.sJUIFooter),-1!=l.indexOf(".")){var p=l.split(".");j.id=p[0].substr(1,p[0].length-1),j.className=p[1]}else"#"==l.charAt(0)?j.id=l.substr(1,l.length-1):j.className=l;o+=m}g.append(j),g=d(j)}else if(">"==i)g=g.parent();else if("l"==i&&f.bPaginate&&f.bLengthChange)h=ib(a);else if("f"==i&&f.bFilter)h=W(a);else if("r"==i&&f.bProcessing)h=lb(a);else if("t"==i)h=nb(a);else if("i"==i&&f.bInfo)h=cb(a);else if("p"==i&&f.bPaginate)h=jb(a);else if(0!==Ub.ext.feature.length)for(var q=Ub.ext.feature,r=0,s=q.length;s>r;r++)if(i==q[r].cFeature){h=q[r].fnInit(a);break}if(h){var t=a.aanFeatures;t[i]||(t[i]=[]),t[i].push(h),g.append(h)}}e.replaceWith(g)}function P(a,b){var c,e,f,g,h,i,j,k,l,m,n,o=d(b).children("tr"),p=function(a,b,c){for(var d=a[b];d[c];)c++;return c};for(a.splice(0,a.length),f=0,i=o.length;i>f;f++)a.push([]);for(f=0,i=o.length;i>f;f++)for(c=o[f],k=0,e=c.firstChild;e;){if("TD"==e.nodeName.toUpperCase()||"TH"==e.nodeName.toUpperCase())for(l=1*e.getAttribute("colspan"),m=1*e.getAttribute("rowspan"),l=l&&0!==l&&1!==l?l:1,m=m&&0!==m&&1!==m?m:1,j=p(a,f,k),n=1===l?!0:!1,h=0;l>h;h++)for(g=0;m>g;g++)a[f+g][j+h]={"cell":e,"unique":n},a[f+g].nTr=c;e=e.nextSibling}}function Q(a,b,c){var d=[];c||(c=a.aoHeader,b&&(c=[],P(c,b)));for(var e=0,f=c.length;f>e;e++)for(var g=0,h=c[e].length;h>g;g++)!c[e][g].unique||d[g]&&a.bSortCellsTop||(d[g]=c[e][g].cell);return d}function R(a,b,c){if(Nb(a,"aoServerParams","serverParams",[b]),b&&b.__legacy){var e={},f=/(.*?)\[\]$/;d.each(b,function(a,b){var c=b.name.match(f);if(c){var d=c[0];e[d]||(e[d]=[]),e[d].push(b.value)}else e[b.name]=b.value}),b=e}var g,h=a.ajax,i=a.oInstance;if(d.isPlainObject(h)&&h.data){g=h.data;var j=d.isFunction(g)?g(b):g;b=d.isFunction(g)&&j?j:d.extend(!0,b,j),delete h.data}var k={"data":b,"success":function(b){var d=b.error||b.sError;d&&a.oApi._fnLog(a,0,d),a.json=b,Nb(a,null,"xhr",[a,b]),c(b)},"dataType":"json","cache":!1,"type":a.sServerMethod,"error":function(b,c){var d=a.oApi._fnLog;"parsererror"==c?d(a,0,"Invalid JSON response",1):d(a,0,"Ajax error",7)}};a.fnServerData?a.fnServerData.call(i,a.sAjaxSource,b,c,a):a.sAjaxSource||"string"==typeof h?a.jqXHR=d.ajax(d.extend(k,{"url":h||a.sAjaxSource})):d.isFunction(h)?a.jqXHR=h.call(i,b,c,a):(a.jqXHR=d.ajax(d.extend(k,h)),h.data=g)}function S(a){if(a.bAjaxDataGet){a.iDraw++,mb(a,!0);var b=(a.aoColumns.length,T(a));return R(a,b,function(b){U(a,b)},a),!1}return!0}function T(a){var b,c,e,f,g=a.aoColumns,h=g.length,i=a.oFeatures,j=a.oPreviousSearch,k=a.aoPreSearchCols,l=[],m=yb(a),n=a._iDisplayStart,o=i.bPaginate!==!1?a._iDisplayLength:-1,p=function(a,b){l.push({"name":a,"value":b})};p("sEcho",a.iDraw),p("iColumns",h),p("sColumns",jc(g,"sName").join(",")),p("iDisplayStart",n),p("iDisplayLength",o);var q={"draw":a.iDraw,"columns":[],"order":[],"start":n,"length":o,"search":{"value":j.sSearch,"regex":j.bRegex}};for(b=0;h>b;b++)e=g[b],f=k[b],c="function"==typeof e.mData?"function":e.mData,q.columns.push({"data":c,"name":e.sName,"searchable":e.bSearchable,"orderable":e.bSortable,"search":{"value":f.sSearch,"regex":f.bRegex}}),p("mDataProp_"+b,c),i.bFilter&&(p("sSearch_"+b,f.sSearch),p("bRegex_"+b,f.bRegex),p("bSearchable_"+b,e.bSearchable)),i.bSort&&p("bSortable_"+b,e.bSortable);d.each(m,function(a,b){q.order.push({"column":b.col,"dir":b.dir}),p("iSortCol_"+a,b.col),p("sSortDir_"+a,b.dir)}),i.bFilter&&(p("sSearch",j.sSearch),p("bRegex",j.bRegex)),i.bSort&&p("iSortingCols",m.length),l.__legacy=!0;var r=Ub.ext.legacy.ajax;return null===r?a.sAjaxSource?l:q:r?l:q}function U(a,b){var d=function(a,d){return b[a]!==c?b[a]:b[d]},e=d("sEcho","draw"),f=d("iTotalRecords","recordsTotal"),g=d("iTotalDisplayRecords","recordsFiltered");if(e){if(1*e<a.iDraw)return;a.iDraw=1*e}E(a),a._iRecordsTotal=parseInt(f,10),a._iRecordsDisplay=parseInt(g,10);for(var h=V(a,b),i=0,j=h.length;j>i;i++)t(a,h[i]);a.aiDisplay=a.aiDisplayMaster.slice(),a.bAjaxDataGet=!1,M(a),a._bInitComplete||gb(a,b),a.bAjaxDataGet=!0,mb(a,!1)}function V(a,b){var e=d.isPlainObject(a.ajax)&&a.ajax.dataSrc!==c?a.ajax.dataSrc:a.sAjaxDataProp;return"data"===e?b.aaData||b[e]:""!==e?B(e)(b):b}function W(a){var c=a.oClasses,e=a.sTableId,f=a.oPreviousSearch,g=a.aanFeatures,h='<input type="search" class="'+c.sFilterInput+'"/>',i=a.oLanguage.sSearch;i=i.match(/_INPUT_/)?i.replace("_INPUT_",h):i+h;var j=d("<div/>",{"id":g.f?null:e+"_filter","class":c.sFilter}).append(d("<label/>").append(i)),k=function(){var b=(g.f,this.value?this.value:"");b!=f.sSearch&&(X(a,{"sSearch":b,"bRegex":f.bRegex,"bSmart":f.bSmart,"bCaseInsensitive":f.bCaseInsensitive}),a._iDisplayStart=0,M(a))},l=d('input[type="search"]',j).val(f.sSearch.replace('"',""")).bind("keyup.DT search.DT input.DT paste.DT cut.DT","ssp"===Qb(a)?rb(k,400):k).bind("keypress.DT",function(a){return 13==a.keyCode?!1:void 0}).attr("aria-controls",e);return d(a.nTable).on("filter.DT",function(){try{l[0]!==b.activeElement&&l.val(f.sSearch)}catch(a){}}),j[0]}function X(a,b,c){var d=a.oPreviousSearch,e=a.aoPreSearchCols,f=function(a){d.sSearch=a.sSearch,d.bRegex=a.bRegex,d.bSmart=a.bSmart,d.bCaseInsensitive=a.bCaseInsensitive};if(r(a),"ssp"!=Qb(a)){$(a,b.sSearch,c,b.bRegex,b.bSmart,b.bCaseInsensitive),f(b);for(var g=0;g<e.length;g++)Z(a,e[g].sSearch,g,e[g].bRegex,e[g].bSmart,e[g].bCaseInsensitive);Y(a)}else f(b);a.bFiltered=!0,Nb(a,null,"search",[a])}function Y(a){for(var b=Ub.ext.search,c=q(a,"bSearchable"),d=0,e=b.length;e>d;d++)for(var f=0,g=0,h=a.aiDisplay.length;h>g;g++){var i=a.aiDisplay[g-f],j=b[d](a,x(a,i,"filter",c),i);j||(a.aiDisplay.splice(g-f,1),f++)}}function Z(a,b,c,d,e,f){if(""!==b)for(var g,h=a.aiDisplay,i=_(b,d,e,f),j=h.length-1;j>=0;j--)g=a.aoData[h[j]]._aFilterData[c],i.test(g)||h.splice(j,1)}function $(a,b,c,d,e,f){var g,h,i,j=_(b,d,e,f),k=a.oPreviousSearch.sSearch,l=a.aiDisplayMaster;if(0!==Ub.ext.search.length&&(c=!0),h=bb(a),b.length<=0)a.aiDisplay=l.slice();else for((h||c||k.length>b.length||0!==b.indexOf(k)||a.bSorted)&&(a.aiDisplay=l.slice()),g=a.aiDisplay,i=g.length-1;i>=0;i--)j.test(a.aoData[g[i]]._sFilterRow)||g.splice(i,1)}function _(a,b,c,d){var e,f=b?a:ab(a);return c&&(e=f.split(" "),f="^(?=.*?"+e.join(")(?=.*?")+").*$"),new RegExp(f,d?"i":"")}function ab(a){return a.replace(bc,"\\$1")}function bb(a){var b,c,d,e,f,g,h,i,j=a.aoColumns,k=Ub.ext.type.search,l=!1;for(c=0,e=a.aoData.length;e>c;c++)if(i=a.aoData[c],!i._aFilterData){for(g=[],d=0,f=j.length;f>d;d++)b=j[d],b.bSearchable?(h=y(a,c,d,"filter"),h=k[b.sType]?k[b.sType](h):null!==h?h:""):h="",h.indexOf&&-1!==h.indexOf("&")&&(rc.innerHTML=h,h=sc?rc.textContent:rc.innerText,h=h.replace(/[\r\n]/g,"")),g.push(h);i._aFilterData=g,i._sFilterRow=g.join(" "),l=!0}return l}function cb(a){var b=a.sTableId,c=a.aanFeatures.i,e=d("<div/>",{"class":a.oClasses.sInfo,"id":c?null:b+"_info"});return c||(a.aoDrawCallback.push({"fn":db,"sName":"information"}),e.attr("role","alert").attr("aria-live","polite").attr("aria-relevant","all"),d(a.nTable).attr("aria-describedby",b+"_info")),e[0]}function db(a){var b=a.aanFeatures.i;if(0!==b.length){var c=a.oLanguage,e=a._iDisplayStart+1,f=a.fnDisplayEnd(),g=a.fnRecordsTotal(),h=a.fnRecordsDisplay(),i=h?c.sInfo:c.sInfoEmpty;h!==g&&(i+=" "+c.sInfoFiltered),i+=c.sInfoPostFix,i=eb(a,i);var j=c.fnInfoCallback;null!==j&&(i=j.call(a.oInstance,a,e,f,g,h,i)),d(b).html(i)}}function eb(a,b){var c=a.fnFormatNumber,d=a._iDisplayStart+1,e=a._iDisplayLength,f=a.fnRecordsDisplay(),g=-1===e;return b.replace(/_START_/g,c.call(a,d)).replace(/_END_/g,c.call(a,a.fnDisplayEnd())).replace(/_MAX_/g,c.call(a,a.fnRecordsTotal())).replace(/_TOTAL_/g,c.call(a,f)).replace(/_PAGE_/g,c.call(a,g?1:Math.ceil(d/e))).replace(/_PAGES_/g,c.call(a,g?1:Math.ceil(f/e)))}function fb(a){var b,c,d,e=a.iInitDisplayStart,f=a.aoColumns,g=a.oFeatures;if(!a.bInitialised)return void setTimeout(function(){fb(a)},200);for(O(a),K(a),L(a,a.aoHeader),L(a,a.aoFooter),mb(a,!0),g.bAutoWidth&&qb(a),b=0,c=f.length;c>b;b++)d=f[b],d.sWidth&&(d.nTh.style.width=wb(d.sWidth));N(a);var h=Qb(a);"ssp"!=h&&("ajax"==h?R(a,[],function(c){var d=V(a,c);for(b=0;b<d.length;b++)t(a,d[b]);a.iInitDisplayStart=e,N(a),mb(a,!1),gb(a,c)},a):(mb(a,!1),gb(a)))}function gb(a,b){a._bInitComplete=!0,b&&m(a),Nb(a,"aoInitComplete","init",[a,b])}function hb(a,b){var c=parseInt(b,10);a._iDisplayLength=c,Ob(a),Nb(a,null,"length",[a,c])}function ib(a){for(var b=a.oClasses,c=a.sTableId,e=a.aLengthMenu,f=d.isArray(e[0]),g=f?e[0]:e,h=f?e[1]:e,i=d("<select/>",{"name":c+"_length","aria-controls":c,"class":b.sLengthSelect}),j=0,k=g.length;k>j;j++)i[0][j]=new Option(h[j],g[j]);var l=d("<div><label/></div>").addClass(b.sLength);a.aanFeatures.l||(l[0].id=c+"_length");var m=a.oLanguage.sLengthMenu.split(/(_MENU_)/);return l.children().append(m[0]).append(i).append(m[2]),i.val(a._iDisplayLength).bind("change.DT",function(){hb(a,d(this).val()),M(a)}),d(a.nTable).bind("length",function(a,b,c){i.val(c)}),l[0]}function jb(a){var b=a.sPaginationType,c=Ub.ext.pager[b],e="function"==typeof c,f=function(a){M(a)},g=d("<div/>").addClass(a.oClasses.sPaging+b)[0],h=a.aanFeatures;return e||c.fnInit(a,g,f),h.p||(g.id=a.sTableId+"_paginate",a.aoDrawCallback.push({"fn":function(a){if(e){var b,d,g=a._iDisplayStart,i=a._iDisplayLength,j=a.fnRecordsDisplay(),k=-1===i,l=k?0:Math.ceil(g/i),m=k?1:Math.ceil(j/i),n=c(l,m);for(b=0,d=h.p.length;d>b;b++)Pb(a,"pageButton")(a,h.p[b],b,n,l,m)}else c.fnUpdate(a,f)},"sName":"pagination"})),g}function kb(a,b,c){var d=a._iDisplayStart,e=a._iDisplayLength,f=a.fnRecordsDisplay();0===f||-1===e?d=0:"number"==typeof b?(d=b*e,d>f&&(d=0)):"first"==b?d=0:"previous"==b?(d=e>=0?d-e:0,0>d&&(d=0)):"next"==b?f>d+e&&(d+=e):"last"==b?d=Math.floor((f-1)/e)*e:Ib(a,0,"Unknown paging action: "+b,5);var g=a._iDisplayStart!==d;return a._iDisplayStart=d,Nb(a,null,"page",[a]),c&&M(a),g}function lb(a){return d("<div/>",{"id":a.aanFeatures.r?null:a.sTableId+"_processing","class":a.oClasses.sProcessing}).html(a.oLanguage.sProcessing).insertBefore(a.nTable)[0]}function mb(a,b){a.oFeatures.bProcessing&&d(a.aanFeatures.r).css("visibility",b?"visible":"hidden"),Nb(a,null,"processing",[a,b])}function nb(a){var b=a.oScroll;if(""===b.sX&&""===b.sY)return a.nTable;var c=b.sX,e=b.sY,f=a.oClasses,g=d(a.nTable),h=g.children("caption"),i=h.length?h[0]._captionSide:null,j=d(g[0].cloneNode(!1)),k=d(g[0].cloneNode(!1)),l=g.children("tfoot"),m="<div/>",n=function(a){return a?wb(a):null};b.sX&&"100%"===g.attr("width")&&g.removeAttr("width"),l.length||(l=null);var o=d(m,{"class":f.sScrollWrapper}).append(d(m,{"class":f.sScrollHead}).css({"overflow":"hidden","position":"relative","border":0,"width":c?n(c):"100%"}).append(d(m,{"class":f.sScrollHeadInner}).css({"box-sizing":"content-box","width":b.sXInner||"100%"}).append(j.removeAttr("id").css("margin-left",0).append(g.children("thead")))).append("top"===i?h:null)).append(d(m,{"class":f.sScrollBody}).css({"overflow":"auto","height":n(e),"width":n(c)}).append(g));l&&o.append(d(m,{"class":f.sScrollFoot}).css({"overflow":"hidden","border":0,"width":c?n(c):"100%"}).append(d(m,{"class":f.sScrollFootInner}).append(k.removeAttr("id").css("margin-left",0).append(g.children("tfoot")))).append("bottom"===i?h:null));var p=o.children(),q=p[0],r=p[1],s=l?p[2]:null;return c&&d(r).scroll(function(){var a=this.scrollLeft;q.scrollLeft=a,l&&(s.scrollLeft=a)}),a.nScrollHead=q,a.nScrollBody=r,a.nScrollFoot=s,a.aoDrawCallback.push({"fn":ob,"sName":"scrolling"}),o[0]}function ob(a){var b,c,e,f,g,h,i,j,k,l=a.oScroll,m=l.sX,o=l.sXInner,p=l.sY,q=l.iBarWidth,r=d(a.nScrollHead),s=r[0].style,t=r.children("div"),u=t[0].style,v=t.children("table"),w=a.nScrollBody,x=d(w),y=w.style,z=d(a.nScrollFoot),A=z.children("div"),B=A.children("table"),C=d(a.nTHead),D=d(a.nTable),E=D[0],F=E.style,G=a.nTFoot?d(a.nTFoot):null,H=a.oBrowser,I=H.bScrollOversize,J=[],K=[],L=[],M=function(a){var b=a.style;b.paddingTop="0",b.paddingBottom="0",b.borderTopWidth="0",b.borderBottomWidth="0",b.height=0};if(D.children("thead, tfoot").remove(),g=C.clone().prependTo(D),b=C.find("tr"),e=g.find("tr"),g.find("th, td").removeAttr("tabindex"),G&&(h=G.clone().prependTo(D),c=G.find("tr"),f=h.find("tr")),m||(y.width="100%",r[0].style.width="100%"),d.each(Q(a,g),function(b,c){i=n(a,b),c.style.width=a.aoColumns[i].sWidth}),G&&pb(function(a){a.style.width=""},f),l.bCollapse&&""!==p&&(y.height=x.offsetHeight+C[0].offsetHeight+"px"),k=D.outerWidth(),""===m?(F.width="100%",I&&(D.find("tbody").height()>w.offsetHeight||"scroll"==x.css("overflow-y"))&&(F.width=wb(D.outerWidth()-q))):""!==o?F.width=wb(o):k==x.width()&&x.height()<D.height()?(F.width=wb(k-q),D.outerWidth()>k-q&&(F.width=wb(k))):F.width=wb(k),k=D.outerWidth(),pb(M,e),pb(function(a){L.push(a.innerHTML),J.push(wb(d(a).css("width")))},e),pb(function(a,b){a.style.width=J[b]},b),d(e).height(0),G&&(pb(M,f),pb(function(a){K.push(wb(d(a).css("width")))},f),pb(function(a,b){a.style.width=K[b]},c),d(f).height(0)),pb(function(a,b){a.innerHTML='<div class="dataTables_sizing" style="height:0;overflow:hidden;">'+L[b]+"</div>",a.style.width=J[b]},e),G&&pb(function(a,b){a.innerHTML="",a.style.width=K[b]},f),D.outerWidth()<k?(j=w.scrollHeight>w.offsetHeight||"scroll"==x.css("overflow-y")?k+q:k,I&&(w.scrollHeight>w.offsetHeight||"scroll"==x.css("overflow-y"))&&(F.width=wb(j-q)),(""===m||""!==o)&&Ib(a,1,"Possible column misalignment",6)):j="100%",y.width=wb(j),s.width=wb(j),G&&(a.nScrollFoot.style.width=wb(j)),p||I&&(y.height=wb(E.offsetHeight+q)),p&&l.bCollapse){y.height=wb(p);var N=m&&E.offsetWidth>w.offsetWidth?q:0;E.offsetHeight<w.offsetHeight&&(y.height=wb(E.offsetHeight+N))}var O=D.outerWidth();v[0].style.width=wb(O),u.width=wb(O);var P=D.height()>w.clientHeight||"scroll"==x.css("overflow-y"),R="padding"+(H.bScrollbarLeft?"Left":"Right");u[R]=P?q+"px":"0px",G&&(B[0].style.width=wb(O),A[0].style.width=wb(O),A[0].style[R]=P?q+"px":"0px"),x.scroll(),(a.bSorted||a.bFiltered)&&(w.scrollTop=0)}function pb(a,b,c){for(var d,e,f=0,g=0,h=b.length;h>g;){for(d=b[g].firstChild,e=c?c[g].firstChild:null;d;)1===d.nodeType&&(c?a(d,e,f):a(d,f),f++),d=d.nextSibling,e=c?e.nextSibling:null;g++}}function qb(b){var c,e,f,g,h,i=b.nTable,j=b.aoColumns,k=b.oScroll,l=k.sY,n=k.sX,o=k.sXInner,r=j.length,s=q(b,"bVisible"),t=d("th",b.nTHead),u=i.getAttribute("width"),v=i.parentNode,w=!1;for(c=0;c<s.length;c++)e=j[s[c]],null!==e.sWidth&&(e.sWidth=sb(e.sWidthOrig,v),w=!0);if(w||n||l||r!=p(b)||r!=t.length){var x=d(i.cloneNode(!1)).css("visibility","hidden").removeAttr("id").append(d(b.nTHead).clone(!1)).append(d(b.nTFoot).clone(!1)).append(d("<tbody><tr/></tbody>"));x.find("tfoot th, tfoot td").css("width","");var y=x.find("tbody tr");for(t=Q(b,x.find("thead")[0]),c=0;c<s.length;c++)e=j[s[c]],t[c].style.width=null!==e.sWidthOrig&&""!==e.sWidthOrig?wb(e.sWidthOrig):"";if(b.aoData.length)for(c=0;c<s.length;c++)f=s[c],e=j[f],d(ub(b,f)).clone(!1).append(e.sContentPadding).appendTo(y);if(x.appendTo(v),n&&o?x.width(o):n?(x.css("width","auto"),x.width()<v.offsetWidth&&x.width(v.offsetWidth)):l?x.width(v.offsetWidth):u&&x.width(u),tb(b,x[0]),n){var z=0;for(c=0;c<s.length;c++)e=j[s[c]],h=d(t[c]).outerWidth(),z+=null===e.sWidthOrig?h:parseInt(e.sWidth,10)+h-d(t[c]).width();x.width(wb(z)),i.style.width=wb(z)}for(c=0;c<s.length;c++)e=j[s[c]],g=d(t[c]).width(),g&&(e.sWidth=wb(g));i.style.width=wb(x.css("width")),x.remove()}else for(c=0;r>c;c++)j[c].sWidth=wb(t.eq(c).width());u&&(i.style.width=wb(u)),!u&&!n||b._reszEvt||(d(a).bind("resize.DT-"+b.sInstance,rb(function(){m(b)})),b._reszEvt=!0)}function rb(a,b){var d,e,f=b||200;return function(){var b=this,g=+new Date,h=arguments;d&&d+f>g?(clearTimeout(e),e=setTimeout(function(){d=c,a.apply(b,h)},f)):d?(d=g,a.apply(b,h)):d=g}}function sb(a,c){if(!a)return 0;var e=d("<div/>").css("width",wb(a)).appendTo(c||b.body),f=e[0].offsetWidth;return e.remove(),f}function tb(a,b){var c=a.oScroll;if(c.sX||c.sY){var e=c.sX?0:c.iBarWidth;b.style.width=wb(d(b).outerWidth()-e)}}function ub(a,b){var c=vb(a,b);if(0>c)return null;var e=a.aoData[c];return e.nTr?e.anCells[b]:d("<td/>").html(y(a,c,b,"display"))[0]
|
|
}function vb(a,b){for(var c,d=-1,e=-1,f=0,g=a.aoData.length;g>f;f++)c=y(a,f,b,"display")+"",c=c.replace(tc,""),c.length>d&&(d=c.length,e=f);return e}function wb(a){return null===a?"0px":"number"==typeof a?0>a?"0px":a+"px":a.match(/\d$/)?a+"px":a}function xb(){if(!Ub.__scrollbarWidth){var a=d("<p/>").css({"width":"100%","height":200,"padding":0})[0],b=d("<div/>").css({"position":"absolute","top":0,"left":0,"width":200,"height":150,"padding":0,"overflow":"hidden","visibility":"hidden"}).append(a).appendTo("body"),c=a.offsetWidth;b.css("overflow","scroll");var e=a.offsetWidth;c===e&&(e=b[0].clientWidth),b.remove(),Ub.__scrollbarWidth=c-e}return Ub.__scrollbarWidth}function yb(a){var b,c,e,f,g,h,i,j=[],k=a.aoColumns,l=a.aaSortingFixed,m=d.isPlainObject(l),n=[],o=function(a){a.length&&!d.isArray(a[0])?n.push(a):n.push.apply(n,a)};for(d.isArray(l)&&o(l),m&&l.pre&&o(l.pre),o(a.aaSorting),m&&l.post&&o(l.post),b=0;b<n.length;b++)for(i=n[b][0],f=k[i].aDataSort,c=0,e=f.length;e>c;c++)g=f[c],h=k[g].sType||"string",j.push({"src":i,"col":g,"dir":n[b][1],"index":n[b][2],"type":h,"formatter":Ub.ext.type.order[h+"-pre"]});return j}function zb(a){var b,c,d,e,f=[],g=Ub.ext.type.order,h=a.aoData,i=(a.aoColumns,0),j=a.aiDisplayMaster,k=yb(a);for(r(a),b=0,c=k.length;c>b;b++)e=k[b],e.formatter&&i++,Eb(a,e.col);if("ssp"!=Qb(a)&&0!==k.length){for(b=0,d=j.length;d>b;b++)f[j[b]]=b;j.sort(i===k.length?function(a,b){var c,d,e,g,i,j=k.length,l=h[a]._aSortData,m=h[b]._aSortData;for(e=0;j>e;e++)if(i=k[e],c=l[i.col],d=m[i.col],g=d>c?-1:c>d?1:0,0!==g)return"asc"===i.dir?g:-g;return c=f[a],d=f[b],d>c?-1:c>d?1:0}:function(a,b){var c,d,e,i,j,l,m=k.length,n=h[a]._aSortData,o=h[b]._aSortData;for(e=0;m>e;e++)if(j=k[e],c=n[j.col],d=o[j.col],l=g[j.type+"-"+j.dir]||g["string-"+j.dir],i=l(c,d),0!==i)return i;return c=f[a],d=f[b],d>c?-1:c>d?1:0})}a.bSorted=!0}function Ab(a){for(var b,c,d=a.aoColumns,e=yb(a),f=a.oLanguage.oAria,g=0,h=d.length;h>g;g++){var i=d[g],j=i.asSorting,k=i.sTitle.replace(/<.*?>/g,""),l=i.nTh;l.removeAttribute("aria-sort"),i.bSortable?(e.length>0&&e[0].col==g?(l.setAttribute("aria-sort","asc"==e[0].dir?"ascending":"descending"),c=j[e[0].index+1]||j[0]):c=j[0],b=k+("asc"===c?f.sSortAscending:f.sSortDescending)):b=k,l.setAttribute("aria-label",b)}}function Bb(a,b,e,f){var g,h=a.aoColumns[b],i=a.aaSorting,j=h.asSorting,k=function(a){var b=a._idx;return b===c&&(b=d.inArray(a[1],j)),b+1>=j.length?0:b+1};if(e&&a.oFeatures.bSortMulti){var l=d.inArray(b,jc(i,"0"));-1!==l?(g=k(i[l]),i[l][1]=j[g],i[l]._idx=g):(i.push([b,j[0],0]),i[i.length-1]._idx=0)}else i.length&&i[0][0]==b?(g=k(i[0]),i.length=1,i[0][1]=j[g],i[0]._idx=g):(i.length=0,i.push([b,j[0]]),i[0]._idx=0);N(a),"function"==typeof f&&f(a)}function Cb(a,b,c,d){var e=a.aoColumns[c];Lb(b,{},function(b){e.bSortable!==!1&&(mb(a,!0),setTimeout(function(){Bb(a,c,b.shiftKey,d),"ssp"!==Qb(a)&&mb(a,!1)},0))})}function Db(a){var b,c,e,f=a.aLastSort,g=a.oClasses.sSortColumn,h=yb(a),i=a.oFeatures;if(i.bSort&&i.bSortClasses){for(b=0,c=f.length;c>b;b++)e=f[b].src,d(jc(a.aoData,"anCells",e)).removeClass(g+(2>b?b+1:3));for(b=0,c=h.length;c>b;b++)e=h[b].src,d(jc(a.aoData,"anCells",e)).addClass(g+(2>b?b+1:3))}a.aLastSort=h}function Eb(a,b){var c,d=a.aoColumns[b],e=Ub.ext.order[d.sSortDataType];e&&(c=e.call(a.oInstance,a,b,o(a,b)));for(var f,g,h=Ub.ext.type.order[d.sType+"-pre"],i=0,j=a.aoData.length;j>i;i++)f=a.aoData[i],f._aSortData||(f._aSortData=[]),(!f._aSortData[b]||e)&&(g=e?c[i]:y(a,i,b,"sort"),f._aSortData[b]=h?h(g):g)}function Fb(a){if(a.oFeatures.bStateSave&&!a.bDestroying){var b,c,e={"iCreate":(new Date).getTime(),"iStart":a._iDisplayStart,"iLength":a._iDisplayLength,"aaSorting":d.extend(!0,[],a.aaSorting),"oSearch":d.extend(!0,{},a.oPreviousSearch),"aoSearchCols":d.extend(!0,[],a.aoPreSearchCols),"abVisCols":[]};for(b=0,c=a.aoColumns.length;c>b;b++)e.abVisCols.push(a.aoColumns[b].bVisible);Nb(a,"aoStateSaveParams","stateSaveParams",[a,e]),a.fnStateSaveCallback.call(a.oInstance,a,e)}}function Gb(a){var b,c,e=a.aoColumns;if(a.oFeatures.bStateSave){var f=a.fnStateLoadCallback.call(a.oInstance,a);if(f){var g=Nb(a,"aoStateLoadParams","stateLoadParams",[a,f]);if(-1===d.inArray(!1,g)&&!(f.iCreate<(new Date).getTime()-1e3*a.iStateDuration)&&e.length===f.aoSearchCols.length){a.oLoadedState=d.extend(!0,{},f),a._iDisplayStart=f.iStart,a.iInitDisplayStart=f.iStart,a._iDisplayLength=f.iLength,a.aaSorting=[];var h=f.aaSorting;for(b=0,c=h.length;c>b;b++)a.aaSorting.push(h[b][0]>=e.length?[0,h[b][1]]:h[b]);for(d.extend(a.oPreviousSearch,f.oSearch),d.extend(!0,a.aoPreSearchCols,f.aoSearchCols),b=0,c=f.abVisCols.length;c>b;b++)e[b].bVisible=f.abVisCols[b];Nb(a,"aoStateLoaded","stateLoaded",[a,f])}}}}function Hb(a){var b=Ub.settings,c=d.inArray(a,jc(b,"nTable"));return-1!==c?b[c]:null}function Ib(b,c,d,e){if(d="DataTables warning: "+(null!==b?"table id="+b.sTableId+" - ":"")+d,e&&(d+=". For more information about this error, please see http://datatables.net/tn/"+e),c)a.console&&console.log;else{var f=Ub.ext,g=f.sErrMode||f.errMode;if("alert"!=g)throw new Error(d);alert(d)}}function Jb(a,b,e,f){return d.isArray(e)?void d.each(e,function(c,e){d.isArray(e)?Jb(a,b,e[0],e[1]):Jb(a,b,e)}):(f===c&&(f=e),void(b[e]!==c&&(a[f]=b[e])))}function Kb(a,b,c){var e;for(var f in b)b.hasOwnProperty(f)&&(e=b[f],d.isPlainObject(e)?(d.isPlainObject(a[f])||(a[f]={}),d.extend(!0,a[f],e)):a[f]=c&&"data"!==f&&"aaData"!==f&&d.isArray(e)?e.slice():e);return a}function Lb(a,b,c){d(a).bind("click.DT",b,function(b){a.blur(),c(b)}).bind("keypress.DT",b,function(a){13===a.which&&c(a)}).bind("selectstart.DT",function(){return!1})}function Mb(a,b,c,d){c&&a[b].push({"fn":c,"sName":d})}function Nb(a,b,c,e){var f=[];return b&&(f=d.map(a[b].slice().reverse(),function(b){return b.fn.apply(a.oInstance,e)})),null!==c&&d(a.nTable).trigger(c+".dt",e),f}function Ob(a){var b=a._iDisplayStart,c=a.fnDisplayEnd(),d=a._iDisplayLength;c===a.fnRecordsDisplay()&&(b=c-d),(-1===d||0>b)&&(b=0),a._iDisplayStart=b}function Pb(a,b){var c=a.renderer,e=Ub.ext.renderer[b];return d.isPlainObject(c)&&c[b]?e[c[b]]||e._:"string"==typeof c?e[c]||e._:e._}function Qb(a){return a.oFeatures.bServerSide?"ssp":a.ajax||a.sAjaxSource?"ajax":"dom"}function Rb(a,b){var c=[],d=Lc.numbers_length,e=Math.floor(d/2);return d>=b?c=lc(0,b):e>=a?(c=lc(0,d-2),c.push("ellipsis"),c.push(b-1)):a>=b-1-e?(c=lc(b-(d-2),b),c.splice(0,0,"ellipsis"),c.splice(0,0,0)):(c=lc(a-1,a+2),c.push("ellipsis"),c.push(b-1),c.splice(0,0,"ellipsis"),c.splice(0,0,0)),c.DT_el="span",c}function Sb(a){d.each({"num":function(b){return Mc(b,a)},"num-fmt":function(b){return Mc(b,a,cc)},"html-num":function(b){return Mc(b,a,_b)},"html-num-fmt":function(b){return Mc(b,a,_b,cc)}},function(b,c){Vb.type.order[b+a+"-pre"]=c})}function Tb(a){return function(){var b=[Hb(this[Ub.ext.iApiIndex])].concat(Array.prototype.slice.call(arguments));return Ub.ext.internal[a].apply(this,b)}}var Ub,Vb,Wb,Xb,Yb,Zb={},$b=/[\r\n]/g,_b=/<.*?>/g,ac=/^[\d\+\-a-zA-Z]/,bc=new RegExp("(\\"+["/",".","*","+","?","|","(",")","[","]","{","}","\\","$","^","-"].join("|\\")+")","g"),cc=/[',$\xa3\u20ac\xa5%\u2009\u202F]/g,dc=function(a){return a&&"-"!==a?!1:!0},ec=function(a){var b=parseInt(a,10);return!isNaN(b)&&isFinite(a)?b:null},fc=function(a,b){return Zb[b]||(Zb[b]=new RegExp(ab(b),"g")),a.replace(/\./g,"").replace(Zb[b],".")},gc=function(a,b,c){var d="string"==typeof a;return b&&d&&(a=fc(a,b)),c&&d&&(a=a.replace(cc,"")),!a||"-"===a||!isNaN(parseFloat(a))&&isFinite(a)},hc=function(a){return!a||"string"==typeof a},ic=function(a,b,c){if(dc(a))return!0;var d=hc(a);return d&&gc(mc(a),b,c)?!0:null},jc=function(a,b,d){var e=[],f=0,g=a.length;if(d!==c)for(;g>f;f++)a[f]&&a[f][b]&&e.push(a[f][b][d]);else for(;g>f;f++)a[f]&&e.push(a[f][b]);return e},kc=function(a,b,d,e){var f=[],g=0,h=b.length;if(e!==c)for(;h>g;g++)f.push(a[b[g]][d][e]);else for(;h>g;g++)f.push(a[b[g]][d]);return f},lc=function(a,b){var d,e=[];b===c?(b=0,d=a):(d=b,b=a);for(var f=b;d>f;f++)e.push(f);return e},mc=function(a){return a.replace(_b,"")},nc=function(a){var b,c,d,e=[],f=a.length,g=0;a:for(c=0;f>c;c++){for(b=a[c],d=0;g>d;d++)if(e[d]===b)continue a;e.push(b),g++}return e},oc=function(a,b,d){a[b]!==c&&(a[d]=a[b])},pc=/\[.*?\]$/,qc=/\(\)$/,rc=d("<div>")[0],sc=rc.textContent!==c,tc=/<.*?>/g;Ub=function(a){this.$=function(a,b){return this.api(!0).$(a,b)},this._=function(a,b){return this.api(!0).rows(a,b).data()},this.api=function(a){return new Wb(a?Hb(this[Vb.iApiIndex]):this)},this.fnAddData=function(a,b){var e=this.api(!0),f=d.isArray(a)&&(d.isArray(a[0])||d.isPlainObject(a[0]))?e.rows.add(a):e.row.add(a);return(b===c||b)&&e.draw(),f.flatten().toArray()},this.fnAdjustColumnSizing=function(a){var b=this.api(!0).columns.adjust(),d=b.settings()[0],e=d.oScroll;a===c||a?b.draw(!1):(""!==e.sX||""!==e.sY)&&ob(d)},this.fnClearTable=function(a){var b=this.api(!0).clear();(a===c||a)&&b.draw()},this.fnClose=function(a){this.api(!0).row(a).child.hide()},this.fnDeleteRow=function(a,b,d){var e=this.api(!0),f=e.rows(a),g=f.settings()[0],h=g.aoData[f[0][0]];return f.remove(),b&&b.call(this,g,h),(d===c||d)&&e.draw(),h},this.fnDestroy=function(a){this.api(!0).destroy(a)},this.fnDraw=function(a){this.api(!0).draw(!a)},this.fnFilter=function(a,b,d,e,f,g){var h=this.api(!0);null===b||b===c?h.search(a,d,e,g):h.column(b).search(a,d,e,g),h.draw()},this.fnGetData=function(a,b){var d=this.api(!0);if(a!==c){var e=a.nodeName?a.nodeName.toLowerCase():"";return b!==c||"td"==e||"th"==e?d.cell(a,b).data():d.row(a).data()}return d.data().toArray()},this.fnGetNodes=function(a){var b=this.api(!0);return a!==c?b.row(a).node():b.rows().nodes().toArray()},this.fnGetPosition=function(a){var b=this.api(!0),c=a.nodeName.toUpperCase();if("TR"==c)return b.row(a).index();if("TD"==c||"TH"==c){var d=b.cell(a).index();return[d.row,d.columnVisible,d.column]}return null},this.fnIsOpen=function(a){return this.api(!0).row(a).child.isShown()},this.fnOpen=function(a,b,c){return this.api(!0).row(a).child(b,c).show()},this.fnPageChange=function(a,b){var d=this.api(!0).page(a);(b===c||b)&&d.draw(!1)},this.fnSetColumnVis=function(a,b,d){var e=this.api(!0).column(a).visible(b);(d===c||d)&&e.columns.adjust().draw()},this.fnSettings=function(){return Hb(this[Vb.iApiIndex])},this.fnSort=function(a){this.api(!0).order(a).draw()},this.fnSortListener=function(a,b,c){this.api(!0).order.listener(a,b,c)},this.fnUpdate=function(a,b,d,e,f){var g=this.api(!0);return d===c||null===d?g.row(b).data(a):g.cell(b,d).data(a),(f===c||f)&&g.columns.adjust(),(e===c||e)&&g.draw(),0},this.fnVersionCheck=Vb.fnVersionCheck;var b=this,e=a===c,m=this.length;e&&(a={}),this.oApi=this.internal=Vb.internal;for(var n in Ub.ext.internal)n&&(this[n]=Tb(n));return this.each(function(){var n,o={},p=m>1?Kb(o,a,!0):a,q=0,r=this.getAttribute("id"),v=!1,w=Ub.defaults;if("table"!=this.nodeName.toLowerCase())return void Ib(null,0,"Non-table node initialisation ("+this.nodeName+")",2);h(w),i(w.column),f(w,w,!0),f(w.column,w.column,!0),f(w,p);var x=Ub.settings;for(q=0,n=x.length;n>q;q++){if(x[q].nTable==this){var y=p.bRetrieve!==c?p.bRetrieve:w.bRetrieve,z=p.bDestroy!==c?p.bDestroy:w.bDestroy;if(e||y)return x[q].oInstance;if(z){x[q].oInstance.fnDestroy();break}return void Ib(x[q],0,"Cannot reinitialise DataTable",3)}if(x[q].sTableId==this.id){x.splice(q,1);break}}(null===r||""===r)&&(r="DataTables_Table_"+Ub.ext._unique++,this.id=r);var A=d.extend(!0,{},Ub.models.oSettings,{"nTable":this,"oApi":b.internal,"oInit":p,"sDestroyWidth":d(this)[0].style.width,"sInstance":r,"sTableId":r});if(x.push(A),A.oInstance=1===b.length?b:d(this).dataTable(),h(p),p.oLanguage&&g(p.oLanguage),p.aLengthMenu&&!p.iDisplayLength&&(p.iDisplayLength=d.isArray(p.aLengthMenu[0])?p.aLengthMenu[0][0]:p.aLengthMenu[0]),p=Kb(d.extend(!0,{},w),p),Jb(A.oFeatures,p,["bPaginate","bLengthChange","bFilter","bSort","bSortMulti","bInfo","bProcessing","bAutoWidth","bSortClasses","bServerSide","bDeferRender"]),Jb(A,p,["asStripeClasses","ajax","fnServerData","fnFormatNumber","sServerMethod","aaSorting","aaSortingFixed","aLengthMenu","sPaginationType","sAjaxSource","sAjaxDataProp","iStateDuration","sDom","bSortCellsTop","iTabIndex","fnStateLoadCallback","fnStateSaveCallback","renderer",["iCookieDuration","iStateDuration"],["oSearch","oPreviousSearch"],["aoSearchCols","aoPreSearchCols"],["iDisplayLength","_iDisplayLength"],["bJQueryUI","bJUI"]]),Jb(A.oScroll,p,[["sScrollX","sX"],["sScrollXInner","sXInner"],["sScrollY","sY"],["bScrollCollapse","bCollapse"]]),Jb(A.oLanguage,p,"fnInfoCallback"),Mb(A,"aoDrawCallback",p.fnDrawCallback,"user"),Mb(A,"aoServerParams",p.fnServerParams,"user"),Mb(A,"aoStateSaveParams",p.fnStateSaveParams,"user"),Mb(A,"aoStateLoadParams",p.fnStateLoadParams,"user"),Mb(A,"aoStateLoaded",p.fnStateLoaded,"user"),Mb(A,"aoRowCallback",p.fnRowCallback,"user"),Mb(A,"aoRowCreatedCallback",p.fnCreatedRow,"user"),Mb(A,"aoHeaderCallback",p.fnHeaderCallback,"user"),Mb(A,"aoFooterCallback",p.fnFooterCallback,"user"),Mb(A,"aoInitComplete",p.fnInitComplete,"user"),Mb(A,"aoPreDrawCallback",p.fnPreDrawCallback,"user"),p.bJQueryUI?(d.extend(A.oClasses,Ub.ext.oJUIClasses,p.oClasses),p.sDom===w.sDom&&"lfrtip"===w.sDom&&(A.sDom='<"H"lfr>t<"F"ip>'),A.renderer?d.isPlainObject(A.renderer)&&!A.renderer.header&&(A.renderer.header="jqueryui"):A.renderer="jqueryui"):d.extend(A.oClasses,Ub.ext.classes,p.oClasses),d(this).addClass(A.oClasses.sTable),(""!==A.oScroll.sX||""!==A.oScroll.sY)&&(A.oScroll.iBarWidth=xb()),A.oScroll.sX===!0&&(A.oScroll.sX="100%"),A.iInitDisplayStart===c&&(A.iInitDisplayStart=p.iDisplayStart,A._iDisplayStart=p.iDisplayStart),null!==p.iDeferLoading){A.bDeferLoading=!0;var B=d.isArray(p.iDeferLoading);A._iRecordsDisplay=B?p.iDeferLoading[0]:p.iDeferLoading,A._iRecordsTotal=B?p.iDeferLoading[1]:p.iDeferLoading}""!==p.oLanguage.sUrl?(A.oLanguage.sUrl=p.oLanguage.sUrl,d.getJSON(A.oLanguage.sUrl,null,function(a){g(a),f(w.oLanguage,a),d.extend(!0,A.oLanguage,p.oLanguage,a),fb(A)}),v=!0):d.extend(!0,A.oLanguage,p.oLanguage),null===p.asStripeClasses&&(A.asStripeClasses=[A.oClasses.sStripeOdd,A.oClasses.sStripeEven]);var C=A.asStripeClasses,D=d("tbody tr:eq(0)",this);-1!==d.inArray(!0,d.map(C,function(a){return D.hasClass(a)}))&&(d("tbody tr",this).removeClass(C.join(" ")),A.asDestroyStripes=C.slice());var E,F=[],G=this.getElementsByTagName("thead");if(0!==G.length&&(P(A.aoHeader,G[0]),F=Q(A)),null===p.aoColumns)for(E=[],q=0,n=F.length;n>q;q++)E.push(null);else E=p.aoColumns;for(q=0,n=E.length;n>q;q++)k(A,F?F[q]:null);if(s(A,p.aoColumnDefs,E,function(a,b){l(A,a,b)}),D.length){var I=function(a,b){return a.getAttribute("data-"+b)?b:null};d.each(H(A,D[0]).cells,function(a,b){var d=A.aoColumns[a];if(d.mData===a){var e=I(b,"sort")||I(b,"order"),f=I(b,"filter")||I(b,"search");(null!==e||null!==f)&&(d.mData={"_":a+".display","sort":null!==e?a+".@data-"+e:c,"type":null!==e?a+".@data-"+e:c,"filter":null!==f?a+".@data-"+f:c},l(A,a))}})}if(p.bStateSave&&(A.oFeatures.bStateSave=!0,Gb(A,p),Mb(A,"aoDrawCallback",Fb,"state_save")),p.aaSorting===c)for(q=0,n=A.aaSorting.length;n>q;q++)A.aaSorting[q][1]=A.aoColumns[q].asSorting[0];Db(A),A.oFeatures.bSort&&Mb(A,"aoDrawCallback",function(){if(A.bSorted){var a=yb(A),b={};d.each(a,function(a,c){b[c.src]=c.dir}),Nb(A,null,"order",[A,a,b]),Db(A),Ab(A)}}),j(A);var J=d(this).children("caption").each(function(){this._captionSide=d(this).css("caption-side")}),K=d(this).children("thead");0===K.length&&(K=d("<thead/>").appendTo(this)),A.nTHead=K[0];var L=d(this).children("tbody");0===L.length&&(L=d("<tbody/>").appendTo(this)),A.nTBody=L[0];var M=d(this).children("tfoot");if(0===M.length&&J.length>0&&(""!==A.oScroll.sX||""!==A.oScroll.sY)&&(M=d("<tfoot/>").appendTo(this)),0===M.length||0===M.children().length?d(this).addClass(A.oClasses.sNoFooter):M.length>0&&(A.nTFoot=M[0],P(A.aoFooter,A.nTFoot)),p.aaData)for(q=0;q<p.aaData.length;q++)t(A,p.aaData[q]);else(A.bDeferLoading||"dom"==Qb(A))&&u(A,d(A.nTBody).children("tr"));A.aiDisplay=A.aiDisplayMaster.slice(),A.bInitialised=!0,v===!1&&fb(A)}),b=null,this};var uc=[],vc=Array.prototype,wc=function(a){var b,c,e=Ub.settings,f=d.map(e,function(a){return a.nTable});return a?a.nTable&&a.oApi?[a]:a.nodeName&&"table"===a.nodeName.toLowerCase()?(b=d.inArray(a,f),-1!==b?[e[b]]:null):a&&"function"==typeof a.settings?a.settings():("string"==typeof a?c=d(a):a instanceof d&&(c=a),c?c.map(function(){return b=d.inArray(this,f),-1!==b?e[b]:null}).toArray():void 0):[]};Ub.Api=Wb=function(a,b){if(!this instanceof Wb)throw"DT API must be constructed as a new object";var c=[],e=function(a){var b=wc(a);b&&c.push.apply(c,b)};if(d.isArray(a))for(var f=0,g=a.length;g>f;f++)e(a[f]);else e(a);this.context=nc(c),b&&this.push.apply(this,b.toArray?b.toArray():b),this.selector={"rows":null,"cols":null,"opts":null},Wb.extend(this,this,uc)},Wb.prototype={"concat":vc.concat,"context":[],"each":function(a){if(vc.forEach)vc.forEach.call(this,a,this);else for(var b=0,c=this.length;c>b;b++)a.call(this,this[b],b,this);return this},"eq":function(a){var b=this.context;return b.length>a?new Wb(b[a],this[a]):null},"filter":function(a){var b=[];if(vc.filter)b=vc.filter.call(this,a,this);else for(var c=0,d=this.length;d>c;c++)a.call(this,this[c],c,this)&&b.push(this[c]);return new Wb(this.context,b)},"flatten":function(){var a=[];return new Wb(this.context,a.concat.apply(a,this.toArray()))},"join":vc.join,"indexOf":vc.indexOf||function(a,b){for(var c=b||0,d=this.length;d>c;c++)if(this[c]===a)return c;return-1},"iterator":function(a,b,d){var e,f,g,h,i,j,k,l,m=[],n=this.context,o=this.selector;for("string"==typeof a&&(d=b,b=a,a=!1),f=0,g=n.length;g>f;f++)if("table"===b)e=d(n[f],f),e!==c&&m.push(e);else if("columns"===b||"rows"===b)e=d(n[f],this[f],f),e!==c&&m.push(e);else if("column"===b||"column-rows"===b||"row"===b||"cell"===b)for(k=this[f],"column-rows"===b&&(j=Cc(n[f],o.opts)),h=0,i=k.length;i>h;h++)l=k[h],e="cell"===b?d(n[f],l.row,l.column,f,h):d(n[f],l,f,h,j),e!==c&&m.push(e);if(m.length){var p=new Wb(n,a?m.concat.apply([],m):m),q=p.selector;return q.rows=o.rows,q.cols=o.cols,q.opts=o.opts,p}return this},"lastIndexOf":vc.lastIndexOf||function(){return this.indexOf.apply(this.toArray.reverse(),arguments)},"length":0,"map":function(a){var b=[];if(vc.map)b=vc.map.call(this,a,this);else for(var c=0,d=this.length;d>c;c++)b.push(a.call(this,this[c],c));return new Wb(this.context,b)},"pluck":function(a){return this.map(function(b){return b[a]})},"pop":vc.pop,"push":vc.push,"reduce":vc.reduce||function(a,b){var c,d=!1;arguments.length>1&&(c=b,d=!0);for(var e=0,f=this.length;f>e;e++)this.hasOwnProperty(e)&&(c=d?a(c,this[e],e,this):this[e],d=!0);return c},"reduceRight":vc.reduceRight||function(a,b){var c,d=!1;arguments.length>1&&(c=b,d=!0);for(var e=this.length-1;e>=0;e--)this.hasOwnProperty(e)&&(c=d?a(c,this[e],e,this):this[e],d=!0);return c},"reverse":vc.reverse,"selector":null,"shift":vc.shift,"sort":vc.sort,"splice":vc.splice,"toArray":function(){return vc.slice.call(this)},"to$":function(){return d(this)},"toJQuery":function(){return d(this)},"unique":function(){return new Wb(this.context,nc(this))},"unshift":vc.unshift},Wb.extend=function(a,b,c){if(b&&(b instanceof Wb||b.__dt_wrapper)){var d,e,f,g=function(b,c){return function(){var d=b.apply(a,arguments);return Wb.extend(d,d,c.methodExt),d}};for(d=0,e=c.length;e>d;d++)f=c[d],b[f.name]="function"==typeof f.val?g(f.val,f):f.val,b[f.name].__dt_wrapper=!0,Wb.extend(a,b[f.name],f.propExt)}},Wb.register=Xb=function(a,b){if(d.isArray(a))for(var c=0,e=a.length;e>c;c++)Wb.register(a[c],b);else{var f,g,h,i,j=a.split("."),k=uc,l=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c].name===b)return a[c];return null};for(f=0,g=j.length;g>f;f++){i=-1!==j[f].indexOf("()"),h=i?j[f].replace("()",""):j[f];var m=l(k,h);m||(m={"name":h,"val":{},"methodExt":[],"propExt":[]},k.push(m)),f===g-1?m.val=b:k=i?m.methodExt:m.propExt}Wb.ready&&Ub.api.build()}},Wb.registerPlural=Yb=function(a,b,e){Wb.register(a,e),Wb.register(b,function(){var a=e.apply(this,arguments);return a===this?this:a instanceof Wb?a.length?d.isArray(a[0])?new Wb(a.context,a[0]):a[0]:c:a})};var xc=function(a,b){if("number"==typeof a)return[b[a]];var c=d.map(b,function(a){return a.nTable});return d(c).filter(a).map(function(){var a=d.inArray(this,c);return b[a]}).toArray()};Xb("tables()",function(a){return a?new Wb(xc(a,this.context)):this}),Xb("table()",function(a){var b=this.tables(a),c=b.context;return c.length?new Wb(c[0]):b}),Yb("tables().nodes()","table().node()",function(){return this.iterator("table",function(a){return a.nTable})}),Yb("tables().body()","table().body()",function(){return this.iterator("table",function(a){return a.nTBody})}),Yb("tables().header()","table().header()",function(){return this.iterator("table",function(a){return a.nTHead})}),Yb("tables().footer()","table().footer()",function(){return this.iterator("table",function(a){return a.nTFoot})}),Xb("draw()",function(a){return this.iterator("table",function(b){N(b,a===!1)})}),Xb("page()",function(a){return a===c?this.page.info().page:this.iterator("table",function(b){kb(b,a)})}),Xb("page.info()",function(){if(0===this.context.length)return c;var a=this.context[0],b=a._iDisplayStart,d=a._iDisplayLength,e=a.fnRecordsDisplay(),f=-1===d;return{"page":f?0:Math.floor(b/d),"pages":f?1:Math.ceil(e/d),"start":b,"end":a.fnDisplayEnd(),"length":d,"recordsTotal":a.fnRecordsTotal(),"recordsDisplay":e}}),Xb("page.len()",function(a){return a===c?0!==this.context.length?this.context[0]._iDisplayLength:c:this.iterator("table",function(b){hb(b,a)})});var yc=function(a,b,c){if("ssp"==Qb(a)?N(a,b):R(a,[],function(c){E(a);for(var d=V(a,c),e=0,f=d.length;f>e;e++)t(a,d[e]);N(a,b)}),c){var d=new Wb(a);d.one("draw",function(){c(d.ajax.json())})}};Xb("ajax.json()",function(){var a=this.context;return a.length>0?a[0].json:void 0}),Xb("ajax.reload()",function(a,b){return this.iterator("table",function(c){yc(c,b===!1,a)})}),Xb("ajax.url()",function(a){var b=this.context;return a===c?0===b.length?c:(b=b[0],b.ajax?d.isPlainObject(b.ajax)?b.ajax.url:b.ajax:b.sAjaxSource):this.iterator("table",function(b){d.isPlainObject(b.ajax)?b.ajax.url=a:b.ajax=a})}),Xb("ajax.url().load()",function(a,b){return this.iterator("table",function(c){yc(c,b===!1,a)})});var zc=function(a,b){var c,e,f,g,h,i,j=[];for(d.isArray(a)||(a=[a]),f=0,g=a.length;g>f;f++)for(e=a[f]&&a[f].split?a[f].split(","):[a[f]],h=0,i=e.length;i>h;h++)c=b("string"==typeof e[h]?d.trim(e[h]):e[h]),c&&c.length&&j.push.apply(j,c);return j},Ac=function(a){return a||(a={}),a.filter&&!a.search&&(a.search=a.filter),{"search":a.search||"none","order":a.order||"current","page":a.page||"all"}},Bc=function(a){for(var b=0,c=a.length;c>b;b++)if(a[b].length>0)return a[0]=a[b],a.length=1,a.context=[a.context[b]],a;return a.length=0,a},Cc=function(a,b){var c,e,f,g=[],h=a.aiDisplay,i=a.aiDisplayMaster,j=b.search,k=b.order,l=b.page;if("ssp"==Qb(a))return"removed"===j?[]:lc(0,i.length);if("current"==l)for(c=a._iDisplayStart,e=a.fnDisplayEnd();e>c;c++)g.push(h[c]);else if("current"==k||"applied"==k)g="none"==j?i.slice():"applied"==j?h.slice():d.map(i,function(a){return-1===d.inArray(a,h)?a:null});else if("index"==k||"original"==k)for(c=0,e=a.aoData.length;e>c;c++)"none"==j?g.push(c):(f=d.inArray(c,h),(-1===f&&"removed"==j||1===f&&"applied"==j)&&g.push(c));return g},Dc=function(a,b,c){return zc(b,function(b){var e=ec(b);if(null!==e&&!c)return[e];var f=Cc(a,c);if(null!==e&&-1!==d.inArray(e,f))return[e];if(!b)return f;for(var g=[],h=0,i=f.length;i>h;h++)g.push(a.aoData[f[h]].nTr);return b.nodeName&&-1!==d.inArray(b,g)?[b._DT_RowIndex]:d(g).filter(b).map(function(){return this._DT_RowIndex}).toArray()})};Xb("rows()",function(a,b){a===c?a="":d.isPlainObject(a)&&(b=a,a=""),b=Ac(b);var e=this.iterator("table",function(c){return Dc(c,a,b)});return e.selector.rows=a,e.selector.opts=b,e}),Xb("rows().nodes()",function(){return this.iterator("row",function(a,b){return a.aoData[b].nTr||c})}),Xb("rows().data()",function(){return this.iterator(!0,"rows",function(a,b){return kc(a.aoData,b,"_aData")})}),Yb("rows().cache()","row().cache()",function(a){return this.iterator("row",function(b,c){var d=b.aoData[c];return"search"===a?d._aFilterData:d._aSortData})}),Yb("rows().invalidate()","row().invalidate()",function(a){return this.iterator("row",function(b,c){G(b,c,a)})}),Yb("rows().indexes()","row().index()",function(){return this.iterator("row",function(a,b){return b})}),Yb("rows().remove()","row().remove()",function(){var a=this;return this.iterator("row",function(b,c,e){var f=b.aoData;f.splice(c,1);for(var g=0,h=f.length;h>g;g++)null!==f[g].nTr&&(f[g].nTr._DT_RowIndex=g);d.inArray(c,b.aiDisplay);F(b.aiDisplayMaster,c),F(b.aiDisplay,c),F(a[e],c,!1),Ob(b)})}),Xb("rows.add()",function(a){var b=this.iterator("table",function(b){var c,d,e,f=[];for(d=0,e=a.length;e>d;d++)c=a[d],f.push(c.nodeName&&"TR"===c.nodeName.toUpperCase()?u(b,c)[0]:t(b,c));return f}),c=this.rows(-1);return c.pop(),c.push.apply(c,b.toArray()),c}),Xb("row()",function(a,b){return Bc(this.rows(a,b))}),Xb("row().data()",function(a){var b=this.context;return a===c?b.length&&this.length?b[0].aoData[this[0]]._aData:c:(b[0].aoData[this[0]]._aData=a,G(b[0],this[0],"data"),this)}),Xb("row().node()",function(){var a=this.context;return a.length&&this.length?a[0].aoData[this[0]].nTr||null:null}),Xb("row.add()",function(a){a instanceof d&&a.length&&(a=a[0]);var b=this.iterator("table",function(b){return a.nodeName&&"TR"===a.nodeName.toUpperCase()?u(b,a)[0]:t(b,a)});return this.row(b[0])});var Ec=function(a,b,c,e){var f=[],g=function(b,c){b.nodeName&&"tr"===b.nodeName.toUpperCase()||(b=d("<tr><td></td></tr>").find("td").html(b).parent()),d("td",b).addClass(c)[0].colSpan=p(a),f.push(b[0])};if(d.isArray(c)||c instanceof d)for(var h=0,i=c.length;i>h;h++)g(c[h],e);else g(c,e);b._details&&b._details.remove(),b._details=d(f),b._detailsShow&&b._details.insertAfter(b.nTr)},Fc=function(a){var b=this.context;if(b.length&&this.length){var c=b[0].aoData[this[0]];c._details&&(c._detailsShow=a,a?c._details.insertAfter(c.nTr):c._details.remove(),Gc(b[0]))}return this},Gc=function(a){var b=new Wb(a),c=".dt.DT_details",d="draw"+c,e="column-visibility"+c;b.off(d+" "+e),jc(a.aoData,"_details").length>0&&(b.on(d,function(){b.rows({"page":"current"}).eq(0).each(function(b){var c=a.aoData[b];c._detailsShow&&c._details.insertAfter(c.nTr)})}),b.on(e,function(a,b){for(var c,d=p(b),e=0,f=b.aoData.length;f>e;e++)c=b.aoData[e],c._details&&c._details.children("td[colspan]").attr("colspan",d)}))};Xb("row().child()",function(a,b){var d=this.context;return a===c?d.length&&this.length?d[0].aoData[this[0]]._details:c:(d.length&&this.length&&Ec(d[0],d[0].aoData[this[0]],a,b),this)}),Xb(["row().child.show()","row().child().show()"],function(){Fc.call(this,!0)}),Xb(["row().child.hide()","row().child().hide()"],function(){Fc.call(this,!1)}),Xb("row().child.isShown()",function(){var a=this.context;return a.length&&this.length?a[0].aoData[this[0]]._detailsShow||!1:!1});var Hc=/^(.*):(name|visIdx|visible)$/,Ic=function(a,b){var c=a.aoColumns,e=jc(c,"sName"),f=jc(c,"nTh");return zc(b,function(b){var g=ec(b);if(""===b)return lc(c.length);if(null!==g)return[g>=0?g:c.length+g];var h=b.match(Hc);if(!h)return d(f).filter(b).map(function(){return d.inArray(this,f)}).toArray();switch(h[2]){case"visIdx":case"visible":var i=parseInt(h[1],10);if(0>i){var j=d.map(c,function(a,b){return a.bVisible?b:null});return[j[j.length+i]]}return[n(a,i)];case"name":return d.map(e,function(a,b){return a===h[1]?b:null})}})},Jc=function(a,b,e){var f,g,h,i,j=a.aoColumns,k=j[b],l=a.aoData;if(e===c)return k.bVisible;if(k.bVisible!==e){if(e){var n=d.inArray(!0,jc(j,"bVisible"),b+1);for(g=0,h=l.length;h>g;g++)i=l[g].nTr,f=l[g].anCells,i&&i.insertBefore(f[b],f[n]||null)}else d(jc(a.aoData,"anCells",b)).detach(),k.bVisible=!1,L(a,a.aoHeader),L(a,a.aoFooter),Fb(a);k.bVisible=e,L(a,a.aoHeader),L(a,a.aoFooter),m(a),(a.oScroll.sX||a.oScroll.sY)&&ob(a),Nb(a,null,"column-visibility",[a,b,e]),Fb(a)}};Xb("columns()",function(a,b){a===c?a="":d.isPlainObject(a)&&(b=a,a=""),b=Ac(b);var e=this.iterator("table",function(c){return Ic(c,a,b)});return e.selector.cols=a,e.selector.opts=b,e}),Yb("columns().header()","column().header()",function(){return this.iterator("column",function(a,b){return a.aoColumns[b].nTh})}),Yb("columns().footer()","column().footer()",function(){return this.iterator("column",function(a,b){return a.aoColumns[b].nTf})}),Yb("columns().data()","column().data()",function(){return this.iterator("column-rows",function(a,b,c,d,e){for(var f=[],g=0,h=e.length;h>g;g++)f.push(y(a,e[g],b,""));return f})}),Yb("columns().cache()","column().cache()",function(a){return this.iterator("column-rows",function(b,c,d,e,f){return kc(b.aoData,f,"search"===a?"_aFilterData":"_aSortData",c)})}),Yb("columns().nodes()","column().nodes()",function(){return this.iterator("column-rows",function(a,b,c,d,e){return kc(a.aoData,e,"anCells",b)})}),Yb("columns().visible()","column().visible()",function(a){return this.iterator("column",function(b,c){return Jc(b,c,a)})}),Yb("columns().indexes()","column().index()",function(a){return this.iterator("column",function(b,c){return"visible"===a?o(b,c):c})}),Xb("columns.adjust()",function(){return this.iterator("table",function(a){m(a)})}),Xb("column.index()",function(a,b){if(0!==this.context.length){var c=this.context[0];if("fromVisible"===a||"toData"===a)return o(c,b);if("fromData"===a||"toVisible"===a)return n(c,b)}}),Xb("column()",function(a,b){return Bc(this.columns(a,b))});var Kc=function(a,b,c){var e,f,g,h,i,j=a.aoData,k=Cc(a,c),l=kc(j,k,"anCells"),m=d([].concat.apply([],l)),n=a.aoColumns.length;return zc(b,function(a){if(!a){for(f=[],g=0,h=k.length;h>g;g++)for(e=k[g],i=0;n>i;i++)f.push({"row":e,"column":i});return f}return m.filter(a).map(function(a,b){return e=b.parentNode._DT_RowIndex,{"row":e,"column":d.inArray(b,j[e].anCells)}})})};Xb("cells()",function(a,b,e){if(d.isPlainObject(a)&&(e=a,a=null),d.isPlainObject(b)&&(e=b,b=null),null===b||b===c)return this.iterator("table",function(b){return Kc(b,a,Ac(e))});var f,g,h,i,j,k=this.columns(b,e),l=this.rows(a,e),m=this.iterator("table",function(a,b){for(f=[],g=0,h=l[b].length;h>g;g++)for(i=0,j=k[b].length;j>i;i++)f.push({"row":l[b][g],"column":k[b][i]});return f});return d.extend(m.selector,{"cols":b,"rows":a,"opts":e}),m}),Yb("cells().nodes()","cell().node()",function(){return this.iterator("cell",function(a,b,c){return a.aoData[b].anCells[c]})}),Xb("cells().data()",function(){return this.iterator("cell",function(a,b,c){return y(a,b,c)})}),Yb("cells().cache()","cell().cache()",function(a){return a="search"===a?"_aFilterData":"_aSortData",this.iterator("cell",function(b,c,d){return b.aoData[c][a][d]})}),Yb("cells().indexes()","cell().index()",function(){return this.iterator("cell",function(a,b,c){return{"row":b,"column":c,"columnVisible":o(a,c)}})}),Xb(["cells().invalidate()","cell().invalidate()"],function(a){var b=this.selector;return this.rows(b.rows,b.opts).invalidate(a),this}),Xb("cell()",function(a,b,c){return Bc(this.cells(a,b,c))}),Xb("cell().data()",function(a){var b=this.context,d=this[0];return a===c?b.length&&d.length?y(b[0],d[0].row,d[0].column):c:(z(b[0],d[0].row,d[0].column,a),G(b[0],d[0].row,"data",d[0].column),this)}),Xb("order()",function(a,b){var e=this.context;return a===c?0!==e.length?e[0].aaSorting:c:("number"==typeof a?a=[[a,b]]:d.isArray(a[0])||(a=Array.prototype.slice.call(arguments)),this.iterator("table",function(b){b.aaSorting=a.slice()}))}),Xb("order.listener()",function(a,b,c){return this.iterator("table",function(d){Cb(d,a,b,c)})}),Xb(["columns().order()","column().order()"],function(a){var b=this;return this.iterator("table",function(c,e){var f=[];d.each(b[e],function(b,c){f.push([c,a])}),c.aaSorting=f})}),Xb("search()",function(a,b,e,f){var g=this.context;return a===c?0!==g.length?g[0].oPreviousSearch.sSearch:c:this.iterator("table",function(c){c.oFeatures.bFilter&&X(c,d.extend({},c.oPreviousSearch,{"sSearch":a+"","bRegex":null===b?!1:b,"bSmart":null===e?!0:e,"bCaseInsensitive":null===f?!0:f}),1)
|
|
})}),Xb(["columns().search()","column().search()"],function(a,b,e,f){return this.iterator("column",function(g,h){var i=g.aoPreSearchCols;return a===c?i[h].sSearch:void(g.oFeatures.bFilter&&(d.extend(i[h],{"sSearch":a+"","bRegex":null===b?!1:b,"bSmart":null===e?!0:e,"bCaseInsensitive":null===f?!0:f}),X(g,g.oPreviousSearch,1)))})}),Ub.versionCheck=Ub.fnVersionCheck=function(a){for(var b,c,d=Ub.version.split("."),e=a.split("."),f=0,g=e.length;g>f;f++)if(b=parseInt(d[f],10)||0,c=parseInt(e[f],10)||0,b!==c)return b>c;return!0},Ub.isDataTable=Ub.fnIsDataTable=function(a){var b=d(a).get(0),c=!1;return d.each(Ub.settings,function(a,d){(d.nTable===b||d.nScrollHead===b||d.nScrollFoot===b)&&(c=!0)}),c},Ub.tables=Ub.fnTables=function(a){return jQuery.map(Ub.settings,function(b){return!a||a&&d(b.nTable).is(":visible")?b.nTable:void 0})},Ub.camelToHungarian=f,Xb("$()",function(a,b){var c=this.rows(b).nodes(),e=d(c);return d([].concat(e.filter(a).toArray(),e.find(a).toArray()))}),d.each(["on","one","off"],function(a,b){Xb(b+"()",function(){var a=Array.prototype.slice.call(arguments);-1===a[0].indexOf(".dt")&&(a[0]+=".dt");var c=d(this.tables().nodes());return c[b].apply(c,a),this})}),Xb("clear()",function(){return this.iterator("table",function(a){E(a)})}),Xb("settings()",function(){return new Wb(this.context,this.context)}),Xb("data()",function(){return this.iterator("table",function(a){return jc(a.aoData,"_aData")}).flatten()}),Xb("destroy()",function(b){return b=b||!1,this.iterator("table",function(c){var e,f=c.nTableWrapper.parentNode,g=c.oClasses,h=c.nTable,i=c.nTBody,j=c.nTHead,k=c.nTFoot,l=d(h),m=d(i),n=d(c.nTableWrapper),o=d.map(c.aoData,function(a){return a.nTr});c.bDestroying=!0,Nb(c,"aoDestroyCallback","destroy",[c]),b||new Wb(c).columns().visible(!0),n.unbind(".DT").find(":not(tbody *)").unbind(".DT"),d(a).unbind(".DT-"+c.sInstance),h!=j.parentNode&&(l.children("thead").remove(),l.append(j)),k&&h!=k.parentNode&&(l.children("tfoot").remove(),l.append(k)),l.remove(),n.remove(),c.aaSorting=[],c.aaSortingFixed=[],Db(c),d(o).removeClass(c.asStripeClasses.join(" ")),d("th, td",j).removeClass(g.sSortable+" "+g.sSortableAsc+" "+g.sSortableDesc+" "+g.sSortableNone),c.bJUI&&(d("th span."+g.sSortIcon+", td span."+g.sSortIcon,j).remove(),d("th, td",j).each(function(){var a=d("div."+g.sSortJUIWrapper,this);d(this).append(a.contents()),a.remove()})),b||f.insertBefore(h,c.nTableReinsertBefore),m.children().detach(),m.append(o),l.css("width",c.sDestroyWidth).removeClass(g.sTable),e=c.asDestroyStripes.length,e&&m.children().each(function(a){d(this).addClass(c.asDestroyStripes[a%e])});var p=d.inArray(c,Ub.settings);-1!==p&&Ub.settings.splice(p,1)})}),Ub.version="1.10.0-beta.2",Ub.settings=[],Ub.models={},Ub.models.oSearch={"bCaseInsensitive":!0,"sSearch":"","bRegex":!1,"bSmart":!0},Ub.models.oRow={"nTr":null,"anCells":null,"_aData":[],"_aSortData":null,"_aFilterData":null,"_sFilterRow":null,"_sRowStripe":"","src":null},Ub.models.oColumn={"idx":null,"aDataSort":null,"asSorting":null,"bSearchable":null,"bSortable":null,"bVisible":null,"_sManualType":null,"_bAttrSrc":!1,"fnCreatedCell":null,"fnGetData":null,"fnSetData":null,"mData":null,"mRender":null,"nTh":null,"nTf":null,"sClass":null,"sContentPadding":null,"sDefaultContent":null,"sName":null,"sSortDataType":"std","sSortingClass":null,"sSortingClassJUI":null,"sTitle":null,"sType":null,"sWidth":null,"sWidthOrig":null},Ub.defaults={"aaData":null,"aaSorting":[[0,"asc"]],"aaSortingFixed":[],"ajax":null,"aLengthMenu":[10,25,50,100],"aoColumns":null,"aoColumnDefs":null,"aoSearchCols":[],"asStripeClasses":null,"bAutoWidth":!0,"bDeferRender":!1,"bDestroy":!1,"bFilter":!0,"bInfo":!0,"bJQueryUI":!1,"bLengthChange":!0,"bPaginate":!0,"bProcessing":!1,"bRetrieve":!1,"bScrollCollapse":!1,"bServerSide":!1,"bSort":!0,"bSortMulti":!0,"bSortCellsTop":!1,"bSortClasses":!0,"bStateSave":!1,"fnCreatedRow":null,"fnDrawCallback":null,"fnFooterCallback":null,"fnFormatNumber":function(a){return a.toString().replace(/\B(?=(\d{3})+(?!\d))/g,this.oLanguage.sThousands)},"fnHeaderCallback":null,"fnInfoCallback":null,"fnInitComplete":null,"fnPreDrawCallback":null,"fnRowCallback":null,"fnServerData":null,"fnServerParams":null,"fnStateLoadCallback":function(b){try{return JSON.parse(localStorage.getItem("DataTables_"+b.sInstance+"_"+a.location.pathname))}catch(c){}},"fnStateLoadParams":null,"fnStateLoaded":null,"fnStateSaveCallback":function(b,c){try{localStorage.setItem("DataTables_"+b.sInstance+"_"+a.location.pathname,JSON.stringify(c))}catch(d){}},"fnStateSaveParams":null,"iStateDuration":7200,"iDeferLoading":null,"iDisplayLength":10,"iDisplayStart":0,"iTabIndex":0,"oClasses":{},"oLanguage":{"oAria":{"sSortAscending":": activate to sort column ascending","sSortDescending":": activate to sort column descending"},"oPaginate":{"sFirst":"First","sLast":"Last","sNext":"Next","sPrevious":"Previous"},"sEmptyTable":"No data available in table","sInfo":"Showing _START_ to _END_ of _TOTAL_ entries","sInfoEmpty":"Showing 0 to 0 of 0 entries","sInfoFiltered":"(filtered from _MAX_ total entries)","sInfoPostFix":"","sDecimal":"","sThousands":",","sLengthMenu":"Show _MENU_ entries","sLoadingRecords":"Loading...","sProcessing":"Processing...","sSearch":"Search:","sUrl":"","sZeroRecords":"No matching records found"},"oSearch":d.extend({},Ub.models.oSearch),"sAjaxDataProp":"data","sAjaxSource":null,"sDom":"lfrtip","sPaginationType":"simple_numbers","sScrollX":"","sScrollXInner":"","sScrollY":"","sServerMethod":"GET","renderer":null},e(Ub.defaults),Ub.defaults.column={"aDataSort":null,"iDataSort":-1,"asSorting":["asc","desc"],"bSearchable":!0,"bSortable":!0,"bVisible":!0,"fnCreatedCell":null,"mData":null,"mRender":null,"sCellType":"td","sClass":"","sContentPadding":"","sDefaultContent":null,"sName":"","sSortDataType":"std","sTitle":null,"sType":null,"sWidth":null},e(Ub.defaults.column),Ub.models.oSettings={"oFeatures":{"bAutoWidth":null,"bDeferRender":null,"bFilter":null,"bInfo":null,"bLengthChange":null,"bPaginate":null,"bProcessing":null,"bServerSide":null,"bSort":null,"bSortMulti":null,"bSortClasses":null,"bStateSave":null},"oScroll":{"bCollapse":null,"iBarWidth":0,"sX":null,"sXInner":null,"sY":null},"oLanguage":{"fnInfoCallback":null},"oBrowser":{"bScrollOversize":!1,"bScrollbarLeft":!1},"ajax":null,"aanFeatures":[],"aoData":[],"aiDisplay":[],"aiDisplayMaster":[],"aoColumns":[],"aoHeader":[],"aoFooter":[],"oPreviousSearch":{},"aoPreSearchCols":[],"aaSorting":null,"aaSortingFixed":[],"asStripeClasses":null,"asDestroyStripes":[],"sDestroyWidth":0,"aoRowCallback":[],"aoHeaderCallback":[],"aoFooterCallback":[],"aoDrawCallback":[],"aoRowCreatedCallback":[],"aoPreDrawCallback":[],"aoInitComplete":[],"aoStateSaveParams":[],"aoStateLoadParams":[],"aoStateLoaded":[],"sTableId":"","nTable":null,"nTHead":null,"nTFoot":null,"nTBody":null,"nTableWrapper":null,"bDeferLoading":!1,"bInitialised":!1,"aoOpenRows":[],"sDom":null,"sPaginationType":"two_button","iStateDuration":0,"aoStateSave":[],"aoStateLoad":[],"oLoadedState":null,"sAjaxSource":null,"sAjaxDataProp":null,"bAjaxDataGet":!0,"jqXHR":null,"json":c,"fnServerData":null,"aoServerParams":[],"sServerMethod":null,"fnFormatNumber":null,"aLengthMenu":null,"iDraw":0,"bDrawing":!1,"iDrawError":-1,"_iDisplayLength":10,"_iDisplayStart":0,"_iRecordsTotal":0,"_iRecordsDisplay":0,"bJUI":null,"oClasses":{},"bFiltered":!1,"bSorted":!1,"bSortCellsTop":null,"oInit":null,"aoDestroyCallback":[],"fnRecordsTotal":function(){return"ssp"==Qb(this)?1*this._iRecordsTotal:this.aiDisplayMaster.length},"fnRecordsDisplay":function(){return"ssp"==Qb(this)?1*this._iRecordsDisplay:this.aiDisplay.length},"fnDisplayEnd":function(){var a=this._iDisplayLength,b=this._iDisplayStart,c=b+a,d=this.aiDisplay.length,e=this.oFeatures,f=e.bPaginate;return e.bServerSide?f===!1||-1===a?b+d:Math.min(b+a,this._iRecordsDisplay):!f||c>d||-1===a?d:c},"oInstance":null,"sInstance":null,"iTabIndex":0,"nScrollHead":null,"nScrollFoot":null,"aLastSort":[],"oPlugins":{}},Ub.ext=Vb={"classes":{},"errMode":"alert","feature":[],"search":[],"internal":{},"legacy":{"ajax":null},"pager":{},"renderer":{"pageButton":{},"header":{}},"order":{},"type":{"detect":[],"search":{},"order":{}},"_unique":0,"fnVersionCheck":Ub.fnVersionCheck,"iApiIndex":0,"oJUIClasses":{},"sVersion":Ub.version},d.extend(Vb,{"afnFiltering":Vb.search,"aTypes":Vb.type.detect,"ofnSearch":Vb.type.search,"oSort":Vb.type.order,"afnSortData":Vb.order,"aoFeatures":Vb.feature,"oApi":Vb.internal,"oStdClasses":Vb.classes,"oPagination":Vb.pager}),d.extend(Ub.ext.classes,{"sTable":"dataTable","sNoFooter":"no-footer","sPageButton":"paginate_button","sPageButtonActive":"current","sPageButtonDisabled":"disabled","sStripeOdd":"odd","sStripeEven":"even","sRowEmpty":"dataTables_empty","sWrapper":"dataTables_wrapper","sFilter":"dataTables_filter","sInfo":"dataTables_info","sPaging":"dataTables_paginate paging_","sLength":"dataTables_length","sProcessing":"dataTables_processing","sSortAsc":"sorting_asc","sSortDesc":"sorting_desc","sSortable":"sorting","sSortableAsc":"sorting_asc_disabled","sSortableDesc":"sorting_desc_disabled","sSortableNone":"sorting_disabled","sSortColumn":"sorting_","sFilterInput":"","sLengthSelect":"","sScrollWrapper":"dataTables_scroll","sScrollHead":"dataTables_scrollHead","sScrollHeadInner":"dataTables_scrollHeadInner","sScrollBody":"dataTables_scrollBody","sScrollFoot":"dataTables_scrollFoot","sScrollFootInner":"dataTables_scrollFootInner","sHeaderTH":"","sFooterTH":"","sSortJUIAsc":"","sSortJUIDesc":"","sSortJUI":"","sSortJUIAscAllowed":"","sSortJUIDescAllowed":"","sSortJUIWrapper":"","sSortIcon":"","sJUIHeader":"","sJUIFooter":""}),function(){var a="";a="";var b=a+"ui-state-default",c=a+"css_right ui-icon ui-icon-",e=a+"fg-toolbar ui-toolbar ui-widget-header ui-helper-clearfix";d.extend(Ub.ext.oJUIClasses,Ub.ext.classes,{"sPageButton":"fg-button ui-button "+b,"sPageButtonActive":"ui-state-disabled","sPageButtonDisabled":"ui-state-disabled","sPaging":"dataTables_paginate fg-buttonset ui-buttonset fg-buttonset-multi ui-buttonset-multi paging_","sSortAsc":b+" sorting_asc","sSortDesc":b+" sorting_desc","sSortable":b+" sorting","sSortableAsc":b+" sorting_asc_disabled","sSortableDesc":b+" sorting_desc_disabled","sSortableNone":b+" sorting_disabled","sSortJUIAsc":c+"triangle-1-n","sSortJUIDesc":c+"triangle-1-s","sSortJUI":c+"carat-2-n-s","sSortJUIAscAllowed":c+"carat-1-n","sSortJUIDescAllowed":c+"carat-1-s","sSortJUIWrapper":"DataTables_sort_wrapper","sSortIcon":"DataTables_sort_icon","sScrollHead":"dataTables_scrollHead "+b,"sScrollFoot":"dataTables_scrollFoot "+b,"sHeaderTH":b,"sFooterTH":b,"sJUIHeader":e+" ui-corner-tl ui-corner-tr","sJUIFooter":e+" ui-corner-bl ui-corner-br"})}();var Lc=Ub.ext.pager;d.extend(Lc,{"simple":function(){return["previous","next"]},"full":function(){return["first","previous","next","last"]},"simple_numbers":function(a,b){return["previous",Rb(a,b),"next"]},"full_numbers":function(a,b){return["first","previous",Rb(a,b),"next","last"]},"_numbers":Rb,"numbers_length":7}),d.extend(!0,Ub.ext.renderer,{"pageButton":{"_":function(a,b,c,e,f,g){var h,i,j=a.oClasses,k=a.oLanguage.oPaginate,l=function(b,e){var m,n,o,p,q=function(b){kb(a,b.data.action,!0)};for(m=0,n=e.length;n>m;m++)if(p=e[m],d.isArray(p)){var r=d("<"+(p.DT_el||"div")+"/>").appendTo(b);l(r,p)}else{switch(h="",i="",p){case"ellipsis":b.append("<span>…</span>");break;case"first":h=k.sFirst,i=p+(f>0?"":" "+j.sPageButtonDisabled);break;case"previous":h=k.sPrevious,i=p+(f>0?"":" "+j.sPageButtonDisabled);break;case"next":h=k.sNext,i=p+(g-1>f?"":" "+j.sPageButtonDisabled);break;case"last":h=k.sLast,i=p+(g-1>f?"":" "+j.sPageButtonDisabled);break;default:h=p+1,i=f===p?j.sPageButtonActive:""}h&&(o=d("<a>",{"class":j.sPageButton+" "+i,"aria-controls":a.sTableId,"tabindex":a.iTabIndex,"id":0===c&&"string"==typeof p?a.sTableId+"_"+p:null}).html(h).appendTo(b),Lb(o,{"action":p},q))}};l(d(b).empty(),e)}}});var Mc=function(a,b,c,d){return a&&"-"!==a?(b&&(a=fc(a,b)),a.replace&&(c&&(a=a.replace(c,"")),d&&(a=a.replace(d,""))),1*a):-1/0};return d.extend(Vb.type.order,{"date-pre":function(a){return Date.parse(a)||0},"html-pre":function(a){return a.replace?a.replace(/<.*?>/g,"").toLowerCase():a+""},"string-pre":function(a){return"string"==typeof a?a.toLowerCase():a&&a.toString?a.toString():""},"string-asc":function(a,b){return b>a?-1:a>b?1:0},"string-desc":function(a,b){return b>a?1:a>b?-1:0}}),Sb(""),d.extend(Ub.ext.type.detect,[function(a,b){var c=b.oLanguage.sDecimal;return gc(a,c)?"num"+c:null},function(a){if(a&&!ac.test(a))return null;var b=Date.parse(a);return null!==b&&!isNaN(b)||dc(a)?"date":null},function(a,b){var c=b.oLanguage.sDecimal;return gc(a,c,!0)?"num-fmt"+c:null},function(a,b){var c=b.oLanguage.sDecimal;return ic(a,c)?"html-num"+c:null},function(a,b){var c=b.oLanguage.sDecimal;return ic(a,c,!0)?"html-num-fmt"+c:null},function(a){return dc(a)||"string"==typeof a&&-1!==a.indexOf("<")?"html":null}]),d.extend(Ub.ext.type.search,{"html":function(a){return dc(a)?"":"string"==typeof a?a.replace($b," ").replace(_b,""):""},"string":function(a){return dc(a)?"":"string"==typeof a?a.replace($b," "):a}}),d.extend(!0,Ub.ext.renderer,{"header":{"_":function(a,b,c,e){d(a.nTable).on("order.dt",function(a,d,f,g){var h=c.idx;b.removeClass(c.sSortingClass+" "+e.sSortAsc+" "+e.sSortDesc).addClass("asc"==g[h]?e.sSortAsc:"desc"==g[h]?e.sSortDesc:c.sSortingClass)})},"jqueryui":function(a,b,c,e){var f=c.idx;d("<div/>").addClass(e.sSortJUIWrapper).append(b.contents()).append(d("<span/>").addClass(e.sSortIcon+" "+c.sSortingClassJUI)).appendTo(b),d(a.nTable).on("order.dt",function(a,d,g,h){b.removeClass(e.sSortAsc+" "+e.sSortDesc).addClass("asc"==h[f]?e.sSortAsc:"desc"==h[f]?e.sSortDesc:c.sSortingClass),b.find("span").removeClass(e.sSortJUIAsc+" "+e.sSortJUIDesc+" "+e.sSortJUI+" "+e.sSortJUIAscAllowed+" "+e.sSortJUIDescAllowed).addClass("asc"==h[f]?e.sSortJUIAsc:"desc"==h[f]?e.sSortJUIDesc:c.sSortingClassJUI)})}}}),d.extend(Ub.ext.internal,{"_fnExternApiFunc":Tb,"_fnBuildAjax":R,"_fnAjaxUpdate":S,"_fnAjaxParameters":T,"_fnAjaxUpdateDraw":U,"_fnAjaxDataSrc":V,"_fnAddColumn":k,"_fnColumnOptions":l,"_fnAdjustColumnSizing":m,"_fnVisibleToColumnIndex":n,"_fnColumnIndexToVisible":o,"_fnVisbleColumns":p,"_fnGetColumns":q,"_fnColumnTypes":r,"_fnApplyColumnDefs":s,"_fnHungarianMap":e,"_fnCamelToHungarian":f,"_fnLanguageCompat":g,"_fnBrowserDetect":j,"_fnAddData":t,"_fnAddTr":u,"_fnNodeToDataIndex":v,"_fnNodeToColumnIndex":w,"_fnGetRowData":x,"_fnGetCellData":y,"_fnSetCellData":z,"_fnSplitObjNotation":A,"_fnGetObjectDataFn":B,"_fnSetObjectDataFn":C,"_fnGetDataMaster":D,"_fnClearTable":E,"_fnDeleteIndex":F,"_fnInvalidateRow":G,"_fnGetRowElements":H,"_fnCreateTr":I,"_fnBuildHead":K,"_fnDrawHead":L,"_fnDraw":M,"_fnReDraw":N,"_fnAddOptionsHtml":O,"_fnDetectHeader":P,"_fnGetUniqueThs":Q,"_fnFeatureHtmlFilter":W,"_fnFilterComplete":X,"_fnFilterCustom":Y,"_fnFilterColumn":Z,"_fnFilter":$,"_fnFilterCreateSearch":_,"_fnEscapeRegex":ab,"_fnFilterData":bb,"_fnFeatureHtmlInfo":cb,"_fnUpdateInfo":db,"_fnInfoMacros":eb,"_fnInitialise":fb,"_fnInitComplete":gb,"_fnLengthChange":hb,"_fnFeatureHtmlLength":ib,"_fnFeatureHtmlPaginate":jb,"_fnPageChange":kb,"_fnFeatureHtmlProcessing":lb,"_fnProcessingDisplay":mb,"_fnFeatureHtmlTable":nb,"_fnScrollDraw":ob,"_fnApplyToChildren":pb,"_fnCalculateColumnWidths":qb,"_fnThrottle":rb,"_fnConvertToWidth":sb,"_fnScrollingWidthAdjust":tb,"_fnGetWidestNode":ub,"_fnGetMaxLenString":vb,"_fnStringToCss":wb,"_fnScrollBarWidth":xb,"_fnSortFlatten":yb,"_fnSort":zb,"_fnSortAria":Ab,"_fnSortListener":Bb,"_fnSortAttachListener":Cb,"_fnSortingClasses":Db,"_fnSortData":Eb,"_fnSaveState":Fb,"_fnLoadState":Gb,"_fnSettingsFromNode":Hb,"_fnLog":Ib,"_fnMap":Jb,"_fnBindAction":Lb,"_fnCallbackReg":Mb,"_fnCallbackFire":Nb,"_fnLengthOverflow":Ob,"_fnRenderer":Pb,"_fnDataSource":Qb,"_fnRowAttributes":J,"_fnCalculateEnd":function(){}}),d.fn.dataTable=Ub,d.fn.dataTableSettings=Ub.settings,d.fn.dataTableExt=Ub.ext,d.fn.DataTable=function(a){return d(this).dataTable(a).api()},d.each(Ub,function(a,b){d.fn.DataTable[a]=b}),d.fn.dataTable})}(window,document),$.extend(!0,$.fn.dataTable.defaults,{"sDom":"<'table-header clearfix'<'table-caption'><'DT-lf-right'<'DT-per-page'l><'DT-search'f>>r>t<'table-footer clearfix'<'DT-label'i><'DT-pagination'p>>","oLanguage":{"sLengthMenu":"Per page: _MENU_","sSearch":""}}),$.extend($.fn.dataTableExt.oStdClasses,{"sWrapper":"dataTables_wrapper form-inline","sFilterInput":"form-control input-sm","sLengthSelect":"form-control input-sm"}),$.fn.dataTable.Api?($.fn.dataTable.defaults.renderer="bootstrap",$.fn.dataTable.ext.renderer.pageButton.bootstrap=function(a,b,c,d,e,f){var g,h,i=new $.fn.dataTable.Api(a),j=a.oClasses,k=a.oLanguage.oPaginate,l=function(b,d){var m,n,o,p,q=function(a){a.preventDefault(),"ellipsis"!==a.data.action&&i.page(a.data.action).draw(!1)};for(m=0,n=d.length;n>m;m++)if(p=d[m],$.isArray(p))l(b,p);else{switch(g="",h="",p){case"ellipsis":g="…",h="disabled";break;case"first":g=k.sFirst,h=p+(e>0?"":" disabled");break;case"previous":g=k.sPrevious,h=p+(e>0?"":" disabled");break;case"next":g=k.sNext,h=p+(f-1>e?"":" disabled");break;case"last":g=k.sLast,h=p+(f-1>e?"":" disabled");break;default:g=p+1,h=e===p?"active":""}g&&(o=$("<li>",{"class":j.sPageButton+" "+h,"aria-controls":a.sTableId,"tabindex":a.iTabIndex,"id":0===c&&"string"==typeof p?a.sTableId+"_"+p:null}).append($("<a>",{"href":"#"}).html(g)).appendTo(b),a.oApi._fnBindAction(o,{"action":p},q))}};l($(b).empty().html('<ul class="pagination"/>').children("ul"),d)}):($.fn.dataTable.defaults.sPaginationType="bootstrap",$.fn.dataTableExt.oApi.fnPagingInfo=function(a){return{"iStart":a._iDisplayStart,"iEnd":a.fnDisplayEnd(),"iLength":a._iDisplayLength,"iTotal":a.fnRecordsTotal(),"iFilteredTotal":a.fnRecordsDisplay(),"iPage":-1===a._iDisplayLength?0:Math.ceil(a._iDisplayStart/a._iDisplayLength),"iTotalPages":-1===a._iDisplayLength?0:Math.ceil(a.fnRecordsDisplay()/a._iDisplayLength)}},$.extend($.fn.dataTableExt.oPagination,{"bootstrap":{"fnInit":function(a,b,c){var d=a.oLanguage.oPaginate,e=function(b){b.preventDefault(),a.oApi._fnPageChange(a,b.data.action)&&c(a)};$(b).append('<ul class="pagination"><li class="prev disabled"><a href="#">← '+d.sPrevious+'</a></li><li class="next disabled"><a href="#">'+d.sNext+" → </a></li></ul>");var f=$("a",b);$(f[0]).bind("click.DT",{"action":"previous"},e),$(f[1]).bind("click.DT",{"action":"next"},e)},"fnUpdate":function(a,b){var c,d,e,f,g,h,i=5,j=a.oInstance.fnPagingInfo(),k=a.aanFeatures.p,l=Math.floor(i/2);for(j.iTotalPages<i?(g=1,h=j.iTotalPages):j.iPage<=l?(g=1,h=i):j.iPage>=j.iTotalPages-l?(g=j.iTotalPages-i+1,h=j.iTotalPages):(g=j.iPage-l+1,h=g+i-1),c=0,d=k.length;d>c;c++){for($("li:gt(0)",k[c]).filter(":not(:last)").remove(),e=g;h>=e;e++)f=e==j.iPage+1?'class="active"':"",$("<li "+f+'><a href="#">'+e+"</a></li>").insertBefore($("li:last",k[c])[0]).bind("click",function(c){c.preventDefault(),a._iDisplayStart=(parseInt($("a",this).text(),10)-1)*j.iLength,b(a)});0===j.iPage?$("li:first",k[c]).addClass("disabled"):$("li:first",k[c]).removeClass("disabled"),j.iPage===j.iTotalPages-1||0===j.iTotalPages?$("li:last",k[c]).addClass("disabled"):$("li:last",k[c]).removeClass("disabled")}}}})),$.fn.DataTable.TableTools&&($.extend(!0,$.fn.DataTable.TableTools.classes,{"container":"DTTT btn-group","buttons":{"normal":"btn btn-default","disabled":"disabled"},"collection":{"container":"DTTT_dropdown dropdown-menu","buttons":{"normal":"","disabled":"disabled"}},"print":{"info":"DTTT_print_info modal"},"select":{"row":"active"}}),$.extend(!0,$.fn.DataTable.TableTools.DEFAULTS.oTags,{"collection":{"container":"ul","button":"li","liner":"a"}})),Emitter.prototype.on=function(a,b){return this._callbacks=this._callbacks||{},(this._callbacks[a]=this._callbacks[a]||[]).push(b),this},Emitter.prototype.once=function(a,b){function c(){d.off(a,c),b.apply(this,arguments)}var d=this;return this._callbacks=this._callbacks||{},b._off=c,this.on(a,c),this},Emitter.prototype.off=Emitter.prototype.removeListener=Emitter.prototype.removeAllListeners=function(a,b){this._callbacks=this._callbacks||{};var c=this._callbacks[a];if(!c)return this;if(1==arguments.length)return delete this._callbacks[a],this;var d=c.indexOf(b._off||b);return~d&&c.splice(d,1),this},Emitter.prototype.emit=function(a){this._callbacks=this._callbacks||{};var b=[].slice.call(arguments,1),c=this._callbacks[a];if(c){c=c.slice(0);for(var d=0,e=c.length;e>d;++d)c[d].apply(this,b)}return this},Emitter.prototype.listeners=function(a){return this._callbacks=this._callbacks||{},this._callbacks[a]||[]},Emitter.prototype.hasListeners=function(a){return!!this.listeners(a).length},function(){var a,b,c,d,e,f,g,h,i={}.hasOwnProperty,j=function(a,b){function c(){this.constructor=a}for(var d in b)i.call(b,d)&&(a[d]=b[d]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},k=[].slice;b="undefined"!=typeof Emitter&&null!==Emitter?Emitter:require("emitter"),g=function(){},a=function(a){function b(a,d){var e,f,g;if(this.element=a,this.version=b.version,this.defaultOptions.previewTemplate=this.defaultOptions.previewTemplate.replace(/\n*/g,""),this.clickableElements=[],this.listeners=[],this.files=[],"string"==typeof this.element&&(this.element=document.querySelector(this.element)),!this.element||null==this.element.nodeType)throw new Error("Invalid dropzone element.");if(this.element.dropzone)throw new Error("Dropzone already attached.");if(b.instances.push(this),this.element.dropzone=this,e=null!=(g=b.optionsForElement(this.element))?g:{},this.options=c({},this.defaultOptions,e,null!=d?d:{}),this.options.forceFallback||!b.isBrowserSupported())return this.options.fallback.call(this);if(null==this.options.url&&(this.options.url=this.element.getAttribute("action")),!this.options.url)throw new Error("No URL provided.");if(this.options.acceptedFiles&&this.options.acceptedMimeTypes)throw new Error("You can't provide both 'acceptedFiles' and 'acceptedMimeTypes'. 'acceptedMimeTypes' is deprecated.");this.options.acceptedMimeTypes&&(this.options.acceptedFiles=this.options.acceptedMimeTypes,delete this.options.acceptedMimeTypes),this.options.method=this.options.method.toUpperCase(),(f=this.getExistingFallback())&&f.parentNode&&f.parentNode.removeChild(f),this.previewsContainer=this.options.previewsContainer?b.getElement(this.options.previewsContainer,"previewsContainer"):this.element,this.options.clickable&&(this.clickableElements=this.options.clickable===!0?[this.element]:b.getElements(this.options.clickable,"clickable")),this.init()}var c;return j(b,a),b.prototype.events=["drop","dragstart","dragend","dragenter","dragover","dragleave","addedfile","removedfile","thumbnail","error","errormultiple","processing","processingmultiple","uploadprogress","totaluploadprogress","sending","sendingmultiple","success","successmultiple","canceled","canceledmultiple","complete","completemultiple","reset","maxfilesexceeded","maxfilesreached"],b.prototype.defaultOptions={"url":null,"method":"post","withCredentials":!1,"parallelUploads":2,"uploadMultiple":!1,"maxFilesize":256,"paramName":"file","createImageThumbnails":!0,"maxThumbnailFilesize":10,"thumbnailWidth":100,"thumbnailHeight":100,"maxFiles":null,"params":{},"clickable":!0,"ignoreHiddenFiles":!0,"acceptedFiles":null,"acceptedMimeTypes":null,"autoProcessQueue":!0,"addRemoveLinks":!1,"previewsContainer":null,"dictDefaultMessage":"Drop files here to upload","dictFallbackMessage":"Your browser does not support drag'n'drop file uploads.","dictFallbackText":"Please use the fallback form below to upload your files like in the olden days.","dictFileTooBig":"File is too big ({{filesize}}MiB). Max filesize: {{maxFilesize}}MiB.","dictInvalidFileType":"You can't upload files of this type.","dictResponseError":"Server responded with {{statusCode}} code.","dictCancelUpload":"Cancel upload","dictCancelUploadConfirmation":"Are you sure you want to cancel this upload?","dictRemoveFile":"Remove file","dictRemoveFileConfirmation":null,"dictMaxFilesExceeded":"You can not upload any more files.","accept":function(a,b){return b()},"init":function(){return g},"forceFallback":!1,"fallback":function(){var a,c,d,e,f,g;for(this.element.className=""+this.element.className+" dz-browser-not-supported",g=this.element.getElementsByTagName("div"),e=0,f=g.length;f>e;e++)a=g[e],/(^| )dz-message($| )/.test(a.className)&&(c=a,a.className="dz-message");return c||(c=b.createElement('<div class="dz-message"><span></span></div>'),this.element.appendChild(c)),d=c.getElementsByTagName("span")[0],d&&(d.textContent=this.options.dictFallbackMessage),this.element.appendChild(this.getFallbackForm())},"resize":function(a){var b,c,d;return b={"srcX":0,"srcY":0,"srcWidth":a.width,"srcHeight":a.height},c=a.width/a.height,d=this.options.thumbnailWidth/this.options.thumbnailHeight,a.height<this.options.thumbnailHeight||a.width<this.options.thumbnailWidth?(b.trgHeight=b.srcHeight,b.trgWidth=b.srcWidth):c>d?(b.srcHeight=a.height,b.srcWidth=b.srcHeight*d):(b.srcWidth=a.width,b.srcHeight=b.srcWidth/d),b.srcX=(a.width-b.srcWidth)/2,b.srcY=(a.height-b.srcHeight)/2,b},"drop":function(){return this.element.classList.remove("dz-drag-hover")},"dragstart":g,"dragend":function(){return this.element.classList.remove("dz-drag-hover")},"dragenter":function(){return this.element.classList.add("dz-drag-hover")},"dragover":function(){return this.element.classList.add("dz-drag-hover")},"dragleave":function(){return this.element.classList.remove("dz-drag-hover")},"paste":g,"reset":function(){return this.element.classList.remove("dz-started")},"addedfile":function(a){var c,d,e,f,g,h,i,j,k,l,m,n,o,p=this;for(this.element===this.previewsContainer&&this.element.classList.add("dz-started"),a.previewElement=b.createElement(this.options.previewTemplate.trim()),a.previewTemplate=a.previewElement,this.previewsContainer.appendChild(a.previewElement),l=a.previewElement.querySelectorAll("[data-dz-name]"),f=0,i=l.length;i>f;f++)c=l[f],c.textContent=a.name;for(m=a.previewElement.querySelectorAll("[data-dz-size]"),g=0,j=m.length;j>g;g++)c=m[g],c.innerHTML=this.filesize(a.size);for(this.options.addRemoveLinks&&(a._removeLink=b.createElement('<a class="dz-remove" href="javascript:undefined;" data-dz-remove>'+this.options.dictRemoveFile+"</a>"),a.previewElement.appendChild(a._removeLink)),d=function(c){return c.preventDefault(),c.stopPropagation(),a.status===b.UPLOADING?b.confirm(p.options.dictCancelUploadConfirmation,function(){return p.removeFile(a)}):p.options.dictRemoveFileConfirmation?b.confirm(p.options.dictRemoveFileConfirmation,function(){return p.removeFile(a)}):p.removeFile(a)},n=a.previewElement.querySelectorAll("[data-dz-remove]"),o=[],h=0,k=n.length;k>h;h++)e=n[h],o.push(e.addEventListener("click",d));return o},"removedfile":function(a){var b;return null!=(b=a.previewElement)&&b.parentNode.removeChild(a.previewElement),this._updateMaxFilesReachedClass()},"thumbnail":function(a,b){var c,d,e,f,g;for(a.previewElement.classList.remove("dz-file-preview"),a.previewElement.classList.add("dz-image-preview"),f=a.previewElement.querySelectorAll("[data-dz-thumbnail]"),g=[],d=0,e=f.length;e>d;d++)c=f[d],c.alt=a.name,g.push(c.src=b);return g},"error":function(a,b){var c,d,e,f,g;for(a.previewElement.classList.add("dz-error"),"String"!=typeof b&&b.error&&(b=b.error),f=a.previewElement.querySelectorAll("[data-dz-errormessage]"),g=[],d=0,e=f.length;e>d;d++)c=f[d],g.push(c.textContent=b);return g},"errormultiple":g,"processing":function(a){return a.previewElement.classList.add("dz-processing"),a._removeLink?a._removeLink.textContent=this.options.dictCancelUpload:void 0},"processingmultiple":g,"uploadprogress":function(a,b){var c,d,e,f,g;for(f=a.previewElement.querySelectorAll("[data-dz-uploadprogress]"),g=[],d=0,e=f.length;e>d;d++)c=f[d],g.push(c.style.width=""+b+"%");return g},"totaluploadprogress":g,"sending":g,"sendingmultiple":g,"success":function(a){return a.previewElement.classList.add("dz-success")},"successmultiple":g,"canceled":function(a){return this.emit("error",a,"Upload canceled.")},"canceledmultiple":g,"complete":function(a){return a._removeLink?a._removeLink.textContent=this.options.dictRemoveFile:void 0},"completemultiple":g,"maxfilesexceeded":g,"maxfilesreached":g,"previewTemplate":'<div class="dz-preview dz-file-preview">\n <div class="dz-details">\n <div class="dz-filename"><span data-dz-name></span></div>\n <div class="dz-size" data-dz-size></div>\n <img data-dz-thumbnail />\n </div>\n <div class="dz-progress"><span class="dz-upload" data-dz-uploadprogress></span></div>\n <div class="dz-success-mark"><span>\u2714</span></div>\n <div class="dz-error-mark"><span>\u2718</span></div>\n <div class="dz-error-message"><span data-dz-errormessage></span></div>\n</div>'},c=function(){var a,b,c,d,e,f,g;for(d=arguments[0],c=2<=arguments.length?k.call(arguments,1):[],f=0,g=c.length;g>f;f++){b=c[f];for(a in b)e=b[a],d[a]=e}return d},b.prototype.getAcceptedFiles=function(){var a,b,c,d,e;for(d=this.files,e=[],b=0,c=d.length;c>b;b++)a=d[b],a.accepted&&e.push(a);return e},b.prototype.getRejectedFiles=function(){var a,b,c,d,e;for(d=this.files,e=[],b=0,c=d.length;c>b;b++)a=d[b],a.accepted||e.push(a);return e},b.prototype.getQueuedFiles=function(){var a,c,d,e,f;for(e=this.files,f=[],c=0,d=e.length;d>c;c++)a=e[c],a.status===b.QUEUED&&f.push(a);return f},b.prototype.getUploadingFiles=function(){var a,c,d,e,f;for(e=this.files,f=[],c=0,d=e.length;d>c;c++)a=e[c],a.status===b.UPLOADING&&f.push(a);return f},b.prototype.init=function(){var a,c,d,e,f,g,h,i=this;for("form"===this.element.tagName&&this.element.setAttribute("enctype","multipart/form-data"),this.element.classList.contains("dropzone")&&!this.element.querySelector(".dz-message")&&this.element.appendChild(b.createElement('<div class="dz-default dz-message"><span>'+this.options.dictDefaultMessage+"</span></div>")),this.clickableElements.length&&(d=function(){return i.hiddenFileInput&&document.body.removeChild(i.hiddenFileInput),i.hiddenFileInput=document.createElement("input"),i.hiddenFileInput.setAttribute("type","file"),(null==i.options.maxFiles||i.options.maxFiles>1)&&i.hiddenFileInput.setAttribute("multiple","multiple"),null!=i.options.acceptedFiles&&i.hiddenFileInput.setAttribute("accept",i.options.acceptedFiles),i.hiddenFileInput.style.visibility="hidden",i.hiddenFileInput.style.position="absolute",i.hiddenFileInput.style.top="0",i.hiddenFileInput.style.left="0",i.hiddenFileInput.style.height="0",i.hiddenFileInput.style.width="0",document.body.appendChild(i.hiddenFileInput),i.hiddenFileInput.addEventListener("change",function(){var a,b,c,e;if(b=i.hiddenFileInput.files,b.length)for(c=0,e=b.length;e>c;c++)a=b[c],i.addFile(a);return d()})})(),this.URL=null!=(g=window.URL)?g:window.webkitURL,h=this.events,e=0,f=h.length;f>e;e++)a=h[e],this.on(a,this.options[a]);return this.on("uploadprogress",function(){return i.updateTotalUploadProgress()}),this.on("removedfile",function(){return i.updateTotalUploadProgress()}),this.on("canceled",function(a){return i.emit("complete",a)}),this.on("complete",function(){return 0===i.getUploadingFiles().length&&0===i.getQueuedFiles().length?setTimeout(function(){return i.emit("queuecomplete")},0):void 0}),c=function(a){return a.stopPropagation(),a.preventDefault?a.preventDefault():a.returnValue=!1},this.listeners=[{"element":this.element,"events":{"dragstart":function(a){return i.emit("dragstart",a)},"dragenter":function(a){return c(a),i.emit("dragenter",a)},"dragover":function(a){var b;try{b=a.dataTransfer.effectAllowed}catch(d){}return a.dataTransfer.dropEffect="move"===b||"linkMove"===b?"move":"copy",c(a),i.emit("dragover",a)},"dragleave":function(a){return i.emit("dragleave",a)},"drop":function(a){return c(a),i.drop(a)},"dragend":function(a){return i.emit("dragend",a)}}}],this.clickableElements.forEach(function(a){return i.listeners.push({"element":a,"events":{"click":function(c){return a!==i.element||c.target===i.element||b.elementInside(c.target,i.element.querySelector(".dz-message"))?i.hiddenFileInput.click():void 0
|
|
}}})}),this.enable(),this.options.init.call(this)},b.prototype.destroy=function(){var a;return this.disable(),this.removeAllFiles(!0),(null!=(a=this.hiddenFileInput)?a.parentNode:void 0)&&(this.hiddenFileInput.parentNode.removeChild(this.hiddenFileInput),this.hiddenFileInput=null),delete this.element.dropzone,b.instances.splice(b.instances.indexOf(this),1)},b.prototype.updateTotalUploadProgress=function(){var a,b,c,d,e,f,g,h;if(d=0,c=0,a=this.getAcceptedFiles(),a.length){for(h=this.getAcceptedFiles(),f=0,g=h.length;g>f;f++)b=h[f],d+=b.upload.bytesSent,c+=b.upload.total;e=100*d/c}else e=100;return this.emit("totaluploadprogress",e,c,d)},b.prototype.getFallbackForm=function(){var a,c,d,e;return(a=this.getExistingFallback())?a:(d='<div class="dz-fallback">',this.options.dictFallbackText&&(d+="<p>"+this.options.dictFallbackText+"</p>"),d+='<input type="file" name="'+this.options.paramName+(this.options.uploadMultiple?"[]":"")+'" '+(this.options.uploadMultiple?'multiple="multiple"':void 0)+' /><input type="submit" value="Upload!"></div>',c=b.createElement(d),"FORM"!==this.element.tagName?(e=b.createElement('<form action="'+this.options.url+'" enctype="multipart/form-data" method="'+this.options.method+'"></form>'),e.appendChild(c)):(this.element.setAttribute("enctype","multipart/form-data"),this.element.setAttribute("method",this.options.method)),null!=e?e:c)},b.prototype.getExistingFallback=function(){var a,b,c,d,e,f;for(b=function(a){var b,c,d;for(c=0,d=a.length;d>c;c++)if(b=a[c],/(^| )fallback($| )/.test(b.className))return b},f=["div","form"],d=0,e=f.length;e>d;d++)if(c=f[d],a=b(this.element.getElementsByTagName(c)))return a},b.prototype.setupEventListeners=function(){var a,b,c,d,e,f,g;for(f=this.listeners,g=[],d=0,e=f.length;e>d;d++)a=f[d],g.push(function(){var d,e;d=a.events,e=[];for(b in d)c=d[b],e.push(a.element.addEventListener(b,c,!1));return e}());return g},b.prototype.removeEventListeners=function(){var a,b,c,d,e,f,g;for(f=this.listeners,g=[],d=0,e=f.length;e>d;d++)a=f[d],g.push(function(){var d,e;d=a.events,e=[];for(b in d)c=d[b],e.push(a.element.removeEventListener(b,c,!1));return e}());return g},b.prototype.disable=function(){var a,b,c,d,e;for(this.clickableElements.forEach(function(a){return a.classList.remove("dz-clickable")}),this.removeEventListeners(),d=this.files,e=[],b=0,c=d.length;c>b;b++)a=d[b],e.push(this.cancelUpload(a));return e},b.prototype.enable=function(){return this.clickableElements.forEach(function(a){return a.classList.add("dz-clickable")}),this.setupEventListeners()},b.prototype.filesize=function(a){var b;return a>=109951162777.6?(a/=109951162777.6,b="TiB"):a>=107374182.4?(a/=107374182.4,b="GiB"):a>=104857.6?(a/=104857.6,b="MiB"):a>=102.4?(a/=102.4,b="KiB"):(a=10*a,b="b"),"<strong>"+Math.round(a)/10+"</strong> "+b},b.prototype._updateMaxFilesReachedClass=function(){return null!=this.options.maxFiles&&this.getAcceptedFiles().length>=this.options.maxFiles?(this.getAcceptedFiles().length===this.options.maxFiles&&this.emit("maxfilesreached",this.files),this.element.classList.add("dz-max-files-reached")):this.element.classList.remove("dz-max-files-reached")},b.prototype.drop=function(a){var b,c;a.dataTransfer&&(this.emit("drop",a),b=a.dataTransfer.files,b.length&&(c=a.dataTransfer.items,c&&c.length&&null!=c[0].webkitGetAsEntry?this._addFilesFromItems(c):this.handleFiles(b)))},b.prototype.paste=function(a){var b,c;if(null!=(null!=a&&null!=(c=a.clipboardData)?c.items:void 0))return this.emit("paste",a),b=a.clipboardData.items,b.length?this._addFilesFromItems(b):void 0},b.prototype.handleFiles=function(a){var b,c,d,e;for(e=[],c=0,d=a.length;d>c;c++)b=a[c],e.push(this.addFile(b));return e},b.prototype._addFilesFromItems=function(a){var b,c,d,e,f;for(f=[],d=0,e=a.length;e>d;d++)c=a[d],f.push(null!=c.webkitGetAsEntry&&(b=c.webkitGetAsEntry())?b.isFile?this.addFile(c.getAsFile()):b.isDirectory?this._addFilesFromDirectory(b,b.name):void 0:null!=c.getAsFile?null==c.kind||"file"===c.kind?this.addFile(c.getAsFile()):void 0:void 0);return f},b.prototype._addFilesFromDirectory=function(a,b){var c,d,e=this;return c=a.createReader(),d=function(a){var c,d,f;for(d=0,f=a.length;f>d;d++)c=a[d],c.isFile?c.file(function(a){return e.options.ignoreHiddenFiles&&"."===a.name.substring(0,1)?void 0:(a.fullPath=""+b+"/"+a.name,e.addFile(a))}):c.isDirectory&&e._addFilesFromDirectory(c,""+b+"/"+c.name)},c.readEntries(d,function(a){return"undefined"!=typeof console&&null!==console&&"function"==typeof console.log?void 0:void 0})},b.prototype.accept=function(a,c){return a.size>1024*this.options.maxFilesize*1024?c(this.options.dictFileTooBig.replace("{{filesize}}",Math.round(a.size/1024/10.24)/100).replace("{{maxFilesize}}",this.options.maxFilesize)):b.isValidFile(a,this.options.acceptedFiles)?null!=this.options.maxFiles&&this.getAcceptedFiles().length>=this.options.maxFiles?(c(this.options.dictMaxFilesExceeded.replace("{{maxFiles}}",this.options.maxFiles)),this.emit("maxfilesexceeded",a)):this.options.accept.call(this,a,c):c(this.options.dictInvalidFileType)},b.prototype.addFile=function(a){var c=this;return a.upload={"progress":0,"total":a.size,"bytesSent":0},this.files.push(a),a.status=b.ADDED,this.emit("addedfile",a),this._enqueueThumbnail(a),this.accept(a,function(b){return b?(a.accepted=!1,c._errorProcessing([a],b)):c.enqueueFile(a),c._updateMaxFilesReachedClass()})},b.prototype.enqueueFiles=function(a){var b,c,d;for(c=0,d=a.length;d>c;c++)b=a[c],this.enqueueFile(b);return null},b.prototype.enqueueFile=function(a){var c=this;if(a.accepted=!0,a.status!==b.ADDED)throw new Error("This file can't be queued because it has already been processed or was rejected.");return a.status=b.QUEUED,this.options.autoProcessQueue?setTimeout(function(){return c.processQueue()},0):void 0},b.prototype._thumbnailQueue=[],b.prototype._processingThumbnail=!1,b.prototype._enqueueThumbnail=function(a){var b=this;return this.options.createImageThumbnails&&a.type.match(/image.*/)&&a.size<=1024*this.options.maxThumbnailFilesize*1024?(this._thumbnailQueue.push(a),setTimeout(function(){return b._processThumbnailQueue()},0)):void 0},b.prototype._processThumbnailQueue=function(){var a=this;if(!this._processingThumbnail&&0!==this._thumbnailQueue.length)return this._processingThumbnail=!0,this.createThumbnail(this._thumbnailQueue.shift(),function(){return a._processingThumbnail=!1,a._processThumbnailQueue()})},b.prototype.removeFile=function(a){return a.status===b.UPLOADING&&this.cancelUpload(a),this.files=h(this.files,a),this.emit("removedfile",a),0===this.files.length?this.emit("reset"):void 0},b.prototype.removeAllFiles=function(a){var c,d,e,f;for(null==a&&(a=!1),f=this.files.slice(),d=0,e=f.length;e>d;d++)c=f[d],(c.status!==b.UPLOADING||a)&&this.removeFile(c);return null},b.prototype.createThumbnail=function(a,b){var c,d=this;return c=new FileReader,c.onload=function(){var e;return e=document.createElement("img"),e.onload=function(){var c,g,h,i,j,k,l,m;return a.width=e.width,a.height=e.height,h=d.options.resize.call(d,a),null==h.trgWidth&&(h.trgWidth=d.options.thumbnailWidth),null==h.trgHeight&&(h.trgHeight=d.options.thumbnailHeight),c=document.createElement("canvas"),g=c.getContext("2d"),c.width=h.trgWidth,c.height=h.trgHeight,f(g,e,null!=(j=h.srcX)?j:0,null!=(k=h.srcY)?k:0,h.srcWidth,h.srcHeight,null!=(l=h.trgX)?l:0,null!=(m=h.trgY)?m:0,h.trgWidth,h.trgHeight),i=c.toDataURL("image/png"),d.emit("thumbnail",a,i),null!=b?b():void 0},e.src=c.result},c.readAsDataURL(a)},b.prototype.processQueue=function(){var a,b,c,d;if(b=this.options.parallelUploads,c=this.getUploadingFiles().length,a=c,!(c>=b)&&(d=this.getQueuedFiles(),d.length>0)){if(this.options.uploadMultiple)return this.processFiles(d.slice(0,b-c));for(;b>a;){if(!d.length)return;this.processFile(d.shift()),a++}}},b.prototype.processFile=function(a){return this.processFiles([a])},b.prototype.processFiles=function(a){var c,d,e;for(d=0,e=a.length;e>d;d++)c=a[d],c.processing=!0,c.status=b.UPLOADING,this.emit("processing",c);return this.options.uploadMultiple&&this.emit("processingmultiple",a),this.uploadFiles(a)},b.prototype._getFilesWithXhr=function(a){var b,c;return c=function(){var c,d,e,f;for(e=this.files,f=[],c=0,d=e.length;d>c;c++)b=e[c],b.xhr===a&&f.push(b);return f}.call(this)},b.prototype.cancelUpload=function(a){var c,d,e,f,g,h,i;if(a.status===b.UPLOADING){for(d=this._getFilesWithXhr(a.xhr),e=0,g=d.length;g>e;e++)c=d[e],c.status=b.CANCELED;for(a.xhr.abort(),f=0,h=d.length;h>f;f++)c=d[f],this.emit("canceled",c);this.options.uploadMultiple&&this.emit("canceledmultiple",d)}else((i=a.status)===b.ADDED||i===b.QUEUED)&&(a.status=b.CANCELED,this.emit("canceled",a),this.options.uploadMultiple&&this.emit("canceledmultiple",[a]));return this.options.autoProcessQueue?this.processQueue():void 0},b.prototype.uploadFile=function(a){return this.uploadFiles([a])},b.prototype.uploadFiles=function(a){var d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I=this;for(s=new XMLHttpRequest,t=0,x=a.length;x>t;t++)d=a[t],d.xhr=s;s.open(this.options.method,this.options.url,!0),s.withCredentials=!!this.options.withCredentials,p=null,f=function(){var b,c,e;for(e=[],b=0,c=a.length;c>b;b++)d=a[b],e.push(I._errorProcessing(a,p||I.options.dictResponseError.replace("{{statusCode}}",s.status),s));return e},q=function(b){var c,e,f,g,h,i,j,k,l;if(null!=b)for(e=100*b.loaded/b.total,f=0,i=a.length;i>f;f++)d=a[f],d.upload={"progress":e,"total":b.total,"bytesSent":b.loaded};else{for(c=!0,e=100,g=0,j=a.length;j>g;g++)d=a[g],(100!==d.upload.progress||d.upload.bytesSent!==d.upload.total)&&(c=!1),d.upload.progress=e,d.upload.bytesSent=d.upload.total;if(c)return}for(l=[],h=0,k=a.length;k>h;h++)d=a[h],l.push(I.emit("uploadprogress",d,e,d.upload.bytesSent));return l},s.onload=function(c){var d;if(a[0].status!==b.CANCELED&&4===s.readyState){if(p=s.responseText,s.getResponseHeader("content-type")&&~s.getResponseHeader("content-type").indexOf("application/json"))try{p=JSON.parse(p)}catch(e){c=e,p="Invalid JSON response from server."}return q(),200<=(d=s.status)&&300>d?I._finished(a,p,c):f()}},s.onerror=function(){return a[0].status!==b.CANCELED?f():void 0},o=null!=(D=s.upload)?D:s,o.onprogress=q,i={"Accept":"application/json","Cache-Control":"no-cache","X-Requested-With":"XMLHttpRequest"},this.options.headers&&c(i,this.options.headers);for(g in i)h=i[g],s.setRequestHeader(g,h);if(e=new FormData,this.options.params){E=this.options.params;for(m in E)r=E[m],e.append(m,r)}for(u=0,y=a.length;y>u;u++)d=a[u],this.emit("sending",d,s,e);if(this.options.uploadMultiple&&this.emit("sendingmultiple",a,s,e),"FORM"===this.element.tagName)for(F=this.element.querySelectorAll("input, textarea, select, button"),v=0,z=F.length;z>v;v++)if(j=F[v],k=j.getAttribute("name"),l=j.getAttribute("type"),"SELECT"===j.tagName&&j.hasAttribute("multiple"))for(G=j.options,w=0,A=G.length;A>w;w++)n=G[w],n.selected&&e.append(k,n.value);else(!l||"checkbox"!==(H=l.toLowerCase())&&"radio"!==H||j.checked)&&e.append(k,j.value);for(C=0,B=a.length;B>C;C++)d=a[C],e.append(""+this.options.paramName+(this.options.uploadMultiple?"[]":""),d,d.name);return s.send(e)},b.prototype._finished=function(a,c,d){var e,f,g;for(f=0,g=a.length;g>f;f++)e=a[f],e.status=b.SUCCESS,this.emit("success",e,c,d),this.emit("complete",e);return this.options.uploadMultiple&&(this.emit("successmultiple",a,c,d),this.emit("completemultiple",a)),this.options.autoProcessQueue?this.processQueue():void 0},b.prototype._errorProcessing=function(a,c,d){var e,f,g;for(f=0,g=a.length;g>f;f++)e=a[f],e.status=b.ERROR,this.emit("error",e,c,d),this.emit("complete",e);return this.options.uploadMultiple&&(this.emit("errormultiple",a,c,d),this.emit("completemultiple",a)),this.options.autoProcessQueue?this.processQueue():void 0},b}(b),a.version="3.8.4",a.options={},a.optionsForElement=function(b){return b.getAttribute("id")?a.options[c(b.getAttribute("id"))]:void 0},a.instances=[],a.forElement=function(a){if("string"==typeof a&&(a=document.querySelector(a)),null==(null!=a?a.dropzone:void 0))throw new Error("No Dropzone found for given element. This is probably because you're trying to access it before Dropzone had the time to initialize. Use the `init` option to setup any additional observers on your Dropzone.");return a.dropzone},a.autoDiscover=!0,a.discover=function(){var b,c,d,e,f,g;for(document.querySelectorAll?d=document.querySelectorAll(".dropzone"):(d=[],b=function(a){var b,c,e,f;for(f=[],c=0,e=a.length;e>c;c++)b=a[c],f.push(/(^| )dropzone($| )/.test(b.className)?d.push(b):void 0);return f},b(document.getElementsByTagName("div")),b(document.getElementsByTagName("form"))),g=[],e=0,f=d.length;f>e;e++)c=d[e],g.push(a.optionsForElement(c)!==!1?new a(c):void 0);return g},a.blacklistedBrowsers=[/opera.*Macintosh.*version\/12/i],a.isBrowserSupported=function(){var b,c,d,e,f;if(b=!0,window.File&&window.FileReader&&window.FileList&&window.Blob&&window.FormData&&document.querySelector)if("classList"in document.createElement("a"))for(f=a.blacklistedBrowsers,d=0,e=f.length;e>d;d++)c=f[d],c.test(navigator.userAgent)&&(b=!1);else b=!1;else b=!1;return b},h=function(a,b){var c,d,e,f;for(f=[],d=0,e=a.length;e>d;d++)c=a[d],c!==b&&f.push(c);return f},c=function(a){return a.replace(/[\-_](\w)/g,function(a){return a[1].toUpperCase()})},a.createElement=function(a){var b;return b=document.createElement("div"),b.innerHTML=a,b.childNodes[0]},a.elementInside=function(a,b){if(a===b)return!0;for(;a=a.parentNode;)if(a===b)return!0;return!1},a.getElement=function(a,b){var c;if("string"==typeof a?c=document.querySelector(a):null!=a.nodeType&&(c=a),null==c)throw new Error("Invalid `"+b+"` option provided. Please provide a CSS selector or a plain HTML element.");return c},a.getElements=function(a,b){var c,d,e,f,g,h,i,j;if(a instanceof Array){e=[];try{for(f=0,h=a.length;h>f;f++)d=a[f],e.push(this.getElement(d,b))}catch(k){c=k,e=null}}else if("string"==typeof a)for(e=[],j=document.querySelectorAll(a),g=0,i=j.length;i>g;g++)d=j[g],e.push(d);else null!=a.nodeType&&(e=[a]);if(null==e||!e.length)throw new Error("Invalid `"+b+"` option provided. Please provide a CSS selector, a plain HTML element or a list of those.");return e},a.confirm=function(a,b,c){return window.confirm(a)?b():null!=c?c():void 0},a.isValidFile=function(a,b){var c,d,e,f,g;if(!b)return!0;for(b=b.split(","),d=a.type,c=d.replace(/\/.*$/,""),f=0,g=b.length;g>f;f++)if(e=b[f],e=e.trim(),"."===e.charAt(0)){if(-1!==a.name.toLowerCase().indexOf(e.toLowerCase(),a.name.length-e.length))return!0}else if(/\/\*$/.test(e)){if(c===e.replace(/\/.*$/,""))return!0}else if(d===e)return!0;return!1},"undefined"!=typeof jQuery&&null!==jQuery&&(jQuery.fn.dropzone=function(b){return this.each(function(){return new a(this,b)})}),"undefined"!=typeof module&&null!==module?module.exports=a:window.Dropzone=a,a.ADDED="added",a.QUEUED="queued",a.ACCEPTED=a.QUEUED,a.UPLOADING="uploading",a.PROCESSING=a.UPLOADING,a.CANCELED="canceled",a.ERROR="error",a.SUCCESS="success",e=function(a){var b,c,d,e,f,g,h,i,j,k;for(h=a.naturalWidth,g=a.naturalHeight,c=document.createElement("canvas"),c.width=1,c.height=g,d=c.getContext("2d"),d.drawImage(a,0,0),e=d.getImageData(0,0,1,g).data,k=0,f=g,i=g;i>k;)b=e[4*(i-1)+3],0===b?f=i:k=i,i=f+k>>1;return j=i/g,0===j?1:j},f=function(a,b,c,d,f,g,h,i,j,k){var l;return l=e(b),a.drawImage(b,c,d,f,g,h,i,j,k/l)},d=function(a,b){var c,d,e,f,g,h,i,j,k;if(e=!1,k=!0,d=a.document,j=d.documentElement,c=d.addEventListener?"addEventListener":"attachEvent",i=d.addEventListener?"removeEventListener":"detachEvent",h=d.addEventListener?"":"on",f=function(c){return"readystatechange"!==c.type||"complete"===d.readyState?(("load"===c.type?a:d)[i](h+c.type,f,!1),!e&&(e=!0)?b.call(a,c.type||c):void 0):void 0},g=function(){var a;try{j.doScroll("left")}catch(b){return a=b,void setTimeout(g,50)}return f("poll")},"complete"!==d.readyState){if(d.createEventObject&&j.doScroll){try{k=!a.frameElement}catch(l){}k&&g()}return d[c](h+"DOMContentLoaded",f,!1),d[c](h+"readystatechange",f,!1),a[c](h+"load",f,!1)}},a._autoDiscoverFunction=function(){return a.autoDiscover?a.discover():void 0},d(window,a._autoDiscoverFunction)}.call(this),function(){var a,b,c,d,e,f,g,h,i={}.hasOwnProperty,j=function(a,b){function c(){this.constructor=a}for(var d in b)i.call(b,d)&&(a[d]=b[d]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},k=[].slice;b="undefined"!=typeof Emitter&&null!==Emitter?Emitter:require("emitter"),g=function(){},a=function(a){function b(a,d){var e,f,g;if(this.element=a,this.version=b.version,this.defaultOptions.previewTemplate=this.defaultOptions.previewTemplate.replace(/\n*/g,""),this.clickableElements=[],this.listeners=[],this.files=[],"string"==typeof this.element&&(this.element=document.querySelector(this.element)),!this.element||null==this.element.nodeType)throw new Error("Invalid dropzone element.");if(this.element.dropzone)throw new Error("Dropzone already attached.");if(b.instances.push(this),this.element.dropzone=this,e=null!=(g=b.optionsForElement(this.element))?g:{},this.options=c({},this.defaultOptions,e,null!=d?d:{}),this.options.forceFallback||!b.isBrowserSupported())return this.options.fallback.call(this);if(null==this.options.url&&(this.options.url=this.element.getAttribute("action")),!this.options.url)throw new Error("No URL provided.");if(this.options.acceptedFiles&&this.options.acceptedMimeTypes)throw new Error("You can't provide both 'acceptedFiles' and 'acceptedMimeTypes'. 'acceptedMimeTypes' is deprecated.");this.options.acceptedMimeTypes&&(this.options.acceptedFiles=this.options.acceptedMimeTypes,delete this.options.acceptedMimeTypes),this.options.method=this.options.method.toUpperCase(),(f=this.getExistingFallback())&&f.parentNode&&f.parentNode.removeChild(f),this.previewsContainer=this.options.previewsContainer?b.getElement(this.options.previewsContainer,"previewsContainer"):this.element,this.options.clickable&&(this.clickableElements=this.options.clickable===!0?[this.element]:b.getElements(this.options.clickable,"clickable")),this.init()}var c;return j(b,a),b.prototype.events=["drop","dragstart","dragend","dragenter","dragover","dragleave","addedfile","removedfile","thumbnail","error","errormultiple","processing","processingmultiple","uploadprogress","totaluploadprogress","sending","sendingmultiple","success","successmultiple","canceled","canceledmultiple","complete","completemultiple","reset","maxfilesexceeded","maxfilesreached"],b.prototype.defaultOptions={"url":null,"method":"post","withCredentials":!1,"parallelUploads":2,"uploadMultiple":!1,"maxFilesize":256,"paramName":"file","createImageThumbnails":!0,"maxThumbnailFilesize":10,"thumbnailWidth":100,"thumbnailHeight":100,"maxFiles":null,"params":{},"clickable":!0,"ignoreHiddenFiles":!0,"acceptedFiles":null,"acceptedMimeTypes":null,"autoProcessQueue":!0,"addRemoveLinks":!1,"previewsContainer":null,"dictDefaultMessage":"Drop files here to upload","dictFallbackMessage":"Your browser does not support drag'n'drop file uploads.","dictFallbackText":"Please use the fallback form below to upload your files like in the olden days.","dictFileTooBig":"File is too big ({{filesize}}MiB). Max filesize: {{maxFilesize}}MiB.","dictInvalidFileType":"You can't upload files of this type.","dictResponseError":"Server responded with {{statusCode}} code.","dictCancelUpload":"Cancel upload","dictCancelUploadConfirmation":"Are you sure you want to cancel this upload?","dictRemoveFile":"Remove file","dictRemoveFileConfirmation":null,"dictMaxFilesExceeded":"You can not upload any more files.","accept":function(a,b){return b()},"init":function(){return g},"forceFallback":!1,"fallback":function(){var a,c,d,e,f,g;for(this.element.className=""+this.element.className+" dz-browser-not-supported",g=this.element.getElementsByTagName("div"),e=0,f=g.length;f>e;e++)a=g[e],/(^| )dz-message($| )/.test(a.className)&&(c=a,a.className="dz-message");return c||(c=b.createElement('<div class="dz-message"><span></span></div>'),this.element.appendChild(c)),d=c.getElementsByTagName("span")[0],d&&(d.textContent=this.options.dictFallbackMessage),this.element.appendChild(this.getFallbackForm())},"resize":function(a){var b,c,d;return b={"srcX":0,"srcY":0,"srcWidth":a.width,"srcHeight":a.height},c=a.width/a.height,d=this.options.thumbnailWidth/this.options.thumbnailHeight,a.height<this.options.thumbnailHeight||a.width<this.options.thumbnailWidth?(b.trgHeight=b.srcHeight,b.trgWidth=b.srcWidth):c>d?(b.srcHeight=a.height,b.srcWidth=b.srcHeight*d):(b.srcWidth=a.width,b.srcHeight=b.srcWidth/d),b.srcX=(a.width-b.srcWidth)/2,b.srcY=(a.height-b.srcHeight)/2,b},"drop":function(){return this.element.classList.remove("dz-drag-hover")},"dragstart":g,"dragend":function(){return this.element.classList.remove("dz-drag-hover")},"dragenter":function(){return this.element.classList.add("dz-drag-hover")},"dragover":function(){return this.element.classList.add("dz-drag-hover")},"dragleave":function(){return this.element.classList.remove("dz-drag-hover")},"paste":g,"reset":function(){return this.element.classList.remove("dz-started")},"addedfile":function(a){var c,d,e,f,g,h,i,j,k,l,m,n,o,p=this;for(this.element===this.previewsContainer&&this.element.classList.add("dz-started"),a.previewElement=b.createElement(this.options.previewTemplate.trim()),a.previewTemplate=a.previewElement,this.previewsContainer.appendChild(a.previewElement),l=a.previewElement.querySelectorAll("[data-dz-name]"),f=0,i=l.length;i>f;f++)c=l[f],c.textContent=a.name;for(m=a.previewElement.querySelectorAll("[data-dz-size]"),g=0,j=m.length;j>g;g++)c=m[g],c.innerHTML=this.filesize(a.size);for(this.options.addRemoveLinks&&(a._removeLink=b.createElement('<a class="dz-remove" href="javascript:undefined;" data-dz-remove>'+this.options.dictRemoveFile+"</a>"),a.previewElement.appendChild(a._removeLink)),d=function(c){return c.preventDefault(),c.stopPropagation(),a.status===b.UPLOADING?b.confirm(p.options.dictCancelUploadConfirmation,function(){return p.removeFile(a)}):p.options.dictRemoveFileConfirmation?b.confirm(p.options.dictRemoveFileConfirmation,function(){return p.removeFile(a)}):p.removeFile(a)},n=a.previewElement.querySelectorAll("[data-dz-remove]"),o=[],h=0,k=n.length;k>h;h++)e=n[h],o.push(e.addEventListener("click",d));return o},"removedfile":function(a){var b;return null!=(b=a.previewElement)&&b.parentNode.removeChild(a.previewElement),this._updateMaxFilesReachedClass()},"thumbnail":function(a,b){var c,d,e,f,g;for(a.previewElement.classList.remove("dz-file-preview"),a.previewElement.classList.add("dz-image-preview"),f=a.previewElement.querySelectorAll("[data-dz-thumbnail]"),g=[],d=0,e=f.length;e>d;d++)c=f[d],c.alt=a.name,g.push(c.src=b);return g},"error":function(a,b){var c,d,e,f,g;for(a.previewElement.classList.add("dz-error"),"String"!=typeof b&&b.error&&(b=b.error),f=a.previewElement.querySelectorAll("[data-dz-errormessage]"),g=[],d=0,e=f.length;e>d;d++)c=f[d],g.push(c.textContent=b);return g},"errormultiple":g,"processing":function(a){return a.previewElement.classList.add("dz-processing"),a._removeLink?a._removeLink.textContent=this.options.dictCancelUpload:void 0},"processingmultiple":g,"uploadprogress":function(a,b){var c,d,e,f,g;for(f=a.previewElement.querySelectorAll("[data-dz-uploadprogress]"),g=[],d=0,e=f.length;e>d;d++)c=f[d],g.push(c.style.width=""+b+"%");return g},"totaluploadprogress":g,"sending":g,"sendingmultiple":g,"success":function(a){return a.previewElement.classList.add("dz-success")},"successmultiple":g,"canceled":function(a){return this.emit("error",a,"Upload canceled.")},"canceledmultiple":g,"complete":function(a){return a._removeLink?a._removeLink.textContent=this.options.dictRemoveFile:void 0},"completemultiple":g,"maxfilesexceeded":g,"maxfilesreached":g,"previewTemplate":'<div class="dz-preview dz-file-preview">\n <div class="dz-details">\n <div class="dz-filename"><span data-dz-name></span></div>\n <div class="dz-size" data-dz-size></div>\n <img data-dz-thumbnail />\n </div>\n <div class="dz-progress"><span class="dz-upload" data-dz-uploadprogress></span></div>\n <div class="dz-success-mark"><span>\u2714</span></div>\n <div class="dz-error-mark"><span>\u2718</span></div>\n <div class="dz-error-message"><span data-dz-errormessage></span></div>\n</div>'},c=function(){var a,b,c,d,e,f,g;for(d=arguments[0],c=2<=arguments.length?k.call(arguments,1):[],f=0,g=c.length;g>f;f++){b=c[f];for(a in b)e=b[a],d[a]=e}return d},b.prototype.getAcceptedFiles=function(){var a,b,c,d,e;for(d=this.files,e=[],b=0,c=d.length;c>b;b++)a=d[b],a.accepted&&e.push(a);return e},b.prototype.getRejectedFiles=function(){var a,b,c,d,e;for(d=this.files,e=[],b=0,c=d.length;c>b;b++)a=d[b],a.accepted||e.push(a);return e},b.prototype.getQueuedFiles=function(){var a,c,d,e,f;for(e=this.files,f=[],c=0,d=e.length;d>c;c++)a=e[c],a.status===b.QUEUED&&f.push(a);return f},b.prototype.getUploadingFiles=function(){var a,c,d,e,f;for(e=this.files,f=[],c=0,d=e.length;d>c;c++)a=e[c],a.status===b.UPLOADING&&f.push(a);return f},b.prototype.init=function(){var a,c,d,e,f,g,h,i=this;for("form"===this.element.tagName&&this.element.setAttribute("enctype","multipart/form-data"),this.element.classList.contains("dropzone")&&!this.element.querySelector(".dz-message")&&this.element.appendChild(b.createElement('<div class="dz-default dz-message"><span>'+this.options.dictDefaultMessage+"</span></div>")),this.clickableElements.length&&(d=function(){return i.hiddenFileInput&&document.body.removeChild(i.hiddenFileInput),i.hiddenFileInput=document.createElement("input"),i.hiddenFileInput.setAttribute("type","file"),(null==i.options.maxFiles||i.options.maxFiles>1)&&i.hiddenFileInput.setAttribute("multiple","multiple"),null!=i.options.acceptedFiles&&i.hiddenFileInput.setAttribute("accept",i.options.acceptedFiles),i.hiddenFileInput.style.visibility="hidden",i.hiddenFileInput.style.position="absolute",i.hiddenFileInput.style.top="0",i.hiddenFileInput.style.left="0",i.hiddenFileInput.style.height="0",i.hiddenFileInput.style.width="0",document.body.appendChild(i.hiddenFileInput),i.hiddenFileInput.addEventListener("change",function(){var a,b,c,e;if(b=i.hiddenFileInput.files,b.length)for(c=0,e=b.length;e>c;c++)a=b[c],i.addFile(a);return d()})})(),this.URL=null!=(g=window.URL)?g:window.webkitURL,h=this.events,e=0,f=h.length;f>e;e++)a=h[e],this.on(a,this.options[a]);return this.on("uploadprogress",function(){return i.updateTotalUploadProgress()}),this.on("removedfile",function(){return i.updateTotalUploadProgress()}),this.on("canceled",function(a){return i.emit("complete",a)}),this.on("complete",function(){return 0===i.getUploadingFiles().length&&0===i.getQueuedFiles().length?setTimeout(function(){return i.emit("queuecomplete")},0):void 0}),c=function(a){return a.stopPropagation(),a.preventDefault?a.preventDefault():a.returnValue=!1},this.listeners=[{"element":this.element,"events":{"dragstart":function(a){return i.emit("dragstart",a)},"dragenter":function(a){return c(a),i.emit("dragenter",a)},"dragover":function(a){var b;try{b=a.dataTransfer.effectAllowed}catch(d){}return a.dataTransfer.dropEffect="move"===b||"linkMove"===b?"move":"copy",c(a),i.emit("dragover",a)},"dragleave":function(a){return i.emit("dragleave",a)},"drop":function(a){return c(a),i.drop(a)},"dragend":function(a){return i.emit("dragend",a)}}}],this.clickableElements.forEach(function(a){return i.listeners.push({"element":a,"events":{"click":function(c){return a!==i.element||c.target===i.element||b.elementInside(c.target,i.element.querySelector(".dz-message"))?i.hiddenFileInput.click():void 0}}})}),this.enable(),this.options.init.call(this)},b.prototype.destroy=function(){var a;return this.disable(),this.removeAllFiles(!0),(null!=(a=this.hiddenFileInput)?a.parentNode:void 0)&&(this.hiddenFileInput.parentNode.removeChild(this.hiddenFileInput),this.hiddenFileInput=null),delete this.element.dropzone,b.instances.splice(b.instances.indexOf(this),1)},b.prototype.updateTotalUploadProgress=function(){var a,b,c,d,e,f,g,h;if(d=0,c=0,a=this.getAcceptedFiles(),a.length){for(h=this.getAcceptedFiles(),f=0,g=h.length;g>f;f++)b=h[f],d+=b.upload.bytesSent,c+=b.upload.total;e=100*d/c}else e=100;return this.emit("totaluploadprogress",e,c,d)},b.prototype.getFallbackForm=function(){var a,c,d,e;return(a=this.getExistingFallback())?a:(d='<div class="dz-fallback">',this.options.dictFallbackText&&(d+="<p>"+this.options.dictFallbackText+"</p>"),d+='<input type="file" name="'+this.options.paramName+(this.options.uploadMultiple?"[]":"")+'" '+(this.options.uploadMultiple?'multiple="multiple"':void 0)+' /><input type="submit" value="Upload!"></div>',c=b.createElement(d),"FORM"!==this.element.tagName?(e=b.createElement('<form action="'+this.options.url+'" enctype="multipart/form-data" method="'+this.options.method+'"></form>'),e.appendChild(c)):(this.element.setAttribute("enctype","multipart/form-data"),this.element.setAttribute("method",this.options.method)),null!=e?e:c)},b.prototype.getExistingFallback=function(){var a,b,c,d,e,f;for(b=function(a){var b,c,d;for(c=0,d=a.length;d>c;c++)if(b=a[c],/(^| )fallback($| )/.test(b.className))return b},f=["div","form"],d=0,e=f.length;e>d;d++)if(c=f[d],a=b(this.element.getElementsByTagName(c)))return a},b.prototype.setupEventListeners=function(){var a,b,c,d,e,f,g;for(f=this.listeners,g=[],d=0,e=f.length;e>d;d++)a=f[d],g.push(function(){var d,e;d=a.events,e=[];for(b in d)c=d[b],e.push(a.element.addEventListener(b,c,!1));return e}());return g},b.prototype.removeEventListeners=function(){var a,b,c,d,e,f,g;for(f=this.listeners,g=[],d=0,e=f.length;e>d;d++)a=f[d],g.push(function(){var d,e;d=a.events,e=[];for(b in d)c=d[b],e.push(a.element.removeEventListener(b,c,!1));return e}());return g},b.prototype.disable=function(){var a,b,c,d,e;for(this.clickableElements.forEach(function(a){return a.classList.remove("dz-clickable")}),this.removeEventListeners(),d=this.files,e=[],b=0,c=d.length;c>b;b++)a=d[b],e.push(this.cancelUpload(a));return e},b.prototype.enable=function(){return this.clickableElements.forEach(function(a){return a.classList.add("dz-clickable")}),this.setupEventListeners()},b.prototype.filesize=function(a){var b;return a>=109951162777.6?(a/=109951162777.6,b="TiB"):a>=107374182.4?(a/=107374182.4,b="GiB"):a>=104857.6?(a/=104857.6,b="MiB"):a>=102.4?(a/=102.4,b="KiB"):(a=10*a,b="b"),"<strong>"+Math.round(a)/10+"</strong> "+b},b.prototype._updateMaxFilesReachedClass=function(){return null!=this.options.maxFiles&&this.getAcceptedFiles().length>=this.options.maxFiles?(this.getAcceptedFiles().length===this.options.maxFiles&&this.emit("maxfilesreached",this.files),this.element.classList.add("dz-max-files-reached")):this.element.classList.remove("dz-max-files-reached")},b.prototype.drop=function(a){var b,c;a.dataTransfer&&(this.emit("drop",a),b=a.dataTransfer.files,b.length&&(c=a.dataTransfer.items,c&&c.length&&null!=c[0].webkitGetAsEntry?this._addFilesFromItems(c):this.handleFiles(b)))},b.prototype.paste=function(a){var b,c;if(null!=(null!=a&&null!=(c=a.clipboardData)?c.items:void 0))return this.emit("paste",a),b=a.clipboardData.items,b.length?this._addFilesFromItems(b):void 0},b.prototype.handleFiles=function(a){var b,c,d,e;for(e=[],c=0,d=a.length;d>c;c++)b=a[c],e.push(this.addFile(b));return e},b.prototype._addFilesFromItems=function(a){var b,c,d,e,f;for(f=[],d=0,e=a.length;e>d;d++)c=a[d],f.push(null!=c.webkitGetAsEntry&&(b=c.webkitGetAsEntry())?b.isFile?this.addFile(c.getAsFile()):b.isDirectory?this._addFilesFromDirectory(b,b.name):void 0:null!=c.getAsFile?null==c.kind||"file"===c.kind?this.addFile(c.getAsFile()):void 0:void 0);return f},b.prototype._addFilesFromDirectory=function(a,b){var c,d,e=this;return c=a.createReader(),d=function(a){var c,d,f;for(d=0,f=a.length;f>d;d++)c=a[d],c.isFile?c.file(function(a){return e.options.ignoreHiddenFiles&&"."===a.name.substring(0,1)?void 0:(a.fullPath=""+b+"/"+a.name,e.addFile(a))}):c.isDirectory&&e._addFilesFromDirectory(c,""+b+"/"+c.name)},c.readEntries(d,function(a){return"undefined"!=typeof console&&null!==console&&"function"==typeof console.log?void 0:void 0
|
|
})},b.prototype.accept=function(a,c){return a.size>1024*this.options.maxFilesize*1024?c(this.options.dictFileTooBig.replace("{{filesize}}",Math.round(a.size/1024/10.24)/100).replace("{{maxFilesize}}",this.options.maxFilesize)):b.isValidFile(a,this.options.acceptedFiles)?null!=this.options.maxFiles&&this.getAcceptedFiles().length>=this.options.maxFiles?(c(this.options.dictMaxFilesExceeded.replace("{{maxFiles}}",this.options.maxFiles)),this.emit("maxfilesexceeded",a)):this.options.accept.call(this,a,c):c(this.options.dictInvalidFileType)},b.prototype.addFile=function(a){var c=this;return a.upload={"progress":0,"total":a.size,"bytesSent":0},this.files.push(a),a.status=b.ADDED,this.emit("addedfile",a),this._enqueueThumbnail(a),this.accept(a,function(b){return b?(a.accepted=!1,c._errorProcessing([a],b)):c.enqueueFile(a),c._updateMaxFilesReachedClass()})},b.prototype.enqueueFiles=function(a){var b,c,d;for(c=0,d=a.length;d>c;c++)b=a[c],this.enqueueFile(b);return null},b.prototype.enqueueFile=function(a){var c=this;if(a.accepted=!0,a.status!==b.ADDED)throw new Error("This file can't be queued because it has already been processed or was rejected.");return a.status=b.QUEUED,this.options.autoProcessQueue?setTimeout(function(){return c.processQueue()},0):void 0},b.prototype._thumbnailQueue=[],b.prototype._processingThumbnail=!1,b.prototype._enqueueThumbnail=function(a){var b=this;return this.options.createImageThumbnails&&a.type.match(/image.*/)&&a.size<=1024*this.options.maxThumbnailFilesize*1024?(this._thumbnailQueue.push(a),setTimeout(function(){return b._processThumbnailQueue()},0)):void 0},b.prototype._processThumbnailQueue=function(){var a=this;if(!this._processingThumbnail&&0!==this._thumbnailQueue.length)return this._processingThumbnail=!0,this.createThumbnail(this._thumbnailQueue.shift(),function(){return a._processingThumbnail=!1,a._processThumbnailQueue()})},b.prototype.removeFile=function(a){return a.status===b.UPLOADING&&this.cancelUpload(a),this.files=h(this.files,a),this.emit("removedfile",a),0===this.files.length?this.emit("reset"):void 0},b.prototype.removeAllFiles=function(a){var c,d,e,f;for(null==a&&(a=!1),f=this.files.slice(),d=0,e=f.length;e>d;d++)c=f[d],(c.status!==b.UPLOADING||a)&&this.removeFile(c);return null},b.prototype.createThumbnail=function(a,b){var c,d=this;return c=new FileReader,c.onload=function(){var e;return e=document.createElement("img"),e.onload=function(){var c,g,h,i,j,k,l,m;return a.width=e.width,a.height=e.height,h=d.options.resize.call(d,a),null==h.trgWidth&&(h.trgWidth=d.options.thumbnailWidth),null==h.trgHeight&&(h.trgHeight=d.options.thumbnailHeight),c=document.createElement("canvas"),g=c.getContext("2d"),c.width=h.trgWidth,c.height=h.trgHeight,f(g,e,null!=(j=h.srcX)?j:0,null!=(k=h.srcY)?k:0,h.srcWidth,h.srcHeight,null!=(l=h.trgX)?l:0,null!=(m=h.trgY)?m:0,h.trgWidth,h.trgHeight),i=c.toDataURL("image/png"),d.emit("thumbnail",a,i),null!=b?b():void 0},e.src=c.result},c.readAsDataURL(a)},b.prototype.processQueue=function(){var a,b,c,d;if(b=this.options.parallelUploads,c=this.getUploadingFiles().length,a=c,!(c>=b)&&(d=this.getQueuedFiles(),d.length>0)){if(this.options.uploadMultiple)return this.processFiles(d.slice(0,b-c));for(;b>a;){if(!d.length)return;this.processFile(d.shift()),a++}}},b.prototype.processFile=function(a){return this.processFiles([a])},b.prototype.processFiles=function(a){var c,d,e;for(d=0,e=a.length;e>d;d++)c=a[d],c.processing=!0,c.status=b.UPLOADING,this.emit("processing",c);return this.options.uploadMultiple&&this.emit("processingmultiple",a),this.uploadFiles(a)},b.prototype._getFilesWithXhr=function(a){var b,c;return c=function(){var c,d,e,f;for(e=this.files,f=[],c=0,d=e.length;d>c;c++)b=e[c],b.xhr===a&&f.push(b);return f}.call(this)},b.prototype.cancelUpload=function(a){var c,d,e,f,g,h,i;if(a.status===b.UPLOADING){for(d=this._getFilesWithXhr(a.xhr),e=0,g=d.length;g>e;e++)c=d[e],c.status=b.CANCELED;for(a.xhr.abort(),f=0,h=d.length;h>f;f++)c=d[f],this.emit("canceled",c);this.options.uploadMultiple&&this.emit("canceledmultiple",d)}else((i=a.status)===b.ADDED||i===b.QUEUED)&&(a.status=b.CANCELED,this.emit("canceled",a),this.options.uploadMultiple&&this.emit("canceledmultiple",[a]));return this.options.autoProcessQueue?this.processQueue():void 0},b.prototype.uploadFile=function(a){return this.uploadFiles([a])},b.prototype.uploadFiles=function(a){var d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I=this;for(s=new XMLHttpRequest,t=0,x=a.length;x>t;t++)d=a[t],d.xhr=s;s.open(this.options.method,this.options.url,!0),s.withCredentials=!!this.options.withCredentials,p=null,f=function(){var b,c,e;for(e=[],b=0,c=a.length;c>b;b++)d=a[b],e.push(I._errorProcessing(a,p||I.options.dictResponseError.replace("{{statusCode}}",s.status),s));return e},q=function(b){var c,e,f,g,h,i,j,k,l;if(null!=b)for(e=100*b.loaded/b.total,f=0,i=a.length;i>f;f++)d=a[f],d.upload={"progress":e,"total":b.total,"bytesSent":b.loaded};else{for(c=!0,e=100,g=0,j=a.length;j>g;g++)d=a[g],(100!==d.upload.progress||d.upload.bytesSent!==d.upload.total)&&(c=!1),d.upload.progress=e,d.upload.bytesSent=d.upload.total;if(c)return}for(l=[],h=0,k=a.length;k>h;h++)d=a[h],l.push(I.emit("uploadprogress",d,e,d.upload.bytesSent));return l},s.onload=function(c){var d;if(a[0].status!==b.CANCELED&&4===s.readyState){if(p=s.responseText,s.getResponseHeader("content-type")&&~s.getResponseHeader("content-type").indexOf("application/json"))try{p=JSON.parse(p)}catch(e){c=e,p="Invalid JSON response from server."}return q(),200<=(d=s.status)&&300>d?I._finished(a,p,c):f()}},s.onerror=function(){return a[0].status!==b.CANCELED?f():void 0},o=null!=(D=s.upload)?D:s,o.onprogress=q,i={"Accept":"application/json","Cache-Control":"no-cache","X-Requested-With":"XMLHttpRequest"},this.options.headers&&c(i,this.options.headers);for(g in i)h=i[g],s.setRequestHeader(g,h);if(e=new FormData,this.options.params){E=this.options.params;for(m in E)r=E[m],e.append(m,r)}for(u=0,y=a.length;y>u;u++)d=a[u],this.emit("sending",d,s,e);if(this.options.uploadMultiple&&this.emit("sendingmultiple",a,s,e),"FORM"===this.element.tagName)for(F=this.element.querySelectorAll("input, textarea, select, button"),v=0,z=F.length;z>v;v++)if(j=F[v],k=j.getAttribute("name"),l=j.getAttribute("type"),"SELECT"===j.tagName&&j.hasAttribute("multiple"))for(G=j.options,w=0,A=G.length;A>w;w++)n=G[w],n.selected&&e.append(k,n.value);else(!l||"checkbox"!==(H=l.toLowerCase())&&"radio"!==H||j.checked)&&e.append(k,j.value);for(C=0,B=a.length;B>C;C++)d=a[C],e.append(""+this.options.paramName+(this.options.uploadMultiple?"[]":""),d,d.name);return s.send(e)},b.prototype._finished=function(a,c,d){var e,f,g;for(f=0,g=a.length;g>f;f++)e=a[f],e.status=b.SUCCESS,this.emit("success",e,c,d),this.emit("complete",e);return this.options.uploadMultiple&&(this.emit("successmultiple",a,c,d),this.emit("completemultiple",a)),this.options.autoProcessQueue?this.processQueue():void 0},b.prototype._errorProcessing=function(a,c,d){var e,f,g;for(f=0,g=a.length;g>f;f++)e=a[f],e.status=b.ERROR,this.emit("error",e,c,d),this.emit("complete",e);return this.options.uploadMultiple&&(this.emit("errormultiple",a,c,d),this.emit("completemultiple",a)),this.options.autoProcessQueue?this.processQueue():void 0},b}(b),a.version="3.8.4",a.options={},a.optionsForElement=function(b){return b.getAttribute("id")?a.options[c(b.getAttribute("id"))]:void 0},a.instances=[],a.forElement=function(a){if("string"==typeof a&&(a=document.querySelector(a)),null==(null!=a?a.dropzone:void 0))throw new Error("No Dropzone found for given element. This is probably because you're trying to access it before Dropzone had the time to initialize. Use the `init` option to setup any additional observers on your Dropzone.");return a.dropzone},a.autoDiscover=!0,a.discover=function(){var b,c,d,e,f,g;for(document.querySelectorAll?d=document.querySelectorAll(".dropzone"):(d=[],b=function(a){var b,c,e,f;for(f=[],c=0,e=a.length;e>c;c++)b=a[c],f.push(/(^| )dropzone($| )/.test(b.className)?d.push(b):void 0);return f},b(document.getElementsByTagName("div")),b(document.getElementsByTagName("form"))),g=[],e=0,f=d.length;f>e;e++)c=d[e],g.push(a.optionsForElement(c)!==!1?new a(c):void 0);return g},a.blacklistedBrowsers=[/opera.*Macintosh.*version\/12/i],a.isBrowserSupported=function(){var b,c,d,e,f;if(b=!0,window.File&&window.FileReader&&window.FileList&&window.Blob&&window.FormData&&document.querySelector)if("classList"in document.createElement("a"))for(f=a.blacklistedBrowsers,d=0,e=f.length;e>d;d++)c=f[d],c.test(navigator.userAgent)&&(b=!1);else b=!1;else b=!1;return b},h=function(a,b){var c,d,e,f;for(f=[],d=0,e=a.length;e>d;d++)c=a[d],c!==b&&f.push(c);return f},c=function(a){return a.replace(/[\-_](\w)/g,function(a){return a[1].toUpperCase()})},a.createElement=function(a){var b;return b=document.createElement("div"),b.innerHTML=a,b.childNodes[0]},a.elementInside=function(a,b){if(a===b)return!0;for(;a=a.parentNode;)if(a===b)return!0;return!1},a.getElement=function(a,b){var c;if("string"==typeof a?c=document.querySelector(a):null!=a.nodeType&&(c=a),null==c)throw new Error("Invalid `"+b+"` option provided. Please provide a CSS selector or a plain HTML element.");return c},a.getElements=function(a,b){var c,d,e,f,g,h,i,j;if(a instanceof Array){e=[];try{for(f=0,h=a.length;h>f;f++)d=a[f],e.push(this.getElement(d,b))}catch(k){c=k,e=null}}else if("string"==typeof a)for(e=[],j=document.querySelectorAll(a),g=0,i=j.length;i>g;g++)d=j[g],e.push(d);else null!=a.nodeType&&(e=[a]);if(null==e||!e.length)throw new Error("Invalid `"+b+"` option provided. Please provide a CSS selector, a plain HTML element or a list of those.");return e},a.confirm=function(a,b,c){return window.confirm(a)?b():null!=c?c():void 0},a.isValidFile=function(a,b){var c,d,e,f,g;if(!b)return!0;for(b=b.split(","),d=a.type,c=d.replace(/\/.*$/,""),f=0,g=b.length;g>f;f++)if(e=b[f],e=e.trim(),"."===e.charAt(0)){if(-1!==a.name.toLowerCase().indexOf(e.toLowerCase(),a.name.length-e.length))return!0}else if(/\/\*$/.test(e)){if(c===e.replace(/\/.*$/,""))return!0}else if(d===e)return!0;return!1},"undefined"!=typeof jQuery&&null!==jQuery&&(jQuery.fn.dropzone=function(b){return this.each(function(){return new a(this,b)})}),"undefined"!=typeof module&&null!==module?module.exports=a:window.Dropzone=a,a.ADDED="added",a.QUEUED="queued",a.ACCEPTED=a.QUEUED,a.UPLOADING="uploading",a.PROCESSING=a.UPLOADING,a.CANCELED="canceled",a.ERROR="error",a.SUCCESS="success",e=function(a){var b,c,d,e,f,g,h,i,j,k;for(h=a.naturalWidth,g=a.naturalHeight,c=document.createElement("canvas"),c.width=1,c.height=g,d=c.getContext("2d"),d.drawImage(a,0,0),e=d.getImageData(0,0,1,g).data,k=0,f=g,i=g;i>k;)b=e[4*(i-1)+3],0===b?f=i:k=i,i=f+k>>1;return j=i/g,0===j?1:j},f=function(a,b,c,d,f,g,h,i,j,k){var l;return l=e(b),a.drawImage(b,c,d,f,g,h,i,j,k/l)},d=function(a,b){var c,d,e,f,g,h,i,j,k;if(e=!1,k=!0,d=a.document,j=d.documentElement,c=d.addEventListener?"addEventListener":"attachEvent",i=d.addEventListener?"removeEventListener":"detachEvent",h=d.addEventListener?"":"on",f=function(c){return"readystatechange"!==c.type||"complete"===d.readyState?(("load"===c.type?a:d)[i](h+c.type,f,!1),!e&&(e=!0)?b.call(a,c.type||c):void 0):void 0},g=function(){var a;try{j.doScroll("left")}catch(b){return a=b,void setTimeout(g,50)}return f("poll")},"complete"!==d.readyState){if(d.createEventObject&&j.doScroll){try{k=!a.frameElement}catch(l){}k&&g()}return d[c](h+"DOMContentLoaded",f,!1),d[c](h+"readystatechange",f,!1),a[c](h+"load",f,!1)}},a._autoDiscoverFunction=function(){return a.autoDiscover?a.discover():void 0},d(window,a._autoDiscoverFunction)}.call(this),function(a){"function"==typeof define&&define.amd?define(["jquery","codemirror"],a):a(window.jQuery,window.CodeMirror)}(function(a,b){"function"!=typeof Array.prototype.reduce&&(Array.prototype.reduce=function(a,b){var c,d,e=this.length>>>0,f=!1;for(1<arguments.length&&(d=b,f=!0),c=0;e>c;++c)this.hasOwnProperty(c)&&(f?d=a(d,this[c],c,this):(d=this[c],f=!0));if(!f)throw new TypeError("Reduce of empty array with no initial value");return d});var c={"bMac":navigator.appVersion.indexOf("Mac")>-1,"bMSIE":navigator.userAgent.indexOf("MSIE")>-1,"bFF":navigator.userAgent.indexOf("Firefox")>-1,"jqueryVersion":parseFloat(a.fn.jquery),"bCodeMirror":!!b},d=function(){var a=function(a){return function(b){return a===b}},b=function(a,b){return a===b},c=function(){return!0},d=function(){return!1},e=function(a){return function(){return!a.apply(a,arguments)}},f=function(a){return a};return{"eq":a,"eq2":b,"ok":c,"fail":d,"not":e,"self":f}}(),e=function(){var a=function(a){return a[0]},b=function(a){return a[a.length-1]},c=function(a){return a.slice(0,a.length-1)},e=function(a){return a.slice(1)},f=function(a,b){var c=a.indexOf(b);return-1===c?null:a[c+1]},g=function(a,b){var c=a.indexOf(b);return-1===c?null:a[c-1]},h=function(a,b){return b=b||d.self,a.reduce(function(a,c){return a+b(c)},0)},i=function(a){for(var b=[],c=-1,d=a.length;++c<d;)b[c]=a[c];return b},j=function(c,d){if(0===c.length)return[];var f=e(c);return f.reduce(function(a,c){var e=b(a);return d(b(e),c)?e[e.length]=c:a[a.length]=[c],a},[[a(c)]])},k=function(a){for(var b=[],c=0,d=a.length;d>c;c++)a[c]&&b.push(a[c]);return b};return{"head":a,"last":b,"initial":c,"tail":e,"prev":g,"next":f,"sum":h,"from":i,"compact":k,"clusterBy":j}}(),f=function(){var b=function(b){return b&&a(b).hasClass("note-editable")},g=function(b){return b&&a(b).hasClass("note-control-sizing")},h=function(a){var b=function(b){return function(){return a.find(b)}};return{"editor":function(){return a},"dropzone":b(".note-dropzone"),"toolbar":b(".note-toolbar"),"editable":b(".note-editable"),"codable":b(".note-codable"),"statusbar":b(".note-statusbar"),"popover":b(".note-popover"),"handle":b(".note-handle"),"dialog":b(".note-dialog")}},i=function(a){return function(b){return b&&b.nodeName===a}},j=function(a){return a&&/^DIV|^P|^LI|^H[1-7]/.test(a.nodeName)},k=function(a){return a&&/^UL|^OL/.test(a.nodeName)},l=function(a){return a&&/^TD|^TH/.test(a.nodeName)},m=function(a,c){for(;a;){if(c(a))return a;if(b(a))break;a=a.parentNode}return null},n=function(a,b){b=b||d.fail;var c=[];return m(a,function(a){return c.push(a),b(a)}),c},o=function(b,c){for(var d=n(b),e=c;e;e=e.parentNode)if(a.inArray(e,d)>-1)return e;return null},p=function(a,b){var c=[],d=!1,e=!1;return function f(g){if(g){if(g===a&&(d=!0),d&&!e&&c.push(g),g===b)return void(e=!0);for(var h=0,i=g.childNodes.length;i>h;h++)f(g.childNodes[h])}}(o(a,b)),c},q=function(a,b){b=b||d.fail;for(var c=[];a&&(c.push(a),!b(a));)a=a.previousSibling;return c},r=function(a,b){b=b||d.fail;for(var c=[];a&&(c.push(a),!b(a));)a=a.nextSibling;return c},s=function(a,b){var c=[];return b=b||d.ok,function e(d){a!==d&&b(d)&&c.push(d);for(var f=0,g=d.childNodes.length;g>f;f++)e(d.childNodes[f])}(a),c},t=function(a,b){var c=b.nextSibling,d=b.parentNode;return c?d.insertBefore(a,c):d.appendChild(a),a},u=function(b,c){return a.each(c,function(a,c){b.appendChild(c)}),b},v=i("#text"),w=function(a){return v(a)?a.nodeValue.length:a.childNodes.length},x=function(a){for(var b=0;a=a.previousSibling;)b+=1;return b},y=function(b,c){var f=e.initial(n(c,d.eq(b)));return a.map(f,x).reverse()},z=function(a,b){for(var c=a,d=0,e=b.length;e>d;d++)c=c.childNodes[b[d]];return c},A=function(a,b){if(0===b)return a;if(b>=w(a))return a.nextSibling;if(v(a))return a.splitText(b);var c=a.childNodes[b];return a=t(a.cloneNode(!1),a),u(a,r(c))},B=function(a,b,c){var e=n(b,d.eq(a));return 1===e.length?A(b,c):e.reduce(function(a,d){var e=d.cloneNode(!1);return t(e,d),a===b&&(a=A(a,c)),u(e,r(a)),e})},C=function(a,b){if(a&&a.parentNode){if(a.removeNode)return a.removeNode(b);var c=a.parentNode;if(!b){var d,e,f=[];for(d=0,e=a.childNodes.length;e>d;d++)f.push(a.childNodes[d]);for(d=0,e=f.length;e>d;d++)c.insertBefore(f[d],a)}c.removeChild(a)}},D=function(a){return f.isTextarea(a[0])?a.val():a.html()};return{"blank":c.bMSIE?" ":"<br/>","emptyPara":"<p><br/></p>","isEditable":b,"isControlSizing":g,"buildLayoutInfo":h,"isText":v,"isPara":j,"isList":k,"isTable":i("TABLE"),"isCell":l,"isAnchor":i("A"),"isDiv":i("DIV"),"isLi":i("LI"),"isSpan":i("SPAN"),"isB":i("B"),"isU":i("U"),"isS":i("S"),"isI":i("I"),"isImg":i("IMG"),"isTextarea":i("TEXTAREA"),"ancestor":m,"listAncestor":n,"listNext":r,"listPrev":q,"listDescendant":s,"commonAncestor":o,"listBetween":p,"insertAfter":t,"position":x,"makeOffsetPath":y,"fromOffsetPath":z,"split":B,"remove":C,"html":D}}(),g={"version":"0.5.1","options":{"width":null,"height":null,"focus":!1,"tabsize":null,"styleWithSpan":!0,"disableLinkTarget":!1,"disableDragAndDrop":!1,"codemirror":null,"lang":"en-US","direction":null,"toolbar":[["style",["style"]],["font",["bold","italic","underline","clear"]],["fontname",["fontname"]],["color",["color"]],["para",["ul","ol","paragraph"]],["height",["height"]],["table",["table"]],["insert",["link","picture","video"]],["view",["fullscreen","codeview"]],["help",["help"]]],"oninit":null,"onfocus":null,"onblur":null,"onenter":null,"onkeyup":null,"onkeydown":null,"onImageUpload":null,"onImageUploadError":null,"onToolbarClick":null},"lang":{"en-US":{"font":{"bold":"Bold","italic":"Italic","underline":"Underline","strike":"Strike","clear":"Remove Font Style","height":"Line Height","name":"Font Family","size":"Font Size"},"image":{"image":"Picture","insert":"Insert Image","resizeFull":"Resize Full","resizeHalf":"Resize Half","resizeQuarter":"Resize Quarter","floatLeft":"Float Left","floatRight":"Float Right","floatNone":"Float None","dragImageHere":"Drag an image here","selectFromFiles":"Select from files","url":"Image URL","remove":"Remove Image"},"link":{"link":"Link","insert":"Insert Link","unlink":"Unlink","edit":"Edit","textToDisplay":"Text to display","url":"To what URL should this link go?","openInNewWindow":"Open in new window"},"video":{"video":"Video","videoLink":"Video Link","insert":"Insert Video","url":"Video URL?","providers":"(YouTube, Vimeo, Vine, Instagram, or DailyMotion)"},"table":{"table":"Table"},"hr":{"insert":"Insert Horizontal Rule"},"style":{"style":"Style","normal":"Normal","blockquote":"Quote","pre":"Code","h1":"Header 1","h2":"Header 2","h3":"Header 3","h4":"Header 4","h5":"Header 5","h6":"Header 6"},"lists":{"unordered":"Unordered list","ordered":"Ordered list"},"options":{"help":"Help","fullscreen":"Full Screen","codeview":"Code View"},"paragraph":{"paragraph":"Paragraph","outdent":"Outdent","indent":"Indent","left":"Align left","center":"Align center","right":"Align right","justify":"Justify full"},"color":{"recent":"Recent Color","more":"More Color","background":"BackColor","foreground":"FontColor","transparent":"Transparent","setTransparent":"Set transparent","reset":"Reset","resetToDefault":"Reset to default"},"shortcut":{"shortcuts":"Keyboard shortcuts","close":"Close","textFormatting":"Text formatting","action":"Action","paragraphFormatting":"Paragraph formatting","documentStyle":"Document Style"},"history":{"undo":"Undo","redo":"Redo"}}}},h=function(){var b=function(b){return a.Deferred(function(c){a.extend(new FileReader,{"onload":function(a){var b=a.target.result;c.resolve(b)},"onerror":function(){c.reject(this)}}).readAsDataURL(b)}).promise()},c=function(b){return a.Deferred(function(c){a.extend(new Image,{"detachEvents":function(){this.onload=null,this.onerror=null,this.onabort=null},"onload":function(){this.detachEvents(),c.resolve(this)},"onerror":function(){this.detachEvents(),c.reject(this)},"onabort":function(){this.detachEvents(),c.reject(this)}}).src=b}).promise()};return{"readFileAsDataURL":b,"loadImage":c}}(),i={"BACKSPACE":8,"TAB":9,"ENTER":13,"SPACE":32,"NUM0":48,"NUM1":49,"NUM6":54,"NUM7":55,"NUM8":56,"B":66,"E":69,"I":73,"J":74,"K":75,"L":76,"R":82,"S":83,"U":85,"Y":89,"Z":90,"SLASH":191,"LEFTBRACKET":219,"BACKSLACH":220,"RIGHTBRACKET":221},j=function(){var b=function(b,d){if(c.jqueryVersion<1.9){var e={};return a.each(d,function(a,c){e[c]=b.css(c)}),e}return b.css.call(b,d)};this.stylePara=function(b,c){a.each(b.nodes(f.isPara),function(b,d){a(d).css(c)})},this.current=function(c,d){var e=a(f.isText(c.sc)?c.sc.parentNode:c.sc),g=["font-family","font-size","text-align","list-style-type","line-height"],h=b(e,g)||{};if(h["font-size"]=parseInt(h["font-size"]),h["font-bold"]=document.queryCommandState("bold")?"bold":"normal",h["font-italic"]=document.queryCommandState("italic")?"italic":"normal",h["font-underline"]=document.queryCommandState("underline")?"underline":"normal",c.isOnList()){var i=["circle","disc","disc-leading-zero","square"],j=a.inArray(h["list-style-type"],i)>-1;h["list-style"]=j?"unordered":"ordered"}else h["list-style"]="none";var k=f.ancestor(c.sc,f.isPara);if(k&&k.style["line-height"])h["line-height"]=k.style.lineHeight;else{var l=parseInt(h["line-height"])/parseInt(h["font-size"]);h["line-height"]=l.toFixed(1)}return h.image=f.isImg(d)&&d,h.anchor=c.isOnAnchor()&&f.ancestor(c.sc,f.isAnchor),h.aAncestor=f.listAncestor(c.sc,f.isEditable),h}},k=function(){var b=!!document.createRange,c=function(a,b){var c,d,g=a.parentElement(),h=document.body.createTextRange(),i=e.from(g.childNodes);for(c=0;c<i.length;c++)if(!f.isText(i[c])){if(h.moveToElementText(i[c]),h.compareEndPoints("StartToStart",a)>=0)break;d=i[c]}if(0!==c&&f.isText(i[c-1])){var j=document.body.createTextRange(),k=null;j.moveToElementText(d||g),j.collapse(!d),k=d?d.nextSibling:g.firstChild;var l=a.duplicate();l.setEndPoint("StartToStart",j);for(var m=l.text.replace(/[\r\n]/g,"").length;m>k.nodeValue.length&&k.nextSibling;)m-=k.nodeValue.length,k=k.nextSibling;{k.nodeValue}b&&k.nextSibling&&f.isText(k.nextSibling)&&m===k.nodeValue.length&&(m-=k.nodeValue.length,k=k.nextSibling),g=k,c=m}return{"cont":g,"offset":c}},g=function(a){var b=function(a,c){var g,h;if(f.isText(a)){var i=f.listPrev(a,d.not(f.isText)),j=e.last(i).previousSibling;g=j||a.parentNode,c+=e.sum(e.tail(i),f.length),h=!j}else{if(g=a.childNodes[c]||a,f.isText(g))return b(g,c);c=0,h=!1}return{"cont":g,"collapseToStart":h,"offset":c}},c=document.body.createTextRange(),g=b(a.cont,a.offset);return c.moveToElementText(g.cont),c.collapse(g.collapseToStart),c.moveStart("character",g.offset),c},h=function(c,h,i,j){this.sc=c,this.so=h,this.ec=i,this.eo=j;var k=function(){if(b){var a=document.createRange();return a.setStart(c,h),a.setEnd(i,j),a}var d=g({"cont":c,"offset":h});return d.setEndPoint("EndToEnd",g({"cont":i,"offset":j})),d};this.select=function(){var a=k();if(b){var c=document.getSelection();c.rangeCount>0&&c.removeAllRanges(),c.addRange(a)}else a.select()},this.nodes=function(b){var g=f.listBetween(c,i),h=e.compact(a.map(g,function(a){return f.ancestor(a,b)}));return a.map(e.clusterBy(h,d.eq2),e.head)},this.commonAncestor=function(){return f.commonAncestor(c,i)};var l=function(a){return function(){var b=f.ancestor(c,a);return!!b&&b===f.ancestor(i,a)}};this.isOnEditable=l(f.isEditable),this.isOnList=l(f.isList),this.isOnAnchor=l(f.isAnchor),this.isOnCell=l(f.isCell),this.isCollapsed=function(){return c===i&&h===j},this.insertNode=function(a){var c=k();b?c.insertNode(a):c.pasteHTML(a.outerHTML)},this.toString=function(){var a=k();return b?a.toString():a.text},this.bookmark=function(a){return{"s":{"path":f.makeOffsetPath(a,c),"offset":h},"e":{"path":f.makeOffsetPath(a,i),"offset":j}}}};return{"create":function(a,d,e,f){if(0===arguments.length)if(b){var g=document.getSelection();if(0===g.rangeCount)return null;var i=g.getRangeAt(0);a=i.startContainer,d=i.startOffset,e=i.endContainer,f=i.endOffset}else{var j=document.selection.createRange(),k=j.duplicate();k.collapse(!1);var l=j;l.collapse(!0);var m=c(l,!0),n=c(k,!1);a=m.cont,d=m.offset,e=n.cont,f=n.offset}else 2===arguments.length&&(e=a,f=d);return new h(a,d,e,f)},"createFromNode":function(a){return this.create(a,0,a,1)},"createFromBookmark":function(a,b){var c=f.fromOffsetPath(a,b.s.path),d=b.s.offset,e=f.fromOffsetPath(a,b.e.path),g=b.e.offset;return new h(c,d,e,g)}}}(),l=function(){this.tab=function(a,b){var c=f.ancestor(a.commonAncestor(),f.isCell),d=f.ancestor(c,f.isTable),g=f.listDescendant(d,f.isCell),h=e[b?"prev":"next"](g,c);h&&k.create(h,0).select()},this.createTable=function(b,c){for(var d,e=[],g=0;b>g;g++)e.push("<td>"+f.blank+"</td>");d=e.join("");for(var h,i=[],j=0;c>j;j++)i.push("<tr>"+d+"</tr>");h=i.join("");var k='<table class="table table-bordered">'+h+"</table>";return a(k)[0]}},m=function(){var b=new j,d=new l;this.saveRange=function(a){a.data("range",k.create())},this.restoreRange=function(a){var b=a.data("range");b&&b.select()},this.currentStyle=function(a){var c=k.create();return c&&c.isOnEditable()&&b.current(c,a)},this.undo=function(a){a.data("NoteHistory").undo(a)},this.redo=function(a){a.data("NoteHistory").redo(a)};for(var e=this.recordUndo=function(a){a.data("NoteHistory").recordUndo(a)},g=["bold","italic","underline","strikethrough","justifyLeft","justifyCenter","justifyRight","justifyFull","insertOrderedList","insertUnorderedList","indent","outdent","formatBlock","removeFormat","backColor","foreColor","insertHorizontalRule","fontName"],i=0,m=g.length;m>i;i++)this[g[i]]=function(a){return function(b,c){e(b),document.execCommand(a,!1,c)}}(g[i]);var n=function(b,c,d){e(b);var g=new Array(d+1).join(" ");c.insertNode(a('<span id="noteTab">'+g+"</span>")[0]);var h=a("#noteTab").removeAttr("id");c=k.create(h[0],1),c.select(),f.remove(h[0])};this.tab=function(a,b,c){var e=k.create();e.isCollapsed()&&e.isOnCell()?d.tab(e,c):n(a,e,b)},this.insertImage=function(b,c){h.loadImage(c).done(function(d){e(b);var f=a("<img>").attr("src",c);f.css("width",Math.min(b.width(),d.width)),k.create().insertNode(f[0])}).fail(function(){var a=b.data("callbacks");a.onImageUploadError&&a.onImageUploadError()})},this.insertVideo=function(b,c){e(b);var d,f=/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/,g=c.match(f),h=/\/\/instagram.com\/p\/(.[a-zA-Z0-9]*)/,i=c.match(h),j=/\/\/vine.co\/v\/(.[a-zA-Z0-9]*)/,l=c.match(j),m=/\/\/(player.)?vimeo.com\/([a-z]*\/)*([0-9]{6,11})[?]?.*/,n=c.match(m),o=/.+dailymotion.com\/(video|hub)\/([^_]+)[^#]*(#video=([^_&]+))?/,p=c.match(o);if(g&&11===g[2].length){var q=g[2];d=a("<iframe>").attr("src","//www.youtube.com/embed/"+q).attr("width","640").attr("height","360")}else i&&i[0].length>0?d=a("<iframe>").attr("src",i[0]+"/embed/").attr("width","612").attr("height","710").attr("scrolling","no").attr("allowtransparency","true"):l&&l[0].length>0?d=a("<iframe>").attr("src",l[0]+"/embed/simple").attr("width","600").attr("height","600").attr("class","vine-embed"):n&&n[3].length>0?d=a("<iframe webkitallowfullscreen mozallowfullscreen allowfullscreen>").attr("src","//player.vimeo.com/video/"+n[3]).attr("width","640").attr("height","360"):p&&p[2].length>0&&(d=a("<iframe>").attr("src","//www.dailymotion.com/embed/video/"+p[2]).attr("width","640").attr("height","360"));d&&(d.attr("frameborder",0),k.create().insertNode(d[0]))},this.formatBlock=function(a,b){e(a),b=c.bMSIE?"<"+b+">":b,document.execCommand("FormatBlock",!1,b)},this.fontSize=function(a,b){e(a),document.execCommand("fontSize",!1,3),c.bFF?a.find("font[size=3]").removeAttr("size").css("font-size",b+"px"):a.find("span").filter(function(){return"medium"===this.style.fontSize}).css("font-size",b+"px")},this.lineHeight=function(a,c){e(a),b.stylePara(k.create(),{"lineHeight":c})},this.unlink=function(a){var b=k.create();if(b.isOnAnchor()){e(a);var c=f.ancestor(b.sc,f.isAnchor);b=k.createFromNode(c),b.select(),document.execCommand("unlink")}},this.createLink=function(b,d,g){var h=k.create();e(b);var i=d;if(-1!==d.indexOf("@")&&-1===d.indexOf(":")?i="mailto:"+d:-1===d.indexOf("://")&&(i="http://"+d),(c.bMSIE||c.bFF)&&h.isCollapsed()){h.insertNode(a('<A id="linkAnchor">'+d+"</A>")[0]);var j=a("#linkAnchor").attr("href",i).removeAttr("id");h=k.createFromNode(j[0]),h.select()}else document.execCommand("createlink",!1,i),h=k.create();a.each(h.nodes(f.isAnchor),function(b,c){g?a(c).attr("target","_blank"):a(c).removeAttr("target")})},this.setLinkDialog=function(b,c){var d=k.create(),e=!0;if(d.isOnAnchor()){var g=f.ancestor(d.sc,f.isAnchor);d=k.createFromNode(g),e="_blank"===a(g).attr("target")}var h=this;c({"text":d.toString(),"url":d.isOnAnchor()?f.ancestor(d.sc,f.isAnchor).href:"","newWindow":e},function(a,c){d.select(),h.createLink(b,a,c)})},this.setVideoDialog=function(a,b){var c=k.create();if(c.isOnAnchor()){var d=f.ancestor(c.sc,f.isAnchor);c=k.createFromNode(d)}var e=this;b({"text":c.toString()},function(b){c.select(),e.insertVideo(a,b)})},this.color=function(a,b){var c=JSON.parse(b),d=c.foreColor,f=c.backColor;e(a),d&&document.execCommand("foreColor",!1,d),f&&document.execCommand("backColor",!1,f)},this.insertTable=function(a,b){e(a);var c=b.split("x");k.create().insertNode(d.createTable(c[0],c[1]))},this.floatMe=function(a,b,c){e(a),c.css("float",b)},this.resize=function(a,b,c){e(a),c.css({"width":a.width()*b+"px","height":""})},this.resizeTo=function(a,b,c){var d;if(c){var e=a.y/a.x,f=b.data("ratio");d={"width":f>e?a.x:a.y/f,"height":f>e?a.x*f:a.y}}else d={"width":a.x,"height":a.y};b.css(d)},this.removeMedia=function(a,b,c){e(a),c.detach()}},n=function(){var a=[],b=[],c=function(a){var b=a[0],c=k.create();return{"contents":a.html(),"bookmark":c.bookmark(b),"scrollTop":a.scrollTop()}},d=function(a,b){a.html(b.contents).scrollTop(b.scrollTop),k.createFromBookmark(a[0],b.bookmark).select()};this.undo=function(e){var f=c(e);0!==a.length&&(d(e,a.pop()),b.push(f))},this.redo=function(e){var f=c(e);0!==b.length&&(d(e,b.pop()),a.push(f))},this.recordUndo=function(d){b=[],a.push(c(d))}},o=function(){this.update=function(b,c){var d=function(b,c){b.find(".dropdown-menu li a").each(function(){var b=a(this).data("value")+""==c+"";this.className=b?"checked":""})},f=function(a,c){var d=b.find(a);d.toggleClass("active",c())},g=b.find(".note-fontname");if(g.length>0){var h=c["font-family"];h&&(h=e.head(h.split(",")),h=h.replace(/\'/g,""),g.find(".note-current-fontname").text(h),d(g,h))}var i=b.find(".note-fontsize");i.find(".note-current-fontsize").text(c["font-size"]),d(i,parseFloat(c["font-size"]));var j=b.find(".note-height");d(j,parseFloat(c["line-height"])),f('button[data-event="bold"]',function(){return"bold"===c["font-bold"]}),f('button[data-event="italic"]',function(){return"italic"===c["font-italic"]}),f('button[data-event="underline"]',function(){return"underline"===c["font-underline"]}),f('button[data-event="justifyLeft"]',function(){return"left"===c["text-align"]||"start"===c["text-align"]}),f('button[data-event="justifyCenter"]',function(){return"center"===c["text-align"]}),f('button[data-event="justifyRight"]',function(){return"right"===c["text-align"]}),f('button[data-event="justifyFull"]',function(){return"justify"===c["text-align"]}),f('button[data-event="insertUnorderedList"]',function(){return"unordered"===c["list-style"]}),f('button[data-event="insertOrderedList"]',function(){return"ordered"===c["list-style"]})},this.updateRecentColor=function(b,c,d){var e=a(b).closest(".note-color"),f=e.find(".note-recent-color"),g=JSON.parse(f.attr("data-value"));g[c]=d,f.attr("data-value",JSON.stringify(g));var h="backColor"===c?"background-color":"color";f.find("i").css(h,d)},this.updateFullscreen=function(a,b){var c=a.find('button[data-event="fullscreen"]');c.toggleClass("active",b)},this.updateCodeview=function(a,b){var c=a.find('button[data-event="codeview"]');c.toggleClass("active",b)},this.activate=function(a){a.find("button").not('button[data-event="codeview"]').removeClass("disabled")},this.deactivate=function(a){a.find("button").not('button[data-event="codeview"]').addClass("disabled")}},p=function(){var b=function(b,c){var d=a(c),e=d.position(),f=d.height();b.css({"display":"block","left":e.left,"top":e.top+f})};this.update=function(a,c){var d=a.find(".note-link-popover");if(c.anchor){var e=d.find("a");e.attr("href",c.anchor.href).html(c.anchor.href),b(d,c.anchor)}else d.hide();var f=a.find(".note-image-popover");c.image?b(f,c.image):f.hide()},this.hide=function(a){a.children().hide()
|
|
}},q=function(){this.update=function(b,c){var d=b.find(".note-control-selection");if(c.image){var e=a(c.image),f=e.position(),g={"w":e.width(),"h":e.height()};d.css({"display":"block","left":f.left,"top":f.top,"width":g.w,"height":g.h}).data("target",c.image);var h=g.w+"x"+g.h;d.find(".note-control-selection-info").text(h)}else d.hide()},this.hide=function(a){a.children().hide()}},r=function(){var b=function(a,b){b?a.removeClass("disabled").attr("disabled",!1):a.addClass("disabled").attr("disabled",!0)};this.showImageDialog=function(c,d,e,f){var g=d.find(".note-image-dialog"),h=d.find(".note-image-input"),i=d.find(".note-image-url"),j=d.find(".note-image-btn");g.one("shown.bs.modal",function(c){c.stopPropagation(),h.on("change",function(){e(this.files),a(this).val(""),g.modal("hide")}),j.click(function(a){g.modal("hide"),f(i.val()),a.preventDefault()}),i.keyup(function(){b(j,i.val())}).val("").focus()}).one("hidden.bs.modal",function(){c.focus(),h.off("change"),i.off("keyup"),j.off("click")}).modal("show")},this.showVideoDialog=function(a,c,d,e){var f=c.find(".note-video-dialog"),g=f.find(".note-video-url"),h=f.find(".note-video-btn");f.one("shown.bs.modal",function(a){a.stopPropagation(),g.val(d.text).keyup(function(){b(h,g.val())}).trigger("keyup").trigger("focus"),h.click(function(a){f.modal("hide"),e(g.val()),a.preventDefault()})}).one("hidden.bs.modal",function(){a.focus(),g.off("keyup"),h.off("click")}).modal("show")},this.showLinkDialog=function(a,c,d,e){var f=c.find(".note-link-dialog"),g=f.find(".note-link-text"),h=f.find(".note-link-url"),i=f.find(".note-link-btn"),j=f.find("input[type=checkbox]");f.one("shown.bs.modal",function(a){a.stopPropagation(),g.val(d.text),h.val(d.url).keyup(function(){b(i,h.val()),d.text||g.val(h.val())}).trigger("focus"),j.prop("checked",d.newWindow),i.click(function(a){f.modal("hide"),e(h.val(),j.is(":checked")),a.preventDefault()})}).one("hidden.bs.modal",function(){a.focus(),h.off("keyup"),i.off("click")}).modal("show")},this.showHelpDialog=function(a,b){var c=b.find(".note-help-dialog");c.one("hidden.bs.modal",function(){a.focus()}).modal("show")}},s=function(){var d=new m,e=new o,g=new p,j=new q,k=new r,l=function(b){var c=a(b).closest(".note-editor");return c.length>0&&f.buildLayoutInfo(c)},s=function(b,c){d.restoreRange(b);var e=b.data("callbacks");e.onImageUpload?e.onImageUpload(c,d,b):a.each(c,function(a,c){h.readFileAsDataURL(c).done(function(a){d.insertImage(b,a)}).fail(function(){e.onImageUploadError&&e.onImageUploadError()})})},t=function(a){var b=c.bMac?a.metaKey:a.ctrlKey,e=a.shiftKey,f=a.keyCode,g=b||e||f===i.TAB,h=g?l(a.target):null;if(f===i.TAB){var j=h.editor().data("options").tabsize;d.tab(h.editable(),j,e)}else if(b&&(e&&f===i.Z||f===i.Y))d.redo(h.editable());else if(b&&f===i.Z)d.undo(h.editable());else if(b&&f===i.B)d.bold(h.editable());else if(b&&f===i.I)d.italic(h.editable());else if(b&&f===i.U)d.underline(h.editable());else if(b&&e&&f===i.S)d.strikethrough(h.editable());else if(b&&f===i.BACKSLACH)d.removeFormat(h.editable());else if(b&&f===i.K)d.setLinkDialog(h.editable(),function(a,b){k.showLinkDialog(h.editable(),h.dialog(),a,b)});else if(b&&f===i.SLASH)k.showHelpDialog(h.editable(),h.dialog());else if(b&&e&&f===i.L)d.justifyLeft(h.editable());else if(b&&e&&f===i.E)d.justifyCenter(h.editable());else if(b&&e&&f===i.R)d.justifyRight(h.editable());else if(b&&e&&f===i.J)d.justifyFull(h.editable());else if(b&&e&&f===i.NUM7)d.insertUnorderedList(h.editable());else if(b&&e&&f===i.NUM8)d.insertOrderedList(h.editable());else if(b&&f===i.LEFTBRACKET)d.outdent(h.editable());else if(b&&f===i.RIGHTBRACKET)d.indent(h.editable());else if(b&&f===i.NUM0)d.formatBlock(h.editable(),"P");else if(b&&i.NUM1<=f&&f<=i.NUM6){var m="H"+String.fromCharCode(f);d.formatBlock(h.editable(),m)}else{if(!b||f!==i.ENTER)return void((f===i.BACKSPACE||f===i.ENTER||f===i.SPACE)&&d.recordUndo(l(a.target).editable()));d.insertHorizontalRule(h.editable())}a.preventDefault()},u=function(a){var b=a.originalEvent.dataTransfer;if(b&&b.files){var c=l(a.currentTarget||a.target);c.editable().focus(),s(c.editable(),b.files)}a.preventDefault()},v=function(a){f.isImg(a.target)&&a.preventDefault()},w=function(a){var b=l(a.currentTarget||a.target),c=d.currentStyle(a.target);c&&(e.update(b.toolbar(),c),g.update(b.popover(),c),j.update(b.handle(),c))},x=function(a){var b=l(a.currentTarget||a.target);g.hide(b.popover()),j.hide(b.handle())},y=function(b){if(f.isControlSizing(b.target)){var c=l(b.target),e=c.handle(),h=c.popover(),i=c.editable(),k=c.editor(),m=e.find(".note-control-selection").data("target"),n=a(m),o=n.offset(),p=a(document).scrollTop();k.on("mousemove",function(a){d.resizeTo({"x":a.clientX-o.left,"y":a.clientY-(o.top-p)},n,!a.shiftKey),j.update(e,{"image":m}),g.update(h,{"image":m})}).one("mouseup",function(){k.off("mousemove")}),n.data("ratio")||n.data("ratio",n.height()/n.width()),d.recordUndo(i),b.stopPropagation(),b.preventDefault()}},z=function(b){var c=a(b.target).closest("[data-event]");c.length>0&&b.preventDefault()},A=function(g){var h=a(g.target).closest("[data-event]");if(h.length>0){var i,j,m,n=h.attr("data-event"),o=h.attr("data-value"),p=l(g.target),q=p.editor(),r=p.toolbar(),t=p.dialog(),u=p.editable(),v=p.codable(),x=q.data("options");if(-1!==a.inArray(n,["resize","floatMe","removeMedia"])){var y=p.handle(),z=y.find(".note-control-selection");m=a(z.data("target"))}if(d[n]&&(u.trigger("focus"),d[n](u,o,m)),-1!==a.inArray(n,["backColor","foreColor"]))e.updateRecentColor(h[0],n,o);else if("showLinkDialog"===n)u.focus(),d.setLinkDialog(u,function(a,b){k.showLinkDialog(u,t,a,b)});else if("showImageDialog"===n)u.focus(),k.showImageDialog(u,t,function(a){s(u,a)},function(a){d.restoreRange(u),d.insertImage(u,a)});else if("showVideoDialog"===n)u.focus(),d.setVideoDialog(u,function(a,b){k.showVideoDialog(u,t,a,b)});else if("showHelpDialog"===n)k.showHelpDialog(u,t);else if("fullscreen"===n){q.toggleClass("fullscreen");var A=function(){var b=a(window).width();q.css("width",b);var c=a(window).height()-r.outerHeight();u.css("height",c),v.css("height",c);var d=v.data("cmEditor");d&&d.setSize(null,c)},B=a("html, body"),C=q.hasClass("fullscreen");if(C)q.data("orgWidth",q.width()),u.data("orgHeight",u.css("height")),a(window).on("resize",A).trigger("resize"),B.css("overflow","hidden");else{var D=q.data("orgWidth"),E=D===a(window).width()?"auto":D;q.css("width",E);var F=u.data("orgHeight");u.css("height",F),v.css("height",F),j=v.data("cmEditor"),j&&j.setSize(null,F),B.css("overflow","auto"),a(window).off("resize")}e.updateFullscreen(r,C)}else if("codeview"===n){q.toggleClass("codeview");var G=q.hasClass("codeview");if(G){if(v.val(u.html()),v.height(u.height()),e.deactivate(r),v.focus(),c.bCodeMirror){j=b.fromTextArea(v[0],a.extend({"mode":"text/html","lineNumbers":!0},x.codemirror));var H=q.data("options").codemirror.tern||!1;H&&(i=new b.TernServer(H),j.ternServer=i,j.on("cursorActivity",function(a){i.updateArgHints(a)})),j.setSize(null,u.outerHeight()),j.autoFormatRange&&j.autoFormatRange({"line":0,"ch":0},{"line":j.lineCount(),"ch":j.getTextArea().value.length}),v.data("cmEditor",j)}}else c.bCodeMirror&&(j=v.data("cmEditor"),v.val(j.getValue()),j.toTextArea()),u.html(v.val()||f.emptyPara),u.height(x.height?v.height():"auto"),e.activate(r),u.focus();e.updateCodeview(p.toolbar(),G)}w(g)}},B=24,C=function(b){var c=a(document),d=l(b.target).editable(),e=d.offset().top-c.scrollTop();c.on("mousemove",function(a){var b=a.clientY-(e+B);d.height(b)}).one("mouseup",function(){c.off("mousemove")}),b.stopPropagation(),b.preventDefault()},D=18,E=function(b){var c,d=a(b.target.parentNode),e=d.next(),f=d.find(".note-dimension-picker-mousecatcher"),g=d.find(".note-dimension-picker-highlighted"),h=d.find(".note-dimension-picker-unhighlighted");if(void 0===b.offsetX){var i=a(b.target).offset();c={"x":b.pageX-i.left,"y":b.pageY-i.top}}else c={"x":b.offsetX,"y":b.offsetY};var j={"c":Math.ceil(c.x/D)||1,"r":Math.ceil(c.y/D)||1};g.css({"width":j.c+"em","height":j.r+"em"}),f.attr("data-value",j.c+"x"+j.r),3<j.c&&j.c<10&&h.css({"width":j.c+1+"em"}),3<j.r&&j.r<10&&h.css({"height":j.r+1+"em"}),e.html(j.c+" x "+j.r)},F=function(b){var c=a(),d=b.dropzone,e=b.dropzone.find(".note-dropzone-message");a(document).on("dragenter",function(a){var f=b.editor.hasClass("codeview");f||0!==c.length||(b.editor.addClass("dragover"),d.width(b.editor.width()),d.height(b.editor.height()),e.text("Drag Image Here")),c=c.add(a.target)}).on("dragleave",function(a){c=c.not(a.target),0===c.length&&b.editor.removeClass("dragover")}).on("drop",function(){c=a(),b.editor.removeClass("dragover")}),d.on("dragenter",function(){d.addClass("hover"),e.text("Drop Image")}).on("dragleave",function(){d.removeClass("hover"),e.text("Drag Image Here")}),d.on("drop",function(a){u(a)}).on("dragover",!1)};this.attach=function(a,b){a.editable.on("keydown",t),a.editable.on("mousedown",v),a.editable.on("keyup mouseup",w),a.editable.on("scroll",x),b.disableDragAndDrop||F(a),a.handle.on("mousedown",y),a.toolbar.on("click",A),a.popover.on("click",A),a.toolbar.on("mousedown",z),a.popover.on("mousedown",z),a.statusbar.on("mousedown",C);var e=a.toolbar,f=e.find(".note-dimension-picker-mousecatcher");f.on("mousemove",E),a.editable.on("blur",function(){d.saveRange(a.editable)}),a.editor.data("options",b),b.styleWithSpan&&!c.bMSIE&&setTimeout(function(){document.execCommand("styleWithCSS",0,!0)}),a.editable.data("NoteHistory",new n),b.onenter&&a.editable.keypress(function(a){a.keyCode===i.ENTER&&b.onenter(a)}),b.onfocus&&a.editable.focus(b.onfocus),b.onblur&&a.editable.blur(b.onblur),b.onkeyup&&a.editable.keyup(b.onkeyup),b.onkeydown&&a.editable.keydown(b.onkeydown),b.onToolbarClick&&a.toolbar.click(b.onToolbarClick),a.editable.data("callbacks",{"onChange":b.onChange,"onAutoSave":b.onAutoSave,"onPasteBefore":b.onPasteBefore,"onPasteAfter":b.onPasteAfter,"onImageUpload":b.onImageUpload,"onImageUploadError":b.onImageUpload,"onFileUpload":b.onFileUpload,"onFileUploadError":b.onFileUpload})},this.dettach=function(a){a.editable.off(),a.toolbar.off(),a.handle.off(),a.popover.off()}},t=function(){var b,d,e,g,h;b={"picture":function(a){return'<button type="button" class="btn btn-default btn-sm btn-small" title="'+a.image.image+'" data-event="showImageDialog" tabindex="-1"><i class="fa fa-picture-o icon-picture"></i></button>'},"link":function(a){return'<button type="button" class="btn btn-default btn-sm btn-small" title="'+a.link.link+'" data-event="showLinkDialog" data-shortcut="Ctrl+K" data-mac-shortcut="\u2318+K" tabindex="-1"><i class="fa fa-link icon-link"></i></button>'},"video":function(a){return'<button type="button" class="btn btn-default btn-sm btn-small" title="'+a.video.video+'" data-event="showVideoDialog" tabindex="-1"><i class="fa fa-youtube-play icon-play"></i></button>'},"table":function(a){return'<button type="button" class="btn btn-default btn-sm btn-small dropdown-toggle" title="'+a.table.table+'" data-toggle="dropdown" tabindex="-1"><i class="fa fa-table icon-table"></i> <span class="caret"></span></button><ul class="dropdown-menu"><div class="note-dimension-picker"><div class="note-dimension-picker-mousecatcher" data-event="insertTable" data-value="1x1"></div><div class="note-dimension-picker-highlighted"></div><div class="note-dimension-picker-unhighlighted"></div></div><div class="note-dimension-display"> 1 x 1 </div></ul>'},"style":function(a){return'<button type="button" class="btn btn-default btn-sm btn-small dropdown-toggle" title="'+a.style.style+'" data-toggle="dropdown" tabindex="-1"><i class="fa fa-magic icon-magic"></i> <span class="caret"></span></button><ul class="dropdown-menu"><li><a data-event="formatBlock" data-value="p">'+a.style.normal+'</a></li><li><a data-event="formatBlock" data-value="blockquote"><blockquote>'+a.style.blockquote+'</blockquote></a></li><li><a data-event="formatBlock" data-value="pre">'+a.style.pre+'</a></li><li><a data-event="formatBlock" data-value="h1"><h1>'+a.style.h1+'</h1></a></li><li><a data-event="formatBlock" data-value="h2"><h2>'+a.style.h2+'</h2></a></li><li><a data-event="formatBlock" data-value="h3"><h3>'+a.style.h3+'</h3></a></li><li><a data-event="formatBlock" data-value="h4"><h4>'+a.style.h4+'</h4></a></li><li><a data-event="formatBlock" data-value="h5"><h5>'+a.style.h5+'</h5></a></li><li><a data-event="formatBlock" data-value="h6"><h6>'+a.style.h6+"</h6></a></li></ul>"},"fontname":function(a){var b=["Serif","Sans","Arial","Arial Black","Courier","Courier New","Comic Sans MS","Helvetica","Impact","Lucida Grande","Lucida Sans","Tahoma","Times","Times New Roman","Verdana"],c='<button type="button" class="btn btn-default btn-sm btn-small dropdown-toggle" data-toggle="dropdown" title="'+a.font.name+'" tabindex="-1"><span class="note-current-fontname">Arial</span> <b class="caret"></b></button>';c+='<ul class="dropdown-menu">';for(var d=0;d<b.length;d++)c+='<li><a data-event="fontName" data-value="'+b[d]+'"><i class="fa fa-check icon-ok"></i> '+b[d]+"</a></li>";return c+="</ul>"},"fontsize":function(a){return'<button type="button" class="btn btn-default btn-sm btn-small dropdown-toggle" data-toggle="dropdown" title="'+a.font.size+'" tabindex="-1"><span class="note-current-fontsize">11</span> <b class="caret"></b></button><ul class="dropdown-menu"><li><a data-event="fontSize" data-value="8"><i class="fa fa-check icon-ok"></i> 8</a></li><li><a data-event="fontSize" data-value="9"><i class="fa fa-check icon-ok"></i> 9</a></li><li><a data-event="fontSize" data-value="10"><i class="fa fa-check icon-ok"></i> 10</a></li><li><a data-event="fontSize" data-value="11"><i class="fa fa-check icon-ok"></i> 11</a></li><li><a data-event="fontSize" data-value="12"><i class="fa fa-check icon-ok"></i> 12</a></li><li><a data-event="fontSize" data-value="14"><i class="fa fa-check icon-ok"></i> 14</a></li><li><a data-event="fontSize" data-value="18"><i class="fa fa-check icon-ok"></i> 18</a></li><li><a data-event="fontSize" data-value="24"><i class="fa fa-check icon-ok"></i> 24</a></li><li><a data-event="fontSize" data-value="36"><i class="fa fa-check icon-ok"></i> 36</a></li></ul>'},"color":function(a){return'<button type="button" class="btn btn-default btn-sm btn-small note-recent-color" title="'+a.color.recent+'" data-event="color" data-value=\'{"backColor":"yellow"}\' tabindex="-1"><i class="fa fa-font icon-font" style="color:black;background-color:yellow;"></i></button><button type="button" class="btn btn-default btn-sm btn-small dropdown-toggle" title="'+a.color.more+'" data-toggle="dropdown" tabindex="-1"><span class="caret"></span></button><ul class="dropdown-menu"><li><div class="btn-group"><div class="note-palette-title">'+a.color.background+'</div><div class="note-color-reset" data-event="backColor" data-value="inherit" title="'+a.color.transparent+'">'+a.color.setTransparent+'</div><div class="note-color-palette" data-target-event="backColor"></div></div><div class="btn-group"><div class="note-palette-title">'+a.color.foreground+'</div><div class="note-color-reset" data-event="foreColor" data-value="inherit" title="'+a.color.reset+'">'+a.color.resetToDefault+'</div><div class="note-color-palette" data-target-event="foreColor"></div></div></li></ul>'},"bold":function(a){return'<button type="button" class="btn btn-default btn-sm btn-small" title="'+a.font.bold+'" data-shortcut="Ctrl+B" data-mac-shortcut="\u2318+B" data-event="bold" tabindex="-1"><i class="fa fa-bold icon-bold"></i></button>'},"italic":function(a){return'<button type="button" class="btn btn-default btn-sm btn-small" title="'+a.font.italic+'" data-shortcut="Ctrl+I" data-mac-shortcut="\u2318+I" data-event="italic" tabindex="-1"><i class="fa fa-italic icon-italic"></i></button>'},"underline":function(a){return'<button type="button" class="btn btn-default btn-sm btn-small" title="'+a.font.underline+'" data-shortcut="Ctrl+U" data-mac-shortcut="\u2318+U" data-event="underline" tabindex="-1"><i class="fa fa-underline icon-underline"></i></button>'},"clear":function(a){return'<button type="button" class="btn btn-default btn-sm btn-small" title="'+a.font.clear+'" data-shortcut="Ctrl+\\" data-mac-shortcut="\u2318+\\" data-event="removeFormat" tabindex="-1"><i class="fa fa-eraser icon-eraser"></i></button>'},"ul":function(a){return'<button type="button" class="btn btn-default btn-sm btn-small" title="'+a.lists.unordered+'" data-shortcut="Ctrl+Shift+8" data-mac-shortcut="\u2318+\u21e7+7" data-event="insertUnorderedList" tabindex="-1"><i class="fa fa-list-ul icon-list-ul"></i></button>'},"ol":function(a){return'<button type="button" class="btn btn-default btn-sm btn-small" title="'+a.lists.ordered+'" data-shortcut="Ctrl+Shift+7" data-mac-shortcut="\u2318+\u21e7+8" data-event="insertOrderedList" tabindex="-1"><i class="fa fa-list-ol icon-list-ol"></i></button>'},"paragraph":function(a){return'<button type="button" class="btn btn-default btn-sm btn-small dropdown-toggle" title="'+a.paragraph.paragraph+'" data-toggle="dropdown" tabindex="-1"><i class="fa fa-align-left icon-align-left"></i> <span class="caret"></span></button><div class="dropdown-menu"><div class="note-align btn-group"><button type="button" class="btn btn-default btn-sm btn-small" title="'+a.paragraph.left+'" data-shortcut="Ctrl+Shift+L" data-mac-shortcut="\u2318+\u21e7+L" data-event="justifyLeft" tabindex="-1"><i class="fa fa-align-left icon-align-left"></i></button><button type="button" class="btn btn-default btn-sm btn-small" title="'+a.paragraph.center+'" data-shortcut="Ctrl+Shift+E" data-mac-shortcut="\u2318+\u21e7+E" data-event="justifyCenter" tabindex="-1"><i class="fa fa-align-center icon-align-center"></i></button><button type="button" class="btn btn-default btn-sm btn-small" title="'+a.paragraph.right+'" data-shortcut="Ctrl+Shift+R" data-mac-shortcut="\u2318+\u21e7+R" data-event="justifyRight" tabindex="-1"><i class="fa fa-align-right icon-align-right"></i></button><button type="button" class="btn btn-default btn-sm btn-small" title="'+a.paragraph.justify+'" data-shortcut="Ctrl+Shift+J" data-mac-shortcut="\u2318+\u21e7+J" data-event="justifyFull" tabindex="-1"><i class="fa fa-align-justify icon-align-justify"></i></button></div><div class="note-list btn-group"><button type="button" class="btn btn-default btn-sm btn-small" title="'+a.paragraph.outdent+'" data-shortcut="Ctrl+[" data-mac-shortcut="\u2318+[" data-event="outdent" tabindex="-1"><i class="fa fa-outdent icon-indent-left"></i></button><button type="button" class="btn btn-default btn-sm btn-small" title="'+a.paragraph.indent+'" data-shortcut="Ctrl+]" data-mac-shortcut="\u2318+]" data-event="indent" tabindex="-1"><i class="fa fa-indent icon-indent-right"></i></button></div></div>'},"height":function(a){return'<button type="button" class="btn btn-default btn-sm btn-small dropdown-toggle" data-toggle="dropdown" title="'+a.font.height+'" tabindex="-1"><i class="fa fa-text-height icon-text-height"></i> <b class="caret"></b></button><ul class="dropdown-menu"><li><a data-event="lineHeight" data-value="1.0"><i class="fa fa-check icon-ok"></i> 1.0</a></li><li><a data-event="lineHeight" data-value="1.2"><i class="fa fa-check icon-ok"></i> 1.2</a></li><li><a data-event="lineHeight" data-value="1.4"><i class="fa fa-check icon-ok"></i> 1.4</a></li><li><a data-event="lineHeight" data-value="1.5"><i class="fa fa-check icon-ok"></i> 1.5</a></li><li><a data-event="lineHeight" data-value="1.6"><i class="fa fa-check icon-ok"></i> 1.6</a></li><li><a data-event="lineHeight" data-value="1.8"><i class="fa fa-check icon-ok"></i> 1.8</a></li><li><a data-event="lineHeight" data-value="2.0"><i class="fa fa-check icon-ok"></i> 2.0</a></li><li><a data-event="lineHeight" data-value="3.0"><i class="fa fa-check icon-ok"></i> 3.0</a></li></ul>'},"help":function(a){return'<button type="button" class="btn btn-default btn-sm btn-small" title="'+a.options.help+'" data-shortcut="Ctrl+/" data-mac-shortcut="\u2318+/" data-event="showHelpDialog" tabindex="-1"><i class="fa fa-question icon-question"></i></button>'},"fullscreen":function(a){return'<button type="button" class="btn btn-default btn-sm btn-small" title="'+a.options.fullscreen+'" data-event="fullscreen" tabindex="-1"><i class="fa fa-arrows-alt icon-fullscreen"></i></button>'},"codeview":function(a){return'<button type="button" class="btn btn-default btn-sm btn-small" title="'+a.options.codeview+'" data-event="codeview" tabindex="-1"><i class="fa fa-code icon-code"></i></button>'},"undo":function(a){return'<button type="button" class="btn btn-default btn-sm btn-small" title="'+a.history.undo+'" data-event="undo" tabindex="-1"><i class="fa fa-undo icon-undo"></i></button>'},"redo":function(a){return'<button type="button" class="btn btn-default btn-sm btn-small" title="'+a.history.redo+'" data-event="redo" tabindex="-1"><i class="fa fa-repeat icon-repeat"></i></button>'}},d=function(a){return'<div class="note-popover"><div class="note-link-popover popover bottom in" style="display: none;"><div class="arrow"></div><div class="popover-content note-link-content"><a href="http://www.google.com" target="_blank">www.google.com</a> <div class="note-insert btn-group"><button type="button" class="btn btn-default btn-sm btn-small" title="'+a.link.edit+'" data-event="showLinkDialog" tabindex="-1"><i class="fa fa-edit icon-edit"></i></button><button type="button" class="btn btn-default btn-sm btn-small" title="'+a.link.unlink+'" data-event="unlink" tabindex="-1"><i class="fa fa-unlink icon-unlink"></i></button></div></div></div><div class="note-image-popover popover bottom in" style="display: none;"><div class="arrow"></div><div class="popover-content note-image-content"><div class="btn-group"><button type="button" class="btn btn-default btn-sm btn-small" title="'+a.image.resizeFull+'" data-event="resize" data-value="1" tabindex="-1"><span class="note-fontsize-10">100%</span> </button><button type="button" class="btn btn-default btn-sm btn-small" title="'+a.image.resizeHalf+'" data-event="resize" data-value="0.5" tabindex="-1"><span class="note-fontsize-10">50%</span> </button><button type="button" class="btn btn-default btn-sm btn-small" title="'+a.image.resizeQuarter+'" data-event="resize" data-value="0.25" tabindex="-1"><span class="note-fontsize-10">25%</span> </button></div><div class="btn-group"><button type="button" class="btn btn-default btn-sm btn-small" title="'+a.image.floatLeft+'" data-event="floatMe" data-value="left" tabindex="-1"><i class="fa fa-align-left icon-align-left"></i></button><button type="button" class="btn btn-default btn-sm btn-small" title="'+a.image.floatRight+'" data-event="floatMe" data-value="right" tabindex="-1"><i class="fa fa-align-right icon-align-right"></i></button><button type="button" class="btn btn-default btn-sm btn-small" title="'+a.image.floatNone+'" data-event="floatMe" data-value="none" tabindex="-1"><i class="fa fa-align-justify icon-align-justify"></i></button></div><div class="btn-group"><button type="button" class="btn btn-default btn-sm btn-small" title="'+a.image.remove+'" data-event="removeMedia" data-value="none" tabindex="-1"><i class="fa fa-trash-o icon-trash"></i></button></div></div></div></div>'};var e=function(){return'<div class="note-handle"><div class="note-control-selection"><div class="note-control-selection-bg"></div><div class="note-control-holder note-control-nw"></div><div class="note-control-holder note-control-ne"></div><div class="note-control-holder note-control-sw"></div><div class="note-control-sizing note-control-se"></div><div class="note-control-selection-info"></div></div></div>'},i=function(a){return'<table class="note-shortcut"><thead><tr><th></th><th>'+a.shortcut.textFormatting+"</th></tr></thead><tbody><tr><td>\u2318 + B</td><td>"+a.font.bold+"</td></tr><tr><td>\u2318 + I</td><td>"+a.font.italic+"</td></tr><tr><td>\u2318 + U</td><td>"+a.font.underline+"</td></tr><tr><td>\u2318 + \u21e7 + S</td><td>"+a.font.strike+"</td></tr><tr><td>\u2318 + \\</td><td>"+a.font.clear+"</td></tr></tr></tbody></table>"},j=function(a){return'<table class="note-shortcut"><thead><tr><th></th><th>'+a.shortcut.action+"</th></tr></thead><tbody><tr><td>\u2318 + Z</td><td>"+a.history.undo+"</td></tr><tr><td>\u2318 + \u21e7 + Z</td><td>"+a.history.redo+"</td></tr><tr><td>\u2318 + ]</td><td>"+a.paragraph.indent+"</td></tr><tr><td>\u2318 + [</td><td>"+a.paragraph.outdent+"</td></tr><tr><td>\u2318 + K</td><td>"+a.link.insert+"</td></tr><tr><td>\u2318 + ENTER</td><td>"+a.hr.insert+"</td></tr></tbody></table>"},k=function(a,b){var c='<table class="note-shortcut"><thead><tr><th></th><th>'+a.shortcut.extraKeys+"</th></tr></thead><tbody>";for(var d in b.extraKeys)b.extraKeys.hasOwnProperty(d)&&(c+="<tr><td>"+d+"</td><td>"+b.extraKeys[d]+"</td></tr>");return c+="</tbody></table>"},l=function(a){return'<table class="note-shortcut"><thead><tr><th></th><th>'+a.shortcut.paragraphFormatting+"</th></tr></thead><tbody><tr><td>\u2318 + \u21e7 + L</td><td>"+a.paragraph.left+"</td></tr><tr><td>\u2318 + \u21e7 + E</td><td>"+a.paragraph.center+"</td></tr><tr><td>\u2318 + \u21e7 + R</td><td>"+a.paragraph.right+"</td></tr><tr><td>\u2318 + \u21e7 + J</td><td>"+a.paragraph.justify+"</td></tr><tr><td>\u2318 + \u21e7 + NUM7</td><td>"+a.lists.ordered+"</td></tr><tr><td>\u2318 + \u21e7 + NUM8</td><td>"+a.lists.unordered+"</td></tr></tbody></table>"},m=function(a){return'<table class="note-shortcut"><thead><tr><th></th><th>'+a.shortcut.documentStyle+"</th></tr></thead><tbody><tr><td>\u2318 + NUM0</td><td>"+a.style.normal+"</td></tr><tr><td>\u2318 + NUM1</td><td>"+a.style.h1+"</td></tr><tr><td>\u2318 + NUM2</td><td>"+a.style.h2+"</td></tr><tr><td>\u2318 + NUM3</td><td>"+a.style.h3+"</td></tr><tr><td>\u2318 + NUM4</td><td>"+a.style.h4+"</td></tr><tr><td>\u2318 + NUM5</td><td>"+a.style.h5+"</td></tr><tr><td>\u2318 + NUM6</td><td>"+a.style.h6+"</td></tr></tbody></table>"},n=function(a,b){var c='<table class="note-shortcut-layout"><tbody><tr><td>'+j(a,b)+"</td><td>"+i(a,b)+"</td></tr><tr><td>"+m(a,b)+"</td><td>"+l(a,b)+"</td></tr>";return b.extraKeys&&(c+='<tr><td colspan="2">'+k(a,b)+"</td></tr>"),c+="</tbody</table>"},o=function(a){return a.replace(/\u2318/g,"Ctrl").replace(/\u21e7/g,"Shift")};g=function(a,b){var d=function(){return'<div class="note-image-dialog modal" aria-hidden="false"><div class="modal-dialog"><div class="modal-content"><div class="modal-header"><button type="button" class="close" aria-hidden="true" tabindex="-1">×</button><h4>'+a.image.insert+'</h4></div><div class="modal-body"><div class="row-fluid"><h5>'+a.image.selectFromFiles+'</h5><input class="note-image-input" type="file" name="files" accept="image/*" /><h5>'+a.image.url+'</h5><input class="note-image-url form-control span12" type="text" /></div></div><div class="modal-footer"><button href="#" class="btn btn-primary note-image-btn disabled" disabled="disabled">'+a.image.insert+"</button></div></div></div></div>"},e=function(){return'<div class="note-link-dialog modal" aria-hidden="false"><div class="modal-dialog"><div class="modal-content"><div class="modal-header"><button type="button" class="close" aria-hidden="true" tabindex="-1">×</button><h4>'+a.link.insert+'</h4></div><div class="modal-body"><div class="row-fluid"><div class="form-group"><label>'+a.link.textToDisplay+'</label><input class="note-link-text form-control span12" disabled type="text" /></div><div class="form-group"><label>'+a.link.url+'</label><input class="note-link-url form-control span12" type="text" /></div>'+(b.disableLinkTarget?"":'<div class="checkbox"><label><input type="checkbox" checked> '+a.link.openInNewWindow+"</label></div>")+'</div></div><div class="modal-footer"><button href="#" class="btn btn-primary note-link-btn disabled" disabled="disabled">'+a.link.insert+"</button></div></div></div></div>"},f=function(){return'<div class="note-video-dialog modal" aria-hidden="false"><div class="modal-dialog"><div class="modal-content"><div class="modal-header"><button type="button" class="close" aria-hidden="true" tabindex="-1">×</button><h4>'+a.video.insert+'</h4></div><div class="modal-body"><div class="row-fluid"><div class="form-group"><label>'+a.video.url+'</label> <small class="text-muted">'+a.video.providers+'</small><input class="note-video-url form-control span12" type="text" /></div></div></div><div class="modal-footer"><button href="#" class="btn btn-primary note-video-btn disabled" disabled="disabled">'+a.video.insert+"</button></div></div></div></div>"},g=function(){return'<div class="note-help-dialog modal" aria-hidden="false"><div class="modal-dialog"><div class="modal-content"><div class="modal-body"><a class="modal-close pull-right" aria-hidden="true" tabindex="-1">'+a.shortcut.close+'</a><div class="title">'+a.shortcut.shortcuts+"</div>"+(c.bMac?n(a,b):o(n(a,b)))+'<p class="text-center"><a href="//hackerwins.github.io/summernote/" target="_blank">Summernote 0.5.1</a> \xb7 <a href="//github.com/HackerWins/summernote" target="_blank">Project</a> \xb7 <a href="//github.com/HackerWins/summernote/issues" target="_blank">Issues</a></p></div></div></div></div>'};return'<div class="note-dialog">'+d()+e()+f()+g()+"</div>"},h=function(){return'<div class="note-resizebar"><div class="note-icon-bar"></div><div class="note-icon-bar"></div><div class="note-icon-bar"></div></div>'};var p=function(b,d){b.find("button").each(function(b,d){var e=a(d),f=e.attr(c.bMac?"data-mac-shortcut":"data-shortcut");f&&e.attr("title",function(a,b){return b+" ("+f+")"})}).tooltip({"container":"body","trigger":"hover","placement":d||"top"}).on("click",function(){a(this).tooltip("hide")})},q=[["#000000","#424242","#636363","#9C9C94","#CEC6CE","#EFEFEF","#F7F7F7","#FFFFFF"],["#FF0000","#FF9C00","#FFFF00","#00FF00","#00FFFF","#0000FF","#9C00FF","#FF00FF"],["#F7C6CE","#FFE7CE","#FFEFC6","#D6EFD6","#CEDEE7","#CEE7F7","#D6D6E7","#E7D6DE"],["#E79C9C","#FFC69C","#FFE79C","#B5D6A5","#A5C6CE","#9CC6EF","#B5A5D6","#D6A5BD"],["#E76363","#F7AD6B","#FFD663","#94BD7B","#73A5AD","#6BADDE","#8C7BC6","#C67BA5"],["#CE0000","#E79439","#EFC631","#6BA54A","#4A7B8C","#3984C6","#634AA5","#A54A7B"],["#9C0000","#B56308","#BD9400","#397B21","#104A5A","#085294","#311873","#731842"],["#630000","#7B3900","#846300","#295218","#083139","#003163","#21104A","#4A1031"]],r=function(b){b.find(".note-color-palette").each(function(){for(var b=a(this),c=b.attr("data-target-event"),d=[],e=0,f=q.length;f>e;e++){for(var g=q[e],h=[],i=0,j=g.length;j>i;i++){var k=g[i];h.push(['<button type="button" class="note-color-btn" style="background-color:',k,';" data-event="',c,'" data-value="',k,'" title="',k,'" data-toggle="button" tabindex="-1"></button>'].join(""))}d.push("<div>"+h.join("")+"</div>")}b.html(d.join(""))})};this.createLayout=function(c,i){var j=c.next();if(!j||!j.hasClass("note-editor")){var k=a('<div class="note-editor"></div>');i.width&&k.width(i.width),i.height>0&&a('<div class="note-statusbar">'+h()+"</div>").prependTo(k);var l=!c.is(":disabled"),m=a('<div class="note-editable" contentEditable="'+l+'"></div>').prependTo(k);i.height&&m.height(i.height),i.direction&&m.attr("dir",i.direction),m.html(f.html(c)||f.emptyPara),a('<textarea class="note-codable"></textarea>').prependTo(k);for(var n=a.summernote.lang[i.lang],o="",q=0,s=i.toolbar.length;s>q;q++){var t=i.toolbar[q];o+='<div class="note-'+t[0]+' btn-group">';for(var u=0,v=t[1].length;v>u;u++)o+=b[t[1][u]](n);o+="</div>"}o='<div class="note-toolbar btn-toolbar">'+o+"</div>";var w=a(o).prependTo(k);r(w),p(w,"bottom");var x=a(d(n)).prependTo(k);p(x),a(e()).prependTo(k);var y=a(g(n,i)).prependTo(k);y.find("button.close, a.modal-close").click(function(){a(this).closest(".modal").modal("hide")}),a('<div class="note-dropzone"><div class="note-dropzone-message"></div></div>').prependTo(k),k.insertAfter(c),c.hide()}},this.layoutInfoFromHolder=function(a){var b=a.next();if(b.hasClass("note-editor")){var c=f.buildLayoutInfo(b);for(var d in c)c.hasOwnProperty(d)&&(c[d]=c[d].call());return c
|
|
}},this.removeLayout=function(a){var b=this.layoutInfoFromHolder(a);b&&(a.html(b.editable.html()),b.editor.remove(),a.show())}};a.summernote=a.summernote||{},a.extend(a.summernote,g);var u=new t,v=new s;a.fn.extend({"summernote":function(b){if(b=a.extend({},a.summernote.options,b),this.each(function(c,d){var e=a(d);u.createLayout(e,b);var g=u.layoutInfoFromHolder(e);v.attach(g,b),f.isTextarea(e[0])&&e.closest("form").submit(function(){e.html(e.code())})}),this.first()&&b.focus){var c=u.layoutInfoFromHolder(this.first());c.editable.focus()}return this.length>0&&b.oninit&&b.oninit(),this},"code":function(b){if(void 0===b){var d=this.first();if(0===d.length)return;var e=u.layoutInfoFromHolder(d);if(e&&e.editable){var f=e.editor.hasClass("codeview");return f&&c.bCodeMirror&&e.codable.data("cmEditor").save(),f?e.codable.val():e.editable.html()}return d.html()}return this.each(function(c,d){var e=u.layoutInfoFromHolder(a(d));e&&e.editable&&e.editable.html(b)}),this},"destroy":function(){return this.each(function(b,c){var d=a(c),e=u.layoutInfoFromHolder(d);e&&e.editable&&(v.dettach(e),u.removeLayout(d))}),this}})}),function(b){function c(){return"Markdown.mk_block( "+uneval(this.toString())+", "+uneval(this.trailing)+", "+uneval(this.lineNumber)+" )"}function d(){var a=require("util");return"Markdown.mk_block( "+a.inspect(this.toString())+", "+a.inspect(this.trailing)+", "+a.inspect(this.lineNumber)+" )"}function e(a){for(var b=0,c=-1;-1!==(c=a.indexOf("\n",c+1));)b++;return b}function f(a,b){function c(a){this.len_after=a,this.name="close_"+b}var d=a+"_state",e="strong"==a?"em_state":"strong_state";return function(f){if(this[d][0]==b)return this[d].shift(),[f.length,new c(f.length-b.length)];var g=this[e].slice(),h=this[d].slice();this[d].unshift(b);{var i=this.processInline(f.substr(b.length)),j=i[i.length-1];this[d].shift()}if(j instanceof c){i.pop();var k=f.length-j.len_after;return[k,[a].concat(i)]}return this[e]=g,this[d]=h,[b.length,b]}}function g(a){for(var b=a.split(""),c=[""],d=!1;b.length;){var e=b.shift();switch(e){case" ":d?c[c.length-1]+=e:c.push("");break;case"'":case'"':d=!d;break;case"\\":e=b.shift();default:c[c.length-1]+=e}}return c}function h(a){return q(a)&&a.length>1&&"object"==typeof a[1]&&!q(a[1])?a[1]:void 0}function i(a){return a.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function j(a){if("string"==typeof a)return i(a);var b=a.shift(),c={},d=[];for(!a.length||"object"!=typeof a[0]||a[0]instanceof Array||(c=a.shift());a.length;)d.push(arguments.callee(a.shift()));var e="";for(var f in c)e+=" "+f+'="'+i(c[f])+'"';return"img"==b||"br"==b||"hr"==b?"<"+b+e+"/>":"<"+b+e+">"+d.join("")+"</"+b+">"}function k(a,b,c){var d;c=c||{};var e=a.slice(0);"function"==typeof c.preprocessTreeNode&&(e=c.preprocessTreeNode(e,b));var f=h(e);if(f){e[1]={};for(d in f)e[1][d]=f[d];f=e[1]}if("string"==typeof e)return e;switch(e[0]){case"header":e[0]="h"+e[1].level,delete e[1].level;break;case"bulletlist":e[0]="ul";break;case"numberlist":e[0]="ol";break;case"listitem":e[0]="li";break;case"para":e[0]="p";break;case"markdown":e[0]="html",f&&delete f.references;break;case"code_block":e[0]="pre",d=f?2:1;var g=["code"];g.push.apply(g,e.splice(d)),e[d]=g;break;case"inlinecode":e[0]="code";break;case"img":e[1].src=e[1].href,delete e[1].href;break;case"linebreak":e[0]="br";break;case"link":e[0]="a";break;case"link_ref":e[0]="a";var i=b[f.ref];if(!i)return f.original;delete f.ref,f.href=i.href,i.title&&(f.title=i.title),delete f.original;break;case"img_ref":e[0]="img";var i=b[f.ref];if(!i)return f.original;delete f.ref,f.src=i.href,i.title&&(f.title=i.title),delete f.original}if(d=1,f){for(var j in e[1])d=2;1===d&&e.splice(d,1)}for(;d<e.length;++d)e[d]=arguments.callee(e[d],b,c);return e}function l(a){for(var b=h(a)?2:1;b<a.length;)"string"==typeof a[b]?b+1<a.length&&"string"==typeof a[b+1]?a[b]+=a.splice(b+1,1)[0]:++b:(arguments.callee(a[b]),++b)}var m=b.Markdown=function r(a){switch(typeof a){case"undefined":this.dialect=r.dialects.Gruber;break;case"object":this.dialect=a;break;default:if(!(a in r.dialects))throw new Error("Unknown Markdown dialect '"+String(a)+"'");this.dialect=r.dialects[a]}this.em_state=[],this.strong_state=[],this.debug_indent=""};b.parse=function(a,b){var c=new m(b);return c.toTree(a)},b.toHTML=function(a,c,d){var e=b.toHTMLTree(a,c,d);return b.renderJsonML(e)},b.toHTMLTree=function(a,b,c){"string"==typeof a&&(a=this.parse(a,b));var d=h(a),e={};d&&d.references&&(e=d.references);var f=k(a,e,c);return l(f),f};var n=m.mk_block=function(a,b,e){1==arguments.length&&(b="\n\n");var f=new String(a);return f.trailing=b,f.inspect=d,f.toSource=c,void 0!=e&&(f.lineNumber=e),f};m.prototype.split_blocks=function(a){var b,c=/([\s\S]+?)($|\n(?:\s*\n|$)+)/g,d=[],f=1;for(null!=(b=/^(\s*\n)/.exec(a))&&(f+=e(b[0]),c.lastIndex=b[0].length);null!==(b=c.exec(a));)d.push(n(b[1],b[2],f)),f+=e(b[0]);return d},m.prototype.processBlock=function(a,b){var c=this.dialect.block,d=c.__order__;if("__call__"in c)return c.__call__.call(this,a,b);for(var e=0;e<d.length;e++){var f=c[d[e]].call(this,a,b);if(f)return(!q(f)||f.length>0&&!q(f[0]))&&this.debug(d[e],"didn't return a proper array"),f}return[]},m.prototype.processInline=function(a){return this.dialect.inline.__call__.call(this,String(a))},m.prototype.toTree=function(a,b){var c=a instanceof Array?a:this.split_blocks(a),d=this.tree;try{for(this.tree=b||this.tree||["markdown"];c.length;){var e=this.processBlock(c.shift(),c);e.length&&this.tree.push.apply(this.tree,e)}return this.tree}finally{b&&(this.tree=d)}},m.prototype.debug=function(){var a=Array.prototype.slice.call(arguments);a.unshift(this.debug_indent),"undefined"!=typeof print&&print.apply(print,a),"undefined"!=typeof console&&"undefined"!=typeof console.log&&console.log.apply(null,a)},m.prototype.loop_re_over_block=function(a,b,c){for(var d,e=b.valueOf();e.length&&null!=(d=a.exec(e));)e=e.substr(d[0].length),c.call(this,d);return e},m.dialects={},m.dialects.Gruber={"block":{"atxHeader":function(a,b){var c=a.match(/^(#{1,6})\s*(.*?)\s*#*\s*(?:\n|$)/);if(!c)return void 0;var d=["header",{"level":c[1].length}];return Array.prototype.push.apply(d,this.processInline(c[2])),c[0].length<a.length&&b.unshift(n(a.substr(c[0].length),a.trailing,a.lineNumber+2)),[d]},"setextHeader":function(a,b){var c=a.match(/^(.*)\n([-=])\2\2+(?:\n|$)/);if(!c)return void 0;var d="="===c[2]?1:2,e=["header",{"level":d},c[1]];return c[0].length<a.length&&b.unshift(n(a.substr(c[0].length),a.trailing,a.lineNumber+2)),[e]},"code":function(a,b){var c=[],d=/^(?: {0,3}\t| {4})(.*)\n?/;if(!a.match(d))return void 0;a:for(;;){var e=this.loop_re_over_block(d,a.valueOf(),function(a){c.push(a[1])});if(e.length){b.unshift(n(e,a.trailing));break a}if(!b.length)break a;if(!b[0].match(d))break a;c.push(a.trailing.replace(/[^\n]/g,"").substring(2)),a=b.shift()}return[["code_block",c.join("\n")]]},"horizRule":function(a,b){var c=a.match(/^(?:([\s\S]*?)\n)?[ \t]*([-_*])(?:[ \t]*\2){2,}[ \t]*(?:\n([\s\S]*))?$/);if(!c)return void 0;var d=[["hr"]];return c[1]&&d.unshift.apply(d,this.processBlock(c[1],[])),c[3]&&b.unshift(n(c[3])),d},"lists":function(){function a(a){return new RegExp("(?:^("+i+"{0,"+a+"} {0,3})("+f+")\\s+)|(^"+i+"{0,"+(a-1)+"}[ ]{0,4})")}function b(a){return a.replace(/ {0,3}\t/g," ")}function c(a,b,c,d){if(b)return void a.push(["para"].concat(c));var e=a[a.length-1]instanceof Array&&"para"==a[a.length-1][0]?a[a.length-1]:a;d&&a.length>1&&c.unshift(d);for(var f=0;f<c.length;f++){var g=c[f],h="string"==typeof g;h&&e.length>1&&"string"==typeof e[e.length-1]?e[e.length-1]+=g:e.push(g)}}function d(a,b){for(var c=new RegExp("^("+i+"{"+a+"}.*?\\n?)*$"),d=new RegExp("^"+i+"{"+a+"}","gm"),e=[];b.length>0;){if(c.exec(b[0])){var f=b.shift(),g=f.replace(d,"");e.push(n(g,f.trailing,f.lineNumber))}break}return e}function e(a,b,c){var d=a.list,e=d[d.length-1];if(!(e[1]instanceof Array&&"para"==e[1][0]))if(b+1==c.length)e.push(["para"].concat(e.splice(1)));else{var f=e.pop();e.push(["para"].concat(e.splice(1)),f)}}var f="[*+-]|\\d+\\.",g=/[*+-]/,h=new RegExp("^( {0,3})("+f+")[ ]+"),i="(?: {0,3}\\t| {4})";return function(f,i){function j(a){var b=g.exec(a[2])?["bulletlist"]:["numberlist"];return n.push({"list":b,"indent":a[1]}),b}var k=f.match(h);if(!k)return void 0;for(var l,m,n=[],p=j(k),q=!1,r=[n[0].list];;){for(var s=f.split(/(?=\n)/),t="",u=0;u<s.length;u++){var v="",w=s[u].replace(/^\n/,function(a){return v=a,""}),x=a(n.length);if(k=w.match(x),void 0!==k[1]){t.length&&(c(l,q,this.processInline(t),v),q=!1,t=""),k[1]=b(k[1]);var y=Math.floor(k[1].length/4)+1;if(y>n.length)p=j(k),l.push(p),l=p[1]=["listitem"];else{var z=!1;for(m=0;m<n.length;m++)if(n[m].indent==k[1]){p=n[m].list,n.splice(m+1),z=!0;break}z||(y++,y<=n.length?(n.splice(y),p=n[y-1].list):(p=j(k),l.push(p))),l=["listitem"],p.push(l)}v=""}w.length>k[0].length&&(t+=v+w.substr(k[0].length))}t.length&&(c(l,q,this.processInline(t),v),q=!1,t="");var A=d(n.length,i);A.length>0&&(o(n,e,this),l.push.apply(l,this.toTree(A,[])));var B=i[0]&&i[0].valueOf()||"";if(!B.match(h)&&!B.match(/^ /))break;f=i.shift();var C=this.dialect.block.horizRule(f,i);if(C){r.push.apply(r,C);break}o(n,e,this),q=!0}return r}}(),"blockquote":function(a,b){if(!a.match(/^>/m))return void 0;var c=[];if(">"!=a[0]){for(var d=a.split(/\n/),e=[];d.length&&">"!=d[0][0];)e.push(d.shift());a=d.join("\n"),c.push.apply(c,this.processBlock(e.join("\n"),[]))}for(;b.length&&">"==b[0][0];){var f=b.shift();a=new String(a+a.trailing+f),a.trailing=f.trailing}{var g=a.replace(/^> ?/gm,"");this.tree}return c.push(this.toTree(g,["blockquote"])),c},"referenceDefn":function(a,b){var c=/^\s*\[(.*?)\]:\s*(\S+)(?:\s+(?:(['"])(.*?)\3|\((.*?)\)))?\n?/;if(!a.match(c))return void 0;h(this.tree)||this.tree.splice(1,0,{});var d=h(this.tree);void 0===d.references&&(d.references={});var e=this.loop_re_over_block(c,a,function(a){a[2]&&"<"==a[2][0]&&">"==a[2][a[2].length-1]&&(a[2]=a[2].substring(1,a[2].length-1));var b=d.references[a[1].toLowerCase()]={"href":a[2]};void 0!==a[4]?b.title=a[4]:void 0!==a[5]&&(b.title=a[5])});return e.length&&b.unshift(n(e,a.trailing)),[]},"para":function(a){return[["para"].concat(this.processInline(a))]}}},m.dialects.Gruber.inline={"__oneElement__":function(a,b,c){var d,e;b=b||this.dialect.inline.__patterns__;var f=new RegExp("([\\s\\S]*?)("+(b.source||b)+")");if(d=f.exec(a),!d)return[a.length,a];if(d[1])return[d[1].length,d[1]];var e;return d[2]in this.dialect.inline&&(e=this.dialect.inline[d[2]].call(this,a.substr(d.index),d,c||[])),e=e||[d[2].length,d[2]]},"__call__":function(a,b){function c(a){"string"==typeof a&&"string"==typeof e[e.length-1]?e[e.length-1]+=a:e.push(a)}for(var d,e=[];a.length>0;)d=this.dialect.inline.__oneElement__.call(this,a,b,e),a=a.substr(d.shift()),o(d,c);return e},"]":function(){},"}":function(){},"\\":function(a){return a.match(/^\\[\\`\*_{}\[\]()#\+.!\-]/)?[2,a[1]]:[1,"\\"]},"![":function(a){var b=a.match(/^!\[(.*?)\][ \t]*\([ \t]*(\S*)(?:[ \t]+(["'])(.*?)\3)?[ \t]*\)/);if(b){b[2]&&"<"==b[2][0]&&">"==b[2][b[2].length-1]&&(b[2]=b[2].substring(1,b[2].length-1)),b[2]=this.dialect.inline.__call__.call(this,b[2],/\\/)[0];var c={"alt":b[1],"href":b[2]||""};return void 0!==b[4]&&(c.title=b[4]),[b[0].length,["img",c]]}return b=a.match(/^!\[(.*?)\][ \t]*\[(.*?)\]/),b?[b[0].length,["img_ref",{"alt":b[1],"ref":b[2].toLowerCase(),"original":b[0]}]]:[2,"!["]},"[":function s(a){var b=String(a),c=m.DialectHelpers.inline_until_char.call(this,a.substr(1),"]");if(!c)return[1,"["];var s,d,e=1+c[0],f=c[1];a=a.substr(e);var g=a.match(/^\s*\([ \t]*(\S+)(?:[ \t]+(["'])(.*?)\2)?[ \t]*\)/);if(g){var h=g[1];if(e+=g[0].length,h&&"<"==h[0]&&">"==h[h.length-1]&&(h=h.substring(1,h.length-1)),!g[3])for(var i=1,j=0;j<h.length;j++)switch(h[j]){case"(":i++;break;case")":0==--i&&(e-=h.length-j,h=h.substring(0,j))}return h=this.dialect.inline.__call__.call(this,h,/\\/)[0],d={"href":h||""},void 0!==g[3]&&(d.title=g[3]),s=["link",d].concat(f),[e,s]}return g=a.match(/^\s*\[(.*?)\]/),g?(e+=g[0].length,d={"ref":(g[1]||String(f)).toLowerCase(),"original":b.substr(0,e)},s=["link_ref",d].concat(f),[e,s]):1==f.length&&"string"==typeof f[0]?(d={"ref":f[0].toLowerCase(),"original":b.substr(0,e)},s=["link_ref",d,f[0]],[e,s]):[1,"["]},"<":function(a){var b;return null!=(b=a.match(/^<(?:((https?|ftp|mailto):[^>]+)|(.*?@.*?\.[a-zA-Z]+))>/))?b[3]?[b[0].length,["link",{"href":"mailto:"+b[3]},b[3]]]:"mailto"==b[2]?[b[0].length,["link",{"href":b[1]},b[1].substr("mailto:".length)]]:[b[0].length,["link",{"href":b[1]},b[1]]]:[1,"<"]},"`":function(a){var b=a.match(/(`+)(([\s\S]*?)\1)/);return b&&b[2]?[b[1].length+b[2].length,["inlinecode",b[3]]]:[1,"`"]}," \n":function(){return[3,["linebreak"]]}},m.dialects.Gruber.inline["**"]=f("strong","**"),m.dialects.Gruber.inline.__=f("strong","__"),m.dialects.Gruber.inline["*"]=f("em","*"),m.dialects.Gruber.inline._=f("em","_"),m.buildBlockOrder=function(a){var b=[];for(var c in a)"__order__"!=c&&"__call__"!=c&&b.push(c);a.__order__=b},m.buildInlinePatterns=function(a){var b=[];for(var c in a)if(!c.match(/^__.*__$/)){var d=c.replace(/([\\.*+?|()\[\]{}])/g,"\\$1").replace(/\n/,"\\n");b.push(1==c.length?d:"(?:"+d+")")}b=b.join("|"),a.__patterns__=b;var e=a.__call__;a.__call__=function(a,c){return void 0!=c?e.call(this,a,c):e.call(this,a,b)}},m.DialectHelpers={},m.DialectHelpers.inline_until_char=function(a,b){for(var c=0,d=[];;){if(a[c]==b)return c++,[c,d];if(c>=a.length)return null;var e=this.dialect.inline.__oneElement__.call(this,a.substr(c));c+=e[0],d.push.apply(d,e.slice(1))}},m.subclassDialect=function(a){function b(){}function c(){}return b.prototype=a.block,c.prototype=a.inline,{"block":new b,"inline":new c}},m.buildBlockOrder(m.dialects.Gruber.block),m.buildInlinePatterns(m.dialects.Gruber.inline),m.dialects.Maruku=m.subclassDialect(m.dialects.Gruber),m.dialects.Maruku.processMetaHash=function(a){for(var b=g(a),c={},d=0;d<b.length;++d)if(/^#/.test(b[d]))c.id=b[d].substring(1);else if(/^\./.test(b[d]))c["class"]=c["class"]?c["class"]+b[d].replace(/./," "):b[d].substring(1);else if(/\=/.test(b[d])){var e=b[d].split(/\=/);c[e[0]]=e[1]}return c},m.dialects.Maruku.block.document_meta=function(a){if(a.lineNumber>1)return void 0;if(!a.match(/^(?:\w+:.*\n)*\w+:.*$/))return void 0;h(this.tree)||this.tree.splice(1,0,{});var b=a.split(/\n/);for(p in b){var c=b[p].match(/(\w+):\s*(.*)$/),d=c[1].toLowerCase(),e=c[2];this.tree[1][d]=e}return[]},m.dialects.Maruku.block.block_meta=function(b){var c=b.match(/(^|\n) {0,3}\{:\s*((?:\\\}|[^\}])*)\s*\}$/);if(!c)return void 0;var d,e=this.dialect.processMetaHash(c[2]);if(""===c[1]){var f=this.tree[this.tree.length-1];if(d=h(f),"string"==typeof f)return void 0;d||(d={},f.splice(1,0,d));for(a in e)d[a]=e[a];return[]}var g=b.replace(/\n.*$/,""),i=this.processBlock(g,[]);d=h(i[0]),d||(d={},i[0].splice(1,0,d));for(a in e)d[a]=e[a];return i},m.dialects.Maruku.block.definition_list=function(a,b){var c,d=/^((?:[^\s:].*\n)+):\s+([\s\S]+)$/,e=["dl"];if(!(h=a.match(d)))return void 0;for(var f=[a];b.length&&d.exec(b[0]);)f.push(b.shift());for(var g=0;g<f.length;++g){var h=f[g].match(d),i=h[1].replace(/\n$/,"").split(/\n/),j=h[2].split(/\n:\s+/);for(c=0;c<i.length;++c)e.push(["dt",i[c]]);for(c=0;c<j.length;++c)e.push(["dd"].concat(this.processInline(j[c].replace(/(\n)\s+/,"$1"))))}return[e]},m.dialects.Maruku.inline["{:"]=function(a,b,c){if(!c.length)return[2,"{:"];var d=c[c.length-1];if("string"==typeof d)return[2,"{:"];var e=a.match(/^\{:\s*((?:\\\}|[^\}])*)\s*\}/);if(!e)return[2,"{:"];var f=this.dialect.processMetaHash(e[1]),g=h(d);g||(g={},d.splice(1,0,g));for(var i in f)g[i]=f[i];return[e[0].length,""]},m.buildBlockOrder(m.dialects.Maruku.block),m.buildInlinePatterns(m.dialects.Maruku.inline);var o,q=Array.isArray||function(a){return"[object Array]"==Object.prototype.toString.call(a)};o=Array.prototype.forEach?function(a,b,c){return a.forEach(b,c)}:function(a,b,c){for(var d=0;d<a.length;d++)b.call(c||a,a[d],d,a)},b.renderJsonML=function(a,b){b=b||{},b.root=b.root||!1;var c=[];if(b.root)c.push(j(a));else for(a.shift(),!a.length||"object"!=typeof a[0]||a[0]instanceof Array||a.shift();a.length;)c.push(j(a.shift()));return c.join("\n\n")}}(function(){return"undefined"==typeof exports?(window.markdown={},window.markdown):exports}());var toMarkdown=function(a){function b(a,b){var c="void"===b.type?"<"+b.tag+"\\b([^>]*)\\/?>":"<"+b.tag+"\\b([^>]*)>([\\s\\S]*?)<\\/"+b.tag+">",d=new RegExp(c,"gi"),e="";return e="string"==typeof b.replacement?a.replace(d,b.replacement):a.replace(d,function(a,c,d,e){return b.replacement.call(this,a,c,d,e)})}function c(a){return new RegExp(a+"\\s*=\\s*[\"']?([^\"']*)[\"']?","i")}function d(a){return a=a.replace(/<(ul|ol)\b[^>]*>([\s\S]*?)<\/\1>/gi,function(a,b,c){var d=c.split("</li>");for(d.splice(d.length-1,1),h=0,i=d.length;i>h;h++)if(d[h]){var e="ol"===b?h+1+". ":"* ";d[h]=d[h].replace(/\s*<li[^>]*>([\s\S]*)/i,function(a,b){return b=b.replace(/^\s+/,""),b=b.replace(/\n\n/g,"\n\n "),b=b.replace(/\n([ ]*)+(\*|\d+\.) /g,"\n$1 $2 "),e+b})}return d.join("\n")}),"\n\n"+a.replace(/[ \t]+\n|\s+$/g,"")}function e(a){return a=a.replace(/<blockquote\b[^>]*>([\s\S]*?)<\/blockquote>/gi,function(a,b){return b=b.replace(/^\s+|\s+$/g,""),b=f(b),b=b.replace(/^/gm,"> "),b=b.replace(/^(>([ \t]{2,}>)+)/gm,"> >")})}function f(a){return a=a.replace(/^[\t\r\n]+|[\t\r\n]+$/g,""),a=a.replace(/\n\s+\n/g,"\n\n"),a=a.replace(/\n{3,}/g,"\n\n")}for(var g=[{"patterns":"p","replacement":function(a,b,c){return c?"\n\n"+c+"\n":""}},{"patterns":"br","type":"void","replacement":"\n"},{"patterns":"h([1-6])","replacement":function(a,b,c,d){for(var e="",f=0;b>f;f++)e+="#";return"\n\n"+e+" "+d+"\n"}},{"patterns":"hr","type":"void","replacement":"\n\n* * *\n"},{"patterns":"a","replacement":function(a,b,d){var e=b.match(c("href")),f=b.match(c("title"));return e?"["+d+"]("+e[1]+(f&&f[1]?' "'+f[1]+'"':"")+")":a}},{"patterns":["b","strong"],"replacement":function(a,b,c){return c?"**"+c+"**":""}},{"patterns":["i","em"],"replacement":function(a,b,c){return c?"_"+c+"_":""}},{"patterns":"code","replacement":function(a,b,c){return c?"`"+c+"`":""}},{"patterns":"img","type":"void","replacement":function(a,b){var d=b.match(c("src")),e=b.match(c("alt")),f=b.match(c("title"));return"!["+(e&&e[1]?e[1]:"")+"]("+d[1]+(f&&f[1]?' "'+f[1]+'"':"")+")"}}],h=0,i=g.length;i>h;h++)if("string"==typeof g[h].patterns)a=b(a,{"tag":g[h].patterns,"replacement":g[h].replacement,"type":g[h].type});else for(var j=0,k=g[h].patterns.length;k>j;j++)a=b(a,{"tag":g[h].patterns[j],"replacement":g[h].replacement,"type":g[h].type});a=a.replace(/<pre\b[^>]*>`([\s\S]*)`<\/pre>/gi,function(a,b){return b=b.replace(/^\t+/g," "),b=b.replace(/\n/g,"\n "),"\n\n "+b+"\n"}),a=a.replace(/^(\s{0,3}\d+)\. /g,"$1\\. ");for(var l=/<(ul|ol)\b[^>]*>(?:(?!<ul|<ol)[\s\S])*?<\/\1>/gi;a.match(l);)a=a.replace(l,function(a){return d(a)});for(var m=/<blockquote\b[^>]*>((?:(?!<blockquote)[\s\S])*?)<\/blockquote>/gi;a.match(m);)a=a.replace(m,function(a){return e(a)});return f(a)};"object"==typeof exports&&(exports.toMarkdown=toMarkdown),!function(a){"use strict";var b=function(b,c){this.$ns="bootstrap-markdown",this.$element=a(b),this.$editable={"el":null,"type":null,"attrKeys":[],"attrValues":[],"content":null},this.$options=a.extend(!0,{},a.fn.markdown.defaults,c),this.$oldContent=null,this.$isPreview=!1,this.$editor=null,this.$textarea=null,this.$handler=[],this.$callback=[],this.$nextTab=[],this.showEditor()};b.prototype={"constructor":b,"__alterButtons":function(b,c){var d=this.$handler,e="all"==b,f=this;a.each(d,function(a,d){var g=!0;g=e?!1:d.indexOf(b)<0,0==g&&c(f.$editor.find('button[data-handler="'+d+'"]'))})},"__buildButtons":function(b,c){var d,e=this.$ns,f=this.$handler,g=this.$callback;for(d=0;d<b.length;d++){var h,i=b[d];for(h=0;h<i.length;h++){var j,k=i[h].data,l=a("<div/>",{"class":"btn-group"});for(j=0;j<k.length;j++){var m=k[j],n="",o=e+"-"+m.name,p=m.icon instanceof Object?m.icon[this.$options.iconlibrary]:m.icon,q=m.btnText?m.btnText:"",r=m.btnClass?m.btnClass:"btn",s=m.tabIndex?m.tabIndex:"-1";1==m.toggle&&(n=' data-toggle="button"'),l.append('<button type="button" class="'+r+' btn-default btn-sm" title="'+m.title+'" tabindex="'+s+'" data-provider="'+e+'" data-handler="'+o+'"'+n+'><span class="'+p+'"></span> '+q+"</button>"),f.push(o),g.push(m.callback)}c.append(l)}}return c},"__setListener":function(){var b="undefined"!=typeof this.$textarea.attr("rows"),c=this.$textarea.val().split("\n").length>5?this.$textarea.val().split("\n").length:"5",d=b?this.$textarea.attr("rows"):c;this.$textarea.attr("rows",d),this.$textarea.css("resize","none"),this.$textarea.on("focus",a.proxy(this.focus,this)).on("keypress",a.proxy(this.keypress,this)).on("keyup",a.proxy(this.keyup,this)),this.eventSupported("keydown")&&this.$textarea.on("keydown",a.proxy(this.keydown,this)),this.$textarea.data("markdown",this)},"__handle":function(b){var c=a(b.currentTarget),d=this.$handler,e=this.$callback,f=c.attr("data-handler"),g=d.indexOf(f),h=e[g];a(b.currentTarget).focus(),h(this),f.indexOf("cmdSave")<0&&this.$textarea.focus(),b.preventDefault()},"showEditor":function(){var b,c=this,d=this.$ns,e=this.$element,f=(e.css("height"),e.css("width"),this.$editable),g=this.$handler,h=this.$callback,i=this.$options,j=a("<div/>",{"class":"md-editor","click":function(){c.focus()}});if(null==this.$editor){var k=a("<div/>",{"class":"md-header btn-toolbar"});if(i.buttons.length>0&&(k=this.__buildButtons(i.buttons,k)),i.additionalButtons.length>0&&(k=this.__buildButtons(i.additionalButtons,k)),j.append(k),e.is("textarea"))e.before(j),b=e,b.addClass("md-input"),j.append(b);else{var l="function"==typeof toMarkdown?toMarkdown(e.html()):e.html(),m=a.trim(l);b=a("<textarea/>",{"class":"md-input","val":m}),j.append(b),f.el=e,f.type=e.prop("tagName").toLowerCase(),f.content=e.html(),a(e[0].attributes).each(function(){f.attrKeys.push(this.nodeName),f.attrValues.push(this.nodeValue)}),e.replaceWith(j)}if(i.savable){var n=a("<div/>",{"class":"md-footer"}),o="cmdSave";g.push(o),h.push(i.onSave),n.append('<button class="btn btn-success" data-provider="'+d+'" data-handler="'+o+'"><i class="icon icon-white icon-ok"></i> Save</button>'),j.append(n)}a.each(["height","width"],function(a,b){"inherit"!=i[b]&&(jQuery.isNumeric(i[b])?j.css(b,i[b]+"px"):j.addClass(i[b]))}),this.$editor=j,this.$textarea=b,this.$editable=f,this.$oldContent=this.getContent(),this.__setListener(),this.$editor.attr("id",(new Date).getTime()),this.$editor.on("click",'[data-provider="bootstrap-markdown"]',a.proxy(this.__handle,this))}else this.$editor.show();return i.autofocus&&(this.$textarea.focus(),this.$editor.addClass("active")),i.onShow(this),this},"showPreview":function(){var b,c=this.$options,d=c.onPreview(this),e=this.$textarea,f=e.next(),g=a("<div/>",{"class":"md-preview","data-provider":"markdown-preview"});if(this.$isPreview=!0,this.disableButtons("all").enableButtons("cmdPreview"),"string"==typeof d)b=d;else{var h=e.val();b="object"==typeof markdown?markdown.toHTML(h):"function"==typeof marked?marked(h):h}return g.html(b),f&&"md-footer"==f.attr("class")?g.insertBefore(f):e.parent().append(g),e.hide(),g.data("markdown",this),this},"hidePreview":function(){this.$isPreview=!1;var a=this.$editor.find('div[data-provider="markdown-preview"]');return a.remove(),this.enableButtons("all"),this.$textarea.show(),this.__setListener(),this},"isDirty":function(){return this.$oldContent!=this.getContent()},"getContent":function(){return this.$textarea.val()},"setContent":function(a){return this.$textarea.val(a),this},"findSelection":function(a){var b,c=this.getContent();if(b=c.indexOf(a),b>=0&&a.length>0){var d,e=this.getSelection();return this.setSelection(b,b+a.length),d=this.getSelection(),this.setSelection(e.start,e.end),d}return null},"getSelection":function(){var a=this.$textarea[0];return("selectionStart"in a&&function(){var b=a.selectionEnd-a.selectionStart;return{"start":a.selectionStart,"end":a.selectionEnd,"length":b,"text":a.value.substr(a.selectionStart,b)}}||function(){return null})()},"setSelection":function(a,b){var c=this.$textarea[0];return("selectionStart"in c&&function(){c.selectionStart=a,c.selectionEnd=b}||function(){return null})()},"replaceSelection":function(a){var b=this.$textarea[0];return("selectionStart"in b&&function(){return b.value=b.value.substr(0,b.selectionStart)+a+b.value.substr(b.selectionEnd,b.value.length),b.selectionStart=b.value.length,this}||function(){return b.value+=a,jQuery(b)})()},"getNextTab":function(){if(0==this.$nextTab.length)return null;var a,b=this.$nextTab.shift();return"function"==typeof b?a=b():"object"==typeof b&&b.length>0&&(a=b),a},"setNextTab":function(a,b){if("string"==typeof a){var c=this;this.$nextTab.push(function(){return c.findSelection(a)})}else if("numeric"==typeof a&&"numeric"==typeof b){var d=this.getSelection();this.setSelection(a,b),this.$nextTab.push(this.getSelection()),this.setSelection(d.start,d.end)}},"enableButtons":function(a){var b=function(a){a.removeAttr("disabled")};return this.__alterButtons(a,b),this},"disableButtons":function(a){var b=function(a){a.attr("disabled","disabled")};return this.__alterButtons(a,b),this},"eventSupported":function(a){var b=a in this.$element;return b||(this.$element.setAttribute(a,"return;"),b="function"==typeof this.$element[a]),b},"keydown":function(b){this.suppressKeyPressRepeat=~a.inArray(b.keyCode,[40,38,9,13,27]),this.keyup(b)},"keypress":function(a){this.suppressKeyPressRepeat||this.keyup(a)},"keyup":function(a){var b=!1;switch(a.keyCode){case 40:case 38:case 16:case 17:case 18:break;case 9:var c;if(c=this.getNextTab(),null!=c){var d=this;setTimeout(function(){d.setSelection(c.start,c.end)},500),b=!0}else{var e=this.getSelection();e.start==e.end&&e.end==this.getContent().length?b=!1:(this.setSelection(this.getContent().length,this.getContent().length),b=!0)}break;case 13:case 27:b=!1;break;default:b=!1}b&&(a.stopPropagation(),a.preventDefault())},"focus":function(){var b=this.$options,c=(b.hideable,this.$editor);return c.addClass("active"),a(document).find(".md-editor").each(function(){if(a(this).attr("id")!=c.attr("id")){var b;b=a(this).find("textarea").data("markdown"),null==b&&(b=a(this).find('div[data-provider="markdown-preview"]').data("markdown")),b&&b.blur()}}),b.onFocus(this),this},"blur":function(){var b=this.$options,c=b.hideable,d=this.$editor,e=this.$editable;if(d.hasClass("active")||0==this.$element.parent().length){if(d.removeClass("active"),c)if(null!=e.el){var f=a("<"+e.type+"/>"),g=this.getContent(),h="object"==typeof markdown?markdown.toHTML(g):g;a(e.attrKeys).each(function(a){f.attr(e.attrKeys[a],e.attrValues[a])}),f.html(h),d.replaceWith(f)}else d.hide();b.onBlur(this)}return this}};var c=a.fn.markdown;a.fn.markdown=function(c){return this.each(function(){var d=a(this),e=d.data("markdown"),f="object"==typeof c&&c;e||d.data("markdown",e=new b(this,f))})},a.fn.markdown.defaults={"autofocus":!1,"hideable":!1,"savable":!1,"width":"inherit","height":"inherit","iconlibrary":"glyph","buttons":[[{"name":"groupFont","data":[{"name":"cmdBold","title":"Bold","icon":{"glyph":"glyphicon glyphicon-bold","fa":"fa fa-bold"},"callback":function(a){var b,c,d=a.getSelection(),e=a.getContent();b=0==d.length?"strong text":d.text,"**"==e.substr(d.start-2,2)&&"**"==e.substr(d.end,2)?(a.setSelection(d.start-2,d.end+2),a.replaceSelection(b),c=d.start-2):(a.replaceSelection("**"+b+"**"),c=d.start+2),a.setSelection(c,c+b.length)}},{"name":"cmdItalic","title":"Italic","icon":{"glyph":"glyphicon glyphicon-italic","fa":"fa fa-italic"},"callback":function(a){var b,c,d=a.getSelection(),e=a.getContent();b=0==d.length?"emphasized text":d.text,"*"==e.substr(d.start-1,1)&&"*"==e.substr(d.end,1)?(a.setSelection(d.start-1,d.end+1),a.replaceSelection(b),c=d.start-1):(a.replaceSelection("*"+b+"*"),c=d.start+1),a.setSelection(c,c+b.length)}},{"name":"cmdHeading","title":"Heading","icon":{"glyph":"glyphicon glyphicon-header","fa":"fa fa-font"},"callback":function(a){var b,c,d,e,f=a.getSelection(),g=a.getContent();b=0==f.length?"heading text":f.text+"\n",d=4,"### "==g.substr(f.start-d,d)||(d=3,"###"==g.substr(f.start-d,d))?(a.setSelection(f.start-d,f.end),a.replaceSelection(b),c=f.start-d):f.start>0&&(e=g.substr(f.start-1,1),!!e&&"\n"!=e)?(a.replaceSelection("\n\n### "+b),c=f.start+6):(a.replaceSelection("### "+b),c=f.start+4),a.setSelection(c,c+b.length)}}]},{"name":"groupLink","data":[{"name":"cmdUrl","title":"URL/Link","icon":{"glyph":"glyphicon glyphicon-globe","fa":"fa fa-globe"},"callback":function(a){{var b,c,d,e=a.getSelection();a.getContent()}b=0==e.length?"enter link description here":e.text,d=prompt("Insert Hyperlink","http://"),null!=d&&""!=d&&"http://"!=d&&(a.replaceSelection("["+b+"]("+d+")"),c=e.start+1,a.setSelection(c,c+b.length))}},{"name":"cmdImage","title":"Image","icon":{"glyph":"glyphicon glyphicon-picture","fa":"fa fa-picture-o"},"callback":function(a){{var b,c,d,e=a.getSelection();a.getContent()}b=0==e.length?"enter image description here":e.text,d=prompt("Insert Image Hyperlink","http://"),null!=d&&(a.replaceSelection("'),c=e.start+2,a.setNextTab("enter image title here"),a.setSelection(c,c+b.length))}}]},{"name":"groupMisc","data":[{"name":"cmdList","title":"List","icon":{"glyph":"glyphicon glyphicon-list","fa":"fa fa-list"},"callback":function(b){{var c,d,e=b.getSelection();b.getContent()}if(0==e.length)c="list text here",b.replaceSelection("- "+c),d=e.start+2;else if(e.text.indexOf("\n")<0)c=e.text,b.replaceSelection("- "+c),d=e.start+2;else{var f=[];f=e.text.split("\n"),c=f[0],a.each(f,function(a,b){f[a]="- "+b}),b.replaceSelection("\n\n"+f.join("\n")),d=e.start+4}b.setSelection(d,d+c.length)}}]},{"name":"groupUtil","data":[{"name":"cmdPreview","toggle":!0,"title":"Preview","btnText":"Preview","btnClass":"btn btn-primary btn-sm","icon":{"glyph":"glyphicon glyphicon-search","fa":"fa fa-search"},"callback":function(a){var b=a.$isPreview;0==b?a.showPreview():a.hidePreview()}}]}]],"additionalButtons":[],"onShow":function(){},"onPreview":function(){},"onSave":function(){},"onBlur":function(){},"onFocus":function(){}},a.fn.markdown.Constructor=b,a.fn.markdown.noConflict=function(){return a.fn.markdown=c,this};var d=function(a){var b=a;return b.data("markdown")?void b.data("markdown").showEditor():void b.markdown(b.data())},e=function(b){var c,d=!1,e=a(b.currentTarget);"focusin"!=b.type&&"click"!=b.type||1!=e.length||"object"!=typeof e[0]||(c=e[0].activeElement,a(c).data("markdown")||("undefined"==typeof a(c).parent().parent().parent().attr("class")||a(c).parent().parent().parent().attr("class").indexOf("md-editor")<0?("undefined"==typeof a(c).parent().parent().attr("class")||a(c).parent().parent().attr("class").indexOf("md-editor")<0)&&(d=!0):d=!1),d&&a(document).find(".md-editor").each(function(){var b=a(c).parent();if(a(this).attr("id")!=b.attr("id")){var d;d=a(this).find("textarea").data("markdown"),null==d&&(d=a(this).find('div[data-provider="markdown-preview"]').data("markdown")),d&&d.blur()}}),b.stopPropagation())};a(document).on("click.markdown.data-api",'[data-provide="markdown-editable"]',function(b){d(a(this)),b.preventDefault()}).on("click",function(a){e(a)}).on("focusin",function(a){e(a)}).ready(function(){a('textarea[data-provide="markdown"]').each(function(){d(a(this))})})}(window.jQuery),!function(a){var b,c,d="0.4.2",e="hasOwnProperty",f=/[\.\/]/,g="*",h=function(){},i=function(a,b){return a-b},j={"n":{}},k=function(a,d){a=String(a);var e,f=c,g=Array.prototype.slice.call(arguments,2),h=k.listeners(a),j=0,l=[],m={},n=[],o=b;b=a,c=0;for(var p=0,q=h.length;q>p;p++)"zIndex"in h[p]&&(l.push(h[p].zIndex),h[p].zIndex<0&&(m[h[p].zIndex]=h[p]));for(l.sort(i);l[j]<0;)if(e=m[l[j++]],n.push(e.apply(d,g)),c)return c=f,n;for(p=0;q>p;p++)if(e=h[p],"zIndex"in e)if(e.zIndex==l[j]){if(n.push(e.apply(d,g)),c)break;do if(j++,e=m[l[j]],e&&n.push(e.apply(d,g)),c)break;while(e)}else m[e.zIndex]=e;else if(n.push(e.apply(d,g)),c)break;
|
|
return c=f,b=o,n.length?n:null};k._events=j,k.listeners=function(a){var b,c,d,e,h,i,k,l,m=a.split(f),n=j,o=[n],p=[];for(e=0,h=m.length;h>e;e++){for(l=[],i=0,k=o.length;k>i;i++)for(n=o[i].n,c=[n[m[e]],n[g]],d=2;d--;)b=c[d],b&&(l.push(b),p=p.concat(b.f||[]));o=l}return p},k.on=function(a,b){if(a=String(a),"function"!=typeof b)return function(){};for(var c=a.split(f),d=j,e=0,g=c.length;g>e;e++)d=d.n,d=d.hasOwnProperty(c[e])&&d[c[e]]||(d[c[e]]={"n":{}});for(d.f=d.f||[],e=0,g=d.f.length;g>e;e++)if(d.f[e]==b)return h;return d.f.push(b),function(a){+a==+a&&(b.zIndex=+a)}},k.f=function(a){var b=[].slice.call(arguments,1);return function(){k.apply(null,[a,null].concat(b).concat([].slice.call(arguments,0)))}},k.stop=function(){c=1},k.nt=function(a){return a?new RegExp("(?:\\.|\\/|^)"+a+"(?:\\.|\\/|$)").test(b):b},k.nts=function(){return b.split(f)},k.off=k.unbind=function(a,b){if(!a)return void(k._events=j={"n":{}});var c,d,h,i,l,m,n,o=a.split(f),p=[j];for(i=0,l=o.length;l>i;i++)for(m=0;m<p.length;m+=h.length-2){if(h=[m,1],c=p[m].n,o[i]!=g)c[o[i]]&&h.push(c[o[i]]);else for(d in c)c[e](d)&&h.push(c[d]);p.splice.apply(p,h)}for(i=0,l=p.length;l>i;i++)for(c=p[i];c.n;){if(b){if(c.f){for(m=0,n=c.f.length;n>m;m++)if(c.f[m]==b){c.f.splice(m,1);break}!c.f.length&&delete c.f}for(d in c.n)if(c.n[e](d)&&c.n[d].f){var q=c.n[d].f;for(m=0,n=q.length;n>m;m++)if(q[m]==b){q.splice(m,1);break}!q.length&&delete c.n[d].f}}else{delete c.f;for(d in c.n)c.n[e](d)&&c.n[d].f&&delete c.n[d].f}c=c.n}},k.once=function(a,b){var c=function(){return k.unbind(a,c),b.apply(this,arguments)};return k.on(a,c)},k.version=d,k.toString=function(){return"You are running Eve "+d},"undefined"!=typeof module&&module.exports?module.exports=k:"undefined"!=typeof define?define("eve",[],function(){return k}):a.eve=k}(window||this),function(a,b){"function"==typeof define&&define.amd?define(["eve"],function(c){return b(a,c)}):b(a,a.eve)}(this,function(a,b){function c(a){if(c.is(a,"function"))return u?a():b.on("raphael.DOMload",a);if(c.is(a,V))return c._engine.create[D](c,a.splice(0,3+c.is(a[0],T))).add(a);var d=Array.prototype.slice.call(arguments,0);if(c.is(d[d.length-1],"function")){var e=d.pop();return u?e.call(c._engine.create[D](c,d)):b.on("raphael.DOMload",function(){e.call(c._engine.create[D](c,d))})}return c._engine.create[D](c,arguments)}function d(a){if("function"==typeof a||Object(a)!==a)return a;var b=new a.constructor;for(var c in a)a[z](c)&&(b[c]=d(a[c]));return b}function e(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return a.push(a.splice(c,1)[0])}function f(a,b,c){function d(){var f=Array.prototype.slice.call(arguments,0),g=f.join("\u2400"),h=d.cache=d.cache||{},i=d.count=d.count||[];return h[z](g)?(e(i,g),c?c(h[g]):h[g]):(i.length>=1e3&&delete h[i.shift()],i.push(g),h[g]=a[D](b,f),c?c(h[g]):h[g])}return d}function g(){return this.hex}function h(a,b){for(var c=[],d=0,e=a.length;e-2*!b>d;d+=2){var f=[{"x":+a[d-2],"y":+a[d-1]},{"x":+a[d],"y":+a[d+1]},{"x":+a[d+2],"y":+a[d+3]},{"x":+a[d+4],"y":+a[d+5]}];b?d?e-4==d?f[3]={"x":+a[0],"y":+a[1]}:e-2==d&&(f[2]={"x":+a[0],"y":+a[1]},f[3]={"x":+a[2],"y":+a[3]}):f[0]={"x":+a[e-2],"y":+a[e-1]}:e-4==d?f[3]=f[2]:d||(f[0]={"x":+a[d],"y":+a[d+1]}),c.push(["C",(-f[0].x+6*f[1].x+f[2].x)/6,(-f[0].y+6*f[1].y+f[2].y)/6,(f[1].x+6*f[2].x-f[3].x)/6,(f[1].y+6*f[2].y-f[3].y)/6,f[2].x,f[2].y])}return c}function i(a,b,c,d,e){var f=-3*b+9*c-9*d+3*e,g=a*f+6*b-12*c+6*d;return a*g-3*b+3*c}function j(a,b,c,d,e,f,g,h,j){null==j&&(j=1),j=j>1?1:0>j?0:j;for(var k=j/2,l=12,m=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],n=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],o=0,p=0;l>p;p++){var q=k*m[p]+k,r=i(q,a,c,e,g),s=i(q,b,d,f,h),t=r*r+s*s;o+=n[p]*N.sqrt(t)}return k*o}function k(a,b,c,d,e,f,g,h,i){if(!(0>i||j(a,b,c,d,e,f,g,h)<i)){var k,l=1,m=l/2,n=l-m,o=.01;for(k=j(a,b,c,d,e,f,g,h,n);Q(k-i)>o;)m/=2,n+=(i>k?1:-1)*m,k=j(a,b,c,d,e,f,g,h,n);return n}}function l(a,b,c,d,e,f,g,h){if(!(O(a,c)<P(e,g)||P(a,c)>O(e,g)||O(b,d)<P(f,h)||P(b,d)>O(f,h))){var i=(a*d-b*c)*(e-g)-(a-c)*(e*h-f*g),j=(a*d-b*c)*(f-h)-(b-d)*(e*h-f*g),k=(a-c)*(f-h)-(b-d)*(e-g);if(k){var l=i/k,m=j/k,n=+l.toFixed(2),o=+m.toFixed(2);if(!(n<+P(a,c).toFixed(2)||n>+O(a,c).toFixed(2)||n<+P(e,g).toFixed(2)||n>+O(e,g).toFixed(2)||o<+P(b,d).toFixed(2)||o>+O(b,d).toFixed(2)||o<+P(f,h).toFixed(2)||o>+O(f,h).toFixed(2)))return{"x":l,"y":m}}}}function m(a,b,d){var e=c.bezierBBox(a),f=c.bezierBBox(b);if(!c.isBBoxIntersect(e,f))return d?0:[];for(var g=j.apply(0,a),h=j.apply(0,b),i=O(~~(g/5),1),k=O(~~(h/5),1),m=[],n=[],o={},p=d?0:[],q=0;i+1>q;q++){var r=c.findDotsAtSegment.apply(c,a.concat(q/i));m.push({"x":r.x,"y":r.y,"t":q/i})}for(q=0;k+1>q;q++)r=c.findDotsAtSegment.apply(c,b.concat(q/k)),n.push({"x":r.x,"y":r.y,"t":q/k});for(q=0;i>q;q++)for(var s=0;k>s;s++){var t=m[q],u=m[q+1],v=n[s],w=n[s+1],x=Q(u.x-t.x)<.001?"y":"x",y=Q(w.x-v.x)<.001?"y":"x",z=l(t.x,t.y,u.x,u.y,v.x,v.y,w.x,w.y);if(z){if(o[z.x.toFixed(4)]==z.y.toFixed(4))continue;o[z.x.toFixed(4)]=z.y.toFixed(4);var A=t.t+Q((z[x]-t[x])/(u[x]-t[x]))*(u.t-t.t),B=v.t+Q((z[y]-v[y])/(w[y]-v[y]))*(w.t-v.t);A>=0&&1.001>=A&&B>=0&&1.001>=B&&(d?p++:p.push({"x":z.x,"y":z.y,"t1":P(A,1),"t2":P(B,1)}))}}return p}function n(a,b,d){a=c._path2curve(a),b=c._path2curve(b);for(var e,f,g,h,i,j,k,l,n,o,p=d?0:[],q=0,r=a.length;r>q;q++){var s=a[q];if("M"==s[0])e=i=s[1],f=j=s[2];else{"C"==s[0]?(n=[e,f].concat(s.slice(1)),e=n[6],f=n[7]):(n=[e,f,e,f,i,j,i,j],e=i,f=j);for(var t=0,u=b.length;u>t;t++){var v=b[t];if("M"==v[0])g=k=v[1],h=l=v[2];else{"C"==v[0]?(o=[g,h].concat(v.slice(1)),g=o[6],h=o[7]):(o=[g,h,g,h,k,l,k,l],g=k,h=l);var w=m(n,o,d);if(d)p+=w;else{for(var x=0,y=w.length;y>x;x++)w[x].segment1=q,w[x].segment2=t,w[x].bez1=n,w[x].bez2=o;p=p.concat(w)}}}}}return p}function o(a,b,c,d,e,f){null!=a?(this.a=+a,this.b=+b,this.c=+c,this.d=+d,this.e=+e,this.f=+f):(this.a=1,this.b=0,this.c=0,this.d=1,this.e=0,this.f=0)}function p(){return this.x+H+this.y+H+this.width+" \xd7 "+this.height}function q(a,b,c,d,e,f){function g(a){return((l*a+k)*a+j)*a}function h(a,b){var c=i(a,b);return((o*c+n)*c+m)*c}function i(a,b){var c,d,e,f,h,i;for(e=a,i=0;8>i;i++){if(f=g(e)-a,Q(f)<b)return e;if(h=(3*l*e+2*k)*e+j,Q(h)<1e-6)break;e-=f/h}if(c=0,d=1,e=a,c>e)return c;if(e>d)return d;for(;d>c;){if(f=g(e),Q(f-a)<b)return e;a>f?c=e:d=e,e=(d-c)/2+c}return e}var j=3*b,k=3*(d-b)-j,l=1-j-k,m=3*c,n=3*(e-c)-m,o=1-m-n;return h(a,1/(200*f))}function r(a,b){var c=[],d={};if(this.ms=b,this.times=1,a){for(var e in a)a[z](e)&&(d[_(e)]=a[e],c.push(_(e)));c.sort(lb)}this.anim=d,this.top=c[c.length-1],this.percents=c}function s(a,d,e,f,g,h){e=_(e);var i,j,k,l,m,n,p=a.ms,r={},s={},t={};if(f)for(v=0,x=ic.length;x>v;v++){var u=ic[v];if(u.el.id==d.id&&u.anim==a){u.percent!=e?(ic.splice(v,1),k=1):j=u,d.attr(u.totalOrigin);break}}else f=+s;for(var v=0,x=a.percents.length;x>v;v++){if(a.percents[v]==e||a.percents[v]>f*a.top){e=a.percents[v],m=a.percents[v-1]||0,p=p/a.top*(e-m),l=a.percents[v+1],i=a.anim[e];break}f&&d.attr(a.anim[a.percents[v]])}if(i){if(j)j.initstatus=f,j.start=new Date-j.ms*f;else{for(var y in i)if(i[z](y)&&(db[z](y)||d.paper.customAttributes[z](y)))switch(r[y]=d.attr(y),null==r[y]&&(r[y]=cb[y]),s[y]=i[y],db[y]){case T:t[y]=(s[y]-r[y])/p;break;case"colour":r[y]=c.getRGB(r[y]);var A=c.getRGB(s[y]);t[y]={"r":(A.r-r[y].r)/p,"g":(A.g-r[y].g)/p,"b":(A.b-r[y].b)/p};break;case"path":var B=Kb(r[y],s[y]),C=B[1];for(r[y]=B[0],t[y]=[],v=0,x=r[y].length;x>v;v++){t[y][v]=[0];for(var D=1,F=r[y][v].length;F>D;D++)t[y][v][D]=(C[v][D]-r[y][v][D])/p}break;case"transform":var G=d._,H=Pb(G[y],s[y]);if(H)for(r[y]=H.from,s[y]=H.to,t[y]=[],t[y].real=!0,v=0,x=r[y].length;x>v;v++)for(t[y][v]=[r[y][v][0]],D=1,F=r[y][v].length;F>D;D++)t[y][v][D]=(s[y][v][D]-r[y][v][D])/p;else{var K=d.matrix||new o,L={"_":{"transform":G.transform},"getBBox":function(){return d.getBBox(1)}};r[y]=[K.a,K.b,K.c,K.d,K.e,K.f],Nb(L,s[y]),s[y]=L._.transform,t[y]=[(L.matrix.a-K.a)/p,(L.matrix.b-K.b)/p,(L.matrix.c-K.c)/p,(L.matrix.d-K.d)/p,(L.matrix.e-K.e)/p,(L.matrix.f-K.f)/p]}break;case"csv":var M=I(i[y])[J](w),N=I(r[y])[J](w);if("clip-rect"==y)for(r[y]=N,t[y]=[],v=N.length;v--;)t[y][v]=(M[v]-r[y][v])/p;s[y]=M;break;default:for(M=[][E](i[y]),N=[][E](r[y]),t[y]=[],v=d.paper.customAttributes[y].length;v--;)t[y][v]=((M[v]||0)-(N[v]||0))/p}var O=i.easing,P=c.easing_formulas[O];if(!P)if(P=I(O).match(Z),P&&5==P.length){var Q=P;P=function(a){return q(a,+Q[1],+Q[2],+Q[3],+Q[4],p)}}else P=nb;if(n=i.start||a.start||+new Date,u={"anim":a,"percent":e,"timestamp":n,"start":n+(a.del||0),"status":0,"initstatus":f||0,"stop":!1,"ms":p,"easing":P,"from":r,"diff":t,"to":s,"el":d,"callback":i.callback,"prev":m,"next":l,"repeat":h||a.times,"origin":d.attr(),"totalOrigin":g},ic.push(u),f&&!j&&!k&&(u.stop=!0,u.start=new Date-p*f,1==ic.length))return kc();k&&(u.start=new Date-u.ms*f),1==ic.length&&jc(kc)}b("raphael.anim.start."+d.id,d,a)}}function t(a){for(var b=0;b<ic.length;b++)ic[b].el.paper==a&&ic.splice(b--,1)}c.version="2.1.2",c.eve=b;var u,v,w=/[, ]+/,x={"circle":1,"rect":1,"path":1,"ellipse":1,"text":1,"image":1},y=/\{(\d+)\}/g,z="hasOwnProperty",A={"doc":document,"win":a},B={"was":Object.prototype[z].call(A.win,"Raphael"),"is":A.win.Raphael},C=function(){this.ca=this.customAttributes={}},D="apply",E="concat",F="ontouchstart"in A.win||A.win.DocumentTouch&&A.doc instanceof DocumentTouch,G="",H=" ",I=String,J="split",K="click dblclick mousedown mousemove mouseout mouseover mouseup touchstart touchmove touchend touchcancel"[J](H),L={"mousedown":"touchstart","mousemove":"touchmove","mouseup":"touchend"},M=I.prototype.toLowerCase,N=Math,O=N.max,P=N.min,Q=N.abs,R=N.pow,S=N.PI,T="number",U="string",V="array",W=Object.prototype.toString,X=(c._ISURL=/^url\(['"]?([^\)]+?)['"]?\)$/i,/^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+%?)?)\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?)%?\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?)%?\s*\))\s*$/i),Y={"NaN":1,"Infinity":1,"-Infinity":1},Z=/^(?:cubic-)?bezier\(([^,]+),([^,]+),([^,]+),([^\)]+)\)/,$=N.round,_=parseFloat,ab=parseInt,bb=I.prototype.toUpperCase,cb=c._availableAttrs={"arrow-end":"none","arrow-start":"none","blur":0,"clip-rect":"0 0 1e9 1e9","cursor":"default","cx":0,"cy":0,"fill":"#fff","fill-opacity":1,"font":'10px "Arial"',"font-family":'"Arial"',"font-size":"10","font-style":"normal","font-weight":400,"gradient":0,"height":0,"href":"http://raphaeljs.com/","letter-spacing":0,"opacity":1,"path":"M0,0","r":0,"rx":0,"ry":0,"src":"","stroke":"#000","stroke-dasharray":"","stroke-linecap":"butt","stroke-linejoin":"butt","stroke-miterlimit":0,"stroke-opacity":1,"stroke-width":1,"target":"_blank","text-anchor":"middle","title":"Raphael","transform":"","width":0,"x":0,"y":0},db=c._availableAnimAttrs={"blur":T,"clip-rect":"csv","cx":T,"cy":T,"fill":"colour","fill-opacity":T,"font-size":T,"height":T,"opacity":T,"path":"path","r":T,"rx":T,"ry":T,"stroke":"colour","stroke-opacity":T,"stroke-width":T,"transform":"transform","width":T,"x":T,"y":T},eb=/[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*/,fb={"hs":1,"rg":1},gb=/,?([achlmqrstvxz]),?/gi,hb=/([achlmrqstvz])[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029,]*((-?\d*\.?\d*(?:e[\-+]?\d+)?[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,?[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*)+)/gi,ib=/([rstm])[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029,]*((-?\d*\.?\d*(?:e[\-+]?\d+)?[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,?[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*)+)/gi,jb=/(-?\d*\.?\d*(?:e[\-+]?\d+)?)[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,?[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*/gi,kb=(c._radial_gradient=/^r(?:\(([^,]+?)[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*([^\)]+?)\))?/,{}),lb=function(a,b){return _(a)-_(b)},mb=function(){},nb=function(a){return a},ob=c._rectPath=function(a,b,c,d,e){return e?[["M",a+e,b],["l",c-2*e,0],["a",e,e,0,0,1,e,e],["l",0,d-2*e],["a",e,e,0,0,1,-e,e],["l",2*e-c,0],["a",e,e,0,0,1,-e,-e],["l",0,2*e-d],["a",e,e,0,0,1,e,-e],["z"]]:[["M",a,b],["l",c,0],["l",0,d],["l",-c,0],["z"]]},pb=function(a,b,c,d){return null==d&&(d=c),[["M",a,b],["m",0,-d],["a",c,d,0,1,1,0,2*d],["a",c,d,0,1,1,0,-2*d],["z"]]},qb=c._getPath={"path":function(a){return a.attr("path")},"circle":function(a){var b=a.attrs;return pb(b.cx,b.cy,b.r)},"ellipse":function(a){var b=a.attrs;return pb(b.cx,b.cy,b.rx,b.ry)},"rect":function(a){var b=a.attrs;return ob(b.x,b.y,b.width,b.height,b.r)},"image":function(a){var b=a.attrs;return ob(b.x,b.y,b.width,b.height)},"text":function(a){var b=a._getBBox();return ob(b.x,b.y,b.width,b.height)},"set":function(a){var b=a._getBBox();return ob(b.x,b.y,b.width,b.height)}},rb=c.mapPath=function(a,b){if(!b)return a;var c,d,e,f,g,h,i;for(a=Kb(a),e=0,g=a.length;g>e;e++)for(i=a[e],f=1,h=i.length;h>f;f+=2)c=b.x(i[f],i[f+1]),d=b.y(i[f],i[f+1]),i[f]=c,i[f+1]=d;return a};if(c._g=A,c.type=A.win.SVGAngle||A.doc.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")?"SVG":"VML","VML"==c.type){var sb,tb=A.doc.createElement("div");if(tb.innerHTML='<v:shape adj="1"/>',sb=tb.firstChild,sb.style.behavior="url(#default#VML)",!sb||"object"!=typeof sb.adj)return c.type=G;tb=null}c.svg=!(c.vml="VML"==c.type),c._Paper=C,c.fn=v=C.prototype=c.prototype,c._id=0,c._oid=0,c.is=function(a,b){return b=M.call(b),"finite"==b?!Y[z](+a):"array"==b?a instanceof Array:"null"==b&&null===a||b==typeof a&&null!==a||"object"==b&&a===Object(a)||"array"==b&&Array.isArray&&Array.isArray(a)||W.call(a).slice(8,-1).toLowerCase()==b},c.angle=function(a,b,d,e,f,g){if(null==f){var h=a-d,i=b-e;return h||i?(180+180*N.atan2(-i,-h)/S+360)%360:0}return c.angle(a,b,f,g)-c.angle(d,e,f,g)},c.rad=function(a){return a%360*S/180},c.deg=function(a){return 180*a/S%360},c.snapTo=function(a,b,d){if(d=c.is(d,"finite")?d:10,c.is(a,V)){for(var e=a.length;e--;)if(Q(a[e]-b)<=d)return a[e]}else{a=+a;var f=b%a;if(d>f)return b-f;if(f>a-d)return b-f+a}return b},c.createUUID=function(a,b){return function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(a,b).toUpperCase()}}(/[xy]/g,function(a){var b=16*N.random()|0,c="x"==a?b:3&b|8;return c.toString(16)}),c.setWindow=function(a){b("raphael.setWindow",c,A.win,a),A.win=a,A.doc=A.win.document,c._engine.initWin&&c._engine.initWin(A.win)};var ub=function(a){if(c.vml){var b,d=/^\s+|\s+$/g;try{var e=new ActiveXObject("htmlfile");e.write("<body>"),e.close(),b=e.body}catch(g){b=createPopup().document.body}var h=b.createTextRange();ub=f(function(a){try{b.style.color=I(a).replace(d,G);var c=h.queryCommandValue("ForeColor");return c=(255&c)<<16|65280&c|(16711680&c)>>>16,"#"+("000000"+c.toString(16)).slice(-6)}catch(e){return"none"}})}else{var i=A.doc.createElement("i");i.title="Rapha\xebl Colour Picker",i.style.display="none",A.doc.body.appendChild(i),ub=f(function(a){return i.style.color=a,A.doc.defaultView.getComputedStyle(i,G).getPropertyValue("color")})}return ub(a)},vb=function(){return"hsb("+[this.h,this.s,this.b]+")"},wb=function(){return"hsl("+[this.h,this.s,this.l]+")"},xb=function(){return this.hex},yb=function(a,b,d){if(null==b&&c.is(a,"object")&&"r"in a&&"g"in a&&"b"in a&&(d=a.b,b=a.g,a=a.r),null==b&&c.is(a,U)){var e=c.getRGB(a);a=e.r,b=e.g,d=e.b}return(a>1||b>1||d>1)&&(a/=255,b/=255,d/=255),[a,b,d]},zb=function(a,b,d,e){a*=255,b*=255,d*=255;var f={"r":a,"g":b,"b":d,"hex":c.rgb(a,b,d),"toString":xb};return c.is(e,"finite")&&(f.opacity=e),f};c.color=function(a){var b;return c.is(a,"object")&&"h"in a&&"s"in a&&"b"in a?(b=c.hsb2rgb(a),a.r=b.r,a.g=b.g,a.b=b.b,a.hex=b.hex):c.is(a,"object")&&"h"in a&&"s"in a&&"l"in a?(b=c.hsl2rgb(a),a.r=b.r,a.g=b.g,a.b=b.b,a.hex=b.hex):(c.is(a,"string")&&(a=c.getRGB(a)),c.is(a,"object")&&"r"in a&&"g"in a&&"b"in a?(b=c.rgb2hsl(a),a.h=b.h,a.s=b.s,a.l=b.l,b=c.rgb2hsb(a),a.v=b.b):(a={"hex":"none"},a.r=a.g=a.b=a.h=a.s=a.v=a.l=-1)),a.toString=xb,a},c.hsb2rgb=function(a,b,c,d){this.is(a,"object")&&"h"in a&&"s"in a&&"b"in a&&(c=a.b,b=a.s,a=a.h,d=a.o),a*=360;var e,f,g,h,i;return a=a%360/60,i=c*b,h=i*(1-Q(a%2-1)),e=f=g=c-i,a=~~a,e+=[i,h,0,0,h,i][a],f+=[h,i,i,h,0,0][a],g+=[0,0,h,i,i,h][a],zb(e,f,g,d)},c.hsl2rgb=function(a,b,c,d){this.is(a,"object")&&"h"in a&&"s"in a&&"l"in a&&(c=a.l,b=a.s,a=a.h),(a>1||b>1||c>1)&&(a/=360,b/=100,c/=100),a*=360;var e,f,g,h,i;return a=a%360/60,i=2*b*(.5>c?c:1-c),h=i*(1-Q(a%2-1)),e=f=g=c-i/2,a=~~a,e+=[i,h,0,0,h,i][a],f+=[h,i,i,h,0,0][a],g+=[0,0,h,i,i,h][a],zb(e,f,g,d)},c.rgb2hsb=function(a,b,c){c=yb(a,b,c),a=c[0],b=c[1],c=c[2];var d,e,f,g;return f=O(a,b,c),g=f-P(a,b,c),d=0==g?null:f==a?(b-c)/g:f==b?(c-a)/g+2:(a-b)/g+4,d=(d+360)%6*60/360,e=0==g?0:g/f,{"h":d,"s":e,"b":f,"toString":vb}},c.rgb2hsl=function(a,b,c){c=yb(a,b,c),a=c[0],b=c[1],c=c[2];var d,e,f,g,h,i;return g=O(a,b,c),h=P(a,b,c),i=g-h,d=0==i?null:g==a?(b-c)/i:g==b?(c-a)/i+2:(a-b)/i+4,d=(d+360)%6*60/360,f=(g+h)/2,e=0==i?0:.5>f?i/(2*f):i/(2-2*f),{"h":d,"s":e,"l":f,"toString":wb}},c._path2string=function(){return this.join(",").replace(gb,"$1")},c._preload=function(a,b){var c=A.doc.createElement("img");c.style.cssText="position:absolute;left:-9999em;top:-9999em",c.onload=function(){b.call(this),this.onload=null,A.doc.body.removeChild(this)},c.onerror=function(){A.doc.body.removeChild(this)},A.doc.body.appendChild(c),c.src=a},c.getRGB=f(function(a){if(!a||(a=I(a)).indexOf("-")+1)return{"r":-1,"g":-1,"b":-1,"hex":"none","error":1,"toString":g};if("none"==a)return{"r":-1,"g":-1,"b":-1,"hex":"none","toString":g};!(fb[z](a.toLowerCase().substring(0,2))||"#"==a.charAt())&&(a=ub(a));var b,d,e,f,h,i,j=a.match(X);return j?(j[2]&&(e=ab(j[2].substring(5),16),d=ab(j[2].substring(3,5),16),b=ab(j[2].substring(1,3),16)),j[3]&&(e=ab((h=j[3].charAt(3))+h,16),d=ab((h=j[3].charAt(2))+h,16),b=ab((h=j[3].charAt(1))+h,16)),j[4]&&(i=j[4][J](eb),b=_(i[0]),"%"==i[0].slice(-1)&&(b*=2.55),d=_(i[1]),"%"==i[1].slice(-1)&&(d*=2.55),e=_(i[2]),"%"==i[2].slice(-1)&&(e*=2.55),"rgba"==j[1].toLowerCase().slice(0,4)&&(f=_(i[3])),i[3]&&"%"==i[3].slice(-1)&&(f/=100)),j[5]?(i=j[5][J](eb),b=_(i[0]),"%"==i[0].slice(-1)&&(b*=2.55),d=_(i[1]),"%"==i[1].slice(-1)&&(d*=2.55),e=_(i[2]),"%"==i[2].slice(-1)&&(e*=2.55),("deg"==i[0].slice(-3)||"\xb0"==i[0].slice(-1))&&(b/=360),"hsba"==j[1].toLowerCase().slice(0,4)&&(f=_(i[3])),i[3]&&"%"==i[3].slice(-1)&&(f/=100),c.hsb2rgb(b,d,e,f)):j[6]?(i=j[6][J](eb),b=_(i[0]),"%"==i[0].slice(-1)&&(b*=2.55),d=_(i[1]),"%"==i[1].slice(-1)&&(d*=2.55),e=_(i[2]),"%"==i[2].slice(-1)&&(e*=2.55),("deg"==i[0].slice(-3)||"\xb0"==i[0].slice(-1))&&(b/=360),"hsla"==j[1].toLowerCase().slice(0,4)&&(f=_(i[3])),i[3]&&"%"==i[3].slice(-1)&&(f/=100),c.hsl2rgb(b,d,e,f)):(j={"r":b,"g":d,"b":e,"toString":g},j.hex="#"+(16777216|e|d<<8|b<<16).toString(16).slice(1),c.is(f,"finite")&&(j.opacity=f),j)):{"r":-1,"g":-1,"b":-1,"hex":"none","error":1,"toString":g}},c),c.hsb=f(function(a,b,d){return c.hsb2rgb(a,b,d).hex}),c.hsl=f(function(a,b,d){return c.hsl2rgb(a,b,d).hex}),c.rgb=f(function(a,b,c){return"#"+(16777216|c|b<<8|a<<16).toString(16).slice(1)}),c.getColor=function(a){var b=this.getColor.start=this.getColor.start||{"h":0,"s":1,"b":a||.75},c=this.hsb2rgb(b.h,b.s,b.b);return b.h+=.075,b.h>1&&(b.h=0,b.s-=.2,b.s<=0&&(this.getColor.start={"h":0,"s":1,"b":b.b})),c.hex},c.getColor.reset=function(){delete this.start},c.parsePathString=function(a){if(!a)return null;var b=Ab(a);if(b.arr)return Cb(b.arr);var d={"a":7,"c":6,"h":1,"l":2,"m":2,"r":4,"q":4,"s":4,"t":2,"v":1,"z":0},e=[];return c.is(a,V)&&c.is(a[0],V)&&(e=Cb(a)),e.length||I(a).replace(hb,function(a,b,c){var f=[],g=b.toLowerCase();if(c.replace(jb,function(a,b){b&&f.push(+b)}),"m"==g&&f.length>2&&(e.push([b][E](f.splice(0,2))),g="l",b="m"==b?"l":"L"),"r"==g)e.push([b][E](f));else for(;f.length>=d[g]&&(e.push([b][E](f.splice(0,d[g]))),d[g]););}),e.toString=c._path2string,b.arr=Cb(e),e},c.parseTransformString=f(function(a){if(!a)return null;var b=[];return c.is(a,V)&&c.is(a[0],V)&&(b=Cb(a)),b.length||I(a).replace(ib,function(a,c,d){var e=[];M.call(c),d.replace(jb,function(a,b){b&&e.push(+b)}),b.push([c][E](e))}),b.toString=c._path2string,b});var Ab=function(a){var b=Ab.ps=Ab.ps||{};return b[a]?b[a].sleep=100:b[a]={"sleep":100},setTimeout(function(){for(var c in b)b[z](c)&&c!=a&&(b[c].sleep--,!b[c].sleep&&delete b[c])}),b[a]};c.findDotsAtSegment=function(a,b,c,d,e,f,g,h,i){var j=1-i,k=R(j,3),l=R(j,2),m=i*i,n=m*i,o=k*a+3*l*i*c+3*j*i*i*e+n*g,p=k*b+3*l*i*d+3*j*i*i*f+n*h,q=a+2*i*(c-a)+m*(e-2*c+a),r=b+2*i*(d-b)+m*(f-2*d+b),s=c+2*i*(e-c)+m*(g-2*e+c),t=d+2*i*(f-d)+m*(h-2*f+d),u=j*a+i*c,v=j*b+i*d,w=j*e+i*g,x=j*f+i*h,y=90-180*N.atan2(q-s,r-t)/S;return(q>s||t>r)&&(y+=180),{"x":o,"y":p,"m":{"x":q,"y":r},"n":{"x":s,"y":t},"start":{"x":u,"y":v},"end":{"x":w,"y":x},"alpha":y}},c.bezierBBox=function(a,b,d,e,f,g,h,i){c.is(a,"array")||(a=[a,b,d,e,f,g,h,i]);var j=Jb.apply(null,a);return{"x":j.min.x,"y":j.min.y,"x2":j.max.x,"y2":j.max.y,"width":j.max.x-j.min.x,"height":j.max.y-j.min.y}},c.isPointInsideBBox=function(a,b,c){return b>=a.x&&b<=a.x2&&c>=a.y&&c<=a.y2},c.isBBoxIntersect=function(a,b){var d=c.isPointInsideBBox;return d(b,a.x,a.y)||d(b,a.x2,a.y)||d(b,a.x,a.y2)||d(b,a.x2,a.y2)||d(a,b.x,b.y)||d(a,b.x2,b.y)||d(a,b.x,b.y2)||d(a,b.x2,b.y2)||(a.x<b.x2&&a.x>b.x||b.x<a.x2&&b.x>a.x)&&(a.y<b.y2&&a.y>b.y||b.y<a.y2&&b.y>a.y)},c.pathIntersection=function(a,b){return n(a,b)},c.pathIntersectionNumber=function(a,b){return n(a,b,1)},c.isPointInsidePath=function(a,b,d){var e=c.pathBBox(a);return c.isPointInsideBBox(e,b,d)&&n(a,[["M",b,d],["H",e.x2+10]],1)%2==1},c._removedFactory=function(a){return function(){b("raphael.log",null,"Rapha\xebl: you are calling to method \u201c"+a+"\u201d of removed object",a)}};var Bb=c.pathBBox=function(a){var b=Ab(a);if(b.bbox)return d(b.bbox);if(!a)return{"x":0,"y":0,"width":0,"height":0,"x2":0,"y2":0};a=Kb(a);for(var c,e=0,f=0,g=[],h=[],i=0,j=a.length;j>i;i++)if(c=a[i],"M"==c[0])e=c[1],f=c[2],g.push(e),h.push(f);else{var k=Jb(e,f,c[1],c[2],c[3],c[4],c[5],c[6]);g=g[E](k.min.x,k.max.x),h=h[E](k.min.y,k.max.y),e=c[5],f=c[6]}var l=P[D](0,g),m=P[D](0,h),n=O[D](0,g),o=O[D](0,h),p=n-l,q=o-m,r={"x":l,"y":m,"x2":n,"y2":o,"width":p,"height":q,"cx":l+p/2,"cy":m+q/2};return b.bbox=d(r),r},Cb=function(a){var b=d(a);return b.toString=c._path2string,b},Db=c._pathToRelative=function(a){var b=Ab(a);if(b.rel)return Cb(b.rel);c.is(a,V)&&c.is(a&&a[0],V)||(a=c.parsePathString(a));var d=[],e=0,f=0,g=0,h=0,i=0;"M"==a[0][0]&&(e=a[0][1],f=a[0][2],g=e,h=f,i++,d.push(["M",e,f]));for(var j=i,k=a.length;k>j;j++){var l=d[j]=[],m=a[j];if(m[0]!=M.call(m[0]))switch(l[0]=M.call(m[0]),l[0]){case"a":l[1]=m[1],l[2]=m[2],l[3]=m[3],l[4]=m[4],l[5]=m[5],l[6]=+(m[6]-e).toFixed(3),l[7]=+(m[7]-f).toFixed(3);break;case"v":l[1]=+(m[1]-f).toFixed(3);break;case"m":g=m[1],h=m[2];default:for(var n=1,o=m.length;o>n;n++)l[n]=+(m[n]-(n%2?e:f)).toFixed(3)}else{l=d[j]=[],"m"==m[0]&&(g=m[1]+e,h=m[2]+f);for(var p=0,q=m.length;q>p;p++)d[j][p]=m[p]}var r=d[j].length;switch(d[j][0]){case"z":e=g,f=h;break;case"h":e+=+d[j][r-1];break;case"v":f+=+d[j][r-1];break;default:e+=+d[j][r-2],f+=+d[j][r-1]}}return d.toString=c._path2string,b.rel=Cb(d),d},Eb=c._pathToAbsolute=function(a){var b=Ab(a);if(b.abs)return Cb(b.abs);if(c.is(a,V)&&c.is(a&&a[0],V)||(a=c.parsePathString(a)),!a||!a.length)return[["M",0,0]];var d=[],e=0,f=0,g=0,i=0,j=0;"M"==a[0][0]&&(e=+a[0][1],f=+a[0][2],g=e,i=f,j++,d[0]=["M",e,f]);for(var k,l,m=3==a.length&&"M"==a[0][0]&&"R"==a[1][0].toUpperCase()&&"Z"==a[2][0].toUpperCase(),n=j,o=a.length;o>n;n++){if(d.push(k=[]),l=a[n],l[0]!=bb.call(l[0]))switch(k[0]=bb.call(l[0]),k[0]){case"A":k[1]=l[1],k[2]=l[2],k[3]=l[3],k[4]=l[4],k[5]=l[5],k[6]=+(l[6]+e),k[7]=+(l[7]+f);break;case"V":k[1]=+l[1]+f;break;case"H":k[1]=+l[1]+e;break;case"R":for(var p=[e,f][E](l.slice(1)),q=2,r=p.length;r>q;q++)p[q]=+p[q]+e,p[++q]=+p[q]+f;d.pop(),d=d[E](h(p,m));break;case"M":g=+l[1]+e,i=+l[2]+f;default:for(q=1,r=l.length;r>q;q++)k[q]=+l[q]+(q%2?e:f)}else if("R"==l[0])p=[e,f][E](l.slice(1)),d.pop(),d=d[E](h(p,m)),k=["R"][E](l.slice(-2));else for(var s=0,t=l.length;t>s;s++)k[s]=l[s];switch(k[0]){case"Z":e=g,f=i;break;case"H":e=k[1];break;case"V":f=k[1];break;case"M":g=k[k.length-2],i=k[k.length-1];default:e=k[k.length-2],f=k[k.length-1]}}return d.toString=c._path2string,b.abs=Cb(d),d},Fb=function(a,b,c,d){return[a,b,c,d,c,d]},Gb=function(a,b,c,d,e,f){var g=1/3,h=2/3;return[g*a+h*c,g*b+h*d,g*e+h*c,g*f+h*d,e,f]},Hb=function(a,b,c,d,e,g,h,i,j,k){var l,m=120*S/180,n=S/180*(+e||0),o=[],p=f(function(a,b,c){var d=a*N.cos(c)-b*N.sin(c),e=a*N.sin(c)+b*N.cos(c);return{"x":d,"y":e}});if(k)y=k[0],z=k[1],w=k[2],x=k[3];else{l=p(a,b,-n),a=l.x,b=l.y,l=p(i,j,-n),i=l.x,j=l.y;var q=(N.cos(S/180*e),N.sin(S/180*e),(a-i)/2),r=(b-j)/2,s=q*q/(c*c)+r*r/(d*d);s>1&&(s=N.sqrt(s),c=s*c,d=s*d);var t=c*c,u=d*d,v=(g==h?-1:1)*N.sqrt(Q((t*u-t*r*r-u*q*q)/(t*r*r+u*q*q))),w=v*c*r/d+(a+i)/2,x=v*-d*q/c+(b+j)/2,y=N.asin(((b-x)/d).toFixed(9)),z=N.asin(((j-x)/d).toFixed(9));y=w>a?S-y:y,z=w>i?S-z:z,0>y&&(y=2*S+y),0>z&&(z=2*S+z),h&&y>z&&(y-=2*S),!h&&z>y&&(z-=2*S)}var A=z-y;if(Q(A)>m){var B=z,C=i,D=j;z=y+m*(h&&z>y?1:-1),i=w+c*N.cos(z),j=x+d*N.sin(z),o=Hb(i,j,c,d,e,0,h,C,D,[z,B,w,x])}A=z-y;var F=N.cos(y),G=N.sin(y),H=N.cos(z),I=N.sin(z),K=N.tan(A/4),L=4/3*c*K,M=4/3*d*K,O=[a,b],P=[a+L*G,b-M*F],R=[i+L*I,j-M*H],T=[i,j];if(P[0]=2*O[0]-P[0],P[1]=2*O[1]-P[1],k)return[P,R,T][E](o);o=[P,R,T][E](o).join()[J](",");for(var U=[],V=0,W=o.length;W>V;V++)U[V]=V%2?p(o[V-1],o[V],n).y:p(o[V],o[V+1],n).x;return U},Ib=function(a,b,c,d,e,f,g,h,i){var j=1-i;return{"x":R(j,3)*a+3*R(j,2)*i*c+3*j*i*i*e+R(i,3)*g,"y":R(j,3)*b+3*R(j,2)*i*d+3*j*i*i*f+R(i,3)*h}},Jb=f(function(a,b,c,d,e,f,g,h){var i,j=e-2*c+a-(g-2*e+c),k=2*(c-a)-2*(e-c),l=a-c,m=(-k+N.sqrt(k*k-4*j*l))/2/j,n=(-k-N.sqrt(k*k-4*j*l))/2/j,o=[b,h],p=[a,g];return Q(m)>"1e12"&&(m=.5),Q(n)>"1e12"&&(n=.5),m>0&&1>m&&(i=Ib(a,b,c,d,e,f,g,h,m),p.push(i.x),o.push(i.y)),n>0&&1>n&&(i=Ib(a,b,c,d,e,f,g,h,n),p.push(i.x),o.push(i.y)),j=f-2*d+b-(h-2*f+d),k=2*(d-b)-2*(f-d),l=b-d,m=(-k+N.sqrt(k*k-4*j*l))/2/j,n=(-k-N.sqrt(k*k-4*j*l))/2/j,Q(m)>"1e12"&&(m=.5),Q(n)>"1e12"&&(n=.5),m>0&&1>m&&(i=Ib(a,b,c,d,e,f,g,h,m),p.push(i.x),o.push(i.y)),n>0&&1>n&&(i=Ib(a,b,c,d,e,f,g,h,n),p.push(i.x),o.push(i.y)),{"min":{"x":P[D](0,p),"y":P[D](0,o)},"max":{"x":O[D](0,p),"y":O[D](0,o)}}}),Kb=c._path2curve=f(function(a,b){var c=!b&&Ab(a);if(!b&&c.curve)return Cb(c.curve);for(var d=Eb(a),e=b&&Eb(b),f={"x":0,"y":0,"bx":0,"by":0,"X":0,"Y":0,"qx":null,"qy":null},g={"x":0,"y":0,"bx":0,"by":0,"X":0,"Y":0,"qx":null,"qy":null},h=(function(a,b,c){var d,e,f={"T":1,"Q":1};if(!a)return["C",b.x,b.y,b.x,b.y,b.x,b.y];switch(!(a[0]in f)&&(b.qx=b.qy=null),a[0]){case"M":b.X=a[1],b.Y=a[2];break;case"A":a=["C"][E](Hb[D](0,[b.x,b.y][E](a.slice(1))));break;case"S":"C"==c||"S"==c?(d=2*b.x-b.bx,e=2*b.y-b.by):(d=b.x,e=b.y),a=["C",d,e][E](a.slice(1));break;case"T":"Q"==c||"T"==c?(b.qx=2*b.x-b.qx,b.qy=2*b.y-b.qy):(b.qx=b.x,b.qy=b.y),a=["C"][E](Gb(b.x,b.y,b.qx,b.qy,a[1],a[2]));break;case"Q":b.qx=a[1],b.qy=a[2],a=["C"][E](Gb(b.x,b.y,a[1],a[2],a[3],a[4]));break;case"L":a=["C"][E](Fb(b.x,b.y,a[1],a[2]));break;case"H":a=["C"][E](Fb(b.x,b.y,a[1],b.y));break;case"V":a=["C"][E](Fb(b.x,b.y,b.x,a[1]));break;case"Z":a=["C"][E](Fb(b.x,b.y,b.X,b.Y))}return a}),i=function(a,b){if(a[b].length>7){a[b].shift();for(var c=a[b];c.length;)a.splice(b++,0,["C"][E](c.splice(0,6)));a.splice(b,1),l=O(d.length,e&&e.length||0)}},j=function(a,b,c,f,g){a&&b&&"M"==a[g][0]&&"M"!=b[g][0]&&(b.splice(g,0,["M",f.x,f.y]),c.bx=0,c.by=0,c.x=a[g][1],c.y=a[g][2],l=O(d.length,e&&e.length||0))},k=0,l=O(d.length,e&&e.length||0);l>k;k++){d[k]=h(d[k],f),i(d,k),e&&(e[k]=h(e[k],g)),e&&i(e,k),j(d,e,f,g,k),j(e,d,g,f,k);var m=d[k],n=e&&e[k],o=m.length,p=e&&n.length;f.x=m[o-2],f.y=m[o-1],f.bx=_(m[o-4])||f.x,f.by=_(m[o-3])||f.y,g.bx=e&&(_(n[p-4])||g.x),g.by=e&&(_(n[p-3])||g.y),g.x=e&&n[p-2],g.y=e&&n[p-1]}return e||(c.curve=Cb(d)),e?[d,e]:d},null,Cb),Lb=(c._parseDots=f(function(a){for(var b=[],d=0,e=a.length;e>d;d++){var f={},g=a[d].match(/^([^:]*):?([\d\.]*)/);if(f.color=c.getRGB(g[1]),f.color.error)return null;f.color=f.color.hex,g[2]&&(f.offset=g[2]+"%"),b.push(f)}for(d=1,e=b.length-1;e>d;d++)if(!b[d].offset){for(var h=_(b[d-1].offset||0),i=0,j=d+1;e>j;j++)if(b[j].offset){i=b[j].offset;break}i||(i=100,j=e),i=_(i);for(var k=(i-h)/(j-d+1);j>d;d++)h+=k,b[d].offset=h+"%"}return b}),c._tear=function(a,b){a==b.top&&(b.top=a.prev),a==b.bottom&&(b.bottom=a.next),a.next&&(a.next.prev=a.prev),a.prev&&(a.prev.next=a.next)}),Mb=(c._tofront=function(a,b){b.top!==a&&(Lb(a,b),a.next=null,a.prev=b.top,b.top.next=a,b.top=a)},c._toback=function(a,b){b.bottom!==a&&(Lb(a,b),a.next=b.bottom,a.prev=null,b.bottom.prev=a,b.bottom=a)},c._insertafter=function(a,b,c){Lb(a,c),b==c.top&&(c.top=a),b.next&&(b.next.prev=a),a.next=b.next,a.prev=b,b.next=a},c._insertbefore=function(a,b,c){Lb(a,c),b==c.bottom&&(c.bottom=a),b.prev&&(b.prev.next=a),a.prev=b.prev,b.prev=a,a.next=b},c.toMatrix=function(a,b){var c=Bb(a),d={"_":{"transform":G},"getBBox":function(){return c}};return Nb(d,b),d.matrix}),Nb=(c.transformPath=function(a,b){return rb(a,Mb(a,b))},c._extractTransform=function(a,b){if(null==b)return a._.transform;b=I(b).replace(/\.{3}|\u2026/g,a._.transform||G);var d=c.parseTransformString(b),e=0,f=0,g=0,h=1,i=1,j=a._,k=new o;if(j.transform=d||[],d)for(var l=0,m=d.length;m>l;l++){var n,p,q,r,s,t=d[l],u=t.length,v=I(t[0]).toLowerCase(),w=t[0]!=v,x=w?k.invert():0;"t"==v&&3==u?w?(n=x.x(0,0),p=x.y(0,0),q=x.x(t[1],t[2]),r=x.y(t[1],t[2]),k.translate(q-n,r-p)):k.translate(t[1],t[2]):"r"==v?2==u?(s=s||a.getBBox(1),k.rotate(t[1],s.x+s.width/2,s.y+s.height/2),e+=t[1]):4==u&&(w?(q=x.x(t[2],t[3]),r=x.y(t[2],t[3]),k.rotate(t[1],q,r)):k.rotate(t[1],t[2],t[3]),e+=t[1]):"s"==v?2==u||3==u?(s=s||a.getBBox(1),k.scale(t[1],t[u-1],s.x+s.width/2,s.y+s.height/2),h*=t[1],i*=t[u-1]):5==u&&(w?(q=x.x(t[3],t[4]),r=x.y(t[3],t[4]),k.scale(t[1],t[2],q,r)):k.scale(t[1],t[2],t[3],t[4]),h*=t[1],i*=t[2]):"m"==v&&7==u&&k.add(t[1],t[2],t[3],t[4],t[5],t[6]),j.dirtyT=1,a.matrix=k}a.matrix=k,j.sx=h,j.sy=i,j.deg=e,j.dx=f=k.e,j.dy=g=k.f,1==h&&1==i&&!e&&j.bbox?(j.bbox.x+=+f,j.bbox.y+=+g):j.dirtyT=1}),Ob=function(a){var b=a[0];switch(b.toLowerCase()){case"t":return[b,0,0];case"m":return[b,1,0,0,1,0,0];case"r":return 4==a.length?[b,0,a[2],a[3]]:[b,0];case"s":return 5==a.length?[b,1,1,a[3],a[4]]:3==a.length?[b,1,1]:[b,1]}},Pb=c._equaliseTransform=function(a,b){b=I(b).replace(/\.{3}|\u2026/g,a),a=c.parseTransformString(a)||[],b=c.parseTransformString(b)||[];for(var d,e,f,g,h=O(a.length,b.length),i=[],j=[],k=0;h>k;k++){if(f=a[k]||Ob(b[k]),g=b[k]||Ob(f),f[0]!=g[0]||"r"==f[0].toLowerCase()&&(f[2]!=g[2]||f[3]!=g[3])||"s"==f[0].toLowerCase()&&(f[3]!=g[3]||f[4]!=g[4]))return;for(i[k]=[],j[k]=[],d=0,e=O(f.length,g.length);e>d;d++)d in f&&(i[k][d]=f[d]),d in g&&(j[k][d]=g[d])}return{"from":i,"to":j}};c._getContainer=function(a,b,d,e){var f;
|
|
return f=null!=e||c.is(a,"object")?a:A.doc.getElementById(a),null!=f?f.tagName?null==b?{"container":f,"width":f.style.pixelWidth||f.offsetWidth,"height":f.style.pixelHeight||f.offsetHeight}:{"container":f,"width":b,"height":d}:{"container":1,"x":a,"y":b,"width":d,"height":e}:void 0},c.pathToRelative=Db,c._engine={},c.path2curve=Kb,c.matrix=function(a,b,c,d,e,f){return new o(a,b,c,d,e,f)},function(a){function b(a){return a[0]*a[0]+a[1]*a[1]}function d(a){var c=N.sqrt(b(a));a[0]&&(a[0]/=c),a[1]&&(a[1]/=c)}a.add=function(a,b,c,d,e,f){var g,h,i,j,k=[[],[],[]],l=[[this.a,this.c,this.e],[this.b,this.d,this.f],[0,0,1]],m=[[a,c,e],[b,d,f],[0,0,1]];for(a&&a instanceof o&&(m=[[a.a,a.c,a.e],[a.b,a.d,a.f],[0,0,1]]),g=0;3>g;g++)for(h=0;3>h;h++){for(j=0,i=0;3>i;i++)j+=l[g][i]*m[i][h];k[g][h]=j}this.a=k[0][0],this.b=k[1][0],this.c=k[0][1],this.d=k[1][1],this.e=k[0][2],this.f=k[1][2]},a.invert=function(){var a=this,b=a.a*a.d-a.b*a.c;return new o(a.d/b,-a.b/b,-a.c/b,a.a/b,(a.c*a.f-a.d*a.e)/b,(a.b*a.e-a.a*a.f)/b)},a.clone=function(){return new o(this.a,this.b,this.c,this.d,this.e,this.f)},a.translate=function(a,b){this.add(1,0,0,1,a,b)},a.scale=function(a,b,c,d){null==b&&(b=a),(c||d)&&this.add(1,0,0,1,c,d),this.add(a,0,0,b,0,0),(c||d)&&this.add(1,0,0,1,-c,-d)},a.rotate=function(a,b,d){a=c.rad(a),b=b||0,d=d||0;var e=+N.cos(a).toFixed(9),f=+N.sin(a).toFixed(9);this.add(e,f,-f,e,b,d),this.add(1,0,0,1,-b,-d)},a.x=function(a,b){return a*this.a+b*this.c+this.e},a.y=function(a,b){return a*this.b+b*this.d+this.f},a.get=function(a){return+this[I.fromCharCode(97+a)].toFixed(4)},a.toString=function(){return c.svg?"matrix("+[this.get(0),this.get(1),this.get(2),this.get(3),this.get(4),this.get(5)].join()+")":[this.get(0),this.get(2),this.get(1),this.get(3),0,0].join()},a.toFilter=function(){return"progid:DXImageTransform.Microsoft.Matrix(M11="+this.get(0)+", M12="+this.get(2)+", M21="+this.get(1)+", M22="+this.get(3)+", Dx="+this.get(4)+", Dy="+this.get(5)+", sizingmethod='auto expand')"},a.offset=function(){return[this.e.toFixed(4),this.f.toFixed(4)]},a.split=function(){var a={};a.dx=this.e,a.dy=this.f;var e=[[this.a,this.c],[this.b,this.d]];a.scalex=N.sqrt(b(e[0])),d(e[0]),a.shear=e[0][0]*e[1][0]+e[0][1]*e[1][1],e[1]=[e[1][0]-e[0][0]*a.shear,e[1][1]-e[0][1]*a.shear],a.scaley=N.sqrt(b(e[1])),d(e[1]),a.shear/=a.scaley;var f=-e[0][1],g=e[1][1];return 0>g?(a.rotate=c.deg(N.acos(g)),0>f&&(a.rotate=360-a.rotate)):a.rotate=c.deg(N.asin(f)),a.isSimple=!(+a.shear.toFixed(9)||a.scalex.toFixed(9)!=a.scaley.toFixed(9)&&a.rotate),a.isSuperSimple=!+a.shear.toFixed(9)&&a.scalex.toFixed(9)==a.scaley.toFixed(9)&&!a.rotate,a.noRotation=!+a.shear.toFixed(9)&&!a.rotate,a},a.toTransformString=function(a){var b=a||this[J]();return b.isSimple?(b.scalex=+b.scalex.toFixed(4),b.scaley=+b.scaley.toFixed(4),b.rotate=+b.rotate.toFixed(4),(b.dx||b.dy?"t"+[b.dx,b.dy]:G)+(1!=b.scalex||1!=b.scaley?"s"+[b.scalex,b.scaley,0,0]:G)+(b.rotate?"r"+[b.rotate,0,0]:G)):"m"+[this.get(0),this.get(1),this.get(2),this.get(3),this.get(4),this.get(5)]}}(o.prototype);var Qb=navigator.userAgent.match(/Version\/(.*?)\s/)||navigator.userAgent.match(/Chrome\/(\d+)/);v.safari="Apple Computer, Inc."==navigator.vendor&&(Qb&&Qb[1]<4||"iP"==navigator.platform.slice(0,2))||"Google Inc."==navigator.vendor&&Qb&&Qb[1]<8?function(){var a=this.rect(-99,-99,this.width+99,this.height+99).attr({"stroke":"none"});setTimeout(function(){a.remove()})}:mb;for(var Rb=function(){this.returnValue=!1},Sb=function(){return this.originalEvent.preventDefault()},Tb=function(){this.cancelBubble=!0},Ub=function(){return this.originalEvent.stopPropagation()},Vb=function(a){var b=A.doc.documentElement.scrollTop||A.doc.body.scrollTop,c=A.doc.documentElement.scrollLeft||A.doc.body.scrollLeft;return{"x":a.clientX+c,"y":a.clientY+b}},Wb=function(){return A.doc.addEventListener?function(a,b,c,d){var e=function(a){var b=Vb(a);return c.call(d,a,b.x,b.y)};if(a.addEventListener(b,e,!1),F&&L[b]){var f=function(b){for(var e=Vb(b),f=b,g=0,h=b.targetTouches&&b.targetTouches.length;h>g;g++)if(b.targetTouches[g].target==a){b=b.targetTouches[g],b.originalEvent=f,b.preventDefault=Sb,b.stopPropagation=Ub;break}return c.call(d,b,e.x,e.y)};a.addEventListener(L[b],f,!1)}return function(){return a.removeEventListener(b,e,!1),F&&L[b]&&a.removeEventListener(L[b],e,!1),!0}}:A.doc.attachEvent?function(a,b,c,d){var e=function(a){a=a||A.win.event;var b=A.doc.documentElement.scrollTop||A.doc.body.scrollTop,e=A.doc.documentElement.scrollLeft||A.doc.body.scrollLeft,f=a.clientX+e,g=a.clientY+b;return a.preventDefault=a.preventDefault||Rb,a.stopPropagation=a.stopPropagation||Tb,c.call(d,a,f,g)};a.attachEvent("on"+b,e);var f=function(){return a.detachEvent("on"+b,e),!0};return f}:void 0}(),Xb=[],Yb=function(a){for(var c,d=a.clientX,e=a.clientY,f=A.doc.documentElement.scrollTop||A.doc.body.scrollTop,g=A.doc.documentElement.scrollLeft||A.doc.body.scrollLeft,h=Xb.length;h--;){if(c=Xb[h],F&&a.touches){for(var i,j=a.touches.length;j--;)if(i=a.touches[j],i.identifier==c.el._drag.id){d=i.clientX,e=i.clientY,(a.originalEvent?a.originalEvent:a).preventDefault();break}}else a.preventDefault();var k,l=c.el.node,m=l.nextSibling,n=l.parentNode,o=l.style.display;A.win.opera&&n.removeChild(l),l.style.display="none",k=c.el.paper.getElementByPoint(d,e),l.style.display=o,A.win.opera&&(m?n.insertBefore(l,m):n.appendChild(l)),k&&b("raphael.drag.over."+c.el.id,c.el,k),d+=g,e+=f,b("raphael.drag.move."+c.el.id,c.move_scope||c.el,d-c.el._drag.x,e-c.el._drag.y,d,e,a)}},Zb=function(a){c.unmousemove(Yb).unmouseup(Zb);for(var d,e=Xb.length;e--;)d=Xb[e],d.el._drag={},b("raphael.drag.end."+d.el.id,d.end_scope||d.start_scope||d.move_scope||d.el,a);Xb=[]},$b=c.el={},_b=K.length;_b--;)!function(a){c[a]=$b[a]=function(b,d){return c.is(b,"function")&&(this.events=this.events||[],this.events.push({"name":a,"f":b,"unbind":Wb(this.shape||this.node||A.doc,a,b,d||this)})),this},c["un"+a]=$b["un"+a]=function(b){for(var d=this.events||[],e=d.length;e--;)d[e].name!=a||!c.is(b,"undefined")&&d[e].f!=b||(d[e].unbind(),d.splice(e,1),!d.length&&delete this.events);return this}}(K[_b]);$b.data=function(a,d){var e=kb[this.id]=kb[this.id]||{};if(0==arguments.length)return e;if(1==arguments.length){if(c.is(a,"object")){for(var f in a)a[z](f)&&this.data(f,a[f]);return this}return b("raphael.data.get."+this.id,this,e[a],a),e[a]}return e[a]=d,b("raphael.data.set."+this.id,this,d,a),this},$b.removeData=function(a){return null==a?kb[this.id]={}:kb[this.id]&&delete kb[this.id][a],this},$b.getData=function(){return d(kb[this.id]||{})},$b.hover=function(a,b,c,d){return this.mouseover(a,c).mouseout(b,d||c)},$b.unhover=function(a,b){return this.unmouseover(a).unmouseout(b)};var ac=[];$b.drag=function(a,d,e,f,g,h){function i(i){(i.originalEvent||i).preventDefault();var j=i.clientX,k=i.clientY,l=A.doc.documentElement.scrollTop||A.doc.body.scrollTop,m=A.doc.documentElement.scrollLeft||A.doc.body.scrollLeft;if(this._drag.id=i.identifier,F&&i.touches)for(var n,o=i.touches.length;o--;)if(n=i.touches[o],this._drag.id=n.identifier,n.identifier==this._drag.id){j=n.clientX,k=n.clientY;break}this._drag.x=j+m,this._drag.y=k+l,!Xb.length&&c.mousemove(Yb).mouseup(Zb),Xb.push({"el":this,"move_scope":f,"start_scope":g,"end_scope":h}),d&&b.on("raphael.drag.start."+this.id,d),a&&b.on("raphael.drag.move."+this.id,a),e&&b.on("raphael.drag.end."+this.id,e),b("raphael.drag.start."+this.id,g||f||this,i.clientX+m,i.clientY+l,i)}return this._drag={},ac.push({"el":this,"start":i}),this.mousedown(i),this},$b.onDragOver=function(a){a?b.on("raphael.drag.over."+this.id,a):b.unbind("raphael.drag.over."+this.id)},$b.undrag=function(){for(var a=ac.length;a--;)ac[a].el==this&&(this.unmousedown(ac[a].start),ac.splice(a,1),b.unbind("raphael.drag.*."+this.id));!ac.length&&c.unmousemove(Yb).unmouseup(Zb),Xb=[]},v.circle=function(a,b,d){var e=c._engine.circle(this,a||0,b||0,d||0);return this.__set__&&this.__set__.push(e),e},v.rect=function(a,b,d,e,f){var g=c._engine.rect(this,a||0,b||0,d||0,e||0,f||0);return this.__set__&&this.__set__.push(g),g},v.ellipse=function(a,b,d,e){var f=c._engine.ellipse(this,a||0,b||0,d||0,e||0);return this.__set__&&this.__set__.push(f),f},v.path=function(a){a&&!c.is(a,U)&&!c.is(a[0],V)&&(a+=G);var b=c._engine.path(c.format[D](c,arguments),this);return this.__set__&&this.__set__.push(b),b},v.image=function(a,b,d,e,f){var g=c._engine.image(this,a||"about:blank",b||0,d||0,e||0,f||0);return this.__set__&&this.__set__.push(g),g},v.text=function(a,b,d){var e=c._engine.text(this,a||0,b||0,I(d));return this.__set__&&this.__set__.push(e),e},v.set=function(a){!c.is(a,"array")&&(a=Array.prototype.splice.call(arguments,0,arguments.length));var b=new mc(a);return this.__set__&&this.__set__.push(b),b.paper=this,b.type="set",b},v.setStart=function(a){this.__set__=a||this.set()},v.setFinish=function(){var a=this.__set__;return delete this.__set__,a},v.setSize=function(a,b){return c._engine.setSize.call(this,a,b)},v.setViewBox=function(a,b,d,e,f){return c._engine.setViewBox.call(this,a,b,d,e,f)},v.top=v.bottom=null,v.raphael=c;var bc=function(a){var b=a.getBoundingClientRect(),c=a.ownerDocument,d=c.body,e=c.documentElement,f=e.clientTop||d.clientTop||0,g=e.clientLeft||d.clientLeft||0,h=b.top+(A.win.pageYOffset||e.scrollTop||d.scrollTop)-f,i=b.left+(A.win.pageXOffset||e.scrollLeft||d.scrollLeft)-g;return{"y":h,"x":i}};v.getElementByPoint=function(a,b){var c=this,d=c.canvas,e=A.doc.elementFromPoint(a,b);if(A.win.opera&&"svg"==e.tagName){var f=bc(d),g=d.createSVGRect();g.x=a-f.x,g.y=b-f.y,g.width=g.height=1;var h=d.getIntersectionList(g,null);h.length&&(e=h[h.length-1])}if(!e)return null;for(;e.parentNode&&e!=d.parentNode&&!e.raphael;)e=e.parentNode;return e==c.canvas.parentNode&&(e=d),e=e&&e.raphael?c.getById(e.raphaelid):null},v.getElementsByBBox=function(a){var b=this.set();return this.forEach(function(d){c.isBBoxIntersect(d.getBBox(),a)&&b.push(d)}),b},v.getById=function(a){for(var b=this.bottom;b;){if(b.id==a)return b;b=b.next}return null},v.forEach=function(a,b){for(var c=this.bottom;c;){if(a.call(b,c)===!1)return this;c=c.next}return this},v.getElementsByPoint=function(a,b){var c=this.set();return this.forEach(function(d){d.isPointInside(a,b)&&c.push(d)}),c},$b.isPointInside=function(a,b){var d=this.realPath=qb[this.type](this);return this.attr("transform")&&this.attr("transform").length&&(d=c.transformPath(d,this.attr("transform"))),c.isPointInsidePath(d,a,b)},$b.getBBox=function(a){if(this.removed)return{};var b=this._;return a?((b.dirty||!b.bboxwt)&&(this.realPath=qb[this.type](this),b.bboxwt=Bb(this.realPath),b.bboxwt.toString=p,b.dirty=0),b.bboxwt):((b.dirty||b.dirtyT||!b.bbox)&&((b.dirty||!this.realPath)&&(b.bboxwt=0,this.realPath=qb[this.type](this)),b.bbox=Bb(rb(this.realPath,this.matrix)),b.bbox.toString=p,b.dirty=b.dirtyT=0),b.bbox)},$b.clone=function(){if(this.removed)return null;var a=this.paper[this.type]().attr(this.attr());return this.__set__&&this.__set__.push(a),a},$b.glow=function(a){if("text"==this.type)return null;a=a||{};var b={"width":(a.width||10)+(+this.attr("stroke-width")||1),"fill":a.fill||!1,"opacity":a.opacity||.5,"offsetx":a.offsetx||0,"offsety":a.offsety||0,"color":a.color||"#000"},c=b.width/2,d=this.paper,e=d.set(),f=this.realPath||qb[this.type](this);f=this.matrix?rb(f,this.matrix):f;for(var g=1;c+1>g;g++)e.push(d.path(f).attr({"stroke":b.color,"fill":b.fill?b.color:"none","stroke-linejoin":"round","stroke-linecap":"round","stroke-width":+(b.width/c*g).toFixed(3),"opacity":+(b.opacity/c).toFixed(3)}));return e.insertBefore(this).translate(b.offsetx,b.offsety)};var cc=function(a,b,d,e,f,g,h,i,l){return null==l?j(a,b,d,e,f,g,h,i):c.findDotsAtSegment(a,b,d,e,f,g,h,i,k(a,b,d,e,f,g,h,i,l))},dc=function(a,b){return function(d,e,f){d=Kb(d);for(var g,h,i,j,k,l="",m={},n=0,o=0,p=d.length;p>o;o++){if(i=d[o],"M"==i[0])g=+i[1],h=+i[2];else{if(j=cc(g,h,i[1],i[2],i[3],i[4],i[5],i[6]),n+j>e){if(b&&!m.start){if(k=cc(g,h,i[1],i[2],i[3],i[4],i[5],i[6],e-n),l+=["C"+k.start.x,k.start.y,k.m.x,k.m.y,k.x,k.y],f)return l;m.start=l,l=["M"+k.x,k.y+"C"+k.n.x,k.n.y,k.end.x,k.end.y,i[5],i[6]].join(),n+=j,g=+i[5],h=+i[6];continue}if(!a&&!b)return k=cc(g,h,i[1],i[2],i[3],i[4],i[5],i[6],e-n),{"x":k.x,"y":k.y,"alpha":k.alpha}}n+=j,g=+i[5],h=+i[6]}l+=i.shift()+i}return m.end=l,k=a?n:b?m:c.findDotsAtSegment(g,h,i[0],i[1],i[2],i[3],i[4],i[5],1),k.alpha&&(k={"x":k.x,"y":k.y,"alpha":k.alpha}),k}},ec=dc(1),fc=dc(),gc=dc(0,1);c.getTotalLength=ec,c.getPointAtLength=fc,c.getSubpath=function(a,b,c){if(this.getTotalLength(a)-c<1e-6)return gc(a,b).end;var d=gc(a,c,1);return b?gc(d,b).end:d},$b.getTotalLength=function(){var a=this.getPath();return a?this.node.getTotalLength?this.node.getTotalLength():ec(a):void 0},$b.getPointAtLength=function(a){var b=this.getPath();return b?fc(b,a):void 0},$b.getPath=function(){var a,b=c._getPath[this.type];return"text"!=this.type&&"set"!=this.type?(b&&(a=b(this)),a):void 0},$b.getSubpath=function(a,b){var d=this.getPath();return d?c.getSubpath(d,a,b):void 0};var hc=c.easing_formulas={"linear":function(a){return a},"<":function(a){return R(a,1.7)},">":function(a){return R(a,.48)},"<>":function(a){var b=.48-a/1.04,c=N.sqrt(.1734+b*b),d=c-b,e=R(Q(d),1/3)*(0>d?-1:1),f=-c-b,g=R(Q(f),1/3)*(0>f?-1:1),h=e+g+.5;return 3*(1-h)*h*h+h*h*h},"backIn":function(a){var b=1.70158;return a*a*((b+1)*a-b)},"backOut":function(a){a-=1;var b=1.70158;return a*a*((b+1)*a+b)+1},"elastic":function(a){return a==!!a?a:R(2,-10*a)*N.sin(2*(a-.075)*S/.3)+1},"bounce":function(a){var b,c=7.5625,d=2.75;return 1/d>a?b=c*a*a:2/d>a?(a-=1.5/d,b=c*a*a+.75):2.5/d>a?(a-=2.25/d,b=c*a*a+.9375):(a-=2.625/d,b=c*a*a+.984375),b}};hc.easeIn=hc["ease-in"]=hc["<"],hc.easeOut=hc["ease-out"]=hc[">"],hc.easeInOut=hc["ease-in-out"]=hc["<>"],hc["back-in"]=hc.backIn,hc["back-out"]=hc.backOut;var ic=[],jc=a.requestAnimationFrame||a.webkitRequestAnimationFrame||a.mozRequestAnimationFrame||a.oRequestAnimationFrame||a.msRequestAnimationFrame||function(a){setTimeout(a,16)},kc=function(){for(var a=+new Date,d=0;d<ic.length;d++){var e=ic[d];if(!e.el.removed&&!e.paused){var f,g,h=a-e.start,i=e.ms,j=e.easing,k=e.from,l=e.diff,m=e.to,n=(e.t,e.el),o={},p={};if(e.initstatus?(h=(e.initstatus*e.anim.top-e.prev)/(e.percent-e.prev)*i,e.status=e.initstatus,delete e.initstatus,e.stop&&ic.splice(d--,1)):e.status=(e.prev+(e.percent-e.prev)*(h/i))/e.anim.top,!(0>h))if(i>h){var q=j(h/i);for(var r in k)if(k[z](r)){switch(db[r]){case T:f=+k[r]+q*i*l[r];break;case"colour":f="rgb("+[lc($(k[r].r+q*i*l[r].r)),lc($(k[r].g+q*i*l[r].g)),lc($(k[r].b+q*i*l[r].b))].join(",")+")";break;case"path":f=[];for(var t=0,u=k[r].length;u>t;t++){f[t]=[k[r][t][0]];for(var v=1,w=k[r][t].length;w>v;v++)f[t][v]=+k[r][t][v]+q*i*l[r][t][v];f[t]=f[t].join(H)}f=f.join(H);break;case"transform":if(l[r].real)for(f=[],t=0,u=k[r].length;u>t;t++)for(f[t]=[k[r][t][0]],v=1,w=k[r][t].length;w>v;v++)f[t][v]=k[r][t][v]+q*i*l[r][t][v];else{var x=function(a){return+k[r][a]+q*i*l[r][a]};f=[["m",x(0),x(1),x(2),x(3),x(4),x(5)]]}break;case"csv":if("clip-rect"==r)for(f=[],t=4;t--;)f[t]=+k[r][t]+q*i*l[r][t];break;default:var y=[][E](k[r]);for(f=[],t=n.paper.customAttributes[r].length;t--;)f[t]=+y[t]+q*i*l[r][t]}o[r]=f}n.attr(o),function(a,c,d){setTimeout(function(){b("raphael.anim.frame."+a,c,d)})}(n.id,n,e.anim)}else{if(function(a,d,e){setTimeout(function(){b("raphael.anim.frame."+d.id,d,e),b("raphael.anim.finish."+d.id,d,e),c.is(a,"function")&&a.call(d)})}(e.callback,n,e.anim),n.attr(m),ic.splice(d--,1),e.repeat>1&&!e.next){for(g in m)m[z](g)&&(p[g]=e.totalOrigin[g]);e.el.attr(p),s(e.anim,e.el,e.anim.percents[0],null,e.totalOrigin,e.repeat-1)}e.next&&!e.stop&&s(e.anim,e.el,e.next,null,e.totalOrigin,e.repeat)}}}c.svg&&n&&n.paper&&n.paper.safari(),ic.length&&jc(kc)},lc=function(a){return a>255?255:0>a?0:a};$b.animateWith=function(a,b,d,e,f,g){var h=this;if(h.removed)return g&&g.call(h),h;var i=d instanceof r?d:c.animation(d,e,f,g);s(i,h,i.percents[0],null,h.attr());for(var j=0,k=ic.length;k>j;j++)if(ic[j].anim==b&&ic[j].el==a){ic[k-1].start=ic[j].start;break}return h},$b.onAnimation=function(a){return a?b.on("raphael.anim.frame."+this.id,a):b.unbind("raphael.anim.frame."+this.id),this},r.prototype.delay=function(a){var b=new r(this.anim,this.ms);return b.times=this.times,b.del=+a||0,b},r.prototype.repeat=function(a){var b=new r(this.anim,this.ms);return b.del=this.del,b.times=N.floor(O(a,0))||1,b},c.animation=function(a,b,d,e){if(a instanceof r)return a;(c.is(d,"function")||!d)&&(e=e||d||null,d=null),a=Object(a),b=+b||0;var f,g,h={};for(g in a)a[z](g)&&_(g)!=g&&_(g)+"%"!=g&&(f=!0,h[g]=a[g]);return f?(d&&(h.easing=d),e&&(h.callback=e),new r({"100":h},b)):new r(a,b)},$b.animate=function(a,b,d,e){var f=this;if(f.removed)return e&&e.call(f),f;var g=a instanceof r?a:c.animation(a,b,d,e);return s(g,f,g.percents[0],null,f.attr()),f},$b.setTime=function(a,b){return a&&null!=b&&this.status(a,P(b,a.ms)/a.ms),this},$b.status=function(a,b){var c,d,e=[],f=0;if(null!=b)return s(a,this,-1,P(b,1)),this;for(c=ic.length;c>f;f++)if(d=ic[f],d.el.id==this.id&&(!a||d.anim==a)){if(a)return d.status;e.push({"anim":d.anim,"status":d.status})}return a?0:e},$b.pause=function(a){for(var c=0;c<ic.length;c++)ic[c].el.id!=this.id||a&&ic[c].anim!=a||b("raphael.anim.pause."+this.id,this,ic[c].anim)!==!1&&(ic[c].paused=!0);return this},$b.resume=function(a){for(var c=0;c<ic.length;c++)if(ic[c].el.id==this.id&&(!a||ic[c].anim==a)){var d=ic[c];b("raphael.anim.resume."+this.id,this,d.anim)!==!1&&(delete d.paused,this.status(d.anim,d.status))}return this},$b.stop=function(a){for(var c=0;c<ic.length;c++)ic[c].el.id!=this.id||a&&ic[c].anim!=a||b("raphael.anim.stop."+this.id,this,ic[c].anim)!==!1&&ic.splice(c--,1);return this},b.on("raphael.remove",t),b.on("raphael.clear",t),$b.toString=function(){return"Rapha\xebl\u2019s object"};var mc=function(a){if(this.items=[],this.length=0,this.type="set",a)for(var b=0,c=a.length;c>b;b++)!a[b]||a[b].constructor!=$b.constructor&&a[b].constructor!=mc||(this[this.items.length]=this.items[this.items.length]=a[b],this.length++)},nc=mc.prototype;nc.push=function(){for(var a,b,c=0,d=arguments.length;d>c;c++)a=arguments[c],!a||a.constructor!=$b.constructor&&a.constructor!=mc||(b=this.items.length,this[b]=this.items[b]=a,this.length++);return this},nc.pop=function(){return this.length&&delete this[this.length--],this.items.pop()},nc.forEach=function(a,b){for(var c=0,d=this.items.length;d>c;c++)if(a.call(b,this.items[c],c)===!1)return this;return this};for(var oc in $b)$b[z](oc)&&(nc[oc]=function(a){return function(){var b=arguments;return this.forEach(function(c){c[a][D](c,b)})}}(oc));return nc.attr=function(a,b){if(a&&c.is(a,V)&&c.is(a[0],"object"))for(var d=0,e=a.length;e>d;d++)this.items[d].attr(a[d]);else for(var f=0,g=this.items.length;g>f;f++)this.items[f].attr(a,b);return this},nc.clear=function(){for(;this.length;)this.pop()},nc.splice=function(a,b){a=0>a?O(this.length+a,0):a,b=O(0,P(this.length-a,b));var c,d=[],e=[],f=[];for(c=2;c<arguments.length;c++)f.push(arguments[c]);for(c=0;b>c;c++)e.push(this[a+c]);for(;c<this.length-a;c++)d.push(this[a+c]);var g=f.length;for(c=0;c<g+d.length;c++)this.items[a+c]=this[a+c]=g>c?f[c]:d[c-g];for(c=this.items.length=this.length-=b-g;this[c];)delete this[c++];return new mc(e)},nc.exclude=function(a){for(var b=0,c=this.length;c>b;b++)if(this[b]==a)return this.splice(b,1),!0},nc.animate=function(a,b,d,e){(c.is(d,"function")||!d)&&(e=d||null);var f,g,h=this.items.length,i=h,j=this;if(!h)return this;e&&(g=function(){!--h&&e.call(j)}),d=c.is(d,U)?d:g;var k=c.animation(a,b,d,g);for(f=this.items[--i].animate(k);i--;)this.items[i]&&!this.items[i].removed&&this.items[i].animateWith(f,k,k),this.items[i]&&!this.items[i].removed||h--;return this},nc.insertAfter=function(a){for(var b=this.items.length;b--;)this.items[b].insertAfter(a);return this},nc.getBBox=function(){for(var a=[],b=[],c=[],d=[],e=this.items.length;e--;)if(!this.items[e].removed){var f=this.items[e].getBBox();a.push(f.x),b.push(f.y),c.push(f.x+f.width),d.push(f.y+f.height)}return a=P[D](0,a),b=P[D](0,b),c=O[D](0,c),d=O[D](0,d),{"x":a,"y":b,"x2":c,"y2":d,"width":c-a,"height":d-b}},nc.clone=function(a){a=this.paper.set();for(var b=0,c=this.items.length;c>b;b++)a.push(this.items[b].clone());return a},nc.toString=function(){return"Rapha\xebl\u2018s set"},nc.glow=function(a){var b=this.paper.set();return this.forEach(function(c){var d=c.glow(a);null!=d&&d.forEach(function(a){b.push(a)})}),b},nc.isPointInside=function(a,b){var c=!1;return this.forEach(function(d){return d.isPointInside(a,b)?(c=!0,!1):void 0}),c},c.registerFont=function(a){if(!a.face)return a;this.fonts=this.fonts||{};var b={"w":a.w,"face":{},"glyphs":{}},c=a.face["font-family"];for(var d in a.face)a.face[z](d)&&(b.face[d]=a.face[d]);if(this.fonts[c]?this.fonts[c].push(b):this.fonts[c]=[b],!a.svg){b.face["units-per-em"]=ab(a.face["units-per-em"],10);for(var e in a.glyphs)if(a.glyphs[z](e)){var f=a.glyphs[e];if(b.glyphs[e]={"w":f.w,"k":{},"d":f.d&&"M"+f.d.replace(/[mlcxtrv]/g,function(a){return{"l":"L","c":"C","x":"z","t":"m","r":"l","v":"c"}[a]||"M"})+"z"},f.k)for(var g in f.k)f[z](g)&&(b.glyphs[e].k[g]=f.k[g])}}return a},v.getFont=function(a,b,d,e){if(e=e||"normal",d=d||"normal",b=+b||{"normal":400,"bold":700,"lighter":300,"bolder":800}[b]||400,c.fonts){var f=c.fonts[a];if(!f){var g=new RegExp("(^|\\s)"+a.replace(/[^\w\d\s+!~.:_-]/g,G)+"(\\s|$)","i");for(var h in c.fonts)if(c.fonts[z](h)&&g.test(h)){f=c.fonts[h];break}}var i;if(f)for(var j=0,k=f.length;k>j&&(i=f[j],i.face["font-weight"]!=b||i.face["font-style"]!=d&&i.face["font-style"]||i.face["font-stretch"]!=e);j++);return i}},v.print=function(a,b,d,e,f,g,h,i){g=g||"middle",h=O(P(h||0,1),-1),i=O(P(i||1,3),1);var j,k=I(d)[J](G),l=0,m=0,n=G;if(c.is(e,"string")&&(e=this.getFont(e)),e){j=(f||16)/e.face["units-per-em"];for(var o=e.face.bbox[J](w),p=+o[0],q=o[3]-o[1],r=0,s=+o[1]+("baseline"==g?q+ +e.face.descent:q/2),t=0,u=k.length;u>t;t++){if("\n"==k[t])l=0,x=0,m=0,r+=q*i;else{var v=m&&e.glyphs[k[t-1]]||{},x=e.glyphs[k[t]];l+=m?(v.w||e.w)+(v.k&&v.k[k[t]]||0)+e.w*h:0,m=1}x&&x.d&&(n+=c.transformPath(x.d,["t",l*j,r*j,"s",j,j,p,s,"t",(a-p)/j,(b-s)/j]))}}return this.path(n).attr({"fill":"#000","stroke":"none"})},v.add=function(a){if(c.is(a,"array"))for(var b,d=this.set(),e=0,f=a.length;f>e;e++)b=a[e]||{},x[z](b.type)&&d.push(this[b.type]().attr(b));return d},c.format=function(a,b){var d=c.is(b,V)?[0][E](b):arguments;return a&&c.is(a,U)&&d.length-1&&(a=a.replace(y,function(a,b){return null==d[++b]?G:d[b]})),a||G},c.fullfill=function(){var a=/\{([^\}]+)\}/g,b=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g,c=function(a,c,d){var e=d;return c.replace(b,function(a,b,c,d,f){b=b||d,e&&(b in e&&(e=e[b]),"function"==typeof e&&f&&(e=e()))}),e=(null==e||e==d?a:e)+""};return function(b,d){return String(b).replace(a,function(a,b){return c(a,b,d)})}}(),c.ninja=function(){return B.was?A.win.Raphael=B.is:delete Raphael,c},c.st=nc,function(a,b,d){function e(){/in/.test(a.readyState)?setTimeout(e,9):c.eve("raphael.DOMload")}null==a.readyState&&a.addEventListener&&(a.addEventListener(b,d=function(){a.removeEventListener(b,d,!1),a.readyState="complete"},!1),a.readyState="loading"),e()}(document,"DOMContentLoaded"),b.on("raphael.DOMload",function(){u=!0}),function(){if(c.svg){var a="hasOwnProperty",b=String,d=parseFloat,e=parseInt,f=Math,g=f.max,h=f.abs,i=f.pow,j=/[, ]+/,k=c.eve,l="",m=" ",n="http://www.w3.org/1999/xlink",o={"block":"M5,0 0,2.5 5,5z","classic":"M5,0 0,2.5 5,5 3.5,3 3.5,2z","diamond":"M2.5,0 5,2.5 2.5,5 0,2.5z","open":"M6,1 1,3.5 6,6","oval":"M2.5,0A2.5,2.5,0,0,1,2.5,5 2.5,2.5,0,0,1,2.5,0z"},p={};c.toString=function(){return"Your browser supports SVG.\nYou are running Rapha\xebl "+this.version};var q=function(d,e){if(e){"string"==typeof d&&(d=q(d));for(var f in e)e[a](f)&&("xlink:"==f.substring(0,6)?d.setAttributeNS(n,f.substring(6),b(e[f])):d.setAttribute(f,b(e[f])))}else d=c._g.doc.createElementNS("http://www.w3.org/2000/svg",d),d.style&&(d.style.webkitTapHighlightColor="rgba(0,0,0,0)");return d},r=function(a,e){var j="linear",k=a.id+e,m=.5,n=.5,o=a.node,p=a.paper,r=o.style,s=c._g.doc.getElementById(k);if(!s){if(e=b(e).replace(c._radial_gradient,function(a,b,c){if(j="radial",b&&c){m=d(b),n=d(c);var e=2*(n>.5)-1;i(m-.5,2)+i(n-.5,2)>.25&&(n=f.sqrt(.25-i(m-.5,2))*e+.5)&&.5!=n&&(n=n.toFixed(5)-1e-5*e)}return l}),e=e.split(/\s*\-\s*/),"linear"==j){var t=e.shift();if(t=-d(t),isNaN(t))return null;var u=[0,0,f.cos(c.rad(t)),f.sin(c.rad(t))],v=1/(g(h(u[2]),h(u[3]))||1);u[2]*=v,u[3]*=v,u[2]<0&&(u[0]=-u[2],u[2]=0),u[3]<0&&(u[1]=-u[3],u[3]=0)}var w=c._parseDots(e);if(!w)return null;if(k=k.replace(/[\(\)\s,\xb0#]/g,"_"),a.gradient&&k!=a.gradient.id&&(p.defs.removeChild(a.gradient),delete a.gradient),!a.gradient){s=q(j+"Gradient",{"id":k}),a.gradient=s,q(s,"radial"==j?{"fx":m,"fy":n}:{"x1":u[0],"y1":u[1],"x2":u[2],"y2":u[3],"gradientTransform":a.matrix.invert()}),p.defs.appendChild(s);for(var x=0,y=w.length;y>x;x++)s.appendChild(q("stop",{"offset":w[x].offset?w[x].offset:x?"100%":"0%","stop-color":w[x].color||"#fff"}))}}return q(o,{"fill":"url(#"+k+")","opacity":1,"fill-opacity":1}),r.fill=l,r.opacity=1,r.fillOpacity=1,1},s=function(a){var b=a.getBBox(1);q(a.pattern,{"patternTransform":a.matrix.invert()+" translate("+b.x+","+b.y+")"})},t=function(d,e,f){if("path"==d.type){for(var g,h,i,j,k,m=b(e).toLowerCase().split("-"),n=d.paper,r=f?"end":"start",s=d.node,t=d.attrs,u=t["stroke-width"],v=m.length,w="classic",x=3,y=3,z=5;v--;)switch(m[v]){case"block":case"classic":case"oval":case"diamond":case"open":case"none":w=m[v];break;case"wide":y=5;break;case"narrow":y=2;break;case"long":x=5;break;case"short":x=2}if("open"==w?(x+=2,y+=2,z+=2,i=1,j=f?4:1,k={"fill":"none","stroke":t.stroke}):(j=i=x/2,k={"fill":t.stroke,"stroke":"none"}),d._.arrows?f?(d._.arrows.endPath&&p[d._.arrows.endPath]--,d._.arrows.endMarker&&p[d._.arrows.endMarker]--):(d._.arrows.startPath&&p[d._.arrows.startPath]--,d._.arrows.startMarker&&p[d._.arrows.startMarker]--):d._.arrows={},"none"!=w){var A="raphael-marker-"+w,B="raphael-marker-"+r+w+x+y;c._g.doc.getElementById(A)?p[A]++:(n.defs.appendChild(q(q("path"),{"stroke-linecap":"round","d":o[w],"id":A})),p[A]=1);var C,D=c._g.doc.getElementById(B);D?(p[B]++,C=D.getElementsByTagName("use")[0]):(D=q(q("marker"),{"id":B,"markerHeight":y,"markerWidth":x,"orient":"auto","refX":j,"refY":y/2}),C=q(q("use"),{"xlink:href":"#"+A,"transform":(f?"rotate(180 "+x/2+" "+y/2+") ":l)+"scale("+x/z+","+y/z+")","stroke-width":(1/((x/z+y/z)/2)).toFixed(4)}),D.appendChild(C),n.defs.appendChild(D),p[B]=1),q(C,k);var E=i*("diamond"!=w&&"oval"!=w);f?(g=d._.arrows.startdx*u||0,h=c.getTotalLength(t.path)-E*u):(g=E*u,h=c.getTotalLength(t.path)-(d._.arrows.enddx*u||0)),k={},k["marker-"+r]="url(#"+B+")",(h||g)&&(k.d=c.getSubpath(t.path,g,h)),q(s,k),d._.arrows[r+"Path"]=A,d._.arrows[r+"Marker"]=B,d._.arrows[r+"dx"]=E,d._.arrows[r+"Type"]=w,d._.arrows[r+"String"]=e}else f?(g=d._.arrows.startdx*u||0,h=c.getTotalLength(t.path)-g):(g=0,h=c.getTotalLength(t.path)-(d._.arrows.enddx*u||0)),d._.arrows[r+"Path"]&&q(s,{"d":c.getSubpath(t.path,g,h)}),delete d._.arrows[r+"Path"],delete d._.arrows[r+"Marker"],delete d._.arrows[r+"dx"],delete d._.arrows[r+"Type"],delete d._.arrows[r+"String"];for(k in p)if(p[a](k)&&!p[k]){var F=c._g.doc.getElementById(k);F&&F.parentNode.removeChild(F)}}},u={"":[0],"none":[0],"-":[3,1],".":[1,1],"-.":[3,1,1,1],"-..":[3,1,1,1,1,1],". ":[1,3],"- ":[4,3],"--":[8,3],"- .":[4,3,1,3],"--.":[8,3,1,3],"--..":[8,3,1,3,1,3]},v=function(a,c,d){if(c=u[b(c).toLowerCase()]){for(var e=a.attrs["stroke-width"]||"1",f={"round":e,"square":e,"butt":0}[a.attrs["stroke-linecap"]||d["stroke-linecap"]]||0,g=[],h=c.length;h--;)g[h]=c[h]*e+(h%2?1:-1)*f;q(a.node,{"stroke-dasharray":g.join(",")})}},w=function(d,f){var i=d.node,k=d.attrs,m=i.style.visibility;i.style.visibility="hidden";for(var o in f)if(f[a](o)){if(!c._availableAttrs[a](o))continue;var p=f[o];switch(k[o]=p,o){case"blur":d.blur(p);break;case"href":case"title":var u=q("title"),w=c._g.doc.createTextNode(p);u.appendChild(w),i.appendChild(u);break;case"target":var x=i.parentNode;if("a"!=x.tagName.toLowerCase()){var u=q("a");x.insertBefore(u,i),u.appendChild(i),x=u}"target"==o?x.setAttributeNS(n,"show","blank"==p?"new":p):x.setAttributeNS(n,o,p);break;case"cursor":i.style.cursor=p;break;case"transform":d.transform(p);break;case"arrow-start":t(d,p);break;case"arrow-end":t(d,p,1);break;case"clip-rect":var z=b(p).split(j);if(4==z.length){d.clip&&d.clip.parentNode.parentNode.removeChild(d.clip.parentNode);var A=q("clipPath"),B=q("rect");A.id=c.createUUID(),q(B,{"x":z[0],"y":z[1],"width":z[2],"height":z[3]}),A.appendChild(B),d.paper.defs.appendChild(A),q(i,{"clip-path":"url(#"+A.id+")"}),d.clip=B}if(!p){var C=i.getAttribute("clip-path");if(C){var D=c._g.doc.getElementById(C.replace(/(^url\(#|\)$)/g,l));D&&D.parentNode.removeChild(D),q(i,{"clip-path":l}),delete d.clip}}break;case"path":"path"==d.type&&(q(i,{"d":p?k.path=c._pathToAbsolute(p):"M0,0"}),d._.dirty=1,d._.arrows&&("startString"in d._.arrows&&t(d,d._.arrows.startString),"endString"in d._.arrows&&t(d,d._.arrows.endString,1)));break;case"width":if(i.setAttribute(o,p),d._.dirty=1,!k.fx)break;o="x",p=k.x;case"x":k.fx&&(p=-k.x-(k.width||0));case"rx":if("rx"==o&&"rect"==d.type)break;case"cx":i.setAttribute(o,p),d.pattern&&s(d),d._.dirty=1;break;case"height":if(i.setAttribute(o,p),d._.dirty=1,!k.fy)break;o="y",p=k.y;case"y":k.fy&&(p=-k.y-(k.height||0));case"ry":if("ry"==o&&"rect"==d.type)break;case"cy":i.setAttribute(o,p),d.pattern&&s(d),d._.dirty=1;break;case"r":"rect"==d.type?q(i,{"rx":p,"ry":p}):i.setAttribute(o,p),d._.dirty=1;break;case"src":"image"==d.type&&i.setAttributeNS(n,"href",p);break;case"stroke-width":(1!=d._.sx||1!=d._.sy)&&(p/=g(h(d._.sx),h(d._.sy))||1),d.paper._vbSize&&(p*=d.paper._vbSize),i.setAttribute(o,p),k["stroke-dasharray"]&&v(d,k["stroke-dasharray"],f),d._.arrows&&("startString"in d._.arrows&&t(d,d._.arrows.startString),"endString"in d._.arrows&&t(d,d._.arrows.endString,1));break;case"stroke-dasharray":v(d,p,f);break;case"fill":var E=b(p).match(c._ISURL);if(E){A=q("pattern");var F=q("image");A.id=c.createUUID(),q(A,{"x":0,"y":0,"patternUnits":"userSpaceOnUse","height":1,"width":1}),q(F,{"x":0,"y":0,"xlink:href":E[1]}),A.appendChild(F),function(a){c._preload(E[1],function(){var b=this.offsetWidth,c=this.offsetHeight;q(a,{"width":b,"height":c}),q(F,{"width":b,"height":c}),d.paper.safari()})}(A),d.paper.defs.appendChild(A),q(i,{"fill":"url(#"+A.id+")"}),d.pattern=A,d.pattern&&s(d);break}var G=c.getRGB(p);if(G.error){if(("circle"==d.type||"ellipse"==d.type||"r"!=b(p).charAt())&&r(d,p)){if("opacity"in k||"fill-opacity"in k){var H=c._g.doc.getElementById(i.getAttribute("fill").replace(/^url\(#|\)$/g,l));if(H){var I=H.getElementsByTagName("stop");q(I[I.length-1],{"stop-opacity":("opacity"in k?k.opacity:1)*("fill-opacity"in k?k["fill-opacity"]:1)})}}k.gradient=p,k.fill="none";break}}else delete f.gradient,delete k.gradient,!c.is(k.opacity,"undefined")&&c.is(f.opacity,"undefined")&&q(i,{"opacity":k.opacity}),!c.is(k["fill-opacity"],"undefined")&&c.is(f["fill-opacity"],"undefined")&&q(i,{"fill-opacity":k["fill-opacity"]});G[a]("opacity")&&q(i,{"fill-opacity":G.opacity>1?G.opacity/100:G.opacity});case"stroke":G=c.getRGB(p),i.setAttribute(o,G.hex),"stroke"==o&&G[a]("opacity")&&q(i,{"stroke-opacity":G.opacity>1?G.opacity/100:G.opacity}),"stroke"==o&&d._.arrows&&("startString"in d._.arrows&&t(d,d._.arrows.startString),"endString"in d._.arrows&&t(d,d._.arrows.endString,1));break;case"gradient":("circle"==d.type||"ellipse"==d.type||"r"!=b(p).charAt())&&r(d,p);break;case"opacity":k.gradient&&!k[a]("stroke-opacity")&&q(i,{"stroke-opacity":p>1?p/100:p});case"fill-opacity":if(k.gradient){H=c._g.doc.getElementById(i.getAttribute("fill").replace(/^url\(#|\)$/g,l)),H&&(I=H.getElementsByTagName("stop"),q(I[I.length-1],{"stop-opacity":p}));break}default:"font-size"==o&&(p=e(p,10)+"px");var J=o.replace(/(\-.)/g,function(a){return a.substring(1).toUpperCase()
|
|
});i.style[J]=p,d._.dirty=1,i.setAttribute(o,p)}}y(d,f),i.style.visibility=m},x=1.2,y=function(d,f){if("text"==d.type&&(f[a]("text")||f[a]("font")||f[a]("font-size")||f[a]("x")||f[a]("y"))){var g=d.attrs,h=d.node,i=h.firstChild?e(c._g.doc.defaultView.getComputedStyle(h.firstChild,l).getPropertyValue("font-size"),10):10;if(f[a]("text")){for(g.text=f.text;h.firstChild;)h.removeChild(h.firstChild);for(var j,k=b(f.text).split("\n"),m=[],n=0,o=k.length;o>n;n++)j=q("tspan"),n&&q(j,{"dy":i*x,"x":g.x}),j.appendChild(c._g.doc.createTextNode(k[n])),h.appendChild(j),m[n]=j}else for(m=h.getElementsByTagName("tspan"),n=0,o=m.length;o>n;n++)n?q(m[n],{"dy":i*x,"x":g.x}):q(m[0],{"dy":0});q(h,{"x":g.x,"y":g.y}),d._.dirty=1;var p=d._getBBox(),r=g.y-(p.y+p.height/2);r&&c.is(r,"finite")&&q(m[0],{"dy":r})}},z=function(a,b){this[0]=this.node=a,a.raphael=!0,this.id=c._oid++,a.raphaelid=this.id,this.matrix=c.matrix(),this.realPath=null,this.paper=b,this.attrs=this.attrs||{},this._={"transform":[],"sx":1,"sy":1,"deg":0,"dx":0,"dy":0,"dirty":1},!b.bottom&&(b.bottom=this),this.prev=b.top,b.top&&(b.top.next=this),b.top=this,this.next=null},A=c.el;z.prototype=A,A.constructor=z,c._engine.path=function(a,b){var c=q("path");b.canvas&&b.canvas.appendChild(c);var d=new z(c,b);return d.type="path",w(d,{"fill":"none","stroke":"#000","path":a}),d},A.rotate=function(a,c,e){if(this.removed)return this;if(a=b(a).split(j),a.length-1&&(c=d(a[1]),e=d(a[2])),a=d(a[0]),null==e&&(c=e),null==c||null==e){var f=this.getBBox(1);c=f.x+f.width/2,e=f.y+f.height/2}return this.transform(this._.transform.concat([["r",a,c,e]])),this},A.scale=function(a,c,e,f){if(this.removed)return this;if(a=b(a).split(j),a.length-1&&(c=d(a[1]),e=d(a[2]),f=d(a[3])),a=d(a[0]),null==c&&(c=a),null==f&&(e=f),null==e||null==f)var g=this.getBBox(1);return e=null==e?g.x+g.width/2:e,f=null==f?g.y+g.height/2:f,this.transform(this._.transform.concat([["s",a,c,e,f]])),this},A.translate=function(a,c){return this.removed?this:(a=b(a).split(j),a.length-1&&(c=d(a[1])),a=d(a[0])||0,c=+c||0,this.transform(this._.transform.concat([["t",a,c]])),this)},A.transform=function(b){var d=this._;if(null==b)return d.transform;if(c._extractTransform(this,b),this.clip&&q(this.clip,{"transform":this.matrix.invert()}),this.pattern&&s(this),this.node&&q(this.node,{"transform":this.matrix}),1!=d.sx||1!=d.sy){var e=this.attrs[a]("stroke-width")?this.attrs["stroke-width"]:1;this.attr({"stroke-width":e})}return this},A.hide=function(){return!this.removed&&this.paper.safari(this.node.style.display="none"),this},A.show=function(){return!this.removed&&this.paper.safari(this.node.style.display=""),this},A.remove=function(){if(!this.removed&&this.node.parentNode){var a=this.paper;a.__set__&&a.__set__.exclude(this),k.unbind("raphael.*.*."+this.id),this.gradient&&a.defs.removeChild(this.gradient),c._tear(this,a),"a"==this.node.parentNode.tagName.toLowerCase()?this.node.parentNode.parentNode.removeChild(this.node.parentNode):this.node.parentNode.removeChild(this.node);for(var b in this)this[b]="function"==typeof this[b]?c._removedFactory(b):null;this.removed=!0}},A._getBBox=function(){if("none"==this.node.style.display){this.show();var a=!0}var b={};try{b=this.node.getBBox()}catch(c){}finally{b=b||{}}return a&&this.hide(),b},A.attr=function(b,d){if(this.removed)return this;if(null==b){var e={};for(var f in this.attrs)this.attrs[a](f)&&(e[f]=this.attrs[f]);return e.gradient&&"none"==e.fill&&(e.fill=e.gradient)&&delete e.gradient,e.transform=this._.transform,e}if(null==d&&c.is(b,"string")){if("fill"==b&&"none"==this.attrs.fill&&this.attrs.gradient)return this.attrs.gradient;if("transform"==b)return this._.transform;for(var g=b.split(j),h={},i=0,l=g.length;l>i;i++)b=g[i],h[b]=b in this.attrs?this.attrs[b]:c.is(this.paper.customAttributes[b],"function")?this.paper.customAttributes[b].def:c._availableAttrs[b];return l-1?h:h[g[0]]}if(null==d&&c.is(b,"array")){for(h={},i=0,l=b.length;l>i;i++)h[b[i]]=this.attr(b[i]);return h}if(null!=d){var m={};m[b]=d}else null!=b&&c.is(b,"object")&&(m=b);for(var n in m)k("raphael.attr."+n+"."+this.id,this,m[n]);for(n in this.paper.customAttributes)if(this.paper.customAttributes[a](n)&&m[a](n)&&c.is(this.paper.customAttributes[n],"function")){var o=this.paper.customAttributes[n].apply(this,[].concat(m[n]));this.attrs[n]=m[n];for(var p in o)o[a](p)&&(m[p]=o[p])}return w(this,m),this},A.toFront=function(){if(this.removed)return this;"a"==this.node.parentNode.tagName.toLowerCase()?this.node.parentNode.parentNode.appendChild(this.node.parentNode):this.node.parentNode.appendChild(this.node);var a=this.paper;return a.top!=this&&c._tofront(this,a),this},A.toBack=function(){if(this.removed)return this;var a=this.node.parentNode;return"a"==a.tagName.toLowerCase()?a.parentNode.insertBefore(this.node.parentNode,this.node.parentNode.parentNode.firstChild):a.firstChild!=this.node&&a.insertBefore(this.node,this.node.parentNode.firstChild),c._toback(this,this.paper),this.paper,this},A.insertAfter=function(a){if(this.removed)return this;var b=a.node||a[a.length-1].node;return b.nextSibling?b.parentNode.insertBefore(this.node,b.nextSibling):b.parentNode.appendChild(this.node),c._insertafter(this,a,this.paper),this},A.insertBefore=function(a){if(this.removed)return this;var b=a.node||a[0].node;return b.parentNode.insertBefore(this.node,b),c._insertbefore(this,a,this.paper),this},A.blur=function(a){var b=this;if(0!==+a){var d=q("filter"),e=q("feGaussianBlur");b.attrs.blur=a,d.id=c.createUUID(),q(e,{"stdDeviation":+a||1.5}),d.appendChild(e),b.paper.defs.appendChild(d),b._blur=d,q(b.node,{"filter":"url(#"+d.id+")"})}else b._blur&&(b._blur.parentNode.removeChild(b._blur),delete b._blur,delete b.attrs.blur),b.node.removeAttribute("filter");return b},c._engine.circle=function(a,b,c,d){var e=q("circle");a.canvas&&a.canvas.appendChild(e);var f=new z(e,a);return f.attrs={"cx":b,"cy":c,"r":d,"fill":"none","stroke":"#000"},f.type="circle",q(e,f.attrs),f},c._engine.rect=function(a,b,c,d,e,f){var g=q("rect");a.canvas&&a.canvas.appendChild(g);var h=new z(g,a);return h.attrs={"x":b,"y":c,"width":d,"height":e,"r":f||0,"rx":f||0,"ry":f||0,"fill":"none","stroke":"#000"},h.type="rect",q(g,h.attrs),h},c._engine.ellipse=function(a,b,c,d,e){var f=q("ellipse");a.canvas&&a.canvas.appendChild(f);var g=new z(f,a);return g.attrs={"cx":b,"cy":c,"rx":d,"ry":e,"fill":"none","stroke":"#000"},g.type="ellipse",q(f,g.attrs),g},c._engine.image=function(a,b,c,d,e,f){var g=q("image");q(g,{"x":c,"y":d,"width":e,"height":f,"preserveAspectRatio":"none"}),g.setAttributeNS(n,"href",b),a.canvas&&a.canvas.appendChild(g);var h=new z(g,a);return h.attrs={"x":c,"y":d,"width":e,"height":f,"src":b},h.type="image",h},c._engine.text=function(a,b,d,e){var f=q("text");a.canvas&&a.canvas.appendChild(f);var g=new z(f,a);return g.attrs={"x":b,"y":d,"text-anchor":"middle","text":e,"font":c._availableAttrs.font,"stroke":"none","fill":"#000"},g.type="text",w(g,g.attrs),g},c._engine.setSize=function(a,b){return this.width=a||this.width,this.height=b||this.height,this.canvas.setAttribute("width",this.width),this.canvas.setAttribute("height",this.height),this._viewBox&&this.setViewBox.apply(this,this._viewBox),this},c._engine.create=function(){var a=c._getContainer.apply(0,arguments),b=a&&a.container,d=a.x,e=a.y,f=a.width,g=a.height;if(!b)throw new Error("SVG container not found.");var h,i=q("svg"),j="overflow:hidden;";return d=d||0,e=e||0,f=f||512,g=g||342,q(i,{"height":g,"version":1.1,"width":f,"xmlns":"http://www.w3.org/2000/svg"}),1==b?(i.style.cssText=j+"position:absolute;left:"+d+"px;top:"+e+"px",c._g.doc.body.appendChild(i),h=1):(i.style.cssText=j+"position:relative",b.firstChild?b.insertBefore(i,b.firstChild):b.appendChild(i)),b=new c._Paper,b.width=f,b.height=g,b.canvas=i,b.clear(),b._left=b._top=0,h&&(b.renderfix=function(){}),b.renderfix(),b},c._engine.setViewBox=function(a,b,c,d,e){k("raphael.setViewBox",this,this._viewBox,[a,b,c,d,e]);var f,h,i=g(c/this.width,d/this.height),j=this.top,l=e?"meet":"xMinYMin";for(null==a?(this._vbSize&&(i=1),delete this._vbSize,f="0 0 "+this.width+m+this.height):(this._vbSize=i,f=a+m+b+m+c+m+d),q(this.canvas,{"viewBox":f,"preserveAspectRatio":l});i&&j;)h="stroke-width"in j.attrs?j.attrs["stroke-width"]:1,j.attr({"stroke-width":h}),j._.dirty=1,j._.dirtyT=1,j=j.prev;return this._viewBox=[a,b,c,d,!!e],this},c.prototype.renderfix=function(){var a,b=this.canvas,c=b.style;try{a=b.getScreenCTM()||b.createSVGMatrix()}catch(d){a=b.createSVGMatrix()}var e=-a.e%1,f=-a.f%1;(e||f)&&(e&&(this._left=(this._left+e)%1,c.left=this._left+"px"),f&&(this._top=(this._top+f)%1,c.top=this._top+"px"))},c.prototype.clear=function(){c.eve("raphael.clear",this);for(var a=this.canvas;a.firstChild;)a.removeChild(a.firstChild);this.bottom=this.top=null,(this.desc=q("desc")).appendChild(c._g.doc.createTextNode("Created with Rapha\xebl "+c.version)),a.appendChild(this.desc),a.appendChild(this.defs=q("defs"))},c.prototype.remove=function(){k("raphael.remove",this),this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas);for(var a in this)this[a]="function"==typeof this[a]?c._removedFactory(a):null};var B=c.st;for(var C in A)A[a](C)&&!B[a](C)&&(B[C]=function(a){return function(){var b=arguments;return this.forEach(function(c){c[a].apply(c,b)})}}(C))}}(),function(){if(c.vml){var a="hasOwnProperty",b=String,d=parseFloat,e=Math,f=e.round,g=e.max,h=e.min,i=e.abs,j="fill",k=/[, ]+/,l=c.eve,m=" progid:DXImageTransform.Microsoft",n=" ",o="",p={"M":"m","L":"l","C":"c","Z":"x","m":"t","l":"r","c":"v","z":"x"},q=/([clmz]),?([^clmz]*)/gi,r=/ progid:\S+Blur\([^\)]+\)/g,s=/-?[^,\s-]+/g,t="position:absolute;left:0;top:0;width:1px;height:1px",u=21600,v={"path":1,"rect":1,"image":1},w={"circle":1,"ellipse":1},x=function(a){var d=/[ahqstv]/gi,e=c._pathToAbsolute;if(b(a).match(d)&&(e=c._path2curve),d=/[clmz]/g,e==c._pathToAbsolute&&!b(a).match(d)){var g=b(a).replace(q,function(a,b,c){var d=[],e="m"==b.toLowerCase(),g=p[b];return c.replace(s,function(a){e&&2==d.length&&(g+=d+p["m"==b?"l":"L"],d=[]),d.push(f(a*u))}),g+d});return g}var h,i,j=e(a);g=[];for(var k=0,l=j.length;l>k;k++){h=j[k],i=j[k][0].toLowerCase(),"z"==i&&(i="x");for(var m=1,r=h.length;r>m;m++)i+=f(h[m]*u)+(m!=r-1?",":o);g.push(i)}return g.join(n)},y=function(a,b,d){var e=c.matrix();return e.rotate(-a,.5,.5),{"dx":e.x(b,d),"dy":e.y(b,d)}},z=function(a,b,c,d,e,f){var g=a._,h=a.matrix,k=g.fillpos,l=a.node,m=l.style,o=1,p="",q=u/b,r=u/c;if(m.visibility="hidden",b&&c){if(l.coordsize=i(q)+n+i(r),m.rotation=f*(0>b*c?-1:1),f){var s=y(f,d,e);d=s.dx,e=s.dy}if(0>b&&(p+="x"),0>c&&(p+=" y")&&(o=-1),m.flip=p,l.coordorigin=d*-q+n+e*-r,k||g.fillsize){var t=l.getElementsByTagName(j);t=t&&t[0],l.removeChild(t),k&&(s=y(f,h.x(k[0],k[1]),h.y(k[0],k[1])),t.position=s.dx*o+n+s.dy*o),g.fillsize&&(t.size=g.fillsize[0]*i(b)+n+g.fillsize[1]*i(c)),l.appendChild(t)}m.visibility="visible"}};c.toString=function(){return"Your browser doesn\u2019t support SVG. Falling down to VML.\nYou are running Rapha\xebl "+this.version};var A=function(a,c,d){for(var e=b(c).toLowerCase().split("-"),f=d?"end":"start",g=e.length,h="classic",i="medium",j="medium";g--;)switch(e[g]){case"block":case"classic":case"oval":case"diamond":case"open":case"none":h=e[g];break;case"wide":case"narrow":j=e[g];break;case"long":case"short":i=e[g]}var k=a.node.getElementsByTagName("stroke")[0];k[f+"arrow"]=h,k[f+"arrowlength"]=i,k[f+"arrowwidth"]=j},B=function(e,i){e.attrs=e.attrs||{};var l=e.node,m=e.attrs,p=l.style,q=v[e.type]&&(i.x!=m.x||i.y!=m.y||i.width!=m.width||i.height!=m.height||i.cx!=m.cx||i.cy!=m.cy||i.rx!=m.rx||i.ry!=m.ry||i.r!=m.r),r=w[e.type]&&(m.cx!=i.cx||m.cy!=i.cy||m.r!=i.r||m.rx!=i.rx||m.ry!=i.ry),s=e;for(var t in i)i[a](t)&&(m[t]=i[t]);if(q&&(m.path=c._getPath[e.type](e),e._.dirty=1),i.href&&(l.href=i.href),i.title&&(l.title=i.title),i.target&&(l.target=i.target),i.cursor&&(p.cursor=i.cursor),"blur"in i&&e.blur(i.blur),(i.path&&"path"==e.type||q)&&(l.path=x(~b(m.path).toLowerCase().indexOf("r")?c._pathToAbsolute(m.path):m.path),"image"==e.type&&(e._.fillpos=[m.x,m.y],e._.fillsize=[m.width,m.height],z(e,1,1,0,0,0))),"transform"in i&&e.transform(i.transform),r){var y=+m.cx,B=+m.cy,D=+m.rx||+m.r||0,E=+m.ry||+m.r||0;l.path=c.format("ar{0},{1},{2},{3},{4},{1},{4},{1}x",f((y-D)*u),f((B-E)*u),f((y+D)*u),f((B+E)*u),f(y*u)),e._.dirty=1}if("clip-rect"in i){var G=b(i["clip-rect"]).split(k);if(4==G.length){G[2]=+G[2]+ +G[0],G[3]=+G[3]+ +G[1];var H=l.clipRect||c._g.doc.createElement("div"),I=H.style;I.clip=c.format("rect({1}px {2}px {3}px {0}px)",G),l.clipRect||(I.position="absolute",I.top=0,I.left=0,I.width=e.paper.width+"px",I.height=e.paper.height+"px",l.parentNode.insertBefore(H,l),H.appendChild(l),l.clipRect=H)}i["clip-rect"]||l.clipRect&&(l.clipRect.style.clip="auto")}if(e.textpath){var J=e.textpath.style;i.font&&(J.font=i.font),i["font-family"]&&(J.fontFamily='"'+i["font-family"].split(",")[0].replace(/^['"]+|['"]+$/g,o)+'"'),i["font-size"]&&(J.fontSize=i["font-size"]),i["font-weight"]&&(J.fontWeight=i["font-weight"]),i["font-style"]&&(J.fontStyle=i["font-style"])}if("arrow-start"in i&&A(s,i["arrow-start"]),"arrow-end"in i&&A(s,i["arrow-end"],1),null!=i.opacity||null!=i["stroke-width"]||null!=i.fill||null!=i.src||null!=i.stroke||null!=i["stroke-width"]||null!=i["stroke-opacity"]||null!=i["fill-opacity"]||null!=i["stroke-dasharray"]||null!=i["stroke-miterlimit"]||null!=i["stroke-linejoin"]||null!=i["stroke-linecap"]){var K=l.getElementsByTagName(j),L=!1;if(K=K&&K[0],!K&&(L=K=F(j)),"image"==e.type&&i.src&&(K.src=i.src),i.fill&&(K.on=!0),(null==K.on||"none"==i.fill||null===i.fill)&&(K.on=!1),K.on&&i.fill){var M=b(i.fill).match(c._ISURL);if(M){K.parentNode==l&&l.removeChild(K),K.rotate=!0,K.src=M[1],K.type="tile";var N=e.getBBox(1);K.position=N.x+n+N.y,e._.fillpos=[N.x,N.y],c._preload(M[1],function(){e._.fillsize=[this.offsetWidth,this.offsetHeight]})}else K.color=c.getRGB(i.fill).hex,K.src=o,K.type="solid",c.getRGB(i.fill).error&&(s.type in{"circle":1,"ellipse":1}||"r"!=b(i.fill).charAt())&&C(s,i.fill,K)&&(m.fill="none",m.gradient=i.fill,K.rotate=!1)}if("fill-opacity"in i||"opacity"in i){var O=((+m["fill-opacity"]+1||2)-1)*((+m.opacity+1||2)-1)*((+c.getRGB(i.fill).o+1||2)-1);O=h(g(O,0),1),K.opacity=O,K.src&&(K.color="none")}l.appendChild(K);var P=l.getElementsByTagName("stroke")&&l.getElementsByTagName("stroke")[0],Q=!1;!P&&(Q=P=F("stroke")),(i.stroke&&"none"!=i.stroke||i["stroke-width"]||null!=i["stroke-opacity"]||i["stroke-dasharray"]||i["stroke-miterlimit"]||i["stroke-linejoin"]||i["stroke-linecap"])&&(P.on=!0),("none"==i.stroke||null===i.stroke||null==P.on||0==i.stroke||0==i["stroke-width"])&&(P.on=!1);var R=c.getRGB(i.stroke);P.on&&i.stroke&&(P.color=R.hex),O=((+m["stroke-opacity"]+1||2)-1)*((+m.opacity+1||2)-1)*((+R.o+1||2)-1);var S=.75*(d(i["stroke-width"])||1);if(O=h(g(O,0),1),null==i["stroke-width"]&&(S=m["stroke-width"]),i["stroke-width"]&&(P.weight=S),S&&1>S&&(O*=S)&&(P.weight=1),P.opacity=O,i["stroke-linejoin"]&&(P.joinstyle=i["stroke-linejoin"]||"miter"),P.miterlimit=i["stroke-miterlimit"]||8,i["stroke-linecap"]&&(P.endcap="butt"==i["stroke-linecap"]?"flat":"square"==i["stroke-linecap"]?"square":"round"),"stroke-dasharray"in i){var T={"-":"shortdash",".":"shortdot","-.":"shortdashdot","-..":"shortdashdotdot",". ":"dot","- ":"dash","--":"longdash","- .":"dashdot","--.":"longdashdot","--..":"longdashdotdot"};P.dashstyle=T[a](i["stroke-dasharray"])?T[i["stroke-dasharray"]]:o}Q&&l.appendChild(P)}if("text"==s.type){s.paper.canvas.style.display=o;var U=s.paper.span,V=100,W=m.font&&m.font.match(/\d+(?:\.\d*)?(?=px)/);p=U.style,m.font&&(p.font=m.font),m["font-family"]&&(p.fontFamily=m["font-family"]),m["font-weight"]&&(p.fontWeight=m["font-weight"]),m["font-style"]&&(p.fontStyle=m["font-style"]),W=d(m["font-size"]||W&&W[0])||10,p.fontSize=W*V+"px",s.textpath.string&&(U.innerHTML=b(s.textpath.string).replace(/</g,"<").replace(/&/g,"&").replace(/\n/g,"<br>"));var X=U.getBoundingClientRect();s.W=m.w=(X.right-X.left)/V,s.H=m.h=(X.bottom-X.top)/V,s.X=m.x,s.Y=m.y+s.H/2,("x"in i||"y"in i)&&(s.path.v=c.format("m{0},{1}l{2},{1}",f(m.x*u),f(m.y*u),f(m.x*u)+1));for(var Y=["x","y","text","font","font-family","font-weight","font-style","font-size"],Z=0,$=Y.length;$>Z;Z++)if(Y[Z]in i){s._.dirty=1;break}switch(m["text-anchor"]){case"start":s.textpath.style["v-text-align"]="left",s.bbx=s.W/2;break;case"end":s.textpath.style["v-text-align"]="right",s.bbx=-s.W/2;break;default:s.textpath.style["v-text-align"]="center",s.bbx=0}s.textpath.style["v-text-kern"]=!0}},C=function(a,f,g){a.attrs=a.attrs||{};var h=(a.attrs,Math.pow),i="linear",j=".5 .5";if(a.attrs.gradient=f,f=b(f).replace(c._radial_gradient,function(a,b,c){return i="radial",b&&c&&(b=d(b),c=d(c),h(b-.5,2)+h(c-.5,2)>.25&&(c=e.sqrt(.25-h(b-.5,2))*(2*(c>.5)-1)+.5),j=b+n+c),o}),f=f.split(/\s*\-\s*/),"linear"==i){var k=f.shift();if(k=-d(k),isNaN(k))return null}var l=c._parseDots(f);if(!l)return null;if(a=a.shape||a.node,l.length){a.removeChild(g),g.on=!0,g.method="none",g.color=l[0].color,g.color2=l[l.length-1].color;for(var m=[],p=0,q=l.length;q>p;p++)l[p].offset&&m.push(l[p].offset+n+l[p].color);g.colors=m.length?m.join():"0% "+g.color,"radial"==i?(g.type="gradientTitle",g.focus="100%",g.focussize="0 0",g.focusposition=j,g.angle=0):(g.type="gradient",g.angle=(270-k)%360),a.appendChild(g)}return 1},D=function(a,b){this[0]=this.node=a,a.raphael=!0,this.id=c._oid++,a.raphaelid=this.id,this.X=0,this.Y=0,this.attrs={},this.paper=b,this.matrix=c.matrix(),this._={"transform":[],"sx":1,"sy":1,"dx":0,"dy":0,"deg":0,"dirty":1,"dirtyT":1},!b.bottom&&(b.bottom=this),this.prev=b.top,b.top&&(b.top.next=this),b.top=this,this.next=null},E=c.el;D.prototype=E,E.constructor=D,E.transform=function(a){if(null==a)return this._.transform;var d,e=this.paper._viewBoxShift,f=e?"s"+[e.scale,e.scale]+"-1-1t"+[e.dx,e.dy]:o;e&&(d=a=b(a).replace(/\.{3}|\u2026/g,this._.transform||o)),c._extractTransform(this,f+a);var g,h=this.matrix.clone(),i=this.skew,j=this.node,k=~b(this.attrs.fill).indexOf("-"),l=!b(this.attrs.fill).indexOf("url(");if(h.translate(1,1),l||k||"image"==this.type)if(i.matrix="1 0 0 1",i.offset="0 0",g=h.split(),k&&g.noRotation||!g.isSimple){j.style.filter=h.toFilter();var m=this.getBBox(),p=this.getBBox(1),q=m.x-p.x,r=m.y-p.y;j.coordorigin=q*-u+n+r*-u,z(this,1,1,q,r,0)}else j.style.filter=o,z(this,g.scalex,g.scaley,g.dx,g.dy,g.rotate);else j.style.filter=o,i.matrix=b(h),i.offset=h.offset();return d&&(this._.transform=d),this},E.rotate=function(a,c,e){if(this.removed)return this;if(null!=a){if(a=b(a).split(k),a.length-1&&(c=d(a[1]),e=d(a[2])),a=d(a[0]),null==e&&(c=e),null==c||null==e){var f=this.getBBox(1);c=f.x+f.width/2,e=f.y+f.height/2}return this._.dirtyT=1,this.transform(this._.transform.concat([["r",a,c,e]])),this}},E.translate=function(a,c){return this.removed?this:(a=b(a).split(k),a.length-1&&(c=d(a[1])),a=d(a[0])||0,c=+c||0,this._.bbox&&(this._.bbox.x+=a,this._.bbox.y+=c),this.transform(this._.transform.concat([["t",a,c]])),this)},E.scale=function(a,c,e,f){if(this.removed)return this;if(a=b(a).split(k),a.length-1&&(c=d(a[1]),e=d(a[2]),f=d(a[3]),isNaN(e)&&(e=null),isNaN(f)&&(f=null)),a=d(a[0]),null==c&&(c=a),null==f&&(e=f),null==e||null==f)var g=this.getBBox(1);return e=null==e?g.x+g.width/2:e,f=null==f?g.y+g.height/2:f,this.transform(this._.transform.concat([["s",a,c,e,f]])),this._.dirtyT=1,this},E.hide=function(){return!this.removed&&(this.node.style.display="none"),this},E.show=function(){return!this.removed&&(this.node.style.display=o),this},E._getBBox=function(){return this.removed?{}:{"x":this.X+(this.bbx||0)-this.W/2,"y":this.Y-this.H,"width":this.W,"height":this.H}},E.remove=function(){if(!this.removed&&this.node.parentNode){this.paper.__set__&&this.paper.__set__.exclude(this),c.eve.unbind("raphael.*.*."+this.id),c._tear(this,this.paper),this.node.parentNode.removeChild(this.node),this.shape&&this.shape.parentNode.removeChild(this.shape);for(var a in this)this[a]="function"==typeof this[a]?c._removedFactory(a):null;this.removed=!0}},E.attr=function(b,d){if(this.removed)return this;if(null==b){var e={};for(var f in this.attrs)this.attrs[a](f)&&(e[f]=this.attrs[f]);return e.gradient&&"none"==e.fill&&(e.fill=e.gradient)&&delete e.gradient,e.transform=this._.transform,e}if(null==d&&c.is(b,"string")){if(b==j&&"none"==this.attrs.fill&&this.attrs.gradient)return this.attrs.gradient;for(var g=b.split(k),h={},i=0,m=g.length;m>i;i++)b=g[i],h[b]=b in this.attrs?this.attrs[b]:c.is(this.paper.customAttributes[b],"function")?this.paper.customAttributes[b].def:c._availableAttrs[b];return m-1?h:h[g[0]]}if(this.attrs&&null==d&&c.is(b,"array")){for(h={},i=0,m=b.length;m>i;i++)h[b[i]]=this.attr(b[i]);return h}var n;null!=d&&(n={},n[b]=d),null==d&&c.is(b,"object")&&(n=b);for(var o in n)l("raphael.attr."+o+"."+this.id,this,n[o]);if(n){for(o in this.paper.customAttributes)if(this.paper.customAttributes[a](o)&&n[a](o)&&c.is(this.paper.customAttributes[o],"function")){var p=this.paper.customAttributes[o].apply(this,[].concat(n[o]));this.attrs[o]=n[o];for(var q in p)p[a](q)&&(n[q]=p[q])}n.text&&"text"==this.type&&(this.textpath.string=n.text),B(this,n)}return this},E.toFront=function(){return!this.removed&&this.node.parentNode.appendChild(this.node),this.paper&&this.paper.top!=this&&c._tofront(this,this.paper),this},E.toBack=function(){return this.removed?this:(this.node.parentNode.firstChild!=this.node&&(this.node.parentNode.insertBefore(this.node,this.node.parentNode.firstChild),c._toback(this,this.paper)),this)},E.insertAfter=function(a){return this.removed?this:(a.constructor==c.st.constructor&&(a=a[a.length-1]),a.node.nextSibling?a.node.parentNode.insertBefore(this.node,a.node.nextSibling):a.node.parentNode.appendChild(this.node),c._insertafter(this,a,this.paper),this)},E.insertBefore=function(a){return this.removed?this:(a.constructor==c.st.constructor&&(a=a[0]),a.node.parentNode.insertBefore(this.node,a.node),c._insertbefore(this,a,this.paper),this)},E.blur=function(a){var b=this.node.runtimeStyle,d=b.filter;return d=d.replace(r,o),0!==+a?(this.attrs.blur=a,b.filter=d+n+m+".Blur(pixelradius="+(+a||1.5)+")",b.margin=c.format("-{0}px 0 0 -{0}px",f(+a||1.5))):(b.filter=d,b.margin=0,delete this.attrs.blur),this},c._engine.path=function(a,b){var c=F("shape");c.style.cssText=t,c.coordsize=u+n+u,c.coordorigin=b.coordorigin;var d=new D(c,b),e={"fill":"none","stroke":"#000"};a&&(e.path=a),d.type="path",d.path=[],d.Path=o,B(d,e),b.canvas.appendChild(c);var f=F("skew");return f.on=!0,c.appendChild(f),d.skew=f,d.transform(o),d},c._engine.rect=function(a,b,d,e,f,g){var h=c._rectPath(b,d,e,f,g),i=a.path(h),j=i.attrs;return i.X=j.x=b,i.Y=j.y=d,i.W=j.width=e,i.H=j.height=f,j.r=g,j.path=h,i.type="rect",i},c._engine.ellipse=function(a,b,c,d,e){var f=a.path();return f.attrs,f.X=b-d,f.Y=c-e,f.W=2*d,f.H=2*e,f.type="ellipse",B(f,{"cx":b,"cy":c,"rx":d,"ry":e}),f},c._engine.circle=function(a,b,c,d){var e=a.path();return e.attrs,e.X=b-d,e.Y=c-d,e.W=e.H=2*d,e.type="circle",B(e,{"cx":b,"cy":c,"r":d}),e},c._engine.image=function(a,b,d,e,f,g){var h=c._rectPath(d,e,f,g),i=a.path(h).attr({"stroke":"none"}),k=i.attrs,l=i.node,m=l.getElementsByTagName(j)[0];return k.src=b,i.X=k.x=d,i.Y=k.y=e,i.W=k.width=f,i.H=k.height=g,k.path=h,i.type="image",m.parentNode==l&&l.removeChild(m),m.rotate=!0,m.src=b,m.type="tile",i._.fillpos=[d,e],i._.fillsize=[f,g],l.appendChild(m),z(i,1,1,0,0,0),i},c._engine.text=function(a,d,e,g){var h=F("shape"),i=F("path"),j=F("textpath");d=d||0,e=e||0,g=g||"",i.v=c.format("m{0},{1}l{2},{1}",f(d*u),f(e*u),f(d*u)+1),i.textpathok=!0,j.string=b(g),j.on=!0,h.style.cssText=t,h.coordsize=u+n+u,h.coordorigin="0 0";var k=new D(h,a),l={"fill":"#000","stroke":"none","font":c._availableAttrs.font,"text":g};k.shape=h,k.path=i,k.textpath=j,k.type="text",k.attrs.text=b(g),k.attrs.x=d,k.attrs.y=e,k.attrs.w=1,k.attrs.h=1,B(k,l),h.appendChild(j),h.appendChild(i),a.canvas.appendChild(h);var m=F("skew");return m.on=!0,h.appendChild(m),k.skew=m,k.transform(o),k},c._engine.setSize=function(a,b){var d=this.canvas.style;return this.width=a,this.height=b,a==+a&&(a+="px"),b==+b&&(b+="px"),d.width=a,d.height=b,d.clip="rect(0 "+a+" "+b+" 0)",this._viewBox&&c._engine.setViewBox.apply(this,this._viewBox),this},c._engine.setViewBox=function(a,b,d,e,f){c.eve("raphael.setViewBox",this,this._viewBox,[a,b,d,e,f]);var h,i,j=this.width,k=this.height,l=1/g(d/j,e/k);return f&&(h=k/e,i=j/d,j>d*h&&(a-=(j-d*h)/2/h),k>e*i&&(b-=(k-e*i)/2/i)),this._viewBox=[a,b,d,e,!!f],this._viewBoxShift={"dx":-a,"dy":-b,"scale":l},this.forEach(function(a){a.transform("...")}),this};var F;c._engine.initWin=function(a){var b=a.document;b.createStyleSheet().addRule(".rvml","behavior:url(#default#VML)");try{!b.namespaces.rvml&&b.namespaces.add("rvml","urn:schemas-microsoft-com:vml"),F=function(a){return b.createElement("<rvml:"+a+' class="rvml">')}}catch(c){F=function(a){return b.createElement("<"+a+' xmlns="urn:schemas-microsoft.com:vml" class="rvml">')}}},c._engine.initWin(c._g.win),c._engine.create=function(){var a=c._getContainer.apply(0,arguments),b=a.container,d=a.height,e=a.width,f=a.x,g=a.y;if(!b)throw new Error("VML container not found.");var h=new c._Paper,i=h.canvas=c._g.doc.createElement("div"),j=i.style;return f=f||0,g=g||0,e=e||512,d=d||342,h.width=e,h.height=d,e==+e&&(e+="px"),d==+d&&(d+="px"),h.coordsize=1e3*u+n+1e3*u,h.coordorigin="0 0",h.span=c._g.doc.createElement("span"),h.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;",i.appendChild(h.span),j.cssText=c.format("top:0;left:0;width:{0};height:{1};display:inline-block;position:relative;clip:rect(0 {0} {1} 0);overflow:hidden",e,d),1==b?(c._g.doc.body.appendChild(i),j.left=f+"px",j.top=g+"px",j.position="absolute"):b.firstChild?b.insertBefore(i,b.firstChild):b.appendChild(i),h.renderfix=function(){},h},c.prototype.clear=function(){c.eve("raphael.clear",this),this.canvas.innerHTML=o,this.span=c._g.doc.createElement("span"),this.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;display:inline;",this.canvas.appendChild(this.span),this.bottom=this.top=null},c.prototype.remove=function(){c.eve("raphael.remove",this),this.canvas.parentNode.removeChild(this.canvas);for(var a in this)this[a]="function"==typeof this[a]?c._removedFactory(a):null;return!0};var G=c.st;for(var H in E)E[a](H)&&!G[a](H)&&(G[H]=function(a){return function(){var b=arguments;return this.forEach(function(c){c[a].apply(c,b)})}}(H))}}(),B.was?A.win.Raphael=c:Raphael=c,c}),function(){var a,b,c,d,e=[].slice,f=function(a,b){return function(){return a.apply(b,arguments)}},g={}.hasOwnProperty,h=function(a,b){function c(){this.constructor=a}for(var d in b)g.call(b,d)&&(a[d]=b[d]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},i=[].indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(b in this&&this[b]===a)return b;return-1};b=window.Morris={},a=jQuery,b.EventEmitter=function(){function a(){}return a.prototype.on=function(a,b){return null==this.handlers&&(this.handlers={}),null==this.handlers[a]&&(this.handlers[a]=[]),this.handlers[a].push(b),this},a.prototype.fire=function(){var a,b,c,d,f,g,h;if(c=arguments[0],a=2<=arguments.length?e.call(arguments,1):[],null!=this.handlers&&null!=this.handlers[c]){for(g=this.handlers[c],h=[],d=0,f=g.length;f>d;d++)b=g[d],h.push(b.apply(null,a));return h}},a}(),b.commas=function(a){var b,c,d,e;return null!=a?(d=0>a?"-":"",b=Math.abs(a),c=Math.floor(b).toFixed(0),d+=c.replace(/(?=(?:\d{3})+$)(?!^)/g,","),e=b.toString(),e.length>c.length&&(d+=e.slice(c.length)),d):"-"},b.pad2=function(a){return(10>a?"0":"")+a},b.Grid=function(c){function d(b){this.resizeHandler=f(this.resizeHandler,this);var c=this;if(this.el=a("string"==typeof b.element?document.getElementById(b.element):b.element),null==this.el||0===this.el.length)throw new Error("Graph container element not found");"static"===this.el.css("position")&&this.el.css("position","relative"),this.options=a.extend({},this.gridDefaults,this.defaults||{},b),"string"==typeof this.options.units&&(this.options.postUnits=b.units),this.raphael=new Raphael(this.el[0]),this.elementWidth=null,this.elementHeight=null,this.dirty=!1,this.selectFrom=null,this.init&&this.init(),this.setData(this.options.data),this.el.bind("mousemove",function(a){var b,d,e,f,g;return d=c.el.offset(),g=a.pageX-d.left,c.selectFrom?(b=c.data[c.hitTest(Math.min(g,c.selectFrom))]._x,e=c.data[c.hitTest(Math.max(g,c.selectFrom))]._x,f=e-b,c.selectionRect.attr({"x":b,"width":f})):c.fire("hovermove",g,a.pageY-d.top)}),this.el.bind("mouseleave",function(){return c.selectFrom&&(c.selectionRect.hide(),c.selectFrom=null),c.fire("hoverout")}),this.el.bind("touchstart touchmove touchend",function(a){var b,d;return d=a.originalEvent.touches[0]||a.originalEvent.changedTouches[0],b=c.el.offset(),c.fire("hover",d.pageX-b.left,d.pageY-b.top),d}),this.el.bind("click",function(a){var b;return b=c.el.offset(),c.fire("gridclick",a.pageX-b.left,a.pageY-b.top)}),this.options.rangeSelect&&(this.selectionRect=this.raphael.rect(0,0,0,this.el.innerHeight()).attr({"fill":this.options.rangeSelectColor,"stroke":!1}).toBack().hide(),this.el.bind("mousedown",function(a){var b;return b=c.el.offset(),c.startRange(a.pageX-b.left)}),this.el.bind("mouseup",function(a){var b;return b=c.el.offset(),c.endRange(a.pageX-b.left),c.fire("hovermove",a.pageX-b.left,a.pageY-b.top)})),this.options.resize&&a(window).bind("resize",function(){return null!=c.timeoutId&&window.clearTimeout(c.timeoutId),c.timeoutId=window.setTimeout(c.resizeHandler,100)}),this.postInit&&this.postInit()}return h(d,c),d.prototype.gridDefaults={"dateFormat":null,"axes":!0,"grid":!0,"gridLineColor":"#aaa","gridStrokeWidth":.5,"gridTextColor":"#888","gridTextSize":12,"gridTextFamily":"sans-serif","gridTextWeight":"normal","hideHover":!1,"yLabelFormat":null,"xLabelAngle":0,"numLines":5,"padding":25,"parseTime":!0,"postUnits":"","preUnits":"","ymax":"auto","ymin":"auto 0","goals":[],"goalStrokeWidth":1,"goalLineColors":["#666633","#999966","#cc6666","#663333"],"events":[],"eventStrokeWidth":1,"eventLineColors":["#005a04","#ccffbb","#3a5f0b","#005502"],"rangeSelect":null,"rangeSelectColor":"#eef","resize":!1},d.prototype.setData=function(a,c){var d,e,f,g,h,i,j,k,l,m,n,o,p,q,r;return null==c&&(c=!0),this.options.data=a,null==a||0===a.length?(this.data=[],this.raphael.clear(),void(null!=this.hover&&this.hover.hide())):(o=this.cumulative?0:null,p=this.cumulative?0:null,this.options.goals.length>0&&(h=Math.min.apply(Math,this.options.goals),g=Math.max.apply(Math,this.options.goals),p=null!=p?Math.min(p,h):h,o=null!=o?Math.max(o,g):g),this.data=function(){var c,d,g;for(g=[],f=c=0,d=a.length;d>c;f=++c)j=a[f],i={"src":j},i.label=j[this.options.xkey],this.options.parseTime?(i.x=b.parseDate(i.label),this.options.dateFormat?i.label=this.options.dateFormat(i.x):"number"==typeof i.label&&(i.label=new Date(i.label).toString())):(i.x=f,this.options.xLabelFormat&&(i.label=this.options.xLabelFormat(i))),l=0,i.y=function(){var a,b,c,d;for(c=this.options.ykeys,d=[],e=a=0,b=c.length;b>a;e=++a)n=c[e],q=j[n],"string"==typeof q&&(q=parseFloat(q)),null!=q&&"number"!=typeof q&&(q=null),null!=q&&(this.cumulative?l+=q:null!=o?(o=Math.max(q,o),p=Math.min(q,p)):o=p=q),this.cumulative&&null!=l&&(o=Math.max(l,o),p=Math.min(l,p)),d.push(q);return d}.call(this),g.push(i);return g}.call(this),this.options.parseTime&&(this.data=this.data.sort(function(a,b){return(a.x>b.x)-(b.x>a.x)})),this.xmin=this.data[0].x,this.xmax=this.data[this.data.length-1].x,this.events=[],this.options.events.length>0&&(this.events=this.options.parseTime?function(){var a,c,e,f;for(e=this.options.events,f=[],a=0,c=e.length;c>a;a++)d=e[a],f.push(b.parseDate(d));return f}.call(this):this.options.events,this.xmax=Math.max(this.xmax,Math.max.apply(Math,this.events)),this.xmin=Math.min(this.xmin,Math.min.apply(Math,this.events))),this.xmin===this.xmax&&(this.xmin-=1,this.xmax+=1),this.ymin=this.yboundary("min",p),this.ymax=this.yboundary("max",o),this.ymin===this.ymax&&(p&&(this.ymin-=1),this.ymax+=1),((r=this.options.axes)===!0||"both"===r||"y"===r||this.options.grid===!0)&&(this.options.ymax===this.gridDefaults.ymax&&this.options.ymin===this.gridDefaults.ymin?(this.grid=this.autoGridLines(this.ymin,this.ymax,this.options.numLines),this.ymin=Math.min(this.ymin,this.grid[0]),this.ymax=Math.max(this.ymax,this.grid[this.grid.length-1])):(k=(this.ymax-this.ymin)/(this.options.numLines-1),this.grid=function(){var a,b,c,d;
|
|
for(d=[],m=a=b=this.ymin,c=this.ymax;k>0?c>=a:a>=c;m=a+=k)d.push(m);return d}.call(this))),this.dirty=!0,c?this.redraw():void 0)},d.prototype.yboundary=function(a,b){var c,d;return c=this.options["y"+a],"string"==typeof c?"auto"===c.slice(0,4)?c.length>5?(d=parseInt(c.slice(5),10),null==b?d:Math[a](b,d)):null!=b?b:0:parseInt(c,10):c},d.prototype.autoGridLines=function(a,b,c){var d,e,f,g,h,i,j,k,l;return h=b-a,l=Math.floor(Math.log(h)/Math.log(10)),j=Math.pow(10,l),e=Math.floor(a/j)*j,d=Math.ceil(b/j)*j,i=(d-e)/(c-1),1===j&&i>1&&Math.ceil(i)!==i&&(i=Math.ceil(i),d=e+i*(c-1)),0>e&&d>0&&(e=Math.floor(a/i)*i,d=Math.ceil(b/i)*i),1>i?(g=Math.floor(Math.log(i)/Math.log(10)),f=function(){var a,b;for(b=[],k=a=e;i>0?d>=a:a>=d;k=a+=i)b.push(parseFloat(k.toFixed(1-g)));return b}()):f=function(){var a,b;for(b=[],k=a=e;i>0?d>=a:a>=d;k=a+=i)b.push(k);return b}(),f},d.prototype._calc=function(){var a,b,c,d,e,f,g,h;return e=this.el.width(),c=this.el.height(),(this.elementWidth!==e||this.elementHeight!==c||this.dirty)&&(this.elementWidth=e,this.elementHeight=c,this.dirty=!1,this.left=this.options.padding,this.right=this.elementWidth-this.options.padding,this.top=this.options.padding,this.bottom=this.elementHeight-this.options.padding,((g=this.options.axes)===!0||"both"===g||"y"===g)&&(f=function(){var a,c,d,e;for(d=this.grid,e=[],a=0,c=d.length;c>a;a++)b=d[a],e.push(this.measureText(this.yAxisFormat(b)).width);return e}.call(this),this.left+=Math.max.apply(Math,f)),((h=this.options.axes)===!0||"both"===h||"x"===h)&&(a=function(){var a,b,c;for(c=[],d=a=0,b=this.data.length;b>=0?b>a:a>b;d=b>=0?++a:--a)c.push(this.measureText(this.data[d].text,-this.options.xLabelAngle).height);return c}.call(this),this.bottom-=Math.max.apply(Math,a)),this.width=Math.max(1,this.right-this.left),this.height=Math.max(1,this.bottom-this.top),this.dx=this.width/(this.xmax-this.xmin),this.dy=this.height/(this.ymax-this.ymin),this.calc)?this.calc():void 0},d.prototype.transY=function(a){return this.bottom-(a-this.ymin)*this.dy},d.prototype.transX=function(a){return 1===this.data.length?(this.left+this.right)/2:this.left+(a-this.xmin)*this.dx},d.prototype.redraw=function(){return this.raphael.clear(),this._calc(),this.drawGrid(),this.drawGoals(),this.drawEvents(),this.draw?this.draw():void 0},d.prototype.measureText=function(a,b){var c,d;return null==b&&(b=0),d=this.raphael.text(100,100,a).attr("font-size",this.options.gridTextSize).attr("font-family",this.options.gridTextFamily).attr("font-weight",this.options.gridTextWeight).rotate(b),c=d.getBBox(),d.remove(),c},d.prototype.yAxisFormat=function(a){return this.yLabelFormat(a)},d.prototype.yLabelFormat=function(a){return"function"==typeof this.options.yLabelFormat?this.options.yLabelFormat(a):""+this.options.preUnits+b.commas(a)+this.options.postUnits},d.prototype.drawGrid=function(){var a,b,c,d,e,f,g,h;if(this.options.grid!==!1||(e=this.options.axes)===!0||"both"===e||"y"===e){for(f=this.grid,h=[],c=0,d=f.length;d>c;c++)a=f[c],b=this.transY(a),((g=this.options.axes)===!0||"both"===g||"y"===g)&&this.drawYAxisLabel(this.left-this.options.padding/2,b,this.yAxisFormat(a)),h.push(this.options.grid?this.drawGridLine("M"+this.left+","+b+"H"+(this.left+this.width)):void 0);return h}},d.prototype.drawGoals=function(){var a,b,c,d,e,f,g;for(f=this.options.goals,g=[],c=d=0,e=f.length;e>d;c=++d)b=f[c],a=this.options.goalLineColors[c%this.options.goalLineColors.length],g.push(this.drawGoal(b,a));return g},d.prototype.drawEvents=function(){var a,b,c,d,e,f,g;for(f=this.events,g=[],c=d=0,e=f.length;e>d;c=++d)b=f[c],a=this.options.eventLineColors[c%this.options.eventLineColors.length],g.push(this.drawEvent(b,a));return g},d.prototype.drawGoal=function(a,b){return this.raphael.path("M"+this.left+","+this.transY(a)+"H"+this.right).attr("stroke",b).attr("stroke-width",this.options.goalStrokeWidth)},d.prototype.drawEvent=function(a,b){return this.raphael.path("M"+this.transX(a)+","+this.bottom+"V"+this.top).attr("stroke",b).attr("stroke-width",this.options.eventStrokeWidth)},d.prototype.drawYAxisLabel=function(a,b,c){return this.raphael.text(a,b,c).attr("font-size",this.options.gridTextSize).attr("font-family",this.options.gridTextFamily).attr("font-weight",this.options.gridTextWeight).attr("fill",this.options.gridTextColor).attr("text-anchor","end")},d.prototype.drawGridLine=function(a){return this.raphael.path(a).attr("stroke",this.options.gridLineColor).attr("stroke-width",this.options.gridStrokeWidth)},d.prototype.startRange=function(a){return this.hover.hide(),this.selectFrom=a,this.selectionRect.attr({"x":a,"width":0}).show()},d.prototype.endRange=function(a){var b,c;return this.selectFrom?(c=Math.min(this.selectFrom,a),b=Math.max(this.selectFrom,a),this.options.rangeSelect.call(this.el,{"start":this.data[this.hitTest(c)].x,"end":this.data[this.hitTest(b)].x}),this.selectFrom=null):void 0},d.prototype.resizeHandler=function(){return this.timeoutId=null,this.raphael.setSize(this.el.width(),this.el.height()),this.redraw()},d}(b.EventEmitter),b.parseDate=function(a){var b,c,d,e,f,g,h,i,j,k,l;return"number"==typeof a?a:(c=a.match(/^(\d+) Q(\d)$/),e=a.match(/^(\d+)-(\d+)$/),f=a.match(/^(\d+)-(\d+)-(\d+)$/),h=a.match(/^(\d+) W(\d+)$/),i=a.match(/^(\d+)-(\d+)-(\d+)[ T](\d+):(\d+)(Z|([+-])(\d\d):?(\d\d))?$/),j=a.match(/^(\d+)-(\d+)-(\d+)[ T](\d+):(\d+):(\d+(\.\d+)?)(Z|([+-])(\d\d):?(\d\d))?$/),c?new Date(parseInt(c[1],10),3*parseInt(c[2],10)-1,1).getTime():e?new Date(parseInt(e[1],10),parseInt(e[2],10)-1,1).getTime():f?new Date(parseInt(f[1],10),parseInt(f[2],10)-1,parseInt(f[3],10)).getTime():h?(k=new Date(parseInt(h[1],10),0,1),4!==k.getDay()&&k.setMonth(0,1+(4-k.getDay()+7)%7),k.getTime()+6048e5*parseInt(h[2],10)):i?i[6]?(g=0,"Z"!==i[6]&&(g=60*parseInt(i[8],10)+parseInt(i[9],10),"+"===i[7]&&(g=0-g)),Date.UTC(parseInt(i[1],10),parseInt(i[2],10)-1,parseInt(i[3],10),parseInt(i[4],10),parseInt(i[5],10)+g)):new Date(parseInt(i[1],10),parseInt(i[2],10)-1,parseInt(i[3],10),parseInt(i[4],10),parseInt(i[5],10)).getTime():j?(l=parseFloat(j[6]),b=Math.floor(l),d=Math.round(1e3*(l-b)),j[8]?(g=0,"Z"!==j[8]&&(g=60*parseInt(j[10],10)+parseInt(j[11],10),"+"===j[9]&&(g=0-g)),Date.UTC(parseInt(j[1],10),parseInt(j[2],10)-1,parseInt(j[3],10),parseInt(j[4],10),parseInt(j[5],10)+g,b,d)):new Date(parseInt(j[1],10),parseInt(j[2],10)-1,parseInt(j[3],10),parseInt(j[4],10),parseInt(j[5],10),b,d).getTime()):new Date(parseInt(a,10),0,1).getTime())},b.Hover=function(){function c(c){null==c&&(c={}),this.options=a.extend({},b.Hover.defaults,c),this.el=a("<div class='"+this.options["class"]+"'></div>"),this.el.hide(),this.options.parent.append(this.el)}return c.defaults={"class":"morris-hover morris-default-style"},c.prototype.update=function(a,b,c){return this.html(a),this.show(),this.moveTo(b,c)},c.prototype.html=function(a){return this.el.html(a)},c.prototype.moveTo=function(a,b){var c,d,e,f,g,h;return g=this.options.parent.innerWidth(),f=this.options.parent.innerHeight(),d=this.el.outerWidth(),c=this.el.outerHeight(),e=Math.min(Math.max(0,a-d/2),g-d),null!=b?(h=b-c-10,0>h&&(h=b+10,h+c>f&&(h=f/2-c/2))):h=f/2-c/2,this.el.css({"left":e+"px","top":parseInt(h)+"px"})},c.prototype.show=function(){return this.el.show()},c.prototype.hide=function(){return this.el.hide()},c}(),b.Line=function(a){function c(a){return this.hilight=f(this.hilight,this),this.onHoverOut=f(this.onHoverOut,this),this.onHoverMove=f(this.onHoverMove,this),this.onGridClick=f(this.onGridClick,this),this instanceof b.Line?void c.__super__.constructor.call(this,a):new b.Line(a)}return h(c,a),c.prototype.init=function(){return"always"!==this.options.hideHover?(this.hover=new b.Hover({"parent":this.el}),this.on("hovermove",this.onHoverMove),this.on("hoverout",this.onHoverOut),this.on("gridclick",this.onGridClick)):void 0},c.prototype.defaults={"lineWidth":3,"pointSize":4,"lineColors":["#0b62a4","#7A92A3","#4da74d","#afd8f8","#edc240","#cb4b4b","#9440ed"],"pointStrokeWidths":[1],"pointStrokeColors":["#ffffff"],"pointFillColors":[],"smooth":!0,"xLabels":"auto","xLabelFormat":null,"xLabelMargin":24,"continuousLine":!0,"hideHover":!1},c.prototype.calc=function(){return this.calcPoints(),this.generatePaths()},c.prototype.calcPoints=function(){var a,b,c,d,e,f;for(e=this.data,f=[],c=0,d=e.length;d>c;c++)a=e[c],a._x=this.transX(a.x),a._y=function(){var c,d,e,f;for(e=a.y,f=[],c=0,d=e.length;d>c;c++)b=e[c],f.push(null!=b?this.transY(b):b);return f}.call(this),f.push(a._ymax=Math.min.apply(Math,[this.bottom].concat(function(){var c,d,e,f;for(e=a._y,f=[],c=0,d=e.length;d>c;c++)b=e[c],null!=b&&f.push(b);return f}())));return f},c.prototype.hitTest=function(a){var b,c,d,e,f;if(0===this.data.length)return null;for(f=this.data.slice(1),b=d=0,e=f.length;e>d&&(c=f[b],!(a<(c._x+this.data[b]._x)/2));b=++d);return b},c.prototype.onGridClick=function(a,b){var c;return c=this.hitTest(a),this.fire("click",c,this.data[c].src,a,b)},c.prototype.onHoverMove=function(a){var b;return b=this.hitTest(a),this.displayHoverForRow(b)},c.prototype.onHoverOut=function(){return this.options.hideHover!==!1?this.displayHoverForRow(null):void 0},c.prototype.displayHoverForRow=function(a){var b;return null!=a?((b=this.hover).update.apply(b,this.hoverContentForRow(a)),this.hilight(a)):(this.hover.hide(),this.hilight())},c.prototype.hoverContentForRow=function(a){var b,c,d,e,f,g,h;for(d=this.data[a],b="<div class='morris-hover-row-label'>"+d.label+"</div>",h=d.y,c=f=0,g=h.length;g>f;c=++f)e=h[c],b+="<div class='morris-hover-point' style='color: "+this.colorFor(d,c,"label")+"'>\n "+this.options.labels[c]+":\n "+this.yLabelFormat(e)+"\n</div>";return"function"==typeof this.options.hoverCallback&&(b=this.options.hoverCallback(a,this.options,b,d.src)),[b,d._x,d._ymax]},c.prototype.generatePaths=function(){var a,c,d,e,f;return this.paths=function(){var g,h,j,k;for(k=[],d=g=0,h=this.options.ykeys.length;h>=0?h>g:g>h;d=h>=0?++g:--g)f="boolean"==typeof this.options.smooth?this.options.smooth:(j=this.options.ykeys[d],i.call(this.options.smooth,j)>=0),c=function(){var a,b,c,f;for(c=this.data,f=[],a=0,b=c.length;b>a;a++)e=c[a],void 0!==e._y[d]&&f.push({"x":e._x,"y":e._y[d]});return f}.call(this),this.options.continuousLine&&(c=function(){var b,d,e;for(e=[],b=0,d=c.length;d>b;b++)a=c[b],null!==a.y&&e.push(a);return e}()),k.push(c.length>1?b.Line.createPath(c,f,this.bottom):null);return k}.call(this)},c.prototype.draw=function(){var a;return((a=this.options.axes)===!0||"both"===a||"x"===a)&&this.drawXAxis(),this.drawSeries(),this.options.hideHover===!1?this.displayHoverForRow(this.data.length-1):void 0},c.prototype.drawXAxis=function(){var a,c,d,e,f,g,h,i,j,k,l=this;for(h=this.bottom+this.options.padding/2,f=null,e=null,a=function(a,b){var c,d,g,i,j;return c=l.drawXAxisLabel(l.transX(b),h,a),j=c.getBBox(),c.transform("r"+-l.options.xLabelAngle),d=c.getBBox(),c.transform("t0,"+d.height/2+"..."),0!==l.options.xLabelAngle&&(i=-.5*j.width*Math.cos(l.options.xLabelAngle*Math.PI/180),c.transform("t"+i+",0...")),d=c.getBBox(),(null==f||f>=d.x+d.width||null!=e&&e>=d.x)&&d.x>=0&&d.x+d.width<l.el.width()?(0!==l.options.xLabelAngle&&(g=1.25*l.options.gridTextSize/Math.sin(l.options.xLabelAngle*Math.PI/180),e=d.x-g),f=d.x-l.options.xLabelMargin):c.remove()},d=this.options.parseTime?1===this.data.length&&"auto"===this.options.xLabels?[[this.data[0].label,this.data[0].x]]:b.labelSeries(this.xmin,this.xmax,this.width,this.options.xLabels,this.options.xLabelFormat):function(){var a,b,c,d;for(c=this.data,d=[],a=0,b=c.length;b>a;a++)g=c[a],d.push([g.label,g.x]);return d}.call(this),d.reverse(),k=[],i=0,j=d.length;j>i;i++)c=d[i],k.push(a(c[0],c[1]));return k},c.prototype.drawSeries=function(){var a,b,c,d,e,f;for(this.seriesPoints=[],a=b=d=this.options.ykeys.length-1;0>=d?0>=b:b>=0;a=0>=d?++b:--b)this._drawLineFor(a);for(f=[],a=c=e=this.options.ykeys.length-1;0>=e?0>=c:c>=0;a=0>=e?++c:--c)f.push(this._drawPointFor(a));return f},c.prototype._drawPointFor=function(a){var b,c,d,e,f,g;for(this.seriesPoints[a]=[],f=this.data,g=[],d=0,e=f.length;e>d;d++)c=f[d],b=null,null!=c._y[a]&&(b=this.drawLinePoint(c._x,c._y[a],this.colorFor(c,a,"point"),a)),g.push(this.seriesPoints[a].push(b));return g},c.prototype._drawLineFor=function(a){var b;return b=this.paths[a],null!==b?this.drawLinePath(b,this.colorFor(null,a,"line"),a):void 0},c.createPath=function(a,c,d){var e,f,g,h,i,j,k,l,m,n,o,p,q,r;for(k="",c&&(g=b.Line.gradients(a)),l={"y":null},h=q=0,r=a.length;r>q;h=++q)e=a[h],null!=e.y&&(null!=l.y?c?(f=g[h],j=g[h-1],i=(e.x-l.x)/4,m=l.x+i,o=Math.min(d,l.y+i*j),n=e.x-i,p=Math.min(d,e.y-i*f),k+="C"+m+","+o+","+n+","+p+","+e.x+","+e.y):k+="L"+e.x+","+e.y:c&&null==g[h]||(k+="M"+e.x+","+e.y)),l=e;return k},c.gradients=function(a){var b,c,d,e,f,g,h,i;for(c=function(a,b){return(a.y-b.y)/(a.x-b.x)},i=[],d=g=0,h=a.length;h>g;d=++g)b=a[d],null!=b.y?(e=a[d+1]||{"y":null},f=a[d-1]||{"y":null},i.push(null!=f.y&&null!=e.y?c(f,e):null!=f.y?c(f,b):null!=e.y?c(b,e):null)):i.push(null);return i},c.prototype.hilight=function(a){var b,c,d,e,f;if(null!==this.prevHilight&&this.prevHilight!==a)for(b=c=0,e=this.seriesPoints.length-1;e>=0?e>=c:c>=e;b=e>=0?++c:--c)this.seriesPoints[b][this.prevHilight]&&this.seriesPoints[b][this.prevHilight].animate(this.pointShrinkSeries(b));if(null!==a&&this.prevHilight!==a)for(b=d=0,f=this.seriesPoints.length-1;f>=0?f>=d:d>=f;b=f>=0?++d:--d)this.seriesPoints[b][a]&&this.seriesPoints[b][a].animate(this.pointGrowSeries(b));return this.prevHilight=a},c.prototype.colorFor=function(a,b,c){return"function"==typeof this.options.lineColors?this.options.lineColors.call(this,a,b,c):"point"===c?this.options.pointFillColors[b%this.options.pointFillColors.length]||this.options.lineColors[b%this.options.lineColors.length]:this.options.lineColors[b%this.options.lineColors.length]},c.prototype.drawXAxisLabel=function(a,b,c){return this.raphael.text(a,b,c).attr("font-size",this.options.gridTextSize).attr("font-family",this.options.gridTextFamily).attr("font-weight",this.options.gridTextWeight).attr("fill",this.options.gridTextColor)},c.prototype.drawLinePath=function(a,b,c){return this.raphael.path(a).attr("stroke",b).attr("stroke-width",this.lineWidthForSeries(c))},c.prototype.drawLinePoint=function(a,b,c,d){return this.raphael.circle(a,b,this.pointSizeForSeries(d)).attr("fill",c).attr("stroke-width",this.pointStrokeWidthForSeries(d)).attr("stroke",this.pointStrokeColorForSeries(d))},c.prototype.pointStrokeWidthForSeries=function(a){return this.options.pointStrokeWidths[a%this.options.pointStrokeWidths.length]},c.prototype.pointStrokeColorForSeries=function(a){return this.options.pointStrokeColors[a%this.options.pointStrokeColors.length]},c.prototype.lineWidthForSeries=function(a){return this.options.lineWidth instanceof Array?this.options.lineWidth[a%this.options.lineWidth.length]:this.options.lineWidth},c.prototype.pointSizeForSeries=function(a){return this.options.pointSize instanceof Array?this.options.pointSize[a%this.options.pointSize.length]:this.options.pointSize},c.prototype.pointGrowSeries=function(a){return Raphael.animation({"r":this.pointSizeForSeries(a)+3},25,"linear")},c.prototype.pointShrinkSeries=function(a){return Raphael.animation({"r":this.pointSizeForSeries(a)},25,"linear")},c}(b.Grid),b.labelSeries=function(c,d,e,f,g){var h,i,j,k,l,m,n,o,p,q,r;if(j=200*(d-c)/e,i=new Date(c),n=b.LABEL_SPECS[f],void 0===n)for(r=b.AUTO_LABEL_ORDER,p=0,q=r.length;q>p;p++)if(k=r[p],m=b.LABEL_SPECS[k],j>=m.span){n=m;break}for(void 0===n&&(n=b.LABEL_SPECS.second),g&&(n=a.extend({},n,{"fmt":g})),h=n.start(i),l=[];(o=h.getTime())<=d;)o>=c&&l.push([n.fmt(h),o]),n.incr(h);return l},c=function(a){return{"span":60*a*1e3,"start":function(a){return new Date(a.getFullYear(),a.getMonth(),a.getDate(),a.getHours())},"fmt":function(a){return""+b.pad2(a.getHours())+":"+b.pad2(a.getMinutes())},"incr":function(b){return b.setUTCMinutes(b.getUTCMinutes()+a)}}},d=function(a){return{"span":1e3*a,"start":function(a){return new Date(a.getFullYear(),a.getMonth(),a.getDate(),a.getHours(),a.getMinutes())},"fmt":function(a){return""+b.pad2(a.getHours())+":"+b.pad2(a.getMinutes())+":"+b.pad2(a.getSeconds())},"incr":function(b){return b.setUTCSeconds(b.getUTCSeconds()+a)}}},b.LABEL_SPECS={"decade":{"span":1728e8,"start":function(a){return new Date(a.getFullYear()-a.getFullYear()%10,0,1)},"fmt":function(a){return""+a.getFullYear()},"incr":function(a){return a.setFullYear(a.getFullYear()+10)}},"year":{"span":1728e7,"start":function(a){return new Date(a.getFullYear(),0,1)},"fmt":function(a){return""+a.getFullYear()},"incr":function(a){return a.setFullYear(a.getFullYear()+1)}},"month":{"span":24192e5,"start":function(a){return new Date(a.getFullYear(),a.getMonth(),1)},"fmt":function(a){return""+a.getFullYear()+"-"+b.pad2(a.getMonth()+1)},"incr":function(a){return a.setMonth(a.getMonth()+1)}},"week":{"span":6048e5,"start":function(a){return new Date(a.getFullYear(),a.getMonth(),a.getDate())},"fmt":function(a){return""+a.getFullYear()+"-"+b.pad2(a.getMonth()+1)+"-"+b.pad2(a.getDate())},"incr":function(a){return a.setDate(a.getDate()+7)}},"day":{"span":864e5,"start":function(a){return new Date(a.getFullYear(),a.getMonth(),a.getDate())},"fmt":function(a){return""+a.getFullYear()+"-"+b.pad2(a.getMonth()+1)+"-"+b.pad2(a.getDate())},"incr":function(a){return a.setDate(a.getDate()+1)}},"hour":c(60),"30min":c(30),"15min":c(15),"10min":c(10),"5min":c(5),"minute":c(1),"30sec":d(30),"15sec":d(15),"10sec":d(10),"5sec":d(5),"second":d(1)},b.AUTO_LABEL_ORDER=["decade","year","month","week","day","hour","30min","15min","10min","5min","minute","30sec","15sec","10sec","5sec","second"],b.Area=function(c){function d(c){var f;return this instanceof b.Area?(f=a.extend({},e,c),this.cumulative=!f.behaveLikeLine,"auto"===f.fillOpacity&&(f.fillOpacity=f.behaveLikeLine?.8:1),void d.__super__.constructor.call(this,f)):new b.Area(c)}var e;return h(d,c),e={"fillOpacity":"auto","behaveLikeLine":!1},d.prototype.calcPoints=function(){var a,b,c,d,e,f,g;for(f=this.data,g=[],d=0,e=f.length;e>d;d++)a=f[d],a._x=this.transX(a.x),b=0,a._y=function(){var d,e,f,g;for(f=a.y,g=[],d=0,e=f.length;e>d;d++)c=f[d],this.options.behaveLikeLine?g.push(this.transY(c)):(b+=c||0,g.push(this.transY(b)));return g}.call(this),g.push(a._ymax=Math.max.apply(Math,a._y));return g},d.prototype.drawSeries=function(){var a,b,c,d,e,f,g,h;for(this.seriesPoints=[],b=this.options.behaveLikeLine?function(){f=[];for(var a=0,b=this.options.ykeys.length-1;b>=0?b>=a:a>=b;b>=0?a++:a--)f.push(a);return f}.apply(this):function(){g=[];for(var a=e=this.options.ykeys.length-1;0>=e?0>=a:a>=0;0>=e?a++:a--)g.push(a);return g}.apply(this),h=[],c=0,d=b.length;d>c;c++)a=b[c],this._drawFillFor(a),this._drawLineFor(a),h.push(this._drawPointFor(a));return h},d.prototype._drawFillFor=function(a){var b;return b=this.paths[a],null!==b?(b+="L"+this.transX(this.xmax)+","+this.bottom+"L"+this.transX(this.xmin)+","+this.bottom+"Z",this.drawFilledPath(b,this.fillForSeries(a))):void 0},d.prototype.fillForSeries=function(a){var b;return b=Raphael.rgb2hsl(this.colorFor(this.data[a],a,"line")),Raphael.hsl(b.h,this.options.behaveLikeLine?.9*b.s:.75*b.s,Math.min(.98,this.options.behaveLikeLine?1.2*b.l:1.25*b.l))},d.prototype.drawFilledPath=function(a,b){return this.raphael.path(a).attr("fill",b).attr("fill-opacity",this.options.fillOpacity).attr("stroke","none")},d}(b.Line),b.Bar=function(c){function d(c){return this.onHoverOut=f(this.onHoverOut,this),this.onHoverMove=f(this.onHoverMove,this),this.onGridClick=f(this.onGridClick,this),this instanceof b.Bar?void d.__super__.constructor.call(this,a.extend({},c,{"parseTime":!1})):new b.Bar(c)}return h(d,c),d.prototype.init=function(){return this.cumulative=this.options.stacked,"always"!==this.options.hideHover?(this.hover=new b.Hover({"parent":this.el}),this.on("hovermove",this.onHoverMove),this.on("hoverout",this.onHoverOut),this.on("gridclick",this.onGridClick)):void 0},d.prototype.defaults={"barSizeRatio":.75,"barGap":3,"barColors":["#0b62a4","#7a92a3","#4da74d","#afd8f8","#edc240","#cb4b4b","#9440ed"],"barOpacity":1,"barRadius":[0,0,0,0],"xLabelMargin":50},d.prototype.calc=function(){var a;return this.calcBars(),this.options.hideHover===!1?(a=this.hover).update.apply(a,this.hoverContentForRow(this.data.length-1)):void 0},d.prototype.calcBars=function(){var a,b,c,d,e,f,g;for(f=this.data,g=[],a=d=0,e=f.length;e>d;a=++d)b=f[a],b._x=this.left+this.width*(a+.5)/this.data.length,g.push(b._y=function(){var a,d,e,f;for(e=b.y,f=[],a=0,d=e.length;d>a;a++)c=e[a],f.push(null!=c?this.transY(c):null);return f}.call(this));return g},d.prototype.draw=function(){var a;return((a=this.options.axes)===!0||"both"===a||"x"===a)&&this.drawXAxis(),this.drawSeries()},d.prototype.drawXAxis=function(){var a,b,c,d,e,f,g,h,i,j,k,l,m;for(j=this.bottom+(this.options.xAxisLabelTopPadding||this.options.padding/2),g=null,f=null,m=[],a=k=0,l=this.data.length;l>=0?l>k:k>l;a=l>=0?++k:--k)h=this.data[this.data.length-1-a],b=this.drawXAxisLabel(h._x,j,h.label),i=b.getBBox(),b.transform("r"+-this.options.xLabelAngle),c=b.getBBox(),b.transform("t0,"+c.height/2+"..."),0!==this.options.xLabelAngle&&(e=-.5*i.width*Math.cos(this.options.xLabelAngle*Math.PI/180),b.transform("t"+e+",0...")),(null==g||g>=c.x+c.width||null!=f&&f>=c.x)&&c.x>=0&&c.x+c.width<this.el.width()?(0!==this.options.xLabelAngle&&(d=1.25*this.options.gridTextSize/Math.sin(this.options.xLabelAngle*Math.PI/180),f=c.x-d),m.push(g=c.x-this.options.xLabelMargin)):m.push(b.remove());return m},d.prototype.drawSeries=function(){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o;return c=this.width/this.options.data.length,h=null!=this.options.stacked?1:this.options.ykeys.length,a=(c*this.options.barSizeRatio-this.options.barGap*(h-1))/h,this.options.barSize&&(a=Math.min(a,this.options.barSize)),l=c-a*h-this.options.barGap*(h-1),g=l/2,o=this.ymin<=0&&this.ymax>=0?this.transY(0):null,this.bars=function(){var h,l,p,q;for(p=this.data,q=[],d=h=0,l=p.length;l>h;d=++h)i=p[d],e=0,q.push(function(){var h,l,p,q;for(p=i._y,q=[],j=h=0,l=p.length;l>h;j=++h)n=p[j],null!==n?(o?(m=Math.min(n,o),b=Math.max(n,o)):(m=n,b=this.bottom),f=this.left+d*c+g,this.options.stacked||(f+=j*(a+this.options.barGap)),k=b-m,this.options.stacked&&(m-=e),this.drawBar(f,m,a,k,this.colorFor(i,j,"bar"),this.options.barOpacity,this.options.barRadius),q.push(e+=k)):q.push(null);return q}.call(this));return q}.call(this)},d.prototype.colorFor=function(a,b,c){var d,e;return"function"==typeof this.options.barColors?(d={"x":a.x,"y":a.y[b],"label":a.label},e={"index":b,"key":this.options.ykeys[b],"label":this.options.labels[b]},this.options.barColors.call(this,d,e,c)):this.options.barColors[b%this.options.barColors.length]},d.prototype.hitTest=function(a){return 0===this.data.length?null:(a=Math.max(Math.min(a,this.right),this.left),Math.min(this.data.length-1,Math.floor((a-this.left)/(this.width/this.data.length))))},d.prototype.onGridClick=function(a,b){var c;return c=this.hitTest(a),this.fire("click",c,this.data[c].src,a,b)},d.prototype.onHoverMove=function(a){var b,c;return b=this.hitTest(a),(c=this.hover).update.apply(c,this.hoverContentForRow(b))},d.prototype.onHoverOut=function(){return this.options.hideHover!==!1?this.hover.hide():void 0},d.prototype.hoverContentForRow=function(a){var b,c,d,e,f,g,h,i;for(d=this.data[a],b="<div class='morris-hover-row-label'>"+d.label+"</div>",i=d.y,c=g=0,h=i.length;h>g;c=++g)f=i[c],b+="<div class='morris-hover-point' style='color: "+this.colorFor(d,c,"label")+"'>\n "+this.options.labels[c]+":\n "+this.yLabelFormat(f)+"\n</div>";return"function"==typeof this.options.hoverCallback&&(b=this.options.hoverCallback(a,this.options,b,d.src)),e=this.left+(a+.5)*this.width/this.data.length,[b,e]},d.prototype.drawXAxisLabel=function(a,b,c){var d;return d=this.raphael.text(a,b,c).attr("font-size",this.options.gridTextSize).attr("font-family",this.options.gridTextFamily).attr("font-weight",this.options.gridTextWeight).attr("fill",this.options.gridTextColor)},d.prototype.drawBar=function(a,b,c,d,e,f,g){var h,i;return h=Math.max.apply(Math,g),i=0===h||h>d?this.raphael.rect(a,b,c,d):this.raphael.path(this.roundedRect(a,b,c,d,g)),i.attr("fill",e).attr("fill-opacity",f).attr("stroke","none")},d.prototype.roundedRect=function(a,b,c,d,e){return null==e&&(e=[0,0,0,0]),["M",a,e[0]+b,"Q",a,b,a+e[0],b,"L",a+c-e[1],b,"Q",a+c,b,a+c,b+e[1],"L",a+c,b+d-e[2],"Q",a+c,b+d,a+c-e[2],b+d,"L",a+e[3],b+d,"Q",a,b+d,a,b+d-e[3],"Z"]},d}(b.Grid),b.Donut=function(c){function d(c){this.resizeHandler=f(this.resizeHandler,this),this.select=f(this.select,this),this.click=f(this.click,this);var d=this;if(!(this instanceof b.Donut))return new b.Donut(c);if(this.options=a.extend({},this.defaults,c),this.el=a("string"==typeof c.element?document.getElementById(c.element):c.element),null===this.el||0===this.el.length)throw new Error("Graph placeholder not found.");void 0!==c.data&&0!==c.data.length&&(this.raphael=new Raphael(this.el[0]),this.options.resize&&a(window).bind("resize",function(){return null!=d.timeoutId&&window.clearTimeout(d.timeoutId),d.timeoutId=window.setTimeout(d.resizeHandler,100)}),this.setData(c.data))}return h(d,c),d.prototype.defaults={"colors":["#0B62A4","#3980B5","#679DC6","#95BBD7","#B0CCE1","#095791","#095085","#083E67","#052C48","#042135"],"backgroundColor":"#FFFFFF","labelColor":"#000000","formatter":b.commas,"resize":!1},d.prototype.redraw=function(){var a,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x;for(this.raphael.clear(),c=this.el.width()/2,d=this.el.height()/2,n=(Math.min(c,d)-10)/3,l=0,u=this.values,o=0,r=u.length;r>o;o++)m=u[o],l+=m;for(i=5/(2*n),a=1.9999*Math.PI-i*this.data.length,g=0,f=0,this.segments=[],v=this.values,e=p=0,s=v.length;s>p;e=++p)m=v[e],j=g+i+a*(m/l),k=new b.DonutSegment(c,d,2*n,n,g,j,this.data[e].color||this.options.colors[f%this.options.colors.length],this.options.backgroundColor,f,this.raphael),k.render(),this.segments.push(k),k.on("hover",this.select),k.on("click",this.click),g=j,f+=1;for(this.text1=this.drawEmptyDonutLabel(c,d-10,this.options.labelColor,15,800),this.text2=this.drawEmptyDonutLabel(c,d+10,this.options.labelColor,14),h=Math.max.apply(Math,this.values),f=0,w=this.values,x=[],q=0,t=w.length;t>q;q++){if(m=w[q],m===h){this.select(f);break}x.push(f+=1)}return x},d.prototype.setData=function(a){var b;return this.data=a,this.values=function(){var a,c,d,e;for(d=this.data,e=[],a=0,c=d.length;c>a;a++)b=d[a],e.push(parseFloat(b.value));return e}.call(this),this.redraw()},d.prototype.click=function(a){return this.fire("click",a,this.data[a])},d.prototype.select=function(a){var b,c,d,e,f,g;for(g=this.segments,e=0,f=g.length;f>e;e++)c=g[e],c.deselect();return d=this.segments[a],d.select(),b=this.data[a],this.setLabels(b.label,this.options.formatter(b.value,b))},d.prototype.setLabels=function(a,b){var c,d,e,f,g,h,i,j;return c=2*(Math.min(this.el.width()/2,this.el.height()/2)-10)/3,f=1.8*c,e=c/2,d=c/3,this.text1.attr({"text":a,"transform":""}),g=this.text1.getBBox(),h=Math.min(f/g.width,e/g.height),this.text1.attr({"transform":"S"+h+","+h+","+(g.x+g.width/2)+","+(g.y+g.height)}),this.text2.attr({"text":b,"transform":""}),i=this.text2.getBBox(),j=Math.min(f/i.width,d/i.height),this.text2.attr({"transform":"S"+j+","+j+","+(i.x+i.width/2)+","+i.y})},d.prototype.drawEmptyDonutLabel=function(a,b,c,d,e){var f;return f=this.raphael.text(a,b,"").attr("font-size",d).attr("fill",c),null!=e&&f.attr("font-weight",e),f},d.prototype.resizeHandler=function(){return this.timeoutId=null,this.raphael.setSize(this.el.width(),this.el.height()),this.redraw()},d}(b.EventEmitter),b.DonutSegment=function(a){function b(a,b,c,d,e,g,h,i,j,k){this.cx=a,this.cy=b,this.inner=c,this.outer=d,this.color=h,this.backgroundColor=i,this.index=j,this.raphael=k,this.deselect=f(this.deselect,this),this.select=f(this.select,this),this.sin_p0=Math.sin(e),this.cos_p0=Math.cos(e),this.sin_p1=Math.sin(g),this.cos_p1=Math.cos(g),this.is_long=g-e>Math.PI?1:0,this.path=this.calcSegment(this.inner+3,this.inner+this.outer-5),this.selectedPath=this.calcSegment(this.inner+3,this.inner+this.outer),this.hilight=this.calcArc(this.inner)}return h(b,a),b.prototype.calcArcPoints=function(a){return[this.cx+a*this.sin_p0,this.cy+a*this.cos_p0,this.cx+a*this.sin_p1,this.cy+a*this.cos_p1]},b.prototype.calcSegment=function(a,b){var c,d,e,f,g,h,i,j,k,l;return k=this.calcArcPoints(a),c=k[0],e=k[1],d=k[2],f=k[3],l=this.calcArcPoints(b),g=l[0],i=l[1],h=l[2],j=l[3],"M"+c+","+e+("A"+a+","+a+",0,"+this.is_long+",0,"+d+","+f)+("L"+h+","+j)+("A"+b+","+b+",0,"+this.is_long+",1,"+g+","+i)+"Z"},b.prototype.calcArc=function(a){var b,c,d,e,f;return f=this.calcArcPoints(a),b=f[0],d=f[1],c=f[2],e=f[3],"M"+b+","+d+("A"+a+","+a+",0,"+this.is_long+",0,"+c+","+e)},b.prototype.render=function(){var a=this;return this.arc=this.drawDonutArc(this.hilight,this.color),this.seg=this.drawDonutSegment(this.path,this.color,this.backgroundColor,function(){return a.fire("hover",a.index)},function(){return a.fire("click",a.index)})},b.prototype.drawDonutArc=function(a,b){return this.raphael.path(a).attr({"stroke":b,"stroke-width":2,"opacity":0})},b.prototype.drawDonutSegment=function(a,b,c,d,e){return this.raphael.path(a).attr({"fill":b,"stroke":c,"stroke-width":3}).hover(d).click(e)},b.prototype.select=function(){return this.selected?void 0:(this.seg.animate({"path":this.selectedPath},150,"<>"),this.arc.animate({"opacity":1},150,"<>"),this.selected=!0)},b.prototype.deselect=function(){return this.selected?(this.seg.animate({"path":this.path},150,"<>"),this.arc.animate({"opacity":0},150,"<>"),this.selected=!1):void 0},b}(b.EventEmitter)}.call(this),function(a){a.color={},a.color.make=function(b,c,d,e){var f={};return f.r=b||0,f.g=c||0,f.b=d||0,f.a=null!=e?e:1,f.add=function(a,b){for(var c=0;c<a.length;++c)f[a.charAt(c)]+=b;return f.normalize()},f.scale=function(a,b){for(var c=0;c<a.length;++c)f[a.charAt(c)]*=b;return f.normalize()},f.toString=function(){return f.a>=1?"rgb("+[f.r,f.g,f.b].join(",")+")":"rgba("+[f.r,f.g,f.b,f.a].join(",")+")"},f.normalize=function(){function a(a,b,c){return a>b?a:b>c?c:b}return f.r=a(0,parseInt(f.r),255),f.g=a(0,parseInt(f.g),255),f.b=a(0,parseInt(f.b),255),f.a=a(0,f.a,1),f},f.clone=function(){return a.color.make(f.r,f.b,f.g,f.a)},f.normalize()},a.color.extract=function(b,c){var d;do{if(d=b.css(c).toLowerCase(),""!=d&&"transparent"!=d)break;b=b.parent()}while(b.length&&!a.nodeName(b.get(0),"body"));return"rgba(0, 0, 0, 0)"==d&&(d="transparent"),a.color.parse(d)},a.color.parse=function(c){var d,e=a.color.make;if(d=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(c))return e(parseInt(d[1],10),parseInt(d[2],10),parseInt(d[3],10));if(d=/rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(c))return e(parseInt(d[1],10),parseInt(d[2],10),parseInt(d[3],10),parseFloat(d[4]));if(d=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(c))return e(2.55*parseFloat(d[1]),2.55*parseFloat(d[2]),2.55*parseFloat(d[3]));if(d=/rgba\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(c))return e(2.55*parseFloat(d[1]),2.55*parseFloat(d[2]),2.55*parseFloat(d[3]),parseFloat(d[4]));if(d=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(c))return e(parseInt(d[1],16),parseInt(d[2],16),parseInt(d[3],16));if(d=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(c))return e(parseInt(d[1]+d[1],16),parseInt(d[2]+d[2],16),parseInt(d[3]+d[3],16));var f=a.trim(c).toLowerCase();return"transparent"==f?e(255,255,255,0):(d=b[f]||[0,0,0],e(d[0],d[1],d[2]))};var b={"aqua":[0,255,255],"azure":[240,255,255],"beige":[245,245,220],"black":[0,0,0],"blue":[0,0,255],"brown":[165,42,42],"cyan":[0,255,255],"darkblue":[0,0,139],"darkcyan":[0,139,139],"darkgrey":[169,169,169],"darkgreen":[0,100,0],"darkkhaki":[189,183,107],"darkmagenta":[139,0,139],"darkolivegreen":[85,107,47],"darkorange":[255,140,0],"darkorchid":[153,50,204],"darkred":[139,0,0],"darksalmon":[233,150,122],"darkviolet":[148,0,211],"fuchsia":[255,0,255],"gold":[255,215,0],"green":[0,128,0],"indigo":[75,0,130],"khaki":[240,230,140],"lightblue":[173,216,230],"lightcyan":[224,255,255],"lightgreen":[144,238,144],"lightgrey":[211,211,211],"lightpink":[255,182,193],"lightyellow":[255,255,224],"lime":[0,255,0],"magenta":[255,0,255],"maroon":[128,0,0],"navy":[0,0,128],"olive":[128,128,0],"orange":[255,165,0],"pink":[255,192,203],"purple":[128,0,128],"violet":[128,0,128],"red":[255,0,0],"silver":[192,192,192],"white":[255,255,255],"yellow":[255,255,0]}
|
|
}(jQuery),function(a){function b(b,c){var d=c.children("."+b)[0];if(null==d&&(d=document.createElement("canvas"),d.className=b,a(d).css({"direction":"ltr","position":"absolute","left":0,"top":0}).appendTo(c),!d.getContext)){if(!window.G_vmlCanvasManager)throw new Error("Canvas is not available. If you're using IE with a fall-back such as Excanvas, then there's either a mistake in your conditional include, or the page has no DOCTYPE and is rendering in Quirks Mode.");d=window.G_vmlCanvasManager.initElement(d)}this.element=d;var e=this.context=d.getContext("2d"),f=window.devicePixelRatio||1,g=e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;this.pixelRatio=f/g,this.resize(c.width(),c.height()),this.textContainer=null,this.text={},this._textCache={}}function c(c,e,f,g){function h(a,b){b=[qb].concat(b);for(var c=0;c<a.length;++c)a[c].apply(this,b)}function i(){for(var c={"Canvas":b},d=0;d<g.length;++d){var e=g[d];e.init(qb,c),e.options&&a.extend(!0,eb,e.options)}}function j(b){a.extend(!0,eb,b),b&&b.colors&&(eb.colors=b.colors),null==eb.xaxis.color&&(eb.xaxis.color=a.color.parse(eb.grid.color).scale("a",.22).toString()),null==eb.yaxis.color&&(eb.yaxis.color=a.color.parse(eb.grid.color).scale("a",.22).toString()),null==eb.xaxis.tickColor&&(eb.xaxis.tickColor=eb.grid.tickColor||eb.xaxis.color),null==eb.yaxis.tickColor&&(eb.yaxis.tickColor=eb.grid.tickColor||eb.yaxis.color),null==eb.grid.borderColor&&(eb.grid.borderColor=eb.grid.color),null==eb.grid.tickColor&&(eb.grid.tickColor=a.color.parse(eb.grid.color).scale("a",.22).toString());var d,e,f,g=c.css("font-size"),i=g?+g.replace("px",""):13,j={"style":c.css("font-style"),"size":Math.round(.8*i),"variant":c.css("font-variant"),"weight":c.css("font-weight"),"family":c.css("font-family")};for(f=eb.xaxes.length||1,d=0;f>d;++d)e=eb.xaxes[d],e&&!e.tickColor&&(e.tickColor=e.color),e=a.extend(!0,{},eb.xaxis,e),eb.xaxes[d]=e,e.font&&(e.font=a.extend({},j,e.font),e.font.color||(e.font.color=e.color),e.font.lineHeight||(e.font.lineHeight=Math.round(1.15*e.font.size)));for(f=eb.yaxes.length||1,d=0;f>d;++d)e=eb.yaxes[d],e&&!e.tickColor&&(e.tickColor=e.color),e=a.extend(!0,{},eb.yaxis,e),eb.yaxes[d]=e,e.font&&(e.font=a.extend({},j,e.font),e.font.color||(e.font.color=e.color),e.font.lineHeight||(e.font.lineHeight=Math.round(1.15*e.font.size)));for(eb.xaxis.noTicks&&null==eb.xaxis.ticks&&(eb.xaxis.ticks=eb.xaxis.noTicks),eb.yaxis.noTicks&&null==eb.yaxis.ticks&&(eb.yaxis.ticks=eb.yaxis.noTicks),eb.x2axis&&(eb.xaxes[1]=a.extend(!0,{},eb.xaxis,eb.x2axis),eb.xaxes[1].position="top"),eb.y2axis&&(eb.yaxes[1]=a.extend(!0,{},eb.yaxis,eb.y2axis),eb.yaxes[1].position="right"),eb.grid.coloredAreas&&(eb.grid.markings=eb.grid.coloredAreas),eb.grid.coloredAreasColor&&(eb.grid.markingsColor=eb.grid.coloredAreasColor),eb.lines&&a.extend(!0,eb.series.lines,eb.lines),eb.points&&a.extend(!0,eb.series.points,eb.points),eb.bars&&a.extend(!0,eb.series.bars,eb.bars),null!=eb.shadowSize&&(eb.series.shadowSize=eb.shadowSize),null!=eb.highlightColor&&(eb.series.highlightColor=eb.highlightColor),d=0;d<eb.xaxes.length;++d)q(kb,d+1).options=eb.xaxes[d];for(d=0;d<eb.yaxes.length;++d)q(lb,d+1).options=eb.yaxes[d];for(var k in pb)eb.hooks[k]&&eb.hooks[k].length&&(pb[k]=pb[k].concat(eb.hooks[k]));h(pb.processOptions,[eb])}function k(a){db=l(a),r(),s()}function l(b){for(var c=[],d=0;d<b.length;++d){var e=a.extend(!0,{},eb.series);null!=b[d].data?(e.data=b[d].data,delete b[d].data,a.extend(!0,e,b[d]),b[d].data=e.data):e.data=b[d],c.push(e)}return c}function m(a,b){var c=a[b+"axis"];return"object"==typeof c&&(c=c.n),"number"!=typeof c&&(c=1),c}function n(){return a.grep(kb.concat(lb),function(a){return a})}function o(a){var b,c,d={};for(b=0;b<kb.length;++b)c=kb[b],c&&c.used&&(d["x"+c.n]=c.c2p(a.left));for(b=0;b<lb.length;++b)c=lb[b],c&&c.used&&(d["y"+c.n]=c.c2p(a.top));return void 0!==d.x1&&(d.x=d.x1),void 0!==d.y1&&(d.y=d.y1),d}function p(a){var b,c,d,e={};for(b=0;b<kb.length;++b)if(c=kb[b],c&&c.used&&(d="x"+c.n,null==a[d]&&1==c.n&&(d="x"),null!=a[d])){e.left=c.p2c(a[d]);break}for(b=0;b<lb.length;++b)if(c=lb[b],c&&c.used&&(d="y"+c.n,null==a[d]&&1==c.n&&(d="y"),null!=a[d])){e.top=c.p2c(a[d]);break}return e}function q(b,c){return b[c-1]||(b[c-1]={"n":c,"direction":b==kb?"x":"y","options":a.extend(!0,{},b==kb?eb.xaxis:eb.yaxis)}),b[c-1]}function r(){var b,c=db.length,d=-1;for(b=0;b<db.length;++b){var e=db[b].color;null!=e&&(c--,"number"==typeof e&&e>d&&(d=e))}d>=c&&(c=d+1);var f,g=[],h=eb.colors,i=h.length,j=0;for(b=0;c>b;b++)f=a.color.parse(h[b%i]||"#666"),b%i==0&&b&&(j=j>=0?.5>j?-j-.2:0:-j),g[b]=f.scale("rgb",1+j);var k,l=0;for(b=0;b<db.length;++b){if(k=db[b],null==k.color?(k.color=g[l].toString(),++l):"number"==typeof k.color&&(k.color=g[k.color].toString()),null==k.lines.show){var n,o=!0;for(n in k)if(k[n]&&k[n].show){o=!1;break}o&&(k.lines.show=!0)}null==k.lines.zero&&(k.lines.zero=!!k.lines.fill),k.xaxis=q(kb,m(k,"x")),k.yaxis=q(lb,m(k,"y"))}}function s(){function b(a,b,c){b<a.datamin&&b!=-s&&(a.datamin=b),c>a.datamax&&c!=s&&(a.datamax=c)}var c,d,e,f,g,i,j,k,l,m,o,p,q=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,s=Number.MAX_VALUE;for(a.each(n(),function(a,b){b.datamin=q,b.datamax=r,b.used=!1}),c=0;c<db.length;++c)g=db[c],g.datapoints={"points":[]},h(pb.processRawData,[g,g.data,g.datapoints]);for(c=0;c<db.length;++c){if(g=db[c],o=g.data,p=g.datapoints.format,!p){if(p=[],p.push({"x":!0,"number":!0,"required":!0}),p.push({"y":!0,"number":!0,"required":!0}),g.bars.show||g.lines.show&&g.lines.fill){var t=!!(g.bars.show&&g.bars.zero||g.lines.show&&g.lines.zero);p.push({"y":!0,"number":!0,"required":!1,"defaultValue":0,"autoscale":t}),g.bars.horizontal&&(delete p[p.length-1].y,p[p.length-1].x=!0)}g.datapoints.format=p}if(null==g.datapoints.pointsize){g.datapoints.pointsize=p.length,j=g.datapoints.pointsize,i=g.datapoints.points;var u=g.lines.show&&g.lines.steps;for(g.xaxis.used=g.yaxis.used=!0,d=e=0;d<o.length;++d,e+=j){m=o[d];var v=null==m;if(!v)for(f=0;j>f;++f)k=m[f],l=p[f],l&&(l.number&&null!=k&&(k=+k,isNaN(k)?k=null:1/0==k?k=s:k==-1/0&&(k=-s)),null==k&&(l.required&&(v=!0),null!=l.defaultValue&&(k=l.defaultValue))),i[e+f]=k;if(v)for(f=0;j>f;++f)k=i[e+f],null!=k&&(l=p[f],l.autoscale!==!1&&(l.x&&b(g.xaxis,k,k),l.y&&b(g.yaxis,k,k))),i[e+f]=null;else if(u&&e>0&&null!=i[e-j]&&i[e-j]!=i[e]&&i[e-j+1]!=i[e+1]){for(f=0;j>f;++f)i[e+j+f]=i[e+f];i[e+1]=i[e-j+1],e+=j}}}}for(c=0;c<db.length;++c)g=db[c],h(pb.processDatapoints,[g,g.datapoints]);for(c=0;c<db.length;++c){g=db[c],i=g.datapoints.points,j=g.datapoints.pointsize,p=g.datapoints.format;var w=q,x=q,y=r,z=r;for(d=0;d<i.length;d+=j)if(null!=i[d])for(f=0;j>f;++f)k=i[d+f],l=p[f],l&&l.autoscale!==!1&&k!=s&&k!=-s&&(l.x&&(w>k&&(w=k),k>y&&(y=k)),l.y&&(x>k&&(x=k),k>z&&(z=k)));if(g.bars.show){var A;switch(g.bars.align){case"left":A=0;break;case"right":A=-g.bars.barWidth;break;default:A=-g.bars.barWidth/2}g.bars.horizontal?(x+=A,z+=A+g.bars.barWidth):(w+=A,y+=A+g.bars.barWidth)}b(g.xaxis,w,y),b(g.yaxis,x,z)}a.each(n(),function(a,b){b.datamin==q&&(b.datamin=null),b.datamax==r&&(b.datamax=null)})}function t(){c.css("padding",0).children().filter(function(){return!a(this).hasClass("flot-overlay")&&!a(this).hasClass("flot-base")}).remove(),"static"==c.css("position")&&c.css("position","relative"),fb=new b("flot-base",c),gb=new b("flot-overlay",c),ib=fb.context,jb=gb.context,hb=a(gb.element).unbind();var d=c.data("plot");d&&(d.shutdown(),gb.clear()),c.data("plot",qb)}function u(){eb.grid.hoverable&&(hb.mousemove(T),hb.bind("mouseleave",U)),eb.grid.clickable&&hb.click(V),h(pb.bindEvents,[hb])}function v(){sb&&clearTimeout(sb),hb.unbind("mousemove",T),hb.unbind("mouseleave",U),hb.unbind("click",V),h(pb.shutdown,[hb])}function w(a){function b(a){return a}var c,d,e=a.options.transform||b,f=a.options.inverseTransform;"x"==a.direction?(c=a.scale=nb/Math.abs(e(a.max)-e(a.min)),d=Math.min(e(a.max),e(a.min))):(c=a.scale=ob/Math.abs(e(a.max)-e(a.min)),c=-c,d=Math.max(e(a.max),e(a.min))),a.p2c=e==b?function(a){return(a-d)*c}:function(a){return(e(a)-d)*c},a.c2p=f?function(a){return f(d+a/c)}:function(a){return d+a/c}}function x(a){for(var b=a.options,c=a.ticks||[],d=b.labelWidth||0,e=b.labelHeight||0,f=d||("x"==a.direction?Math.floor(fb.width/(c.length||1)):null),g=a.direction+"Axis "+a.direction+a.n+"Axis",h="flot-"+a.direction+"-axis flot-"+a.direction+a.n+"-axis "+g,i=b.font||"flot-tick-label tickLabel",j=0;j<c.length;++j){var k=c[j];if(k.label){var l=fb.getTextInfo(h,k.label,i,null,f);d=Math.max(d,l.width),e=Math.max(e,l.height)}}a.labelWidth=b.labelWidth||d,a.labelHeight=b.labelHeight||e}function y(b){var c=b.labelWidth,d=b.labelHeight,e=b.options.position,f="x"===b.direction,g=b.options.tickLength,h=eb.grid.axisMargin,i=eb.grid.labelMargin,j=!0,k=!0,l=!0,m=!1;a.each(f?kb:lb,function(a,c){c&&c.reserveSpace&&(c===b?m=!0:c.options.position===e&&(m?k=!1:j=!1),m||(l=!1))}),k&&(h=0),null==g&&(g=l?"full":5),isNaN(+g)||(i+=+g),f?(d+=i,"bottom"==e?(mb.bottom+=d+h,b.box={"top":fb.height-mb.bottom,"height":d}):(b.box={"top":mb.top+h,"height":d},mb.top+=d+h)):(c+=i,"left"==e?(b.box={"left":mb.left+h,"width":c},mb.left+=c+h):(mb.right+=c+h,b.box={"left":fb.width-mb.right,"width":c})),b.position=e,b.tickLength=g,b.box.padding=i,b.innermost=j}function z(a){"x"==a.direction?(a.box.left=mb.left-a.labelWidth/2,a.box.width=fb.width-mb.left-mb.right+a.labelWidth):(a.box.top=mb.top-a.labelHeight/2,a.box.height=fb.height-mb.bottom-mb.top+a.labelHeight)}function A(){var b,c=eb.grid.minBorderMargin;if(null==c)for(c=0,b=0;b<db.length;++b)c=Math.max(c,2*(db[b].points.radius+db[b].points.lineWidth/2));var d={"left":c,"right":c,"top":c,"bottom":c};a.each(n(),function(a,b){if(b.reserveSpace&&b.ticks&&b.ticks.length){var c=b.ticks[b.ticks.length-1];"x"===b.direction?(d.left=Math.max(d.left,b.labelWidth/2),c.v<=b.max&&(d.right=Math.max(d.right,b.labelWidth/2))):(d.bottom=Math.max(d.bottom,b.labelHeight/2),c.v<=b.max&&(d.top=Math.max(d.top,b.labelHeight/2)))}}),mb.left=Math.ceil(Math.max(d.left,mb.left)),mb.right=Math.ceil(Math.max(d.right,mb.right)),mb.top=Math.ceil(Math.max(d.top,mb.top)),mb.bottom=Math.ceil(Math.max(d.bottom,mb.bottom))}function B(){var b,c=n(),d=eb.grid.show;for(var e in mb){var f=eb.grid.margin||0;mb[e]="number"==typeof f?f:f[e]||0}h(pb.processOffset,[mb]);for(var e in mb)mb[e]+="object"==typeof eb.grid.borderWidth?d?eb.grid.borderWidth[e]:0:d?eb.grid.borderWidth:0;if(a.each(c,function(a,b){b.show=b.options.show,null==b.show&&(b.show=b.used),b.reserveSpace=b.show||b.options.reserveSpace,C(b)}),d){var g=a.grep(c,function(a){return a.reserveSpace});for(a.each(g,function(a,b){D(b),E(b),F(b,b.ticks),x(b)}),b=g.length-1;b>=0;--b)y(g[b]);A(),a.each(g,function(a,b){z(b)})}nb=fb.width-mb.left-mb.right,ob=fb.height-mb.bottom-mb.top,a.each(c,function(a,b){w(b)}),d&&K(),R()}function C(a){var b=a.options,c=+(null!=b.min?b.min:a.datamin),d=+(null!=b.max?b.max:a.datamax),e=d-c;if(0==e){var f=0==d?1:.01;null==b.min&&(c-=f),(null==b.max||null!=b.min)&&(d+=f)}else{var g=b.autoscaleMargin;null!=g&&(null==b.min&&(c-=e*g,0>c&&null!=a.datamin&&a.datamin>=0&&(c=0)),null==b.max&&(d+=e*g,d>0&&null!=a.datamax&&a.datamax<=0&&(d=0)))}a.min=c,a.max=d}function D(b){var c,e=b.options;c="number"==typeof e.ticks&&e.ticks>0?e.ticks:.3*Math.sqrt("x"==b.direction?fb.width:fb.height);var f=(b.max-b.min)/c,g=-Math.floor(Math.log(f)/Math.LN10),h=e.tickDecimals;null!=h&&g>h&&(g=h);var i,j=Math.pow(10,-g),k=f/j;if(1.5>k?i=1:3>k?(i=2,k>2.25&&(null==h||h>=g+1)&&(i=2.5,++g)):i=7.5>k?5:10,i*=j,null!=e.minTickSize&&i<e.minTickSize&&(i=e.minTickSize),b.delta=f,b.tickDecimals=Math.max(0,null!=h?h:g),b.tickSize=e.tickSize||i,"time"==e.mode&&!b.tickGenerator)throw new Error("Time mode requires the flot.time plugin.");if(b.tickGenerator||(b.tickGenerator=function(a){var b,c=[],e=d(a.min,a.tickSize),f=0,g=Number.NaN;do b=g,g=e+f*a.tickSize,c.push(g),++f;while(g<a.max&&g!=b);return c},b.tickFormatter=function(a,b){var c=b.tickDecimals?Math.pow(10,b.tickDecimals):1,d=""+Math.round(a*c)/c;if(null!=b.tickDecimals){var e=d.indexOf("."),f=-1==e?0:d.length-e-1;if(f<b.tickDecimals)return(f?d:d+".")+(""+c).substr(1,b.tickDecimals-f)}return d}),a.isFunction(e.tickFormatter)&&(b.tickFormatter=function(a,b){return""+e.tickFormatter(a,b)}),null!=e.alignTicksWithAxis){var l=("x"==b.direction?kb:lb)[e.alignTicksWithAxis-1];if(l&&l.used&&l!=b){var m=b.tickGenerator(b);if(m.length>0&&(null==e.min&&(b.min=Math.min(b.min,m[0])),null==e.max&&m.length>1&&(b.max=Math.max(b.max,m[m.length-1]))),b.tickGenerator=function(a){var b,c,d=[];for(c=0;c<l.ticks.length;++c)b=(l.ticks[c].v-l.min)/(l.max-l.min),b=a.min+b*(a.max-a.min),d.push(b);return d},!b.mode&&null==e.tickDecimals){var n=Math.max(0,-Math.floor(Math.log(b.delta)/Math.LN10)+1),o=b.tickGenerator(b);o.length>1&&/\..*0$/.test((o[1]-o[0]).toFixed(n))||(b.tickDecimals=n)}}}}function E(b){var c=b.options.ticks,d=[];null==c||"number"==typeof c&&c>0?d=b.tickGenerator(b):c&&(d=a.isFunction(c)?c(b):c);var e,f;for(b.ticks=[],e=0;e<d.length;++e){var g=null,h=d[e];"object"==typeof h?(f=+h[0],h.length>1&&(g=h[1])):f=+h,null==g&&(g=b.tickFormatter(f,b)),isNaN(f)||b.ticks.push({"v":f,"label":g})}}function F(a,b){a.options.autoscaleMargin&&b.length>0&&(null==a.options.min&&(a.min=Math.min(a.min,b[0].v)),null==a.options.max&&b.length>1&&(a.max=Math.max(a.max,b[b.length-1].v)))}function G(){fb.clear(),h(pb.drawBackground,[ib]);var a=eb.grid;a.show&&a.backgroundColor&&I(),a.show&&!a.aboveData&&J();for(var b=0;b<db.length;++b)h(pb.drawSeries,[ib,db[b]]),L(db[b]);h(pb.draw,[ib]),a.show&&a.aboveData&&J(),fb.render(),X()}function H(a,b){for(var c,d,e,f,g=n(),h=0;h<g.length;++h)if(c=g[h],c.direction==b&&(f=b+c.n+"axis",a[f]||1!=c.n||(f=b+"axis"),a[f])){d=a[f].from,e=a[f].to;break}if(a[f]||(c="x"==b?kb[0]:lb[0],d=a[b+"1"],e=a[b+"2"]),null!=d&&null!=e&&d>e){var i=d;d=e,e=i}return{"from":d,"to":e,"axis":c}}function I(){ib.save(),ib.translate(mb.left,mb.top),ib.fillStyle=cb(eb.grid.backgroundColor,ob,0,"rgba(255, 255, 255, 0)"),ib.fillRect(0,0,nb,ob),ib.restore()}function J(){var b,c,d,e;ib.save(),ib.translate(mb.left,mb.top);var f=eb.grid.markings;if(f)for(a.isFunction(f)&&(c=qb.getAxes(),c.xmin=c.xaxis.min,c.xmax=c.xaxis.max,c.ymin=c.yaxis.min,c.ymax=c.yaxis.max,f=f(c)),b=0;b<f.length;++b){var g=f[b],h=H(g,"x"),i=H(g,"y");null==h.from&&(h.from=h.axis.min),null==h.to&&(h.to=h.axis.max),null==i.from&&(i.from=i.axis.min),null==i.to&&(i.to=i.axis.max),h.to<h.axis.min||h.from>h.axis.max||i.to<i.axis.min||i.from>i.axis.max||(h.from=Math.max(h.from,h.axis.min),h.to=Math.min(h.to,h.axis.max),i.from=Math.max(i.from,i.axis.min),i.to=Math.min(i.to,i.axis.max),(h.from!=h.to||i.from!=i.to)&&(h.from=h.axis.p2c(h.from),h.to=h.axis.p2c(h.to),i.from=i.axis.p2c(i.from),i.to=i.axis.p2c(i.to),h.from==h.to||i.from==i.to?(ib.beginPath(),ib.strokeStyle=g.color||eb.grid.markingsColor,ib.lineWidth=g.lineWidth||eb.grid.markingsLineWidth,ib.moveTo(h.from,i.from),ib.lineTo(h.to,i.to),ib.stroke()):(ib.fillStyle=g.color||eb.grid.markingsColor,ib.fillRect(h.from,i.to,h.to-h.from,i.from-i.to))))}c=n(),d=eb.grid.borderWidth;for(var j=0;j<c.length;++j){var k,l,m,o,p=c[j],q=p.box,r=p.tickLength;if(p.show&&0!=p.ticks.length){for(ib.lineWidth=1,"x"==p.direction?(k=0,l="full"==r?"top"==p.position?0:ob:q.top-mb.top+("top"==p.position?q.height:0)):(l=0,k="full"==r?"left"==p.position?0:nb:q.left-mb.left+("left"==p.position?q.width:0)),p.innermost||(ib.strokeStyle=p.options.color,ib.beginPath(),m=o=0,"x"==p.direction?m=nb+1:o=ob+1,1==ib.lineWidth&&("x"==p.direction?l=Math.floor(l)+.5:k=Math.floor(k)+.5),ib.moveTo(k,l),ib.lineTo(k+m,l+o),ib.stroke()),ib.strokeStyle=p.options.tickColor,ib.beginPath(),b=0;b<p.ticks.length;++b){var s=p.ticks[b].v;m=o=0,isNaN(s)||s<p.min||s>p.max||"full"==r&&("object"==typeof d&&d[p.position]>0||d>0)&&(s==p.min||s==p.max)||("x"==p.direction?(k=p.p2c(s),o="full"==r?-ob:r,"top"==p.position&&(o=-o)):(l=p.p2c(s),m="full"==r?-nb:r,"left"==p.position&&(m=-m)),1==ib.lineWidth&&("x"==p.direction?k=Math.floor(k)+.5:l=Math.floor(l)+.5),ib.moveTo(k,l),ib.lineTo(k+m,l+o))}ib.stroke()}}d&&(e=eb.grid.borderColor,"object"==typeof d||"object"==typeof e?("object"!=typeof d&&(d={"top":d,"right":d,"bottom":d,"left":d}),"object"!=typeof e&&(e={"top":e,"right":e,"bottom":e,"left":e}),d.top>0&&(ib.strokeStyle=e.top,ib.lineWidth=d.top,ib.beginPath(),ib.moveTo(0-d.left,0-d.top/2),ib.lineTo(nb,0-d.top/2),ib.stroke()),d.right>0&&(ib.strokeStyle=e.right,ib.lineWidth=d.right,ib.beginPath(),ib.moveTo(nb+d.right/2,0-d.top),ib.lineTo(nb+d.right/2,ob),ib.stroke()),d.bottom>0&&(ib.strokeStyle=e.bottom,ib.lineWidth=d.bottom,ib.beginPath(),ib.moveTo(nb+d.right,ob+d.bottom/2),ib.lineTo(0,ob+d.bottom/2),ib.stroke()),d.left>0&&(ib.strokeStyle=e.left,ib.lineWidth=d.left,ib.beginPath(),ib.moveTo(0-d.left/2,ob+d.bottom),ib.lineTo(0-d.left/2,0),ib.stroke())):(ib.lineWidth=d,ib.strokeStyle=eb.grid.borderColor,ib.strokeRect(-d/2,-d/2,nb+d,ob+d))),ib.restore()}function K(){a.each(n(),function(a,b){var c,d,e,f,g,h=b.box,i=b.direction+"Axis "+b.direction+b.n+"Axis",j="flot-"+b.direction+"-axis flot-"+b.direction+b.n+"-axis "+i,k=b.options.font||"flot-tick-label tickLabel";if(fb.removeText(j),b.show&&0!=b.ticks.length)for(var l=0;l<b.ticks.length;++l)c=b.ticks[l],!c.label||c.v<b.min||c.v>b.max||("x"==b.direction?(f="center",d=mb.left+b.p2c(c.v),"bottom"==b.position?e=h.top+h.padding:(e=h.top+h.height-h.padding,g="bottom")):(g="middle",e=mb.top+b.p2c(c.v),"left"==b.position?(d=h.left+h.width-h.padding,f="right"):d=h.left+h.padding),fb.addText(j,d,e,c.label,k,null,null,f,g))})}function L(a){a.lines.show&&M(a),a.bars.show&&P(a),a.points.show&&N(a)}function M(a){function b(a,b,c,d,e){var f=a.points,g=a.pointsize,h=null,i=null;ib.beginPath();for(var j=g;j<f.length;j+=g){var k=f[j-g],l=f[j-g+1],m=f[j],n=f[j+1];if(null!=k&&null!=m){if(n>=l&&l<e.min){if(n<e.min)continue;k=(e.min-l)/(n-l)*(m-k)+k,l=e.min}else if(l>=n&&n<e.min){if(l<e.min)continue;m=(e.min-l)/(n-l)*(m-k)+k,n=e.min}if(l>=n&&l>e.max){if(n>e.max)continue;k=(e.max-l)/(n-l)*(m-k)+k,l=e.max}else if(n>=l&&n>e.max){if(l>e.max)continue;m=(e.max-l)/(n-l)*(m-k)+k,n=e.max}if(m>=k&&k<d.min){if(m<d.min)continue;l=(d.min-k)/(m-k)*(n-l)+l,k=d.min}else if(k>=m&&m<d.min){if(k<d.min)continue;n=(d.min-k)/(m-k)*(n-l)+l,m=d.min}if(k>=m&&k>d.max){if(m>d.max)continue;l=(d.max-k)/(m-k)*(n-l)+l,k=d.max}else if(m>=k&&m>d.max){if(k>d.max)continue;n=(d.max-k)/(m-k)*(n-l)+l,m=d.max}(k!=h||l!=i)&&ib.moveTo(d.p2c(k)+b,e.p2c(l)+c),h=m,i=n,ib.lineTo(d.p2c(m)+b,e.p2c(n)+c)}}ib.stroke()}function c(a,b,c){for(var d=a.points,e=a.pointsize,f=Math.min(Math.max(0,c.min),c.max),g=0,h=!1,i=1,j=0,k=0;;){if(e>0&&g>d.length+e)break;g+=e;var l=d[g-e],m=d[g-e+i],n=d[g],o=d[g+i];if(h){if(e>0&&null!=l&&null==n){k=g,e=-e,i=2;continue}if(0>e&&g==j+e){ib.fill(),h=!1,e=-e,i=1,g=j=k+e;continue}}if(null!=l&&null!=n){if(n>=l&&l<b.min){if(n<b.min)continue;m=(b.min-l)/(n-l)*(o-m)+m,l=b.min}else if(l>=n&&n<b.min){if(l<b.min)continue;o=(b.min-l)/(n-l)*(o-m)+m,n=b.min}if(l>=n&&l>b.max){if(n>b.max)continue;m=(b.max-l)/(n-l)*(o-m)+m,l=b.max}else if(n>=l&&n>b.max){if(l>b.max)continue;o=(b.max-l)/(n-l)*(o-m)+m,n=b.max}if(h||(ib.beginPath(),ib.moveTo(b.p2c(l),c.p2c(f)),h=!0),m>=c.max&&o>=c.max)ib.lineTo(b.p2c(l),c.p2c(c.max)),ib.lineTo(b.p2c(n),c.p2c(c.max));else if(m<=c.min&&o<=c.min)ib.lineTo(b.p2c(l),c.p2c(c.min)),ib.lineTo(b.p2c(n),c.p2c(c.min));else{var p=l,q=n;o>=m&&m<c.min&&o>=c.min?(l=(c.min-m)/(o-m)*(n-l)+l,m=c.min):m>=o&&o<c.min&&m>=c.min&&(n=(c.min-m)/(o-m)*(n-l)+l,o=c.min),m>=o&&m>c.max&&o<=c.max?(l=(c.max-m)/(o-m)*(n-l)+l,m=c.max):o>=m&&o>c.max&&m<=c.max&&(n=(c.max-m)/(o-m)*(n-l)+l,o=c.max),l!=p&&ib.lineTo(b.p2c(p),c.p2c(m)),ib.lineTo(b.p2c(l),c.p2c(m)),ib.lineTo(b.p2c(n),c.p2c(o)),n!=q&&(ib.lineTo(b.p2c(n),c.p2c(o)),ib.lineTo(b.p2c(q),c.p2c(o)))}}}}ib.save(),ib.translate(mb.left,mb.top),ib.lineJoin="round";var d=a.lines.lineWidth,e=a.shadowSize;if(d>0&&e>0){ib.lineWidth=e,ib.strokeStyle="rgba(0,0,0,0.1)";var f=Math.PI/18;b(a.datapoints,Math.sin(f)*(d/2+e/2),Math.cos(f)*(d/2+e/2),a.xaxis,a.yaxis),ib.lineWidth=e/2,b(a.datapoints,Math.sin(f)*(d/2+e/4),Math.cos(f)*(d/2+e/4),a.xaxis,a.yaxis)}ib.lineWidth=d,ib.strokeStyle=a.color;var g=Q(a.lines,a.color,0,ob);g&&(ib.fillStyle=g,c(a.datapoints,a.xaxis,a.yaxis)),d>0&&b(a.datapoints,0,0,a.xaxis,a.yaxis),ib.restore()}function N(a){function b(a,b,c,d,e,f,g,h){for(var i=a.points,j=a.pointsize,k=0;k<i.length;k+=j){var l=i[k],m=i[k+1];null==l||l<f.min||l>f.max||m<g.min||m>g.max||(ib.beginPath(),l=f.p2c(l),m=g.p2c(m)+d,"circle"==h?ib.arc(l,m,b,0,e?Math.PI:2*Math.PI,!1):h(ib,l,m,b,e),ib.closePath(),c&&(ib.fillStyle=c,ib.fill()),ib.stroke())}}ib.save(),ib.translate(mb.left,mb.top);var c=a.points.lineWidth,d=a.shadowSize,e=a.points.radius,f=a.points.symbol;if(0==c&&(c=1e-4),c>0&&d>0){var g=d/2;ib.lineWidth=g,ib.strokeStyle="rgba(0,0,0,0.1)",b(a.datapoints,e,null,g+g/2,!0,a.xaxis,a.yaxis,f),ib.strokeStyle="rgba(0,0,0,0.2)",b(a.datapoints,e,null,g/2,!0,a.xaxis,a.yaxis,f)}ib.lineWidth=c,ib.strokeStyle=a.color,b(a.datapoints,e,Q(a.points,a.color),0,!1,a.xaxis,a.yaxis,f),ib.restore()}function O(a,b,c,d,e,f,g,h,i,j,k){var l,m,n,o,p,q,r,s,t;j?(s=q=r=!0,p=!1,l=c,m=a,o=b+d,n=b+e,l>m&&(t=m,m=l,l=t,p=!0,q=!1)):(p=q=r=!0,s=!1,l=a+d,m=a+e,n=c,o=b,n>o&&(t=o,o=n,n=t,s=!0,r=!1)),m<g.min||l>g.max||o<h.min||n>h.max||(l<g.min&&(l=g.min,p=!1),m>g.max&&(m=g.max,q=!1),n<h.min&&(n=h.min,s=!1),o>h.max&&(o=h.max,r=!1),l=g.p2c(l),n=h.p2c(n),m=g.p2c(m),o=h.p2c(o),f&&(i.fillStyle=f(n,o),i.fillRect(l,o,m-l,n-o)),k>0&&(p||q||r||s)&&(i.beginPath(),i.moveTo(l,n),p?i.lineTo(l,o):i.moveTo(l,o),r?i.lineTo(m,o):i.moveTo(m,o),q?i.lineTo(m,n):i.moveTo(m,n),s?i.lineTo(l,n):i.moveTo(l,n),i.stroke()))}function P(a){function b(b,c,d,e,f,g){for(var h=b.points,i=b.pointsize,j=0;j<h.length;j+=i)null!=h[j]&&O(h[j],h[j+1],h[j+2],c,d,e,f,g,ib,a.bars.horizontal,a.bars.lineWidth)}ib.save(),ib.translate(mb.left,mb.top),ib.lineWidth=a.bars.lineWidth,ib.strokeStyle=a.color;var c;switch(a.bars.align){case"left":c=0;break;case"right":c=-a.bars.barWidth;break;default:c=-a.bars.barWidth/2}var d=a.bars.fill?function(b,c){return Q(a.bars,a.color,b,c)}:null;b(a.datapoints,c,c+a.bars.barWidth,d,a.xaxis,a.yaxis),ib.restore()}function Q(b,c,d,e){var f=b.fill;if(!f)return null;if(b.fillColor)return cb(b.fillColor,d,e,c);var g=a.color.parse(c);return g.a="number"==typeof f?f:.4,g.normalize(),g.toString()}function R(){if(null!=eb.legend.container?a(eb.legend.container).html(""):c.find(".legend").remove(),eb.legend.show){for(var b,d,e=[],f=[],g=!1,h=eb.legend.labelFormatter,i=0;i<db.length;++i)b=db[i],b.label&&(d=h?h(b.label,b):b.label,d&&f.push({"label":d,"color":b.color}));if(eb.legend.sorted)if(a.isFunction(eb.legend.sorted))f.sort(eb.legend.sorted);else if("reverse"==eb.legend.sorted)f.reverse();else{var j="descending"!=eb.legend.sorted;f.sort(function(a,b){return a.label==b.label?0:a.label<b.label!=j?1:-1})}for(var i=0;i<f.length;++i){var k=f[i];i%eb.legend.noColumns==0&&(g&&e.push("</tr>"),e.push("<tr>"),g=!0),e.push('<td class="legendColorBox"><div style="border:1px solid '+eb.legend.labelBoxBorderColor+';padding:1px"><div style="width:4px;height:0;border:5px solid '+k.color+';overflow:hidden"></div></div></td><td class="legendLabel">'+k.label+"</td>")}if(g&&e.push("</tr>"),0!=e.length){var l='<table style="font-size:smaller;color:'+eb.grid.color+'">'+e.join("")+"</table>";if(null!=eb.legend.container)a(eb.legend.container).html(l);else{var m="",n=eb.legend.position,o=eb.legend.margin;null==o[0]&&(o=[o,o]),"n"==n.charAt(0)?m+="top:"+(o[1]+mb.top)+"px;":"s"==n.charAt(0)&&(m+="bottom:"+(o[1]+mb.bottom)+"px;"),"e"==n.charAt(1)?m+="right:"+(o[0]+mb.right)+"px;":"w"==n.charAt(1)&&(m+="left:"+(o[0]+mb.left)+"px;");var p=a('<div class="legend">'+l.replace('style="','style="position:absolute;'+m+";")+"</div>").appendTo(c);if(0!=eb.legend.backgroundOpacity){var q=eb.legend.backgroundColor;null==q&&(q=eb.grid.backgroundColor,q=q&&"string"==typeof q?a.color.parse(q):a.color.extract(p,"background-color"),q.a=1,q=q.toString());var r=p.children();a('<div style="position:absolute;width:'+r.width()+"px;height:"+r.height()+"px;"+m+"background-color:"+q+';"> </div>').prependTo(p).css("opacity",eb.legend.backgroundOpacity)}}}}}function S(a,b,c){var d,e,f,g=eb.grid.mouseActiveRadius,h=g*g+1,i=null;for(d=db.length-1;d>=0;--d)if(c(db[d])){var j=db[d],k=j.xaxis,l=j.yaxis,m=j.datapoints.points,n=k.c2p(a),o=l.c2p(b),p=g/k.scale,q=g/l.scale;if(f=j.datapoints.pointsize,k.options.inverseTransform&&(p=Number.MAX_VALUE),l.options.inverseTransform&&(q=Number.MAX_VALUE),j.lines.show||j.points.show)for(e=0;e<m.length;e+=f){var r=m[e],s=m[e+1];if(null!=r&&!(r-n>p||-p>r-n||s-o>q||-q>s-o)){var t=Math.abs(k.p2c(r)-a),u=Math.abs(l.p2c(s)-b),v=t*t+u*u;h>v&&(h=v,i=[d,e/f])}}if(j.bars.show&&!i){var w,x;switch(j.bars.align){case"left":w=0;break;case"right":w=-j.bars.barWidth;break;default:w=-j.bars.barWidth/2}for(x=w+j.bars.barWidth,e=0;e<m.length;e+=f){var r=m[e],s=m[e+1],y=m[e+2];null!=r&&(db[d].bars.horizontal?n<=Math.max(y,r)&&n>=Math.min(y,r)&&o>=s+w&&s+x>=o:n>=r+w&&r+x>=n&&o>=Math.min(y,s)&&o<=Math.max(y,s))&&(i=[d,e/f])}}}return i?(d=i[0],e=i[1],f=db[d].datapoints.pointsize,{"datapoint":db[d].datapoints.points.slice(e*f,(e+1)*f),"dataIndex":e,"series":db[d],"seriesIndex":d}):null}function T(a){eb.grid.hoverable&&W("plothover",a,function(a){return 0!=a.hoverable})}function U(a){eb.grid.hoverable&&W("plothover",a,function(){return!1})}function V(a){W("plotclick",a,function(a){return 0!=a.clickable})}function W(a,b,d){var e=hb.offset(),f=b.pageX-e.left-mb.left,g=b.pageY-e.top-mb.top,h=o({"left":f,"top":g});h.pageX=b.pageX,h.pageY=b.pageY;var i=S(f,g,d);if(i&&(i.pageX=parseInt(i.series.xaxis.p2c(i.datapoint[0])+e.left+mb.left,10),i.pageY=parseInt(i.series.yaxis.p2c(i.datapoint[1])+e.top+mb.top,10)),eb.grid.autoHighlight){for(var j=0;j<rb.length;++j){var k=rb[j];k.auto!=a||i&&k.series==i.series&&k.point[0]==i.datapoint[0]&&k.point[1]==i.datapoint[1]||$(k.series,k.point)}i&&Z(i.series,i.datapoint,a)}c.trigger(a,[h,i])}function X(){var a=eb.interaction.redrawOverlayInterval;return-1==a?void Y():void(sb||(sb=setTimeout(Y,a)))}function Y(){sb=null,jb.save(),gb.clear(),jb.translate(mb.left,mb.top);var a,b;for(a=0;a<rb.length;++a)b=rb[a],b.series.bars.show?bb(b.series,b.point):ab(b.series,b.point);jb.restore(),h(pb.drawOverlay,[jb])}function Z(a,b,c){if("number"==typeof a&&(a=db[a]),"number"==typeof b){var d=a.datapoints.pointsize;b=a.datapoints.points.slice(d*b,d*(b+1))}var e=_(a,b);-1==e?(rb.push({"series":a,"point":b,"auto":c}),X()):c||(rb[e].auto=!1)}function $(a,b){if(null==a&&null==b)return rb=[],void X();if("number"==typeof a&&(a=db[a]),"number"==typeof b){var c=a.datapoints.pointsize;b=a.datapoints.points.slice(c*b,c*(b+1))}var d=_(a,b);-1!=d&&(rb.splice(d,1),X())}function _(a,b){for(var c=0;c<rb.length;++c){var d=rb[c];if(d.series==a&&d.point[0]==b[0]&&d.point[1]==b[1])return c}return-1}function ab(b,c){var d=c[0],e=c[1],f=b.xaxis,g=b.yaxis,h="string"==typeof b.highlightColor?b.highlightColor:a.color.parse(b.color).scale("a",.5).toString();if(!(d<f.min||d>f.max||e<g.min||e>g.max)){var i=b.points.radius+b.points.lineWidth/2;jb.lineWidth=i,jb.strokeStyle=h;var j=1.5*i;d=f.p2c(d),e=g.p2c(e),jb.beginPath(),"circle"==b.points.symbol?jb.arc(d,e,j,0,2*Math.PI,!1):b.points.symbol(jb,d,e,j,!1),jb.closePath(),jb.stroke()}}function bb(b,c){var d,e="string"==typeof b.highlightColor?b.highlightColor:a.color.parse(b.color).scale("a",.5).toString(),f=e;switch(b.bars.align){case"left":d=0;break;case"right":d=-b.bars.barWidth;break;default:d=-b.bars.barWidth/2}jb.lineWidth=b.bars.lineWidth,jb.strokeStyle=e,O(c[0],c[1],c[2]||0,d,d+b.bars.barWidth,function(){return f},b.xaxis,b.yaxis,jb,b.bars.horizontal,b.bars.lineWidth)}function cb(b,c,d,e){if("string"==typeof b)return b;for(var f=ib.createLinearGradient(0,d,0,c),g=0,h=b.colors.length;h>g;++g){var i=b.colors[g];if("string"!=typeof i){var j=a.color.parse(e);null!=i.brightness&&(j=j.scale("rgb",i.brightness)),null!=i.opacity&&(j.a*=i.opacity),i=j.toString()}f.addColorStop(g/(h-1),i)}return f}var db=[],eb={"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":{}},fb=null,gb=null,hb=null,ib=null,jb=null,kb=[],lb=[],mb={"left":0,"right":0,"top":0,"bottom":0},nb=0,ob=0,pb={"processOptions":[],"processRawData":[],"processDatapoints":[],"processOffset":[],"drawBackground":[],"drawSeries":[],"draw":[],"bindEvents":[],"drawOverlay":[],"shutdown":[]},qb=this;qb.setData=k,qb.setupGrid=B,qb.draw=G,qb.getPlaceholder=function(){return c},qb.getCanvas=function(){return fb.element},qb.getPlotOffset=function(){return mb},qb.width=function(){return nb},qb.height=function(){return ob},qb.offset=function(){var a=hb.offset();return a.left+=mb.left,a.top+=mb.top,a},qb.getData=function(){return db},qb.getAxes=function(){var b={};return a.each(kb.concat(lb),function(a,c){c&&(b[c.direction+(1!=c.n?c.n:"")+"axis"]=c)}),b},qb.getXAxes=function(){return kb},qb.getYAxes=function(){return lb},qb.c2p=o,qb.p2c=p,qb.getOptions=function(){return eb},qb.highlight=Z,qb.unhighlight=$,qb.triggerRedrawOverlay=X,qb.pointOffset=function(a){return{"left":parseInt(kb[m(a,"x")-1].p2c(+a.x)+mb.left,10),"top":parseInt(lb[m(a,"y")-1].p2c(+a.y)+mb.top,10)}},qb.shutdown=v,qb.destroy=function(){v(),c.removeData("plot").empty(),db=[],eb=null,fb=null,gb=null,hb=null,ib=null,jb=null,kb=[],lb=[],pb=null,rb=[],qb=null},qb.resize=function(){var a=c.width(),b=c.height();fb.resize(a,b),gb.resize(a,b)},qb.hooks=pb,i(qb),j(f),t(),k(e),B(),G(),u();var rb=[],sb=null}function d(a,b){return b*Math.floor(a/b)}var e=Object.prototype.hasOwnProperty;b.prototype.resize=function(a,b){if(0>=a||0>=b)throw new Error("Invalid dimensions for plot, width = "+a+", height = "+b);var c=this.element,d=this.context,e=this.pixelRatio;this.width!=a&&(c.width=a*e,c.style.width=a+"px",this.width=a),this.height!=b&&(c.height=b*e,c.style.height=b+"px",this.height=b),d.restore(),d.save(),d.scale(e,e)},b.prototype.clear=function(){this.context.clearRect(0,0,this.width,this.height)},b.prototype.render=function(){var a=this._textCache;for(var b in a)if(e.call(a,b)){var c=this.getTextLayer(b),d=a[b];c.hide();for(var f in d)if(e.call(d,f)){var g=d[f];for(var h in g)if(e.call(g,h)){for(var i,j=g[h].positions,k=0;i=j[k];k++)i.active?i.rendered||(c.append(i.element),i.rendered=!0):(j.splice(k--,1),i.rendered&&i.element.detach());0==j.length&&delete g[h]}}c.show()}},b.prototype.getTextLayer=function(b){var c=this.text[b];return null==c&&(null==this.textContainer&&(this.textContainer=a("<div class='flot-text'></div>").css({"position":"absolute","top":0,"left":0,"bottom":0,"right":0,"font-size":"smaller","color":"#545454"}).insertAfter(this.element)),c=this.text[b]=a("<div></div>").addClass(b).css({"position":"absolute","top":0,"left":0,"bottom":0,"right":0}).appendTo(this.textContainer)),c
|
|
},b.prototype.getTextInfo=function(b,c,d,e,f){var g,h,i,j;if(c=""+c,g="object"==typeof d?d.style+" "+d.variant+" "+d.weight+" "+d.size+"px/"+d.lineHeight+"px "+d.family:d,h=this._textCache[b],null==h&&(h=this._textCache[b]={}),i=h[g],null==i&&(i=h[g]={}),j=i[c],null==j){var k=a("<div></div>").html(c).css({"position":"absolute","max-width":f,"top":-9999}).appendTo(this.getTextLayer(b));"object"==typeof d?k.css({"font":g,"color":d.color}):"string"==typeof d&&k.addClass(d),j=i[c]={"width":k.outerWidth(!0),"height":k.outerHeight(!0),"element":k,"positions":[]},k.detach()}return j},b.prototype.addText=function(a,b,c,d,e,f,g,h,i){var j=this.getTextInfo(a,d,e,f,g),k=j.positions;"center"==h?b-=j.width/2:"right"==h&&(b-=j.width),"middle"==i?c-=j.height/2:"bottom"==i&&(c-=j.height);for(var l,m=0;l=k[m];m++)if(l.x==b&&l.y==c)return void(l.active=!0);l={"active":!0,"rendered":!1,"element":k.length?j.element.clone():j.element,"x":b,"y":c},k.push(l),l.element.css({"top":Math.round(c),"left":Math.round(b),"text-align":h})},b.prototype.removeText=function(a,b,c,d,f,g){if(null==d){var h=this._textCache[a];if(null!=h)for(var i in h)if(e.call(h,i)){var j=h[i];for(var k in j)if(e.call(j,k))for(var l,m=j[k].positions,n=0;l=m[n];n++)l.active=!1}}else for(var l,m=this.getTextInfo(a,d,f,g).positions,n=0;l=m[n];n++)l.x==b&&l.y==c&&(l.active=!1)},a.plot=function(b,d,e){var f=new c(a(b),d,e,a.plot.plugins);return f},a.plot.version="0.8.2",a.plot.plugins=[],a.fn.plot=function(b,c){return this.each(function(){a.plot(this,b,c)})}}(jQuery),function(a){function b(b){function e(b){x||(x=!0,r=b.getCanvas(),s=a(r).parent(),t=b.getOptions(),b.setData(f(b.getData())))}function f(b){for(var c=0,d=0,e=0,f=t.series.pie.combine.color,g=[],h=0;h<b.length;++h){var i=b[h].data;a.isArray(i)&&1==i.length&&(i=i[0]),a.isArray(i)?i[1]=!isNaN(parseFloat(i[1]))&&isFinite(i[1])?+i[1]:0:i=!isNaN(parseFloat(i))&&isFinite(i)?[1,+i]:[1,0],b[h].data=[i]}for(var h=0;h<b.length;++h)c+=b[h].data[0][1];for(var h=0;h<b.length;++h){var i=b[h].data[0][1];i/c<=t.series.pie.combine.threshold&&(d+=i,e++,f||(f=b[h].color))}for(var h=0;h<b.length;++h){var i=b[h].data[0][1];(2>e||i/c>t.series.pie.combine.threshold)&&g.push({"data":[[1,i]],"color":b[h].color,"label":b[h].label,"angle":i*Math.PI*2/c,"percent":i/(c/100)})}return e>1&&g.push({"data":[[1,d]],"color":f,"label":t.series.pie.combine.label,"angle":d*Math.PI*2/c,"percent":d/(c/100)}),g}function g(b,e){function f(){y.clearRect(0,0,j,k),s.children().filter(".pieLabel, .pieLabelBackground").remove()}function g(){var a=t.series.pie.shadow.left,b=t.series.pie.shadow.top,c=10,d=t.series.pie.shadow.alpha,e=t.series.pie.radius>1?t.series.pie.radius:u*t.series.pie.radius;if(!(e>=j/2-a||e*t.series.pie.tilt>=k/2-b||c>=e)){y.save(),y.translate(a,b),y.globalAlpha=d,y.fillStyle="#000",y.translate(v,w),y.scale(1,t.series.pie.tilt);for(var f=1;c>=f;f++)y.beginPath(),y.arc(0,0,e,0,2*Math.PI,!1),y.fill(),e-=f;y.restore()}}function i(){function b(a,b,c){0>=a||isNaN(a)||(c?y.fillStyle=b:(y.strokeStyle=b,y.lineJoin="round"),y.beginPath(),Math.abs(a-2*Math.PI)>1e-9&&y.moveTo(0,0),y.arc(0,0,e,f,f+a/2,!1),y.arc(0,0,e,f+a/2,f+a,!1),y.closePath(),f+=a,c?y.fill():y.stroke())}function c(){function b(b,c,d){if(0==b.data[0][1])return!0;var f,g=t.legend.labelFormatter,h=t.series.pie.label.formatter;f=g?g(b.label,b):b.label,h&&(f=h(f,b));var i=(c+b.angle+c)/2,l=v+Math.round(Math.cos(i)*e),m=w+Math.round(Math.sin(i)*e)*t.series.pie.tilt,n="<span class='pieLabel' id='pieLabel"+d+"' style='position:absolute;top:"+m+"px;left:"+l+"px;'>"+f+"</span>";s.append(n);var o=s.children("#pieLabel"+d),p=m-o.height()/2,q=l-o.width()/2;if(o.css("top",p),o.css("left",q),0-p>0||0-q>0||k-(p+o.height())<0||j-(q+o.width())<0)return!1;if(0!=t.series.pie.label.background.opacity){var r=t.series.pie.label.background.color;null==r&&(r=b.color);var u="top:"+p+"px;left:"+q+"px;";a("<div class='pieLabelBackground' style='position:absolute;width:"+o.width()+"px;height:"+o.height()+"px;"+u+"background-color:"+r+";'></div>").css("opacity",t.series.pie.label.background.opacity).insertBefore(o)}return!0}for(var c=d,e=t.series.pie.label.radius>1?t.series.pie.label.radius:u*t.series.pie.label.radius,f=0;f<m.length;++f){if(m[f].percent>=100*t.series.pie.label.threshold&&!b(m[f],c,f))return!1;c+=m[f].angle}return!0}var d=Math.PI*t.series.pie.startAngle,e=t.series.pie.radius>1?t.series.pie.radius:u*t.series.pie.radius;y.save(),y.translate(v,w),y.scale(1,t.series.pie.tilt),y.save();for(var f=d,g=0;g<m.length;++g)m[g].startAngle=f,b(m[g].angle,m[g].color,!0);if(y.restore(),t.series.pie.stroke.width>0){y.save(),y.lineWidth=t.series.pie.stroke.width,f=d;for(var g=0;g<m.length;++g)b(m[g].angle,t.series.pie.stroke.color,!1);y.restore()}return h(y),y.restore(),t.series.pie.label.show?c():!0}if(s){var j=b.getPlaceholder().width(),k=b.getPlaceholder().height(),l=s.children().filter(".legend").children().width()||0;y=e,x=!1,u=Math.min(j,k/t.series.pie.tilt)/2,w=k/2+t.series.pie.offset.top,v=j/2,"auto"==t.series.pie.offset.left?(t.legend.position.match("w")?v+=l/2:v-=l/2,u>v?v=u:v>j-u&&(v=j-u)):v+=t.series.pie.offset.left;var m=b.getData(),n=0;do n>0&&(u*=d),n+=1,f(),t.series.pie.tilt<=.8&&g();while(!i()&&c>n);n>=c&&(f(),s.prepend("<div class='error'>Could not draw pie with labels contained inside canvas</div>")),b.setSeries&&b.insertLegend&&(b.setSeries(m),b.insertLegend())}}function h(a){if(t.series.pie.innerRadius>0){a.save();var b=t.series.pie.innerRadius>1?t.series.pie.innerRadius:u*t.series.pie.innerRadius;a.globalCompositeOperation="destination-out",a.beginPath(),a.fillStyle=t.series.pie.stroke.color,a.arc(0,0,b,0,2*Math.PI,!1),a.fill(),a.closePath(),a.restore(),a.save(),a.beginPath(),a.strokeStyle=t.series.pie.stroke.color,a.arc(0,0,b,0,2*Math.PI,!1),a.stroke(),a.closePath(),a.restore()}}function i(a,b){for(var c=!1,d=-1,e=a.length,f=e-1;++d<e;f=d)(a[d][1]<=b[1]&&b[1]<a[f][1]||a[f][1]<=b[1]&&b[1]<a[d][1])&&b[0]<(a[f][0]-a[d][0])*(b[1]-a[d][1])/(a[f][1]-a[d][1])+a[d][0]&&(c=!c);return c}function j(a,c){for(var d,e,f=b.getData(),g=b.getOptions(),h=g.series.pie.radius>1?g.series.pie.radius:u*g.series.pie.radius,j=0;j<f.length;++j){var k=f[j];if(k.pie.show){if(y.save(),y.beginPath(),y.moveTo(0,0),y.arc(0,0,h,k.startAngle,k.startAngle+k.angle/2,!1),y.arc(0,0,h,k.startAngle+k.angle/2,k.startAngle+k.angle,!1),y.closePath(),d=a-v,e=c-w,y.isPointInPath){if(y.isPointInPath(a-v,c-w))return y.restore(),{"datapoint":[k.percent,k.data],"dataIndex":0,"series":k,"seriesIndex":j}}else{var l=h*Math.cos(k.startAngle),m=h*Math.sin(k.startAngle),n=h*Math.cos(k.startAngle+k.angle/4),o=h*Math.sin(k.startAngle+k.angle/4),p=h*Math.cos(k.startAngle+k.angle/2),q=h*Math.sin(k.startAngle+k.angle/2),r=h*Math.cos(k.startAngle+k.angle/1.5),s=h*Math.sin(k.startAngle+k.angle/1.5),t=h*Math.cos(k.startAngle+k.angle),x=h*Math.sin(k.startAngle+k.angle),z=[[0,0],[l,m],[n,o],[p,q],[r,s],[t,x]],A=[d,e];if(i(z,A))return y.restore(),{"datapoint":[k.percent,k.data],"dataIndex":0,"series":k,"seriesIndex":j}}y.restore()}}return null}function k(a){m("plothover",a)}function l(a){m("plotclick",a)}function m(a,c){var d=b.offset(),e=parseInt(c.pageX-d.left),f=parseInt(c.pageY-d.top),g=j(e,f);if(t.grid.autoHighlight)for(var h=0;h<z.length;++h){var i=z[h];i.auto!=a||g&&i.series==g.series||o(i.series)}g&&n(g.series,a);var k={"pageX":c.pageX,"pageY":c.pageY};s.trigger(a,[k,g])}function n(a,c){var d=p(a);-1==d?(z.push({"series":a,"auto":c}),b.triggerRedrawOverlay()):c||(z[d].auto=!1)}function o(a){null==a&&(z=[],b.triggerRedrawOverlay());var c=p(a);-1!=c&&(z.splice(c,1),b.triggerRedrawOverlay())}function p(a){for(var b=0;b<z.length;++b){var c=z[b];if(c.series==a)return b}return-1}function q(a,b){function c(a){a.angle<=0||isNaN(a.angle)||(b.fillStyle="rgba(255, 255, 255, "+d.series.pie.highlight.opacity+")",b.beginPath(),Math.abs(a.angle-2*Math.PI)>1e-9&&b.moveTo(0,0),b.arc(0,0,e,a.startAngle,a.startAngle+a.angle/2,!1),b.arc(0,0,e,a.startAngle+a.angle/2,a.startAngle+a.angle,!1),b.closePath(),b.fill())}var d=a.getOptions(),e=d.series.pie.radius>1?d.series.pie.radius:u*d.series.pie.radius;b.save(),b.translate(v,w),b.scale(1,d.series.pie.tilt);for(var f=0;f<z.length;++f)c(z[f].series);h(b),b.restore()}var r=null,s=null,t=null,u=null,v=null,w=null,x=!1,y=null,z=[];b.hooks.processOptions.push(function(a,b){b.series.pie.show&&(b.grid.show=!1,"auto"==b.series.pie.label.show&&(b.series.pie.label.show=b.legend.show?!1:!0),"auto"==b.series.pie.radius&&(b.series.pie.radius=b.series.pie.label.show?.75:1),b.series.pie.tilt>1?b.series.pie.tilt=1:b.series.pie.tilt<0&&(b.series.pie.tilt=0))}),b.hooks.bindEvents.push(function(a,b){var c=a.getOptions();c.series.pie.show&&(c.grid.hoverable&&b.unbind("mousemove").mousemove(k),c.grid.clickable&&b.unbind("click").click(l))}),b.hooks.processDatapoints.push(function(a,b,c,d){var f=a.getOptions();f.series.pie.show&&e(a,b,c,d)}),b.hooks.drawOverlay.push(function(a,b){var c=a.getOptions();c.series.pie.show&&q(a,b)}),b.hooks.draw.push(function(a,b){var c=a.getOptions();c.series.pie.show&&g(a,b)})}var c=10,d=.95,e={"series":{"pie":{"show":!1,"radius":"auto","innerRadius":0,"startAngle":1.5,"tilt":1,"shadow":{"left":5,"top":15,"alpha":.02},"offset":{"top":0,"left":"auto"},"stroke":{"color":"#fff","width":1},"label":{"show":"auto","formatter":function(a,b){return"<div style='font-size:x-small;text-align:center;padding:2px;color:"+b.color+";'>"+a+"<br/>"+Math.round(b.percent)+"%</div>"},"radius":1,"background":{"color":null,"opacity":0},"threshold":0},"combine":{"threshold":-1,"color":null,"label":"Other"},"highlight":{"opacity":.5}}}};a.plot.plugins.push({"init":b,"options":e,"name":"pie","version":"1.1"})}(jQuery),function(){var PixelPlot;if(!$.fn.plot)throw new Error("jquery.flot.js required");PixelPlot=function($graph,graph_data,plot_options,options){var available_colors,d,data,dataItem,previousPoint,timer,_i,_j,_len,_len1;for(null==options&&(options={}),this.options=$.extend(!0,{},PixelPlot.DEFAULTS,options||{}),this.plot_options=$.extend(!0,{},PixelPlot.PLOT_DEFAULTS,plot_options||{}),data=[],this.current_width=null,this.plot_obj=null,timer=null,available_colors=window.PixelAdmin.settings.consts.COLORS.slice(0),_i=0,_len=graph_data.length;_len>_i;_i++)d=graph_data[_i],data.push($.extend({},d));if(this.$graph=$graph.addClass("pa-flot-graph"),this.$graph_container=$('<div class="pa-flot-container"></div>'),this.$graph_info=$('<div class="pa-flot-info"></div>'),this.$graph_container.insertAfter(this.$graph).append(this.$graph_info).append(this.$graph),this.resizeContainer(),data.length){for(_j=0,_len1=data.length;_len1>_j;_j++)dataItem=data[_j],void 0===dataItem.color&&(dataItem.color=available_colors.shift()),dataItem.filledPoints===!0&&($.extend(!0,dataItem,{"points":{"radius":this.options.pointRadius,"fillColor":dataItem.color}}),delete dataItem.filledPoints),this.$graph_info.append($('<span><i style="background: '+dataItem.color+'"></i>'+dataItem.label+"</span>"));return this.plot_obj=$.plot($graph,data,this.plot_options),void 0===this.plot_options.series.pie&&(previousPoint=null,$graph.bind("plothover",function(_this){return function(event,pos,item){var x,y;return item?previousPoint!==item.dataIndex?(previousPoint=item.dataIndex,$(".pa-flot-tooltip").remove(),x=item.datapoint[0],y=item.datapoint[1],_this.showTooltip(item.pageX,item.pageY,eval(_this.options.tooltipText))):void 0:($(".pa-flot-tooltip").remove(),previousPoint=null)}}(this))),$(window).on("pa.resize",$.proxy(this.resizeContainer,this))}},PixelPlot.prototype.resizeContainer=function(){var a,b;return b=this.$graph_container.innerWidth(),b!==this.current_width?(a=null===this.options.height?Math.ceil(b*this.options.heightRatio):this.options.height,this.$graph.css({"width":b,"height":a}),this.current_width=b,this.plot_obj?(this.plot_obj.getPlaceholder().css({"width":b,"height":a}),this.plot_obj.resize(),this.plot_obj.setupGrid(),this.plot_obj.draw()):void 0):void 0},PixelPlot.prototype.showTooltip=function(a,b,c){var d;return d=$('<div class="pa-flot-tooltip">'+c+"</div>").appendTo("body"),a+20+d.width()>this.$graph_container.offset().left+this.$graph_container.width()?a-=40+d.width():a+=20,d.css({"top":b-16,"left":a}).fadeIn()},PixelPlot.DEFAULTS={"pointRadius":4,"height":null,"heightRatio":.5,"tooltipText":"x - y"},PixelPlot.PLOT_DEFAULTS={"series":{"shadowSize":0},"grid":{"color":"#999","borderColor":"#fff","borderWidth":1,"hoverable":!0},"xaxis":{"tickColor":"#fff"},"legend":{"show":!1}},$.fn.pixelPlot=function(a,b,c){return this.each(function(){var d;return d=$.data(this,"PixelPlot"),d?"resizeContainer"===b?d.resizeContainer():void 0:$.data(this,"PixelPlot",new PixelPlot($(this),a,b,c))})},$.fn.pixelPlot.Constructor=PixelPlot}.call(this),function(){var a,b,c,d,e,f;$.fn.modal&&$.fn.Vague&&$("html").hasClass("not-ie")&&(e=$.fn.modal.Constructor.prototype.show,d=$.fn.modal.Constructor.prototype.hide,a=null,f=!1,c=function(){return f?void 0:(a||(a=$("#main-wrapper").Vague({"intensity":3,"forceSVGUrl":!1})),a.blur(),f=!0)},b=function(){return f?(a&&a.unblur(),f=!1):void 0},$.fn.modal.Constructor.prototype.show=function(){return e.call(this),this.$element.hasClass("modal-blur")?($("body").append(this.$element),"desktop"===getScreenSize($("#small-screen-width-point"),$("#tablet-screen-width-point"))&&c(),$(window).on("pa.resize.modal_blur",function(){return"desktop"===getScreenSize($("#small-screen-width-point"),$("#tablet-screen-width-point"))?c():b()})):b()},$.fn.modal.Constructor.prototype.hide=function(){return d.call(this),b(),$(window).off("pa.resize.modal_blur").on("hidden",".modal",function(){return alert("asd")})})}.call(this),function(){var a;if(!$.fn.datepicker)throw new Error("bootstrap-datepicker.js required");a=$.fn.datepicker,$.fn.datepicker=function(b){return b=$.extend({"rtl":$("body").hasClass("right-to-left")},b||{}),a.call($(this),b)}}.call(this),function(){var a;if(!$.fn.timepicker)throw new Error("bootstrap-timepicker.js required");a=$.fn.timepicker.Constructor.prototype._init,$.fn.timepicker.Constructor.prototype._init=function(){return this.$element.parent().hasClass("input-group")&&(this.$element.parent(".input-group").find(".input-group-addon").on("click.timepicker",$.proxy(this.showWidget,this)),this.$element.on({"focus.timepicker":$.proxy(this.highlightUnit,this),"click.timepicker":$.proxy(this.highlightUnit,this),"keydown.timepicker":$.proxy(this.elementKeydown,this),"blur.timepicker":$.proxy(this.blurElement,this)})),a.call(this)},$.fn.timepicker.Constructor.prototype.getTemplate=function(){var a,b,c,d,e,f;return this.showInputs?(a='<input type="text" name="hour" class="bootstrap-timepicker-hour form-control" maxlength="2"/>',c='<input type="text" name="minute" class="bootstrap-timepicker-minute form-control" maxlength="2"/>',d='<input type="text" name="second" class="bootstrap-timepicker-second form-control" maxlength="2"/>',b='<input type="text" name="meridian" class="bootstrap-timepicker-meridian form-control" maxlength="2"/>'):(a='<span class="bootstrap-timepicker-hour"></span>',c='<span class="bootstrap-timepicker-minute"></span>',d='<span class="bootstrap-timepicker-second"></span>',b='<span class="bootstrap-timepicker-meridian"></span>'),f="<table>",f+="<tr>",f+='<td><a href="#" data-action="incrementHour" class="timepicker-increment"><i class="fa fa-chevron-up"></i></a></td>',f+='<td class="separator"> </td>',f+='<td><a href="#" data-action="incrementMinute" class="timepicker-increment"><i class="fa fa-chevron-up"></i></a></td>',this.showSeconds&&(f+='<td class="separator"> </td><td><a href="#" data-action="incrementSecond" class="timepicker-increment"><i class="fa fa-chevron-up"></i></a></td>'),this.showMeridian&&(f+='<td class="separator"> </td><td class="meridian-column"><a href="#" data-action="toggleMeridian" class="timepicker-increment"><i class="fa fa-chevron-up"></i></a></td>'),f+="</tr>",f+="<tr>",f+="<td>"+a+"</td> ",f+='<td class="separator">:</td>',f+="<td>"+c+"</td> ",this.showSeconds&&(f+='<td class="separator">:</td><td>'+d+"</td>"),this.showMeridian&&(f+='<td class="separator"> </td><td>'+b+"</td>"),f+="</tr>",f+="<tr>",f+='<td><a href="#" data-action="decrementHour" class="timepicker-decrement"><i class="fa fa-chevron-down"></i></a></td>',f+='<td class="separator"></td>',f+='<td><a href="#" data-action="decrementMinute" class="timepicker-decrement"><i class="fa fa-chevron-down"></i></a></td>',this.showSeconds&&(f+='<td class="separator"> </td><td><a href="#" data-action="decrementSecond" class="timepicker-decrement"><i class="fa fa-chevron-down"></i></a></td>'),this.showMeridian&&(f+='<td class="separator"> </td><td><a href="#" data-action="toggleMeridian" class="timepicker-decrement"><i class="fa fa-chevron-down"></i></a></td>'),f+="</tr>",f+="</table>","modal"===this.template?(e='<div class="bootstrap-timepicker-widget modal fade" tabindex="-1" role="dialog" style="display: none;">',e+='<div class="modal-dialog modal-sm">',e+='<div class="modal-content">',e+='<div class="modal-header">',e+='<button type="button" class="close" data-dismiss="modal">\xd7</button>',e+="<h4>Pick a Time</h4>",e+="</div>",e+='<div class="modal-body">'+f+"</div>",e+='<div class="modal-footer">',e+='<buttom class="btn btn-primary" data-dismiss="modal">OK</buttom>',e+="</div>",e+="</div>",e+="</div>",e+="</div>"):"dropdown"===this.template&&(e='<div class="bootstrap-timepicker-widget dropdown-menu">'+f+"</div>"),e}}.call(this),function(){var a;if(!$.fn.datepaginator)throw new Error("bootstrap-datepaginator.js required");a=$.fn.datepaginator,$.fn.datepaginator=function(b,c){return a.call(this,$.extend({},{"injectStyle":!1,"itemWidth":45,"selectedItemWidth":160},b||{}),c)}}.call(this),function(){var a;if(!$.fn.tabdrop)throw new Error("bootstrap-tabdrop.js required");a=$.fn.tabdrop,$.fn.tabdrop=function(b){return b=$.extend({},$.fn.tabdrop.defaults,b),this.each(function(){var c,d;return c=$(this),a.call(c,b),d=c.data("tabdrop"),d?(d.dropdown.on("click","li",function(){return $(this).parent().parent().find("a.dropdown-toggle").empty().html('<span class="display-tab"> '+$(this).text()+' </span><b class="caret"></b>'),d.layout()}),d.element.on("click","> li",function(){return $(this).hasClass("tabdrop")?void 0:(d.element.find("> .tabdrop > a.dropdown-toggle").empty().html(b.text+' <b class="caret"></b>'),d.layout())})):void 0})},$.fn.tabdrop.defaults={"text":'<i class="fa fa-bars"></i>'}}.call(this),function(){if(!$.validator)throw new Error("jquery.validate.js required");$.validator.setDefaults({"highlight":function(a){return $(a).closest(".form-group").addClass("has-error")},"unhighlight":function(a){return $(a).closest(".form-group").removeClass("has-error").find("help-block-hidden").removeClass("help-block-hidden").addClass("help-block").show()},"errorElement":"div","errorClass":"jquery-validate-error","errorPlacement":function(a,b){var c,d,e;return e=b.is('input[type="checkbox"]')||b.is('input[type="radio"]'),d=b.closest(".form-group").find(".jquery-validate-error").length,e&&d?void 0:(d||b.closest(".form-group").find(".help-block").removeClass("help-block").addClass("help-block-hidden").hide(),a.addClass("help-block"),e?b.closest('[class*="col-"]').append(a):(c=b.parent(),c.is(".input-group")?c.parent().append(a):c.append(a)))}})}.call(this),function(){var a;if(!$.fn.knob)throw new Error("jquery.knob.js required");a=$.fn.knob,$.fn.knob=function(b){var c;return c=$("body"),a.call(this,b).each(function(){var a;return c.hasClass("right-to-left")?(a=$(this).find("input"),a.css({"margin-left":0,"margin-right":a.css("margin-left")})):void 0})}}.call(this),function(){var a;if(!$.fn.sparkline)throw new Error("jquery.sparkline.js required");a=function(a,b,c){var d,e;return e=a.outerWidth(),d=parseInt(c)*(b-1),Math.floor((e-d)/b)},$.fn.pixelSparkline=function(){var b,c,d,e;return c=arguments,d=!1,e=0,b="2px",c[0]instanceof Array&&c[1]instanceof Object&&"bar"===c[1].type&&"100%"===c[1].width&&(d=!0,e=c[0].length,c[1].barSpacing&&(b=c[1].barSpacing),c[1].barWidth=a($(this),e,b)),$.fn.sparkline.apply(this,c),$(window).on("pa.resize",function(f){return function(){return d&&(c[1].barWidth=a($(f),e,b)),$.fn.sparkline.apply(f,c)}}(this))}}.call(this); |