Blog2Social: Social Media Auto Post & Scheduler - Version 5.7.2

Version Description

Additional Security Update and improvements

Download this release

Release Info

Developer Blog2Social
Plugin Icon 128x128 Blog2Social: Social Media Auto Post & Scheduler
Version 5.7.2
Comparing to
See all releases

Code changes from version 5.7.1 to 5.7.2

assets/js/b2s/ship.js CHANGED
@@ -2409,6 +2409,7 @@ jQuery(document).on('click', '.b2s-loading-area-save-profile-change', function (
2409
  window.addEventListener('message', function (e) {
2410
  if (e.origin == jQuery('#b2sServerUrl').val()) {
2411
  var data = JSON.parse(e.data);
 
2412
  if (typeof data.action !== typeof undefined && data.action == 'approve') {
2413
  jQuery('.b2s-post-item-details-message-result[data-network-auth-id="' + data.networkAuthId + '"]').html("<br><span class=\"text-success\"><i class=\"glyphicon glyphicon-ok-circle\"></i> " + jQuery("#b2sJsTextPublish").val() + " </span>");
2414
  jQuery.ajax({
@@ -2426,7 +2427,7 @@ window.addEventListener('message', function (e) {
2426
  }
2427
  });
2428
  } else {
2429
- loginSuccess(data.networkId, data.networkType, data.displayName, data.networkAuthId, data.mandandId);
2430
  }
2431
  }
2432
  });
@@ -3281,7 +3282,7 @@ function wopApprove(networkAuthId, postId, url, name) {
3281
  }
3282
 
3283
 
3284
- function loginSuccess(networkId, networkType, displayName, networkAuthId, mandandId) {
3285
  jQuery('.b2s-network-auth-success').show();
3286
  jQuery('#b2s-network-list-modal').modal('hide');
3287
  jQuery('#b2s-network-list-modal').hide();
@@ -3300,6 +3301,7 @@ function loginSuccess(networkId, networkType, displayName, networkAuthId, mandan
3300
  'networkType': networkType,
3301
  'displayName': displayName,
3302
  'networkAuthId': networkAuthId,
 
3303
  'mandandId': mandandId
3304
  },
3305
  error: function () {
2409
  window.addEventListener('message', function (e) {
2410
  if (e.origin == jQuery('#b2sServerUrl').val()) {
2411
  var data = JSON.parse(e.data);
2412
+ console.log(data);
2413
  if (typeof data.action !== typeof undefined && data.action == 'approve') {
2414
  jQuery('.b2s-post-item-details-message-result[data-network-auth-id="' + data.networkAuthId + '"]').html("<br><span class=\"text-success\"><i class=\"glyphicon glyphicon-ok-circle\"></i> " + jQuery("#b2sJsTextPublish").val() + " </span>");
2415
  jQuery.ajax({
2427
  }
2428
  });
2429
  } else {
2430
+ loginSuccess(data.networkId, data.networkType, data.displayName, data.networkAuthId, data.mandandId, data.instant_sharing);
2431
  }
2432
  }
2433
  });
3282
  }
3283
 
3284
 
3285
+ function loginSuccess(networkId, networkType, displayName, networkAuthId, mandandId, instant_sharing) {
3286
  jQuery('.b2s-network-auth-success').show();
3287
  jQuery('#b2s-network-list-modal').modal('hide');
3288
  jQuery('#b2s-network-list-modal').hide();
3301
  'networkType': networkType,
3302
  'displayName': displayName,
3303
  'networkAuthId': networkAuthId,
3304
+ 'instant_sharing': instant_sharing,
3305
  'mandandId': mandandId
3306
  },
3307
  error: function () {
assets/js/general.js CHANGED
@@ -1,6 +1,6 @@
1
  /*!
2
- * Bootstrap v3.3.6 (http://getbootstrap.com)
3
- * Copyright 2011-2015 Twitter, Inc.
4
  * Licensed under the MIT license
5
  */
6
  if ("undefined" == typeof jQuery)
1
  /*!
2
+ * Bootstrap
3
+ * Copyright 2011-2019 Twitter, Inc.
4
  * Licensed under the MIT license
5
  */
6
  if ("undefined" == typeof jQuery)
assets/js/validate.js CHANGED
@@ -1,51 +1,4 @@
1
- /**
2
- * jQuery Validation Plugin 1.9.0
3
- *
4
- * http://bassistance.de/jquery-plugins/jquery-plugin-validation/
5
- * http://docs.jquery.com/Plugins/Validation
6
- *
7
- * Copyright (c) 2006 - 2011 Jörn Zaefferer
8
- *
9
- * Dual licensed under the MIT and GPL licenses:
10
- * http://www.opensource.org/licenses/mit-license.php
11
- * http://www.gnu.org/licenses/gpl.html
12
- */
13
- (function(c){c.extend(c.fn,{validate:function(a){if(this.length){var b=c.data(this[0],"validator");if(b)return b;this.attr("novalidate","novalidate");b=new c.validator(a,this[0]);c.data(this[0],"validator",b);if(b.settings.onsubmit){a=this.find("input, button");a.filter(".cancel").click(function(){b.cancelSubmit=true});b.settings.submitHandler&&a.filter(":submit").click(function(){b.submitButton=this});this.submit(function(d){function e(){if(b.settings.submitHandler){if(b.submitButton)var f=c("<input type='hidden'/>").attr("name",
14
- b.submitButton.name).val(b.submitButton.value).appendTo(b.currentForm);b.settings.submitHandler.call(b,b.currentForm);b.submitButton&&f.remove();return false}return true}b.settings.debug&&d.preventDefault();if(b.cancelSubmit){b.cancelSubmit=false;return e()}if(b.form()){if(b.pendingRequest){b.formSubmitted=true;return false}return e()}else{b.focusInvalid();return false}})}return b}else a&&a.debug&&window.console&&console.warn("nothing selected, can't validate, returning nothing")},valid:function(){if(c(this[0]).is("form"))return this.validate().form();
15
- else{var a=true,b=c(this[0].form).validate();this.each(function(){a&=b.element(this)});return a}},removeAttrs:function(a){var b={},d=this;c.each(a.split(/\s/),function(e,f){b[f]=d.attr(f);d.removeAttr(f)});return b},rules:function(a,b){var d=this[0];if(a){var e=c.data(d.form,"validator").settings,f=e.rules,g=c.validator.staticRules(d);switch(a){case "add":c.extend(g,c.validator.normalizeRule(b));f[d.name]=g;if(b.messages)e.messages[d.name]=c.extend(e.messages[d.name],b.messages);break;case "remove":if(!b){delete f[d.name];
16
- return g}var h={};c.each(b.split(/\s/),function(j,i){h[i]=g[i];delete g[i]});return h}}d=c.validator.normalizeRules(c.extend({},c.validator.metadataRules(d),c.validator.classRules(d),c.validator.attributeRules(d),c.validator.staticRules(d)),d);if(d.required){e=d.required;delete d.required;d=c.extend({required:e},d)}return d}});c.extend(c.expr[":"],{blank:function(a){return!c.trim(""+a.value)},filled:function(a){return!!c.trim(""+a.value)},unchecked:function(a){return!a.checked}});c.validator=function(a,
17
- b){this.settings=c.extend(true,{},c.validator.defaults,a);this.currentForm=b;this.init()};c.validator.format=function(a,b){if(arguments.length==1)return function(){var d=c.makeArray(arguments);d.unshift(a);return c.validator.format.apply(this,d)};if(arguments.length>2&&b.constructor!=Array)b=c.makeArray(arguments).slice(1);if(b.constructor!=Array)b=[b];c.each(b,function(d,e){a=a.replace(RegExp("\\{"+d+"\\}","g"),e)});return a};c.extend(c.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",
18
- validClass:"valid",errorElement:"label",focusInvalid:true,errorContainer:c([]),errorLabelContainer:c([]),onsubmit:true,ignore:":hidden",ignoreTitle:false,onfocusin:function(a){this.lastActive=a;if(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){if(!this.checkable(a)&&(a.name in this.submitted||!this.optional(a)))this.element(a)},
19
- onkeyup:function(a){if(a.name in this.submitted||a==this.lastElement)this.element(a)},onclick:function(a){if(a.name in this.submitted)this.element(a);else a.parentNode.name in this.submitted&&this.element(a.parentNode)},highlight:function(a,b,d){a.type==="radio"?this.findByName(a.name).addClass(b).removeClass(d):c(a).addClass(b).removeClass(d)},unhighlight:function(a,b,d){a.type==="radio"?this.findByName(a.name).removeClass(b).addClass(d):c(a).removeClass(b).addClass(d)}},setDefaults:function(a){c.extend(c.validator.defaults,
20
- a)},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.",accept:"Please enter a value with a valid extension.",maxlength:c.validator.format("Please enter no more than {0} characters."),
21
- minlength:c.validator.format("Please enter at least {0} characters."),rangelength:c.validator.format("Please enter a value between {0} and {1} characters long."),range:c.validator.format("Please enter a value between {0} and {1}."),max:c.validator.format("Please enter a value less than or equal to {0}."),min:c.validator.format("Please enter a value greater than or equal to {0}.")},autoCreateRanges:false,prototype:{init:function(){function a(e){var f=c.data(this[0].form,"validator"),g="on"+e.type.replace(/^validate/,
22
- "");f.settings[g]&&f.settings[g].call(f,this[0],e)}this.labelContainer=c(this.settings.errorLabelContainer);this.errorContext=this.labelContainer.length&&this.labelContainer||c(this.currentForm);this.containers=c(this.settings.errorContainer).add(this.settings.errorLabelContainer);this.submitted={};this.valueCache={};this.pendingRequest=0;this.pending={};this.invalid={};this.reset();var b=this.groups={};c.each(this.settings.groups,function(e,f){c.each(f.split(/\s/),function(g,h){b[h]=e})});var d=
23
- this.settings.rules;c.each(d,function(e,f){d[e]=c.validator.normalizeRule(f)});c(this.currentForm).validateDelegate("[type='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",a).validateDelegate("[type='radio'], [type='checkbox'], select, option","click",
24
- a);this.settings.invalidHandler&&c(this.currentForm).bind("invalid-form.validate",this.settings.invalidHandler)},form:function(){this.checkForm();c.extend(this.submitted,this.errorMap);this.invalid=c.extend({},this.errorMap);this.valid()||c(this.currentForm).triggerHandler("invalid-form",[this]);this.showErrors();return 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(a){this.lastElement=
25
- a=this.validationTargetFor(this.clean(a));this.prepareElement(a);this.currentElements=c(a);var b=this.check(a);if(b)delete this.invalid[a.name];else this.invalid[a.name]=true;if(!this.numberOfInvalids())this.toHide=this.toHide.add(this.containers);this.showErrors();return b},showErrors:function(a){if(a){c.extend(this.errorMap,a);this.errorList=[];for(var b in a)this.errorList.push({message:a[b],element:this.findByName(b)[0]});this.successList=c.grep(this.successList,function(d){return!(d.name in a)})}this.settings.showErrors?
26
- this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors()},resetForm:function(){c.fn.resetForm&&c(this.currentForm).resetForm();this.submitted={};this.lastElement=null;this.prepareForm();this.hideErrors();this.elements().removeClass(this.settings.errorClass)},numberOfInvalids:function(){return this.objectLength(this.invalid)},objectLength:function(a){var b=0,d;for(d in a)b++;return b},hideErrors:function(){this.addWrapper(this.toHide).hide()},valid:function(){return this.size()==
27
- 0},size:function(){return this.errorList.length},focusInvalid:function(){if(this.settings.focusInvalid)try{c(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus().trigger("focusin")}catch(a){}},findLastActive:function(){var a=this.lastActive;return a&&c.grep(this.errorList,function(b){return b.element.name==a.name}).length==1&&a},elements:function(){var a=this,b={};return c(this.currentForm).find("input, select, textarea").not(":submit, :reset, :image, [disabled]").not(this.settings.ignore).filter(function(){!this.name&&
28
- a.settings.debug&&window.console&&console.error("%o has no name assigned",this);if(this.name in b||!a.objectLength(c(this).rules()))return false;return b[this.name]=true})},clean:function(a){return c(a)[0]},errors:function(){return c(this.settings.errorElement+"."+this.settings.errorClass,this.errorContext)},reset:function(){this.successList=[];this.errorList=[];this.errorMap={};this.toShow=c([]);this.toHide=c([]);this.currentElements=c([])},prepareForm:function(){this.reset();this.toHide=this.errors().add(this.containers)},
29
- prepareElement:function(a){this.reset();this.toHide=this.errorsFor(a)},check:function(a){a=this.validationTargetFor(this.clean(a));var b=c(a).rules(),d=false,e;for(e in b){var f={method:e,parameters:b[e]};try{var g=c.validator.methods[e].call(this,a.value.replace(/\r/g,""),a,f.parameters);if(g=="dependency-mismatch")d=true;else{d=false;if(g=="pending"){this.toHide=this.toHide.not(this.errorsFor(a));return}if(!g){this.formatAndAdd(a,f);return false}}}catch(h){this.settings.debug&&window.console&&console.log("exception occured when checking element "+
30
- a.id+", check the '"+f.method+"' method",h);throw h;}}if(!d){this.objectLength(b)&&this.successList.push(a);return true}},customMetaMessage:function(a,b){if(c.metadata){var d=this.settings.meta?c(a).metadata()[this.settings.meta]:c(a).metadata();return d&&d.messages&&d.messages[b]}},customMessage:function(a,b){var d=this.settings.messages[a];return d&&(d.constructor==String?d:d[b])},findDefined:function(){for(var a=0;a<arguments.length;a++)if(arguments[a]!==undefined)return arguments[a]},defaultMessage:function(a,
31
- b){return this.findDefined(this.customMessage(a.name,b),this.customMetaMessage(a,b),!this.settings.ignoreTitle&&a.title||undefined,c.validator.messages[b],"<strong>Warning: No message defined for "+a.name+"</strong>")},formatAndAdd:function(a,b){var d=this.defaultMessage(a,b.method),e=/\$?\{(\d+)\}/g;if(typeof d=="function")d=d.call(this,b.parameters,a);else if(e.test(d))d=jQuery.format(d.replace(e,"{$1}"),b.parameters);this.errorList.push({message:d,element:a});this.errorMap[a.name]=d;this.submitted[a.name]=
32
- d},addWrapper:function(a){if(this.settings.wrapper)a=a.add(a.parent(this.settings.wrapper));return a},defaultShowErrors:function(){for(var a=0;this.errorList[a];a++){var b=this.errorList[a];this.settings.highlight&&this.settings.highlight.call(this,b.element,this.settings.errorClass,this.settings.validClass);this.showLabel(b.element,b.message)}if(this.errorList.length)this.toShow=this.toShow.add(this.containers);if(this.settings.success)for(a=0;this.successList[a];a++)this.showLabel(this.successList[a]);
33
- if(this.settings.unhighlight){a=0;for(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 c(this.errorList).map(function(){return this.element})},showLabel:function(a,b){var d=this.errorsFor(a);if(d.length){d.removeClass(this.settings.validClass).addClass(this.settings.errorClass);
34
- d.attr("generated")&&d.html(b)}else{d=c("<"+this.settings.errorElement+"/>").attr({"for":this.idOrName(a),generated:true}).addClass(this.settings.errorClass).html(b||"");if(this.settings.wrapper)d=d.hide().show().wrap("<"+this.settings.wrapper+"/>").parent();this.labelContainer.append(d).length||(this.settings.errorPlacement?this.settings.errorPlacement(d,c(a)):d.insertAfter(a))}if(!b&&this.settings.success){d.text("");typeof this.settings.success=="string"?d.addClass(this.settings.success):this.settings.success(d)}this.toShow=
35
- this.toShow.add(d)},errorsFor:function(a){var b=this.idOrName(a);return this.errors().filter(function(){return c(this).attr("for")==b})},idOrName:function(a){return this.groups[a.name]||(this.checkable(a)?a.name:a.id||a.name)},validationTargetFor:function(a){if(this.checkable(a))a=this.findByName(a.name).not(this.settings.ignore)[0];return a},checkable:function(a){return/radio|checkbox/i.test(a.type)},findByName:function(a){var b=this.currentForm;return c(document.getElementsByName(a)).map(function(d,
36
- e){return e.form==b&&e.name==a&&e||null})},getLength:function(a,b){switch(b.nodeName.toLowerCase()){case "select":return c("option:selected",b).length;case "input":if(this.checkable(b))return this.findByName(b.name).filter(":checked").length}return a.length},depend:function(a,b){return this.dependTypes[typeof a]?this.dependTypes[typeof a](a,b):true},dependTypes:{"boolean":function(a){return a},string:function(a,b){return!!c(a,b.form).length},"function":function(a,b){return a(b)}},optional:function(a){return!c.validator.methods.required.call(this,
37
- c.trim(a.value),a)&&"dependency-mismatch"},startRequest:function(a){if(!this.pending[a.name]){this.pendingRequest++;this.pending[a.name]=true}},stopRequest:function(a,b){this.pendingRequest--;if(this.pendingRequest<0)this.pendingRequest=0;delete this.pending[a.name];if(b&&this.pendingRequest==0&&this.formSubmitted&&this.form()){c(this.currentForm).submit();this.formSubmitted=false}else if(!b&&this.pendingRequest==0&&this.formSubmitted){c(this.currentForm).triggerHandler("invalid-form",[this]);this.formSubmitted=
38
- false}},previousValue:function(a){return c.data(a,"previousValue")||c.data(a,"previousValue",{old:null,valid:true,message:this.defaultMessage(a,"remote")})}},classRuleSettings:{required:{required:true},email:{email:true},url:{url:true},date:{date:true},dateISO:{dateISO:true},dateDE:{dateDE:true},number:{number:true},numberDE:{numberDE:true},digits:{digits:true},creditcard:{creditcard:true}},addClassRules:function(a,b){a.constructor==String?this.classRuleSettings[a]=b:c.extend(this.classRuleSettings,
39
- a)},classRules:function(a){var b={};(a=c(a).attr("class"))&&c.each(a.split(" "),function(){this in c.validator.classRuleSettings&&c.extend(b,c.validator.classRuleSettings[this])});return b},attributeRules:function(a){var b={};a=c(a);for(var d in c.validator.methods){var e;if(e=d==="required"&&typeof c.fn.prop==="function"?a.prop(d):a.attr(d))b[d]=e;else if(a[0].getAttribute("type")===d)b[d]=true}b.maxlength&&/-1|2147483647|524288/.test(b.maxlength)&&delete b.maxlength;return b},metadataRules:function(a){if(!c.metadata)return{};
40
- var b=c.data(a.form,"validator").settings.meta;return b?c(a).metadata()[b]:c(a).metadata()},staticRules:function(a){var b={},d=c.data(a.form,"validator");if(d.settings.rules)b=c.validator.normalizeRule(d.settings.rules[a.name])||{};return b},normalizeRules:function(a,b){c.each(a,function(d,e){if(e===false)delete a[d];else if(e.param||e.depends){var f=true;switch(typeof e.depends){case "string":f=!!c(e.depends,b.form).length;break;case "function":f=e.depends.call(b,b)}if(f)a[d]=e.param!==undefined?
41
- e.param:true;else delete a[d]}});c.each(a,function(d,e){a[d]=c.isFunction(e)?e(b):e});c.each(["minlength","maxlength","min","max"],function(){if(a[this])a[this]=Number(a[this])});c.each(["rangelength","range"],function(){if(a[this])a[this]=[Number(a[this][0]),Number(a[this][1])]});if(c.validator.autoCreateRanges){if(a.min&&a.max){a.range=[a.min,a.max];delete a.min;delete a.max}if(a.minlength&&a.maxlength){a.rangelength=[a.minlength,a.maxlength];delete a.minlength;delete a.maxlength}}a.messages&&delete a.messages;
42
- return a},normalizeRule:function(a){if(typeof a=="string"){var b={};c.each(a.split(/\s/),function(){b[this]=true});a=b}return a},addMethod:function(a,b,d){c.validator.methods[a]=b;c.validator.messages[a]=d!=undefined?d:c.validator.messages[a];b.length<3&&c.validator.addClassRules(a,c.validator.normalizeRule(a))},methods:{required:function(a,b,d){if(!this.depend(d,b))return"dependency-mismatch";switch(b.nodeName.toLowerCase()){case "select":return(a=c(b).val())&&a.length>0;case "input":if(this.checkable(b))return this.getLength(a,
43
- b)>0;default:return c.trim(a).length>0}},remote:function(a,b,d){if(this.optional(b))return"dependency-mismatch";var e=this.previousValue(b);this.settings.messages[b.name]||(this.settings.messages[b.name]={});e.originalMessage=this.settings.messages[b.name].remote;this.settings.messages[b.name].remote=e.message;d=typeof d=="string"&&{url:d}||d;if(this.pending[b.name])return"pending";if(e.old===a)return e.valid;e.old=a;var f=this;this.startRequest(b);var g={};g[b.name]=a;c.ajax(c.extend(true,{url:d,
44
- mode:"abort",port:"validate"+b.name,dataType:"json",data:g,success:function(h){f.settings.messages[b.name].remote=e.originalMessage;var j=h===true;if(j){var i=f.formSubmitted;f.prepareElement(b);f.formSubmitted=i;f.successList.push(b);f.showErrors()}else{i={};h=h||f.defaultMessage(b,"remote");i[b.name]=e.message=c.isFunction(h)?h(a):h;f.showErrors(i)}e.valid=j;f.stopRequest(b,j)}},d));return"pending"},minlength:function(a,b,d){return this.optional(b)||this.getLength(c.trim(a),b)>=d},maxlength:function(a,
45
- b,d){return this.optional(b)||this.getLength(c.trim(a),b)<=d},rangelength:function(a,b,d){a=this.getLength(c.trim(a),b);return this.optional(b)||a>=d[0]&&a<=d[1]},min:function(a,b,d){return this.optional(b)||a>=d},max:function(a,b,d){return this.optional(b)||a<=d},range:function(a,b,d){return this.optional(b)||a>=d[0]&&a<=d[1]},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)},
46
- url: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)},
47
- date:function(a,b){return this.optional(b)||!/Invalid|NaN/.test(new Date(a))},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 false;var d=0,e=0,f=false;a=a.replace(/\D/g,"");for(var g=a.length-1;g>=
48
- 0;g--){e=a.charAt(g);e=parseInt(e,10);if(f)if((e*=2)>9)e-=9;d+=e;f=!f}return d%10==0},accept:function(a,b,d){d=typeof d=="string"?d.replace(/,/g,"|"):"png|jpe?g|gif";return this.optional(b)||a.match(RegExp(".("+d+")$","i"))},equalTo:function(a,b,d){d=c(d).unbind(".validate-equalTo").bind("blur.validate-equalTo",function(){c(b).valid()});return a==d.val()}}});c.format=c.validator.format})(jQuery);
49
- (function(c){var a={};if(c.ajaxPrefilter)c.ajaxPrefilter(function(d,e,f){e=d.port;if(d.mode=="abort"){a[e]&&a[e].abort();a[e]=f}});else{var b=c.ajax;c.ajax=function(d){var e=("port"in d?d:c.ajaxSettings).port;if(("mode"in d?d:c.ajaxSettings).mode=="abort"){a[e]&&a[e].abort();return a[e]=b.apply(this,arguments)}return b.apply(this,arguments)}}})(jQuery);
50
- (function(c){!jQuery.event.special.focusin&&!jQuery.event.special.focusout&&document.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(e){e=c.event.fix(e);e.type=b;return c.event.handle.call(this,e)}c.event.special[b]={setup:function(){this.addEventListener(a,d,true)},teardown:function(){this.removeEventListener(a,d,true)},handler:function(e){arguments[0]=c.event.fix(e);arguments[0].type=b;return c.event.handle.apply(this,arguments)}}});c.extend(c.fn,{validateDelegate:function(a,
51
- b,d){return this.bind(b,function(e){var f=c(e.target);if(f.is(a))return d.apply(f,arguments)})}})})(jQuery);
1
+ /*! jQuery Validation Plugin - v1.19.1 - 6/15/2019
2
+ * https://jqueryvalidation.org/
3
+ * Copyright (c) 2019 Jörn Zaefferer; Licensed MIT */
4
+ !function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof module&&module.exports?module.exports=a(require("jquery")):a(jQuery)}(function(a){a.extend(a.fn,{validate:function(b){if(!this.length)return void(b&&b.debug&&window.console&&console.warn("Nothing selected, can't validate, returning nothing."));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.on("click.validate",":submit",function(b){c.submitButton=b.currentTarget,a(this).hasClass("cancel")&&(c.cancelSubmit=!0),void 0!==a(this).attr("formnovalidate")&&(c.cancelSubmit=!0)}),this.on("submit.validate",function(b){function d(){var d,e;return c.submitButton&&(c.settings.submitHandler||c.formSubmitted)&&(d=a("<input type='hidden'/>").attr("name",c.submitButton.name).val(a(c.submitButton).val()).appendTo(c.currentForm)),!(c.settings.submitHandler&&!c.settings.debug)||(e=c.settings.submitHandler.call(c,c.currentForm,b),d&&d.remove(),void 0!==e&&e)}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(){var b,c,d;return a(this[0]).is("form")?b=this.validate().form():(d=[],b=!0,c=a(this[0].form).validate(),this.each(function(){b=c.element(this)&&b,b||(d=d.concat(c.errorList))}),c.errorList=d),b},rules:function(b,c){var d,e,f,g,h,i,j=this[0],k="undefined"!=typeof this.attr("contenteditable")&&"false"!==this.attr("contenteditable");if(null!=j&&(!j.form&&k&&(j.form=this.closest("form")[0],j.name=this.attr("name")),null!=j.form)){if(b)switch(d=a.data(j.form,"validator").settings,e=d.rules,f=a.validator.staticRules(j),b){case"add":a.extend(f,a.validator.normalizeRule(c)),delete f.messages,e[j.name]=f,c.messages&&(d.messages[j.name]=a.extend(d.messages[j.name],c.messages));break;case"remove":return c?(i={},a.each(c.split(/\s/),function(a,b){i[b]=f[b],delete f[b]}),i):(delete e[j.name],f)}return g=a.validator.normalizeRules(a.extend({},a.validator.classRules(j),a.validator.attributeRules(j),a.validator.dataRules(j),a.validator.staticRules(j)),j),g.required&&(h=g.required,delete g.required,g=a.extend({required:h},g)),g.remote&&(h=g.remote,delete g.remote,g=a.extend(g,{remote:h})),g}}}),a.extend(a.expr.pseudos||a.expr[":"],{blank:function(b){return!a.trim(""+a(b).val())},filled:function(b){var c=a(b).val();return null!==c&&!!a.trim(""+c)},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)}:void 0===c?b:(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",pendingClass:"pending",validClass:"valid",errorElement:"label",focusCleanup:!1,focusInvalid:!0,errorContainer:a([]),errorLabelContainer:a([]),onsubmit:!0,ignore:":hidden",ignoreTitle:!1,onfocusin:function(a){this.lastActive=a,this.settings.focusCleanup&&(this.settings.unhighlight&&this.settings.unhighlight.call(this,a,this.settings.errorClass,this.settings.validClass),this.hideThese(this.errorsFor(a)))},onfocusout:function(a){this.checkable(a)||!(a.name in this.submitted)&&this.optional(a)||this.element(a)},onkeyup:function(b,c){var d=[16,17,18,20,35,36,37,38,39,40,45,144,225];9===c.which&&""===this.elementValue(b)||a.inArray(c.keyCode,d)!==-1||(b.name in this.submitted||b.name in this.invalid)&&this.element(b)},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.",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}."),step:a.validator.format("Please enter a multiple of {0}.")},autoCreateRanges:!1,prototype:{init:function(){function b(b){var c="undefined"!=typeof a(this).attr("contenteditable")&&"false"!==a(this).attr("contenteditable");if(!this.form&&c&&(this.form=a(this).closest("form")[0],this.name=a(this).attr("name")),d===this.form){var e=a.data(this.form,"validator"),f="on"+b.type.replace(/^validate/,""),g=e.settings;g[f]&&!a(this).is(g.ignore)&&g[f].call(e,this,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,d=this.currentForm,e=this.groups={};a.each(this.settings.groups,function(b,c){"string"==typeof c&&(c=c.split(/\s/)),a.each(c,function(a,c){e[c]=b})}),c=this.settings.rules,a.each(c,function(b,d){c[b]=a.validator.normalizeRule(d)}),a(this.currentForm).on("focusin.validate focusout.validate keyup.validate",":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'], [type='radio'], [type='checkbox'], [contenteditable], [type='button']",b).on("click.validate","select, option, [type='radio'], [type='checkbox']",b),this.settings.invalidHandler&&a(this.currentForm).on("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){var c,d,e=this.clean(b),f=this.validationTargetFor(e),g=this,h=!0;return void 0===f?delete this.invalid[e.name]:(this.prepareElement(f),this.currentElements=a(f),d=this.groups[f.name],d&&a.each(this.groups,function(a,b){b===d&&a!==f.name&&(e=g.validationTargetFor(g.clean(g.findByName(a))),e&&e.name in g.invalid&&(g.currentElements.push(e),h=g.check(e)&&h))}),c=this.check(f)!==!1,h=h&&c,c?this.invalid[f.name]=!1:this.invalid[f.name]=!0,this.numberOfInvalids()||(this.toHide=this.toHide.add(this.containers)),this.showErrors(),a(b).attr("aria-invalid",!c)),h},showErrors:function(b){if(b){var c=this;a.extend(this.errorMap,b),this.errorList=a.map(this.errorMap,function(a,b){return{message:a,element:c.findByName(b)[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.invalid={},this.submitted={},this.prepareForm(),this.hideErrors();var b=this.elements().removeData("previousValue").removeAttr("aria-invalid");this.resetElements(b)},resetElements:function(a){var b;if(this.settings.unhighlight)for(b=0;a[b];b++)this.settings.unhighlight.call(this,a[b],this.settings.errorClass,""),this.findByName(a[b].name).removeClass(this.settings.validClass);else a.removeClass(this.settings.errorClass).removeClass(this.settings.validClass)},numberOfInvalids:function(){return this.objectLength(this.invalid)},objectLength:function(a){var b,c=0;for(b in a)void 0!==a[b]&&null!==a[b]&&a[b]!==!1&&c++;return c},hideErrors:function(){this.hideThese(this.toHide)},hideThese:function(a){a.not(this.containers).text(""),this.addWrapper(a).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").trigger("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, [contenteditable]").not(":submit, :reset, :image, :disabled").not(this.settings.ignore).filter(function(){var d=this.name||a(this).attr("name"),e="undefined"!=typeof a(this).attr("contenteditable")&&"false"!==a(this).attr("contenteditable");return!d&&b.settings.debug&&window.console&&console.error("%o has no name assigned",this),e&&(this.form=a(this).closest("form")[0],this.name=d),this.form===b.currentForm&&(!(d in c||!b.objectLength(a(this).rules()))&&(c[d]=!0,!0))})},clean:function(b){return a(b)[0]},errors:function(){var b=this.settings.errorClass.split(" ").join(".");return a(this.settings.errorElement+"."+b,this.errorContext)},resetInternals:function(){this.successList=[],this.errorList=[],this.errorMap={},this.toShow=a([]),this.toHide=a([])},reset:function(){this.resetInternals(),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,d,e=a(b),f=b.type,g="undefined"!=typeof e.attr("contenteditable")&&"false"!==e.attr("contenteditable");return"radio"===f||"checkbox"===f?this.findByName(b.name).filter(":checked").val():"number"===f&&"undefined"!=typeof b.validity?b.validity.badInput?"NaN":e.val():(c=g?e.text():e.val(),"file"===f?"C:\\fakepath\\"===c.substr(0,12)?c.substr(12):(d=c.lastIndexOf("/"),d>=0?c.substr(d+1):(d=c.lastIndexOf("\\"),d>=0?c.substr(d+1):c)):"string"==typeof c?c.replace(/\r/g,""):c)},check:function(b){b=this.validationTargetFor(this.clean(b));var c,d,e,f,g=a(b).rules(),h=a.map(g,function(a,b){return b}).length,i=!1,j=this.elementValue(b);"function"==typeof g.normalizer?f=g.normalizer:"function"==typeof this.settings.normalizer&&(f=this.settings.normalizer),f&&(j=f.call(b,j),delete g.normalizer);for(d in g){e={method:d,parameters:g[d]};try{if(c=a.validator.methods[d].call(this,j,b,e.parameters),"dependency-mismatch"===c&&1===h){i=!0;continue}if(i=!1,"pending"===c)return void(this.toHide=this.toHide.not(this.errorsFor(b)));if(!c)return this.formatAndAdd(b,e),!1}catch(k){throw this.settings.debug&&window.console&&console.log("Exception occurred when checking element "+b.id+", check the '"+e.method+"' method.",k),k instanceof TypeError&&(k.message+=". Exception occurred when checking element "+b.id+", check the '"+e.method+"' method."),k}}if(!i)return this.objectLength(g)&&this.successList.push(b),!0},customDataMessage:function(b,c){return a(b).data("msg"+c.charAt(0).toUpperCase()+c.substring(1).toLowerCase())||a(b).data("msg")},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]},defaultMessage:function(b,c){"string"==typeof c&&(c={method:c});var d=this.findDefined(this.customMessage(b.name,c.method),this.customDataMessage(b,c.method),!this.settings.ignoreTitle&&b.title||void 0,a.validator.messages[c.method],"<strong>Warning: No message defined for "+b.name+"</strong>"),e=/\$?\{(\d+)\}/g;return"function"==typeof d?d=d.call(this,c.parameters,b):e.test(d)&&(d=a.validator.format(d.replace(e,"{$1}"),c.parameters)),d},formatAndAdd:function(a,b){var c=this.defaultMessage(a,b);this.errorList.push({message:c,element:a,method:b.method}),this.errorMap[a.name]=c,this.submitted[a.name]=c},addWrapper:function(a){return this.settings.wrapper&&(a=a.add(a.parent(this.settings.wrapper))),a},defaultShowErrors:function(){var a,b,c;for(a=0;this.errorList[a];a++)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,e,f,g,h=this.errorsFor(b),i=this.idOrName(b),j=a(b).attr("aria-describedby");h.length?(h.removeClass(this.settings.validClass).addClass(this.settings.errorClass),h.html(c)):(h=a("<"+this.settings.errorElement+">").attr("id",i+"-error").addClass(this.settings.errorClass).html(c||""),d=h,this.settings.wrapper&&(d=h.hide().show().wrap("<"+this.settings.wrapper+"/>").parent()),this.labelContainer.length?this.labelContainer.append(d):this.settings.errorPlacement?this.settings.errorPlacement.call(this,d,a(b)):d.insertAfter(b),h.is("label")?h.attr("for",i):0===h.parents("label[for='"+this.escapeCssMeta(i)+"']").length&&(f=h.attr("id"),j?j.match(new RegExp("\\b"+this.escapeCssMeta(f)+"\\b"))||(j+=" "+f):j=f,a(b).attr("aria-describedby",j),e=this.groups[b.name],e&&(g=this,a.each(g.groups,function(b,c){c===e&&a("[name='"+g.escapeCssMeta(b)+"']",g.currentForm).attr("aria-describedby",h.attr("id"))})))),!c&&this.settings.success&&(h.text(""),"string"==typeof this.settings.success?h.addClass(this.settings.success):this.settings.success(h,b)),this.toShow=this.toShow.add(h)},errorsFor:function(b){var c=this.escapeCssMeta(this.idOrName(b)),d=a(b).attr("aria-describedby"),e="label[for='"+c+"'], label[for='"+c+"'] *";return d&&(e=e+", #"+this.escapeCssMeta(d).replace(/\s+/g,", #")),this.errors().filter(e)},escapeCssMeta:function(a){return a.replace(/([\\!"#$%&'()*+,.\/:;<=>?@\[\]^`{|}~])/g,"\\$1")},idOrName:function(a){return this.groups[a.name]||(this.checkable(a)?a.name:a.id||a.name)},validationTargetFor:function(b){return this.checkable(b)&&(b=this.findByName(b.name)),a(b).not(this.settings.ignore)[0]},checkable:function(a){return/radio|checkbox/i.test(a.type)},findByName:function(b){return a(this.currentForm).find("[name='"+this.escapeCssMeta(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)},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(b){this.pending[b.name]||(this.pendingRequest++,a(b).addClass(this.settings.pendingClass),this.pending[b.name]=!0)},stopRequest:function(b,c){this.pendingRequest--,this.pendingRequest<0&&(this.pendingRequest=0),delete this.pending[b.name],a(b).removeClass(this.settings.pendingClass),c&&0===this.pendingRequest&&this.formSubmitted&&this.form()?(a(this.currentForm).submit(),this.submitButton&&a("input:hidden[name='"+this.submitButton.name+"']",this.currentForm).remove(),this.formSubmitted=!1):!c&&0===this.pendingRequest&&this.formSubmitted&&(a(this.currentForm).triggerHandler("invalid-form",[this]),this.formSubmitted=!1)},previousValue:function(b,c){return c="string"==typeof c&&c||"remote",a.data(b,"previousValue")||a.data(b,"previousValue",{old:null,valid:!0,message:this.defaultMessage(b,{method:c})})},destroy:function(){this.resetForm(),a(this.currentForm).off(".validate").removeData("validator").find(".validate-equalTo-blur").off(".validate-equalTo").removeClass("validate-equalTo-blur").find(".validate-lessThan-blur").off(".validate-lessThan").removeClass("validate-lessThan-blur").find(".validate-lessThanEqual-blur").off(".validate-lessThanEqual").removeClass("validate-lessThanEqual-blur").find(".validate-greaterThanEqual-blur").off(".validate-greaterThanEqual").removeClass("validate-greaterThanEqual-blur").find(".validate-greaterThan-blur").off(".validate-greaterThan").removeClass("validate-greaterThan-blur")}},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},normalizeAttributeRule:function(a,b,c,d){/min|max|step/.test(c)&&(null===b||/number|range|text/.test(b))&&(d=Number(d),isNaN(d)&&(d=void 0)),d||0===d?a[c]=d:b===c&&"range"!==b&&(a[c]=!0)},attributeRules:function(b){var c,d,e={},f=a(b),g=b.getAttribute("type");for(c in a.validator.methods)"required"===c?(d=b.getAttribute(c),""===d&&(d=!0),d=!!d):d=f.attr(c),this.normalizeAttributeRule(e,g,c,d);return e.maxlength&&/-1|2147483647|524288/.test(e.maxlength)&&delete e.maxlength,e},dataRules:function(b){var c,d,e={},f=a(b),g=b.getAttribute("type");for(c in a.validator.methods)d=f.data("rule"+c.charAt(0).toUpperCase()+c.substring(1).toLowerCase()),""===d&&(d=!0),this.normalizeAttributeRule(e,g,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:(a.data(c.form,"validator").resetElements(a(c)),delete b[d])}}),a.each(b,function(d,e){b[d]=a.isFunction(e)&&"normalizer"!==d?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].replace(/[\[\]]/g,"").split(/[\s,]+/),b[this]=[Number(c[0]),Number(c[1])]))}),a.validator.autoCreateRanges&&(null!=b.min&&null!=b.max&&(b.range=[b.min,b.max],delete b.min,delete b.max),null!=b.minlength&&null!=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:void 0!==b&&null!==b&&b.length>0},email:function(a,b){return this.optional(b)||/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(a)},url:function(a,b){return this.optional(b)||/^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})).?)(?::\d{2,5})?(?:[\/?#]\S*)?$/i.test(a)},date:function(){var a=!1;return function(b,c){return a||(a=!0,this.settings.debug&&window.console&&console.warn("The `date` method is deprecated and will be removed in version '2.0.0'.\nPlease don't use it, since it relies on the Date constructor, which\nbehaves very differently across browsers and locales. Use `dateISO`\ninstead or one of the locale specific methods in `localizations/`\nand `additional-methods.js`.")),this.optional(c)||!/Invalid|NaN/.test(new Date(b).toString())}}(),dateISO:function(a,b){return this.optional(b)||/^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.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)},minlength:function(b,c,d){var e=a.isArray(b)?b.length:this.getLength(b,c);return this.optional(c)||e>=d},maxlength:function(b,c,d){var e=a.isArray(b)?b.length:this.getLength(b,c);return this.optional(c)||e<=d},rangelength:function(b,c,d){var e=a.isArray(b)?b.length:this.getLength(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)||a<=c},range:function(a,b,c){return this.optional(b)||a>=c[0]&&a<=c[1]},step:function(b,c,d){var e,f=a(c).attr("type"),g="Step attribute on input type "+f+" is not supported.",h=["text","number","range"],i=new RegExp("\\b"+f+"\\b"),j=f&&!i.test(h.join()),k=function(a){var b=(""+a).match(/(?:\.(\d+))?$/);return b&&b[1]?b[1].length:0},l=function(a){return Math.round(a*Math.pow(10,e))},m=!0;if(j)throw new Error(g);return e=k(d),(k(b)>e||l(b)%l(d)!==0)&&(m=!1),this.optional(c)||m},equalTo:function(b,c,d){var e=a(d);return this.settings.onfocusout&&e.not(".validate-equalTo-blur").length&&e.addClass("validate-equalTo-blur").on("blur.validate-equalTo",function(){a(c).valid()}),b===e.val()},remote:function(b,c,d,e){if(this.optional(c))return"dependency-mismatch";e="string"==typeof e&&e||"remote";var f,g,h,i=this.previousValue(c,e);return this.settings.messages[c.name]||(this.settings.messages[c.name]={}),i.originalMessage=i.originalMessage||this.settings.messages[c.name][e],this.settings.messages[c.name][e]=i.message,d="string"==typeof d&&{url:d}||d,h=a.param(a.extend({data:b},d.data)),i.old===h?i.valid:(i.old=h,f=this,this.startRequest(c),g={},g[c.name]=b,a.ajax(a.extend(!0,{mode:"abort",port:"validate"+c.name,dataType:"json",data:g,context:f.currentForm,success:function(a){var d,g,h,j=a===!0||"true"===a;f.settings.messages[c.name][e]=i.originalMessage,j?(h=f.formSubmitted,f.resetInternals(),f.toHide=f.errorsFor(c),f.formSubmitted=h,f.successList.push(c),f.invalid[c.name]=!1,f.showErrors()):(d={},g=a||f.defaultMessage(c,{method:e,parameters:b}),d[c.name]=i.message=g,f.invalid[c.name]=!0,f.showErrors(d)),i.valid=j,f.stopRequest(c,j)}},d)),"pending")}}});var b,c={};return a.ajaxPrefilter?a.ajaxPrefilter(function(a,b,d){var e=a.port;"abort"===a.mode&&(c[e]&&c[e].abort(),c[e]=d)}):(b=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?(c[f]&&c[f].abort(),c[f]=b.apply(this,arguments),c[f]):b.apply(this,arguments)}),a});
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/lib/btn-toogle/bootstrap-toggle.min.css CHANGED
@@ -1,8 +1,7 @@
1
  /*! ========================================================================
2
- * Bootstrap Toggle: bootstrap-toggle.css v2.2.0
3
- * http://www.bootstraptoggle.com
4
  * ========================================================================
5
- * Copyright 2014 Min Hur, The New York Times Company
6
  * Licensed under MIT
7
  * ======================================================================== */
8
  .checkbox label .toggle,.checkbox-inline .toggle{margin-left:-20px;margin-right:5px}
1
  /*! ========================================================================
2
+ * Bootstrap Toggle: bootstrap-toggle.css
 
3
  * ========================================================================
4
+ * Copyright 2019 Min Hur, The New York Times Company
5
  * Licensed under MIT
6
  * ======================================================================== */
7
  .checkbox label .toggle,.checkbox-inline .toggle{margin-left:-20px;margin-right:5px}
assets/lib/btn-toogle/bootstrap-toggle.min.js CHANGED
@@ -1,9 +1,7 @@
1
  /*! ========================================================================
2
- * Bootstrap Toggle: bootstrap-toggle.js v2.2.0
3
- * http://www.bootstraptoggle.com
4
  * ========================================================================
5
- * Copyright 2014 Min Hur, The New York Times Company
6
  * Licensed under MIT
7
  * ======================================================================== */
8
- +function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.toggle"),f="object"==typeof b&&b;e||d.data("bs.toggle",e=new c(this,f)),"string"==typeof b&&e[b]&&e[b]()})}var c=function(b,c){this.$element=a(b),this.options=a.extend({},this.defaults(),c),this.render()};c.VERSION="2.2.0",c.DEFAULTS={on:"On",off:"Off",onstyle:"primary",offstyle:"default",size:"normal",style:"",width:null,height:null},c.prototype.defaults=function(){return{on:this.$element.attr("data-on")||c.DEFAULTS.on,off:this.$element.attr("data-off")||c.DEFAULTS.off,onstyle:this.$element.attr("data-onstyle")||c.DEFAULTS.onstyle,offstyle:this.$element.attr("data-offstyle")||c.DEFAULTS.offstyle,size:this.$element.attr("data-size")||c.DEFAULTS.size,style:this.$element.attr("data-style")||c.DEFAULTS.style,width:this.$element.attr("data-width")||c.DEFAULTS.width,height:this.$element.attr("data-height")||c.DEFAULTS.height}},c.prototype.render=function(){this._onstyle="btn-"+this.options.onstyle,this._offstyle="btn-"+this.options.offstyle;var b="large"===this.options.size?"btn-lg":"small"===this.options.size?"btn-sm":"mini"===this.options.size?"btn-xs":"",c=a('<label class="btn">').html(this.options.on).addClass(this._onstyle+" "+b),d=a('<label class="btn">').html(this.options.off).addClass(this._offstyle+" "+b+" active"),e=a('<span class="toggle-handle btn btn-default">').addClass(b),f=a('<div class="toggle-group">').append(c,d,e),g=a('<div class="toggle btn" data-toggle="toggle">').addClass(this.$element.prop("checked")?this._onstyle:this._offstyle+" off").addClass(b).addClass(this.options.style);this.$element.wrap(g),a.extend(this,{$toggle:this.$element.parent(),$toggleOn:c,$toggleOff:d,$toggleGroup:f}),this.$toggle.append(f);var h=this.options.width||Math.max(c.outerWidth(),d.outerWidth())+e.outerWidth()/2,i=this.options.height||Math.max(c.outerHeight(),d.outerHeight());c.addClass("toggle-on"),d.addClass("toggle-off"),this.$toggle.css({width:h,height:i}),this.options.height&&(c.css("line-height",c.height()+"px"),d.css("line-height",d.height()+"px")),this.update(!0),this.trigger(!0)},c.prototype.toggle=function(){this.$element.prop("checked")?this.off():this.on()},c.prototype.on=function(a){return this.$element.prop("disabled")?!1:(this.$toggle.removeClass(this._offstyle+" off").addClass(this._onstyle),this.$element.prop("checked",!0),void(a||this.trigger()))},c.prototype.off=function(a){return this.$element.prop("disabled")?!1:(this.$toggle.removeClass(this._onstyle).addClass(this._offstyle+" off"),this.$element.prop("checked",!1),void(a||this.trigger()))},c.prototype.enable=function(){this.$toggle.removeAttr("disabled"),this.$element.prop("disabled",!1)},c.prototype.disable=function(){this.$toggle.attr("disabled","disabled"),this.$element.prop("disabled",!0)},c.prototype.update=function(a){this.$element.prop("disabled")?this.disable():this.enable(),this.$element.prop("checked")?this.on(a):this.off(a)},c.prototype.trigger=function(b){this.$element.off("change.bs.toggle"),b||this.$element.change(),this.$element.on("change.bs.toggle",a.proxy(function(){this.update()},this))},c.prototype.destroy=function(){this.$element.off("change.bs.toggle"),this.$toggleGroup.remove(),this.$element.removeData("bs.toggle"),this.$element.unwrap()};var d=a.fn.bootstrapToggle;a.fn.bootstrapToggle=b,a.fn.bootstrapToggle.Constructor=c,a.fn.toggle.noConflict=function(){return a.fn.bootstrapToggle=d,this},a(function(){a("input[type=checkbox][data-toggle^=toggle]").bootstrapToggle()}),a(document).on("click.bs.toggle","div[data-toggle^=toggle]",function(b){var c=a(this).find("input[type=checkbox]");c.bootstrapToggle("toggle"),b.preventDefault()})}(jQuery);
9
- //# sourceMappingURL=bootstrap-toggle.min.js.map
1
  /*! ========================================================================
2
+ * Bootstrap Toggle: bootstrap-toggle.js
 
3
  * ========================================================================
4
+ * Copyright 2019 Min Hur, The New York Times Company
5
  * Licensed under MIT
6
  * ======================================================================== */
7
+ +function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.toggle"),f="object"==typeof b&&b;e||d.data("bs.toggle",e=new c(this,f)),"string"==typeof b&&e[b]&&e[b]()})}var c=function(b,c){this.$element=a(b),this.options=a.extend({},this.defaults(),c),this.render()};c.VERSION="2.2.0",c.DEFAULTS={on:"On",off:"Off",onstyle:"primary",offstyle:"default",size:"normal",style:"",width:null,height:null},c.prototype.defaults=function(){return{on:this.$element.attr("data-on")||c.DEFAULTS.on,off:this.$element.attr("data-off")||c.DEFAULTS.off,onstyle:this.$element.attr("data-onstyle")||c.DEFAULTS.onstyle,offstyle:this.$element.attr("data-offstyle")||c.DEFAULTS.offstyle,size:this.$element.attr("data-size")||c.DEFAULTS.size,style:this.$element.attr("data-style")||c.DEFAULTS.style,width:this.$element.attr("data-width")||c.DEFAULTS.width,height:this.$element.attr("data-height")||c.DEFAULTS.height}},c.prototype.render=function(){this._onstyle="btn-"+this.options.onstyle,this._offstyle="btn-"+this.options.offstyle;var b="large"===this.options.size?"btn-lg":"small"===this.options.size?"btn-sm":"mini"===this.options.size?"btn-xs":"",c=a('<label class="btn">').html(this.options.on).addClass(this._onstyle+" "+b),d=a('<label class="btn">').html(this.options.off).addClass(this._offstyle+" "+b+" active"),e=a('<span class="toggle-handle btn btn-default">').addClass(b),f=a('<div class="toggle-group">').append(c,d,e),g=a('<div class="toggle btn" data-toggle="toggle">').addClass(this.$element.prop("checked")?this._onstyle:this._offstyle+" off").addClass(b).addClass(this.options.style);this.$element.wrap(g),a.extend(this,{$toggle:this.$element.parent(),$toggleOn:c,$toggleOff:d,$toggleGroup:f}),this.$toggle.append(f);var h=this.options.width||Math.max(c.outerWidth(),d.outerWidth())+e.outerWidth()/2,i=this.options.height||Math.max(c.outerHeight(),d.outerHeight());c.addClass("toggle-on"),d.addClass("toggle-off"),this.$toggle.css({width:h,height:i}),this.options.height&&(c.css("line-height",c.height()+"px"),d.css("line-height",d.height()+"px")),this.update(!0),this.trigger(!0)},c.prototype.toggle=function(){this.$element.prop("checked")?this.off():this.on()},c.prototype.on=function(a){return this.$element.prop("disabled")?!1:(this.$toggle.removeClass(this._offstyle+" off").addClass(this._onstyle),this.$element.prop("checked",!0),void(a||this.trigger()))},c.prototype.off=function(a){return this.$element.prop("disabled")?!1:(this.$toggle.removeClass(this._onstyle).addClass(this._offstyle+" off"),this.$element.prop("checked",!1),void(a||this.trigger()))},c.prototype.enable=function(){this.$toggle.removeAttr("disabled"),this.$element.prop("disabled",!1)},c.prototype.disable=function(){this.$toggle.attr("disabled","disabled"),this.$element.prop("disabled",!0)},c.prototype.update=function(a){this.$element.prop("disabled")?this.disable():this.enable(),this.$element.prop("checked")?this.on(a):this.off(a)},c.prototype.trigger=function(b){this.$element.off("change.bs.toggle"),b||this.$element.change(),this.$element.on("change.bs.toggle",a.proxy(function(){this.update()},this))},c.prototype.destroy=function(){this.$element.off("change.bs.toggle"),this.$toggleGroup.remove(),this.$element.removeData("bs.toggle"),this.$element.unwrap()};var d=a.fn.bootstrapToggle;a.fn.bootstrapToggle=b,a.fn.bootstrapToggle.Constructor=c,a.fn.toggle.noConflict=function(){return a.fn.bootstrapToggle=d,this},a(function(){a("input[type=checkbox][data-toggle^=toggle]").bootstrapToggle()}),a(document).on("click.bs.toggle","div[data-toggle^=toggle]",function(b){var c=a(this).find("input[type=checkbox]");c.bootstrapToggle("toggle"),b.preventDefault()})}(jQuery);
 
assets/lib/chartjs/Chart.bundle.min.js CHANGED
@@ -1,10 +1,7 @@
1
  /*!
2
- * Chart.js
3
- * http://chartjs.org/
4
- * Version: 2.7.1
5
- *
6
- * Copyright 2017 Nick Downie
7
- * Released under the MIT license
8
- * https://github.com/chartjs/Chart.js/blob/master/LICENSE.md
9
  */
10
- !function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Chart=t()}}(function(){return function t(e,n,i){function a(o,s){if(!n[o]){if(!e[o]){var l="function"==typeof require&&require;if(!s&&l)return l(o,!0);if(r)return r(o,!0);var u=new Error("Cannot find module '"+o+"'");throw u.code="MODULE_NOT_FOUND",u}var d=n[o]={exports:{}};e[o][0].call(d.exports,function(t){var n=e[o][1][t];return a(n||t)},d,d.exports,t,e,n,i)}return n[o].exports}for(var r="function"==typeof require&&require,o=0;o<i.length;o++)a(i[o]);return a}({1:[function(t,e,n){function i(t){if(t){var e=[0,0,0],n=1,i=t.match(/^#([a-fA-F0-9]{3})$/i);if(i){i=i[1];for(a=0;a<e.length;a++)e[a]=parseInt(i[a]+i[a],16)}else if(i=t.match(/^#([a-fA-F0-9]{6})$/i)){i=i[1];for(a=0;a<e.length;a++)e[a]=parseInt(i.slice(2*a,2*a+2),16)}else if(i=t.match(/^rgba?\(\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/i)){for(a=0;a<e.length;a++)e[a]=parseInt(i[a+1]);n=parseFloat(i[4])}else if(i=t.match(/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/i)){for(a=0;a<e.length;a++)e[a]=Math.round(2.55*parseFloat(i[a+1]));n=parseFloat(i[4])}else if(i=t.match(/(\w+)/)){if("transparent"==i[1])return[0,0,0,0];if(!(e=c[i[1]]))return}for(var a=0;a<e.length;a++)e[a]=u(e[a],0,255);return n=n||0==n?u(n,0,1):1,e[3]=n,e}}function a(t){if(t){var e=t.match(/^hsla?\(\s*([+-]?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)/);if(e){var n=parseFloat(e[4]);return[u(parseInt(e[1]),0,360),u(parseFloat(e[2]),0,100),u(parseFloat(e[3]),0,100),u(isNaN(n)?1:n,0,1)]}}}function r(t){if(t){var e=t.match(/^hwb\(\s*([+-]?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)/);if(e){var n=parseFloat(e[4]);return[u(parseInt(e[1]),0,360),u(parseFloat(e[2]),0,100),u(parseFloat(e[3]),0,100),u(isNaN(n)?1:n,0,1)]}}}function o(t,e){return void 0===e&&(e=void 0!==t[3]?t[3]:1),"rgba("+t[0]+", "+t[1]+", "+t[2]+", "+e+")"}function s(t,e){return"rgba("+Math.round(t[0]/255*100)+"%, "+Math.round(t[1]/255*100)+"%, "+Math.round(t[2]/255*100)+"%, "+(e||t[3]||1)+")"}function l(t,e){return void 0===e&&(e=void 0!==t[3]?t[3]:1),"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+e+")"}function u(t,e,n){return Math.min(Math.max(e,t),n)}function d(t){var e=t.toString(16).toUpperCase();return e.length<2?"0"+e:e}var c=t(5);e.exports={getRgba:i,getHsla:a,getRgb:function(t){var e=i(t);return e&&e.slice(0,3)},getHsl:function(t){var e=a(t);return e&&e.slice(0,3)},getHwb:r,getAlpha:function(t){var e=i(t);return e?e[3]:(e=a(t))?e[3]:(e=r(t))?e[3]:void 0},hexString:function(t){return"#"+d(t[0])+d(t[1])+d(t[2])},rgbString:function(t,e){return e<1||t[3]&&t[3]<1?o(t,e):"rgb("+t[0]+", "+t[1]+", "+t[2]+")"},rgbaString:o,percentString:function(t,e){return e<1||t[3]&&t[3]<1?s(t,e):"rgb("+Math.round(t[0]/255*100)+"%, "+Math.round(t[1]/255*100)+"%, "+Math.round(t[2]/255*100)+"%)"},percentaString:s,hslString:function(t,e){return e<1||t[3]&&t[3]<1?l(t,e):"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)"},hslaString:l,hwbString:function(t,e){return void 0===e&&(e=void 0!==t[3]?t[3]:1),"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+(void 0!==e&&1!==e?", "+e:"")+")"},keyword:function(t){return h[t.slice(0,3)]}};var h={};for(var f in c)h[c[f]]=f},{5:5}],2:[function(t,e,n){var i=t(4),a=t(1),r=function(t){if(t instanceof r)return t;if(!(this instanceof r))return new r(t);this.valid=!1,this.values={rgb:[0,0,0],hsl:[0,0,0],hsv:[0,0,0],hwb:[0,0,0],cmyk:[0,0,0,0],alpha:1};var e;"string"==typeof t?(e=a.getRgba(t))?this.setValues("rgb",e):(e=a.getHsla(t))?this.setValues("hsl",e):(e=a.getHwb(t))&&this.setValues("hwb",e):"object"==typeof t&&(void 0!==(e=t).r||void 0!==e.red?this.setValues("rgb",e):void 0!==e.l||void 0!==e.lightness?this.setValues("hsl",e):void 0!==e.v||void 0!==e.value?this.setValues("hsv",e):void 0!==e.w||void 0!==e.whiteness?this.setValues("hwb",e):void 0===e.c&&void 0===e.cyan||this.setValues("cmyk",e))};r.prototype={isValid:function(){return this.valid},rgb:function(){return this.setSpace("rgb",arguments)},hsl:function(){return this.setSpace("hsl",arguments)},hsv:function(){return this.setSpace("hsv",arguments)},hwb:function(){return this.setSpace("hwb",arguments)},cmyk:function(){return this.setSpace("cmyk",arguments)},rgbArray:function(){return this.values.rgb},hslArray:function(){return this.values.hsl},hsvArray:function(){return this.values.hsv},hwbArray:function(){var t=this.values;return 1!==t.alpha?t.hwb.concat([t.alpha]):t.hwb},cmykArray:function(){return this.values.cmyk},rgbaArray:function(){var t=this.values;return t.rgb.concat([t.alpha])},hslaArray:function(){var t=this.values;return t.hsl.concat([t.alpha])},alpha:function(t){return void 0===t?this.values.alpha:(this.setValues("alpha",t),this)},red:function(t){return this.setChannel("rgb",0,t)},green:function(t){return this.setChannel("rgb",1,t)},blue:function(t){return this.setChannel("rgb",2,t)},hue:function(t){return t&&(t=(t%=360)<0?360+t:t),this.setChannel("hsl",0,t)},saturation:function(t){return this.setChannel("hsl",1,t)},lightness:function(t){return this.setChannel("hsl",2,t)},saturationv:function(t){return this.setChannel("hsv",1,t)},whiteness:function(t){return this.setChannel("hwb",1,t)},blackness:function(t){return this.setChannel("hwb",2,t)},value:function(t){return this.setChannel("hsv",2,t)},cyan:function(t){return this.setChannel("cmyk",0,t)},magenta:function(t){return this.setChannel("cmyk",1,t)},yellow:function(t){return this.setChannel("cmyk",2,t)},black:function(t){return this.setChannel("cmyk",3,t)},hexString:function(){return a.hexString(this.values.rgb)},rgbString:function(){return a.rgbString(this.values.rgb,this.values.alpha)},rgbaString:function(){return a.rgbaString(this.values.rgb,this.values.alpha)},percentString:function(){return a.percentString(this.values.rgb,this.values.alpha)},hslString:function(){return a.hslString(this.values.hsl,this.values.alpha)},hslaString:function(){return a.hslaString(this.values.hsl,this.values.alpha)},hwbString:function(){return a.hwbString(this.values.hwb,this.values.alpha)},keyword:function(){return a.keyword(this.values.rgb,this.values.alpha)},rgbNumber:function(){var t=this.values.rgb;return t[0]<<16|t[1]<<8|t[2]},luminosity:function(){for(var t=this.values.rgb,e=[],n=0;n<t.length;n++){var i=t[n]/255;e[n]=i<=.03928?i/12.92:Math.pow((i+.055)/1.055,2.4)}return.2126*e[0]+.7152*e[1]+.0722*e[2]},contrast:function(t){var e=this.luminosity(),n=t.luminosity();return e>n?(e+.05)/(n+.05):(n+.05)/(e+.05)},level:function(t){var e=this.contrast(t);return e>=7.1?"AAA":e>=4.5?"AA":""},dark:function(){var t=this.values.rgb;return(299*t[0]+587*t[1]+114*t[2])/1e3<128},light:function(){return!this.dark()},negate:function(){for(var t=[],e=0;e<3;e++)t[e]=255-this.values.rgb[e];return this.setValues("rgb",t),this},lighten:function(t){var e=this.values.hsl;return e[2]+=e[2]*t,this.setValues("hsl",e),this},darken:function(t){var e=this.values.hsl;return e[2]-=e[2]*t,this.setValues("hsl",e),this},saturate:function(t){var e=this.values.hsl;return e[1]+=e[1]*t,this.setValues("hsl",e),this},desaturate:function(t){var e=this.values.hsl;return e[1]-=e[1]*t,this.setValues("hsl",e),this},whiten:function(t){var e=this.values.hwb;return e[1]+=e[1]*t,this.setValues("hwb",e),this},blacken:function(t){var e=this.values.hwb;return e[2]+=e[2]*t,this.setValues("hwb",e),this},greyscale:function(){var t=this.values.rgb,e=.3*t[0]+.59*t[1]+.11*t[2];return this.setValues("rgb",[e,e,e]),this},clearer:function(t){var e=this.values.alpha;return this.setValues("alpha",e-e*t),this},opaquer:function(t){var e=this.values.alpha;return this.setValues("alpha",e+e*t),this},rotate:function(t){var e=this.values.hsl,n=(e[0]+t)%360;return e[0]=n<0?360+n:n,this.setValues("hsl",e),this},mix:function(t,e){var n=this,i=t,a=void 0===e?.5:e,r=2*a-1,o=n.alpha()-i.alpha(),s=((r*o==-1?r:(r+o)/(1+r*o))+1)/2,l=1-s;return this.rgb(s*n.red()+l*i.red(),s*n.green()+l*i.green(),s*n.blue()+l*i.blue()).alpha(n.alpha()*a+i.alpha()*(1-a))},toJSON:function(){return this.rgb()},clone:function(){var t,e,n=new r,i=this.values,a=n.values;for(var o in i)i.hasOwnProperty(o)&&(t=i[o],"[object Array]"===(e={}.toString.call(t))?a[o]=t.slice(0):"[object Number]"===e?a[o]=t:console.error("unexpected color value:",t));return n}},r.prototype.spaces={rgb:["red","green","blue"],hsl:["hue","saturation","lightness"],hsv:["hue","saturation","value"],hwb:["hue","whiteness","blackness"],cmyk:["cyan","magenta","yellow","black"]},r.prototype.maxes={rgb:[255,255,255],hsl:[360,100,100],hsv:[360,100,100],hwb:[360,100,100],cmyk:[100,100,100,100]},r.prototype.getValues=function(t){for(var e=this.values,n={},i=0;i<t.length;i++)n[t.charAt(i)]=e[t][i];return 1!==e.alpha&&(n.a=e.alpha),n},r.prototype.setValues=function(t,e){var n,a=this.values,r=this.spaces,o=this.maxes,s=1;if(this.valid=!0,"alpha"===t)s=e;else if(e.length)a[t]=e.slice(0,t.length),s=e[t.length];else if(void 0!==e[t.charAt(0)]){for(n=0;n<t.length;n++)a[t][n]=e[t.charAt(n)];s=e.a}else if(void 0!==e[r[t][0]]){var l=r[t];for(n=0;n<t.length;n++)a[t][n]=e[l[n]];s=e.alpha}if(a.alpha=Math.max(0,Math.min(1,void 0===s?a.alpha:s)),"alpha"===t)return!1;var u;for(n=0;n<t.length;n++)u=Math.max(0,Math.min(o[t][n],a[t][n])),a[t][n]=Math.round(u);for(var d in r)d!==t&&(a[d]=i[t][d](a[t]));return!0},r.prototype.setSpace=function(t,e){var n=e[0];return void 0===n?this.getValues(t):("number"==typeof n&&(n=Array.prototype.slice.call(e)),this.setValues(t,n),this)},r.prototype.setChannel=function(t,e,n){var i=this.values[t];return void 0===n?i[e]:n===i[e]?this:(i[e]=n,this.setValues(t,i),this)},"undefined"!=typeof window&&(window.Color=r),e.exports=r},{1:1,4:4}],3:[function(t,e,n){function i(t){var e,n,i,a=t[0]/255,r=t[1]/255,o=t[2]/255,s=Math.min(a,r,o),l=Math.max(a,r,o),u=l-s;return l==s?e=0:a==l?e=(r-o)/u:r==l?e=2+(o-a)/u:o==l&&(e=4+(a-r)/u),(e=Math.min(60*e,360))<0&&(e+=360),i=(s+l)/2,n=l==s?0:i<=.5?u/(l+s):u/(2-l-s),[e,100*n,100*i]}function a(t){var e,n,i,a=t[0],r=t[1],o=t[2],s=Math.min(a,r,o),l=Math.max(a,r,o),u=l-s;return n=0==l?0:u/l*1e3/10,l==s?e=0:a==l?e=(r-o)/u:r==l?e=2+(o-a)/u:o==l&&(e=4+(a-r)/u),(e=Math.min(60*e,360))<0&&(e+=360),i=l/255*1e3/10,[e,n,i]}function o(t){var e=t[0],n=t[1],a=t[2];return[i(t)[0],100*(1/255*Math.min(e,Math.min(n,a))),100*(a=1-1/255*Math.max(e,Math.max(n,a)))]}function s(t){var e,n,i,a,r=t[0]/255,o=t[1]/255,s=t[2]/255;return a=Math.min(1-r,1-o,1-s),e=(1-r-a)/(1-a)||0,n=(1-o-a)/(1-a)||0,i=(1-s-a)/(1-a)||0,[100*e,100*n,100*i,100*a]}function l(t){return S[JSON.stringify(t)]}function u(t){var e=t[0]/255,n=t[1]/255,i=t[2]/255;return[100*(.4124*(e=e>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92)+.3576*(n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92)+.1805*(i=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92)),100*(.2126*e+.7152*n+.0722*i),100*(.0193*e+.1192*n+.9505*i)]}function d(t){var e,n,i,a=u(t),r=a[0],o=a[1],s=a[2];return r/=95.047,o/=100,s/=108.883,r=r>.008856?Math.pow(r,1/3):7.787*r+16/116,o=o>.008856?Math.pow(o,1/3):7.787*o+16/116,s=s>.008856?Math.pow(s,1/3):7.787*s+16/116,e=116*o-16,n=500*(r-o),i=200*(o-s),[e,n,i]}function c(t){var e,n,i,a,r,o=t[0]/360,s=t[1]/100,l=t[2]/100;if(0==s)return r=255*l,[r,r,r];e=2*l-(n=l<.5?l*(1+s):l+s-l*s),a=[0,0,0];for(var u=0;u<3;u++)(i=o+1/3*-(u-1))<0&&i++,i>1&&i--,r=6*i<1?e+6*(n-e)*i:2*i<1?n:3*i<2?e+(n-e)*(2/3-i)*6:e,a[u]=255*r;return a}function h(t){var e=t[0]/60,n=t[1]/100,i=t[2]/100,a=Math.floor(e)%6,r=e-Math.floor(e),o=255*i*(1-n),s=255*i*(1-n*r),l=255*i*(1-n*(1-r)),i=255*i;switch(a){case 0:return[i,l,o];case 1:return[s,i,o];case 2:return[o,i,l];case 3:return[o,s,i];case 4:return[l,o,i];case 5:return[i,o,s]}}function f(t){var e,n,i,a,o=t[0]/360,s=t[1]/100,l=t[2]/100,u=s+l;switch(u>1&&(s/=u,l/=u),e=Math.floor(6*o),n=1-l,i=6*o-e,0!=(1&e)&&(i=1-i),a=s+i*(n-s),e){default:case 6:case 0:r=n,g=a,b=s;break;case 1:r=a,g=n,b=s;break;case 2:r=s,g=n,b=a;break;case 3:r=s,g=a,b=n;break;case 4:r=a,g=s,b=n;break;case 5:r=n,g=s,b=a}return[255*r,255*g,255*b]}function m(t){var e,n,i,a=t[0]/100,r=t[1]/100,o=t[2]/100,s=t[3]/100;return e=1-Math.min(1,a*(1-s)+s),n=1-Math.min(1,r*(1-s)+s),i=1-Math.min(1,o*(1-s)+s),[255*e,255*n,255*i]}function p(t){var e,n,i,a=t[0]/100,r=t[1]/100,o=t[2]/100;return e=3.2406*a+-1.5372*r+-.4986*o,n=-.9689*a+1.8758*r+.0415*o,i=.0557*a+-.204*r+1.057*o,e=e>.0031308?1.055*Math.pow(e,1/2.4)-.055:e*=12.92,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:n*=12.92,i=i>.0031308?1.055*Math.pow(i,1/2.4)-.055:i*=12.92,e=Math.min(Math.max(0,e),1),n=Math.min(Math.max(0,n),1),i=Math.min(Math.max(0,i),1),[255*e,255*n,255*i]}function v(t){var e,n,i,a=t[0],r=t[1],o=t[2];return a/=95.047,r/=100,o/=108.883,a=a>.008856?Math.pow(a,1/3):7.787*a+16/116,r=r>.008856?Math.pow(r,1/3):7.787*r+16/116,o=o>.008856?Math.pow(o,1/3):7.787*o+16/116,e=116*r-16,n=500*(a-r),i=200*(r-o),[e,n,i]}function y(t){var e,n,i,a,r=t[0],o=t[1],s=t[2];return r<=8?a=(n=100*r/903.3)/100*7.787+16/116:(n=100*Math.pow((r+16)/116,3),a=Math.pow(n/100,1/3)),e=e/95.047<=.008856?e=95.047*(o/500+a-16/116)/7.787:95.047*Math.pow(o/500+a,3),i=i/108.883<=.008859?i=108.883*(a-s/200-16/116)/7.787:108.883*Math.pow(a-s/200,3),[e,n,i]}function x(t){var e,n,i,a=t[0],r=t[1],o=t[2];return e=Math.atan2(o,r),(n=360*e/2/Math.PI)<0&&(n+=360),i=Math.sqrt(r*r+o*o),[a,i,n]}function _(t){return p(y(t))}function k(t){var e,n,i,a=t[0],r=t[1];return i=t[2]/360*2*Math.PI,e=r*Math.cos(i),n=r*Math.sin(i),[a,e,n]}function w(t){return M[t]}e.exports={rgb2hsl:i,rgb2hsv:a,rgb2hwb:o,rgb2cmyk:s,rgb2keyword:l,rgb2xyz:u,rgb2lab:d,rgb2lch:function(t){return x(d(t))},hsl2rgb:c,hsl2hsv:function(t){var e,n,i=t[0],a=t[1]/100,r=t[2]/100;return 0===r?[0,0,0]:(r*=2,a*=r<=1?r:2-r,n=(r+a)/2,e=2*a/(r+a),[i,100*e,100*n])},hsl2hwb:function(t){return o(c(t))},hsl2cmyk:function(t){return s(c(t))},hsl2keyword:function(t){return l(c(t))},hsv2rgb:h,hsv2hsl:function(t){var e,n,i=t[0],a=t[1]/100,r=t[2]/100;return n=(2-a)*r,e=a*r,e/=n<=1?n:2-n,e=e||0,n/=2,[i,100*e,100*n]},hsv2hwb:function(t){return o(h(t))},hsv2cmyk:function(t){return s(h(t))},hsv2keyword:function(t){return l(h(t))},hwb2rgb:f,hwb2hsl:function(t){return i(f(t))},hwb2hsv:function(t){return a(f(t))},hwb2cmyk:function(t){return s(f(t))},hwb2keyword:function(t){return l(f(t))},cmyk2rgb:m,cmyk2hsl:function(t){return i(m(t))},cmyk2hsv:function(t){return a(m(t))},cmyk2hwb:function(t){return o(m(t))},cmyk2keyword:function(t){return l(m(t))},keyword2rgb:w,keyword2hsl:function(t){return i(w(t))},keyword2hsv:function(t){return a(w(t))},keyword2hwb:function(t){return o(w(t))},keyword2cmyk:function(t){return s(w(t))},keyword2lab:function(t){return d(w(t))},keyword2xyz:function(t){return u(w(t))},xyz2rgb:p,xyz2lab:v,xyz2lch:function(t){return x(v(t))},lab2xyz:y,lab2rgb:_,lab2lch:x,lch2lab:k,lch2xyz:function(t){return y(k(t))},lch2rgb:function(t){return _(k(t))}};var M={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},S={};for(var D in M)S[JSON.stringify(M[D])]=D},{}],4:[function(t,e,n){var i=t(3),a=function(){return new u};for(var r in i){a[r+"Raw"]=function(t){return function(e){return"number"==typeof e&&(e=Array.prototype.slice.call(arguments)),i[t](e)}}(r);var o=/(\w+)2(\w+)/.exec(r),s=o[1],l=o[2];(a[s]=a[s]||{})[l]=a[r]=function(t){return function(e){"number"==typeof e&&(e=Array.prototype.slice.call(arguments));var n=i[t](e);if("string"==typeof n||void 0===n)return n;for(var a=0;a<n.length;a++)n[a]=Math.round(n[a]);return n}}(r)}var u=function(){this.convs={}};u.prototype.routeSpace=function(t,e){var n=e[0];return void 0===n?this.getValues(t):("number"==typeof n&&(n=Array.prototype.slice.call(e)),this.setValues(t,n))},u.prototype.setValues=function(t,e){return this.space=t,this.convs={},this.convs[t]=e,this},u.prototype.getValues=function(t){var e=this.convs[t];if(!e){var n=this.space,i=this.convs[n];e=a[n][t](i),this.convs[t]=e}return e},["rgb","hsl","hsv","cmyk","keyword"].forEach(function(t){u.prototype[t]=function(e){return this.routeSpace(t,arguments)}}),e.exports=a},{3:3}],5:[function(t,e,n){"use strict";e.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},{}],6:[function(t,e,n){!function(t,i){"object"==typeof n&&void 0!==e?e.exports=i():t.moment=i()}(this,function(){"use strict";function n(){return xe.apply(null,arguments)}function i(t){return t instanceof Array||"[object Array]"===Object.prototype.toString.call(t)}function a(t){return null!=t&&"[object Object]"===Object.prototype.toString.call(t)}function r(t){var e;for(e in t)return!1;return!0}function o(t){return void 0===t}function s(t){return"number"==typeof t||"[object Number]"===Object.prototype.toString.call(t)}function l(t){return t instanceof Date||"[object Date]"===Object.prototype.toString.call(t)}function u(t,e){var n,i=[];for(n=0;n<t.length;++n)i.push(e(t[n],n));return i}function d(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function c(t,e){for(var n in e)d(e,n)&&(t[n]=e[n]);return d(e,"toString")&&(t.toString=e.toString),d(e,"valueOf")&&(t.valueOf=e.valueOf),t}function h(t,e,n,i){return Yt(t,e,n,i,!0).utc()}function f(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],meridiem:null,rfc2822:!1,weekdayMismatch:!1}}function g(t){return null==t._pf&&(t._pf=f()),t._pf}function m(t){if(null==t._isValid){var e=g(t),n=ke.call(e.parsedDateParts,function(t){return null!=t}),i=!isNaN(t._d.getTime())&&e.overflow<0&&!e.empty&&!e.invalidMonth&&!e.invalidWeekday&&!e.nullInput&&!e.invalidFormat&&!e.userInvalidated&&(!e.meridiem||e.meridiem&&n);if(t._strict&&(i=i&&0===e.charsLeftOver&&0===e.unusedTokens.length&&void 0===e.bigHour),null!=Object.isFrozen&&Object.isFrozen(t))return i;t._isValid=i}return t._isValid}function p(t){var e=h(NaN);return null!=t?c(g(e),t):g(e).userInvalidated=!0,e}function v(t,e){var n,i,a;if(o(e._isAMomentObject)||(t._isAMomentObject=e._isAMomentObject),o(e._i)||(t._i=e._i),o(e._f)||(t._f=e._f),o(e._l)||(t._l=e._l),o(e._strict)||(t._strict=e._strict),o(e._tzm)||(t._tzm=e._tzm),o(e._isUTC)||(t._isUTC=e._isUTC),o(e._offset)||(t._offset=e._offset),o(e._pf)||(t._pf=g(e)),o(e._locale)||(t._locale=e._locale),we.length>0)for(n=0;n<we.length;n++)o(a=e[i=we[n]])||(t[i]=a);return t}function y(t){v(this,t),this._d=new Date(null!=t._d?t._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),!1===Me&&(Me=!0,n.updateOffset(this),Me=!1)}function b(t){return t instanceof y||null!=t&&null!=t._isAMomentObject}function x(t){return t<0?Math.ceil(t)||0:Math.floor(t)}function _(t){var e=+t,n=0;return 0!==e&&isFinite(e)&&(n=x(e)),n}function k(t,e,n){var i,a=Math.min(t.length,e.length),r=Math.abs(t.length-e.length),o=0;for(i=0;i<a;i++)(n&&t[i]!==e[i]||!n&&_(t[i])!==_(e[i]))&&o++;return o+r}function w(t){!1===n.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+t)}function M(t,e){var i=!0;return c(function(){if(null!=n.deprecationHandler&&n.deprecationHandler(null,t),i){for(var a,r=[],o=0;o<arguments.length;o++){if(a="","object"==typeof arguments[o]){a+="\n["+o+"] ";for(var s in arguments[0])a+=s+": "+arguments[0][s]+", ";a=a.slice(0,-2)}else a=arguments[o];r.push(a)}w(t+"\nArguments: "+Array.prototype.slice.call(r).join("")+"\n"+(new Error).stack),i=!1}return e.apply(this,arguments)},e)}function S(t,e){null!=n.deprecationHandler&&n.deprecationHandler(t,e),Se[t]||(w(e),Se[t]=!0)}function D(t){return t instanceof Function||"[object Function]"===Object.prototype.toString.call(t)}function C(t,e){var n,i=c({},t);for(n in e)d(e,n)&&(a(t[n])&&a(e[n])?(i[n]={},c(i[n],t[n]),c(i[n],e[n])):null!=e[n]?i[n]=e[n]:delete i[n]);for(n in t)d(t,n)&&!d(e,n)&&a(t[n])&&(i[n]=c({},i[n]));return i}function P(t){null!=t&&this.set(t)}function T(t,e){var n=t.toLowerCase();Te[n]=Te[n+"s"]=Te[e]=t}function A(t){return"string"==typeof t?Te[t]||Te[t.toLowerCase()]:void 0}function I(t){var e,n,i={};for(n in t)d(t,n)&&(e=A(n))&&(i[e]=t[n]);return i}function O(t,e){Ae[t]=e}function F(t){var e=[];for(var n in t)e.push({unit:n,priority:Ae[n]});return e.sort(function(t,e){return t.priority-e.priority}),e}function R(t,e){return function(i){return null!=i?(W(this,t,i),n.updateOffset(this,e),this):L(this,t)}}function L(t,e){return t.isValid()?t._d["get"+(t._isUTC?"UTC":"")+e]():NaN}function W(t,e,n){t.isValid()&&t._d["set"+(t._isUTC?"UTC":"")+e](n)}function Y(t,e,n){var i=""+Math.abs(t),a=e-i.length;return(t>=0?n?"+":"":"-")+Math.pow(10,Math.max(0,a)).toString().substr(1)+i}function N(t,e,n,i){var a=i;"string"==typeof i&&(a=function(){return this[i]()}),t&&(Re[t]=a),e&&(Re[e[0]]=function(){return Y(a.apply(this,arguments),e[1],e[2])}),n&&(Re[n]=function(){return this.localeData().ordinal(a.apply(this,arguments),t)})}function z(t){return t.match(/\[[\s\S]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"")}function B(t){var e,n,i=t.match(Ie);for(e=0,n=i.length;e<n;e++)Re[i[e]]?i[e]=Re[i[e]]:i[e]=z(i[e]);return function(e){var a,r="";for(a=0;a<n;a++)r+=D(i[a])?i[a].call(e,t):i[a];return r}}function V(t,e){return t.isValid()?(e=H(e,t.localeData()),Fe[e]=Fe[e]||B(e),Fe[e](t)):t.localeData().invalidDate()}function H(t,e){var n=5;for(Oe.lastIndex=0;n>=0&&Oe.test(t);)t=t.replace(Oe,function(t){return e.longDateFormat(t)||t}),Oe.lastIndex=0,n-=1;return t}function E(t,e,n){Ke[t]=D(e)?e:function(t,i){return t&&n?n:e}}function j(t,e){return d(Ke,t)?Ke[t](e._strict,e._locale):new RegExp(U(t))}function U(t){return q(t.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,e,n,i,a){return e||n||i||a}))}function q(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function G(t,e){var n,i=e;for("string"==typeof t&&(t=[t]),s(e)&&(i=function(t,n){n[e]=_(t)}),n=0;n<t.length;n++)Qe[t[n]]=i}function Z(t,e){G(t,function(t,n,i,a){i._w=i._w||{},e(t,i._w,i,a)})}function X(t,e,n){null!=e&&d(Qe,t)&&Qe[t](e,n._a,n,t)}function J(t,e){return new Date(Date.UTC(t,e+1,0)).getUTCDate()}function K(t,e,n){var i,a,r,o=t.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],i=0;i<12;++i)r=h([2e3,i]),this._shortMonthsParse[i]=this.monthsShort(r,"").toLocaleLowerCase(),this._longMonthsParse[i]=this.months(r,"").toLocaleLowerCase();return n?"MMM"===e?-1!==(a=un.call(this._shortMonthsParse,o))?a:null:-1!==(a=un.call(this._longMonthsParse,o))?a:null:"MMM"===e?-1!==(a=un.call(this._shortMonthsParse,o))?a:-1!==(a=un.call(this._longMonthsParse,o))?a:null:-1!==(a=un.call(this._longMonthsParse,o))?a:-1!==(a=un.call(this._shortMonthsParse,o))?a:null}function Q(t,e){var n;if(!t.isValid())return t;if("string"==typeof e)if(/^\d+$/.test(e))e=_(e);else if(e=t.localeData().monthsParse(e),!s(e))return t;return n=Math.min(t.date(),J(t.year(),e)),t._d["set"+(t._isUTC?"UTC":"")+"Month"](e,n),t}function $(t){return null!=t?(Q(this,t),n.updateOffset(this,!0),this):L(this,"Month")}function tt(){function t(t,e){return e.length-t.length}var e,n,i=[],a=[],r=[];for(e=0;e<12;e++)n=h([2e3,e]),i.push(this.monthsShort(n,"")),a.push(this.months(n,"")),r.push(this.months(n,"")),r.push(this.monthsShort(n,""));for(i.sort(t),a.sort(t),r.sort(t),e=0;e<12;e++)i[e]=q(i[e]),a[e]=q(a[e]);for(e=0;e<24;e++)r[e]=q(r[e]);this._monthsRegex=new RegExp("^("+r.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+a.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+i.join("|")+")","i")}function et(t){return nt(t)?366:365}function nt(t){return t%4==0&&t%100!=0||t%400==0}function it(t,e,n,i,a,r,o){var s=new Date(t,e,n,i,a,r,o);return t<100&&t>=0&&isFinite(s.getFullYear())&&s.setFullYear(t),s}function at(t){var e=new Date(Date.UTC.apply(null,arguments));return t<100&&t>=0&&isFinite(e.getUTCFullYear())&&e.setUTCFullYear(t),e}function rt(t,e,n){var i=7+e-n;return-((7+at(t,0,i).getUTCDay()-e)%7)+i-1}function ot(t,e,n,i,a){var r,o,s=1+7*(e-1)+(7+n-i)%7+rt(t,i,a);return s<=0?o=et(r=t-1)+s:s>et(t)?(r=t+1,o=s-et(t)):(r=t,o=s),{year:r,dayOfYear:o}}function st(t,e,n){var i,a,r=rt(t.year(),e,n),o=Math.floor((t.dayOfYear()-r-1)/7)+1;return o<1?i=o+lt(a=t.year()-1,e,n):o>lt(t.year(),e,n)?(i=o-lt(t.year(),e,n),a=t.year()+1):(a=t.year(),i=o),{week:i,year:a}}function lt(t,e,n){var i=rt(t,e,n),a=rt(t+1,e,n);return(et(t)-i+a)/7}function ut(t,e){return"string"!=typeof t?t:isNaN(t)?"number"==typeof(t=e.weekdaysParse(t))?t:null:parseInt(t,10)}function dt(t,e){return"string"==typeof t?e.weekdaysParse(t)%7||7:isNaN(t)?null:t}function ct(t,e,n){var i,a,r,o=t.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],i=0;i<7;++i)r=h([2e3,1]).day(i),this._minWeekdaysParse[i]=this.weekdaysMin(r,"").toLocaleLowerCase(),this._shortWeekdaysParse[i]=this.weekdaysShort(r,"").toLocaleLowerCase(),this._weekdaysParse[i]=this.weekdays(r,"").toLocaleLowerCase();return n?"dddd"===e?-1!==(a=un.call(this._weekdaysParse,o))?a:null:"ddd"===e?-1!==(a=un.call(this._shortWeekdaysParse,o))?a:null:-1!==(a=un.call(this._minWeekdaysParse,o))?a:null:"dddd"===e?-1!==(a=un.call(this._weekdaysParse,o))?a:-1!==(a=un.call(this._shortWeekdaysParse,o))?a:-1!==(a=un.call(this._minWeekdaysParse,o))?a:null:"ddd"===e?-1!==(a=un.call(this._shortWeekdaysParse,o))?a:-1!==(a=un.call(this._weekdaysParse,o))?a:-1!==(a=un.call(this._minWeekdaysParse,o))?a:null:-1!==(a=un.call(this._minWeekdaysParse,o))?a:-1!==(a=un.call(this._weekdaysParse,o))?a:-1!==(a=un.call(this._shortWeekdaysParse,o))?a:null}function ht(){function t(t,e){return e.length-t.length}var e,n,i,a,r,o=[],s=[],l=[],u=[];for(e=0;e<7;e++)n=h([2e3,1]).day(e),i=this.weekdaysMin(n,""),a=this.weekdaysShort(n,""),r=this.weekdays(n,""),o.push(i),s.push(a),l.push(r),u.push(i),u.push(a),u.push(r);for(o.sort(t),s.sort(t),l.sort(t),u.sort(t),e=0;e<7;e++)s[e]=q(s[e]),l[e]=q(l[e]),u[e]=q(u[e]);this._weekdaysRegex=new RegExp("^("+u.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+o.join("|")+")","i")}function ft(){return this.hours()%12||12}function gt(t,e){N(t,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)})}function mt(t,e){return e._meridiemParse}function pt(t){return t?t.toLowerCase().replace("_","-"):t}function vt(t){for(var e,n,i,a,r=0;r<t.length;){for(e=(a=pt(t[r]).split("-")).length,n=(n=pt(t[r+1]))?n.split("-"):null;e>0;){if(i=yt(a.slice(0,e).join("-")))return i;if(n&&n.length>=e&&k(a,n,!0)>=e-1)break;e--}r++}return null}function yt(n){var i=null;if(!Sn[n]&&void 0!==e&&e&&e.exports)try{i=kn._abbr,t("./locale/"+n),bt(i)}catch(t){}return Sn[n]}function bt(t,e){var n;return t&&(n=o(e)?_t(t):xt(t,e))&&(kn=n),kn._abbr}function xt(t,e){if(null!==e){var n=Mn;if(e.abbr=t,null!=Sn[t])S("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),n=Sn[t]._config;else if(null!=e.parentLocale){if(null==Sn[e.parentLocale])return Dn[e.parentLocale]||(Dn[e.parentLocale]=[]),Dn[e.parentLocale].push({name:t,config:e}),null;n=Sn[e.parentLocale]._config}return Sn[t]=new P(C(n,e)),Dn[t]&&Dn[t].forEach(function(t){xt(t.name,t.config)}),bt(t),Sn[t]}return delete Sn[t],null}function _t(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return kn;if(!i(t)){if(e=yt(t))return e;t=[t]}return vt(t)}function kt(t){var e,n=t._a;return n&&-2===g(t).overflow&&(e=n[tn]<0||n[tn]>11?tn:n[en]<1||n[en]>J(n[$e],n[tn])?en:n[nn]<0||n[nn]>24||24===n[nn]&&(0!==n[an]||0!==n[rn]||0!==n[on])?nn:n[an]<0||n[an]>59?an:n[rn]<0||n[rn]>59?rn:n[on]<0||n[on]>999?on:-1,g(t)._overflowDayOfYear&&(e<$e||e>en)&&(e=en),g(t)._overflowWeeks&&-1===e&&(e=sn),g(t)._overflowWeekday&&-1===e&&(e=ln),g(t).overflow=e),t}function wt(t){var e,n,i,a,r,o,s=t._i,l=Cn.exec(s)||Pn.exec(s);if(l){for(g(t).iso=!0,e=0,n=An.length;e<n;e++)if(An[e][1].exec(l[1])){a=An[e][0],i=!1!==An[e][2];break}if(null==a)return void(t._isValid=!1);if(l[3]){for(e=0,n=In.length;e<n;e++)if(In[e][1].exec(l[3])){r=(l[2]||" ")+In[e][0];break}if(null==r)return void(t._isValid=!1)}if(!i&&null!=r)return void(t._isValid=!1);if(l[4]){if(!Tn.exec(l[4]))return void(t._isValid=!1);o="Z"}t._f=a+(r||"")+(o||""),At(t)}else t._isValid=!1}function Mt(t){var e,n,i,a,r,o,s,l,u={" GMT":" +0000"," EDT":" -0400"," EST":" -0500"," CDT":" -0500"," CST":" -0600"," MDT":" -0600"," MST":" -0700"," PDT":" -0700"," PST":" -0800"};if(e=t._i.replace(/\([^\)]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s|\s$/g,""),n=Fn.exec(e)){if(i=n[1]?"ddd"+(5===n[1].length?", ":" "):"",a="D MMM "+(n[2].length>10?"YYYY ":"YY "),r="HH:mm"+(n[4]?":ss":""),n[1]){var d=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"][new Date(n[2]).getDay()];if(n[1].substr(0,3)!==d)return g(t).weekdayMismatch=!0,void(t._isValid=!1)}switch(n[5].length){case 2:s=0===l?" +0000":((l="YXWVUTSRQPONZABCDEFGHIKLM".indexOf(n[5][1].toUpperCase())-12)<0?" -":" +")+(""+l).replace(/^-?/,"0").match(/..$/)[0]+"00";break;case 4:s=u[n[5]];break;default:s=u[" GMT"]}n[5]=s,t._i=n.splice(1).join(""),o=" ZZ",t._f=i+a+r+o,At(t),g(t).rfc2822=!0}else t._isValid=!1}function St(t){var e=On.exec(t._i);null===e?(wt(t),!1===t._isValid&&(delete t._isValid,Mt(t),!1===t._isValid&&(delete t._isValid,n.createFromInputFallback(t)))):t._d=new Date(+e[1])}function Dt(t,e,n){return null!=t?t:null!=e?e:n}function Ct(t){var e=new Date(n.now());return t._useUTC?[e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()]:[e.getFullYear(),e.getMonth(),e.getDate()]}function Pt(t){var e,n,i,a,r=[];if(!t._d){for(i=Ct(t),t._w&&null==t._a[en]&&null==t._a[tn]&&Tt(t),null!=t._dayOfYear&&(a=Dt(t._a[$e],i[$e]),(t._dayOfYear>et(a)||0===t._dayOfYear)&&(g(t)._overflowDayOfYear=!0),n=at(a,0,t._dayOfYear),t._a[tn]=n.getUTCMonth(),t._a[en]=n.getUTCDate()),e=0;e<3&&null==t._a[e];++e)t._a[e]=r[e]=i[e];for(;e<7;e++)t._a[e]=r[e]=null==t._a[e]?2===e?1:0:t._a[e];24===t._a[nn]&&0===t._a[an]&&0===t._a[rn]&&0===t._a[on]&&(t._nextDay=!0,t._a[nn]=0),t._d=(t._useUTC?at:it).apply(null,r),null!=t._tzm&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[nn]=24)}}function Tt(t){var e,n,i,a,r,o,s,l;if(null!=(e=t._w).GG||null!=e.W||null!=e.E)r=1,o=4,n=Dt(e.GG,t._a[$e],st(Nt(),1,4).year),i=Dt(e.W,1),((a=Dt(e.E,1))<1||a>7)&&(l=!0);else{r=t._locale._week.dow,o=t._locale._week.doy;var u=st(Nt(),r,o);n=Dt(e.gg,t._a[$e],u.year),i=Dt(e.w,u.week),null!=e.d?((a=e.d)<0||a>6)&&(l=!0):null!=e.e?(a=e.e+r,(e.e<0||e.e>6)&&(l=!0)):a=r}i<1||i>lt(n,r,o)?g(t)._overflowWeeks=!0:null!=l?g(t)._overflowWeekday=!0:(s=ot(n,i,a,r,o),t._a[$e]=s.year,t._dayOfYear=s.dayOfYear)}function At(t){if(t._f!==n.ISO_8601)if(t._f!==n.RFC_2822){t._a=[],g(t).empty=!0;var e,i,a,r,o,s=""+t._i,l=s.length,u=0;for(a=H(t._f,t._locale).match(Ie)||[],e=0;e<a.length;e++)r=a[e],(i=(s.match(j(r,t))||[])[0])&&((o=s.substr(0,s.indexOf(i))).length>0&&g(t).unusedInput.push(o),s=s.slice(s.indexOf(i)+i.length),u+=i.length),Re[r]?(i?g(t).empty=!1:g(t).unusedTokens.push(r),X(r,i,t)):t._strict&&!i&&g(t).unusedTokens.push(r);g(t).charsLeftOver=l-u,s.length>0&&g(t).unusedInput.push(s),t._a[nn]<=12&&!0===g(t).bigHour&&t._a[nn]>0&&(g(t).bigHour=void 0),g(t).parsedDateParts=t._a.slice(0),g(t).meridiem=t._meridiem,t._a[nn]=It(t._locale,t._a[nn],t._meridiem),Pt(t),kt(t)}else Mt(t);else wt(t)}function It(t,e,n){var i;return null==n?e:null!=t.meridiemHour?t.meridiemHour(e,n):null!=t.isPM?((i=t.isPM(n))&&e<12&&(e+=12),i||12!==e||(e=0),e):e}function Ot(t){var e,n,i,a,r;if(0===t._f.length)return g(t).invalidFormat=!0,void(t._d=new Date(NaN));for(a=0;a<t._f.length;a++)r=0,e=v({},t),null!=t._useUTC&&(e._useUTC=t._useUTC),e._f=t._f[a],At(e),m(e)&&(r+=g(e).charsLeftOver,r+=10*g(e).unusedTokens.length,g(e).score=r,(null==i||r<i)&&(i=r,n=e));c(t,n||e)}function Ft(t){if(!t._d){var e=I(t._i);t._a=u([e.year,e.month,e.day||e.date,e.hour,e.minute,e.second,e.millisecond],function(t){return t&&parseInt(t,10)}),Pt(t)}}function Rt(t){var e=new y(kt(Lt(t)));return e._nextDay&&(e.add(1,"d"),e._nextDay=void 0),e}function Lt(t){var e=t._i,n=t._f;return t._locale=t._locale||_t(t._l),null===e||void 0===n&&""===e?p({nullInput:!0}):("string"==typeof e&&(t._i=e=t._locale.preparse(e)),b(e)?new y(kt(e)):(l(e)?t._d=e:i(n)?Ot(t):n?At(t):Wt(t),m(t)||(t._d=null),t))}function Wt(t){var e=t._i;o(e)?t._d=new Date(n.now()):l(e)?t._d=new Date(e.valueOf()):"string"==typeof e?St(t):i(e)?(t._a=u(e.slice(0),function(t){return parseInt(t,10)}),Pt(t)):a(e)?Ft(t):s(e)?t._d=new Date(e):n.createFromInputFallback(t)}function Yt(t,e,n,o,s){var l={};return!0!==n&&!1!==n||(o=n,n=void 0),(a(t)&&r(t)||i(t)&&0===t.length)&&(t=void 0),l._isAMomentObject=!0,l._useUTC=l._isUTC=s,l._l=n,l._i=t,l._f=e,l._strict=o,Rt(l)}function Nt(t,e,n,i){return Yt(t,e,n,i,!1)}function zt(t,e){var n,a;if(1===e.length&&i(e[0])&&(e=e[0]),!e.length)return Nt();for(n=e[0],a=1;a<e.length;++a)e[a].isValid()&&!e[a][t](n)||(n=e[a]);return n}function Bt(t){for(var e in t)if(-1===Wn.indexOf(e)||null!=t[e]&&isNaN(t[e]))return!1;for(var n=!1,i=0;i<Wn.length;++i)if(t[Wn[i]]){if(n)return!1;parseFloat(t[Wn[i]])!==_(t[Wn[i]])&&(n=!0)}return!0}function Vt(t){var e=I(t),n=e.year||0,i=e.quarter||0,a=e.month||0,r=e.week||0,o=e.day||0,s=e.hour||0,l=e.minute||0,u=e.second||0,d=e.millisecond||0;this._isValid=Bt(e),this._milliseconds=+d+1e3*u+6e4*l+1e3*s*60*60,this._days=+o+7*r,this._months=+a+3*i+12*n,this._data={},this._locale=_t(),this._bubble()}function Ht(t){return t instanceof Vt}function Et(t){return t<0?-1*Math.round(-1*t):Math.round(t)}function jt(t,e){N(t,0,0,function(){var t=this.utcOffset(),n="+";return t<0&&(t=-t,n="-"),n+Y(~~(t/60),2)+e+Y(~~t%60,2)})}function Ut(t,e){var n=(e||"").match(t);if(null===n)return null;var i=((n[n.length-1]||[])+"").match(Yn)||["-",0,0],a=60*i[1]+_(i[2]);return 0===a?0:"+"===i[0]?a:-a}function qt(t,e){var i,a;return e._isUTC?(i=e.clone(),a=(b(t)||l(t)?t.valueOf():Nt(t).valueOf())-i.valueOf(),i._d.setTime(i._d.valueOf()+a),n.updateOffset(i,!1),i):Nt(t).local()}function Gt(t){return 15*-Math.round(t._d.getTimezoneOffset()/15)}function Zt(){return!!this.isValid()&&(this._isUTC&&0===this._offset)}function Xt(t,e){var n,i,a,r=t,o=null;return Ht(t)?r={ms:t._milliseconds,d:t._days,M:t._months}:s(t)?(r={},e?r[e]=t:r.milliseconds=t):(o=Nn.exec(t))?(n="-"===o[1]?-1:1,r={y:0,d:_(o[en])*n,h:_(o[nn])*n,m:_(o[an])*n,s:_(o[rn])*n,ms:_(Et(1e3*o[on]))*n}):(o=zn.exec(t))?(n="-"===o[1]?-1:1,r={y:Jt(o[2],n),M:Jt(o[3],n),w:Jt(o[4],n),d:Jt(o[5],n),h:Jt(o[6],n),m:Jt(o[7],n),s:Jt(o[8],n)}):null==r?r={}:"object"==typeof r&&("from"in r||"to"in r)&&(a=Qt(Nt(r.from),Nt(r.to)),(r={}).ms=a.milliseconds,r.M=a.months),i=new Vt(r),Ht(t)&&d(t,"_locale")&&(i._locale=t._locale),i}function Jt(t,e){var n=t&&parseFloat(t.replace(",","."));return(isNaN(n)?0:n)*e}function Kt(t,e){var n={milliseconds:0,months:0};return n.months=e.month()-t.month()+12*(e.year()-t.year()),t.clone().add(n.months,"M").isAfter(e)&&--n.months,n.milliseconds=+e-+t.clone().add(n.months,"M"),n}function Qt(t,e){var n;return t.isValid()&&e.isValid()?(e=qt(e,t),t.isBefore(e)?n=Kt(t,e):((n=Kt(e,t)).milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function $t(t,e){return function(n,i){var a,r;return null===i||isNaN(+i)||(S(e,"moment()."+e+"(period, number) is deprecated. Please use moment()."+e+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),r=n,n=i,i=r),n="string"==typeof n?+n:n,a=Xt(n,i),te(this,a,t),this}}function te(t,e,i,a){var r=e._milliseconds,o=Et(e._days),s=Et(e._months);t.isValid()&&(a=null==a||a,r&&t._d.setTime(t._d.valueOf()+r*i),o&&W(t,"Date",L(t,"Date")+o*i),s&&Q(t,L(t,"Month")+s*i),a&&n.updateOffset(t,o||s))}function ee(t,e){var n,i=12*(e.year()-t.year())+(e.month()-t.month()),a=t.clone().add(i,"months");return n=e-a<0?(e-a)/(a-t.clone().add(i-1,"months")):(e-a)/(t.clone().add(i+1,"months")-a),-(i+n)||0}function ne(t){var e;return void 0===t?this._locale._abbr:(null!=(e=_t(t))&&(this._locale=e),this)}function ie(){return this._locale}function ae(t,e){N(0,[t,t.length],0,e)}function re(t,e,n,i,a){var r;return null==t?st(this,i,a).year:(r=lt(t,i,a),e>r&&(e=r),oe.call(this,t,e,n,i,a))}function oe(t,e,n,i,a){var r=ot(t,e,n,i,a),o=at(r.year,0,r.dayOfYear);return this.year(o.getUTCFullYear()),this.month(o.getUTCMonth()),this.date(o.getUTCDate()),this}function se(t){return t}function le(t,e,n,i){var a=_t(),r=h().set(i,e);return a[n](r,t)}function ue(t,e,n){if(s(t)&&(e=t,t=void 0),t=t||"",null!=e)return le(t,e,n,"month");var i,a=[];for(i=0;i<12;i++)a[i]=le(t,i,n,"month");return a}function de(t,e,n,i){"boolean"==typeof t?(s(e)&&(n=e,e=void 0),e=e||""):(n=e=t,t=!1,s(e)&&(n=e,e=void 0),e=e||"");var a=_t(),r=t?a._week.dow:0;if(null!=n)return le(e,(n+r)%7,i,"day");var o,l=[];for(o=0;o<7;o++)l[o]=le(e,(o+r)%7,i,"day");return l}function ce(t,e,n,i){var a=Xt(e,n);return t._milliseconds+=i*a._milliseconds,t._days+=i*a._days,t._months+=i*a._months,t._bubble()}function he(t){return t<0?Math.floor(t):Math.ceil(t)}function fe(t){return 4800*t/146097}function ge(t){return 146097*t/4800}function me(t){return function(){return this.as(t)}}function pe(t){return function(){return this.isValid()?this._data[t]:NaN}}function ve(t,e,n,i,a){return a.relativeTime(e||1,!!n,t,i)}function ye(t,e,n){var i=Xt(t).abs(),a=hi(i.as("s")),r=hi(i.as("m")),o=hi(i.as("h")),s=hi(i.as("d")),l=hi(i.as("M")),u=hi(i.as("y")),d=a<=fi.ss&&["s",a]||a<fi.s&&["ss",a]||r<=1&&["m"]||r<fi.m&&["mm",r]||o<=1&&["h"]||o<fi.h&&["hh",o]||s<=1&&["d"]||s<fi.d&&["dd",s]||l<=1&&["M"]||l<fi.M&&["MM",l]||u<=1&&["y"]||["yy",u];return d[2]=e,d[3]=+t>0,d[4]=n,ve.apply(null,d)}function be(){if(!this.isValid())return this.localeData().invalidDate();var t,e,n,i=gi(this._milliseconds)/1e3,a=gi(this._days),r=gi(this._months);e=x((t=x(i/60))/60),i%=60,t%=60;var o=n=x(r/12),s=r%=12,l=a,u=e,d=t,c=i,h=this.asSeconds();return h?(h<0?"-":"")+"P"+(o?o+"Y":"")+(s?s+"M":"")+(l?l+"D":"")+(u||d||c?"T":"")+(u?u+"H":"")+(d?d+"M":"")+(c?c+"S":""):"P0D"}var xe,_e,ke=_e=Array.prototype.some?Array.prototype.some:function(t){for(var e=Object(this),n=e.length>>>0,i=0;i<n;i++)if(i in e&&t.call(this,e[i],i,e))return!0;return!1},we=n.momentProperties=[],Me=!1,Se={};n.suppressDeprecationWarnings=!1,n.deprecationHandler=null;var De,Ce,Pe=De=Object.keys?Object.keys:function(t){var e,n=[];for(e in t)d(t,e)&&n.push(e);return n},Te={},Ae={},Ie=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,Oe=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Fe={},Re={},Le=/\d/,We=/\d\d/,Ye=/\d{3}/,Ne=/\d{4}/,ze=/[+-]?\d{6}/,Be=/\d\d?/,Ve=/\d\d\d\d?/,He=/\d\d\d\d\d\d?/,Ee=/\d{1,3}/,je=/\d{1,4}/,Ue=/[+-]?\d{1,6}/,qe=/\d+/,Ge=/[+-]?\d+/,Ze=/Z|[+-]\d\d:?\d\d/gi,Xe=/Z|[+-]\d\d(?::?\d\d)?/gi,Je=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,Ke={},Qe={},$e=0,tn=1,en=2,nn=3,an=4,rn=5,on=6,sn=7,ln=8,un=Ce=Array.prototype.indexOf?Array.prototype.indexOf:function(t){var e;for(e=0;e<this.length;++e)if(this[e]===t)return e;return-1};N("M",["MM",2],"Mo",function(){return this.month()+1}),N("MMM",0,0,function(t){return this.localeData().monthsShort(this,t)}),N("MMMM",0,0,function(t){return this.localeData().months(this,t)}),T("month","M"),O("month",8),E("M",Be),E("MM",Be,We),E("MMM",function(t,e){return e.monthsShortRegex(t)}),E("MMMM",function(t,e){return e.monthsRegex(t)}),G(["M","MM"],function(t,e){e[tn]=_(t)-1}),G(["MMM","MMMM"],function(t,e,n,i){var a=n._locale.monthsParse(t,i,n._strict);null!=a?e[tn]=a:g(n).invalidMonth=t});var dn=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,cn="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),hn="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),fn=Je,gn=Je;N("Y",0,0,function(){var t=this.year();return t<=9999?""+t:"+"+t}),N(0,["YY",2],0,function(){return this.year()%100}),N(0,["YYYY",4],0,"year"),N(0,["YYYYY",5],0,"year"),N(0,["YYYYYY",6,!0],0,"year"),T("year","y"),O("year",1),E("Y",Ge),E("YY",Be,We),E("YYYY",je,Ne),E("YYYYY",Ue,ze),E("YYYYYY",Ue,ze),G(["YYYYY","YYYYYY"],$e),G("YYYY",function(t,e){e[$e]=2===t.length?n.parseTwoDigitYear(t):_(t)}),G("YY",function(t,e){e[$e]=n.parseTwoDigitYear(t)}),G("Y",function(t,e){e[$e]=parseInt(t,10)}),n.parseTwoDigitYear=function(t){return _(t)+(_(t)>68?1900:2e3)};var mn=R("FullYear",!0);N("w",["ww",2],"wo","week"),N("W",["WW",2],"Wo","isoWeek"),T("week","w"),T("isoWeek","W"),O("week",5),O("isoWeek",5),E("w",Be),E("ww",Be,We),E("W",Be),E("WW",Be,We),Z(["w","ww","W","WW"],function(t,e,n,i){e[i.substr(0,1)]=_(t)});N("d",0,"do","day"),N("dd",0,0,function(t){return this.localeData().weekdaysMin(this,t)}),N("ddd",0,0,function(t){return this.localeData().weekdaysShort(this,t)}),N("dddd",0,0,function(t){return this.localeData().weekdays(this,t)}),N("e",0,0,"weekday"),N("E",0,0,"isoWeekday"),T("day","d"),T("weekday","e"),T("isoWeekday","E"),O("day",11),O("weekday",11),O("isoWeekday",11),E("d",Be),E("e",Be),E("E",Be),E("dd",function(t,e){return e.weekdaysMinRegex(t)}),E("ddd",function(t,e){return e.weekdaysShortRegex(t)}),E("dddd",function(t,e){return e.weekdaysRegex(t)}),Z(["dd","ddd","dddd"],function(t,e,n,i){var a=n._locale.weekdaysParse(t,i,n._strict);null!=a?e.d=a:g(n).invalidWeekday=t}),Z(["d","e","E"],function(t,e,n,i){e[i]=_(t)});var pn="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),vn="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),yn="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),bn=Je,xn=Je,_n=Je;N("H",["HH",2],0,"hour"),N("h",["hh",2],0,ft),N("k",["kk",2],0,function(){return this.hours()||24}),N("hmm",0,0,function(){return""+ft.apply(this)+Y(this.minutes(),2)}),N("hmmss",0,0,function(){return""+ft.apply(this)+Y(this.minutes(),2)+Y(this.seconds(),2)}),N("Hmm",0,0,function(){return""+this.hours()+Y(this.minutes(),2)}),N("Hmmss",0,0,function(){return""+this.hours()+Y(this.minutes(),2)+Y(this.seconds(),2)}),gt("a",!0),gt("A",!1),T("hour","h"),O("hour",13),E("a",mt),E("A",mt),E("H",Be),E("h",Be),E("k",Be),E("HH",Be,We),E("hh",Be,We),E("kk",Be,We),E("hmm",Ve),E("hmmss",He),E("Hmm",Ve),E("Hmmss",He),G(["H","HH"],nn),G(["k","kk"],function(t,e,n){var i=_(t);e[nn]=24===i?0:i}),G(["a","A"],function(t,e,n){n._isPm=n._locale.isPM(t),n._meridiem=t}),G(["h","hh"],function(t,e,n){e[nn]=_(t),g(n).bigHour=!0}),G("hmm",function(t,e,n){var i=t.length-2;e[nn]=_(t.substr(0,i)),e[an]=_(t.substr(i)),g(n).bigHour=!0}),G("hmmss",function(t,e,n){var i=t.length-4,a=t.length-2;e[nn]=_(t.substr(0,i)),e[an]=_(t.substr(i,2)),e[rn]=_(t.substr(a)),g(n).bigHour=!0}),G("Hmm",function(t,e,n){var i=t.length-2;e[nn]=_(t.substr(0,i)),e[an]=_(t.substr(i))}),G("Hmmss",function(t,e,n){var i=t.length-4,a=t.length-2;e[nn]=_(t.substr(0,i)),e[an]=_(t.substr(i,2)),e[rn]=_(t.substr(a))});var kn,wn=R("Hours",!0),Mn={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:/\d{1,2}/,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d 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"},months:cn,monthsShort:hn,week:{dow:0,doy:6},weekdays:pn,weekdaysMin:yn,weekdaysShort:vn,meridiemParse:/[ap]\.?m?\.?/i},Sn={},Dn={},Cn=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Pn=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Tn=/Z|[+-]\d\d(?::?\d\d)?/,An=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],In=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],On=/^\/?Date\((\-?\d+)/i,Fn=/^((?:Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d?\d\s(?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(?:\d\d)?\d\d\s)(\d\d:\d\d)(\:\d\d)?(\s(?:UT|GMT|[ECMP][SD]T|[A-IK-Za-ik-z]|[+-]\d{4}))$/;n.createFromInputFallback=M("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged and will be removed in an upcoming major release. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(t){t._d=new Date(t._i+(t._useUTC?" UTC":""))}),n.ISO_8601=function(){},n.RFC_2822=function(){};var Rn=M("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var t=Nt.apply(null,arguments);return this.isValid()&&t.isValid()?t<this?this:t:p()}),Ln=M("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var t=Nt.apply(null,arguments);return this.isValid()&&t.isValid()?t>this?this:t:p()}),Wn=["year","quarter","month","week","day","hour","minute","second","millisecond"];jt("Z",":"),jt("ZZ",""),E("Z",Xe),E("ZZ",Xe),G(["Z","ZZ"],function(t,e,n){n._useUTC=!0,n._tzm=Ut(Xe,t)});var Yn=/([\+\-]|\d\d)/gi;n.updateOffset=function(){};var Nn=/^(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/,zn=/^(-)?P(?:(-?[0-9,.]*)Y)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)W)?(?:(-?[0-9,.]*)D)?(?:T(?:(-?[0-9,.]*)H)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)S)?)?$/;Xt.fn=Vt.prototype,Xt.invalid=function(){return Xt(NaN)};var Bn=$t(1,"add"),Vn=$t(-1,"subtract");n.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",n.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var Hn=M("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(t){return void 0===t?this.localeData():this.locale(t)});N(0,["gg",2],0,function(){return this.weekYear()%100}),N(0,["GG",2],0,function(){return this.isoWeekYear()%100}),ae("gggg","weekYear"),ae("ggggg","weekYear"),ae("GGGG","isoWeekYear"),ae("GGGGG","isoWeekYear"),T("weekYear","gg"),T("isoWeekYear","GG"),O("weekYear",1),O("isoWeekYear",1),E("G",Ge),E("g",Ge),E("GG",Be,We),E("gg",Be,We),E("GGGG",je,Ne),E("gggg",je,Ne),E("GGGGG",Ue,ze),E("ggggg",Ue,ze),Z(["gggg","ggggg","GGGG","GGGGG"],function(t,e,n,i){e[i.substr(0,2)]=_(t)}),Z(["gg","GG"],function(t,e,i,a){e[a]=n.parseTwoDigitYear(t)}),N("Q",0,"Qo","quarter"),T("quarter","Q"),O("quarter",7),E("Q",Le),G("Q",function(t,e){e[tn]=3*(_(t)-1)}),N("D",["DD",2],"Do","date"),T("date","D"),O("date",9),E("D",Be),E("DD",Be,We),E("Do",function(t,e){return t?e._dayOfMonthOrdinalParse||e._ordinalParse:e._dayOfMonthOrdinalParseLenient}),G(["D","DD"],en),G("Do",function(t,e){e[en]=_(t.match(Be)[0],10)});var En=R("Date",!0);N("DDD",["DDDD",3],"DDDo","dayOfYear"),T("dayOfYear","DDD"),O("dayOfYear",4),E("DDD",Ee),E("DDDD",Ye),G(["DDD","DDDD"],function(t,e,n){n._dayOfYear=_(t)}),N("m",["mm",2],0,"minute"),T("minute","m"),O("minute",14),E("m",Be),E("mm",Be,We),G(["m","mm"],an);var jn=R("Minutes",!1);N("s",["ss",2],0,"second"),T("second","s"),O("second",15),E("s",Be),E("ss",Be,We),G(["s","ss"],rn);var Un=R("Seconds",!1);N("S",0,0,function(){return~~(this.millisecond()/100)}),N(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),N(0,["SSS",3],0,"millisecond"),N(0,["SSSS",4],0,function(){return 10*this.millisecond()}),N(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),N(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),N(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),N(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),N(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),T("millisecond","ms"),O("millisecond",16),E("S",Ee,Le),E("SS",Ee,We),E("SSS",Ee,Ye);var qn;for(qn="SSSS";qn.length<=9;qn+="S")E(qn,qe);for(qn="S";qn.length<=9;qn+="S")G(qn,function(t,e){e[on]=_(1e3*("0."+t))});var Gn=R("Milliseconds",!1);N("z",0,0,"zoneAbbr"),N("zz",0,0,"zoneName");var Zn=y.prototype;Zn.add=Bn,Zn.calendar=function(t,e){var i=t||Nt(),a=qt(i,this).startOf("day"),r=n.calendarFormat(this,a)||"sameElse",o=e&&(D(e[r])?e[r].call(this,i):e[r]);return this.format(o||this.localeData().calendar(r,this,Nt(i)))},Zn.clone=function(){return new y(this)},Zn.diff=function(t,e,n){var i,a,r,o;return this.isValid()&&(i=qt(t,this)).isValid()?(a=6e4*(i.utcOffset()-this.utcOffset()),"year"===(e=A(e))||"month"===e||"quarter"===e?(o=ee(this,i),"quarter"===e?o/=3:"year"===e&&(o/=12)):(r=this-i,o="second"===e?r/1e3:"minute"===e?r/6e4:"hour"===e?r/36e5:"day"===e?(r-a)/864e5:"week"===e?(r-a)/6048e5:r),n?o:x(o)):NaN},Zn.endOf=function(t){return void 0===(t=A(t))||"millisecond"===t?this:("date"===t&&(t="day"),this.startOf(t).add(1,"isoWeek"===t?"week":t).subtract(1,"ms"))},Zn.format=function(t){t||(t=this.isUtc()?n.defaultFormatUtc:n.defaultFormat);var e=V(this,t);return this.localeData().postformat(e)},Zn.from=function(t,e){return this.isValid()&&(b(t)&&t.isValid()||Nt(t).isValid())?Xt({to:this,from:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()},Zn.fromNow=function(t){return this.from(Nt(),t)},Zn.to=function(t,e){return this.isValid()&&(b(t)&&t.isValid()||Nt(t).isValid())?Xt({from:this,to:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()},Zn.toNow=function(t){return this.to(Nt(),t)},Zn.get=function(t){return t=A(t),D(this[t])?this[t]():this},Zn.invalidAt=function(){return g(this).overflow},Zn.isAfter=function(t,e){var n=b(t)?t:Nt(t);return!(!this.isValid()||!n.isValid())&&("millisecond"===(e=A(o(e)?"millisecond":e))?this.valueOf()>n.valueOf():n.valueOf()<this.clone().startOf(e).valueOf())},Zn.isBefore=function(t,e){var n=b(t)?t:Nt(t);return!(!this.isValid()||!n.isValid())&&("millisecond"===(e=A(o(e)?"millisecond":e))?this.valueOf()<n.valueOf():this.clone().endOf(e).valueOf()<n.valueOf())},Zn.isBetween=function(t,e,n,i){return("("===(i=i||"()")[0]?this.isAfter(t,n):!this.isBefore(t,n))&&(")"===i[1]?this.isBefore(e,n):!this.isAfter(e,n))},Zn.isSame=function(t,e){var n,i=b(t)?t:Nt(t);return!(!this.isValid()||!i.isValid())&&("millisecond"===(e=A(e||"millisecond"))?this.valueOf()===i.valueOf():(n=i.valueOf(),this.clone().startOf(e).valueOf()<=n&&n<=this.clone().endOf(e).valueOf()))},Zn.isSameOrAfter=function(t,e){return this.isSame(t,e)||this.isAfter(t,e)},Zn.isSameOrBefore=function(t,e){return this.isSame(t,e)||this.isBefore(t,e)},Zn.isValid=function(){return m(this)},Zn.lang=Hn,Zn.locale=ne,Zn.localeData=ie,Zn.max=Ln,Zn.min=Rn,Zn.parsingFlags=function(){return c({},g(this))},Zn.set=function(t,e){if("object"==typeof t)for(var n=F(t=I(t)),i=0;i<n.length;i++)this[n[i].unit](t[n[i].unit]);else if(t=A(t),D(this[t]))return this[t](e);return this},Zn.startOf=function(t){switch(t=A(t)){case"year":this.month(0);case"quarter":case"month":this.date(1);case"week":case"isoWeek":case"day":case"date":this.hours(0);case"hour":this.minutes(0);case"minute":this.seconds(0);case"second":this.milliseconds(0)}return"week"===t&&this.weekday(0),"isoWeek"===t&&this.isoWeekday(1),"quarter"===t&&this.month(3*Math.floor(this.month()/3)),this},Zn.subtract=Vn,Zn.toArray=function(){var t=this;return[t.year(),t.month(),t.date(),t.hour(),t.minute(),t.second(),t.millisecond()]},Zn.toObject=function(){var t=this;return{years:t.year(),months:t.month(),date:t.date(),hours:t.hours(),minutes:t.minutes(),seconds:t.seconds(),milliseconds:t.milliseconds()}},Zn.toDate=function(){return new Date(this.valueOf())},Zn.toISOString=function(){if(!this.isValid())return null;var t=this.clone().utc();return t.year()<0||t.year()>9999?V(t,"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]"):D(Date.prototype.toISOString)?this.toDate().toISOString():V(t,"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]")},Zn.inspect=function(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var t="moment",e="";this.isLocal()||(t=0===this.utcOffset()?"moment.utc":"moment.parseZone",e="Z");var n="["+t+'("]',i=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",a=e+'[")]';return this.format(n+i+"-MM-DD[T]HH:mm:ss.SSS"+a)},Zn.toJSON=function(){return this.isValid()?this.toISOString():null},Zn.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},Zn.unix=function(){return Math.floor(this.valueOf()/1e3)},Zn.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},Zn.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},Zn.year=mn,Zn.isLeapYear=function(){return nt(this.year())},Zn.weekYear=function(t){return re.call(this,t,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)},Zn.isoWeekYear=function(t){return re.call(this,t,this.isoWeek(),this.isoWeekday(),1,4)},Zn.quarter=Zn.quarters=function(t){return null==t?Math.ceil((this.month()+1)/3):this.month(3*(t-1)+this.month()%3)},Zn.month=$,Zn.daysInMonth=function(){return J(this.year(),this.month())},Zn.week=Zn.weeks=function(t){var e=this.localeData().week(this);return null==t?e:this.add(7*(t-e),"d")},Zn.isoWeek=Zn.isoWeeks=function(t){var e=st(this,1,4).week;return null==t?e:this.add(7*(t-e),"d")},Zn.weeksInYear=function(){var t=this.localeData()._week;return lt(this.year(),t.dow,t.doy)},Zn.isoWeeksInYear=function(){return lt(this.year(),1,4)},Zn.date=En,Zn.day=Zn.days=function(t){if(!this.isValid())return null!=t?this:NaN;var e=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=t?(t=ut(t,this.localeData()),this.add(t-e,"d")):e},Zn.weekday=function(t){if(!this.isValid())return null!=t?this:NaN;var e=(this.day()+7-this.localeData()._week.dow)%7;return null==t?e:this.add(t-e,"d")},Zn.isoWeekday=function(t){if(!this.isValid())return null!=t?this:NaN;if(null!=t){var e=dt(t,this.localeData());return this.day(this.day()%7?e:e-7)}return this.day()||7},Zn.dayOfYear=function(t){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==t?e:this.add(t-e,"d")},Zn.hour=Zn.hours=wn,Zn.minute=Zn.minutes=jn,Zn.second=Zn.seconds=Un,Zn.millisecond=Zn.milliseconds=Gn,Zn.utcOffset=function(t,e,i){var a,r=this._offset||0;if(!this.isValid())return null!=t?this:NaN;if(null!=t){if("string"==typeof t){if(null===(t=Ut(Xe,t)))return this}else Math.abs(t)<16&&!i&&(t*=60);return!this._isUTC&&e&&(a=Gt(this)),this._offset=t,this._isUTC=!0,null!=a&&this.add(a,"m"),r!==t&&(!e||this._changeInProgress?te(this,Xt(t-r,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,n.updateOffset(this,!0),this._changeInProgress=null)),this}return this._isUTC?r:Gt(this)},Zn.utc=function(t){return this.utcOffset(0,t)},Zn.local=function(t){return this._isUTC&&(this.utcOffset(0,t),this._isUTC=!1,t&&this.subtract(Gt(this),"m")),this},Zn.parseZone=function(){if(null!=this._tzm)this.utcOffset(this._tzm,!1,!0);else if("string"==typeof this._i){var t=Ut(Ze,this._i);null!=t?this.utcOffset(t):this.utcOffset(0,!0)}return this},Zn.hasAlignedHourOffset=function(t){return!!this.isValid()&&(t=t?Nt(t).utcOffset():0,(this.utcOffset()-t)%60==0)},Zn.isDST=function(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},Zn.isLocal=function(){return!!this.isValid()&&!this._isUTC},Zn.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},Zn.isUtc=Zt,Zn.isUTC=Zt,Zn.zoneAbbr=function(){return this._isUTC?"UTC":""},Zn.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},Zn.dates=M("dates accessor is deprecated. Use date instead.",En),Zn.months=M("months accessor is deprecated. Use month instead",$),Zn.years=M("years accessor is deprecated. Use year instead",mn),Zn.zone=M("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",function(t,e){return null!=t?("string"!=typeof t&&(t=-t),this.utcOffset(t,e),this):-this.utcOffset()}),Zn.isDSTShifted=M("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",function(){if(!o(this._isDSTShifted))return this._isDSTShifted;var t={};if(v(t,this),(t=Lt(t))._a){var e=t._isUTC?h(t._a):Nt(t._a);this._isDSTShifted=this.isValid()&&k(t._a,e.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted});var Xn=P.prototype;Xn.calendar=function(t,e,n){var i=this._calendar[t]||this._calendar.sameElse;return D(i)?i.call(e,n):i},Xn.longDateFormat=function(t){var e=this._longDateFormat[t],n=this._longDateFormat[t.toUpperCase()];return e||!n?e:(this._longDateFormat[t]=n.replace(/MMMM|MM|DD|dddd/g,function(t){return t.slice(1)}),this._longDateFormat[t])},Xn.invalidDate=function(){return this._invalidDate},Xn.ordinal=function(t){return this._ordinal.replace("%d",t)},Xn.preparse=se,Xn.postformat=se,Xn.relativeTime=function(t,e,n,i){var a=this._relativeTime[n];return D(a)?a(t,e,n,i):a.replace(/%d/i,t)},Xn.pastFuture=function(t,e){var n=this._relativeTime[t>0?"future":"past"];return D(n)?n(e):n.replace(/%s/i,e)},Xn.set=function(t){var e,n;for(n in t)D(e=t[n])?this[n]=e:this["_"+n]=e;this._config=t,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)},Xn.months=function(t,e){return t?i(this._months)?this._months[t.month()]:this._months[(this._months.isFormat||dn).test(e)?"format":"standalone"][t.month()]:i(this._months)?this._months:this._months.standalone},Xn.monthsShort=function(t,e){return t?i(this._monthsShort)?this._monthsShort[t.month()]:this._monthsShort[dn.test(e)?"format":"standalone"][t.month()]:i(this._monthsShort)?this._monthsShort:this._monthsShort.standalone},Xn.monthsParse=function(t,e,n){var i,a,r;if(this._monthsParseExact)return K.call(this,t,e,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),i=0;i<12;i++){if(a=h([2e3,i]),n&&!this._longMonthsParse[i]&&(this._longMonthsParse[i]=new RegExp("^"+this.months(a,"").replace(".","")+"$","i"),this._shortMonthsParse[i]=new RegExp("^"+this.monthsShort(a,"").replace(".","")+"$","i")),n||this._monthsParse[i]||(r="^"+this.months(a,"")+"|^"+this.monthsShort(a,""),this._monthsParse[i]=new RegExp(r.replace(".",""),"i")),n&&"MMMM"===e&&this._longMonthsParse[i].test(t))return i;if(n&&"MMM"===e&&this._shortMonthsParse[i].test(t))return i;if(!n&&this._monthsParse[i].test(t))return i}},Xn.monthsRegex=function(t){return this._monthsParseExact?(d(this,"_monthsRegex")||tt.call(this),t?this._monthsStrictRegex:this._monthsRegex):(d(this,"_monthsRegex")||(this._monthsRegex=gn),this._monthsStrictRegex&&t?this._monthsStrictRegex:this._monthsRegex)},Xn.monthsShortRegex=function(t){return this._monthsParseExact?(d(this,"_monthsRegex")||tt.call(this),t?this._monthsShortStrictRegex:this._monthsShortRegex):(d(this,"_monthsShortRegex")||(this._monthsShortRegex=fn),this._monthsShortStrictRegex&&t?this._monthsShortStrictRegex:this._monthsShortRegex)},Xn.week=function(t){return st(t,this._week.dow,this._week.doy).week},Xn.firstDayOfYear=function(){return this._week.doy},Xn.firstDayOfWeek=function(){return this._week.dow},Xn.weekdays=function(t,e){return t?i(this._weekdays)?this._weekdays[t.day()]:this._weekdays[this._weekdays.isFormat.test(e)?"format":"standalone"][t.day()]:i(this._weekdays)?this._weekdays:this._weekdays.standalone},Xn.weekdaysMin=function(t){return t?this._weekdaysMin[t.day()]:this._weekdaysMin},Xn.weekdaysShort=function(t){return t?this._weekdaysShort[t.day()]:this._weekdaysShort},Xn.weekdaysParse=function(t,e,n){var i,a,r;if(this._weekdaysParseExact)return ct.call(this,t,e,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),i=0;i<7;i++){if(a=h([2e3,1]).day(i),n&&!this._fullWeekdaysParse[i]&&(this._fullWeekdaysParse[i]=new RegExp("^"+this.weekdays(a,"").replace(".",".?")+"$","i"),this._shortWeekdaysParse[i]=new RegExp("^"+this.weekdaysShort(a,"").replace(".",".?")+"$","i"),this._minWeekdaysParse[i]=new RegExp("^"+this.weekdaysMin(a,"").replace(".",".?")+"$","i")),this._weekdaysParse[i]||(r="^"+this.weekdays(a,"")+"|^"+this.weekdaysShort(a,"")+"|^"+this.weekdaysMin(a,""),this._weekdaysParse[i]=new RegExp(r.replace(".",""),"i")),n&&"dddd"===e&&this._fullWeekdaysParse[i].test(t))return i;if(n&&"ddd"===e&&this._shortWeekdaysParse[i].test(t))return i;if(n&&"dd"===e&&this._minWeekdaysParse[i].test(t))return i;if(!n&&this._weekdaysParse[i].test(t))return i}},Xn.weekdaysRegex=function(t){return this._weekdaysParseExact?(d(this,"_weekdaysRegex")||ht.call(this),t?this._weekdaysStrictRegex:this._weekdaysRegex):(d(this,"_weekdaysRegex")||(this._weekdaysRegex=bn),this._weekdaysStrictRegex&&t?this._weekdaysStrictRegex:this._weekdaysRegex)},Xn.weekdaysShortRegex=function(t){return this._weekdaysParseExact?(d(this,"_weekdaysRegex")||ht.call(this),t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(d(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=xn),this._weekdaysShortStrictRegex&&t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},Xn.weekdaysMinRegex=function(t){return this._weekdaysParseExact?(d(this,"_weekdaysRegex")||ht.call(this),t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(d(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=_n),this._weekdaysMinStrictRegex&&t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},Xn.isPM=function(t){return"p"===(t+"").toLowerCase().charAt(0)},Xn.meridiem=function(t,e,n){return t>11?n?"pm":"PM":n?"am":"AM"},bt("en",{dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var e=t%10;return t+(1===_(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th")}}),n.lang=M("moment.lang is deprecated. Use moment.locale instead.",bt),n.langData=M("moment.langData is deprecated. Use moment.localeData instead.",_t);var Jn=Math.abs,Kn=me("ms"),Qn=me("s"),$n=me("m"),ti=me("h"),ei=me("d"),ni=me("w"),ii=me("M"),ai=me("y"),ri=pe("milliseconds"),oi=pe("seconds"),si=pe("minutes"),li=pe("hours"),ui=pe("days"),di=pe("months"),ci=pe("years"),hi=Math.round,fi={ss:44,s:45,m:45,h:22,d:26,M:11},gi=Math.abs,mi=Vt.prototype;return mi.isValid=function(){return this._isValid},mi.abs=function(){var t=this._data;return this._milliseconds=Jn(this._milliseconds),this._days=Jn(this._days),this._months=Jn(this._months),t.milliseconds=Jn(t.milliseconds),t.seconds=Jn(t.seconds),t.minutes=Jn(t.minutes),t.hours=Jn(t.hours),t.months=Jn(t.months),t.years=Jn(t.years),this},mi.add=function(t,e){return ce(this,t,e,1)},mi.subtract=function(t,e){return ce(this,t,e,-1)},mi.as=function(t){if(!this.isValid())return NaN;var e,n,i=this._milliseconds;if("month"===(t=A(t))||"year"===t)return e=this._days+i/864e5,n=this._months+fe(e),"month"===t?n:n/12;switch(e=this._days+Math.round(ge(this._months)),t){case"week":return e/7+i/6048e5;case"day":return e+i/864e5;case"hour":return 24*e+i/36e5;case"minute":return 1440*e+i/6e4;case"second":return 86400*e+i/1e3;case"millisecond":return Math.floor(864e5*e)+i;default:throw new Error("Unknown unit "+t)}},mi.asMilliseconds=Kn,mi.asSeconds=Qn,mi.asMinutes=$n,mi.asHours=ti,mi.asDays=ei,mi.asWeeks=ni,mi.asMonths=ii,mi.asYears=ai,mi.valueOf=function(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*_(this._months/12):NaN},mi._bubble=function(){var t,e,n,i,a,r=this._milliseconds,o=this._days,s=this._months,l=this._data;return r>=0&&o>=0&&s>=0||r<=0&&o<=0&&s<=0||(r+=864e5*he(ge(s)+o),o=0,s=0),l.milliseconds=r%1e3,t=x(r/1e3),l.seconds=t%60,e=x(t/60),l.minutes=e%60,n=x(e/60),l.hours=n%24,o+=x(n/24),a=x(fe(o)),s+=a,o-=he(ge(a)),i=x(s/12),s%=12,l.days=o,l.months=s,l.years=i,this},mi.get=function(t){return t=A(t),this.isValid()?this[t+"s"]():NaN},mi.milliseconds=ri,mi.seconds=oi,mi.minutes=si,mi.hours=li,mi.days=ui,mi.weeks=function(){return x(this.days()/7)},mi.months=di,mi.years=ci,mi.humanize=function(t){if(!this.isValid())return this.localeData().invalidDate();var e=this.localeData(),n=ye(this,!t,e);return t&&(n=e.pastFuture(+this,n)),e.postformat(n)},mi.toISOString=be,mi.toString=be,mi.toJSON=be,mi.locale=ne,mi.localeData=ie,mi.toIsoString=M("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",be),mi.lang=Hn,N("X",0,0,"unix"),N("x",0,0,"valueOf"),E("x",Ge),E("X",/[+-]?\d+(\.\d{1,3})?/),G("X",function(t,e,n){n._d=new Date(1e3*parseFloat(t,10))}),G("x",function(t,e,n){n._d=new Date(_(t))}),n.version="2.18.1",function(t){xe=t}(Nt),n.fn=Zn,n.min=function(){return zt("isBefore",[].slice.call(arguments,0))},n.max=function(){return zt("isAfter",[].slice.call(arguments,0))},n.now=function(){return Date.now?Date.now():+new Date},n.utc=h,n.unix=function(t){return Nt(1e3*t)},n.months=function(t,e){return ue(t,e,"months")},n.isDate=l,n.locale=bt,n.invalid=p,n.duration=Xt,n.isMoment=b,n.weekdays=function(t,e,n){return de(t,e,n,"weekdays")},n.parseZone=function(){return Nt.apply(null,arguments).parseZone()},n.localeData=_t,n.isDuration=Ht,n.monthsShort=function(t,e){return ue(t,e,"monthsShort")},n.weekdaysMin=function(t,e,n){return de(t,e,n,"weekdaysMin")},n.defineLocale=xt,n.updateLocale=function(t,e){if(null!=e){var n,i=Mn;null!=Sn[t]&&(i=Sn[t]._config),(n=new P(e=C(i,e))).parentLocale=Sn[t],Sn[t]=n,bt(t)}else null!=Sn[t]&&(null!=Sn[t].parentLocale?Sn[t]=Sn[t].parentLocale:null!=Sn[t]&&delete Sn[t]);return Sn[t]},n.locales=function(){return Pe(Sn)},n.weekdaysShort=function(t,e,n){return de(t,e,n,"weekdaysShort")},n.normalizeUnits=A,n.relativeTimeRounding=function(t){return void 0===t?hi:"function"==typeof t&&(hi=t,!0)},n.relativeTimeThreshold=function(t,e){return void 0!==fi[t]&&(void 0===e?fi[t]:(fi[t]=e,"s"===t&&(fi.ss=e-1),!0))},n.calendarFormat=function(t,e){var n=t.diff(e,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"},n.prototype=Zn,n})},{}],7:[function(t,e,n){var i=t(29)();i.helpers=t(45),t(27)(i),i.defaults=t(25),i.Element=t(26),i.elements=t(40),i.Interaction=t(28),i.platform=t(48),t(31)(i),t(22)(i),t(23)(i),t(24)(i),t(30)(i),t(33)(i),t(32)(i),t(35)(i),t(54)(i),t(52)(i),t(53)(i),t(55)(i),t(56)(i),t(57)(i),t(15)(i),t(16)(i),t(17)(i),t(18)(i),t(19)(i),t(20)(i),t(21)(i),t(8)(i),t(9)(i),t(10)(i),t(11)(i),t(12)(i),t(13)(i),t(14)(i);var a=[];a.push(t(49)(i),t(50)(i),t(51)(i)),i.plugins.register(a),i.platform.initialize(),e.exports=i,"undefined"!=typeof window&&(window.Chart=i),i.canvasHelpers=i.helpers.canvas},{10:10,11:11,12:12,13:13,14:14,15:15,16:16,17:17,18:18,19:19,20:20,21:21,22:22,23:23,24:24,25:25,26:26,27:27,28:28,29:29,30:30,31:31,32:32,33:33,35:35,40:40,45:45,48:48,49:49,50:50,51:51,52:52,53:53,54:54,55:55,56:56,57:57,8:8,9:9}],8:[function(t,e,n){"use strict";e.exports=function(t){t.Bar=function(e,n){return n.type="bar",new t(e,n)}}},{}],9:[function(t,e,n){"use strict";e.exports=function(t){t.Bubble=function(e,n){return n.type="bubble",new t(e,n)}}},{}],10:[function(t,e,n){"use strict";e.exports=function(t){t.Doughnut=function(e,n){return n.type="doughnut",new t(e,n)}}},{}],11:[function(t,e,n){"use strict";e.exports=function(t){t.Line=function(e,n){return n.type="line",new t(e,n)}}},{}],12:[function(t,e,n){"use strict";e.exports=function(t){t.PolarArea=function(e,n){return n.type="polarArea",new t(e,n)}}},{}],13:[function(t,e,n){"use strict";e.exports=function(t){t.Radar=function(e,n){return n.type="radar",new t(e,n)}}},{}],14:[function(t,e,n){"use strict";e.exports=function(t){t.Scatter=function(e,n){return n.type="scatter",new t(e,n)}}},{}],15:[function(t,e,n){"use strict";var i=t(25),a=t(40),r=t(45);i._set("bar",{hover:{mode:"label"},scales:{xAxes:[{type:"category",categoryPercentage:.8,barPercentage:.9,offset:!0,gridLines:{offsetGridLines:!0}}],yAxes:[{type:"linear"}]}}),i._set("horizontalBar",{hover:{mode:"index",axis:"y"},scales:{xAxes:[{type:"linear",position:"bottom"}],yAxes:[{position:"left",type:"category",categoryPercentage:.8,barPercentage:.9,offset:!0,gridLines:{offsetGridLines:!0}}]},elements:{rectangle:{borderSkipped:"left"}},tooltips:{callbacks:{title:function(t,e){var n="";return t.length>0&&(t[0].yLabel?n=t[0].yLabel:e.labels.length>0&&t[0].index<e.labels.length&&(n=e.labels[t[0].index])),n},label:function(t,e){return(e.datasets[t.datasetIndex].label||"")+": "+t.xLabel}},mode:"index",axis:"y"}}),e.exports=function(t){t.controllers.bar=t.DatasetController.extend({dataElementType:a.Rectangle,initialize:function(){var e,n=this;t.DatasetController.prototype.initialize.apply(n,arguments),(e=n.getMeta()).stack=n.getDataset().stack,e.bar=!0},update:function(t){var e,n,i=this,a=i.getMeta().data;for(i._ruler=i.getRuler(),e=0,n=a.length;e<n;++e)i.updateElement(a[e],e,t)},updateElement:function(t,e,n){var i=this,a=i.chart,o=i.getMeta(),s=i.getDataset(),l=t.custom||{},u=a.options.elements.rectangle;t._xScale=i.getScaleForId(o.xAxisID),t._yScale=i.getScaleForId(o.yAxisID),t._datasetIndex=i.index,t._index=e,t._model={datasetLabel:s.label,label:a.data.labels[e],borderSkipped:l.borderSkipped?l.borderSkipped:u.borderSkipped,backgroundColor:l.backgroundColor?l.backgroundColor:r.valueAtIndexOrDefault(s.backgroundColor,e,u.backgroundColor),borderColor:l.borderColor?l.borderColor:r.valueAtIndexOrDefault(s.borderColor,e,u.borderColor),borderWidth:l.borderWidth?l.borderWidth:r.valueAtIndexOrDefault(s.borderWidth,e,u.borderWidth)},i.updateElementGeometry(t,e,n),t.pivot()},updateElementGeometry:function(t,e,n){var i=this,a=t._model,r=i.getValueScale(),o=r.getBasePixel(),s=r.isHorizontal(),l=i._ruler||i.getRuler(),u=i.calculateBarValuePixels(i.index,e),d=i.calculateBarIndexPixels(i.index,e,l);a.horizontal=s,a.base=n?o:u.base,a.x=s?n?o:u.head:d.center,a.y=s?d.center:n?o:u.head,a.height=s?d.size:void 0,a.width=s?void 0:d.size},getValueScaleId:function(){return this.getMeta().yAxisID},getIndexScaleId:function(){return this.getMeta().xAxisID},getValueScale:function(){return this.getScaleForId(this.getValueScaleId())},getIndexScale:function(){return this.getScaleForId(this.getIndexScaleId())},getStackCount:function(t){var e,n,i=this,a=i.chart,r=i.getIndexScale().options.stacked,o=void 0===t?a.data.datasets.length:t+1,s=[];for(e=0;e<o;++e)(n=a.getDatasetMeta(e)).bar&&a.isDatasetVisible(e)&&(!1===r||!0===r&&-1===s.indexOf(n.stack)||void 0===r&&(void 0===n.stack||-1===s.indexOf(n.stack)))&&s.push(n.stack);return s.length},getStackIndex:function(t){return this.getStackCount(t)-1},getRuler:function(){var t,e,n=this,i=n.getIndexScale(),a=n.getStackCount(),r=n.index,o=[],s=i.isHorizontal(),l=s?i.left:i.top,u=l+(s?i.width:i.height);for(t=0,e=n.getMeta().data.length;t<e;++t)o.push(i.getPixelForValue(null,t,r));return{pixels:o,start:l,end:u,stackCount:a,scale:i}},calculateBarValuePixels:function(t,e){var n,i,a,r,o,s,l=this,u=l.chart,d=l.getMeta(),c=l.getValueScale(),h=u.data.datasets,f=c.getRightValue(h[t].data[e]),g=c.options.stacked,m=d.stack,p=0;if(g||void 0===g&&void 0!==m)for(n=0;n<t;++n)(i=u.getDatasetMeta(n)).bar&&i.stack===m&&i.controller.getValueScaleId()===c.id&&u.isDatasetVisible(n)&&(a=c.getRightValue(h[n].data[e]),(f<0&&a<0||f>=0&&a>0)&&(p+=a));return r=c.getPixelForValue(p),o=c.getPixelForValue(p+f),s=(o-r)/2,{size:s,base:r,head:o,center:o+s/2}},calculateBarIndexPixels:function(t,e,n){var i,a,o,s,l,u,d=this,c=n.scale.options,h=d.getStackIndex(t),f=n.pixels,g=f[e],m=f.length,p=n.start,v=n.end;return 1===m?(i=g>p?g-p:v-g,a=g<v?v-g:g-p):(e>0&&(i=(g-f[e-1])/2,e===m-1&&(a=i)),e<m-1&&(a=(f[e+1]-g)/2,0===e&&(i=a))),o=i*c.categoryPercentage,s=a*c.categoryPercentage,l=(o+s)/n.stackCount,u=l*c.barPercentage,u=Math.min(r.valueOrDefault(c.barThickness,u),r.valueOrDefault(c.maxBarThickness,1/0)),g-=o,g+=l*h,g+=(l-u)/2,{size:u,base:g,head:g+u,center:g+u/2}},draw:function(){var t=this,e=t.chart,n=t.getValueScale(),i=t.getMeta().data,a=t.getDataset(),o=i.length,s=0;for(r.canvas.clipArea(e.ctx,e.chartArea);s<o;++s)isNaN(n.getRightValue(a.data[s]))||i[s].draw();r.canvas.unclipArea(e.ctx)},setHoverStyle:function(t){var e=this.chart.data.datasets[t._datasetIndex],n=t._index,i=t.custom||{},a=t._model;a.backgroundColor=i.hoverBackgroundColor?i.hoverBackgroundColor:r.valueAtIndexOrDefault(e.hoverBackgroundColor,n,r.getHoverColor(a.backgroundColor)),a.borderColor=i.hoverBorderColor?i.hoverBorderColor:r.valueAtIndexOrDefault(e.hoverBorderColor,n,r.getHoverColor(a.borderColor)),a.borderWidth=i.hoverBorderWidth?i.hoverBorderWidth:r.valueAtIndexOrDefault(e.hoverBorderWidth,n,a.borderWidth)},removeHoverStyle:function(t){var e=this.chart.data.datasets[t._datasetIndex],n=t._index,i=t.custom||{},a=t._model,o=this.chart.options.elements.rectangle;a.backgroundColor=i.backgroundColor?i.backgroundColor:r.valueAtIndexOrDefault(e.backgroundColor,n,o.backgroundColor),a.borderColor=i.borderColor?i.borderColor:r.valueAtIndexOrDefault(e.borderColor,n,o.borderColor),a.borderWidth=i.borderWidth?i.borderWidth:r.valueAtIndexOrDefault(e.borderWidth,n,o.borderWidth)}}),t.controllers.horizontalBar=t.controllers.bar.extend({getValueScaleId:function(){return this.getMeta().xAxisID},getIndexScaleId:function(){return this.getMeta().yAxisID}})}},{25:25,40:40,45:45}],16:[function(t,e,n){"use strict";var i=t(25),a=t(40),r=t(45);i._set("bubble",{hover:{mode:"single"},scales:{xAxes:[{type:"linear",position:"bottom",id:"x-axis-0"}],yAxes:[{type:"linear",position:"left",id:"y-axis-0"}]},tooltips:{callbacks:{title:function(){return""},label:function(t,e){var n=e.datasets[t.datasetIndex].label||"",i=e.datasets[t.datasetIndex].data[t.index];return n+": ("+t.xLabel+", "+t.yLabel+", "+i.r+")"}}}}),e.exports=function(t){t.controllers.bubble=t.DatasetController.extend({dataElementType:a.Point,update:function(t){var e=this,n=e.getMeta().data;r.each(n,function(n,i){e.updateElement(n,i,t)})},updateElement:function(t,e,n){var i=this,a=i.getMeta(),r=t.custom||{},o=i.getScaleForId(a.xAxisID),s=i.getScaleForId(a.yAxisID),l=i._resolveElementOptions(t,e),u=i.getDataset().data[e],d=i.index,c=n?o.getPixelForDecimal(.5):o.getPixelForValue("object"==typeof u?u:NaN,e,d),h=n?s.getBasePixel():s.getPixelForValue(u,e,d);t._xScale=o,t._yScale=s,t._options=l,t._datasetIndex=d,t._index=e,t._model={backgroundColor:l.backgroundColor,borderColor:l.borderColor,borderWidth:l.borderWidth,hitRadius:l.hitRadius,pointStyle:l.pointStyle,radius:n?0:l.radius,skip:r.skip||isNaN(c)||isNaN(h),x:c,y:h},t.pivot()},setHoverStyle:function(t){var e=t._model,n=t._options;e.backgroundColor=r.valueOrDefault(n.hoverBackgroundColor,r.getHoverColor(n.backgroundColor)),e.borderColor=r.valueOrDefault(n.hoverBorderColor,r.getHoverColor(n.borderColor)),e.borderWidth=r.valueOrDefault(n.hoverBorderWidth,n.borderWidth),e.radius=n.radius+n.hoverRadius},removeHoverStyle:function(t){var e=t._model,n=t._options;e.backgroundColor=n.backgroundColor,e.borderColor=n.borderColor,e.borderWidth=n.borderWidth,e.radius=n.radius},_resolveElementOptions:function(t,e){var n,i,a,o=this,s=o.chart,l=s.data.datasets[o.index],u=t.custom||{},d=s.options.elements.point,c=r.options.resolve,h=l.data[e],f={},g={chart:s,dataIndex:e,dataset:l,datasetIndex:o.index},m=["backgroundColor","borderColor","borderWidth","hoverBackgroundColor","hoverBorderColor","hoverBorderWidth","hoverRadius","hitRadius","pointStyle"];for(n=0,i=m.length;n<i;++n)f[a=m[n]]=c([u[a],l[a],d[a]],g,e);return f.radius=c([u.radius,h?h.r:void 0,l.radius,d.radius],g,e),f}})}},{25:25,40:40,45:45}],17:[function(t,e,n){"use strict";var i=t(25),a=t(40),r=t(45);i._set("doughnut",{animation:{animateRotate:!0,animateScale:!1},hover:{mode:"single"},legendCallback:function(t){var e=[];e.push('<ul class="'+t.id+'-legend">');var n=t.data,i=n.datasets,a=n.labels;if(i.length)for(var r=0;r<i[0].data.length;++r)e.push('<li><span style="background-color:'+i[0].backgroundColor[r]+'"></span>'),a[r]&&e.push(a[r]),e.push("</li>");return e.push("</ul>"),e.join("")},legend:{labels:{generateLabels:function(t){var e=t.data;return e.labels.length&&e.datasets.length?e.labels.map(function(n,i){var a=t.getDatasetMeta(0),o=e.datasets[0],s=a.data[i],l=s&&s.custom||{},u=r.valueAtIndexOrDefault,d=t.options.elements.arc;return{text:n,fillStyle:l.backgroundColor?l.backgroundColor:u(o.backgroundColor,i,d.backgroundColor),strokeStyle:l.borderColor?l.borderColor:u(o.borderColor,i,d.borderColor),lineWidth:l.borderWidth?l.borderWidth:u(o.borderWidth,i,d.borderWidth),hidden:isNaN(o.data[i])||a.data[i].hidden,index:i}}):[]}},onClick:function(t,e){var n,i,a,r=e.index,o=this.chart;for(n=0,i=(o.data.datasets||[]).length;n<i;++n)(a=o.getDatasetMeta(n)).data[r]&&(a.data[r].hidden=!a.data[r].hidden);o.update()}},cutoutPercentage:50,rotation:-.5*Math.PI,circumference:2*Math.PI,tooltips:{callbacks:{title:function(){return""},label:function(t,e){var n=e.labels[t.index],i=": "+e.datasets[t.datasetIndex].data[t.index];return r.isArray(n)?(n=n.slice())[0]+=i:n+=i,n}}}}),i._set("pie",r.clone(i.doughnut)),i._set("pie",{cutoutPercentage:0}),e.exports=function(t){t.controllers.doughnut=t.controllers.pie=t.DatasetController.extend({dataElementType:a.Arc,linkScales:r.noop,getRingIndex:function(t){for(var e=0,n=0;n<t;++n)this.chart.isDatasetVisible(n)&&++e;return e},update:function(t){var e=this,n=e.chart,i=n.chartArea,a=n.options,o=a.elements.arc,s=i.right-i.left-o.borderWidth,l=i.bottom-i.top-o.borderWidth,u=Math.min(s,l),d={x:0,y:0},c=e.getMeta(),h=a.cutoutPercentage,f=a.circumference;if(f<2*Math.PI){var g=a.rotation%(2*Math.PI),m=(g+=2*Math.PI*(g>=Math.PI?-1:g<-Math.PI?1:0))+f,p={x:Math.cos(g),y:Math.sin(g)},v={x:Math.cos(m),y:Math.sin(m)},y=g<=0&&m>=0||g<=2*Math.PI&&2*Math.PI<=m,b=g<=.5*Math.PI&&.5*Math.PI<=m||g<=2.5*Math.PI&&2.5*Math.PI<=m,x=g<=-Math.PI&&-Math.PI<=m||g<=Math.PI&&Math.PI<=m,_=g<=.5*-Math.PI&&.5*-Math.PI<=m||g<=1.5*Math.PI&&1.5*Math.PI<=m,k=h/100,w={x:x?-1:Math.min(p.x*(p.x<0?1:k),v.x*(v.x<0?1:k)),y:_?-1:Math.min(p.y*(p.y<0?1:k),v.y*(v.y<0?1:k))},M={x:y?1:Math.max(p.x*(p.x>0?1:k),v.x*(v.x>0?1:k)),y:b?1:Math.max(p.y*(p.y>0?1:k),v.y*(v.y>0?1:k))},S={width:.5*(M.x-w.x),height:.5*(M.y-w.y)};u=Math.min(s/S.width,l/S.height),d={x:-.5*(M.x+w.x),y:-.5*(M.y+w.y)}}n.borderWidth=e.getMaxBorderWidth(c.data),n.outerRadius=Math.max((u-n.borderWidth)/2,0),n.innerRadius=Math.max(h?n.outerRadius/100*h:0,0),n.radiusLength=(n.outerRadius-n.innerRadius)/n.getVisibleDatasetCount(),n.offsetX=d.x*n.outerRadius,n.offsetY=d.y*n.outerRadius,c.total=e.calculateTotal(),e.outerRadius=n.outerRadius-n.radiusLength*e.getRingIndex(e.index),e.innerRadius=Math.max(e.outerRadius-n.radiusLength,0),r.each(c.data,function(n,i){e.updateElement(n,i,t)})},updateElement:function(t,e,n){var i=this,a=i.chart,o=a.chartArea,s=a.options,l=s.animation,u=(o.left+o.right)/2,d=(o.top+o.bottom)/2,c=s.rotation,h=s.rotation,f=i.getDataset(),g=n&&l.animateRotate?0:t.hidden?0:i.calculateCircumference(f.data[e])*(s.circumference/(2*Math.PI)),m=n&&l.animateScale?0:i.innerRadius,p=n&&l.animateScale?0:i.outerRadius,v=r.valueAtIndexOrDefault;r.extend(t,{_datasetIndex:i.index,_index:e,_model:{x:u+a.offsetX,y:d+a.offsetY,startAngle:c,endAngle:h,circumference:g,outerRadius:p,innerRadius:m,label:v(f.label,e,a.data.labels[e])}});var y=t._model;this.removeHoverStyle(t),n&&l.animateRotate||(y.startAngle=0===e?s.rotation:i.getMeta().data[e-1]._model.endAngle,y.endAngle=y.startAngle+y.circumference),t.pivot()},removeHoverStyle:function(e){t.DatasetController.prototype.removeHoverStyle.call(this,e,this.chart.options.elements.arc)},calculateTotal:function(){var t,e=this.getDataset(),n=this.getMeta(),i=0;return r.each(n.data,function(n,a){t=e.data[a],isNaN(t)||n.hidden||(i+=Math.abs(t))}),i},calculateCircumference:function(t){var e=this.getMeta().total;return e>0&&!isNaN(t)?2*Math.PI*(t/e):0},getMaxBorderWidth:function(t){for(var e,n,i=0,a=this.index,r=t.length,o=0;o<r;o++)e=t[o]._model?t[o]._model.borderWidth:0,i=(n=t[o]._chart?t[o]._chart.config.data.datasets[a].hoverBorderWidth:0)>(i=e>i?e:i)?n:i;return i}})}},{25:25,40:40,45:45}],18:[function(t,e,n){"use strict";var i=t(25),a=t(40),r=t(45);i._set("line",{showLines:!0,spanGaps:!1,hover:{mode:"label"},scales:{xAxes:[{type:"category",id:"x-axis-0"}],yAxes:[{type:"linear",id:"y-axis-0"}]}}),e.exports=function(t){function e(t,e){return r.valueOrDefault(t.showLine,e.showLines)}t.controllers.line=t.DatasetController.extend({datasetElementType:a.Line,dataElementType:a.Point,update:function(t){var n,i,a,o=this,s=o.getMeta(),l=s.dataset,u=s.data||[],d=o.chart.options,c=d.elements.line,h=o.getScaleForId(s.yAxisID),f=o.getDataset(),g=e(f,d);for(g&&(a=l.custom||{},void 0!==f.tension&&void 0===f.lineTension&&(f.lineTension=f.tension),l._scale=h,l._datasetIndex=o.index,l._children=u,l._model={spanGaps:f.spanGaps?f.spanGaps:d.spanGaps,tension:a.tension?a.tension:r.valueOrDefault(f.lineTension,c.tension),backgroundColor:a.backgroundColor?a.backgroundColor:f.backgroundColor||c.backgroundColor,borderWidth:a.borderWidth?a.borderWidth:f.borderWidth||c.borderWidth,borderColor:a.borderColor?a.borderColor:f.borderColor||c.borderColor,borderCapStyle:a.borderCapStyle?a.borderCapStyle:f.borderCapStyle||c.borderCapStyle,borderDash:a.borderDash?a.borderDash:f.borderDash||c.borderDash,borderDashOffset:a.borderDashOffset?a.borderDashOffset:f.borderDashOffset||c.borderDashOffset,borderJoinStyle:a.borderJoinStyle?a.borderJoinStyle:f.borderJoinStyle||c.borderJoinStyle,fill:a.fill?a.fill:void 0!==f.fill?f.fill:c.fill,steppedLine:a.steppedLine?a.steppedLine:r.valueOrDefault(f.steppedLine,c.stepped),cubicInterpolationMode:a.cubicInterpolationMode?a.cubicInterpolationMode:r.valueOrDefault(f.cubicInterpolationMode,c.cubicInterpolationMode)},l.pivot()),n=0,i=u.length;n<i;++n)o.updateElement(u[n],n,t);for(g&&0!==l._model.tension&&o.updateBezierControlPoints(),n=0,i=u.length;n<i;++n)u[n].pivot()},getPointBackgroundColor:function(t,e){var n=this.chart.options.elements.point.backgroundColor,i=this.getDataset(),a=t.custom||{};return a.backgroundColor?n=a.backgroundColor:i.pointBackgroundColor?n=r.valueAtIndexOrDefault(i.pointBackgroundColor,e,n):i.backgroundColor&&(n=i.backgroundColor),n},getPointBorderColor:function(t,e){var n=this.chart.options.elements.point.borderColor,i=this.getDataset(),a=t.custom||{};return a.borderColor?n=a.borderColor:i.pointBorderColor?n=r.valueAtIndexOrDefault(i.pointBorderColor,e,n):i.borderColor&&(n=i.borderColor),n},getPointBorderWidth:function(t,e){var n=this.chart.options.elements.point.borderWidth,i=this.getDataset(),a=t.custom||{};return isNaN(a.borderWidth)?!isNaN(i.pointBorderWidth)||r.isArray(i.pointBorderWidth)?n=r.valueAtIndexOrDefault(i.pointBorderWidth,e,n):isNaN(i.borderWidth)||(n=i.borderWidth):n=a.borderWidth,n},updateElement:function(t,e,n){var i,a,o=this,s=o.getMeta(),l=t.custom||{},u=o.getDataset(),d=o.index,c=u.data[e],h=o.getScaleForId(s.yAxisID),f=o.getScaleForId(s.xAxisID),g=o.chart.options.elements.point;void 0!==u.radius&&void 0===u.pointRadius&&(u.pointRadius=u.radius),void 0!==u.hitRadius&&void 0===u.pointHitRadius&&(u.pointHitRadius=u.hitRadius),i=f.getPixelForValue("object"==typeof c?c:NaN,e,d),a=n?h.getBasePixel():o.calculatePointY(c,e,d),t._xScale=f,t._yScale=h,t._datasetIndex=d,t._index=e,t._model={x:i,y:a,skip:l.skip||isNaN(i)||isNaN(a),radius:l.radius||r.valueAtIndexOrDefault(u.pointRadius,e,g.radius),pointStyle:l.pointStyle||r.valueAtIndexOrDefault(u.pointStyle,e,g.pointStyle),backgroundColor:o.getPointBackgroundColor(t,e),borderColor:o.getPointBorderColor(t,e),borderWidth:o.getPointBorderWidth(t,e),tension:s.dataset._model?s.dataset._model.tension:0,steppedLine:!!s.dataset._model&&s.dataset._model.steppedLine,hitRadius:l.hitRadius||r.valueAtIndexOrDefault(u.pointHitRadius,e,g.hitRadius)}},calculatePointY:function(t,e,n){var i,a,r,o=this,s=o.chart,l=o.getMeta(),u=o.getScaleForId(l.yAxisID),d=0,c=0;if(u.options.stacked){for(i=0;i<n;i++)if(a=s.data.datasets[i],"line"===(r=s.getDatasetMeta(i)).type&&r.yAxisID===u.id&&s.isDatasetVisible(i)){var h=Number(u.getRightValue(a.data[e]));h<0?c+=h||0:d+=h||0}var f=Number(u.getRightValue(t));return f<0?u.getPixelForValue(c+f):u.getPixelForValue(d+f)}return u.getPixelForValue(t)},updateBezierControlPoints:function(){function t(t,e,n){return Math.max(Math.min(t,n),e)}var e,n,i,a,o=this,s=o.getMeta(),l=o.chart.chartArea,u=s.data||[];if(s.dataset._model.spanGaps&&(u=u.filter(function(t){return!t._model.skip})),"monotone"===s.dataset._model.cubicInterpolationMode)r.splineCurveMonotone(u);else for(e=0,n=u.length;e<n;++e)i=u[e]._model,a=r.splineCurve(r.previousItem(u,e)._model,i,r.nextItem(u,e)._model,s.dataset._model.tension),i.controlPointPreviousX=a.previous.x,i.controlPointPreviousY=a.previous.y,i.controlPointNextX=a.next.x,i.controlPointNextY=a.next.y;if(o.chart.options.elements.line.capBezierPoints)for(e=0,n=u.length;e<n;++e)(i=u[e]._model).controlPointPreviousX=t(i.controlPointPreviousX,l.left,l.right),i.controlPointPreviousY=t(i.controlPointPreviousY,l.top,l.bottom),i.controlPointNextX=t(i.controlPointNextX,l.left,l.right),i.controlPointNextY=t(i.controlPointNextY,l.top,l.bottom)},draw:function(){var t=this,n=t.chart,i=t.getMeta(),a=i.data||[],o=n.chartArea,s=a.length,l=0;for(r.canvas.clipArea(n.ctx,o),e(t.getDataset(),n.options)&&i.dataset.draw(),r.canvas.unclipArea(n.ctx);l<s;++l)a[l].draw(o)},setHoverStyle:function(t){var e=this.chart.data.datasets[t._datasetIndex],n=t._index,i=t.custom||{},a=t._model;a.radius=i.hoverRadius||r.valueAtIndexOrDefault(e.pointHoverRadius,n,this.chart.options.elements.point.hoverRadius),a.backgroundColor=i.hoverBackgroundColor||r.valueAtIndexOrDefault(e.pointHoverBackgroundColor,n,r.getHoverColor(a.backgroundColor)),a.borderColor=i.hoverBorderColor||r.valueAtIndexOrDefault(e.pointHoverBorderColor,n,r.getHoverColor(a.borderColor)),a.borderWidth=i.hoverBorderWidth||r.valueAtIndexOrDefault(e.pointHoverBorderWidth,n,a.borderWidth)},removeHoverStyle:function(t){var e=this,n=e.chart.data.datasets[t._datasetIndex],i=t._index,a=t.custom||{},o=t._model;void 0!==n.radius&&void 0===n.pointRadius&&(n.pointRadius=n.radius),o.radius=a.radius||r.valueAtIndexOrDefault(n.pointRadius,i,e.chart.options.elements.point.radius),o.backgroundColor=e.getPointBackgroundColor(t,i),o.borderColor=e.getPointBorderColor(t,i),o.borderWidth=e.getPointBorderWidth(t,i)}})}},{25:25,40:40,45:45}],19:[function(t,e,n){"use strict";var i=t(25),a=t(40),r=t(45);i._set("polarArea",{scale:{type:"radialLinear",angleLines:{display:!1},gridLines:{circular:!0},pointLabels:{display:!1},ticks:{beginAtZero:!0}},animation:{animateRotate:!0,animateScale:!0},startAngle:-.5*Math.PI,legendCallback:function(t){var e=[];e.push('<ul class="'+t.id+'-legend">');var n=t.data,i=n.datasets,a=n.labels;if(i.length)for(var r=0;r<i[0].data.length;++r)e.push('<li><span style="background-color:'+i[0].backgroundColor[r]+'"></span>'),a[r]&&e.push(a[r]),e.push("</li>");return e.push("</ul>"),e.join("")},legend:{labels:{generateLabels:function(t){var e=t.data;return e.labels.length&&e.datasets.length?e.labels.map(function(n,i){var a=t.getDatasetMeta(0),o=e.datasets[0],s=a.data[i].custom||{},l=r.valueAtIndexOrDefault,u=t.options.elements.arc;return{text:n,fillStyle:s.backgroundColor?s.backgroundColor:l(o.backgroundColor,i,u.backgroundColor),strokeStyle:s.borderColor?s.borderColor:l(o.borderColor,i,u.borderColor),lineWidth:s.borderWidth?s.borderWidth:l(o.borderWidth,i,u.borderWidth),hidden:isNaN(o.data[i])||a.data[i].hidden,index:i}}):[]}},onClick:function(t,e){var n,i,a,r=e.index,o=this.chart;for(n=0,i=(o.data.datasets||[]).length;n<i;++n)(a=o.getDatasetMeta(n)).data[r].hidden=!a.data[r].hidden;o.update()}},tooltips:{callbacks:{title:function(){return""},label:function(t,e){return e.labels[t.index]+": "+t.yLabel}}}}),e.exports=function(t){t.controllers.polarArea=t.DatasetController.extend({dataElementType:a.Arc,linkScales:r.noop,update:function(t){var e=this,n=e.chart,i=n.chartArea,a=e.getMeta(),o=n.options,s=o.elements.arc,l=Math.min(i.right-i.left,i.bottom-i.top);n.outerRadius=Math.max((l-s.borderWidth/2)/2,0),n.innerRadius=Math.max(o.cutoutPercentage?n.outerRadius/100*o.cutoutPercentage:1,0),n.radiusLength=(n.outerRadius-n.innerRadius)/n.getVisibleDatasetCount(),e.outerRadius=n.outerRadius-n.radiusLength*e.index,e.innerRadius=e.outerRadius-n.radiusLength,a.count=e.countVisibleElements(),r.each(a.data,function(n,i){e.updateElement(n,i,t)})},updateElement:function(t,e,n){for(var i=this,a=i.chart,o=i.getDataset(),s=a.options,l=s.animation,u=a.scale,d=a.data.labels,c=i.calculateCircumference(o.data[e]),h=u.xCenter,f=u.yCenter,g=0,m=i.getMeta(),p=0;p<e;++p)isNaN(o.data[p])||m.data[p].hidden||++g;var v=s.startAngle,y=t.hidden?0:u.getDistanceFromCenterForValue(o.data[e]),b=v+c*g,x=b+(t.hidden?0:c),_=l.animateScale?0:u.getDistanceFromCenterForValue(o.data[e]);r.extend(t,{_datasetIndex:i.index,_index:e,_scale:u,_model:{x:h,y:f,innerRadius:0,outerRadius:n?_:y,startAngle:n&&l.animateRotate?v:b,endAngle:n&&l.animateRotate?v:x,label:r.valueAtIndexOrDefault(d,e,d[e])}}),i.removeHoverStyle(t),t.pivot()},removeHoverStyle:function(e){t.DatasetController.prototype.removeHoverStyle.call(this,e,this.chart.options.elements.arc)},countVisibleElements:function(){var t=this.getDataset(),e=this.getMeta(),n=0;return r.each(e.data,function(e,i){isNaN(t.data[i])||e.hidden||n++}),n},calculateCircumference:function(t){var e=this.getMeta().count;return e>0&&!isNaN(t)?2*Math.PI/e:0}})}},{25:25,40:40,45:45}],20:[function(t,e,n){"use strict";var i=t(25),a=t(40),r=t(45);i._set("radar",{scale:{type:"radialLinear"},elements:{line:{tension:0}}}),e.exports=function(t){t.controllers.radar=t.DatasetController.extend({datasetElementType:a.Line,dataElementType:a.Point,linkScales:r.noop,update:function(t){var e=this,n=e.getMeta(),i=n.dataset,a=n.data,o=i.custom||{},s=e.getDataset(),l=e.chart.options.elements.line,u=e.chart.scale;void 0!==s.tension&&void 0===s.lineTension&&(s.lineTension=s.tension),r.extend(n.dataset,{_datasetIndex:e.index,_scale:u,_children:a,_loop:!0,_model:{tension:o.tension?o.tension:r.valueOrDefault(s.lineTension,l.tension),backgroundColor:o.backgroundColor?o.backgroundColor:s.backgroundColor||l.backgroundColor,borderWidth:o.borderWidth?o.borderWidth:s.borderWidth||l.borderWidth,borderColor:o.borderColor?o.borderColor:s.borderColor||l.borderColor,fill:o.fill?o.fill:void 0!==s.fill?s.fill:l.fill,borderCapStyle:o.borderCapStyle?o.borderCapStyle:s.borderCapStyle||l.borderCapStyle,borderDash:o.borderDash?o.borderDash:s.borderDash||l.borderDash,borderDashOffset:o.borderDashOffset?o.borderDashOffset:s.borderDashOffset||l.borderDashOffset,borderJoinStyle:o.borderJoinStyle?o.borderJoinStyle:s.borderJoinStyle||l.borderJoinStyle}}),n.dataset.pivot(),r.each(a,function(n,i){e.updateElement(n,i,t)},e),e.updateBezierControlPoints()},updateElement:function(t,e,n){var i=this,a=t.custom||{},o=i.getDataset(),s=i.chart.scale,l=i.chart.options.elements.point,u=s.getPointPositionForValue(e,o.data[e]);void 0!==o.radius&&void 0===o.pointRadius&&(o.pointRadius=o.radius),void 0!==o.hitRadius&&void 0===o.pointHitRadius&&(o.pointHitRadius=o.hitRadius),r.extend(t,{_datasetIndex:i.index,_index:e,_scale:s,_model:{x:n?s.xCenter:u.x,y:n?s.yCenter:u.y,tension:a.tension?a.tension:r.valueOrDefault(o.lineTension,i.chart.options.elements.line.tension),radius:a.radius?a.radius:r.valueAtIndexOrDefault(o.pointRadius,e,l.radius),backgroundColor:a.backgroundColor?a.backgroundColor:r.valueAtIndexOrDefault(o.pointBackgroundColor,e,l.backgroundColor),borderColor:a.borderColor?a.borderColor:r.valueAtIndexOrDefault(o.pointBorderColor,e,l.borderColor),borderWidth:a.borderWidth?a.borderWidth:r.valueAtIndexOrDefault(o.pointBorderWidth,e,l.borderWidth),pointStyle:a.pointStyle?a.pointStyle:r.valueAtIndexOrDefault(o.pointStyle,e,l.pointStyle),hitRadius:a.hitRadius?a.hitRadius:r.valueAtIndexOrDefault(o.pointHitRadius,e,l.hitRadius)}}),t._model.skip=a.skip?a.skip:isNaN(t._model.x)||isNaN(t._model.y)},updateBezierControlPoints:function(){var t=this.chart.chartArea,e=this.getMeta();r.each(e.data,function(n,i){var a=n._model,o=r.splineCurve(r.previousItem(e.data,i,!0)._model,a,r.nextItem(e.data,i,!0)._model,a.tension);a.controlPointPreviousX=Math.max(Math.min(o.previous.x,t.right),t.left),a.controlPointPreviousY=Math.max(Math.min(o.previous.y,t.bottom),t.top),a.controlPointNextX=Math.max(Math.min(o.next.x,t.right),t.left),a.controlPointNextY=Math.max(Math.min(o.next.y,t.bottom),t.top),n.pivot()})},setHoverStyle:function(t){var e=this.chart.data.datasets[t._datasetIndex],n=t.custom||{},i=t._index,a=t._model;a.radius=n.hoverRadius?n.hoverRadius:r.valueAtIndexOrDefault(e.pointHoverRadius,i,this.chart.options.elements.point.hoverRadius),a.backgroundColor=n.hoverBackgroundColor?n.hoverBackgroundColor:r.valueAtIndexOrDefault(e.pointHoverBackgroundColor,i,r.getHoverColor(a.backgroundColor)),a.borderColor=n.hoverBorderColor?n.hoverBorderColor:r.valueAtIndexOrDefault(e.pointHoverBorderColor,i,r.getHoverColor(a.borderColor)),a.borderWidth=n.hoverBorderWidth?n.hoverBorderWidth:r.valueAtIndexOrDefault(e.pointHoverBorderWidth,i,a.borderWidth)},removeHoverStyle:function(t){var e=this.chart.data.datasets[t._datasetIndex],n=t.custom||{},i=t._index,a=t._model,o=this.chart.options.elements.point;a.radius=n.radius?n.radius:r.valueAtIndexOrDefault(e.pointRadius,i,o.radius),a.backgroundColor=n.backgroundColor?n.backgroundColor:r.valueAtIndexOrDefault(e.pointBackgroundColor,i,o.backgroundColor),a.borderColor=n.borderColor?n.borderColor:r.valueAtIndexOrDefault(e.pointBorderColor,i,o.borderColor),a.borderWidth=n.borderWidth?n.borderWidth:r.valueAtIndexOrDefault(e.pointBorderWidth,i,o.borderWidth)}})}},{25:25,40:40,45:45}],21:[function(t,e,n){"use strict";t(25)._set("scatter",{hover:{mode:"single"},scales:{xAxes:[{id:"x-axis-1",type:"linear",position:"bottom"}],yAxes:[{id:"y-axis-1",type:"linear",position:"left"}]},showLines:!1,tooltips:{callbacks:{title:function(){return""},label:function(t){return"("+t.xLabel+", "+t.yLabel+")"}}}}),e.exports=function(t){t.controllers.scatter=t.controllers.line}},{25:25}],22:[function(t,e,n){"use strict";var i=t(25),a=t(26),r=t(45);i._set("global",{animation:{duration:1e3,easing:"easeOutQuart",onProgress:r.noop,onComplete:r.noop}}),e.exports=function(t){t.Animation=a.extend({chart:null,currentStep:0,numSteps:60,easing:"",render:null,onAnimationProgress:null,onAnimationComplete:null}),t.animationService={frameDuration:17,animations:[],dropFrames:0,request:null,addAnimation:function(t,e,n,i){var a,r,o=this.animations;for(e.chart=t,i||(t.animating=!0),a=0,r=o.length;a<r;++a)if(o[a].chart===t)return void(o[a]=e);o.push(e),1===o.length&&this.requestAnimationFrame()},cancelAnimation:function(t){var e=r.findIndex(this.animations,function(e){return e.chart===t});-1!==e&&(this.animations.splice(e,1),t.animating=!1)},requestAnimationFrame:function(){var t=this;null===t.request&&(t.request=r.requestAnimFrame.call(window,function(){t.request=null,t.startDigest()}))},startDigest:function(){var t=this,e=Date.now(),n=0;t.dropFrames>1&&(n=Math.floor(t.dropFrames),t.dropFrames=t.dropFrames%1),t.advance(1+n);var i=Date.now();t.dropFrames+=(i-e)/t.frameDuration,t.animations.length>0&&t.requestAnimationFrame()},advance:function(t){for(var e,n,i=this.animations,a=0;a<i.length;)n=(e=i[a]).chart,e.currentStep=(e.currentStep||0)+t,e.currentStep=Math.min(e.currentStep,e.numSteps),r.callback(e.render,[n,e],n),r.callback(e.onAnimationProgress,[e],n),e.currentStep>=e.numSteps?(r.callback(e.onAnimationComplete,[e],n),n.animating=!1,i.splice(a,1)):++a}},Object.defineProperty(t.Animation.prototype,"animationObject",{get:function(){return this}}),Object.defineProperty(t.Animation.prototype,"chartInstance",{get:function(){return this.chart},set:function(t){this.chart=t}})}},{25:25,26:26,45:45}],23:[function(t,e,n){"use strict";var i=t(25),a=t(45),r=t(28),o=t(48);e.exports=function(t){function e(t){var e=(t=t||{}).data=t.data||{};return e.datasets=e.datasets||[],e.labels=e.labels||[],t.options=a.configMerge(i.global,i[t.type],t.options||{}),t}function n(t){var e=t.options;e.scale?t.scale.options=e.scale:e.scales&&e.scales.xAxes.concat(e.scales.yAxes).forEach(function(e){t.scales[e.id].options=e}),t.tooltip._options=e.tooltips}function s(t){return"top"===t||"bottom"===t}var l=t.plugins;t.types={},t.instances={},t.controllers={},a.extend(t.prototype,{construct:function(n,i){var r=this;i=e(i);var s=o.acquireContext(n,i),l=s&&s.canvas,u=l&&l.height,d=l&&l.width;r.id=a.uid(),r.ctx=s,r.canvas=l,r.config=i,r.width=d,r.height=u,r.aspectRatio=u?d/u:null,r.options=i.options,r._bufferedRender=!1,r.chart=r,r.controller=r,t.instances[r.id]=r,Object.defineProperty(r,"data",{get:function(){return r.config.data},set:function(t){r.config.data=t}}),s&&l?(r.initialize(),r.update()):console.error("Failed to create chart: can't acquire context from the given item")},initialize:function(){var t=this;return l.notify(t,"beforeInit"),a.retinaScale(t,t.options.devicePixelRatio),t.bindEvents(),t.options.responsive&&t.resize(!0),t.ensureScalesHaveIDs(),t.buildScales(),t.initToolTip(),l.notify(t,"afterInit"),t},clear:function(){return a.canvas.clear(this),this},stop:function(){return t.animationService.cancelAnimation(this),this},resize:function(t){var e=this,n=e.options,i=e.canvas,r=n.maintainAspectRatio&&e.aspectRatio||null,o=Math.max(0,Math.floor(a.getMaximumWidth(i))),s=Math.max(0,Math.floor(r?o/r:a.getMaximumHeight(i)));if((e.width!==o||e.height!==s)&&(i.width=e.width=o,i.height=e.height=s,i.style.width=o+"px",i.style.height=s+"px",a.retinaScale(e,n.devicePixelRatio),!t)){var u={width:o,height:s};l.notify(e,"resize",[u]),e.options.onResize&&e.options.onResize(e,u),e.stop(),e.update(e.options.responsiveAnimationDuration)}},ensureScalesHaveIDs:function(){var t=this.options,e=t.scales||{},n=t.scale;a.each(e.xAxes,function(t,e){t.id=t.id||"x-axis-"+e}),a.each(e.yAxes,function(t,e){t.id=t.id||"y-axis-"+e}),n&&(n.id=n.id||"scale")},buildScales:function(){var e=this,n=e.options,i=e.scales={},r=[];n.scales&&(r=r.concat((n.scales.xAxes||[]).map(function(t){return{options:t,dtype:"category",dposition:"bottom"}}),(n.scales.yAxes||[]).map(function(t){return{options:t,dtype:"linear",dposition:"left"}}))),n.scale&&r.push({options:n.scale,dtype:"radialLinear",isDefault:!0,dposition:"chartArea"}),a.each(r,function(n){var r=n.options,o=a.valueOrDefault(r.type,n.dtype),l=t.scaleService.getScaleConstructor(o);if(l){s(r.position)!==s(n.dposition)&&(r.position=n.dposition);var u=new l({id:r.id,options:r,ctx:e.ctx,chart:e});i[u.id]=u,u.mergeTicksOptions(),n.isDefault&&(e.scale=u)}}),t.scaleService.addScalesToLayout(this)},buildOrUpdateControllers:function(){var e=this,n=[],i=[];return a.each(e.data.datasets,function(a,r){var o=e.getDatasetMeta(r),s=a.type||e.config.type;if(o.type&&o.type!==s&&(e.destroyDatasetMeta(r),o=e.getDatasetMeta(r)),o.type=s,n.push(o.type),o.controller)o.controller.updateIndex(r);else{var l=t.controllers[o.type];if(void 0===l)throw new Error('"'+o.type+'" is not a chart type.');o.controller=new l(e,r),i.push(o.controller)}},e),i},resetElements:function(){var t=this;a.each(t.data.datasets,function(e,n){t.getDatasetMeta(n).controller.reset()},t)},reset:function(){this.resetElements(),this.tooltip.initialize()},update:function(t){var e=this;if(t&&"object"==typeof t||(t={duration:t,lazy:arguments[1]}),n(e),!1!==l.notify(e,"beforeUpdate")){e.tooltip._data=e.data;var i=e.buildOrUpdateControllers();a.each(e.data.datasets,function(t,n){e.getDatasetMeta(n).controller.buildOrUpdateElements()},e),e.updateLayout(),a.each(i,function(t){t.reset()}),e.updateDatasets(),e.tooltip.initialize(),e.lastActive=[],l.notify(e,"afterUpdate"),e._bufferedRender?e._bufferedRequest={duration:t.duration,easing:t.easing,lazy:t.lazy}:e.render(t)}},updateLayout:function(){var e=this;!1!==l.notify(e,"beforeLayout")&&(t.layoutService.update(this,this.width,this.height),l.notify(e,"afterScaleUpdate"),l.notify(e,"afterLayout"))},updateDatasets:function(){var t=this;if(!1!==l.notify(t,"beforeDatasetsUpdate")){for(var e=0,n=t.data.datasets.length;e<n;++e)t.updateDataset(e);l.notify(t,"afterDatasetsUpdate")}},updateDataset:function(t){var e=this,n=e.getDatasetMeta(t),i={meta:n,index:t};!1!==l.notify(e,"beforeDatasetUpdate",[i])&&(n.controller.update(),l.notify(e,"afterDatasetUpdate",[i]))},render:function(e){var n=this;e&&"object"==typeof e||(e={duration:e,lazy:arguments[1]});var i=e.duration,r=e.lazy;if(!1!==l.notify(n,"beforeRender")){var o=n.options.animation,s=function(t){l.notify(n,"afterRender"),a.callback(o&&o.onComplete,[t],n)};if(o&&(void 0!==i&&0!==i||void 0===i&&0!==o.duration)){var u=new t.Animation({numSteps:(i||o.duration)/16.66,easing:e.easing||o.easing,render:function(t,e){var n=a.easing.effects[e.easing],i=e.currentStep,r=i/e.numSteps;t.draw(n(r),r,i)},onAnimationProgress:o.onProgress,onAnimationComplete:s});t.animationService.addAnimation(n,u,i,r)}else n.draw(),s(new t.Animation({numSteps:0,chart:n}));return n}},draw:function(t){var e=this;e.clear(),a.isNullOrUndef(t)&&(t=1),e.transition(t),!1!==l.notify(e,"beforeDraw",[t])&&(a.each(e.boxes,function(t){t.draw(e.chartArea)},e),e.scale&&e.scale.draw(),e.drawDatasets(t),e._drawTooltip(t),l.notify(e,"afterDraw",[t]))},transition:function(t){for(var e=this,n=0,i=(e.data.datasets||[]).length;n<i;++n)e.isDatasetVisible(n)&&e.getDatasetMeta(n).controller.transition(t);e.tooltip.transition(t)},drawDatasets:function(t){var e=this;if(!1!==l.notify(e,"beforeDatasetsDraw",[t])){for(var n=(e.data.datasets||[]).length-1;n>=0;--n)e.isDatasetVisible(n)&&e.drawDataset(n,t);l.notify(e,"afterDatasetsDraw",[t])}},drawDataset:function(t,e){var n=this,i=n.getDatasetMeta(t),a={meta:i,index:t,easingValue:e};!1!==l.notify(n,"beforeDatasetDraw",[a])&&(i.controller.draw(e),l.notify(n,"afterDatasetDraw",[a]))},_drawTooltip:function(t){var e=this,n=e.tooltip,i={tooltip:n,easingValue:t};!1!==l.notify(e,"beforeTooltipDraw",[i])&&(n.draw(),l.notify(e,"afterTooltipDraw",[i]))},getElementAtEvent:function(t){return r.modes.single(this,t)},getElementsAtEvent:function(t){return r.modes.label(this,t,{intersect:!0})},getElementsAtXAxis:function(t){return r.modes["x-axis"](this,t,{intersect:!0})},getElementsAtEventForMode:function(t,e,n){var i=r.modes[e];return"function"==typeof i?i(this,t,n):[]},getDatasetAtEvent:function(t){return r.modes.dataset(this,t,{intersect:!0})},getDatasetMeta:function(t){var e=this,n=e.data.datasets[t];n._meta||(n._meta={});var i=n._meta[e.id];return i||(i=n._meta[e.id]={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null}),i},getVisibleDatasetCount:function(){for(var t=0,e=0,n=this.data.datasets.length;e<n;++e)this.isDatasetVisible(e)&&t++;return t},isDatasetVisible:function(t){var e=this.getDatasetMeta(t);return"boolean"==typeof e.hidden?!e.hidden:!this.data.datasets[t].hidden},generateLegend:function(){return this.options.legendCallback(this)},destroyDatasetMeta:function(t){var e=this.id,n=this.data.datasets[t],i=n._meta&&n._meta[e];i&&(i.controller.destroy(),delete n._meta[e])},destroy:function(){var e,n,i=this,r=i.canvas;for(i.stop(),e=0,n=i.data.datasets.length;e<n;++e)i.destroyDatasetMeta(e);r&&(i.unbindEvents(),a.canvas.clear(i),o.releaseContext(i.ctx),i.canvas=null,i.ctx=null),l.notify(i,"destroy"),delete t.instances[i.id]},toBase64Image:function(){return this.canvas.toDataURL.apply(this.canvas,arguments)},initToolTip:function(){var e=this;e.tooltip=new t.Tooltip({_chart:e,_chartInstance:e,_data:e.data,_options:e.options.tooltips},e)},bindEvents:function(){var t=this,e=t._listeners={},n=function(){t.eventHandler.apply(t,arguments)};a.each(t.options.events,function(i){o.addEventListener(t,i,n),e[i]=n}),t.options.responsive&&(n=function(){t.resize()},o.addEventListener(t,"resize",n),e.resize=n)},unbindEvents:function(){var t=this,e=t._listeners;e&&(delete t._listeners,a.each(e,function(e,n){o.removeEventListener(t,n,e)}))},updateHoverStyle:function(t,e,n){var i,a,r,o=n?"setHoverStyle":"removeHoverStyle";for(a=0,r=t.length;a<r;++a)(i=t[a])&&this.getDatasetMeta(i._datasetIndex).controller[o](i)},eventHandler:function(t){var e=this,n=e.tooltip;if(!1!==l.notify(e,"beforeEvent",[t])){e._bufferedRender=!0,e._bufferedRequest=null;var i=e.handleEvent(t);i|=n&&n.handleEvent(t),l.notify(e,"afterEvent",[t]);var a=e._bufferedRequest;return a?e.render(a):i&&!e.animating&&(e.stop(),e.render(e.options.hover.animationDuration,!0)),e._bufferedRender=!1,e._bufferedRequest=null,e}},handleEvent:function(t){var e=this,n=e.options||{},i=n.hover,r=!1;return e.lastActive=e.lastActive||[],"mouseout"===t.type?e.active=[]:e.active=e.getElementsAtEventForMode(t,i.mode,i),a.callback(n.onHover||n.hover.onHover,[t.native,e.active],e),"mouseup"!==t.type&&"click"!==t.type||n.onClick&&n.onClick.call(e,t.native,e.active),e.lastActive.length&&e.updateHoverStyle(e.lastActive,i.mode,!1),e.active.length&&i.mode&&e.updateHoverStyle(e.active,i.mode,!0),r=!a.arrayEquals(e.active,e.lastActive),e.lastActive=e.active,r}}),t.Controller=t}},{25:25,28:28,45:45,48:48}],24:[function(t,e,n){"use strict";var i=t(45);e.exports=function(t){function e(t,e){t._chartjs?t._chartjs.listeners.push(e):(Object.defineProperty(t,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),a.forEach(function(e){var n="onData"+e.charAt(0).toUpperCase()+e.slice(1),a=t[e];Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value:function(){var e=Array.prototype.slice.call(arguments),r=a.apply(this,e);return i.each(t._chartjs.listeners,function(t){"function"==typeof t[n]&&t[n].apply(t,e)}),r}})}))}function n(t,e){var n=t._chartjs;if(n){var i=n.listeners,r=i.indexOf(e);-1!==r&&i.splice(r,1),i.length>0||(a.forEach(function(e){delete t[e]}),delete t._chartjs)}}var a=["push","pop","shift","splice","unshift"];t.DatasetController=function(t,e){this.initialize(t,e)},i.extend(t.DatasetController.prototype,{datasetElementType:null,dataElementType:null,initialize:function(t,e){var n=this;n.chart=t,n.index=e,n.linkScales(),n.addElements()},updateIndex:function(t){this.index=t},linkScales:function(){var t=this,e=t.getMeta(),n=t.getDataset();null===e.xAxisID&&(e.xAxisID=n.xAxisID||t.chart.options.scales.xAxes[0].id),null===e.yAxisID&&(e.yAxisID=n.yAxisID||t.chart.options.scales.yAxes[0].id)},getDataset:function(){return this.chart.data.datasets[this.index]},getMeta:function(){return this.chart.getDatasetMeta(this.index)},getScaleForId:function(t){return this.chart.scales[t]},reset:function(){this.update(!0)},destroy:function(){this._data&&n(this._data,this)},createMetaDataset:function(){var t=this,e=t.datasetElementType;return e&&new e({_chart:t.chart,_datasetIndex:t.index})},createMetaData:function(t){var e=this,n=e.dataElementType;return n&&new n({_chart:e.chart,_datasetIndex:e.index,_index:t})},addElements:function(){var t,e,n=this,i=n.getMeta(),a=n.getDataset().data||[],r=i.data;for(t=0,e=a.length;t<e;++t)r[t]=r[t]||n.createMetaData(t);i.dataset=i.dataset||n.createMetaDataset()},addElementAndReset:function(t){var e=this.createMetaData(t);this.getMeta().data.splice(t,0,e),this.updateElement(e,t,!0)},buildOrUpdateElements:function(){var t=this,i=t.getDataset(),a=i.data||(i.data=[]);t._data!==a&&(t._data&&n(t._data,t),e(a,t),t._data=a),t.resyncElements()},update:i.noop,transition:function(t){for(var e=this.getMeta(),n=e.data||[],i=n.length,a=0;a<i;++a)n[a].transition(t);e.dataset&&e.dataset.transition(t)},draw:function(){var t=this.getMeta(),e=t.data||[],n=e.length,i=0;for(t.dataset&&t.dataset.draw();i<n;++i)e[i].draw()},removeHoverStyle:function(t,e){var n=this.chart.data.datasets[t._datasetIndex],a=t._index,r=t.custom||{},o=i.valueAtIndexOrDefault,s=t._model;s.backgroundColor=r.backgroundColor?r.backgroundColor:o(n.backgroundColor,a,e.backgroundColor),s.borderColor=r.borderColor?r.borderColor:o(n.borderColor,a,e.borderColor),s.borderWidth=r.borderWidth?r.borderWidth:o(n.borderWidth,a,e.borderWidth)},setHoverStyle:function(t){var e=this.chart.data.datasets[t._datasetIndex],n=t._index,a=t.custom||{},r=i.valueAtIndexOrDefault,o=i.getHoverColor,s=t._model;s.backgroundColor=a.hoverBackgroundColor?a.hoverBackgroundColor:r(e.hoverBackgroundColor,n,o(s.backgroundColor)),s.borderColor=a.hoverBorderColor?a.hoverBorderColor:r(e.hoverBorderColor,n,o(s.borderColor)),s.borderWidth=a.hoverBorderWidth?a.hoverBorderWidth:r(e.hoverBorderWidth,n,s.borderWidth)},resyncElements:function(){var t=this,e=t.getMeta(),n=t.getDataset().data,i=e.data.length,a=n.length;a<i?e.data.splice(a,i-a):a>i&&t.insertElements(i,a-i)},insertElements:function(t,e){for(var n=0;n<e;++n)this.addElementAndReset(t+n)},onDataPush:function(){this.insertElements(this.getDataset().data.length-1,arguments.length)},onDataPop:function(){this.getMeta().data.pop()},onDataShift:function(){this.getMeta().data.shift()},onDataSplice:function(t,e){this.getMeta().data.splice(t,e),this.insertElements(t,arguments.length-2)},onDataUnshift:function(){this.insertElements(0,arguments.length)}}),t.DatasetController.extend=i.inherits}},{45:45}],25:[function(t,e,n){"use strict";var i=t(45);e.exports={_set:function(t,e){return i.merge(this[t]||(this[t]={}),e)}}},{45:45}],26:[function(t,e,n){"use strict";function i(t,e,n,i){var r,o,s,l,u,d,c,h,f,g=Object.keys(n);for(r=0,o=g.length;r<o;++r)if(s=g[r],d=n[s],e.hasOwnProperty(s)||(e[s]=d),(l=e[s])!==d&&"_"!==s[0]){if(t.hasOwnProperty(s)||(t[s]=l),u=t[s],(c=typeof d)===typeof u)if("string"===c){if((h=a(u)).valid&&(f=a(d)).valid){e[s]=f.mix(h,i).rgbString();continue}}else if("number"===c&&isFinite(u)&&isFinite(d)){e[s]=u+(d-u)*i;continue}e[s]=d}}var a=t(2),r=t(45),o=function(t){r.extend(this,t),this.initialize.apply(this,arguments)};r.extend(o.prototype,{initialize:function(){this.hidden=!1},pivot:function(){var t=this;return t._view||(t._view=r.clone(t._model)),t._start={},t},transition:function(t){var e=this,n=e._model,a=e._start,r=e._view;return n&&1!==t?(r||(r=e._view={}),a||(a=e._start={}),i(a,r,n,t),e):(e._view=n,e._start=null,e)},tooltipPosition:function(){return{x:this._model.x,y:this._model.y}},hasValue:function(){return r.isNumber(this._model.x)&&r.isNumber(this._model.y)}}),o.extend=r.inherits,e.exports=o},{2:2,45:45}],27:[function(t,e,n){"use strict";var i=t(2),a=t(25),r=t(45);e.exports=function(t){function e(t,e,n){var i;return"string"==typeof t?(i=parseInt(t,10),-1!==t.indexOf("%")&&(i=i/100*e.parentNode[n])):i=t,i}function n(t){return void 0!==t&&null!==t&&"none"!==t}function o(t,i,a){var r=document.defaultView,o=t.parentNode,s=r.getComputedStyle(t)[i],l=r.getComputedStyle(o)[i],u=n(s),d=n(l),c=Number.POSITIVE_INFINITY;return u||d?Math.min(u?e(s,t,a):c,d?e(l,o,a):c):"none"}r.configMerge=function(){return r.merge(r.clone(arguments[0]),[].slice.call(arguments,1),{merger:function(e,n,i,a){var o=n[e]||{},s=i[e];"scales"===e?n[e]=r.scaleMerge(o,s):"scale"===e?n[e]=r.merge(o,[t.scaleService.getScaleDefaults(s.type),s]):r._merger(e,n,i,a)}})},r.scaleMerge=function(){return r.merge(r.clone(arguments[0]),[].slice.call(arguments,1),{merger:function(e,n,i,a){if("xAxes"===e||"yAxes"===e){var o,s,l,u=i[e].length;for(n[e]||(n[e]=[]),o=0;o<u;++o)l=i[e][o],s=r.valueOrDefault(l.type,"xAxes"===e?"category":"linear"),o>=n[e].length&&n[e].push({}),!n[e][o].type||l.type&&l.type!==n[e][o].type?r.merge(n[e][o],[t.scaleService.getScaleDefaults(s),l]):r.merge(n[e][o],l)}else r._merger(e,n,i,a)}})},r.where=function(t,e){if(r.isArray(t)&&Array.prototype.filter)return t.filter(e);var n=[];return r.each(t,function(t){e(t)&&n.push(t)}),n},r.findIndex=Array.prototype.findIndex?function(t,e,n){return t.findIndex(e,n)}:function(t,e,n){n=void 0===n?t:n;for(var i=0,a=t.length;i<a;++i)if(e.call(n,t[i],i,t))return i;return-1},r.findNextWhere=function(t,e,n){r.isNullOrUndef(n)&&(n=-1);for(var i=n+1;i<t.length;i++){var a=t[i];if(e(a))return a}},r.findPreviousWhere=function(t,e,n){r.isNullOrUndef(n)&&(n=t.length);for(var i=n-1;i>=0;i--){var a=t[i];if(e(a))return a}},r.isNumber=function(t){return!isNaN(parseFloat(t))&&isFinite(t)},r.almostEquals=function(t,e,n){return Math.abs(t-e)<n},r.almostWhole=function(t,e){var n=Math.round(t);return n-e<t&&n+e>t},r.max=function(t){return t.reduce(function(t,e){return isNaN(e)?t:Math.max(t,e)},Number.NEGATIVE_INFINITY)},r.min=function(t){return t.reduce(function(t,e){return isNaN(e)?t:Math.min(t,e)},Number.POSITIVE_INFINITY)},r.sign=Math.sign?function(t){return Math.sign(t)}:function(t){return 0==(t=+t)||isNaN(t)?t:t>0?1:-1},r.log10=Math.log10?function(t){return Math.log10(t)}:function(t){return Math.log(t)/Math.LN10},r.toRadians=function(t){return t*(Math.PI/180)},r.toDegrees=function(t){return t*(180/Math.PI)},r.getAngleFromPoint=function(t,e){var n=e.x-t.x,i=e.y-t.y,a=Math.sqrt(n*n+i*i),r=Math.atan2(i,n);return r<-.5*Math.PI&&(r+=2*Math.PI),{angle:r,distance:a}},r.distanceBetweenPoints=function(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))},r.aliasPixel=function(t){return t%2==0?0:.5},r.splineCurve=function(t,e,n,i){var a=t.skip?e:t,r=e,o=n.skip?e:n,s=Math.sqrt(Math.pow(r.x-a.x,2)+Math.pow(r.y-a.y,2)),l=Math.sqrt(Math.pow(o.x-r.x,2)+Math.pow(o.y-r.y,2)),u=s/(s+l),d=l/(s+l),c=i*(u=isNaN(u)?0:u),h=i*(d=isNaN(d)?0:d);return{previous:{x:r.x-c*(o.x-a.x),y:r.y-c*(o.y-a.y)},next:{x:r.x+h*(o.x-a.x),y:r.y+h*(o.y-a.y)}}},r.EPSILON=Number.EPSILON||1e-14,r.splineCurveMonotone=function(t){var e,n,i,a,o=(t||[]).map(function(t){return{model:t._model,deltaK:0,mK:0}}),s=o.length;for(e=0;e<s;++e)if(!(i=o[e]).model.skip){if(n=e>0?o[e-1]:null,(a=e<s-1?o[e+1]:null)&&!a.model.skip){var l=a.model.x-i.model.x;i.deltaK=0!==l?(a.model.y-i.model.y)/l:0}!n||n.model.skip?i.mK=i.deltaK:!a||a.model.skip?i.mK=n.deltaK:this.sign(n.deltaK)!==this.sign(i.deltaK)?i.mK=0:i.mK=(n.deltaK+i.deltaK)/2}var u,d,c,h;for(e=0;e<s-1;++e)i=o[e],a=o[e+1],i.model.skip||a.model.skip||(r.almostEquals(i.deltaK,0,this.EPSILON)?i.mK=a.mK=0:(u=i.mK/i.deltaK,d=a.mK/i.deltaK,(h=Math.pow(u,2)+Math.pow(d,2))<=9||(c=3/Math.sqrt(h),i.mK=u*c*i.deltaK,a.mK=d*c*i.deltaK)));var f;for(e=0;e<s;++e)(i=o[e]).model.skip||(n=e>0?o[e-1]:null,a=e<s-1?o[e+1]:null,n&&!n.model.skip&&(f=(i.model.x-n.model.x)/3,i.model.controlPointPreviousX=i.model.x-f,i.model.controlPointPreviousY=i.model.y-f*i.mK),a&&!a.model.skip&&(f=(a.model.x-i.model.x)/3,i.model.controlPointNextX=i.model.x+f,i.model.controlPointNextY=i.model.y+f*i.mK))},r.nextItem=function(t,e,n){return n?e>=t.length-1?t[0]:t[e+1]:e>=t.length-1?t[t.length-1]:t[e+1]},r.previousItem=function(t,e,n){return n?e<=0?t[t.length-1]:t[e-1]:e<=0?t[0]:t[e-1]},r.niceNum=function(t,e){var n=Math.floor(r.log10(t)),i=t/Math.pow(10,n);return(e?i<1.5?1:i<3?2:i<7?5:10:i<=1?1:i<=2?2:i<=5?5:10)*Math.pow(10,n)},r.requestAnimFrame="undefined"==typeof window?function(t){t()}:window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){return window.setTimeout(t,1e3/60)},r.getRelativePosition=function(t,e){var n,i,a=t.originalEvent||t,o=t.currentTarget||t.srcElement,s=o.getBoundingClientRect(),l=a.touches;l&&l.length>0?(n=l[0].clientX,i=l[0].clientY):(n=a.clientX,i=a.clientY);var u=parseFloat(r.getStyle(o,"padding-left")),d=parseFloat(r.getStyle(o,"padding-top")),c=parseFloat(r.getStyle(o,"padding-right")),h=parseFloat(r.getStyle(o,"padding-bottom")),f=s.right-s.left-u-c,g=s.bottom-s.top-d-h;return n=Math.round((n-s.left-u)/f*o.width/e.currentDevicePixelRatio),i=Math.round((i-s.top-d)/g*o.height/e.currentDevicePixelRatio),{x:n,y:i}},r.getConstraintWidth=function(t){return o(t,"max-width","clientWidth")},r.getConstraintHeight=function(t){return o(t,"max-height","clientHeight")},r.getMaximumWidth=function(t){var e=t.parentNode;if(!e)return t.clientWidth;var n=parseInt(r.getStyle(e,"padding-left"),10),i=parseInt(r.getStyle(e,"padding-right"),10),a=e.clientWidth-n-i,o=r.getConstraintWidth(t);return isNaN(o)?a:Math.min(a,o)},r.getMaximumHeight=function(t){var e=t.parentNode;if(!e)return t.clientHeight;var n=parseInt(r.getStyle(e,"padding-top"),10),i=parseInt(r.getStyle(e,"padding-bottom"),10),a=e.clientHeight-n-i,o=r.getConstraintHeight(t);return isNaN(o)?a:Math.min(a,o)},r.getStyle=function(t,e){return t.currentStyle?t.currentStyle[e]:document.defaultView.getComputedStyle(t,null).getPropertyValue(e)},r.retinaScale=function(t,e){var n=t.currentDevicePixelRatio=e||window.devicePixelRatio||1;if(1!==n){var i=t.canvas,a=t.height,r=t.width;i.height=a*n,i.width=r*n,t.ctx.scale(n,n),i.style.height=a+"px",i.style.width=r+"px"}},r.fontString=function(t,e,n){return e+" "+t+"px "+n},r.longestText=function(t,e,n,i){var a=(i=i||{}).data=i.data||{},o=i.garbageCollect=i.garbageCollect||[];i.font!==e&&(a=i.data={},o=i.garbageCollect=[],i.font=e),t.font=e;var s=0;r.each(n,function(e){void 0!==e&&null!==e&&!0!==r.isArray(e)?s=r.measureText(t,a,o,s,e):r.isArray(e)&&r.each(e,function(e){void 0===e||null===e||r.isArray(e)||(s=r.measureText(t,a,o,s,e))})});var l=o.length/2;if(l>n.length){for(var u=0;u<l;u++)delete a[o[u]];o.splice(0,l)}return s},r.measureText=function(t,e,n,i,a){var r=e[a];return r||(r=e[a]=t.measureText(a).width,n.push(a)),r>i&&(i=r),i},r.numberOfLabelLines=function(t){var e=1;return r.each(t,function(t){r.isArray(t)&&t.length>e&&(e=t.length)}),e},r.color=i?function(t){return t instanceof CanvasGradient&&(t=a.global.defaultColor),i(t)}:function(t){return console.error("Color.js not found!"),t},r.getHoverColor=function(t){return t instanceof CanvasPattern?t:r.color(t).saturate(.5).darken(.1).rgbString()}}},{2:2,25:25,45:45}],28:[function(t,e,n){"use strict";function i(t,e){return t.native?{x:t.x,y:t.y}:u.getRelativePosition(t,e)}function a(t,e){var n,i,a,r,o;for(i=0,r=t.data.datasets.length;i<r;++i)if(t.isDatasetVisible(i))for(a=0,o=(n=t.getDatasetMeta(i)).data.length;a<o;++a){var s=n.data[a];s._view.skip||e(s)}}function r(t,e){var n=[];return a(t,function(t){t.inRange(e.x,e.y)&&n.push(t)}),n}function o(t,e,n,i){var r=Number.POSITIVE_INFINITY,o=[];return a(t,function(t){if(!n||t.inRange(e.x,e.y)){var a=t.getCenterPoint(),s=i(e,a);s<r?(o=[t],r=s):s===r&&o.push(t)}}),o}function s(t){var e=-1!==t.indexOf("x"),n=-1!==t.indexOf("y");return function(t,i){var a=e?Math.abs(t.x-i.x):0,r=n?Math.abs(t.y-i.y):0;return Math.sqrt(Math.pow(a,2)+Math.pow(r,2))}}function l(t,e,n){var a=i(e,t);n.axis=n.axis||"x";var l=s(n.axis),u=n.intersect?r(t,a):o(t,a,!1,l),d=[];return u.length?(t.data.datasets.forEach(function(e,n){if(t.isDatasetVisible(n)){var i=t.getDatasetMeta(n).data[u[0]._index];i&&!i._view.skip&&d.push(i)}}),d):[]}var u=t(45);e.exports={modes:{single:function(t,e){var n=i(e,t),r=[];return a(t,function(t){if(t.inRange(n.x,n.y))return r.push(t),r}),r.slice(0,1)},label:l,index:l,dataset:function(t,e,n){var a=i(e,t);n.axis=n.axis||"xy";var l=s(n.axis),u=n.intersect?r(t,a):o(t,a,!1,l);return u.length>0&&(u=t.getDatasetMeta(u[0]._datasetIndex).data),u},"x-axis":function(t,e){return l(t,e,{intersect:!1})},point:function(t,e){return r(t,i(e,t))},nearest:function(t,e,n){var a=i(e,t);n.axis=n.axis||"xy";var r=s(n.axis),l=o(t,a,n.intersect,r);return l.length>1&&l.sort(function(t,e){var n=t.getArea()-e.getArea();return 0===n&&(n=t._datasetIndex-e._datasetIndex),n}),l.slice(0,1)},x:function(t,e,n){var r=i(e,t),o=[],s=!1;return a(t,function(t){t.inXRange(r.x)&&o.push(t),t.inRange(r.x,r.y)&&(s=!0)}),n.intersect&&!s&&(o=[]),o},y:function(t,e,n){var r=i(e,t),o=[],s=!1;return a(t,function(t){t.inYRange(r.y)&&o.push(t),t.inRange(r.x,r.y)&&(s=!0)}),n.intersect&&!s&&(o=[]),o}}}},{45:45}],29:[function(t,e,n){"use strict";t(25)._set("global",{responsive:!0,responsiveAnimationDuration:0,maintainAspectRatio:!0,events:["mousemove","mouseout","click","touchstart","touchmove"],hover:{onHover:null,mode:"nearest",intersect:!0,animationDuration:400},onClick:null,defaultColor:"rgba(0,0,0,0.1)",defaultFontColor:"#666",defaultFontFamily:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",defaultFontSize:12,defaultFontStyle:"normal",showLines:!0,elements:{},layout:{padding:{top:0,right:0,bottom:0,left:0}}}),e.exports=function(){var t=function(t,e){return this.construct(t,e),this};return t.Chart=t,t}},{25:25}],30:[function(t,e,n){"use strict";var i=t(45);e.exports=function(t){function e(t,e){return i.where(t,function(t){return t.position===e})}function n(t,e){t.forEach(function(t,e){return t._tmpIndex_=e,t}),t.sort(function(t,n){var i=e?n:t,a=e?t:n;return i.weight===a.weight?i._tmpIndex_-a._tmpIndex_:i.weight-a.weight}),t.forEach(function(t){delete t._tmpIndex_})}t.layoutService={defaults:{},addBox:function(t,e){t.boxes||(t.boxes=[]),e.fullWidth=e.fullWidth||!1,e.position=e.position||"top",e.weight=e.weight||0,t.boxes.push(e)},removeBox:function(t,e){var n=t.boxes?t.boxes.indexOf(e):-1;-1!==n&&t.boxes.splice(n,1)},configure:function(t,e,n){for(var i,a=["fullWidth","position","weight"],r=a.length,o=0;o<r;++o)i=a[o],n.hasOwnProperty(i)&&(e[i]=n[i])},update:function(t,a,r){function o(t){var e=i.findNextWhere(D,function(e){return e.box===t});if(e)if(t.isHorizontal()){var n={left:Math.max(I,C),right:Math.max(O,P),top:0,bottom:0};t.update(t.fullWidth?b:M,x/2,n)}else t.update(e.minSize.width,S)}function s(t){t.isHorizontal()?(t.left=t.fullWidth?d:I,t.right=t.fullWidth?a-c:I+M,t.top=B,t.bottom=B+t.height,B=t.bottom):(t.left=z,t.right=z+t.width,t.top=F,t.bottom=F+S,z=t.right)}if(t){var l=t.options.layout||{},u=i.options.toPadding(l.padding),d=u.left,c=u.right,h=u.top,f=u.bottom,g=e(t.boxes,"left"),m=e(t.boxes,"right"),p=e(t.boxes,"top"),v=e(t.boxes,"bottom"),y=e(t.boxes,"chartArea");n(g,!0),n(m,!1),n(p,!0),n(v,!1);var b=a-d-c,x=r-h-f,_=x/2,k=(a-b/2)/(g.length+m.length),w=(r-_)/(p.length+v.length),M=b,S=x,D=[];i.each(g.concat(m,p,v),function(t){var e,n=t.isHorizontal();n?(e=t.update(t.fullWidth?b:M,w),S-=e.height):(e=t.update(k,_),M-=e.width),D.push({horizontal:n,minSize:e,box:t})});var C=0,P=0,T=0,A=0;i.each(p.concat(v),function(t){if(t.getPadding){var e=t.getPadding();C=Math.max(C,e.left),P=Math.max(P,e.right)}}),i.each(g.concat(m),function(t){if(t.getPadding){var e=t.getPadding();T=Math.max(T,e.top),A=Math.max(A,e.bottom)}});var I=d,O=c,F=h,R=f;i.each(g.concat(m),o),i.each(g,function(t){I+=t.width}),i.each(m,function(t){O+=t.width}),i.each(p.concat(v),o),i.each(p,function(t){F+=t.height}),i.each(v,function(t){R+=t.height}),i.each(g.concat(m),function(t){var e=i.findNextWhere(D,function(e){return e.box===t}),n={left:0,right:0,top:F,bottom:R};e&&t.update(e.minSize.width,S,n)}),I=d,O=c,F=h,R=f,i.each(g,function(t){I+=t.width}),i.each(m,function(t){O+=t.width}),i.each(p,function(t){F+=t.height}),i.each(v,function(t){R+=t.height});var L=Math.max(C-I,0);I+=L,O+=Math.max(P-O,0);var W=Math.max(T-F,0);F+=W,R+=Math.max(A-R,0);var Y=r-F-R,N=a-I-O;N===M&&Y===S||(i.each(g,function(t){t.height=Y}),i.each(m,function(t){t.height=Y}),i.each(p,function(t){t.fullWidth||(t.width=N)}),i.each(v,function(t){t.fullWidth||(t.width=N)}),S=Y,M=N);var z=d+L,B=h+W;i.each(g.concat(p),s),z+=M,B+=S,i.each(m,s),i.each(v,s),t.chartArea={left:I,top:F,right:I+M,bottom:F+S},i.each(y,function(e){e.left=t.chartArea.left,e.top=t.chartArea.top,e.right=t.chartArea.right,e.bottom=t.chartArea.bottom,e.update(M,S)})}}}}},{45:45}],31:[function(t,e,n){"use strict";var i=t(25),a=t(26),r=t(45);i._set("global",{plugins:{}}),e.exports=function(t){t.plugins={_plugins:[],_cacheId:0,register:function(t){var e=this._plugins;[].concat(t).forEach(function(t){-1===e.indexOf(t)&&e.push(t)}),this._cacheId++},unregister:function(t){var e=this._plugins;[].concat(t).forEach(function(t){var n=e.indexOf(t);-1!==n&&e.splice(n,1)}),this._cacheId++},clear:function(){this._plugins=[],this._cacheId++},count:function(){return this._plugins.length},getAll:function(){return this._plugins},notify:function(t,e,n){var i,a,r,o,s,l=this.descriptors(t),u=l.length;for(i=0;i<u;++i)if(a=l[i],r=a.plugin,"function"==typeof(s=r[e])&&((o=[t].concat(n||[])).push(a.options),!1===s.apply(r,o)))return!1;return!0},descriptors:function(t){var e=t._plugins||(t._plugins={});if(e.id===this._cacheId)return e.descriptors;var n=[],a=[],o=t&&t.config||{},s=o.options&&o.options.plugins||{};return this._plugins.concat(o.plugins||[]).forEach(function(t){if(-1===n.indexOf(t)){var e=t.id,o=s[e];!1!==o&&(!0===o&&(o=r.clone(i.global.plugins[e])),n.push(t),a.push({plugin:t,options:o||{}}))}}),e.descriptors=a,e.id=this._cacheId,a}},t.pluginService=t.plugins,t.PluginBase=a.extend({})}},{25:25,26:26,45:45}],32:[function(t,e,n){"use strict";function i(t){var e,n,i=[];for(e=0,n=t.length;e<n;++e)i.push(t[e].label);return i}function a(t,e,n){var i=t.getPixelForTick(e);return n&&(i-=0===e?(t.getPixelForTick(1)-i)/2:(i-t.getPixelForTick(e-1))/2),i}var r=t(25),o=t(26),s=t(45),l=t(34);r._set("scale",{display:!0,position:"left",offset:!1,gridLines:{display:!0,color:"rgba(0, 0, 0, 0.1)",lineWidth:1,drawBorder:!0,drawOnChartArea:!0,drawTicks:!0,tickMarkLength:10,zeroLineWidth:1,zeroLineColor:"rgba(0,0,0,0.25)",zeroLineBorderDash:[],zeroLineBorderDashOffset:0,offsetGridLines:!1,borderDash:[],borderDashOffset:0},scaleLabel:{display:!1,labelString:"",lineHeight:1.2,padding:{top:4,bottom:4}},ticks:{beginAtZero:!1,minRotation:0,maxRotation:50,mirror:!1,padding:0,reverse:!1,display:!0,autoSkip:!0,autoSkipPadding:0,labelOffset:0,callback:l.formatters.values,minor:{},major:{}}}),e.exports=function(t){function e(t,e,n){return s.isArray(e)?s.longestText(t,n,e):t.measureText(e).width}function n(t){var e=s.valueOrDefault,n=r.global,i=e(t.fontSize,n.defaultFontSize),a=e(t.fontStyle,n.defaultFontStyle),o=e(t.fontFamily,n.defaultFontFamily);return{size:i,style:a,family:o,font:s.fontString(i,a,o)}}function l(t){return s.options.toLineHeight(s.valueOrDefault(t.lineHeight,1.2),s.valueOrDefault(t.fontSize,r.global.defaultFontSize))}t.Scale=o.extend({getPadding:function(){var t=this;return{left:t.paddingLeft||0,top:t.paddingTop||0,right:t.paddingRight||0,bottom:t.paddingBottom||0}},getTicks:function(){return this._ticks},mergeTicksOptions:function(){var t=this.options.ticks;!1===t.minor&&(t.minor={display:!1}),!1===t.major&&(t.major={display:!1});for(var e in t)"major"!==e&&"minor"!==e&&(void 0===t.minor[e]&&(t.minor[e]=t[e]),void 0===t.major[e]&&(t.major[e]=t[e]))},beforeUpdate:function(){s.callback(this.options.beforeUpdate,[this])},update:function(t,e,n){var i,a,r,o,l,u,d=this;for(d.beforeUpdate(),d.maxWidth=t,d.maxHeight=e,d.margins=s.extend({left:0,right:0,top:0,bottom:0},n),d.longestTextCache=d.longestTextCache||{},d.beforeSetDimensions(),d.setDimensions(),d.afterSetDimensions(),d.beforeDataLimits(),d.determineDataLimits(),d.afterDataLimits(),d.beforeBuildTicks(),l=d.buildTicks()||[],d.afterBuildTicks(),d.beforeTickToLabelConversion(),r=d.convertTicksToLabels(l)||d.ticks,d.afterTickToLabelConversion(),d.ticks=r,i=0,a=r.length;i<a;++i)o=r[i],(u=l[i])?u.label=o:l.push(u={label:o,major:!1});return d._ticks=l,d.beforeCalculateTickRotation(),d.calculateTickRotation(),d.afterCalculateTickRotation(),d.beforeFit(),d.fit(),d.afterFit(),d.afterUpdate(),d.minSize},afterUpdate:function(){s.callback(this.options.afterUpdate,[this])},beforeSetDimensions:function(){s.callback(this.options.beforeSetDimensions,[this])},setDimensions:function(){var t=this;t.isHorizontal()?(t.width=t.maxWidth,t.left=0,t.right=t.width):(t.height=t.maxHeight,t.top=0,t.bottom=t.height),t.paddingLeft=0,t.paddingTop=0,t.paddingRight=0,t.paddingBottom=0},afterSetDimensions:function(){s.callback(this.options.afterSetDimensions,[this])},beforeDataLimits:function(){s.callback(this.options.beforeDataLimits,[this])},determineDataLimits:s.noop,afterDataLimits:function(){s.callback(this.options.afterDataLimits,[this])},beforeBuildTicks:function(){s.callback(this.options.beforeBuildTicks,[this])},buildTicks:s.noop,afterBuildTicks:function(){s.callback(this.options.afterBuildTicks,[this])},beforeTickToLabelConversion:function(){s.callback(this.options.beforeTickToLabelConversion,[this])},convertTicksToLabels:function(){var t=this,e=t.options.ticks;t.ticks=t.ticks.map(e.userCallback||e.callback,this)},afterTickToLabelConversion:function(){s.callback(this.options.afterTickToLabelConversion,[this])},beforeCalculateTickRotation:function(){s.callback(this.options.beforeCalculateTickRotation,[this])},calculateTickRotation:function(){var t=this,e=t.ctx,a=t.options.ticks,r=i(t._ticks),o=n(a);e.font=o.font;var l=a.minRotation||0;if(r.length&&t.options.display&&t.isHorizontal())for(var u,d=s.longestText(e,o.font,r,t.longestTextCache),c=d,h=t.getPixelForTick(1)-t.getPixelForTick(0)-6;c>h&&l<a.maxRotation;){var f=s.toRadians(l);if(u=Math.cos(f),Math.sin(f)*d>t.maxHeight){l--;break}l++,c=u*d}t.labelRotation=l},afterCalculateTickRotation:function(){s.callback(this.options.afterCalculateTickRotation,[this])},beforeFit:function(){s.callback(this.options.beforeFit,[this])},fit:function(){var t=this,a=t.minSize={width:0,height:0},r=i(t._ticks),o=t.options,u=o.ticks,d=o.scaleLabel,c=o.gridLines,h=o.display,f=t.isHorizontal(),g=n(u),m=o.gridLines.tickMarkLength;if(a.width=f?t.isFullWidth()?t.maxWidth-t.margins.left-t.margins.right:t.maxWidth:h&&c.drawTicks?m:0,a.height=f?h&&c.drawTicks?m:0:t.maxHeight,d.display&&h){var p=l(d)+s.options.toPadding(d.padding).height;f?a.height+=p:a.width+=p}if(u.display&&h){var v=s.longestText(t.ctx,g.font,r,t.longestTextCache),y=s.numberOfLabelLines(r),b=.5*g.size,x=t.options.ticks.padding;if(f){t.longestLabelWidth=v;var _=s.toRadians(t.labelRotation),k=Math.cos(_),w=Math.sin(_)*v+g.size*y+b*(y-1)+b;a.height=Math.min(t.maxHeight,a.height+w+x),t.ctx.font=g.font;var M=e(t.ctx,r[0],g.font),S=e(t.ctx,r[r.length-1],g.font);0!==t.labelRotation?(t.paddingLeft="bottom"===o.position?k*M+3:k*b+3,t.paddingRight="bottom"===o.position?k*b+3:k*S+3):(t.paddingLeft=M/2+3,t.paddingRight=S/2+3)}else u.mirror?v=0:v+=x+b,a.width=Math.min(t.maxWidth,a.width+v),t.paddingTop=g.size/2,t.paddingBottom=g.size/2}t.handleMargins(),t.width=a.width,t.height=a.height},handleMargins:function(){var t=this;t.margins&&(t.paddingLeft=Math.max(t.paddingLeft-t.margins.left,0),t.paddingTop=Math.max(t.paddingTop-t.margins.top,0),t.paddingRight=Math.max(t.paddingRight-t.margins.right,0),t.paddingBottom=Math.max(t.paddingBottom-t.margins.bottom,0))},afterFit:function(){s.callback(this.options.afterFit,[this])},isHorizontal:function(){return"top"===this.options.position||"bottom"===this.options.position},isFullWidth:function(){return this.options.fullWidth},getRightValue:function(t){if(s.isNullOrUndef(t))return NaN;if("number"==typeof t&&!isFinite(t))return NaN;if(t)if(this.isHorizontal()){if(void 0!==t.x)return this.getRightValue(t.x)}else if(void 0!==t.y)return this.getRightValue(t.y);return t},getLabelForIndex:s.noop,getPixelForValue:s.noop,getValueForPixel:s.noop,getPixelForTick:function(t){var e=this,n=e.options.offset;if(e.isHorizontal()){var i=(e.width-(e.paddingLeft+e.paddingRight))/Math.max(e._ticks.length-(n?0:1),1),a=i*t+e.paddingLeft;n&&(a+=i/2);var r=e.left+Math.round(a);return r+=e.isFullWidth()?e.margins.left:0}var o=e.height-(e.paddingTop+e.paddingBottom);return e.top+t*(o/(e._ticks.length-1))},getPixelForDecimal:function(t){var e=this;if(e.isHorizontal()){var n=(e.width-(e.paddingLeft+e.paddingRight))*t+e.paddingLeft,i=e.left+Math.round(n);return i+=e.isFullWidth()?e.margins.left:0}return e.top+t*e.height},getBasePixel:function(){return this.getPixelForValue(this.getBaseValue())},getBaseValue:function(){var t=this,e=t.min,n=t.max;return t.beginAtZero?0:e<0&&n<0?n:e>0&&n>0?e:0},_autoSkip:function(t){var e,n,i,a,r=this,o=r.isHorizontal(),l=r.options.ticks.minor,u=t.length,d=s.toRadians(r.labelRotation),c=Math.cos(d),h=r.longestLabelWidth*c,f=[];for(l.maxTicksLimit&&(a=l.maxTicksLimit),o&&(e=!1,(h+l.autoSkipPadding)*u>r.width-(r.paddingLeft+r.paddingRight)&&(e=1+Math.floor((h+l.autoSkipPadding)*u/(r.width-(r.paddingLeft+r.paddingRight)))),a&&u>a&&(e=Math.max(e,Math.floor(u/a)))),n=0;n<u;n++)i=t[n],(e>1&&n%e>0||n%e==0&&n+e>=u)&&n!==u-1&&delete i.label,f.push(i);return f},draw:function(t){var e=this,i=e.options;if(i.display){var o=e.ctx,u=r.global,d=i.ticks.minor,c=i.ticks.major||d,h=i.gridLines,f=i.scaleLabel,g=0!==e.labelRotation,m=e.isHorizontal(),p=d.autoSkip?e._autoSkip(e.getTicks()):e.getTicks(),v=s.valueOrDefault(d.fontColor,u.defaultFontColor),y=n(d),b=s.valueOrDefault(c.fontColor,u.defaultFontColor),x=n(c),_=h.drawTicks?h.tickMarkLength:0,k=s.valueOrDefault(f.fontColor,u.defaultFontColor),w=n(f),M=s.options.toPadding(f.padding),S=s.toRadians(e.labelRotation),D=[],C="right"===i.position?e.left:e.right-_,P="right"===i.position?e.left+_:e.right,T="bottom"===i.position?e.top:e.bottom-_,A="bottom"===i.position?e.top+_:e.bottom;if(s.each(p,function(n,r){if(!s.isNullOrUndef(n.label)){var o,l,c,f,v=n.label;r===e.zeroLineIndex&&i.offset===h.offsetGridLines?(o=h.zeroLineWidth,l=h.zeroLineColor,c=h.zeroLineBorderDash,f=h.zeroLineBorderDashOffset):(o=s.valueAtIndexOrDefault(h.lineWidth,r),l=s.valueAtIndexOrDefault(h.color,r),c=s.valueOrDefault(h.borderDash,u.borderDash),f=s.valueOrDefault(h.borderDashOffset,u.borderDashOffset));var y,b,x,k,w,M,I,O,F,R,L="middle",W="middle",Y=d.padding;if(m){var N=_+Y;"bottom"===i.position?(W=g?"middle":"top",L=g?"right":"center",R=e.top+N):(W=g?"middle":"bottom",L=g?"left":"center",R=e.bottom-N);var z=a(e,r,h.offsetGridLines&&p.length>1);z<e.left&&(l="rgba(0,0,0,0)"),z+=s.aliasPixel(o),F=e.getPixelForTick(r)+d.labelOffset,y=x=w=I=z,b=T,k=A,M=t.top,O=t.bottom}else{var B,V="left"===i.position;d.mirror?(L=V?"left":"right",B=Y):(L=V?"right":"left",B=_+Y),F=V?e.right-B:e.left+B;var H=a(e,r,h.offsetGridLines&&p.length>1);H<e.top&&(l="rgba(0,0,0,0)"),H+=s.aliasPixel(o),R=e.getPixelForTick(r)+d.labelOffset,y=C,x=P,w=t.left,I=t.right,b=k=M=O=H}D.push({tx1:y,ty1:b,tx2:x,ty2:k,x1:w,y1:M,x2:I,y2:O,labelX:F,labelY:R,glWidth:o,glColor:l,glBorderDash:c,glBorderDashOffset:f,rotation:-1*S,label:v,major:n.major,textBaseline:W,textAlign:L})}}),s.each(D,function(t){if(h.display&&(o.save(),o.lineWidth=t.glWidth,o.strokeStyle=t.glColor,o.setLineDash&&(o.setLineDash(t.glBorderDash),o.lineDashOffset=t.glBorderDashOffset),o.beginPath(),h.drawTicks&&(o.moveTo(t.tx1,t.ty1),o.lineTo(t.tx2,t.ty2)),h.drawOnChartArea&&(o.moveTo(t.x1,t.y1),o.lineTo(t.x2,t.y2)),o.stroke(),o.restore()),d.display){o.save(),o.translate(t.labelX,t.labelY),o.rotate(t.rotation),o.font=t.major?x.font:y.font,o.fillStyle=t.major?b:v,o.textBaseline=t.textBaseline,o.textAlign=t.textAlign;var e=t.label;if(s.isArray(e))for(var n=0,i=0;n<e.length;++n)o.fillText(""+e[n],0,i),i+=1.5*y.size;else o.fillText(e,0,0);o.restore()}}),f.display){var I,O,F=0,R=l(f)/2;if(m)I=e.left+(e.right-e.left)/2,O="bottom"===i.position?e.bottom-R-M.bottom:e.top+R+M.top;else{var L="left"===i.position;I=L?e.left+R+M.top:e.right-R-M.top,O=e.top+(e.bottom-e.top)/2,F=L?-.5*Math.PI:.5*Math.PI}o.save(),o.translate(I,O),o.rotate(F),o.textAlign="center",o.textBaseline="middle",o.fillStyle=k,o.font=w.font,o.fillText(f.labelString,0,0),o.restore()}if(h.drawBorder){o.lineWidth=s.valueAtIndexOrDefault(h.lineWidth,0),o.strokeStyle=s.valueAtIndexOrDefault(h.color,0);var W=e.left,Y=e.right,N=e.top,z=e.bottom,B=s.aliasPixel(o.lineWidth);m?(N=z="top"===i.position?e.bottom:e.top,N+=B,z+=B):(W=Y="left"===i.position?e.right:e.left,W+=B,Y+=B),o.beginPath(),o.moveTo(W,N),o.lineTo(Y,z),o.stroke()}}}})}},{25:25,26:26,34:34,45:45}],33:[function(t,e,n){"use strict";var i=t(25),a=t(45);e.exports=function(t){t.scaleService={constructors:{},defaults:{},registerScaleType:function(t,e,n){this.constructors[t]=e,this.defaults[t]=a.clone(n)},getScaleConstructor:function(t){return this.constructors.hasOwnProperty(t)?this.constructors[t]:void 0},getScaleDefaults:function(t){return this.defaults.hasOwnProperty(t)?a.merge({},[i.scale,this.defaults[t]]):{}},updateScaleDefaults:function(t,e){var n=this;n.defaults.hasOwnProperty(t)&&(n.defaults[t]=a.extend(n.defaults[t],e))},addScalesToLayout:function(e){a.each(e.scales,function(n){n.fullWidth=n.options.fullWidth,n.position=n.options.position,n.weight=n.options.weight,t.layoutService.addBox(e,n)})}}}},{25:25,45:45}],34:[function(t,e,n){"use strict";var i=t(45);e.exports={generators:{linear:function(t,e){var n,a=[];if(t.stepSize&&t.stepSize>0)n=t.stepSize;else{var r=i.niceNum(e.max-e.min,!1);n=i.niceNum(r/(t.maxTicks-1),!0)}var o=Math.floor(e.min/n)*n,s=Math.ceil(e.max/n)*n;t.min&&t.max&&t.stepSize&&i.almostWhole((t.max-t.min)/t.stepSize,n/1e3)&&(o=t.min,s=t.max);var l=(s-o)/n;l=i.almostEquals(l,Math.round(l),n/1e3)?Math.round(l):Math.ceil(l),a.push(void 0!==t.min?t.min:o);for(var u=1;u<l;++u)a.push(o+u*n);return a.push(void 0!==t.max?t.max:s),a},logarithmic:function(t,e){var n,a,r=[],o=i.valueOrDefault,s=o(t.min,Math.pow(10,Math.floor(i.log10(e.min)))),l=Math.floor(i.log10(e.max)),u=Math.ceil(e.max/Math.pow(10,l));0===s?(n=Math.floor(i.log10(e.minNotZero)),a=Math.floor(e.minNotZero/Math.pow(10,n)),r.push(s),s=a*Math.pow(10,n)):(n=Math.floor(i.log10(s)),a=Math.floor(s/Math.pow(10,n)));do{r.push(s),10===++a&&(a=1,++n),s=a*Math.pow(10,n)}while(n<l||n===l&&a<u);var d=o(t.max,s);return r.push(d),r}},formatters:{values:function(t){return i.isArray(t)?t:""+t},linear:function(t,e,n){var a=n.length>3?n[2]-n[1]:n[1]-n[0];Math.abs(a)>1&&t!==Math.floor(t)&&(a=t-Math.floor(t));var r=i.log10(Math.abs(a)),o="";if(0!==t){var s=-1*Math.floor(r);s=Math.max(Math.min(s,20),0),o=t.toFixed(s)}else o="0";return o},logarithmic:function(t,e,n){var a=t/Math.pow(10,Math.floor(i.log10(t)));return 0===t?"0":1===a||2===a||5===a||0===e||e===n.length-1?t.toExponential():""}}}},{45:45}],35:[function(t,e,n){"use strict";var i=t(25),a=t(26),r=t(45);i._set("global",{tooltips:{enabled:!0,custom:null,mode:"nearest",position:"average",intersect:!0,backgroundColor:"rgba(0,0,0,0.8)",titleFontStyle:"bold",titleSpacing:2,titleMarginBottom:6,titleFontColor:"#fff",titleAlign:"left",bodySpacing:2,bodyFontColor:"#fff",bodyAlign:"left",footerFontStyle:"bold",footerSpacing:2,footerMarginTop:6,footerFontColor:"#fff",footerAlign:"left",yPadding:6,xPadding:6,caretPadding:2,caretSize:5,cornerRadius:6,multiKeyBackground:"#fff",displayColors:!0,borderColor:"rgba(0,0,0,0)",borderWidth:0,callbacks:{beforeTitle:r.noop,title:function(t,e){var n="",i=e.labels,a=i?i.length:0;if(t.length>0){var r=t[0];r.xLabel?n=r.xLabel:a>0&&r.index<a&&(n=i[r.index])}return n},afterTitle:r.noop,beforeBody:r.noop,beforeLabel:r.noop,label:function(t,e){var n=e.datasets[t.datasetIndex].label||"";return n&&(n+=": "),n+=t.yLabel},labelColor:function(t,e){var n=e.getDatasetMeta(t.datasetIndex).data[t.index]._view;return{borderColor:n.borderColor,backgroundColor:n.backgroundColor}},labelTextColor:function(){return this._options.bodyFontColor},afterLabel:r.noop,afterBody:r.noop,beforeFooter:r.noop,footer:r.noop,afterFooter:r.noop}}}),e.exports=function(t){function e(t,e){var n=r.color(t);return n.alpha(e*n.alpha()).rgbaString()}function n(t,e){return e&&(r.isArray(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function o(t){var e=t._xScale,n=t._yScale||t._scale,i=t._index,a=t._datasetIndex;return{xLabel:e?e.getLabelForIndex(i,a):"",yLabel:n?n.getLabelForIndex(i,a):"",index:i,datasetIndex:a,x:t._model.x,y:t._model.y}}function s(t){var e=i.global,n=r.valueOrDefault;return{xPadding:t.xPadding,yPadding:t.yPadding,xAlign:t.xAlign,yAlign:t.yAlign,bodyFontColor:t.bodyFontColor,_bodyFontFamily:n(t.bodyFontFamily,e.defaultFontFamily),_bodyFontStyle:n(t.bodyFontStyle,e.defaultFontStyle),_bodyAlign:t.bodyAlign,bodyFontSize:n(t.bodyFontSize,e.defaultFontSize),bodySpacing:t.bodySpacing,titleFontColor:t.titleFontColor,_titleFontFamily:n(t.titleFontFamily,e.defaultFontFamily),_titleFontStyle:n(t.titleFontStyle,e.defaultFontStyle),titleFontSize:n(t.titleFontSize,e.defaultFontSize),_titleAlign:t.titleAlign,titleSpacing:t.titleSpacing,titleMarginBottom:t.titleMarginBottom,footerFontColor:t.footerFontColor,_footerFontFamily:n(t.footerFontFamily,e.defaultFontFamily),_footerFontStyle:n(t.footerFontStyle,e.defaultFontStyle),footerFontSize:n(t.footerFontSize,e.defaultFontSize),_footerAlign:t.footerAlign,footerSpacing:t.footerSpacing,footerMarginTop:t.footerMarginTop,caretSize:t.caretSize,cornerRadius:t.cornerRadius,backgroundColor:t.backgroundColor,opacity:0,legendColorBackground:t.multiKeyBackground,displayColors:t.displayColors,borderColor:t.borderColor,borderWidth:t.borderWidth}}function l(t,e){var n=t._chart.ctx,i=2*e.yPadding,a=0,o=e.body,s=o.reduce(function(t,e){return t+e.before.length+e.lines.length+e.after.length},0);s+=e.beforeBody.length+e.afterBody.length;var l=e.title.length,u=e.footer.length,d=e.titleFontSize,c=e.bodyFontSize,h=e.footerFontSize;i+=l*d,i+=l?(l-1)*e.titleSpacing:0,i+=l?e.titleMarginBottom:0,i+=s*c,i+=s?(s-1)*e.bodySpacing:0,i+=u?e.footerMarginTop:0,i+=u*h,i+=u?(u-1)*e.footerSpacing:0;var f=0,g=function(t){a=Math.max(a,n.measureText(t).width+f)};return n.font=r.fontString(d,e._titleFontStyle,e._titleFontFamily),r.each(e.title,g),n.font=r.fontString(c,e._bodyFontStyle,e._bodyFontFamily),r.each(e.beforeBody.concat(e.afterBody),g),f=e.displayColors?c+2:0,r.each(o,function(t){r.each(t.before,g),r.each(t.lines,g),r.each(t.after,g)}),f=0,n.font=r.fontString(h,e._footerFontStyle,e._footerFontFamily),r.each(e.footer,g),a+=2*e.xPadding,{width:a,height:i}}function u(t,e){var n=t._model,i=t._chart,a=t._chart.chartArea,r="center",o="center";n.y<e.height?o="top":n.y>i.height-e.height&&(o="bottom");var s,l,u,d,c,h=(a.left+a.right)/2,f=(a.top+a.bottom)/2;"center"===o?(s=function(t){return t<=h},l=function(t){return t>h}):(s=function(t){return t<=e.width/2},l=function(t){return t>=i.width-e.width/2}),u=function(t){return t+e.width>i.width},d=function(t){return t-e.width<0},c=function(t){return t<=f?"top":"bottom"},s(n.x)?(r="left",u(n.x)&&(r="center",o=c(n.y))):l(n.x)&&(r="right",d(n.x)&&(r="center",o=c(n.y)));var g=t._options;return{xAlign:g.xAlign?g.xAlign:r,yAlign:g.yAlign?g.yAlign:o}}function d(t,e,n){var i=t.x,a=t.y,r=t.caretSize,o=t.caretPadding,s=t.cornerRadius,l=n.xAlign,u=n.yAlign,d=r+o,c=s+o;return"right"===l?i-=e.width:"center"===l&&(i-=e.width/2),"top"===u?a+=d:a-="bottom"===u?e.height+d:e.height/2,"center"===u?"left"===l?i+=d:"right"===l&&(i-=d):"left"===l?i-=c:"right"===l&&(i+=c),{x:i,y:a}}t.Tooltip=a.extend({initialize:function(){this._model=s(this._options),this._lastActive=[]},getTitle:function(){var t=this,e=t._options.callbacks,i=e.beforeTitle.apply(t,arguments),a=e.title.apply(t,arguments),r=e.afterTitle.apply(t,arguments),o=[];return o=n(o,i),o=n(o,a),o=n(o,r)},getBeforeBody:function(){var t=this._options.callbacks.beforeBody.apply(this,arguments);return r.isArray(t)?t:void 0!==t?[t]:[]},getBody:function(t,e){var i=this,a=i._options.callbacks,o=[];return r.each(t,function(t){var r={before:[],lines:[],after:[]};n(r.before,a.beforeLabel.call(i,t,e)),n(r.lines,a.label.call(i,t,e)),n(r.after,a.afterLabel.call(i,t,e)),o.push(r)}),o},getAfterBody:function(){var t=this._options.callbacks.afterBody.apply(this,arguments);return r.isArray(t)?t:void 0!==t?[t]:[]},getFooter:function(){var t=this,e=t._options.callbacks,i=e.beforeFooter.apply(t,arguments),a=e.footer.apply(t,arguments),r=e.afterFooter.apply(t,arguments),o=[];return o=n(o,i),o=n(o,a),o=n(o,r)},update:function(e){var n,i,a=this,c=a._options,h=a._model,f=a._model=s(c),g=a._active,m=a._data,p={xAlign:h.xAlign,yAlign:h.yAlign},v={x:h.x,y:h.y},y={width:h.width,height:h.height},b={x:h.caretX,y:h.caretY};if(g.length){f.opacity=1;var x=[],_=[];b=t.Tooltip.positioners[c.position].call(a,g,a._eventPosition);var k=[];for(n=0,i=g.length;n<i;++n)k.push(o(g[n]));c.filter&&(k=k.filter(function(t){return c.filter(t,m)})),c.itemSort&&(k=k.sort(function(t,e){return c.itemSort(t,e,m)})),r.each(k,function(t){x.push(c.callbacks.labelColor.call(a,t,a._chart)),_.push(c.callbacks.labelTextColor.call(a,t,a._chart))}),f.title=a.getTitle(k,m),f.beforeBody=a.getBeforeBody(k,m),f.body=a.getBody(k,m),f.afterBody=a.getAfterBody(k,m),f.footer=a.getFooter(k,m),f.x=Math.round(b.x),f.y=Math.round(b.y),f.caretPadding=c.caretPadding,f.labelColors=x,f.labelTextColors=_,f.dataPoints=k,v=d(f,y=l(this,f),p=u(this,y))}else f.opacity=0;return f.xAlign=p.xAlign,f.yAlign=p.yAlign,f.x=v.x,f.y=v.y,f.width=y.width,f.height=y.height,f.caretX=b.x,f.caretY=b.y,a._model=f,e&&c.custom&&c.custom.call(a,f),a},drawCaret:function(t,e){var n=this._chart.ctx,i=this._view,a=this.getCaretPosition(t,e,i);n.lineTo(a.x1,a.y1),n.lineTo(a.x2,a.y2),n.lineTo(a.x3,a.y3)},getCaretPosition:function(t,e,n){var i,a,r,o,s,l,u=n.caretSize,d=n.cornerRadius,c=n.xAlign,h=n.yAlign,f=t.x,g=t.y,m=e.width,p=e.height;if("center"===h)s=g+p/2,"left"===c?(a=(i=f)-u,r=i,o=s+u,l=s-u):(a=(i=f+m)+u,r=i,o=s-u,l=s+u);else if("left"===c?(i=(a=f+d+u)-u,r=a+u):"right"===c?(i=(a=f+m-d-u)-u,r=a+u):(i=(a=f+m/2)-u,r=a+u),"top"===h)s=(o=g)-u,l=o;else{s=(o=g+p)+u,l=o;var v=r;r=i,i=v}return{x1:i,x2:a,x3:r,y1:o,y2:s,y3:l}},drawTitle:function(t,n,i,a){var o=n.title;if(o.length){i.textAlign=n._titleAlign,i.textBaseline="top";var s=n.titleFontSize,l=n.titleSpacing;i.fillStyle=e(n.titleFontColor,a),i.font=r.fontString(s,n._titleFontStyle,n._titleFontFamily);var u,d;for(u=0,d=o.length;u<d;++u)i.fillText(o[u],t.x,t.y),t.y+=s+l,u+1===o.length&&(t.y+=n.titleMarginBottom-l)}},drawBody:function(t,n,i,a){var o=n.bodyFontSize,s=n.bodySpacing,l=n.body;i.textAlign=n._bodyAlign,i.textBaseline="top",i.font=r.fontString(o,n._bodyFontStyle,n._bodyFontFamily);var u=0,d=function(e){i.fillText(e,t.x+u,t.y),t.y+=o+s};i.fillStyle=e(n.bodyFontColor,a),r.each(n.beforeBody,d);var c=n.displayColors;u=c?o+2:0,r.each(l,function(s,l){var u=e(n.labelTextColors[l],a);i.fillStyle=u,r.each(s.before,d),r.each(s.lines,function(r){c&&(i.fillStyle=e(n.legendColorBackground,a),i.fillRect(t.x,t.y,o,o),i.lineWidth=1,i.strokeStyle=e(n.labelColors[l].borderColor,a),i.strokeRect(t.x,t.y,o,o),i.fillStyle=e(n.labelColors[l].backgroundColor,a),i.fillRect(t.x+1,t.y+1,o-2,o-2),i.fillStyle=u),d(r)}),r.each(s.after,d)}),u=0,r.each(n.afterBody,d),t.y-=s},drawFooter:function(t,n,i,a){var o=n.footer;o.length&&(t.y+=n.footerMarginTop,i.textAlign=n._footerAlign,i.textBaseline="top",i.fillStyle=e(n.footerFontColor,a),i.font=r.fontString(n.footerFontSize,n._footerFontStyle,n._footerFontFamily),r.each(o,function(e){i.fillText(e,t.x,t.y),t.y+=n.footerFontSize+n.footerSpacing}))},drawBackground:function(t,n,i,a,r){i.fillStyle=e(n.backgroundColor,r),i.strokeStyle=e(n.borderColor,r),i.lineWidth=n.borderWidth;var o=n.xAlign,s=n.yAlign,l=t.x,u=t.y,d=a.width,c=a.height,h=n.cornerRadius;i.beginPath(),i.moveTo(l+h,u),"top"===s&&this.drawCaret(t,a),i.lineTo(l+d-h,u),i.quadraticCurveTo(l+d,u,l+d,u+h),"center"===s&&"right"===o&&this.drawCaret(t,a),i.lineTo(l+d,u+c-h),i.quadraticCurveTo(l+d,u+c,l+d-h,u+c),"bottom"===s&&this.drawCaret(t,a),i.lineTo(l+h,u+c),i.quadraticCurveTo(l,u+c,l,u+c-h),"center"===s&&"left"===o&&this.drawCaret(t,a),i.lineTo(l,u+h),i.quadraticCurveTo(l,u,l+h,u),i.closePath(),i.fill(),n.borderWidth>0&&i.stroke()},draw:function(){var t=this._chart.ctx,e=this._view;if(0!==e.opacity){var n={width:e.width,height:e.height},i={x:e.x,y:e.y},a=Math.abs(e.opacity<.001)?0:e.opacity,r=e.title.length||e.beforeBody.length||e.body.length||e.afterBody.length||e.footer.length;this._options.enabled&&r&&(this.drawBackground(i,e,t,n,a),i.x+=e.xPadding,i.y+=e.yPadding,this.drawTitle(i,e,t,a),this.drawBody(i,e,t,a),this.drawFooter(i,e,t,a))}},handleEvent:function(t){var e=this,n=e._options,i=!1;if(e._lastActive=e._lastActive||[],"mouseout"===t.type?e._active=[]:e._active=e._chart.getElementsAtEventForMode(t,n.mode,n),!(i=!r.arrayEquals(e._active,e._lastActive)))return!1;if(e._lastActive=e._active,n.enabled||n.custom){e._eventPosition={x:t.x,y:t.y};var a=e._model;e.update(!0),e.pivot(),i|=a.x!==e._model.x||a.y!==e._model.y}return i}}),t.Tooltip.positioners={average:function(t){if(!t.length)return!1;var e,n,i=0,a=0,r=0;for(e=0,n=t.length;e<n;++e){var o=t[e];if(o&&o.hasValue()){var s=o.tooltipPosition();i+=s.x,a+=s.y,++r}}return{x:Math.round(i/r),y:Math.round(a/r)}},nearest:function(t,e){var n,i,a,o=e.x,s=e.y,l=Number.POSITIVE_INFINITY;for(n=0,i=t.length;n<i;++n){var u=t[n];if(u&&u.hasValue()){var d=u.getCenterPoint(),c=r.distanceBetweenPoints(e,d);c<l&&(l=c,a=u)}}if(a){var h=a.tooltipPosition();o=h.x,s=h.y}return{x:o,y:s}}}}},{25:25,26:26,45:45}],36:[function(t,e,n){"use strict";var i=t(25),a=t(26),r=t(45);i._set("global",{elements:{arc:{backgroundColor:i.global.defaultColor,borderColor:"#fff",borderWidth:2}}}),e.exports=a.extend({inLabelRange:function(t){var e=this._view;return!!e&&Math.pow(t-e.x,2)<Math.pow(e.radius+e.hoverRadius,2)},inRange:function(t,e){var n=this._view;if(n){for(var i=r.getAngleFromPoint(n,{x:t,y:e}),a=i.angle,o=i.distance,s=n.startAngle,l=n.endAngle;l<s;)l+=2*Math.PI;for(;a>l;)a-=2*Math.PI;for(;a<s;)a+=2*Math.PI;var u=a>=s&&a<=l,d=o>=n.innerRadius&&o<=n.outerRadius;return u&&d}return!1},getCenterPoint:function(){var t=this._view,e=(t.startAngle+t.endAngle)/2,n=(t.innerRadius+t.outerRadius)/2;return{x:t.x+Math.cos(e)*n,y:t.y+Math.sin(e)*n}},getArea:function(){var t=this._view;return Math.PI*((t.endAngle-t.startAngle)/(2*Math.PI))*(Math.pow(t.outerRadius,2)-Math.pow(t.innerRadius,2))},tooltipPosition:function(){var t=this._view,e=t.startAngle+(t.endAngle-t.startAngle)/2,n=(t.outerRadius-t.innerRadius)/2+t.innerRadius;return{x:t.x+Math.cos(e)*n,y:t.y+Math.sin(e)*n}},draw:function(){var t=this._chart.ctx,e=this._view,n=e.startAngle,i=e.endAngle;t.beginPath(),t.arc(e.x,e.y,e.outerRadius,n,i),t.arc(e.x,e.y,e.innerRadius,i,n,!0),t.closePath(),t.strokeStyle=e.borderColor,t.lineWidth=e.borderWidth,t.fillStyle=e.backgroundColor,t.fill(),t.lineJoin="bevel",e.borderWidth&&t.stroke()}})},{25:25,26:26,45:45}],37:[function(t,e,n){"use strict";var i=t(25),a=t(26),r=t(45),o=i.global;i._set("global",{elements:{line:{tension:.4,backgroundColor:o.defaultColor,borderWidth:3,borderColor:o.defaultColor,borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",capBezierPoints:!0,fill:!0}}}),e.exports=a.extend({draw:function(){var t,e,n,i,a=this,s=a._view,l=a._chart.ctx,u=s.spanGaps,d=a._children.slice(),c=o.elements.line,h=-1;for(a._loop&&d.length&&d.push(d[0]),l.save(),l.lineCap=s.borderCapStyle||c.borderCapStyle,l.setLineDash&&l.setLineDash(s.borderDash||c.borderDash),l.lineDashOffset=s.borderDashOffset||c.borderDashOffset,l.lineJoin=s.borderJoinStyle||c.borderJoinStyle,l.lineWidth=s.borderWidth||c.borderWidth,l.strokeStyle=s.borderColor||o.defaultColor,l.beginPath(),h=-1,t=0;t<d.length;++t)e=d[t],n=r.previousItem(d,t),i=e._view,0===t?i.skip||(l.moveTo(i.x,i.y),h=t):(n=-1===h?n:d[h],i.skip||(h!==t-1&&!u||-1===h?l.moveTo(i.x,i.y):r.canvas.lineTo(l,n._view,e._view),h=t));l.stroke(),l.restore()}})},{25:25,26:26,45:45}],38:[function(t,e,n){"use strict";function i(t){var e=this._view;return!!e&&Math.pow(t-e.x,2)<Math.pow(e.radius+e.hitRadius,2)}var a=t(25),r=t(26),o=t(45),s=a.global.defaultColor;a._set("global",{elements:{point:{radius:3,pointStyle:"circle",backgroundColor:s,borderColor:s,borderWidth:1,hitRadius:1,hoverRadius:4,hoverBorderWidth:1}}}),e.exports=r.extend({inRange:function(t,e){var n=this._view;return!!n&&Math.pow(t-n.x,2)+Math.pow(e-n.y,2)<Math.pow(n.hitRadius+n.radius,2)},inLabelRange:i,inXRange:i,inYRange:function(t){var e=this._view;return!!e&&Math.pow(t-e.y,2)<Math.pow(e.radius+e.hitRadius,2)},getCenterPoint:function(){var t=this._view;return{x:t.x,y:t.y}},getArea:function(){return Math.PI*Math.pow(this._view.radius,2)},tooltipPosition:function(){var t=this._view;return{x:t.x,y:t.y,padding:t.radius+t.borderWidth}},draw:function(t){var e=this._view,n=this._model,i=this._chart.ctx,r=e.pointStyle,l=e.radius,u=e.x,d=e.y,c=o.color,h=0;e.skip||(i.strokeStyle=e.borderColor||s,i.lineWidth=o.valueOrDefault(e.borderWidth,a.global.elements.point.borderWidth),i.fillStyle=e.backgroundColor||s,void 0!==t&&(n.x<t.left||1.01*t.right<n.x||n.y<t.top||1.01*t.bottom<n.y)&&(n.x<t.left?h=(u-n.x)/(t.left-n.x):1.01*t.right<n.x?h=(n.x-u)/(n.x-t.right):n.y<t.top?h=(d-n.y)/(t.top-n.y):1.01*t.bottom<n.y&&(h=(n.y-d)/(n.y-t.bottom)),h=Math.round(100*h)/100,i.strokeStyle=c(i.strokeStyle).alpha(h).rgbString(),i.fillStyle=c(i.fillStyle).alpha(h).rgbString()),o.canvas.drawPoint(i,r,l,u,d))}})},{25:25,26:26,45:45}],39:[function(t,e,n){"use strict";function i(t){return void 0!==t._view.width}function a(t){var e,n,a,r,o=t._view;if(i(t)){var s=o.width/2;e=o.x-s,n=o.x+s,a=Math.min(o.y,o.base),r=Math.max(o.y,o.base)}else{var l=o.height/2;e=Math.min(o.x,o.base),n=Math.max(o.x,o.base),a=o.y-l,r=o.y+l}return{left:e,top:a,right:n,bottom:r}}var r=t(25),o=t(26);r._set("global",{elements:{rectangle:{backgroundColor:r.global.defaultColor,borderColor:r.global.defaultColor,borderSkipped:"bottom",borderWidth:0}}}),e.exports=o.extend({draw:function(){function t(t){return v[(y+t)%4]}var e,n,i,a,r,o,s,l=this._chart.ctx,u=this._view,d=u.borderWidth;if(u.horizontal?(e=u.base,n=u.x,i=u.y-u.height/2,a=u.y+u.height/2,r=n>e?1:-1,o=1,s=u.borderSkipped||"left"):(e=u.x-u.width/2,n=u.x+u.width/2,i=u.y,r=1,o=(a=u.base)>i?1:-1,s=u.borderSkipped||"bottom"),d){var c=Math.min(Math.abs(e-n),Math.abs(i-a)),h=(d=d>c?c:d)/2,f=e+("left"!==s?h*r:0),g=n+("right"!==s?-h*r:0),m=i+("top"!==s?h*o:0),p=a+("bottom"!==s?-h*o:0);f!==g&&(i=m,a=p),m!==p&&(e=f,n=g)}l.beginPath(),l.fillStyle=u.backgroundColor,l.strokeStyle=u.borderColor,l.lineWidth=d;var v=[[e,a],[e,i],[n,i],[n,a]],y=["bottom","left","top","right"].indexOf(s,0);-1===y&&(y=0);var b=t(0);l.moveTo(b[0],b[1]);for(var x=1;x<4;x++)b=t(x),l.lineTo(b[0],b[1]);l.fill(),d&&l.stroke()},height:function(){var t=this._view;return t.base-t.y},inRange:function(t,e){var n=!1;if(this._view){var i=a(this);n=t>=i.left&&t<=i.right&&e>=i.top&&e<=i.bottom}return n},inLabelRange:function(t,e){var n=this;if(!n._view)return!1;var r=a(n);return i(n)?t>=r.left&&t<=r.right:e>=r.top&&e<=r.bottom},inXRange:function(t){var e=a(this);return t>=e.left&&t<=e.right},inYRange:function(t){var e=a(this);return t>=e.top&&t<=e.bottom},getCenterPoint:function(){var t,e,n=this._view;return i(this)?(t=n.x,e=(n.y+n.base)/2):(t=(n.x+n.base)/2,e=n.y),{x:t,y:e}},getArea:function(){var t=this._view;return t.width*Math.abs(t.y-t.base)},tooltipPosition:function(){var t=this._view;return{x:t.x,y:t.y}}})},{25:25,26:26}],40:[function(t,e,n){"use strict";e.exports={},e.exports.Arc=t(36),e.exports.Line=t(37),e.exports.Point=t(38),e.exports.Rectangle=t(39)},{36:36,37:37,38:38,39:39}],41:[function(t,e,n){"use strict";var i=t(42),n=e.exports={clear:function(t){t.ctx.clearRect(0,0,t.width,t.height)},roundedRect:function(t,e,n,i,a,r){if(r){var o=Math.min(r,i/2),s=Math.min(r,a/2);t.moveTo(e+o,n),t.lineTo(e+i-o,n),t.quadraticCurveTo(e+i,n,e+i,n+s),t.lineTo(e+i,n+a-s),t.quadraticCurveTo(e+i,n+a,e+i-o,n+a),t.lineTo(e+o,n+a),t.quadraticCurveTo(e,n+a,e,n+a-s),t.lineTo(e,n+s),t.quadraticCurveTo(e,n,e+o,n)}else t.rect(e,n,i,a)},drawPoint:function(t,e,n,i,a){var r,o,s,l,u,d;if(!e||"object"!=typeof e||"[object HTMLImageElement]"!==(r=e.toString())&&"[object HTMLCanvasElement]"!==r){if(!(isNaN(n)||n<=0)){switch(e){default:t.beginPath(),t.arc(i,a,n,0,2*Math.PI),t.closePath(),t.fill();break;case"triangle":t.beginPath(),u=(o=3*n/Math.sqrt(3))*Math.sqrt(3)/2,t.moveTo(i-o/2,a+u/3),t.lineTo(i+o/2,a+u/3),t.lineTo(i,a-2*u/3),t.closePath(),t.fill();break;case"rect":d=1/Math.SQRT2*n,t.beginPath(),t.fillRect(i-d,a-d,2*d,2*d),t.strokeRect(i-d,a-d,2*d,2*d);break;case"rectRounded":var c=n/Math.SQRT2,h=i-c,f=a-c,g=Math.SQRT2*n;t.beginPath(),this.roundedRect(t,h,f,g,g,n/2),t.closePath(),t.fill();break;case"rectRot":d=1/Math.SQRT2*n,t.beginPath(),t.moveTo(i-d,a),t.lineTo(i,a+d),t.lineTo(i+d,a),t.lineTo(i,a-d),t.closePath(),t.fill();break;case"cross":t.beginPath(),t.moveTo(i,a+n),t.lineTo(i,a-n),t.moveTo(i-n,a),t.lineTo(i+n,a),t.closePath();break;case"crossRot":t.beginPath(),s=Math.cos(Math.PI/4)*n,l=Math.sin(Math.PI/4)*n,t.moveTo(i-s,a-l),t.lineTo(i+s,a+l),t.moveTo(i-s,a+l),t.lineTo(i+s,a-l),t.closePath();break;case"star":t.beginPath(),t.moveTo(i,a+n),t.lineTo(i,a-n),t.moveTo(i-n,a),t.lineTo(i+n,a),s=Math.cos(Math.PI/4)*n,l=Math.sin(Math.PI/4)*n,t.moveTo(i-s,a-l),t.lineTo(i+s,a+l),t.moveTo(i-s,a+l),t.lineTo(i+s,a-l),t.closePath();break;case"line":t.beginPath(),t.moveTo(i-n,a),t.lineTo(i+n,a),t.closePath();break;case"dash":t.beginPath(),t.moveTo(i,a),t.lineTo(i+n,a),t.closePath()}t.stroke()}}else t.drawImage(e,i-e.width/2,a-e.height/2,e.width,e.height)},clipArea:function(t,e){t.save(),t.beginPath(),t.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),t.clip()},unclipArea:function(t){t.restore()},lineTo:function(t,e,n,i){if(n.steppedLine)return"after"===n.steppedLine&&!i||"after"!==n.steppedLine&&i?t.lineTo(e.x,n.y):t.lineTo(n.x,e.y),void t.lineTo(n.x,n.y);n.tension?t.bezierCurveTo(i?e.controlPointPreviousX:e.controlPointNextX,i?e.controlPointPreviousY:e.controlPointNextY,i?n.controlPointNextX:n.controlPointPreviousX,i?n.controlPointNextY:n.controlPointPreviousY,n.x,n.y):t.lineTo(n.x,n.y)}};i.clear=n.clear,i.drawRoundedRectangle=function(t){t.beginPath(),n.roundedRect.apply(n,arguments),t.closePath()}},{42:42}],42:[function(t,e,n){"use strict";var i={noop:function(){},uid:function(){var t=0;return function(){return t++}}(),isNullOrUndef:function(t){return null===t||void 0===t},isArray:Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},isObject:function(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)},valueOrDefault:function(t,e){return void 0===t?e:t},valueAtIndexOrDefault:function(t,e,n){return i.valueOrDefault(i.isArray(t)?t[e]:t,n)},callback:function(t,e,n){if(t&&"function"==typeof t.call)return t.apply(n,e)},each:function(t,e,n,a){var r,o,s;if(i.isArray(t))if(o=t.length,a)for(r=o-1;r>=0;r--)e.call(n,t[r],r);else for(r=0;r<o;r++)e.call(n,t[r],r);else if(i.isObject(t))for(o=(s=Object.keys(t)).length,r=0;r<o;r++)e.call(n,t[s[r]],s[r])},arrayEquals:function(t,e){var n,a,r,o;if(!t||!e||t.length!==e.length)return!1;for(n=0,a=t.length;n<a;++n)if(r=t[n],o=e[n],r instanceof Array&&o instanceof Array){if(!i.arrayEquals(r,o))return!1}else if(r!==o)return!1;return!0},clone:function(t){if(i.isArray(t))return t.map(i.clone);if(i.isObject(t)){for(var e={},n=Object.keys(t),a=n.length,r=0;r<a;++r)e[n[r]]=i.clone(t[n[r]]);return e}return t},_merger:function(t,e,n,a){var r=e[t],o=n[t];i.isObject(r)&&i.isObject(o)?i.merge(r,o,a):e[t]=i.clone(o)},_mergerIf:function(t,e,n){var a=e[t],r=n[t];i.isObject(a)&&i.isObject(r)?i.mergeIf(a,r):e.hasOwnProperty(t)||(e[t]=i.clone(r))},merge:function(t,e,n){var a,r,o,s,l,u=i.isArray(e)?e:[e],d=u.length;if(!i.isObject(t))return t;for(a=(n=n||{}).merger||i._merger,r=0;r<d;++r)if(e=u[r],i.isObject(e))for(l=0,s=(o=Object.keys(e)).length;l<s;++l)a(o[l],t,e,n);return t},mergeIf:function(t,e){return i.merge(t,e,{merger:i._mergerIf})},extend:function(t){for(var e=1,n=arguments.length;e<n;++e)i.each(arguments[e],function(e,n){t[n]=e});return t},inherits:function(t){var e=this,n=t&&t.hasOwnProperty("constructor")?t.constructor:function(){return e.apply(this,arguments)},a=function(){this.constructor=n};return a.prototype=e.prototype,n.prototype=new a,n.extend=i.inherits,t&&i.extend(n.prototype,t),n.__super__=e.prototype,n}};e.exports=i,i.callCallback=i.callback,i.indexOf=function(t,e,n){return Array.prototype.indexOf.call(t,e,n)},i.getValueOrDefault=i.valueOrDefault,i.getValueAtIndexOrDefault=i.valueAtIndexOrDefault},{}],43:[function(t,e,n){"use strict";var i=t(42),a={linear:function(t){return t},easeInQuad:function(t){return t*t},easeOutQuad:function(t){return-t*(t-2)},easeInOutQuad:function(t){return(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1)},easeInCubic:function(t){return t*t*t},easeOutCubic:function(t){return(t-=1)*t*t+1},easeInOutCubic:function(t){return(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},easeInQuart:function(t){return t*t*t*t},easeOutQuart:function(t){return-((t-=1)*t*t*t-1)},easeInOutQuart:function(t){return(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)},easeInQuint:function(t){return t*t*t*t*t},easeOutQuint:function(t){return(t-=1)*t*t*t*t+1},easeInOutQuint:function(t){return(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)},easeInSine:function(t){return 1-Math.cos(t*(Math.PI/2))},easeOutSine:function(t){return Math.sin(t*(Math.PI/2))},easeInOutSine:function(t){return-.5*(Math.cos(Math.PI*t)-1)},easeInExpo:function(t){return 0===t?0:Math.pow(2,10*(t-1))},easeOutExpo:function(t){return 1===t?1:1-Math.pow(2,-10*t)},easeInOutExpo:function(t){return 0===t?0:1===t?1:(t/=.5)<1?.5*Math.pow(2,10*(t-1)):.5*(2-Math.pow(2,-10*--t))},easeInCirc:function(t){return t>=1?t:-(Math.sqrt(1-t*t)-1)},easeOutCirc:function(t){return Math.sqrt(1-(t-=1)*t)},easeInOutCirc:function(t){return(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},easeInElastic:function(t){var e=1.70158,n=0,i=1;return 0===t?0:1===t?1:(n||(n=.3),i<1?(i=1,e=n/4):e=n/(2*Math.PI)*Math.asin(1/i),-i*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n))},easeOutElastic:function(t){var e=1.70158,n=0,i=1;return 0===t?0:1===t?1:(n||(n=.3),i<1?(i=1,e=n/4):e=n/(2*Math.PI)*Math.asin(1/i),i*Math.pow(2,-10*t)*Math.sin((t-e)*(2*Math.PI)/n)+1)},easeInOutElastic:function(t){var e=1.70158,n=0,i=1;return 0===t?0:2==(t/=.5)?1:(n||(n=.45),i<1?(i=1,e=n/4):e=n/(2*Math.PI)*Math.asin(1/i),t<1?i*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n)*-.5:i*Math.pow(2,-10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n)*.5+1)},easeInBack:function(t){var e=1.70158;return t*t*((e+1)*t-e)},easeOutBack:function(t){var e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},easeInOutBack:function(t){var e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},easeInBounce:function(t){return 1-a.easeOutBounce(1-t)},easeOutBounce:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},easeInOutBounce:function(t){return t<.5?.5*a.easeInBounce(2*t):.5*a.easeOutBounce(2*t-1)+.5}};e.exports={effects:a},i.easingEffects=a},{42:42}],44:[function(t,e,n){"use strict";var i=t(42);e.exports={toLineHeight:function(t,e){var n=(""+t).match(/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/);if(!n||"normal"===n[1])return 1.2*e;switch(t=+n[2],n[3]){case"px":return t;case"%":t/=100}return e*t},toPadding:function(t){var e,n,a,r;return i.isObject(t)?(e=+t.top||0,n=+t.right||0,a=+t.bottom||0,r=+t.left||0):e=n=a=r=+t||0,{top:e,right:n,bottom:a,left:r,height:e+a,width:r+n}},resolve:function(t,e,n){var a,r,o;for(a=0,r=t.length;a<r;++a)if(void 0!==(o=t[a])&&(void 0!==e&&"function"==typeof o&&(o=o(e)),void 0!==n&&i.isArray(o)&&(o=o[n]),void 0!==o))return o}}},{42:42}],45:[function(t,e,n){"use strict";e.exports=t(42),e.exports.easing=t(43),e.exports.canvas=t(41),e.exports.options=t(44)},{41:41,42:42,43:43,44:44}],46:[function(t,e,n){e.exports={acquireContext:function(t){return t&&t.canvas&&(t=t.canvas),t&&t.getContext("2d")||null}}},{}],47:[function(t,e,n){"use strict";function i(t,e){var n=p.getStyle(t,e),i=n&&n.match(/^(\d+)(\.\d+)?px$/);return i?Number(i[1]):void 0}function a(t,e){var n=t.style,a=t.getAttribute("height"),r=t.getAttribute("width");if(t[v]={initial:{height:a,width:r,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",null===r||""===r){var o=i(t,"width");void 0!==o&&(t.width=o)}if(null===a||""===a)if(""===t.style.height)t.height=t.width/(e.options.aspectRatio||2);else{var s=i(t,"height");void 0!==o&&(t.height=s)}return t}function r(t,e,n){t.addEventListener(e,n,w)}function o(t,e,n){t.removeEventListener(e,n,w)}function s(t,e,n,i,a){return{type:t,chart:e,native:a||null,x:void 0!==n?n:null,y:void 0!==i?i:null}}function l(t,e){var n=k[t.type]||t.type,i=p.getRelativePosition(t,e);return s(n,e,i.x,i.y,t)}function u(t,e){var n=!1,i=[];return function(){i=Array.prototype.slice.call(arguments),e=e||this,n||(n=!0,p.requestAnimFrame.call(window,function(){n=!1,t.apply(e,i)}))}}function d(t){var e=document.createElement("div"),n=y+"size-monitor",i="position:absolute;left:0;top:0;right:0;bottom:0;overflow:hidden;pointer-events:none;visibility:hidden;z-index:-1;";e.style.cssText=i,e.className=n,e.innerHTML='<div class="'+n+'-expand" style="'+i+'"><div style="position:absolute;width:1000000px;height:1000000px;left:0;top:0"></div></div><div class="'+n+'-shrink" style="'+i+'"><div style="position:absolute;width:200%;height:200%;left:0; top:0"></div></div>';var a=e.childNodes[0],o=e.childNodes[1];e._reset=function(){a.scrollLeft=1e6,a.scrollTop=1e6,o.scrollLeft=1e6,o.scrollTop=1e6};var s=function(){e._reset(),t()};return r(a,"scroll",s.bind(a,"expand")),r(o,"scroll",s.bind(o,"shrink")),e}function c(t,e){var n=t[v]||(t[v]={}),i=n.renderProxy=function(t){t.animationName===x&&e()};p.each(_,function(e){r(t,e,i)}),n.reflow=!!t.offsetParent,t.classList.add(b)}function h(t){var e=t[v]||{},n=e.renderProxy;n&&(p.each(_,function(e){o(t,e,n)}),delete e.renderProxy),t.classList.remove(b)}function f(t,e,n){var i=t[v]||(t[v]={}),a=i.resizer=d(u(function(){if(i.resizer)return e(s("resize",n))}));c(t,function(){if(i.resizer){var e=t.parentNode;e&&e!==a.parentNode&&e.insertBefore(a,e.firstChild),a._reset()}})}function g(t){var e=t[v]||{},n=e.resizer;delete e.resizer,h(t),n&&n.parentNode&&n.parentNode.removeChild(n)}function m(t,e){var n=t._style||document.createElement("style");t._style||(t._style=n,e="/* Chart.js */\n"+e,n.setAttribute("type","text/css"),document.getElementsByTagName("head")[0].appendChild(n)),n.appendChild(document.createTextNode(e))}var p=t(45),v="$chartjs",y="chartjs-",b=y+"render-monitor",x=y+"render-animation",_=["animationstart","webkitAnimationStart"],k={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},w=!!function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("e",null,e)}catch(t){}return t}()&&{passive:!0};e.exports={_enabled:"undefined"!=typeof window&&"undefined"!=typeof document,initialize:function(){var t="from{opacity:0.99}to{opacity:1}";m(this,"@-webkit-keyframes "+x+"{"+t+"}@keyframes "+x+"{"+t+"}."+b+"{-webkit-animation:"+x+" 0.001s;animation:"+x+" 0.001s;}")},acquireContext:function(t,e){"string"==typeof t?t=document.getElementById(t):t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas);var n=t&&t.getContext&&t.getContext("2d");return n&&n.canvas===t?(a(t,e),n):null},releaseContext:function(t){var e=t.canvas;if(e[v]){var n=e[v].initial;["height","width"].forEach(function(t){var i=n[t];p.isNullOrUndef(i)?e.removeAttribute(t):e.setAttribute(t,i)}),p.each(n.style||{},function(t,n){e.style[n]=t}),e.width=e.width,delete e[v]}},addEventListener:function(t,e,n){var i=t.canvas;if("resize"!==e){var a=n[v]||(n[v]={});r(i,e,(a.proxies||(a.proxies={}))[t.id+"_"+e]=function(e){n(l(e,t))})}else f(i,n,t)},removeEventListener:function(t,e,n){var i=t.canvas;if("resize"!==e){var a=((n[v]||{}).proxies||{})[t.id+"_"+e];a&&o(i,e,a)}else g(i)}},p.addEvent=r,p.removeEvent=o},{45:45}],48:[function(t,e,n){"use strict";var i=t(45),a=t(46),r=t(47),o=r._enabled?r:a;e.exports=i.extend({initialize:function(){},acquireContext:function(){},releaseContext:function(){},addEventListener:function(){},removeEventListener:function(){}},o)},{45:45,46:46,47:47}],49:[function(t,e,n){"use strict";var i=t(25),a=t(40),r=t(45);i._set("global",{plugins:{filler:{propagate:!0}}}),e.exports=function(){function t(t,e,n){var i,a=t._model||{},r=a.fill;if(void 0===r&&(r=!!a.backgroundColor),!1===r||null===r)return!1;if(!0===r)return"origin";if(i=parseFloat(r,10),isFinite(i)&&Math.floor(i)===i)return"-"!==r[0]&&"+"!==r[0]||(i=e+i),!(i===e||i<0||i>=n)&&i;switch(r){case"bottom":return"start";case"top":return"end";case"zero":return"origin";case"origin":case"start":case"end":return r;default:return!1}}function e(t){var e,n=t.el._model||{},i=t.el._scale||{},a=t.fill,r=null;if(isFinite(a))return null;if("start"===a?r=void 0===n.scaleBottom?i.bottom:n.scaleBottom:"end"===a?r=void 0===n.scaleTop?i.top:n.scaleTop:void 0!==n.scaleZero?r=n.scaleZero:i.getBasePosition?r=i.getBasePosition():i.getBasePixel&&(r=i.getBasePixel()),void 0!==r&&null!==r){if(void 0!==r.x&&void 0!==r.y)return r;if("number"==typeof r&&isFinite(r))return e=i.isHorizontal(),{x:e?r:null,y:e?null:r}}return null}function n(t,e,n){var i,a=t[e].fill,r=[e];if(!n)return a;for(;!1!==a&&-1===r.indexOf(a);){if(!isFinite(a))return a;if(!(i=t[a]))return!1;if(i.visible)return a;r.push(a),a=i.fill}return!1}function o(t){var e=t.fill,n="dataset";return!1===e?null:(isFinite(e)||(n="boundary"),d[n](t))}function s(t){return t&&!t.skip}function l(t,e,n,i,a){var o;if(i&&a){for(t.moveTo(e[0].x,e[0].y),o=1;o<i;++o)r.canvas.lineTo(t,e[o-1],e[o]);for(t.lineTo(n[a-1].x,n[a-1].y),o=a-1;o>0;--o)r.canvas.lineTo(t,n[o],n[o-1],!0)}}function u(t,e,n,i,a,r){var o,u,d,c,h,f,g,m=e.length,p=i.spanGaps,v=[],y=[],b=0,x=0;for(t.beginPath(),o=0,u=m+!!r;o<u;++o)h=n(c=e[d=o%m]._view,d,i),f=s(c),g=s(h),f&&g?(b=v.push(c),x=y.push(h)):b&&x&&(p?(f&&v.push(c),g&&y.push(h)):(l(t,v,y,b,x),b=x=0,v=[],y=[]));l(t,v,y,b,x),t.closePath(),t.fillStyle=a,t.fill()}var d={dataset:function(t){var e=t.fill,n=t.chart,i=n.getDatasetMeta(e),a=i&&n.isDatasetVisible(e)&&i.dataset._children||[],r=a.length||0;return r?function(t,e){return e<r&&a[e]._view||null}:null},boundary:function(t){var e=t.boundary,n=e?e.x:null,i=e?e.y:null;return function(t){return{x:null===n?t.x:n,y:null===i?t.y:i}}}};return{id:"filler",afterDatasetsUpdate:function(i,r){var s,l,u,d,c=(i.data.datasets||[]).length,h=r.propagate,f=[];for(l=0;l<c;++l)d=null,(u=(s=i.getDatasetMeta(l)).dataset)&&u._model&&u instanceof a.Line&&(d={visible:i.isDatasetVisible(l),fill:t(u,l,c),chart:i,el:u}),s.$filler=d,f.push(d);for(l=0;l<c;++l)(d=f[l])&&(d.fill=n(f,l,h),d.boundary=e(d),d.mapper=o(d))},beforeDatasetDraw:function(t,e){var n=e.meta.$filler;if(n){var a=t.ctx,o=n.el,s=o._view,l=o._children||[],d=n.mapper,c=s.backgroundColor||i.global.defaultColor;d&&c&&l.length&&(r.canvas.clipArea(a,t.chartArea),u(a,l,d,s,c,o._loop),r.canvas.unclipArea(a))}}}}},{25:25,40:40,45:45}],50:[function(t,e,n){"use strict";var i=t(25),a=t(26),r=t(45);i._set("global",{legend:{display:!0,position:"top",fullWidth:!0,reverse:!1,weight:1e3,onClick:function(t,e){var n=e.datasetIndex,i=this.chart,a=i.getDatasetMeta(n);a.hidden=null===a.hidden?!i.data.datasets[n].hidden:null,i.update()},onHover:null,labels:{boxWidth:40,padding:10,generateLabels:function(t){var e=t.data;return r.isArray(e.datasets)?e.datasets.map(function(e,n){return{text:e.label,fillStyle:r.isArray(e.backgroundColor)?e.backgroundColor[0]:e.backgroundColor,hidden:!t.isDatasetVisible(n),lineCap:e.borderCapStyle,lineDash:e.borderDash,lineDashOffset:e.borderDashOffset,lineJoin:e.borderJoinStyle,lineWidth:e.borderWidth,strokeStyle:e.borderColor,pointStyle:e.pointStyle,datasetIndex:n}},this):[]}}},legendCallback:function(t){var e=[];e.push('<ul class="'+t.id+'-legend">');for(var n=0;n<t.data.datasets.length;n++)e.push('<li><span style="background-color:'+t.data.datasets[n].backgroundColor+'"></span>'),t.data.datasets[n].label&&e.push(t.data.datasets[n].label),e.push("</li>");return e.push("</ul>"),e.join("")}}),e.exports=function(t){function e(t,e){return t.usePointStyle?e*Math.SQRT2:t.boxWidth}function n(e,n){var i=new t.Legend({ctx:e.ctx,options:n,chart:e});o.configure(e,i,n),o.addBox(e,i),e.legend=i}var o=t.layoutService,s=r.noop;return t.Legend=a.extend({initialize:function(t){r.extend(this,t),this.legendHitBoxes=[],this.doughnutMode=!1},beforeUpdate:s,update:function(t,e,n){var i=this;return i.beforeUpdate(),i.maxWidth=t,i.maxHeight=e,i.margins=n,i.beforeSetDimensions(),i.setDimensions(),i.afterSetDimensions(),i.beforeBuildLabels(),i.buildLabels(),i.afterBuildLabels(),i.beforeFit(),i.fit(),i.afterFit(),i.afterUpdate(),i.minSize},afterUpdate:s,beforeSetDimensions:s,setDimensions:function(){var t=this;t.isHorizontal()?(t.width=t.maxWidth,t.left=0,t.right=t.width):(t.height=t.maxHeight,t.top=0,t.bottom=t.height),t.paddingLeft=0,t.paddingTop=0,t.paddingRight=0,t.paddingBottom=0,t.minSize={width:0,height:0}},afterSetDimensions:s,beforeBuildLabels:s,buildLabels:function(){var t=this,e=t.options.labels||{},n=r.callback(e.generateLabels,[t.chart],t)||[];e.filter&&(n=n.filter(function(n){return e.filter(n,t.chart.data)})),t.options.reverse&&n.reverse(),t.legendItems=n},afterBuildLabels:s,beforeFit:s,fit:function(){var t=this,n=t.options,a=n.labels,o=n.display,s=t.ctx,l=i.global,u=r.valueOrDefault,d=u(a.fontSize,l.defaultFontSize),c=u(a.fontStyle,l.defaultFontStyle),h=u(a.fontFamily,l.defaultFontFamily),f=r.fontString(d,c,h),g=t.legendHitBoxes=[],m=t.minSize,p=t.isHorizontal();if(p?(m.width=t.maxWidth,m.height=o?10:0):(m.width=o?10:0,m.height=t.maxHeight),o)if(s.font=f,p){var v=t.lineWidths=[0],y=t.legendItems.length?d+a.padding:0;s.textAlign="left",s.textBaseline="top",r.each(t.legendItems,function(n,i){var r=e(a,d)+d/2+s.measureText(n.text).width;v[v.length-1]+r+a.padding>=t.width&&(y+=d+a.padding,v[v.length]=t.left),g[i]={left:0,top:0,width:r,height:d},v[v.length-1]+=r+a.padding}),m.height+=y}else{var b=a.padding,x=t.columnWidths=[],_=a.padding,k=0,w=0,M=d+b;r.each(t.legendItems,function(t,n){var i=e(a,d)+d/2+s.measureText(t.text).width;w+M>m.height&&(_+=k+a.padding,x.push(k),k=0,w=0),k=Math.max(k,i),w+=M,g[n]={left:0,top:0,width:i,height:d}}),_+=k,x.push(k),m.width+=_}t.width=m.width,t.height=m.height},afterFit:s,isHorizontal:function(){return"top"===this.options.position||"bottom"===this.options.position},draw:function(){var t=this,n=t.options,a=n.labels,o=i.global,s=o.elements.line,l=t.width,u=t.lineWidths;if(n.display){var d,c=t.ctx,h=r.valueOrDefault,f=h(a.fontColor,o.defaultFontColor),g=h(a.fontSize,o.defaultFontSize),m=h(a.fontStyle,o.defaultFontStyle),p=h(a.fontFamily,o.defaultFontFamily),v=r.fontString(g,m,p);c.textAlign="left",c.textBaseline="middle",c.lineWidth=.5,c.strokeStyle=f,c.fillStyle=f,c.font=v;var y=e(a,g),b=t.legendHitBoxes,x=function(t,e,i){if(!(isNaN(y)||y<=0)){c.save(),c.fillStyle=h(i.fillStyle,o.defaultColor),c.lineCap=h(i.lineCap,s.borderCapStyle),c.lineDashOffset=h(i.lineDashOffset,s.borderDashOffset),c.lineJoin=h(i.lineJoin,s.borderJoinStyle),c.lineWidth=h(i.lineWidth,s.borderWidth),c.strokeStyle=h(i.strokeStyle,o.defaultColor);var a=0===h(i.lineWidth,s.borderWidth);if(c.setLineDash&&c.setLineDash(h(i.lineDash,s.borderDash)),n.labels&&n.labels.usePointStyle){var l=g*Math.SQRT2/2,u=l/Math.SQRT2,d=t+u,f=e+u;r.canvas.drawPoint(c,i.pointStyle,l,d,f)}else a||c.strokeRect(t,e,y,g),c.fillRect(t,e,y,g);c.restore()}},_=function(t,e,n,i){var a=g/2,r=y+a+t,o=e+a;c.fillText(n.text,r,o),n.hidden&&(c.beginPath(),c.lineWidth=2,c.moveTo(r,o),c.lineTo(r+i,o),c.stroke())},k=t.isHorizontal();d=k?{x:t.left+(l-u[0])/2,y:t.top+a.padding,line:0}:{x:t.left+a.padding,y:t.top+a.padding,line:0};var w=g+a.padding;r.each(t.legendItems,function(e,n){var i=c.measureText(e.text).width,r=y+g/2+i,o=d.x,s=d.y;k?o+r>=l&&(s=d.y+=w,d.line++,o=d.x=t.left+(l-u[d.line])/2):s+w>t.bottom&&(o=d.x=o+t.columnWidths[d.line]+a.padding,s=d.y=t.top+a.padding,d.line++),x(o,s,e),b[n].left=o,b[n].top=s,_(o,s,e,i),k?d.x+=r+a.padding:d.y+=w})}},handleEvent:function(t){var e=this,n=e.options,i="mouseup"===t.type?"click":t.type,a=!1;if("mousemove"===i){if(!n.onHover)return}else{if("click"!==i)return;if(!n.onClick)return}var r=t.x,o=t.y;if(r>=e.left&&r<=e.right&&o>=e.top&&o<=e.bottom)for(var s=e.legendHitBoxes,l=0;l<s.length;++l){var u=s[l];if(r>=u.left&&r<=u.left+u.width&&o>=u.top&&o<=u.top+u.height){if("click"===i){n.onClick.call(e,t.native,e.legendItems[l]),a=!0;break}if("mousemove"===i){n.onHover.call(e,t.native,e.legendItems[l]),a=!0;break}}}return a}}),{id:"legend",beforeInit:function(t){var e=t.options.legend;e&&n(t,e)},beforeUpdate:function(t){var e=t.options.legend,a=t.legend;e?(r.mergeIf(e,i.global.legend),a?(o.configure(t,a,e),a.options=e):n(t,e)):a&&(o.removeBox(t,a),delete t.legend)},afterEvent:function(t,e){var n=t.legend;n&&n.handleEvent(e)}}}},{25:25,26:26,45:45}],51:[function(t,e,n){"use strict";var i=t(25),a=t(26),r=t(45);i._set("global",{title:{display:!1,fontStyle:"bold",fullWidth:!0,lineHeight:1.2,padding:10,position:"top",text:"",weight:2e3}}),e.exports=function(t){function e(e,i){var a=new t.Title({ctx:e.ctx,options:i,chart:e});n.configure(e,a,i),n.addBox(e,a),e.titleBlock=a}var n=t.layoutService,o=r.noop;return t.Title=a.extend({initialize:function(t){var e=this;r.extend(e,t),e.legendHitBoxes=[]},beforeUpdate:o,update:function(t,e,n){var i=this;return i.beforeUpdate(),i.maxWidth=t,i.maxHeight=e,i.margins=n,i.beforeSetDimensions(),i.setDimensions(),i.afterSetDimensions(),i.beforeBuildLabels(),i.buildLabels(),i.afterBuildLabels(),i.beforeFit(),i.fit(),i.afterFit(),i.afterUpdate(),i.minSize},afterUpdate:o,beforeSetDimensions:o,setDimensions:function(){var t=this;t.isHorizontal()?(t.width=t.maxWidth,t.left=0,t.right=t.width):(t.height=t.maxHeight,t.top=0,t.bottom=t.height),t.paddingLeft=0,t.paddingTop=0,t.paddingRight=0,t.paddingBottom=0,t.minSize={width:0,height:0}},afterSetDimensions:o,beforeBuildLabels:o,buildLabels:o,afterBuildLabels:o,beforeFit:o,fit:function(){var t=this,e=r.valueOrDefault,n=t.options,a=n.display,o=e(n.fontSize,i.global.defaultFontSize),s=t.minSize,l=r.isArray(n.text)?n.text.length:1,u=r.options.toLineHeight(n.lineHeight,o),d=a?l*u+2*n.padding:0;t.isHorizontal()?(s.width=t.maxWidth,s.height=d):(s.width=d,s.height=t.maxHeight),t.width=s.width,t.height=s.height},afterFit:o,isHorizontal:function(){var t=this.options.position;return"top"===t||"bottom"===t},draw:function(){var t=this,e=t.ctx,n=r.valueOrDefault,a=t.options,o=i.global;if(a.display){var s,l,u,d=n(a.fontSize,o.defaultFontSize),c=n(a.fontStyle,o.defaultFontStyle),h=n(a.fontFamily,o.defaultFontFamily),f=r.fontString(d,c,h),g=r.options.toLineHeight(a.lineHeight,d),m=g/2+a.padding,p=0,v=t.top,y=t.left,b=t.bottom,x=t.right;e.fillStyle=n(a.fontColor,o.defaultFontColor),e.font=f,t.isHorizontal()?(l=y+(x-y)/2,u=v+m,s=x-y):(l="left"===a.position?y+m:x-m,u=v+(b-v)/2,s=b-v,p=Math.PI*("left"===a.position?-.5:.5)),e.save(),e.translate(l,u),e.rotate(p),e.textAlign="center",e.textBaseline="middle";var _=a.text;if(r.isArray(_))for(var k=0,w=0;w<_.length;++w)e.fillText(_[w],0,k,s),k+=g;else e.fillText(_,0,0,s);e.restore()}}}),{id:"title",beforeInit:function(t){var n=t.options.title;n&&e(t,n)},beforeUpdate:function(a){var o=a.options.title,s=a.titleBlock;o?(r.mergeIf(o,i.global.title),s?(n.configure(a,s,o),s.options=o):e(a,o)):s&&(t.layoutService.removeBox(a,s),delete a.titleBlock)}}}},{25:25,26:26,45:45}],52:[function(t,e,n){"use strict";e.exports=function(t){var e=t.Scale.extend({getLabels:function(){var t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels},determineDataLimits:function(){var t=this,e=t.getLabels();t.minIndex=0,t.maxIndex=e.length-1;var n;void 0!==t.options.ticks.min&&(n=e.indexOf(t.options.ticks.min),t.minIndex=-1!==n?n:t.minIndex),void 0!==t.options.ticks.max&&(n=e.indexOf(t.options.ticks.max),t.maxIndex=-1!==n?n:t.maxIndex),t.min=e[t.minIndex],t.max=e[t.maxIndex]},buildTicks:function(){var t=this,e=t.getLabels();t.ticks=0===t.minIndex&&t.maxIndex===e.length-1?e:e.slice(t.minIndex,t.maxIndex+1)},getLabelForIndex:function(t,e){var n=this,i=n.chart.data,a=n.isHorizontal();return i.yLabels&&!a?n.getRightValue(i.datasets[e].data[t]):n.ticks[t-n.minIndex]},getPixelForValue:function(t,e){var n,i=this,a=i.options.offset,r=Math.max(i.maxIndex+1-i.minIndex-(a?0:1),1);if(void 0!==t&&null!==t&&(n=i.isHorizontal()?t.x:t.y),void 0!==n||void 0!==t&&isNaN(e)){var o=i.getLabels();t=n||t;var s=o.indexOf(t);e=-1!==s?s:e}if(i.isHorizontal()){var l=i.width/r,u=l*(e-i.minIndex);return a&&(u+=l/2),i.left+Math.round(u)}var d=i.height/r,c=d*(e-i.minIndex);return a&&(c+=d/2),i.top+Math.round(c)},getPixelForTick:function(t){return this.getPixelForValue(this.ticks[t],t+this.minIndex,null)},getValueForPixel:function(t){var e=this,n=e.options.offset,i=Math.max(e._ticks.length-(n?0:1),1),a=e.isHorizontal(),r=(a?e.width:e.height)/i;return t-=a?e.left:e.top,n&&(t-=r/2),(t<=0?0:Math.round(t/r))+e.minIndex},getBasePixel:function(){return this.bottom}});t.scaleService.registerScaleType("category",e,{position:"bottom"})}},{}],53:[function(t,e,n){"use strict";var i=t(25),a=t(45),r=t(34);e.exports=function(t){var e={position:"left",ticks:{callback:r.formatters.linear}},n=t.LinearScaleBase.extend({determineDataLimits:function(){function t(t){return o?t.xAxisID===e.id:t.yAxisID===e.id}var e=this,n=e.options,i=e.chart,r=i.data.datasets,o=e.isHorizontal();e.min=null,e.max=null;var s=n.stacked;if(void 0===s&&a.each(r,function(e,n){if(!s){var a=i.getDatasetMeta(n);i.isDatasetVisible(n)&&t(a)&&void 0!==a.stack&&(s=!0)}}),n.stacked||s){var l={};a.each(r,function(r,o){var s=i.getDatasetMeta(o),u=[s.type,void 0===n.stacked&&void 0===s.stack?o:"",s.stack].join(".");void 0===l[u]&&(l[u]={positiveValues:[],negativeValues:[]});var d=l[u].positiveValues,c=l[u].negativeValues;i.isDatasetVisible(o)&&t(s)&&a.each(r.data,function(t,i){var a=+e.getRightValue(t);isNaN(a)||s.data[i].hidden||(d[i]=d[i]||0,c[i]=c[i]||0,n.relativePoints?d[i]=100:a<0?c[i]+=a:d[i]+=a)})}),a.each(l,function(t){var n=t.positiveValues.concat(t.negativeValues),i=a.min(n),r=a.max(n);e.min=null===e.min?i:Math.min(e.min,i),e.max=null===e.max?r:Math.max(e.max,r)})}else a.each(r,function(n,r){var o=i.getDatasetMeta(r);i.isDatasetVisible(r)&&t(o)&&a.each(n.data,function(t,n){var i=+e.getRightValue(t);isNaN(i)||o.data[n].hidden||(null===e.min?e.min=i:i<e.min&&(e.min=i),null===e.max?e.max=i:i>e.max&&(e.max=i))})});e.min=isFinite(e.min)&&!isNaN(e.min)?e.min:0,e.max=isFinite(e.max)&&!isNaN(e.max)?e.max:1,this.handleTickRangeOptions()},getTickLimit:function(){var t,e=this,n=e.options.ticks;if(e.isHorizontal())t=Math.min(n.maxTicksLimit?n.maxTicksLimit:11,Math.ceil(e.width/50));else{var r=a.valueOrDefault(n.fontSize,i.global.defaultFontSize);t=Math.min(n.maxTicksLimit?n.maxTicksLimit:11,Math.ceil(e.height/(2*r)))}return t},handleDirectionalChanges:function(){this.isHorizontal()||this.ticks.reverse()},getLabelForIndex:function(t,e){return+this.getRightValue(this.chart.data.datasets[e].data[t])},getPixelForValue:function(t){var e,n=this,i=n.start,a=+n.getRightValue(t),r=n.end-i;return n.isHorizontal()?(e=n.left+n.width/r*(a-i),Math.round(e)):(e=n.bottom-n.height/r*(a-i),Math.round(e))},getValueForPixel:function(t){var e=this,n=e.isHorizontal(),i=n?e.width:e.height,a=(n?t-e.left:e.bottom-t)/i;return e.start+(e.end-e.start)*a},getPixelForTick:function(t){return this.getPixelForValue(this.ticksAsNumbers[t])}});t.scaleService.registerScaleType("linear",n,e)}},{25:25,34:34,45:45}],54:[function(t,e,n){"use strict";var i=t(45),a=t(34);e.exports=function(t){var e=i.noop;t.LinearScaleBase=t.Scale.extend({getRightValue:function(e){return"string"==typeof e?+e:t.Scale.prototype.getRightValue.call(this,e)},handleTickRangeOptions:function(){var t=this,e=t.options.ticks;if(e.beginAtZero){var n=i.sign(t.min),a=i.sign(t.max);n<0&&a<0?t.max=0:n>0&&a>0&&(t.min=0)}var r=void 0!==e.min||void 0!==e.suggestedMin,o=void 0!==e.max||void 0!==e.suggestedMax;void 0!==e.min?t.min=e.min:void 0!==e.suggestedMin&&(null===t.min?t.min=e.suggestedMin:t.min=Math.min(t.min,e.suggestedMin)),void 0!==e.max?t.max=e.max:void 0!==e.suggestedMax&&(null===t.max?t.max=e.suggestedMax:t.max=Math.max(t.max,e.suggestedMax)),r!==o&&t.min>=t.max&&(r?t.max=t.min+1:t.min=t.max-1),t.min===t.max&&(t.max++,e.beginAtZero||t.min--)},getTickLimit:e,handleDirectionalChanges:e,buildTicks:function(){var t=this,e=t.options.ticks,n=t.getTickLimit(),r={maxTicks:n=Math.max(2,n),min:e.min,max:e.max,stepSize:i.valueOrDefault(e.fixedStepSize,e.stepSize)},o=t.ticks=a.generators.linear(r,t);t.handleDirectionalChanges(),t.max=i.max(o),t.min=i.min(o),e.reverse?(o.reverse(),t.start=t.max,t.end=t.min):(t.start=t.min,t.end=t.max)},convertTicksToLabels:function(){var e=this;e.ticksAsNumbers=e.ticks.slice(),e.zeroLineIndex=e.ticks.indexOf(0),t.Scale.prototype.convertTicksToLabels.call(e)}})}},{34:34,45:45}],55:[function(t,e,n){"use strict";var i=t(45),a=t(34);e.exports=function(t){var e={position:"left",ticks:{callback:a.formatters.logarithmic}},n=t.Scale.extend({determineDataLimits:function(){function t(t){return l?t.xAxisID===e.id:t.yAxisID===e.id}var e=this,n=e.options,a=n.ticks,r=e.chart,o=r.data.datasets,s=i.valueOrDefault,l=e.isHorizontal();e.min=null,e.max=null,e.minNotZero=null;var u=n.stacked;if(void 0===u&&i.each(o,function(e,n){if(!u){var i=r.getDatasetMeta(n);r.isDatasetVisible(n)&&t(i)&&void 0!==i.stack&&(u=!0)}}),n.stacked||u){var d={};i.each(o,function(a,o){var s=r.getDatasetMeta(o),l=[s.type,void 0===n.stacked&&void 0===s.stack?o:"",s.stack].join(".");r.isDatasetVisible(o)&&t(s)&&(void 0===d[l]&&(d[l]=[]),i.each(a.data,function(t,i){var a=d[l],r=+e.getRightValue(t);isNaN(r)||s.data[i].hidden||(a[i]=a[i]||0,n.relativePoints?a[i]=100:a[i]+=r)}))}),i.each(d,function(t){var n=i.min(t),a=i.max(t);e.min=null===e.min?n:Math.min(e.min,n),e.max=null===e.max?a:Math.max(e.max,a)})}else i.each(o,function(n,a){var o=r.getDatasetMeta(a);r.isDatasetVisible(a)&&t(o)&&i.each(n.data,function(t,n){var i=+e.getRightValue(t);isNaN(i)||o.data[n].hidden||(null===e.min?e.min=i:i<e.min&&(e.min=i),null===e.max?e.max=i:i>e.max&&(e.max=i),0!==i&&(null===e.minNotZero||i<e.minNotZero)&&(e.minNotZero=i))})});e.min=s(a.min,e.min),e.max=s(a.max,e.max),e.min===e.max&&(0!==e.min&&null!==e.min?(e.min=Math.pow(10,Math.floor(i.log10(e.min))-1),e.max=Math.pow(10,Math.floor(i.log10(e.max))+1)):(e.min=1,e.max=10))},buildTicks:function(){var t=this,e=t.options.ticks,n={min:e.min,max:e.max},r=t.ticks=a.generators.logarithmic(n,t);t.isHorizontal()||r.reverse(),t.max=i.max(r),t.min=i.min(r),e.reverse?(r.reverse(),t.start=t.max,t.end=t.min):(t.start=t.min,t.end=t.max)},convertTicksToLabels:function(){this.tickValues=this.ticks.slice(),t.Scale.prototype.convertTicksToLabels.call(this)},getLabelForIndex:function(t,e){return+this.getRightValue(this.chart.data.datasets[e].data[t])},getPixelForTick:function(t){return this.getPixelForValue(this.tickValues[t])},getPixelForValue:function(t){var e,n,a,r=this,o=r.start,s=+r.getRightValue(t),l=r.options.ticks;return r.isHorizontal()?(a=i.log10(r.end)-i.log10(o),0===s?n=r.left:(e=r.width,n=r.left+e/a*(i.log10(s)-i.log10(o)))):(e=r.height,0!==o||l.reverse?0===r.end&&l.reverse?(a=i.log10(r.start)-i.log10(r.minNotZero),n=s===r.end?r.top:s===r.minNotZero?r.top+.02*e:r.top+.02*e+.98*e/a*(i.log10(s)-i.log10(r.minNotZero))):0===s?n=l.reverse?r.top:r.bottom:(a=i.log10(r.end)-i.log10(o),e=r.height,n=r.bottom-e/a*(i.log10(s)-i.log10(o))):(a=i.log10(r.end)-i.log10(r.minNotZero),n=s===o?r.bottom:s===r.minNotZero?r.bottom-.02*e:r.bottom-.02*e-.98*e/a*(i.log10(s)-i.log10(r.minNotZero)))),n},getValueForPixel:function(t){var e,n,a=this,r=i.log10(a.end)-i.log10(a.start);return a.isHorizontal()?(n=a.width,e=a.start*Math.pow(10,(t-a.left)*r/n)):(n=a.height,e=Math.pow(10,(a.bottom-t)*r/n)/a.start),e}});t.scaleService.registerScaleType("logarithmic",n,e)}},{34:34,45:45}],56:[function(t,e,n){"use strict";var i=t(25),a=t(45),r=t(34);e.exports=function(t){function e(t){var e=t.options;return e.angleLines.display||e.pointLabels.display?t.chart.data.labels.length:0}function n(t){var e=t.options.pointLabels,n=a.valueOrDefault(e.fontSize,p.defaultFontSize),i=a.valueOrDefault(e.fontStyle,p.defaultFontStyle),r=a.valueOrDefault(e.fontFamily,p.defaultFontFamily);return{size:n,style:i,family:r,font:a.fontString(n,i,r)}}function o(t,e,n){return a.isArray(n)?{w:a.longestText(t,t.font,n),h:n.length*e+1.5*(n.length-1)*e}:{w:t.measureText(n).width,h:e}}function s(t,e,n,i,a){return t===i||t===a?{start:e-n/2,end:e+n/2}:t<i||t>a?{start:e-n-5,end:e}:{start:e,end:e+n+5}}function l(t){var i,r,l,u=n(t),d=Math.min(t.height/2,t.width/2),c={r:t.width,l:0,t:t.height,b:0},h={};t.ctx.font=u.font,t._pointLabelSizes=[];var f=e(t);for(i=0;i<f;i++){l=t.getPointPosition(i,d),r=o(t.ctx,u.size,t.pointLabels[i]||""),t._pointLabelSizes[i]=r;var g=t.getIndexAngle(i),m=a.toDegrees(g)%360,p=s(m,l.x,r.w,0,180),v=s(m,l.y,r.h,90,270);p.start<c.l&&(c.l=p.start,h.l=g),p.end>c.r&&(c.r=p.end,h.r=g),v.start<c.t&&(c.t=v.start,h.t=g),v.end>c.b&&(c.b=v.end,h.b=g)}t.setReductions(d,c,h)}function u(t){var e=Math.min(t.height/2,t.width/2);t.drawingArea=Math.round(e),t.setCenterPoint(0,0,0,0)}function d(t){return 0===t||180===t?"center":t<180?"left":"right"}function c(t,e,n,i){if(a.isArray(e))for(var r=n.y,o=1.5*i,s=0;s<e.length;++s)t.fillText(e[s],n.x,r),r+=o;else t.fillText(e,n.x,n.y)}function h(t,e,n){90===t||270===t?n.y-=e.h/2:(t>270||t<90)&&(n.y-=e.h)}function f(t){var i=t.ctx,r=a.valueOrDefault,o=t.options,s=o.angleLines,l=o.pointLabels;i.lineWidth=s.lineWidth,i.strokeStyle=s.color;var u=t.getDistanceFromCenterForValue(o.ticks.reverse?t.min:t.max),f=n(t);i.textBaseline="top";for(var g=e(t)-1;g>=0;g--){if(s.display){var m=t.getPointPosition(g,u);i.beginPath(),i.moveTo(t.xCenter,t.yCenter),i.lineTo(m.x,m.y),i.stroke(),i.closePath()}if(l.display){var v=t.getPointPosition(g,u+5),y=r(l.fontColor,p.defaultFontColor);i.font=f.font,i.fillStyle=y;var b=t.getIndexAngle(g),x=a.toDegrees(b);i.textAlign=d(x),h(x,t._pointLabelSizes[g],v),c(i,t.pointLabels[g]||"",v,f.size)}}}function g(t,n,i,r){var o=t.ctx;if(o.strokeStyle=a.valueAtIndexOrDefault(n.color,r-1),o.lineWidth=a.valueAtIndexOrDefault(n.lineWidth,r-1),t.options.gridLines.circular)o.beginPath(),o.arc(t.xCenter,t.yCenter,i,0,2*Math.PI),o.closePath(),o.stroke();else{var s=e(t);if(0===s)return;o.beginPath();var l=t.getPointPosition(0,i);o.moveTo(l.x,l.y);for(var u=1;u<s;u++)l=t.getPointPosition(u,i),o.lineTo(l.x,l.y);o.closePath(),o.stroke()}}function m(t){return a.isNumber(t)?t:0}var p=i.global,v={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,color:"rgba(0, 0, 0, 0.1)",lineWidth:1},gridLines:{circular:!1},ticks:{showLabelBackdrop:!0,backdropColor:"rgba(255,255,255,0.75)",backdropPaddingY:2,backdropPaddingX:2,callback:r.formatters.linear},pointLabels:{display:!0,fontSize:10,callback:function(t){return t}}},y=t.LinearScaleBase.extend({setDimensions:function(){var t=this,e=t.options,n=e.ticks;t.width=t.maxWidth,t.height=t.maxHeight,t.xCenter=Math.round(t.width/2),t.yCenter=Math.round(t.height/2);var i=a.min([t.height,t.width]),r=a.valueOrDefault(n.fontSize,p.defaultFontSize);t.drawingArea=e.display?i/2-(r/2+n.backdropPaddingY):i/2},determineDataLimits:function(){var t=this,e=t.chart,n=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;a.each(e.data.datasets,function(r,o){if(e.isDatasetVisible(o)){var s=e.getDatasetMeta(o);a.each(r.data,function(e,a){var r=+t.getRightValue(e);isNaN(r)||s.data[a].hidden||(n=Math.min(r,n),i=Math.max(r,i))})}}),t.min=n===Number.POSITIVE_INFINITY?0:n,t.max=i===Number.NEGATIVE_INFINITY?0:i,t.handleTickRangeOptions()},getTickLimit:function(){var t=this.options.ticks,e=a.valueOrDefault(t.fontSize,p.defaultFontSize);return Math.min(t.maxTicksLimit?t.maxTicksLimit:11,Math.ceil(this.drawingArea/(1.5*e)))},convertTicksToLabels:function(){var e=this;t.LinearScaleBase.prototype.convertTicksToLabels.call(e),e.pointLabels=e.chart.data.labels.map(e.options.pointLabels.callback,e)},getLabelForIndex:function(t,e){return+this.getRightValue(this.chart.data.datasets[e].data[t])},fit:function(){this.options.pointLabels.display?l(this):u(this)},setReductions:function(t,e,n){var i=this,a=e.l/Math.sin(n.l),r=Math.max(e.r-i.width,0)/Math.sin(n.r),o=-e.t/Math.cos(n.t),s=-Math.max(e.b-i.height,0)/Math.cos(n.b);a=m(a),r=m(r),o=m(o),s=m(s),i.drawingArea=Math.min(Math.round(t-(a+r)/2),Math.round(t-(o+s)/2)),i.setCenterPoint(a,r,o,s)},setCenterPoint:function(t,e,n,i){var a=this,r=a.width-e-a.drawingArea,o=t+a.drawingArea,s=n+a.drawingArea,l=a.height-i-a.drawingArea;a.xCenter=Math.round((o+r)/2+a.left),a.yCenter=Math.round((s+l)/2+a.top)},getIndexAngle:function(t){return t*(2*Math.PI/e(this))+(this.chart.options&&this.chart.options.startAngle?this.chart.options.startAngle:0)*Math.PI*2/360},getDistanceFromCenterForValue:function(t){var e=this;if(null===t)return 0;var n=e.drawingArea/(e.max-e.min);return e.options.ticks.reverse?(e.max-t)*n:(t-e.min)*n},getPointPosition:function(t,e){var n=this,i=n.getIndexAngle(t)-Math.PI/2;return{x:Math.round(Math.cos(i)*e)+n.xCenter,y:Math.round(Math.sin(i)*e)+n.yCenter}},getPointPositionForValue:function(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))},getBasePosition:function(){var t=this,e=t.min,n=t.max;return t.getPointPositionForValue(0,t.beginAtZero?0:e<0&&n<0?n:e>0&&n>0?e:0)},draw:function(){var t=this,e=t.options,n=e.gridLines,i=e.ticks,r=a.valueOrDefault;if(e.display){var o=t.ctx,s=this.getIndexAngle(0),l=r(i.fontSize,p.defaultFontSize),u=r(i.fontStyle,p.defaultFontStyle),d=r(i.fontFamily,p.defaultFontFamily),c=a.fontString(l,u,d);a.each(t.ticks,function(e,a){if(a>0||i.reverse){var u=t.getDistanceFromCenterForValue(t.ticksAsNumbers[a]);if(n.display&&0!==a&&g(t,n,u,a),i.display){var d=r(i.fontColor,p.defaultFontColor);if(o.font=c,o.save(),o.translate(t.xCenter,t.yCenter),o.rotate(s),i.showLabelBackdrop){var h=o.measureText(e).width;o.fillStyle=i.backdropColor,o.fillRect(-h/2-i.backdropPaddingX,-u-l/2-i.backdropPaddingY,h+2*i.backdropPaddingX,l+2*i.backdropPaddingY)}o.textAlign="center",o.textBaseline="middle",o.fillStyle=d,o.fillText(e,0,-u),o.restore()}}}),(e.angleLines.display||e.pointLabels.display)&&f(t)}}});t.scaleService.registerScaleType("radialLinear",y,v)}},{25:25,34:34,45:45}],57:[function(t,e,n){"use strict";function i(t,e){return t-e}function a(t){var e,n,i,a={},r=[];for(e=0,n=t.length;e<n;++e)a[i=t[e]]||(a[i]=!0,r.push(i));return r}function r(t,e,n,i){if("linear"===i||!t.length)return[{time:e,pos:0},{time:n,pos:1}];var a,r,o,s,l,u=[],d=[e];for(a=0,r=t.length;a<r;++a)(s=t[a])>e&&s<n&&d.push(s);for(d.push(n),a=0,r=d.length;a<r;++a)l=d[a+1],o=d[a-1],s=d[a],void 0!==o&&void 0!==l&&Math.round((l+o)/2)===s||u.push({time:s,pos:a/(r-1)});return u}function o(t,e,n){for(var i,a,r,o=0,s=t.length-1;o>=0&&o<=s;){if(i=o+s>>1,a=t[i-1]||null,r=t[i],!a)return{lo:null,hi:r};if(r[e]<n)o=i+1;else{if(!(a[e]>n))return{lo:a,hi:r};s=i-1}}return{lo:r,hi:null}}function s(t,e,n,i){var a=o(t,e,n),r=a.lo?a.hi?a.lo:t[t.length-2]:t[0],s=a.lo?a.hi?a.hi:t[t.length-1]:t[1],l=s[e]-r[e],u=l?(n-r[e])/l:0,d=(s[i]-r[i])*u;return r[i]+d}function l(t,e){var n=e.parser,i=e.parser||e.format;return"function"==typeof n?n(t):"string"==typeof t&&"string"==typeof i?v(t,i):(t instanceof v||(t=v(t)),t.isValid()?t:"function"==typeof i?i(t):t)}function u(t,e){if(b.isNullOrUndef(t))return null;var n=e.options.time,i=l(e.getRightValue(t),n);return i.isValid()?(n.round&&i.startOf(n.round),i.valueOf()):null}function d(t,e,n,i){var a,r,o,s=e-t,l=k[n],u=l.size,d=l.steps;if(!d)return Math.ceil(s/((i||1)*u));for(a=0,r=d.length;a<r&&(o=d[a],!(Math.ceil(s/(u*o))<=i));++a);return o}function c(t,e,n,i){var a,r,o,s=w.length;for(a=w.indexOf(t);a<s-1;++a)if(r=k[w[a]],o=r.steps?r.steps[r.steps.length-1]:_,r.common&&Math.ceil((n-e)/(o*r.size))<=i)return w[a];return w[s-1]}function h(t,e,n,i){var a,r,o=v.duration(v(i).diff(v(n)));for(a=w.length-1;a>=w.indexOf(e);a--)if(r=w[a],k[r].common&&o.as(r)>=t.length)return r;return w[e?w.indexOf(e):0]}function f(t){for(var e=w.indexOf(t)+1,n=w.length;e<n;++e)if(k[w[e]].common)return w[e]}function g(t,e,n,i){var a,r=i.time,o=r.unit||c(r.minUnit,t,e,n),s=f(o),l=b.valueOrDefault(r.stepSize,r.unitStepSize),u="week"===o&&r.isoWeekday,h=i.ticks.major.enabled,g=k[o],m=v(t),p=v(e),y=[];for(l||(l=d(t,e,o,n)),u&&(m=m.isoWeekday(u),p=p.isoWeekday(u)),m=m.startOf(u?"day":o),(p=p.startOf(u?"day":o))<e&&p.add(1,o),a=v(m),h&&s&&!u&&!r.round&&(a.startOf(s),a.add(~~((m-a)/(g.size*l))*l,o));a<p;a.add(l,o))y.push(+a);return y.push(+a),y}function m(t,e,n,i,a){var r,o,l=0,u=0;return a.offset&&e.length&&(a.time.min||(r=e.length>1?e[1]:i,o=e[0],l=(s(t,"time",r,"pos")-s(t,"time",o,"pos"))/2),a.time.max||(r=e[e.length-1],o=e.length>1?e[e.length-2]:n,u=(s(t,"time",r,"pos")-s(t,"time",o,"pos"))/2)),{left:l,right:u}}function p(t,e){var n,i,a,r,o=[];for(n=0,i=t.length;n<i;++n)a=t[n],r=!!e&&a===+v(a).startOf(e),o.push({value:a,major:r});return o}var v=t(6);v="function"==typeof v?v:window.moment;var y=t(25),b=t(45),x=Number.MIN_SAFE_INTEGER||-9007199254740991,_=Number.MAX_SAFE_INTEGER||9007199254740991,k={millisecond:{common:!0,size:1,steps:[1,2,5,10,20,50,100,250,500]},second:{common:!0,size:1e3,steps:[1,2,5,10,30]},minute:{common:!0,size:6e4,steps:[1,2,5,10,30]},hour:{common:!0,size:36e5,steps:[1,2,3,6,12]},day:{common:!0,size:864e5,steps:[1,2,5]},week:{common:!1,size:6048e5,steps:[1,2,3,4]},month:{common:!0,size:2628e6,steps:[1,2,3]},quarter:{common:!1,size:7884e6,steps:[1,2,3,4]},year:{common:!0,size:3154e7}},w=Object.keys(k);e.exports=function(t){var e=t.Scale.extend({initialize:function(){if(!v)throw new Error("Chart.js - Moment.js could not be found! You must include it before Chart.js to use the time scale. Download at https://momentjs.com");this.mergeTicksOptions(),t.Scale.prototype.initialize.call(this)},update:function(){var e=this,n=e.options;return n.time&&n.time.format&&console.warn("options.time.format is deprecated and replaced by options.time.parser."),t.Scale.prototype.update.apply(e,arguments)},getRightValue:function(e){return e&&void 0!==e.t&&(e=e.t),t.Scale.prototype.getRightValue.call(this,e)},determineDataLimits:function(){var t,e,n,r,o,s,l=this,d=l.chart,c=l.options.time,h=_,f=x,g=[],m=[],p=[];for(t=0,n=d.data.labels.length;t<n;++t)p.push(u(d.data.labels[t],l));for(t=0,n=(d.data.datasets||[]).length;t<n;++t)if(d.isDatasetVisible(t))if(o=d.data.datasets[t].data,b.isObject(o[0]))for(m[t]=[],e=0,r=o.length;e<r;++e)s=u(o[e],l),g.push(s),m[t][e]=s;else g.push.apply(g,p),m[t]=p.slice(0);else m[t]=[];p.length&&(p=a(p).sort(i),h=Math.min(h,p[0]),f=Math.max(f,p[p.length-1])),g.length&&(g=a(g).sort(i),h=Math.min(h,g[0]),f=Math.max(f,g[g.length-1])),h=u(c.min,l)||h,f=u(c.max,l)||f,h=h===_?+v().startOf("day"):h,f=f===x?+v().endOf("day")+1:f,l.min=Math.min(h,f),l.max=Math.max(h+1,f),l._horizontal=l.isHorizontal(),l._table=[],l._timestamps={data:g,datasets:m,labels:p}},buildTicks:function(){var t,e,n,i=this,a=i.min,o=i.max,s=i.options,l=s.time,d=[],c=[];switch(s.ticks.source){case"data":d=i._timestamps.data;break;case"labels":d=i._timestamps.labels;break;case"auto":default:d=g(a,o,i.getLabelCapacity(a),s)}for("ticks"===s.bounds&&d.length&&(a=d[0],o=d[d.length-1]),a=u(l.min,i)||a,o=u(l.max,i)||o,t=0,e=d.length;t<e;++t)(n=d[t])>=a&&n<=o&&c.push(n);return i.min=a,i.max=o,i._unit=l.unit||h(c,l.minUnit,i.min,i.max),i._majorUnit=f(i._unit),i._table=r(i._timestamps.data,a,o,s.distribution),i._offsets=m(i._table,c,a,o,s),p(c,i._majorUnit)},getLabelForIndex:function(t,e){var n=this,i=n.chart.data,a=n.options.time,r=i.labels&&t<i.labels.length?i.labels[t]:"",o=i.datasets[e].data[t];return b.isObject(o)&&(r=n.getRightValue(o)),a.tooltipFormat&&(r=l(r,a).format(a.tooltipFormat)),r},tickFormatFunction:function(t,e,n,i){var a=this,r=a.options,o=t.valueOf(),s=r.time.displayFormats,l=s[a._unit],u=a._majorUnit,d=s[u],c=t.clone().startOf(u).valueOf(),h=r.ticks.major,f=h.enabled&&u&&d&&o===c,g=t.format(i||(f?d:l)),m=f?h:r.ticks.minor,p=b.valueOrDefault(m.callback,m.userCallback);return p?p(g,e,n):g},convertTicksToLabels:function(t){var e,n,i=[];for(e=0,n=t.length;e<n;++e)i.push(this.tickFormatFunction(v(t[e].value),e,t));return i},getPixelForOffset:function(t){var e=this,n=e._horizontal?e.width:e.height,i=e._horizontal?e.left:e.top,a=s(e._table,"time",t,"pos");return i+n*(e._offsets.left+a)/(e._offsets.left+1+e._offsets.right)},getPixelForValue:function(t,e,n){var i=this,a=null;if(void 0!==e&&void 0!==n&&(a=i._timestamps.datasets[n][e]),null===a&&(a=u(t,i)),null!==a)return i.getPixelForOffset(a)},getPixelForTick:function(t){var e=this.getTicks();return t>=0&&t<e.length?this.getPixelForOffset(e[t].value):null},getValueForPixel:function(t){var e=this,n=e._horizontal?e.width:e.height,i=e._horizontal?e.left:e.top,a=(n?(t-i)/n:0)*(e._offsets.left+1+e._offsets.left)-e._offsets.right,r=s(e._table,"pos",a,"time");return v(r)},getLabelWidth:function(t){var e=this,n=e.options.ticks,i=e.ctx.measureText(t).width,a=b.toRadians(n.maxRotation),r=Math.cos(a),o=Math.sin(a);return i*r+b.valueOrDefault(n.fontSize,y.global.defaultFontSize)*o},getLabelCapacity:function(t){var e=this,n=e.options.time.displayFormats.millisecond,i=e.tickFormatFunction(v(t),0,[],n),a=e.getLabelWidth(i),r=e.isHorizontal()?e.width:e.height;return Math.floor(r/a)}});t.scaleService.registerScaleType("time",e,{position:"bottom",distribution:"linear",bounds:"data",time:{parser:!1,format:!1,unit:!1,round:!1,displayFormat:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{millisecond:"h:mm:ss.SSS a",second:"h:mm:ss a",minute:"h:mm a",hour:"hA",day:"MMM D",week:"ll",month:"MMM YYYY",quarter:"[Q]Q - YYYY",year:"YYYY"}},ticks:{autoSkip:!1,source:"auto",major:{enabled:!1}}})}},{25:25,45:45,6:6}]},{},[7])(7)});
1
  /*!
2
+ * Chart.js v2.8.0
3
+ * https://www.chartjs.org
4
+ * (c) 2019 Chart.js Contributors
5
+ * Released under the MIT License
 
 
 
6
  */
7
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(function(){try{return require("moment")}catch(t){}}()):"function"==typeof define&&define.amd?define(["require"],function(t){return e(function(){try{return t("moment")}catch(t){}}())}):t.Chart=e(t.moment)}(this,function(t){"use strict";t=t&&t.hasOwnProperty("default")?t.default:t;var e={rgb2hsl:i,rgb2hsv:n,rgb2hwb:a,rgb2cmyk:o,rgb2keyword:s,rgb2xyz:l,rgb2lab:d,rgb2lch:function(t){return x(d(t))},hsl2rgb:u,hsl2hsv:function(t){var e=t[0],i=t[1]/100,n=t[2]/100;if(0===n)return[0,0,0];return[e,100*(2*(i*=(n*=2)<=1?n:2-n)/(n+i)),100*((n+i)/2)]},hsl2hwb:function(t){return a(u(t))},hsl2cmyk:function(t){return o(u(t))},hsl2keyword:function(t){return s(u(t))},hsv2rgb:h,hsv2hsl:function(t){var e,i,n=t[0],a=t[1]/100,o=t[2]/100;return e=a*o,[n,100*(e=(e/=(i=(2-a)*o)<=1?i:2-i)||0),100*(i/=2)]},hsv2hwb:function(t){return a(h(t))},hsv2cmyk:function(t){return o(h(t))},hsv2keyword:function(t){return s(h(t))},hwb2rgb:c,hwb2hsl:function(t){return i(c(t))},hwb2hsv:function(t){return n(c(t))},hwb2cmyk:function(t){return o(c(t))},hwb2keyword:function(t){return s(c(t))},cmyk2rgb:f,cmyk2hsl:function(t){return i(f(t))},cmyk2hsv:function(t){return n(f(t))},cmyk2hwb:function(t){return a(f(t))},cmyk2keyword:function(t){return s(f(t))},keyword2rgb:w,keyword2hsl:function(t){return i(w(t))},keyword2hsv:function(t){return n(w(t))},keyword2hwb:function(t){return a(w(t))},keyword2cmyk:function(t){return o(w(t))},keyword2lab:function(t){return d(w(t))},keyword2xyz:function(t){return l(w(t))},xyz2rgb:p,xyz2lab:m,xyz2lch:function(t){return x(m(t))},lab2xyz:v,lab2rgb:y,lab2lch:x,lch2lab:k,lch2xyz:function(t){return v(k(t))},lch2rgb:function(t){return y(k(t))}};function i(t){var e,i,n=t[0]/255,a=t[1]/255,o=t[2]/255,r=Math.min(n,a,o),s=Math.max(n,a,o),l=s-r;return s==r?e=0:n==s?e=(a-o)/l:a==s?e=2+(o-n)/l:o==s&&(e=4+(n-a)/l),(e=Math.min(60*e,360))<0&&(e+=360),i=(r+s)/2,[e,100*(s==r?0:i<=.5?l/(s+r):l/(2-s-r)),100*i]}function n(t){var e,i,n=t[0],a=t[1],o=t[2],r=Math.min(n,a,o),s=Math.max(n,a,o),l=s-r;return i=0==s?0:l/s*1e3/10,s==r?e=0:n==s?e=(a-o)/l:a==s?e=2+(o-n)/l:o==s&&(e=4+(n-a)/l),(e=Math.min(60*e,360))<0&&(e+=360),[e,i,s/255*1e3/10]}function a(t){var e=t[0],n=t[1],a=t[2];return[i(t)[0],100*(1/255*Math.min(e,Math.min(n,a))),100*(a=1-1/255*Math.max(e,Math.max(n,a)))]}function o(t){var e,i=t[0]/255,n=t[1]/255,a=t[2]/255;return[100*((1-i-(e=Math.min(1-i,1-n,1-a)))/(1-e)||0),100*((1-n-e)/(1-e)||0),100*((1-a-e)/(1-e)||0),100*e]}function s(t){return _[JSON.stringify(t)]}function l(t){var e=t[0]/255,i=t[1]/255,n=t[2]/255;return[100*(.4124*(e=e>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92)+.3576*(i=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92)+.1805*(n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92)),100*(.2126*e+.7152*i+.0722*n),100*(.0193*e+.1192*i+.9505*n)]}function d(t){var e=l(t),i=e[0],n=e[1],a=e[2];return n/=100,a/=108.883,i=(i/=95.047)>.008856?Math.pow(i,1/3):7.787*i+16/116,[116*(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116)-16,500*(i-n),200*(n-(a=a>.008856?Math.pow(a,1/3):7.787*a+16/116))]}function u(t){var e,i,n,a,o,r=t[0]/360,s=t[1]/100,l=t[2]/100;if(0==s)return[o=255*l,o,o];e=2*l-(i=l<.5?l*(1+s):l+s-l*s),a=[0,0,0];for(var d=0;d<3;d++)(n=r+1/3*-(d-1))<0&&n++,n>1&&n--,o=6*n<1?e+6*(i-e)*n:2*n<1?i:3*n<2?e+(i-e)*(2/3-n)*6:e,a[d]=255*o;return a}function h(t){var e=t[0]/60,i=t[1]/100,n=t[2]/100,a=Math.floor(e)%6,o=e-Math.floor(e),r=255*n*(1-i),s=255*n*(1-i*o),l=255*n*(1-i*(1-o));n*=255;switch(a){case 0:return[n,l,r];case 1:return[s,n,r];case 2:return[r,n,l];case 3:return[r,s,n];case 4:return[l,r,n];case 5:return[n,r,s]}}function c(t){var e,i,n,a,o=t[0]/360,s=t[1]/100,l=t[2]/100,d=s+l;switch(d>1&&(s/=d,l/=d),n=6*o-(e=Math.floor(6*o)),0!=(1&e)&&(n=1-n),a=s+n*((i=1-l)-s),e){default:case 6:case 0:r=i,g=a,b=s;break;case 1:r=a,g=i,b=s;break;case 2:r=s,g=i,b=a;break;case 3:r=s,g=a,b=i;break;case 4:r=a,g=s,b=i;break;case 5:r=i,g=s,b=a}return[255*r,255*g,255*b]}function f(t){var e=t[0]/100,i=t[1]/100,n=t[2]/100,a=t[3]/100;return[255*(1-Math.min(1,e*(1-a)+a)),255*(1-Math.min(1,i*(1-a)+a)),255*(1-Math.min(1,n*(1-a)+a))]}function p(t){var e,i,n,a=t[0]/100,o=t[1]/100,r=t[2]/100;return i=-.9689*a+1.8758*o+.0415*r,n=.0557*a+-.204*o+1.057*r,e=(e=3.2406*a+-1.5372*o+-.4986*r)>.0031308?1.055*Math.pow(e,1/2.4)-.055:e*=12.92,i=i>.0031308?1.055*Math.pow(i,1/2.4)-.055:i*=12.92,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:n*=12.92,[255*(e=Math.min(Math.max(0,e),1)),255*(i=Math.min(Math.max(0,i),1)),255*(n=Math.min(Math.max(0,n),1))]}function m(t){var e=t[0],i=t[1],n=t[2];return i/=100,n/=108.883,e=(e/=95.047)>.008856?Math.pow(e,1/3):7.787*e+16/116,[116*(i=i>.008856?Math.pow(i,1/3):7.787*i+16/116)-16,500*(e-i),200*(i-(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116))]}function v(t){var e,i,n,a,o=t[0],r=t[1],s=t[2];return o<=8?a=(i=100*o/903.3)/100*7.787+16/116:(i=100*Math.pow((o+16)/116,3),a=Math.pow(i/100,1/3)),[e=e/95.047<=.008856?e=95.047*(r/500+a-16/116)/7.787:95.047*Math.pow(r/500+a,3),i,n=n/108.883<=.008859?n=108.883*(a-s/200-16/116)/7.787:108.883*Math.pow(a-s/200,3)]}function x(t){var e,i=t[0],n=t[1],a=t[2];return(e=360*Math.atan2(a,n)/2/Math.PI)<0&&(e+=360),[i,Math.sqrt(n*n+a*a),e]}function y(t){return p(v(t))}function k(t){var e,i=t[0],n=t[1];return e=t[2]/360*2*Math.PI,[i,n*Math.cos(e),n*Math.sin(e)]}function w(t){return M[t]}var M={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},_={};for(var C in M)_[JSON.stringify(M[C])]=C;var S=function(){return new T};for(var P in e){S[P+"Raw"]=function(t){return function(i){return"number"==typeof i&&(i=Array.prototype.slice.call(arguments)),e[t](i)}}(P);var I=/(\w+)2(\w+)/.exec(P),A=I[1],D=I[2];(S[A]=S[A]||{})[D]=S[P]=function(t){return function(i){"number"==typeof i&&(i=Array.prototype.slice.call(arguments));var n=e[t](i);if("string"==typeof n||void 0===n)return n;for(var a=0;a<n.length;a++)n[a]=Math.round(n[a]);return n}}(P)}var T=function(){this.convs={}};T.prototype.routeSpace=function(t,e){var i=e[0];return void 0===i?this.getValues(t):("number"==typeof i&&(i=Array.prototype.slice.call(e)),this.setValues(t,i))},T.prototype.setValues=function(t,e){return this.space=t,this.convs={},this.convs[t]=e,this},T.prototype.getValues=function(t){var e=this.convs[t];if(!e){var i=this.space,n=this.convs[i];e=S[i][t](n),this.convs[t]=e}return e},["rgb","hsl","hsv","cmyk","keyword"].forEach(function(t){T.prototype[t]=function(e){return this.routeSpace(t,arguments)}});var F=S,L={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},R={getRgba:O,getHsla:z,getRgb:function(t){var e=O(t);return e&&e.slice(0,3)},getHsl:function(t){var e=z(t);return e&&e.slice(0,3)},getHwb:B,getAlpha:function(t){var e=O(t);if(e)return e[3];if(e=z(t))return e[3];if(e=B(t))return e[3]},hexString:function(t,e){var e=void 0!==e&&3===t.length?e:t[3];return"#"+H(t[0])+H(t[1])+H(t[2])+(e>=0&&e<1?H(Math.round(255*e)):"")},rgbString:function(t,e){if(e<1||t[3]&&t[3]<1)return N(t,e);return"rgb("+t[0]+", "+t[1]+", "+t[2]+")"},rgbaString:N,percentString:function(t,e){if(e<1||t[3]&&t[3]<1)return W(t,e);var i=Math.round(t[0]/255*100),n=Math.round(t[1]/255*100),a=Math.round(t[2]/255*100);return"rgb("+i+"%, "+n+"%, "+a+"%)"},percentaString:W,hslString:function(t,e){if(e<1||t[3]&&t[3]<1)return V(t,e);return"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)"},hslaString:V,hwbString:function(t,e){void 0===e&&(e=void 0!==t[3]?t[3]:1);return"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+(void 0!==e&&1!==e?", "+e:"")+")"},keyword:function(t){return j[t.slice(0,3)]}};function O(t){if(t){var e=[0,0,0],i=1,n=t.match(/^#([a-fA-F0-9]{3,4})$/i),a="";if(n){a=(n=n[1])[3];for(var o=0;o<e.length;o++)e[o]=parseInt(n[o]+n[o],16);a&&(i=Math.round(parseInt(a+a,16)/255*100)/100)}else if(n=t.match(/^#([a-fA-F0-9]{6}([a-fA-F0-9]{2})?)$/i)){a=n[2],n=n[1];for(o=0;o<e.length;o++)e[o]=parseInt(n.slice(2*o,2*o+2),16);a&&(i=Math.round(parseInt(a,16)/255*100)/100)}else if(n=t.match(/^rgba?\(\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/i)){for(o=0;o<e.length;o++)e[o]=parseInt(n[o+1]);i=parseFloat(n[4])}else if(n=t.match(/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/i)){for(o=0;o<e.length;o++)e[o]=Math.round(2.55*parseFloat(n[o+1]));i=parseFloat(n[4])}else if(n=t.match(/(\w+)/)){if("transparent"==n[1])return[0,0,0,0];if(!(e=L[n[1]]))return}for(o=0;o<e.length;o++)e[o]=E(e[o],0,255);return i=i||0==i?E(i,0,1):1,e[3]=i,e}}function z(t){if(t){var e=t.match(/^hsla?\(\s*([+-]?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)/);if(e){var i=parseFloat(e[4]);return[E(parseInt(e[1]),0,360),E(parseFloat(e[2]),0,100),E(parseFloat(e[3]),0,100),E(isNaN(i)?1:i,0,1)]}}}function B(t){if(t){var e=t.match(/^hwb\(\s*([+-]?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)/);if(e){var i=parseFloat(e[4]);return[E(parseInt(e[1]),0,360),E(parseFloat(e[2]),0,100),E(parseFloat(e[3]),0,100),E(isNaN(i)?1:i,0,1)]}}}function N(t,e){return void 0===e&&(e=void 0!==t[3]?t[3]:1),"rgba("+t[0]+", "+t[1]+", "+t[2]+", "+e+")"}function W(t,e){return"rgba("+Math.round(t[0]/255*100)+"%, "+Math.round(t[1]/255*100)+"%, "+Math.round(t[2]/255*100)+"%, "+(e||t[3]||1)+")"}function V(t,e){return void 0===e&&(e=void 0!==t[3]?t[3]:1),"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+e+")"}function E(t,e,i){return Math.min(Math.max(e,t),i)}function H(t){var e=t.toString(16).toUpperCase();return e.length<2?"0"+e:e}var j={};for(var q in L)j[L[q]]=q;var Y=function(t){return t instanceof Y?t:this instanceof Y?(this.valid=!1,this.values={rgb:[0,0,0],hsl:[0,0,0],hsv:[0,0,0],hwb:[0,0,0],cmyk:[0,0,0,0],alpha:1},void("string"==typeof t?(e=R.getRgba(t))?this.setValues("rgb",e):(e=R.getHsla(t))?this.setValues("hsl",e):(e=R.getHwb(t))&&this.setValues("hwb",e):"object"==typeof t&&(void 0!==(e=t).r||void 0!==e.red?this.setValues("rgb",e):void 0!==e.l||void 0!==e.lightness?this.setValues("hsl",e):void 0!==e.v||void 0!==e.value?this.setValues("hsv",e):void 0!==e.w||void 0!==e.whiteness?this.setValues("hwb",e):void 0===e.c&&void 0===e.cyan||this.setValues("cmyk",e)))):new Y(t);var e};Y.prototype={isValid:function(){return this.valid},rgb:function(){return this.setSpace("rgb",arguments)},hsl:function(){return this.setSpace("hsl",arguments)},hsv:function(){return this.setSpace("hsv",arguments)},hwb:function(){return this.setSpace("hwb",arguments)},cmyk:function(){return this.setSpace("cmyk",arguments)},rgbArray:function(){return this.values.rgb},hslArray:function(){return this.values.hsl},hsvArray:function(){return this.values.hsv},hwbArray:function(){var t=this.values;return 1!==t.alpha?t.hwb.concat([t.alpha]):t.hwb},cmykArray:function(){return this.values.cmyk},rgbaArray:function(){var t=this.values;return t.rgb.concat([t.alpha])},hslaArray:function(){var t=this.values;return t.hsl.concat([t.alpha])},alpha:function(t){return void 0===t?this.values.alpha:(this.setValues("alpha",t),this)},red:function(t){return this.setChannel("rgb",0,t)},green:function(t){return this.setChannel("rgb",1,t)},blue:function(t){return this.setChannel("rgb",2,t)},hue:function(t){return t&&(t=(t%=360)<0?360+t:t),this.setChannel("hsl",0,t)},saturation:function(t){return this.setChannel("hsl",1,t)},lightness:function(t){return this.setChannel("hsl",2,t)},saturationv:function(t){return this.setChannel("hsv",1,t)},whiteness:function(t){return this.setChannel("hwb",1,t)},blackness:function(t){return this.setChannel("hwb",2,t)},value:function(t){return this.setChannel("hsv",2,t)},cyan:function(t){return this.setChannel("cmyk",0,t)},magenta:function(t){return this.setChannel("cmyk",1,t)},yellow:function(t){return this.setChannel("cmyk",2,t)},black:function(t){return this.setChannel("cmyk",3,t)},hexString:function(){return R.hexString(this.values.rgb)},rgbString:function(){return R.rgbString(this.values.rgb,this.values.alpha)},rgbaString:function(){return R.rgbaString(this.values.rgb,this.values.alpha)},percentString:function(){return R.percentString(this.values.rgb,this.values.alpha)},hslString:function(){return R.hslString(this.values.hsl,this.values.alpha)},hslaString:function(){return R.hslaString(this.values.hsl,this.values.alpha)},hwbString:function(){return R.hwbString(this.values.hwb,this.values.alpha)},keyword:function(){return R.keyword(this.values.rgb,this.values.alpha)},rgbNumber:function(){var t=this.values.rgb;return t[0]<<16|t[1]<<8|t[2]},luminosity:function(){for(var t=this.values.rgb,e=[],i=0;i<t.length;i++){var n=t[i]/255;e[i]=n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4)}return.2126*e[0]+.7152*e[1]+.0722*e[2]},contrast:function(t){var e=this.luminosity(),i=t.luminosity();return e>i?(e+.05)/(i+.05):(i+.05)/(e+.05)},level:function(t){var e=this.contrast(t);return e>=7.1?"AAA":e>=4.5?"AA":""},dark:function(){var t=this.values.rgb;return(299*t[0]+587*t[1]+114*t[2])/1e3<128},light:function(){return!this.dark()},negate:function(){for(var t=[],e=0;e<3;e++)t[e]=255-this.values.rgb[e];return this.setValues("rgb",t),this},lighten:function(t){var e=this.values.hsl;return e[2]+=e[2]*t,this.setValues("hsl",e),this},darken:function(t){var e=this.values.hsl;return e[2]-=e[2]*t,this.setValues("hsl",e),this},saturate:function(t){var e=this.values.hsl;return e[1]+=e[1]*t,this.setValues("hsl",e),this},desaturate:function(t){var e=this.values.hsl;return e[1]-=e[1]*t,this.setValues("hsl",e),this},whiten:function(t){var e=this.values.hwb;return e[1]+=e[1]*t,this.setValues("hwb",e),this},blacken:function(t){var e=this.values.hwb;return e[2]+=e[2]*t,this.setValues("hwb",e),this},greyscale:function(){var t=this.values.rgb,e=.3*t[0]+.59*t[1]+.11*t[2];return this.setValues("rgb",[e,e,e]),this},clearer:function(t){var e=this.values.alpha;return this.setValues("alpha",e-e*t),this},opaquer:function(t){var e=this.values.alpha;return this.setValues("alpha",e+e*t),this},rotate:function(t){var e=this.values.hsl,i=(e[0]+t)%360;return e[0]=i<0?360+i:i,this.setValues("hsl",e),this},mix:function(t,e){var i=t,n=void 0===e?.5:e,a=2*n-1,o=this.alpha()-i.alpha(),r=((a*o==-1?a:(a+o)/(1+a*o))+1)/2,s=1-r;return this.rgb(r*this.red()+s*i.red(),r*this.green()+s*i.green(),r*this.blue()+s*i.blue()).alpha(this.alpha()*n+i.alpha()*(1-n))},toJSON:function(){return this.rgb()},clone:function(){var t,e,i=new Y,n=this.values,a=i.values;for(var o in n)n.hasOwnProperty(o)&&(t=n[o],"[object Array]"===(e={}.toString.call(t))?a[o]=t.slice(0):"[object Number]"===e?a[o]=t:console.error("unexpected color value:",t));return i}},Y.prototype.spaces={rgb:["red","green","blue"],hsl:["hue","saturation","lightness"],hsv:["hue","saturation","value"],hwb:["hue","whiteness","blackness"],cmyk:["cyan","magenta","yellow","black"]},Y.prototype.maxes={rgb:[255,255,255],hsl:[360,100,100],hsv:[360,100,100],hwb:[360,100,100],cmyk:[100,100,100,100]},Y.prototype.getValues=function(t){for(var e=this.values,i={},n=0;n<t.length;n++)i[t.charAt(n)]=e[t][n];return 1!==e.alpha&&(i.a=e.alpha),i},Y.prototype.setValues=function(t,e){var i,n,a=this.values,o=this.spaces,r=this.maxes,s=1;if(this.valid=!0,"alpha"===t)s=e;else if(e.length)a[t]=e.slice(0,t.length),s=e[t.length];else if(void 0!==e[t.charAt(0)]){for(i=0;i<t.length;i++)a[t][i]=e[t.charAt(i)];s=e.a}else if(void 0!==e[o[t][0]]){var l=o[t];for(i=0;i<t.length;i++)a[t][i]=e[l[i]];s=e.alpha}if(a.alpha=Math.max(0,Math.min(1,void 0===s?a.alpha:s)),"alpha"===t)return!1;for(i=0;i<t.length;i++)n=Math.max(0,Math.min(r[t][i],a[t][i])),a[t][i]=Math.round(n);for(var d in o)d!==t&&(a[d]=F[t][d](a[t]));return!0},Y.prototype.setSpace=function(t,e){var i=e[0];return void 0===i?this.getValues(t):("number"==typeof i&&(i=Array.prototype.slice.call(e)),this.setValues(t,i),this)},Y.prototype.setChannel=function(t,e,i){var n=this.values[t];return void 0===i?n[e]:i===n[e]?this:(n[e]=i,this.setValues(t,n),this)},"undefined"!=typeof window&&(window.Color=Y);var U,X=Y,K={noop:function(){},uid:(U=0,function(){return U++}),isNullOrUndef:function(t){return null==t},isArray:function(t){if(Array.isArray&&Array.isArray(t))return!0;var e=Object.prototype.toString.call(t);return"[object"===e.substr(0,7)&&"Array]"===e.substr(-6)},isObject:function(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)},isFinite:function(t){return("number"==typeof t||t instanceof Number)&&isFinite(t)},valueOrDefault:function(t,e){return void 0===t?e:t},valueAtIndexOrDefault:function(t,e,i){return K.valueOrDefault(K.isArray(t)?t[e]:t,i)},callback:function(t,e,i){if(t&&"function"==typeof t.call)return t.apply(i,e)},each:function(t,e,i,n){var a,o,r;if(K.isArray(t))if(o=t.length,n)for(a=o-1;a>=0;a--)e.call(i,t[a],a);else for(a=0;a<o;a++)e.call(i,t[a],a);else if(K.isObject(t))for(o=(r=Object.keys(t)).length,a=0;a<o;a++)e.call(i,t[r[a]],r[a])},arrayEquals:function(t,e){var i,n,a,o;if(!t||!e||t.length!==e.length)return!1;for(i=0,n=t.length;i<n;++i)if(a=t[i],o=e[i],a instanceof Array&&o instanceof Array){if(!K.arrayEquals(a,o))return!1}else if(a!==o)return!1;return!0},clone:function(t){if(K.isArray(t))return t.map(K.clone);if(K.isObject(t)){for(var e={},i=Object.keys(t),n=i.length,a=0;a<n;++a)e[i[a]]=K.clone(t[i[a]]);return e}return t},_merger:function(t,e,i,n){var a=e[t],o=i[t];K.isObject(a)&&K.isObject(o)?K.merge(a,o,n):e[t]=K.clone(o)},_mergerIf:function(t,e,i){var n=e[t],a=i[t];K.isObject(n)&&K.isObject(a)?K.mergeIf(n,a):e.hasOwnProperty(t)||(e[t]=K.clone(a))},merge:function(t,e,i){var n,a,o,r,s,l=K.isArray(e)?e:[e],d=l.length;if(!K.isObject(t))return t;for(n=(i=i||{}).merger||K._merger,a=0;a<d;++a)if(e=l[a],K.isObject(e))for(s=0,r=(o=Object.keys(e)).length;s<r;++s)n(o[s],t,e,i);return t},mergeIf:function(t,e){return K.merge(t,e,{merger:K._mergerIf})},extend:function(t){for(var e=function(e,i){t[i]=e},i=1,n=arguments.length;i<n;++i)K.each(arguments[i],e);return t},inherits:function(t){var e=this,i=t&&t.hasOwnProperty("constructor")?t.constructor:function(){return e.apply(this,arguments)},n=function(){this.constructor=i};return n.prototype=e.prototype,i.prototype=new n,i.extend=K.inherits,t&&K.extend(i.prototype,t),i.__super__=e.prototype,i}},G=K;K.callCallback=K.callback,K.indexOf=function(t,e,i){return Array.prototype.indexOf.call(t,e,i)},K.getValueOrDefault=K.valueOrDefault,K.getValueAtIndexOrDefault=K.valueAtIndexOrDefault;var Z={linear:function(t){return t},easeInQuad:function(t){return t*t},easeOutQuad:function(t){return-t*(t-2)},easeInOutQuad:function(t){return(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1)},easeInCubic:function(t){return t*t*t},easeOutCubic:function(t){return(t-=1)*t*t+1},easeInOutCubic:function(t){return(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},easeInQuart:function(t){return t*t*t*t},easeOutQuart:function(t){return-((t-=1)*t*t*t-1)},easeInOutQuart:function(t){return(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)},easeInQuint:function(t){return t*t*t*t*t},easeOutQuint:function(t){return(t-=1)*t*t*t*t+1},easeInOutQuint:function(t){return(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)},easeInSine:function(t){return 1-Math.cos(t*(Math.PI/2))},easeOutSine:function(t){return Math.sin(t*(Math.PI/2))},easeInOutSine:function(t){return-.5*(Math.cos(Math.PI*t)-1)},easeInExpo:function(t){return 0===t?0:Math.pow(2,10*(t-1))},easeOutExpo:function(t){return 1===t?1:1-Math.pow(2,-10*t)},easeInOutExpo:function(t){return 0===t?0:1===t?1:(t/=.5)<1?.5*Math.pow(2,10*(t-1)):.5*(2-Math.pow(2,-10*--t))},easeInCirc:function(t){return t>=1?t:-(Math.sqrt(1-t*t)-1)},easeOutCirc:function(t){return Math.sqrt(1-(t-=1)*t)},easeInOutCirc:function(t){return(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},easeInElastic:function(t){var e=1.70158,i=0,n=1;return 0===t?0:1===t?1:(i||(i=.3),n<1?(n=1,e=i/4):e=i/(2*Math.PI)*Math.asin(1/n),-n*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/i))},easeOutElastic:function(t){var e=1.70158,i=0,n=1;return 0===t?0:1===t?1:(i||(i=.3),n<1?(n=1,e=i/4):e=i/(2*Math.PI)*Math.asin(1/n),n*Math.pow(2,-10*t)*Math.sin((t-e)*(2*Math.PI)/i)+1)},easeInOutElastic:function(t){var e=1.70158,i=0,n=1;return 0===t?0:2==(t/=.5)?1:(i||(i=.45),n<1?(n=1,e=i/4):e=i/(2*Math.PI)*Math.asin(1/n),t<1?n*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/i)*-.5:n*Math.pow(2,-10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/i)*.5+1)},easeInBack:function(t){var e=1.70158;return t*t*((e+1)*t-e)},easeOutBack:function(t){var e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},easeInOutBack:function(t){var e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},easeInBounce:function(t){return 1-Z.easeOutBounce(1-t)},easeOutBounce:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},easeInOutBounce:function(t){return t<.5?.5*Z.easeInBounce(2*t):.5*Z.easeOutBounce(2*t-1)+.5}},$={effects:Z};G.easingEffects=Z;var J=Math.PI,Q=J/180,tt=2*J,et=J/2,it=J/4,nt=2*J/3,at={clear:function(t){t.ctx.clearRect(0,0,t.width,t.height)},roundedRect:function(t,e,i,n,a,o){if(o){var r=Math.min(o,a/2,n/2),s=e+r,l=i+r,d=e+n-r,u=i+a-r;t.moveTo(e,l),s<d&&l<u?(t.arc(s,l,r,-J,-et),t.arc(d,l,r,-et,0),t.arc(d,u,r,0,et),t.arc(s,u,r,et,J)):s<d?(t.moveTo(s,i),t.arc(d,l,r,-et,et),t.arc(s,l,r,et,J+et)):l<u?(t.arc(s,l,r,-J,0),t.arc(s,u,r,0,J)):t.arc(s,l,r,-J,J),t.closePath(),t.moveTo(e,i)}else t.rect(e,i,n,a)},drawPoint:function(t,e,i,n,a,o){var r,s,l,d,u,h=(o||0)*Q;if(!e||"object"!=typeof e||"[object HTMLImageElement]"!==(r=e.toString())&&"[object HTMLCanvasElement]"!==r){if(!(isNaN(i)||i<=0)){switch(t.beginPath(),e){default:t.arc(n,a,i,0,tt),t.closePath();break;case"triangle":t.moveTo(n+Math.sin(h)*i,a-Math.cos(h)*i),h+=nt,t.lineTo(n+Math.sin(h)*i,a-Math.cos(h)*i),h+=nt,t.lineTo(n+Math.sin(h)*i,a-Math.cos(h)*i),t.closePath();break;case"rectRounded":d=i-(u=.516*i),s=Math.cos(h+it)*d,l=Math.sin(h+it)*d,t.arc(n-s,a-l,u,h-J,h-et),t.arc(n+l,a-s,u,h-et,h),t.arc(n+s,a+l,u,h,h+et),t.arc(n-l,a+s,u,h+et,h+J),t.closePath();break;case"rect":if(!o){d=Math.SQRT1_2*i,t.rect(n-d,a-d,2*d,2*d);break}h+=it;case"rectRot":s=Math.cos(h)*i,l=Math.sin(h)*i,t.moveTo(n-s,a-l),t.lineTo(n+l,a-s),t.lineTo(n+s,a+l),t.lineTo(n-l,a+s),t.closePath();break;case"crossRot":h+=it;case"cross":s=Math.cos(h)*i,l=Math.sin(h)*i,t.moveTo(n-s,a-l),t.lineTo(n+s,a+l),t.moveTo(n+l,a-s),t.lineTo(n-l,a+s);break;case"star":s=Math.cos(h)*i,l=Math.sin(h)*i,t.moveTo(n-s,a-l),t.lineTo(n+s,a+l),t.moveTo(n+l,a-s),t.lineTo(n-l,a+s),h+=it,s=Math.cos(h)*i,l=Math.sin(h)*i,t.moveTo(n-s,a-l),t.lineTo(n+s,a+l),t.moveTo(n+l,a-s),t.lineTo(n-l,a+s);break;case"line":s=Math.cos(h)*i,l=Math.sin(h)*i,t.moveTo(n-s,a-l),t.lineTo(n+s,a+l);break;case"dash":t.moveTo(n,a),t.lineTo(n+Math.cos(h)*i,a+Math.sin(h)*i)}t.fill(),t.stroke()}}else t.drawImage(e,n-e.width/2,a-e.height/2,e.width,e.height)},_isPointInArea:function(t,e){return t.x>e.left-1e-6&&t.x<e.right+1e-6&&t.y>e.top-1e-6&&t.y<e.bottom+1e-6},clipArea:function(t,e){t.save(),t.beginPath(),t.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),t.clip()},unclipArea:function(t){t.restore()},lineTo:function(t,e,i,n){var a=i.steppedLine;if(a){if("middle"===a){var o=(e.x+i.x)/2;t.lineTo(o,n?i.y:e.y),t.lineTo(o,n?e.y:i.y)}else"after"===a&&!n||"after"!==a&&n?t.lineTo(e.x,i.y):t.lineTo(i.x,e.y);t.lineTo(i.x,i.y)}else i.tension?t.bezierCurveTo(n?e.controlPointPreviousX:e.controlPointNextX,n?e.controlPointPreviousY:e.controlPointNextY,n?i.controlPointNextX:i.controlPointPreviousX,n?i.controlPointNextY:i.controlPointPreviousY,i.x,i.y):t.lineTo(i.x,i.y)}},ot=at;G.clear=at.clear,G.drawRoundedRectangle=function(t){t.beginPath(),at.roundedRect.apply(at,arguments)};var rt={_set:function(t,e){return G.merge(this[t]||(this[t]={}),e)}};rt._set("global",{defaultColor:"rgba(0,0,0,0.1)",defaultFontColor:"#666",defaultFontFamily:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",defaultFontSize:12,defaultFontStyle:"normal",defaultLineHeight:1.2,showLines:!0});var st=rt,lt=G.valueOrDefault;var dt={toLineHeight:function(t,e){var i=(""+t).match(/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/);if(!i||"normal"===i[1])return 1.2*e;switch(t=+i[2],i[3]){case"px":return t;case"%":t/=100}return e*t},toPadding:function(t){var e,i,n,a;return G.isObject(t)?(e=+t.top||0,i=+t.right||0,n=+t.bottom||0,a=+t.left||0):e=i=n=a=+t||0,{top:e,right:i,bottom:n,left:a,height:e+n,width:a+i}},_parseFont:function(t){var e=st.global,i=lt(t.fontSize,e.defaultFontSize),n={family:lt(t.fontFamily,e.defaultFontFamily),lineHeight:G.options.toLineHeight(lt(t.lineHeight,e.defaultLineHeight),i),size:i,style:lt(t.fontStyle,e.defaultFontStyle),weight:null,string:""};return n.string=function(t){return!t||G.isNullOrUndef(t.size)||G.isNullOrUndef(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}(n),n},resolve:function(t,e,i){var n,a,o;for(n=0,a=t.length;n<a;++n)if(void 0!==(o=t[n])&&(void 0!==e&&"function"==typeof o&&(o=o(e)),void 0!==i&&G.isArray(o)&&(o=o[i]),void 0!==o))return o}},ut=G,ht=$,ct=ot,ft=dt;ut.easing=ht,ut.canvas=ct,ut.options=ft;var gt=function(t){ut.extend(this,t),this.initialize.apply(this,arguments)};ut.extend(gt.prototype,{initialize:function(){this.hidden=!1},pivot:function(){var t=this;return t._view||(t._view=ut.clone(t._model)),t._start={},t},transition:function(t){var e=this,i=e._model,n=e._start,a=e._view;return i&&1!==t?(a||(a=e._view={}),n||(n=e._start={}),function(t,e,i,n){var a,o,r,s,l,d,u,h,c,f=Object.keys(i);for(a=0,o=f.length;a<o;++a)if(d=i[r=f[a]],e.hasOwnProperty(r)||(e[r]=d),(s=e[r])!==d&&"_"!==r[0]){if(t.hasOwnProperty(r)||(t[r]=s),(u=typeof d)==typeof(l=t[r]))if("string"===u){if((h=X(l)).valid&&(c=X(d)).valid){e[r]=c.mix(h,n).rgbString();continue}}else if(ut.isFinite(l)&&ut.isFinite(d)){e[r]=l+(d-l)*n;continue}e[r]=d}}(n,a,i,t),e):(e._view=i,e._start=null,e)},tooltipPosition:function(){return{x:this._model.x,y:this._model.y}},hasValue:function(){return ut.isNumber(this._model.x)&&ut.isNumber(this._model.y)}}),gt.extend=ut.inherits;var pt=gt,mt=pt.extend({chart:null,currentStep:0,numSteps:60,easing:"",render:null,onAnimationProgress:null,onAnimationComplete:null}),vt=mt;Object.defineProperty(mt.prototype,"animationObject",{get:function(){return this}}),Object.defineProperty(mt.prototype,"chartInstance",{get:function(){return this.chart},set:function(t){this.chart=t}}),st._set("global",{animation:{duration:1e3,easing:"easeOutQuart",onProgress:ut.noop,onComplete:ut.noop}});var bt={animations:[],request:null,addAnimation:function(t,e,i,n){var a,o,r=this.animations;for(e.chart=t,e.startTime=Date.now(),e.duration=i,n||(t.animating=!0),a=0,o=r.length;a<o;++a)if(r[a].chart===t)return void(r[a]=e);r.push(e),1===r.length&&this.requestAnimationFrame()},cancelAnimation:function(t){var e=ut.findIndex(this.animations,function(e){return e.chart===t});-1!==e&&(this.animations.splice(e,1),t.animating=!1)},requestAnimationFrame:function(){var t=this;null===t.request&&(t.request=ut.requestAnimFrame.call(window,function(){t.request=null,t.startDigest()}))},startDigest:function(){this.advance(),this.animations.length>0&&this.requestAnimationFrame()},advance:function(){for(var t,e,i,n,a=this.animations,o=0;o<a.length;)e=(t=a[o]).chart,i=t.numSteps,n=Math.floor((Date.now()-t.startTime)/t.duration*i)+1,t.currentStep=Math.min(n,i),ut.callback(t.render,[e,t],e),ut.callback(t.onAnimationProgress,[t],e),t.currentStep>=i?(ut.callback(t.onAnimationComplete,[t],e),e.animating=!1,a.splice(o,1)):++o}},xt=ut.options.resolve,yt=["push","pop","shift","splice","unshift"];function kt(t,e){var i=t._chartjs;if(i){var n=i.listeners,a=n.indexOf(e);-1!==a&&n.splice(a,1),n.length>0||(yt.forEach(function(e){delete t[e]}),delete t._chartjs)}}var wt=function(t,e){this.initialize(t,e)};ut.extend(wt.prototype,{datasetElementType:null,dataElementType:null,initialize:function(t,e){this.chart=t,this.index=e,this.linkScales(),this.addElements()},updateIndex:function(t){this.index=t},linkScales:function(){var t=this,e=t.getMeta(),i=t.getDataset();null!==e.xAxisID&&e.xAxisID in t.chart.scales||(e.xAxisID=i.xAxisID||t.chart.options.scales.xAxes[0].id),null!==e.yAxisID&&e.yAxisID in t.chart.scales||(e.yAxisID=i.yAxisID||t.chart.options.scales.yAxes[0].id)},getDataset:function(){return this.chart.data.datasets[this.index]},getMeta:function(){return this.chart.getDatasetMeta(this.index)},getScaleForId:function(t){return this.chart.scales[t]},_getValueScaleId:function(){return this.getMeta().yAxisID},_getIndexScaleId:function(){return this.getMeta().xAxisID},_getValueScale:function(){return this.getScaleForId(this._getValueScaleId())},_getIndexScale:function(){return this.getScaleForId(this._getIndexScaleId())},reset:function(){this.update(!0)},destroy:function(){this._data&&kt(this._data,this)},createMetaDataset:function(){var t=this.datasetElementType;return t&&new t({_chart:this.chart,_datasetIndex:this.index})},createMetaData:function(t){var e=this.dataElementType;return e&&new e({_chart:this.chart,_datasetIndex:this.index,_index:t})},addElements:function(){var t,e,i=this.getMeta(),n=this.getDataset().data||[],a=i.data;for(t=0,e=n.length;t<e;++t)a[t]=a[t]||this.createMetaData(t);i.dataset=i.dataset||this.createMetaDataset()},addElementAndReset:function(t){var e=this.createMetaData(t);this.getMeta().data.splice(t,0,e),this.updateElement(e,t,!0)},buildOrUpdateElements:function(){var t,e,i=this,n=i.getDataset(),a=n.data||(n.data=[]);i._data!==a&&(i._data&&kt(i._data,i),a&&Object.isExtensible(a)&&(e=i,(t=a)._chartjs?t._chartjs.listeners.push(e):(Object.defineProperty(t,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),yt.forEach(function(e){var i="onData"+e.charAt(0).toUpperCase()+e.slice(1),n=t[e];Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value:function(){var e=Array.prototype.slice.call(arguments),a=n.apply(this,e);return ut.each(t._chartjs.listeners,function(t){"function"==typeof t[i]&&t[i].apply(t,e)}),a}})}))),i._data=a),i.resyncElements()},update:ut.noop,transition:function(t){for(var e=this.getMeta(),i=e.data||[],n=i.length,a=0;a<n;++a)i[a].transition(t);e.dataset&&e.dataset.transition(t)},draw:function(){var t=this.getMeta(),e=t.data||[],i=e.length,n=0;for(t.dataset&&t.dataset.draw();n<i;++n)e[n].draw()},removeHoverStyle:function(t){ut.merge(t._model,t.$previousStyle||{}),delete t.$previousStyle},setHoverStyle:function(t){var e=this.chart.data.datasets[t._datasetIndex],i=t._index,n=t.custom||{},a=t._model,o=ut.getHoverColor;t.$previousStyle={backgroundColor:a.backgroundColor,borderColor:a.borderColor,borderWidth:a.borderWidth},a.backgroundColor=xt([n.hoverBackgroundColor,e.hoverBackgroundColor,o(a.backgroundColor)],void 0,i),a.borderColor=xt([n.hoverBorderColor,e.hoverBorderColor,o(a.borderColor)],void 0,i),a.borderWidth=xt([n.hoverBorderWidth,e.hoverBorderWidth,a.borderWidth],void 0,i)},resyncElements:function(){var t=this.getMeta(),e=this.getDataset().data,i=t.data.length,n=e.length;n<i?t.data.splice(n,i-n):n>i&&this.insertElements(i,n-i)},insertElements:function(t,e){for(var i=0;i<e;++i)this.addElementAndReset(t+i)},onDataPush:function(){var t=arguments.length;this.insertElements(this.getDataset().data.length-t,t)},onDataPop:function(){this.getMeta().data.pop()},onDataShift:function(){this.getMeta().data.shift()},onDataSplice:function(t,e){this.getMeta().data.splice(t,e),this.insertElements(t,arguments.length-2)},onDataUnshift:function(){this.insertElements(0,arguments.length)}}),wt.extend=ut.inherits;var Mt=wt;st._set("global",{elements:{arc:{backgroundColor:st.global.defaultColor,borderColor:"#fff",borderWidth:2,borderAlign:"center"}}});var _t=pt.extend({inLabelRange:function(t){var e=this._view;return!!e&&Math.pow(t-e.x,2)<Math.pow(e.radius+e.hoverRadius,2)},inRange:function(t,e){var i=this._view;if(i){for(var n=ut.getAngleFromPoint(i,{x:t,y:e}),a=n.angle,o=n.distance,r=i.startAngle,s=i.endAngle;s<r;)s+=2*Math.PI;for(;a>s;)a-=2*Math.PI;for(;a<r;)a+=2*Math.PI;var l=a>=r&&a<=s,d=o>=i.innerRadius&&o<=i.outerRadius;return l&&d}return!1},getCenterPoint:function(){var t=this._view,e=(t.startAngle+t.endAngle)/2,i=(t.innerRadius+t.outerRadius)/2;return{x:t.x+Math.cos(e)*i,y:t.y+Math.sin(e)*i}},getArea:function(){var t=this._view;return Math.PI*((t.endAngle-t.startAngle)/(2*Math.PI))*(Math.pow(t.outerRadius,2)-Math.pow(t.innerRadius,2))},tooltipPosition:function(){var t=this._view,e=t.startAngle+(t.endAngle-t.startAngle)/2,i=(t.outerRadius-t.innerRadius)/2+t.innerRadius;return{x:t.x+Math.cos(e)*i,y:t.y+Math.sin(e)*i}},draw:function(){var t,e=this._chart.ctx,i=this._view,n=i.startAngle,a=i.endAngle,o="inner"===i.borderAlign?.33:0;e.save(),e.beginPath(),e.arc(i.x,i.y,Math.max(i.outerRadius-o,0),n,a),e.arc(i.x,i.y,i.innerRadius,a,n,!0),e.closePath(),e.fillStyle=i.backgroundColor,e.fill(),i.borderWidth&&("inner"===i.borderAlign?(e.beginPath(),t=o/i.outerRadius,e.arc(i.x,i.y,i.outerRadius,n-t,a+t),i.innerRadius>o?(t=o/i.innerRadius,e.arc(i.x,i.y,i.innerRadius-o,a+t,n-t,!0)):e.arc(i.x,i.y,o,a+Math.PI/2,n-Math.PI/2),e.closePath(),e.clip(),e.beginPath(),e.arc(i.x,i.y,i.outerRadius,n,a),e.arc(i.x,i.y,i.innerRadius,a,n,!0),e.closePath(),e.lineWidth=2*i.borderWidth,e.lineJoin="round"):(e.lineWidth=i.borderWidth,e.lineJoin="bevel"),e.strokeStyle=i.borderColor,e.stroke()),e.restore()}}),Ct=ut.valueOrDefault,St=st.global.defaultColor;st._set("global",{elements:{line:{tension:.4,backgroundColor:St,borderWidth:3,borderColor:St,borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",capBezierPoints:!0,fill:!0}}});var Pt=pt.extend({draw:function(){var t,e,i,n,a=this._view,o=this._chart.ctx,r=a.spanGaps,s=this._children.slice(),l=st.global,d=l.elements.line,u=-1;for(this._loop&&s.length&&s.push(s[0]),o.save(),o.lineCap=a.borderCapStyle||d.borderCapStyle,o.setLineDash&&o.setLineDash(a.borderDash||d.borderDash),o.lineDashOffset=Ct(a.borderDashOffset,d.borderDashOffset),o.lineJoin=a.borderJoinStyle||d.borderJoinStyle,o.lineWidth=Ct(a.borderWidth,d.borderWidth),o.strokeStyle=a.borderColor||l.defaultColor,o.beginPath(),u=-1,t=0;t<s.length;++t)e=s[t],i=ut.previousItem(s,t),n=e._view,0===t?n.skip||(o.moveTo(n.x,n.y),u=t):(i=-1===u?i:s[u],n.skip||(u!==t-1&&!r||-1===u?o.moveTo(n.x,n.y):ut.canvas.lineTo(o,i._view,e._view),u=t));o.stroke(),o.restore()}}),It=ut.valueOrDefault,At=st.global.defaultColor;function Dt(t){var e=this._view;return!!e&&Math.abs(t-e.x)<e.radius+e.hitRadius}st._set("global",{elements:{point:{radius:3,pointStyle:"circle",backgroundColor:At,borderColor:At,borderWidth:1,hitRadius:1,hoverRadius:4,hoverBorderWidth:1}}});var Tt=pt.extend({inRange:function(t,e){var i=this._view;return!!i&&Math.pow(t-i.x,2)+Math.pow(e-i.y,2)<Math.pow(i.hitRadius+i.radius,2)},inLabelRange:Dt,inXRange:Dt,inYRange:function(t){var e=this._view;return!!e&&Math.abs(t-e.y)<e.radius+e.hitRadius},getCenterPoint:function(){var t=this._view;return{x:t.x,y:t.y}},getArea:function(){return Math.PI*Math.pow(this._view.radius,2)},tooltipPosition:function(){var t=this._view;return{x:t.x,y:t.y,padding:t.radius+t.borderWidth}},draw:function(t){var e=this._view,i=this._chart.ctx,n=e.pointStyle,a=e.rotation,o=e.radius,r=e.x,s=e.y,l=st.global,d=l.defaultColor;e.skip||(void 0===t||ut.canvas._isPointInArea(e,t))&&(i.strokeStyle=e.borderColor||d,i.lineWidth=It(e.borderWidth,l.elements.point.borderWidth),i.fillStyle=e.backgroundColor||d,ut.canvas.drawPoint(i,n,o,r,s,a))}}),Ft=st.global.defaultColor;function Lt(t){return t&&void 0!==t.width}function Rt(t){var e,i,n,a,o;return Lt(t)?(o=t.width/2,e=t.x-o,i=t.x+o,n=Math.min(t.y,t.base),a=Math.max(t.y,t.base)):(o=t.height/2,e=Math.min(t.x,t.base),i=Math.max(t.x,t.base),n=t.y-o,a=t.y+o),{left:e,top:n,right:i,bottom:a}}function Ot(t,e,i){return t===e?i:t===i?e:t}function zt(t,e,i){var n,a,o,r,s=t.borderWidth,l=function(t){var e=t.borderSkipped,i={};return e?(t.horizontal?t.base>t.x&&(e=Ot(e,"left","right")):t.base<t.y&&(e=Ot(e,"bottom","top")),i[e]=!0,i):i}(t);return ut.isObject(s)?(n=+s.top||0,a=+s.right||0,o=+s.bottom||0,r=+s.left||0):n=a=o=r=+s||0,{t:l.top||n<0?0:n>i?i:n,r:l.right||a<0?0:a>e?e:a,b:l.bottom||o<0?0:o>i?i:o,l:l.left||r<0?0:r>e?e:r}}function Bt(t,e,i){var n=null===e,a=null===i,o=!(!t||n&&a)&&Rt(t);return o&&(n||e>=o.left&&e<=o.right)&&(a||i>=o.top&&i<=o.bottom)}st._set("global",{elements:{rectangle:{backgroundColor:Ft,borderColor:Ft,borderSkipped:"bottom",borderWidth:0}}});var Nt=pt.extend({draw:function(){var t=this._chart.ctx,e=this._view,i=function(t){var e=Rt(t),i=e.right-e.left,n=e.bottom-e.top,a=zt(t,i/2,n/2);return{outer:{x:e.left,y:e.top,w:i,h:n},inner:{x:e.left+a.l,y:e.top+a.t,w:i-a.l-a.r,h:n-a.t-a.b}}}(e),n=i.outer,a=i.inner;t.fillStyle=e.backgroundColor,t.fillRect(n.x,n.y,n.w,n.h),n.w===a.w&&n.h===a.h||(t.save(),t.beginPath(),t.rect(n.x,n.y,n.w,n.h),t.clip(),t.fillStyle=e.borderColor,t.rect(a.x,a.y,a.w,a.h),t.fill("evenodd"),t.restore())},height:function(){var t=this._view;return t.base-t.y},inRange:function(t,e){return Bt(this._view,t,e)},inLabelRange:function(t,e){var i=this._view;return Lt(i)?Bt(i,t,null):Bt(i,null,e)},inXRange:function(t){return Bt(this._view,t,null)},inYRange:function(t){return Bt(this._view,null,t)},getCenterPoint:function(){var t,e,i=this._view;return Lt(i)?(t=i.x,e=(i.y+i.base)/2):(t=(i.x+i.base)/2,e=i.y),{x:t,y:e}},getArea:function(){var t=this._view;return Lt(t)?t.width*Math.abs(t.y-t.base):t.height*Math.abs(t.x-t.base)},tooltipPosition:function(){var t=this._view;return{x:t.x,y:t.y}}}),Wt={},Vt=_t,Et=Pt,Ht=Tt,jt=Nt;Wt.Arc=Vt,Wt.Line=Et,Wt.Point=Ht,Wt.Rectangle=jt;var qt=ut.options.resolve;st._set("bar",{hover:{mode:"label"},scales:{xAxes:[{type:"category",categoryPercentage:.8,barPercentage:.9,offset:!0,gridLines:{offsetGridLines:!0}}],yAxes:[{type:"linear"}]}});var Yt=Mt.extend({dataElementType:Wt.Rectangle,initialize:function(){var t;Mt.prototype.initialize.apply(this,arguments),(t=this.getMeta()).stack=this.getDataset().stack,t.bar=!0},update:function(t){var e,i,n=this.getMeta().data;for(this._ruler=this.getRuler(),e=0,i=n.length;e<i;++e)this.updateElement(n[e],e,t)},updateElement:function(t,e,i){var n=this,a=n.getMeta(),o=n.getDataset(),r=n._resolveElementOptions(t,e);t._xScale=n.getScaleForId(a.xAxisID),t._yScale=n.getScaleForId(a.yAxisID),t._datasetIndex=n.index,t._index=e,t._model={backgroundColor:r.backgroundColor,borderColor:r.borderColor,borderSkipped:r.borderSkipped,borderWidth:r.borderWidth,datasetLabel:o.label,label:n.chart.data.labels[e]},n._updateElementGeometry(t,e,i),t.pivot()},_updateElementGeometry:function(t,e,i){var n=this,a=t._model,o=n._getValueScale(),r=o.getBasePixel(),s=o.isHorizontal(),l=n._ruler||n.getRuler(),d=n.calculateBarValuePixels(n.index,e),u=n.calculateBarIndexPixels(n.index,e,l);a.horizontal=s,a.base=i?r:d.base,a.x=s?i?r:d.head:u.center,a.y=s?u.center:i?r:d.head,a.height=s?u.size:void 0,a.width=s?void 0:u.size},_getStacks:function(t){var e,i,n=this.chart,a=this._getIndexScale().options.stacked,o=void 0===t?n.data.datasets.length:t+1,r=[];for(e=0;e<o;++e)(i=n.getDatasetMeta(e)).bar&&n.isDatasetVisible(e)&&(!1===a||!0===a&&-1===r.indexOf(i.stack)||void 0===a&&(void 0===i.stack||-1===r.indexOf(i.stack)))&&r.push(i.stack);return r},getStackCount:function(){return this._getStacks().length},getStackIndex:function(t,e){var i=this._getStacks(t),n=void 0!==e?i.indexOf(e):-1;return-1===n?i.length-1:n},getRuler:function(){var t,e,i=this._getIndexScale(),n=this.getStackCount(),a=this.index,o=i.isHorizontal(),r=o?i.left:i.top,s=r+(o?i.width:i.height),l=[];for(t=0,e=this.getMeta().data.length;t<e;++t)l.push(i.getPixelForValue(null,t,a));return{min:ut.isNullOrUndef(i.options.barThickness)?function(t,e){var i,n,a,o,r=t.isHorizontal()?t.width:t.height,s=t.getTicks();for(a=1,o=e.length;a<o;++a)r=Math.min(r,Math.abs(e[a]-e[a-1]));for(a=0,o=s.length;a<o;++a)n=t.getPixelForTick(a),r=a>0?Math.min(r,n-i):r,i=n;return r}(i,l):-1,pixels:l,start:r,end:s,stackCount:n,scale:i}},calculateBarValuePixels:function(t,e){var i,n,a,o,r,s,l=this.chart,d=this.getMeta(),u=this._getValueScale(),h=u.isHorizontal(),c=l.data.datasets,f=+u.getRightValue(c[t].data[e]),g=u.options.minBarLength,p=u.options.stacked,m=d.stack,v=0;if(p||void 0===p&&void 0!==m)for(i=0;i<t;++i)(n=l.getDatasetMeta(i)).bar&&n.stack===m&&n.controller._getValueScaleId()===u.id&&l.isDatasetVisible(i)&&(a=+u.getRightValue(c[i].data[e]),(f<0&&a<0||f>=0&&a>0)&&(v+=a));return o=u.getPixelForValue(v),s=(r=u.getPixelForValue(v+f))-o,void 0!==g&&Math.abs(s)<g&&(s=g,r=f>=0&&!h||f<0&&h?o-g:o+g),{size:s,base:o,head:r,center:r+s/2}},calculateBarIndexPixels:function(t,e,i){var n=i.scale.options,a="flex"===n.barThickness?function(t,e,i){var n,a=e.pixels,o=a[t],r=t>0?a[t-1]:null,s=t<a.length-1?a[t+1]:null,l=i.categoryPercentage;return null===r&&(r=o-(null===s?e.end-e.start:s-o)),null===s&&(s=o+o-r),n=o-(o-Math.min(r,s))/2*l,{chunk:Math.abs(s-r)/2*l/e.stackCount,ratio:i.barPercentage,start:n}}(e,i,n):function(t,e,i){var n,a,o=i.barThickness,r=e.stackCount,s=e.pixels[t];return ut.isNullOrUndef(o)?(n=e.min*i.categoryPercentage,a=i.barPercentage):(n=o*r,a=1),{chunk:n/r,ratio:a,start:s-n/2}}(e,i,n),o=this.getStackIndex(t,this.getMeta().stack),r=a.start+a.chunk*o+a.chunk/2,s=Math.min(ut.valueOrDefault(n.maxBarThickness,1/0),a.chunk*a.ratio);return{base:r-s/2,head:r+s/2,center:r,size:s}},draw:function(){var t=this.chart,e=this._getValueScale(),i=this.getMeta().data,n=this.getDataset(),a=i.length,o=0;for(ut.canvas.clipArea(t.ctx,t.chartArea);o<a;++o)isNaN(e.getRightValue(n.data[o]))||i[o].draw();ut.canvas.unclipArea(t.ctx)},_resolveElementOptions:function(t,e){var i,n,a,o=this.chart,r=o.data.datasets[this.index],s=t.custom||{},l=o.options.elements.rectangle,d={},u={chart:o,dataIndex:e,dataset:r,datasetIndex:this.index},h=["backgroundColor","borderColor","borderSkipped","borderWidth"];for(i=0,n=h.length;i<n;++i)d[a=h[i]]=qt([s[a],r[a],l[a]],u,e);return d}}),Ut=ut.valueOrDefault,Xt=ut.options.resolve;st._set("bubble",{hover:{mode:"single"},scales:{xAxes:[{type:"linear",position:"bottom",id:"x-axis-0"}],yAxes:[{type:"linear",position:"left",id:"y-axis-0"}]},tooltips:{callbacks:{title:function(){return""},label:function(t,e){var i=e.datasets[t.datasetIndex].label||"",n=e.datasets[t.datasetIndex].data[t.index];return i+": ("+t.xLabel+", "+t.yLabel+", "+n.r+")"}}}});var Kt=Mt.extend({dataElementType:Wt.Point,update:function(t){var e=this,i=e.getMeta().data;ut.each(i,function(i,n){e.updateElement(i,n,t)})},updateElement:function(t,e,i){var n=this,a=n.getMeta(),o=t.custom||{},r=n.getScaleForId(a.xAxisID),s=n.getScaleForId(a.yAxisID),l=n._resolveElementOptions(t,e),d=n.getDataset().data[e],u=n.index,h=i?r.getPixelForDecimal(.5):r.getPixelForValue("object"==typeof d?d:NaN,e,u),c=i?s.getBasePixel():s.getPixelForValue(d,e,u);t._xScale=r,t._yScale=s,t._options=l,t._datasetIndex=u,t._index=e,t._model={backgroundColor:l.backgroundColor,borderColor:l.borderColor,borderWidth:l.borderWidth,hitRadius:l.hitRadius,pointStyle:l.pointStyle,rotation:l.rotation,radius:i?0:l.radius,skip:o.skip||isNaN(h)||isNaN(c),x:h,y:c},t.pivot()},setHoverStyle:function(t){var e=t._model,i=t._options,n=ut.getHoverColor;t.$previousStyle={backgroundColor:e.backgroundColor,borderColor:e.borderColor,borderWidth:e.borderWidth,radius:e.radius},e.backgroundColor=Ut(i.hoverBackgroundColor,n(i.backgroundColor)),e.borderColor=Ut(i.hoverBorderColor,n(i.borderColor)),e.borderWidth=Ut(i.hoverBorderWidth,i.borderWidth),e.radius=i.radius+i.hoverRadius},_resolveElementOptions:function(t,e){var i,n,a,o=this.chart,r=o.data.datasets[this.index],s=t.custom||{},l=o.options.elements.point,d=r.data[e],u={},h={chart:o,dataIndex:e,dataset:r,datasetIndex:this.index},c=["backgroundColor","borderColor","borderWidth","hoverBackgroundColor","hoverBorderColor","hoverBorderWidth","hoverRadius","hitRadius","pointStyle","rotation"];for(i=0,n=c.length;i<n;++i)u[a=c[i]]=Xt([s[a],r[a],l[a]],h,e);return u.radius=Xt([s.radius,d?d.r:void 0,r.radius,l.radius],h,e),u}}),Gt=ut.options.resolve,Zt=ut.valueOrDefault;st._set("doughnut",{animation:{animateRotate:!0,animateScale:!1},hover:{mode:"single"},legendCallback:function(t){var e=[];e.push('<ul class="'+t.id+'-legend">');var i=t.data,n=i.datasets,a=i.labels;if(n.length)for(var o=0;o<n[0].data.length;++o)e.push('<li><span style="background-color:'+n[0].backgroundColor[o]+'"></span>'),a[o]&&e.push(a[o]),e.push("</li>");return e.push("</ul>"),e.join("")},legend:{labels:{generateLabels:function(t){var e=t.data;return e.labels.length&&e.datasets.length?e.labels.map(function(i,n){var a=t.getDatasetMeta(0),o=e.datasets[0],r=a.data[n],s=r&&r.custom||{},l=t.options.elements.arc;return{text:i,fillStyle:Gt([s.backgroundColor,o.backgroundColor,l.backgroundColor],void 0,n),strokeStyle:Gt([s.borderColor,o.borderColor,l.borderColor],void 0,n),lineWidth:Gt([s.borderWidth,o.borderWidth,l.borderWidth],void 0,n),hidden:isNaN(o.data[n])||a.data[n].hidden,index:n}}):[]}},onClick:function(t,e){var i,n,a,o=e.index,r=this.chart;for(i=0,n=(r.data.datasets||[]).length;i<n;++i)(a=r.getDatasetMeta(i)).data[o]&&(a.data[o].hidden=!a.data[o].hidden);r.update()}},cutoutPercentage:50,rotation:-.5*Math.PI,circumference:2*Math.PI,tooltips:{callbacks:{title:function(){return""},label:function(t,e){var i=e.labels[t.index],n=": "+e.datasets[t.datasetIndex].data[t.index];return ut.isArray(i)?(i=i.slice())[0]+=n:i+=n,i}}}});var $t=Mt.extend({dataElementType:Wt.Arc,linkScales:ut.noop,getRingIndex:function(t){for(var e=0,i=0;i<t;++i)this.chart.isDatasetVisible(i)&&++e;return e},update:function(t){var e,i,n=this,a=n.chart,o=a.chartArea,r=a.options,s=o.right-o.left,l=o.bottom-o.top,d=Math.min(s,l),u={x:0,y:0},h=n.getMeta(),c=h.data,f=r.cutoutPercentage,g=r.circumference,p=n._getRingWeight(n.index);if(g<2*Math.PI){var m=r.rotation%(2*Math.PI),v=(m+=2*Math.PI*(m>=Math.PI?-1:m<-Math.PI?1:0))+g,b={x:Math.cos(m),y:Math.sin(m)},x={x:Math.cos(v),y:Math.sin(v)},y=m<=0&&v>=0||m<=2*Math.PI&&2*Math.PI<=v,k=m<=.5*Math.PI&&.5*Math.PI<=v||m<=2.5*Math.PI&&2.5*Math.PI<=v,w=m<=-Math.PI&&-Math.PI<=v||m<=Math.PI&&Math.PI<=v,M=m<=.5*-Math.PI&&.5*-Math.PI<=v||m<=1.5*Math.PI&&1.5*Math.PI<=v,_=f/100,C={x:w?-1:Math.min(b.x*(b.x<0?1:_),x.x*(x.x<0?1:_)),y:M?-1:Math.min(b.y*(b.y<0?1:_),x.y*(x.y<0?1:_))},S={x:y?1:Math.max(b.x*(b.x>0?1:_),x.x*(x.x>0?1:_)),y:k?1:Math.max(b.y*(b.y>0?1:_),x.y*(x.y>0?1:_))},P={width:.5*(S.x-C.x),height:.5*(S.y-C.y)};d=Math.min(s/P.width,l/P.height),u={x:-.5*(S.x+C.x),y:-.5*(S.y+C.y)}}for(e=0,i=c.length;e<i;++e)c[e]._options=n._resolveElementOptions(c[e],e);for(a.borderWidth=n.getMaxBorderWidth(),a.outerRadius=Math.max((d-a.borderWidth)/2,0),a.innerRadius=Math.max(f?a.outerRadius/100*f:0,0),a.radiusLength=(a.outerRadius-a.innerRadius)/(n._getVisibleDatasetWeightTotal()||1),a.offsetX=u.x*a.outerRadius,a.offsetY=u.y*a.outerRadius,h.total=n.calculateTotal(),n.outerRadius=a.outerRadius-a.radiusLength*n._getRingWeightOffset(n.index),n.innerRadius=Math.max(n.outerRadius-a.radiusLength*p,0),e=0,i=c.length;e<i;++e)n.updateElement(c[e],e,t)},updateElement:function(t,e,i){var n=this,a=n.chart,o=a.chartArea,r=a.options,s=r.animation,l=(o.left+o.right)/2,d=(o.top+o.bottom)/2,u=r.rotation,h=r.rotation,c=n.getDataset(),f=i&&s.animateRotate?0:t.hidden?0:n.calculateCircumference(c.data[e])*(r.circumference/(2*Math.PI)),g=i&&s.animateScale?0:n.innerRadius,p=i&&s.animateScale?0:n.outerRadius,m=t._options||{};ut.extend(t,{_datasetIndex:n.index,_index:e,_model:{backgroundColor:m.backgroundColor,borderColor:m.borderColor,borderWidth:m.borderWidth,borderAlign:m.borderAlign,x:l+a.offsetX,y:d+a.offsetY,startAngle:u,endAngle:h,circumference:f,outerRadius:p,innerRadius:g,label:ut.valueAtIndexOrDefault(c.label,e,a.data.labels[e])}});var v=t._model;i&&s.animateRotate||(v.startAngle=0===e?r.rotation:n.getMeta().data[e-1]._model.endAngle,v.endAngle=v.startAngle+v.circumference),t.pivot()},calculateTotal:function(){var t,e=this.getDataset(),i=this.getMeta(),n=0;return ut.each(i.data,function(i,a){t=e.data[a],isNaN(t)||i.hidden||(n+=Math.abs(t))}),n},calculateCircumference:function(t){var e=this.getMeta().total;return e>0&&!isNaN(t)?2*Math.PI*(Math.abs(t)/e):0},getMaxBorderWidth:function(t){var e,i,n,a,o,r,s,l,d=0,u=this.chart;if(!t)for(e=0,i=u.data.datasets.length;e<i;++e)if(u.isDatasetVisible(e)){t=(n=u.getDatasetMeta(e)).data,e!==this.index&&(o=n.controller);break}if(!t)return 0;for(e=0,i=t.length;e<i;++e)a=t[e],"inner"!==(r=o?o._resolveElementOptions(a,e):a._options).borderAlign&&(s=r.borderWidth,d=(l=r.hoverBorderWidth)>(d=s>d?s:d)?l:d);return d},setHoverStyle:function(t){var e=t._model,i=t._options,n=ut.getHoverColor;t.$previousStyle={backgroundColor:e.backgroundColor,borderColor:e.borderColor,borderWidth:e.borderWidth},e.backgroundColor=Zt(i.hoverBackgroundColor,n(i.backgroundColor)),e.borderColor=Zt(i.hoverBorderColor,n(i.borderColor)),e.borderWidth=Zt(i.hoverBorderWidth,i.borderWidth)},_resolveElementOptions:function(t,e){var i,n,a,o=this.chart,r=this.getDataset(),s=t.custom||{},l=o.options.elements.arc,d={},u={chart:o,dataIndex:e,dataset:r,datasetIndex:this.index},h=["backgroundColor","borderColor","borderWidth","borderAlign","hoverBackgroundColor","hoverBorderColor","hoverBorderWidth"];for(i=0,n=h.length;i<n;++i)d[a=h[i]]=Gt([s[a],r[a],l[a]],u,e);return d},_getRingWeightOffset:function(t){for(var e=0,i=0;i<t;++i)this.chart.isDatasetVisible(i)&&(e+=this._getRingWeight(i));return e},_getRingWeight:function(t){return Math.max(Zt(this.chart.data.datasets[t].weight,1),0)},_getVisibleDatasetWeightTotal:function(){return this._getRingWeightOffset(this.chart.data.datasets.length)}});st._set("horizontalBar",{hover:{mode:"index",axis:"y"},scales:{xAxes:[{type:"linear",position:"bottom"}],yAxes:[{type:"category",position:"left",categoryPercentage:.8,barPercentage:.9,offset:!0,gridLines:{offsetGridLines:!0}}]},elements:{rectangle:{borderSkipped:"left"}},tooltips:{mode:"index",axis:"y"}});var Jt=Yt.extend({_getValueScaleId:function(){return this.getMeta().xAxisID},_getIndexScaleId:function(){return this.getMeta().yAxisID}}),Qt=ut.valueOrDefault,te=ut.options.resolve,ee=ut.canvas._isPointInArea;function ie(t,e){return Qt(t.showLine,e.showLines)}st._set("line",{showLines:!0,spanGaps:!1,hover:{mode:"label"},scales:{xAxes:[{type:"category",id:"x-axis-0"}],yAxes:[{type:"linear",id:"y-axis-0"}]}});var ne=Mt.extend({datasetElementType:Wt.Line,dataElementType:Wt.Point,update:function(t){var e,i,n=this,a=n.getMeta(),o=a.dataset,r=a.data||[],s=n.getScaleForId(a.yAxisID),l=n.getDataset(),d=ie(l,n.chart.options);for(d&&(void 0!==l.tension&&void 0===l.lineTension&&(l.lineTension=l.tension),o._scale=s,o._datasetIndex=n.index,o._children=r,o._model=n._resolveLineOptions(o),o.pivot()),e=0,i=r.length;e<i;++e)n.updateElement(r[e],e,t);for(d&&0!==o._model.tension&&n.updateBezierControlPoints(),e=0,i=r.length;e<i;++e)r[e].pivot()},updateElement:function(t,e,i){var n,a,o=this,r=o.getMeta(),s=t.custom||{},l=o.getDataset(),d=o.index,u=l.data[e],h=o.getScaleForId(r.yAxisID),c=o.getScaleForId(r.xAxisID),f=r.dataset._model,g=o._resolvePointOptions(t,e);n=c.getPixelForValue("object"==typeof u?u:NaN,e,d),a=i?h.getBasePixel():o.calculatePointY(u,e,d),t._xScale=c,t._yScale=h,t._options=g,t._datasetIndex=d,t._index=e,t._model={x:n,y:a,skip:s.skip||isNaN(n)||isNaN(a),radius:g.radius,pointStyle:g.pointStyle,rotation:g.rotation,backgroundColor:g.backgroundColor,borderColor:g.borderColor,borderWidth:g.borderWidth,tension:Qt(s.tension,f?f.tension:0),steppedLine:!!f&&f.steppedLine,hitRadius:g.hitRadius}},_resolvePointOptions:function(t,e){var i,n,a,o=this.chart,r=o.data.datasets[this.index],s=t.custom||{},l=o.options.elements.point,d={},u={chart:o,dataIndex:e,dataset:r,datasetIndex:this.index},h={backgroundColor:"pointBackgroundColor",borderColor:"pointBorderColor",borderWidth:"pointBorderWidth",hitRadius:"pointHitRadius",hoverBackgroundColor:"pointHoverBackgroundColor",hoverBorderColor:"pointHoverBorderColor",hoverBorderWidth:"pointHoverBorderWidth",hoverRadius:"pointHoverRadius",pointStyle:"pointStyle",radius:"pointRadius",rotation:"pointRotation"},c=Object.keys(h);for(i=0,n=c.length;i<n;++i)d[a=c[i]]=te([s[a],r[h[a]],r[a],l[a]],u,e);return d},_resolveLineOptions:function(t){var e,i,n,a=this.chart,o=a.data.datasets[this.index],r=t.custom||{},s=a.options,l=s.elements.line,d={},u=["backgroundColor","borderWidth","borderColor","borderCapStyle","borderDash","borderDashOffset","borderJoinStyle","fill","cubicInterpolationMode"];for(e=0,i=u.length;e<i;++e)d[n=u[e]]=te([r[n],o[n],l[n]]);return d.spanGaps=Qt(o.spanGaps,s.spanGaps),d.tension=Qt(o.lineTension,l.tension),d.steppedLine=te([r.steppedLine,o.steppedLine,l.stepped]),d},calculatePointY:function(t,e,i){var n,a,o,r=this.chart,s=this.getMeta(),l=this.getScaleForId(s.yAxisID),d=0,u=0;if(l.options.stacked){for(n=0;n<i;n++)if(a=r.data.datasets[n],"line"===(o=r.getDatasetMeta(n)).type&&o.yAxisID===l.id&&r.isDatasetVisible(n)){var h=Number(l.getRightValue(a.data[e]));h<0?u+=h||0:d+=h||0}var c=Number(l.getRightValue(t));return c<0?l.getPixelForValue(u+c):l.getPixelForValue(d+c)}return l.getPixelForValue(t)},updateBezierControlPoints:function(){var t,e,i,n,a=this.chart,o=this.getMeta(),r=o.dataset._model,s=a.chartArea,l=o.data||[];function d(t,e,i){return Math.max(Math.min(t,i),e)}if(r.spanGaps&&(l=l.filter(function(t){return!t._model.skip})),"monotone"===r.cubicInterpolationMode)ut.splineCurveMonotone(l);else for(t=0,e=l.length;t<e;++t)i=l[t]._model,n=ut.splineCurve(ut.previousItem(l,t)._model,i,ut.nextItem(l,t)._model,r.tension),i.controlPointPreviousX=n.previous.x,i.controlPointPreviousY=n.previous.y,i.controlPointNextX=n.next.x,i.controlPointNextY=n.next.y;if(a.options.elements.line.capBezierPoints)for(t=0,e=l.length;t<e;++t)i=l[t]._model,ee(i,s)&&(t>0&&ee(l[t-1]._model,s)&&(i.controlPointPreviousX=d(i.controlPointPreviousX,s.left,s.right),i.controlPointPreviousY=d(i.controlPointPreviousY,s.top,s.bottom)),t<l.length-1&&ee(l[t+1]._model,s)&&(i.controlPointNextX=d(i.controlPointNextX,s.left,s.right),i.controlPointNextY=d(i.controlPointNextY,s.top,s.bottom)))},draw:function(){var t,e=this.chart,i=this.getMeta(),n=i.data||[],a=e.chartArea,o=n.length,r=0;for(ie(this.getDataset(),e.options)&&(t=(i.dataset._model.borderWidth||0)/2,ut.canvas.clipArea(e.ctx,{left:a.left,right:a.right,top:a.top-t,bottom:a.bottom+t}),i.dataset.draw(),ut.canvas.unclipArea(e.ctx));r<o;++r)n[r].draw(a)},setHoverStyle:function(t){var e=t._model,i=t._options,n=ut.getHoverColor;t.$previousStyle={backgroundColor:e.backgroundColor,borderColor:e.borderColor,borderWidth:e.borderWidth,radius:e.radius},e.backgroundColor=Qt(i.hoverBackgroundColor,n(i.backgroundColor)),e.borderColor=Qt(i.hoverBorderColor,n(i.borderColor)),e.borderWidth=Qt(i.hoverBorderWidth,i.borderWidth),e.radius=Qt(i.hoverRadius,i.radius)}}),ae=ut.options.resolve;st._set("polarArea",{scale:{type:"radialLinear",angleLines:{display:!1},gridLines:{circular:!0},pointLabels:{display:!1},ticks:{beginAtZero:!0}},animation:{animateRotate:!0,animateScale:!0},startAngle:-.5*Math.PI,legendCallback:function(t){var e=[];e.push('<ul class="'+t.id+'-legend">');var i=t.data,n=i.datasets,a=i.labels;if(n.length)for(var o=0;o<n[0].data.length;++o)e.push('<li><span style="background-color:'+n[0].backgroundColor[o]+'"></span>'),a[o]&&e.push(a[o]),e.push("</li>");return e.push("</ul>"),e.join("")},legend:{labels:{generateLabels:function(t){var e=t.data;return e.labels.length&&e.datasets.length?e.labels.map(function(i,n){var a=t.getDatasetMeta(0),o=e.datasets[0],r=a.data[n].custom||{},s=t.options.elements.arc;return{text:i,fillStyle:ae([r.backgroundColor,o.backgroundColor,s.backgroundColor],void 0,n),strokeStyle:ae([r.borderColor,o.borderColor,s.borderColor],void 0,n),lineWidth:ae([r.borderWidth,o.borderWidth,s.borderWidth],void 0,n),hidden:isNaN(o.data[n])||a.data[n].hidden,index:n}}):[]}},onClick:function(t,e){var i,n,a,o=e.index,r=this.chart;for(i=0,n=(r.data.datasets||[]).length;i<n;++i)(a=r.getDatasetMeta(i)).data[o].hidden=!a.data[o].hidden;r.update()}},tooltips:{callbacks:{title:function(){return""},label:function(t,e){return e.labels[t.index]+": "+t.yLabel}}}});var oe=Mt.extend({dataElementType:Wt.Arc,linkScales:ut.noop,update:function(t){var e,i,n,a=this,o=a.getDataset(),r=a.getMeta(),s=a.chart.options.startAngle||0,l=a._starts=[],d=a._angles=[],u=r.data;for(a._updateRadius(),r.count=a.countVisibleElements(),e=0,i=o.data.length;e<i;e++)l[e]=s,n=a._computeAngle(e),d[e]=n,s+=n;for(e=0,i=u.length;e<i;++e)u[e]._options=a._resolveElementOptions(u[e],e),a.updateElement(u[e],e,t)},_updateRadius:function(){var t=this,e=t.chart,i=e.chartArea,n=e.options,a=Math.min(i.right-i.left,i.bottom-i.top);e.outerRadius=Math.max(a/2,0),e.innerRadius=Math.max(n.cutoutPercentage?e.outerRadius/100*n.cutoutPercentage:1,0),e.radiusLength=(e.outerRadius-e.innerRadius)/e.getVisibleDatasetCount(),t.outerRadius=e.outerRadius-e.radiusLength*t.index,t.innerRadius=t.outerRadius-e.radiusLength},updateElement:function(t,e,i){var n=this,a=n.chart,o=n.getDataset(),r=a.options,s=r.animation,l=a.scale,d=a.data.labels,u=l.xCenter,h=l.yCenter,c=r.startAngle,f=t.hidden?0:l.getDistanceFromCenterForValue(o.data[e]),g=n._starts[e],p=g+(t.hidden?0:n._angles[e]),m=s.animateScale?0:l.getDistanceFromCenterForValue(o.data[e]),v=t._options||{};ut.extend(t,{_datasetIndex:n.index,_index:e,_scale:l,_model:{backgroundColor:v.backgroundColor,borderColor:v.borderColor,borderWidth:v.borderWidth,borderAlign:v.borderAlign,x:u,y:h,innerRadius:0,outerRadius:i?m:f,startAngle:i&&s.animateRotate?c:g,endAngle:i&&s.animateRotate?c:p,label:ut.valueAtIndexOrDefault(d,e,d[e])}}),t.pivot()},countVisibleElements:function(){var t=this.getDataset(),e=this.getMeta(),i=0;return ut.each(e.data,function(e,n){isNaN(t.data[n])||e.hidden||i++}),i},setHoverStyle:function(t){var e=t._model,i=t._options,n=ut.getHoverColor,a=ut.valueOrDefault;t.$previousStyle={backgroundColor:e.backgroundColor,borderColor:e.borderColor,borderWidth:e.borderWidth},e.backgroundColor=a(i.hoverBackgroundColor,n(i.backgroundColor)),e.borderColor=a(i.hoverBorderColor,n(i.borderColor)),e.borderWidth=a(i.hoverBorderWidth,i.borderWidth)},_resolveElementOptions:function(t,e){var i,n,a,o=this.chart,r=this.getDataset(),s=t.custom||{},l=o.options.elements.arc,d={},u={chart:o,dataIndex:e,dataset:r,datasetIndex:this.index},h=["backgroundColor","borderColor","borderWidth","borderAlign","hoverBackgroundColor","hoverBorderColor","hoverBorderWidth"];for(i=0,n=h.length;i<n;++i)d[a=h[i]]=ae([s[a],r[a],l[a]],u,e);return d},_computeAngle:function(t){var e=this,i=this.getMeta().count,n=e.getDataset(),a=e.getMeta();if(isNaN(n.data[t])||a.data[t].hidden)return 0;var o={chart:e.chart,dataIndex:t,dataset:n,datasetIndex:e.index};return ae([e.chart.options.elements.arc.angle,2*Math.PI/i],o,t)}});st._set("pie",ut.clone(st.doughnut)),st._set("pie",{cutoutPercentage:0});var re=$t,se=ut.valueOrDefault,le=ut.options.resolve;st._set("radar",{scale:{type:"radialLinear"},elements:{line:{tension:0}}});var de=Mt.extend({datasetElementType:Wt.Line,dataElementType:Wt.Point,linkScales:ut.noop,update:function(t){var e,i,n=this,a=n.getMeta(),o=a.dataset,r=a.data||[],s=n.chart.scale,l=n.getDataset();for(void 0!==l.tension&&void 0===l.lineTension&&(l.lineTension=l.tension),o._scale=s,o._datasetIndex=n.index,o._children=r,o._loop=!0,o._model=n._resolveLineOptions(o),o.pivot(),e=0,i=r.length;e<i;++e)n.updateElement(r[e],e,t);for(n.updateBezierControlPoints(),e=0,i=r.length;e<i;++e)r[e].pivot()},updateElement:function(t,e,i){var n=this,a=t.custom||{},o=n.getDataset(),r=n.chart.scale,s=r.getPointPositionForValue(e,o.data[e]),l=n._resolvePointOptions(t,e),d=n.getMeta().dataset._model,u=i?r.xCenter:s.x,h=i?r.yCenter:s.y;t._scale=r,t._options=l,t._datasetIndex=n.index,t._index=e,t._model={x:u,y:h,skip:a.skip||isNaN(u)||isNaN(h),radius:l.radius,pointStyle:l.pointStyle,rotation:l.rotation,backgroundColor:l.backgroundColor,borderColor:l.borderColor,borderWidth:l.borderWidth,tension:se(a.tension,d?d.tension:0),hitRadius:l.hitRadius}},_resolvePointOptions:function(t,e){var i,n,a,o=this.chart,r=o.data.datasets[this.index],s=t.custom||{},l=o.options.elements.point,d={},u={chart:o,dataIndex:e,dataset:r,datasetIndex:this.index},h={backgroundColor:"pointBackgroundColor",borderColor:"pointBorderColor",borderWidth:"pointBorderWidth",hitRadius:"pointHitRadius",hoverBackgroundColor:"pointHoverBackgroundColor",hoverBorderColor:"pointHoverBorderColor",hoverBorderWidth:"pointHoverBorderWidth",hoverRadius:"pointHoverRadius",pointStyle:"pointStyle",radius:"pointRadius",rotation:"pointRotation"},c=Object.keys(h);for(i=0,n=c.length;i<n;++i)d[a=c[i]]=le([s[a],r[h[a]],r[a],l[a]],u,e);return d},_resolveLineOptions:function(t){var e,i,n,a=this.chart,o=a.data.datasets[this.index],r=t.custom||{},s=a.options.elements.line,l={},d=["backgroundColor","borderWidth","borderColor","borderCapStyle","borderDash","borderDashOffset","borderJoinStyle","fill"];for(e=0,i=d.length;e<i;++e)l[n=d[e]]=le([r[n],o[n],s[n]]);return l.tension=se(o.lineTension,s.tension),l},updateBezierControlPoints:function(){var t,e,i,n,a=this.getMeta(),o=this.chart.chartArea,r=a.data||[];function s(t,e,i){return Math.max(Math.min(t,i),e)}for(t=0,e=r.length;t<e;++t)i=r[t]._model,n=ut.splineCurve(ut.previousItem(r,t,!0)._model,i,ut.nextItem(r,t,!0)._model,i.tension),i.controlPointPreviousX=s(n.previous.x,o.left,o.right),i.controlPointPreviousY=s(n.previous.y,o.top,o.bottom),i.controlPointNextX=s(n.next.x,o.left,o.right),i.controlPointNextY=s(n.next.y,o.top,o.bottom)},setHoverStyle:function(t){var e=t._model,i=t._options,n=ut.getHoverColor;t.$previousStyle={backgroundColor:e.backgroundColor,borderColor:e.borderColor,borderWidth:e.borderWidth,radius:e.radius},e.backgroundColor=se(i.hoverBackgroundColor,n(i.backgroundColor)),e.borderColor=se(i.hoverBorderColor,n(i.borderColor)),e.borderWidth=se(i.hoverBorderWidth,i.borderWidth),e.radius=se(i.hoverRadius,i.radius)}});st._set("scatter",{hover:{mode:"single"},scales:{xAxes:[{id:"x-axis-1",type:"linear",position:"bottom"}],yAxes:[{id:"y-axis-1",type:"linear",position:"left"}]},showLines:!1,tooltips:{callbacks:{title:function(){return""},label:function(t){return"("+t.xLabel+", "+t.yLabel+")"}}}});var ue={bar:Yt,bubble:Kt,doughnut:$t,horizontalBar:Jt,line:ne,polarArea:oe,pie:re,radar:de,scatter:ne};function he(t,e){return t.native?{x:t.x,y:t.y}:ut.getRelativePosition(t,e)}function ce(t,e){var i,n,a,o,r;for(n=0,o=t.data.datasets.length;n<o;++n)if(t.isDatasetVisible(n))for(a=0,r=(i=t.getDatasetMeta(n)).data.length;a<r;++a){var s=i.data[a];s._view.skip||e(s)}}function fe(t,e){var i=[];return ce(t,function(t){t.inRange(e.x,e.y)&&i.push(t)}),i}function ge(t,e,i,n){var a=Number.POSITIVE_INFINITY,o=[];return ce(t,function(t){if(!i||t.inRange(e.x,e.y)){var r=t.getCenterPoint(),s=n(e,r);s<a?(o=[t],a=s):s===a&&o.push(t)}}),o}function pe(t){var e=-1!==t.indexOf("x"),i=-1!==t.indexOf("y");return function(t,n){var a=e?Math.abs(t.x-n.x):0,o=i?Math.abs(t.y-n.y):0;return Math.sqrt(Math.pow(a,2)+Math.pow(o,2))}}function me(t,e,i){var n=he(e,t);i.axis=i.axis||"x";var a=pe(i.axis),o=i.intersect?fe(t,n):ge(t,n,!1,a),r=[];return o.length?(t.data.datasets.forEach(function(e,i){if(t.isDatasetVisible(i)){var n=t.getDatasetMeta(i).data[o[0]._index];n&&!n._view.skip&&r.push(n)}}),r):[]}var ve={modes:{single:function(t,e){var i=he(e,t),n=[];return ce(t,function(t){if(t.inRange(i.x,i.y))return n.push(t),n}),n.slice(0,1)},label:me,index:me,dataset:function(t,e,i){var n=he(e,t);i.axis=i.axis||"xy";var a=pe(i.axis),o=i.intersect?fe(t,n):ge(t,n,!1,a);return o.length>0&&(o=t.getDatasetMeta(o[0]._datasetIndex).data),o},"x-axis":function(t,e){return me(t,e,{intersect:!1})},point:function(t,e){return fe(t,he(e,t))},nearest:function(t,e,i){var n=he(e,t);i.axis=i.axis||"xy";var a=pe(i.axis);return ge(t,n,i.intersect,a)},x:function(t,e,i){var n=he(e,t),a=[],o=!1;return ce(t,function(t){t.inXRange(n.x)&&a.push(t),t.inRange(n.x,n.y)&&(o=!0)}),i.intersect&&!o&&(a=[]),a},y:function(t,e,i){var n=he(e,t),a=[],o=!1;return ce(t,function(t){t.inYRange(n.y)&&a.push(t),t.inRange(n.x,n.y)&&(o=!0)}),i.intersect&&!o&&(a=[]),a}}};function be(t,e){return ut.where(t,function(t){return t.position===e})}function xe(t,e){t.forEach(function(t,e){return t._tmpIndex_=e,t}),t.sort(function(t,i){var n=e?i:t,a=e?t:i;return n.weight===a.weight?n._tmpIndex_-a._tmpIndex_:n.weight-a.weight}),t.forEach(function(t){delete t._tmpIndex_})}function ye(t,e){ut.each(t,function(t){e[t.position]+=t.isHorizontal()?t.height:t.width})}st._set("global",{layout:{padding:{top:0,right:0,bottom:0,left:0}}});var ke={defaults:{},addBox:function(t,e){t.boxes||(t.boxes=[]),e.fullWidth=e.fullWidth||!1,e.position=e.position||"top",e.weight=e.weight||0,t.boxes.push(e)},removeBox:function(t,e){var i=t.boxes?t.boxes.indexOf(e):-1;-1!==i&&t.boxes.splice(i,1)},configure:function(t,e,i){for(var n,a=["fullWidth","position","weight"],o=a.length,r=0;r<o;++r)n=a[r],i.hasOwnProperty(n)&&(e[n]=i[n])},update:function(t,e,i){if(t){var n=t.options.layout||{},a=ut.options.toPadding(n.padding),o=a.left,r=a.right,s=a.top,l=a.bottom,d=be(t.boxes,"left"),u=be(t.boxes,"right"),h=be(t.boxes,"top"),c=be(t.boxes,"bottom"),f=be(t.boxes,"chartArea");xe(d,!0),xe(u,!1),xe(h,!0),xe(c,!1);var g,p=d.concat(u),m=h.concat(c),v=p.concat(m),b=e-o-r,x=i-s-l,y=(e-b/2)/p.length,k=b,w=x,M={top:s,left:o,bottom:l,right:r},_=[];ut.each(v,function(t){var e,i=t.isHorizontal();i?(e=t.update(t.fullWidth?b:k,x/2),w-=e.height):(e=t.update(y,w),k-=e.width),_.push({horizontal:i,width:e.width,box:t})}),g=function(t){var e=0,i=0,n=0,a=0;return ut.each(t,function(t){if(t.getPadding){var o=t.getPadding();e=Math.max(e,o.top),i=Math.max(i,o.left),n=Math.max(n,o.bottom),a=Math.max(a,o.right)}}),{top:e,left:i,bottom:n,right:a}}(v),ut.each(p,T),ye(p,M),ut.each(m,T),ye(m,M),ut.each(p,function(t){var e=ut.findNextWhere(_,function(e){return e.box===t}),i={left:0,right:0,top:M.top,bottom:M.bottom};e&&t.update(e.width,w,i)}),ye(v,M={top:s,left:o,bottom:l,right:r});var C=Math.max(g.left-M.left,0);M.left+=C,M.right+=Math.max(g.right-M.right,0);var S=Math.max(g.top-M.top,0);M.top+=S,M.bottom+=Math.max(g.bottom-M.bottom,0);var P=i-M.top-M.bottom,I=e-M.left-M.right;I===k&&P===w||(ut.each(p,function(t){t.height=P}),ut.each(m,function(t){t.fullWidth||(t.width=I)}),w=P,k=I);var A=o+C,D=s+S;ut.each(d.concat(h),F),A+=k,D+=w,ut.each(u,F),ut.each(c,F),t.chartArea={left:M.left,top:M.top,right:M.left+k,bottom:M.top+w},ut.each(f,function(e){e.left=t.chartArea.left,e.top=t.chartArea.top,e.right=t.chartArea.right,e.bottom=t.chartArea.bottom,e.update(k,w)})}function T(t){var e=ut.findNextWhere(_,function(e){return e.box===t});if(e)if(e.horizontal){var i={left:Math.max(M.left,g.left),right:Math.max(M.right,g.right),top:0,bottom:0};t.update(t.fullWidth?b:k,x/2,i)}else t.update(e.width,w)}function F(t){t.isHorizontal()?(t.left=t.fullWidth?o:M.left,t.right=t.fullWidth?e-r:M.left+k,t.top=D,t.bottom=D+t.height,D=t.bottom):(t.left=A,t.right=A+t.width,t.top=M.top,t.bottom=M.top+w,A=t.right)}}};var we,Me=(we=Object.freeze({default:"@keyframes chartjs-render-animation{from{opacity:.99}to{opacity:1}}.chartjs-render-monitor{animation:chartjs-render-animation 1ms}.chartjs-size-monitor,.chartjs-size-monitor-expand,.chartjs-size-monitor-shrink{position:absolute;direction:ltr;left:0;top:0;right:0;bottom:0;overflow:hidden;pointer-events:none;visibility:hidden;z-index:-1}.chartjs-size-monitor-expand>div{position:absolute;width:1000000px;height:1000000px;left:0;top:0}.chartjs-size-monitor-shrink>div{position:absolute;width:200%;height:200%;left:0;top:0}"}))&&we.default||we,_e="$chartjs",Ce="chartjs-size-monitor",Se="chartjs-render-monitor",Pe="chartjs-render-animation",Ie=["animationstart","webkitAnimationStart"],Ae={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"};function De(t,e){var i=ut.getStyle(t,e),n=i&&i.match(/^(\d+)(\.\d+)?px$/);return n?Number(n[1]):void 0}var Te=!!function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("e",null,e)}catch(t){}return t}()&&{passive:!0};function Fe(t,e,i){t.addEventListener(e,i,Te)}function Le(t,e,i){t.removeEventListener(e,i,Te)}function Re(t,e,i,n,a){return{type:t,chart:e,native:a||null,x:void 0!==i?i:null,y:void 0!==n?n:null}}function Oe(t){var e=document.createElement("div");return e.className=t||"",e}function ze(t,e,i){var n,a,o,r,s=t[_e]||(t[_e]={}),l=s.resizer=function(t){var e=Oe(Ce),i=Oe(Ce+"-expand"),n=Oe(Ce+"-shrink");i.appendChild(Oe()),n.appendChild(Oe()),e.appendChild(i),e.appendChild(n),e._reset=function(){i.scrollLeft=1e6,i.scrollTop=1e6,n.scrollLeft=1e6,n.scrollTop=1e6};var a=function(){e._reset(),t()};return Fe(i,"scroll",a.bind(i,"expand")),Fe(n,"scroll",a.bind(n,"shrink")),e}((n=function(){if(s.resizer){var n=i.options.maintainAspectRatio&&t.parentNode,a=n?n.clientWidth:0;e(Re("resize",i)),n&&n.clientWidth<a&&i.canvas&&e(Re("resize",i))}},o=!1,r=[],function(){r=Array.prototype.slice.call(arguments),a=a||this,o||(o=!0,ut.requestAnimFrame.call(window,function(){o=!1,n.apply(a,r)}))}));!function(t,e){var i=t[_e]||(t[_e]={}),n=i.renderProxy=function(t){t.animationName===Pe&&e()};ut.each(Ie,function(e){Fe(t,e,n)}),i.reflow=!!t.offsetParent,t.classList.add(Se)}(t,function(){if(s.resizer){var e=t.parentNode;e&&e!==l.parentNode&&e.insertBefore(l,e.firstChild),l._reset()}})}function Be(t){var e=t[_e]||{},i=e.resizer;delete e.resizer,function(t){var e=t[_e]||{},i=e.renderProxy;i&&(ut.each(Ie,function(e){Le(t,e,i)}),delete e.renderProxy),t.classList.remove(Se)}(t),i&&i.parentNode&&i.parentNode.removeChild(i)}var Ne={disableCSSInjection:!1,_enabled:"undefined"!=typeof window&&"undefined"!=typeof document,_ensureLoaded:function(){var t,e,i;this._loaded||(this._loaded=!0,this.disableCSSInjection||(e=Me,i=(t=this)._style||document.createElement("style"),t._style||(t._style=i,e="/* Chart.js */\n"+e,i.setAttribute("type","text/css"),document.getElementsByTagName("head")[0].appendChild(i)),i.appendChild(document.createTextNode(e))))},acquireContext:function(t,e){"string"==typeof t?t=document.getElementById(t):t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas);var i=t&&t.getContext&&t.getContext("2d");return this._ensureLoaded(),i&&i.canvas===t?(function(t,e){var i=t.style,n=t.getAttribute("height"),a=t.getAttribute("width");if(t[_e]={initial:{height:n,width:a,style:{display:i.display,height:i.height,width:i.width}}},i.display=i.display||"block",null===a||""===a){var o=De(t,"width");void 0!==o&&(t.width=o)}if(null===n||""===n)if(""===t.style.height)t.height=t.width/(e.options.aspectRatio||2);else{var r=De(t,"height");void 0!==o&&(t.height=r)}}(t,e),i):null},releaseContext:function(t){var e=t.canvas;if(e[_e]){var i=e[_e].initial;["height","width"].forEach(function(t){var n=i[t];ut.isNullOrUndef(n)?e.removeAttribute(t):e.setAttribute(t,n)}),ut.each(i.style||{},function(t,i){e.style[i]=t}),e.width=e.width,delete e[_e]}},addEventListener:function(t,e,i){var n=t.canvas;if("resize"!==e){var a=i[_e]||(i[_e]={});Fe(n,e,(a.proxies||(a.proxies={}))[t.id+"_"+e]=function(e){i(function(t,e){var i=Ae[t.type]||t.type,n=ut.getRelativePosition(t,e);return Re(i,e,n.x,n.y,t)}(e,t))})}else ze(n,i,t)},removeEventListener:function(t,e,i){var n=t.canvas;if("resize"!==e){var a=((i[_e]||{}).proxies||{})[t.id+"_"+e];a&&Le(n,e,a)}else Be(n)}};ut.addEvent=Fe,ut.removeEvent=Le;var We=Ne._enabled?Ne:{acquireContext:function(t){return t&&t.canvas&&(t=t.canvas),t&&t.getContext("2d")||null}},Ve=ut.extend({initialize:function(){},acquireContext:function(){},releaseContext:function(){},addEventListener:function(){},removeEventListener:function(){}},We);st._set("global",{plugins:{}});var Ee={_plugins:[],_cacheId:0,register:function(t){var e=this._plugins;[].concat(t).forEach(function(t){-1===e.indexOf(t)&&e.push(t)}),this._cacheId++},unregister:function(t){var e=this._plugins;[].concat(t).forEach(function(t){var i=e.indexOf(t);-1!==i&&e.splice(i,1)}),this._cacheId++},clear:function(){this._plugins=[],this._cacheId++},count:function(){return this._plugins.length},getAll:function(){return this._plugins},notify:function(t,e,i){var n,a,o,r,s,l=this.descriptors(t),d=l.length;for(n=0;n<d;++n)if("function"==typeof(s=(o=(a=l[n]).plugin)[e])&&((r=[t].concat(i||[])).push(a.options),!1===s.apply(o,r)))return!1;return!0},descriptors:function(t){var e=t.$plugins||(t.$plugins={});if(e.id===this._cacheId)return e.descriptors;var i=[],n=[],a=t&&t.config||{},o=a.options&&a.options.plugins||{};return this._plugins.concat(a.plugins||[]).forEach(function(t){if(-1===i.indexOf(t)){var e=t.id,a=o[e];!1!==a&&(!0===a&&(a=ut.clone(st.global.plugins[e])),i.push(t),n.push({plugin:t,options:a||{}}))}}),e.descriptors=n,e.id=this._cacheId,n},_invalidate:function(t){delete t.$plugins}},He={constructors:{},defaults:{},registerScaleType:function(t,e,i){this.constructors[t]=e,this.defaults[t]=ut.clone(i)},getScaleConstructor:function(t){return this.constructors.hasOwnProperty(t)?this.constructors[t]:void 0},getScaleDefaults:function(t){return this.defaults.hasOwnProperty(t)?ut.merge({},[st.scale,this.defaults[t]]):{}},updateScaleDefaults:function(t,e){this.defaults.hasOwnProperty(t)&&(this.defaults[t]=ut.extend(this.defaults[t],e))},addScalesToLayout:function(t){ut.each(t.scales,function(e){e.fullWidth=e.options.fullWidth,e.position=e.options.position,e.weight=e.options.weight,ke.addBox(t,e)})}},je=ut.valueOrDefault;st._set("global",{tooltips:{enabled:!0,custom:null,mode:"nearest",position:"average",intersect:!0,backgroundColor:"rgba(0,0,0,0.8)",titleFontStyle:"bold",titleSpacing:2,titleMarginBottom:6,titleFontColor:"#fff",titleAlign:"left",bodySpacing:2,bodyFontColor:"#fff",bodyAlign:"left",footerFontStyle:"bold",footerSpacing:2,footerMarginTop:6,footerFontColor:"#fff",footerAlign:"left",yPadding:6,xPadding:6,caretPadding:2,caretSize:5,cornerRadius:6,multiKeyBackground:"#fff",displayColors:!0,borderColor:"rgba(0,0,0,0)",borderWidth:0,callbacks:{beforeTitle:ut.noop,title:function(t,e){var i="",n=e.labels,a=n?n.length:0;if(t.length>0){var o=t[0];o.label?i=o.label:o.xLabel?i=o.xLabel:a>0&&o.index<a&&(i=n[o.index])}return i},afterTitle:ut.noop,beforeBody:ut.noop,beforeLabel:ut.noop,label:function(t,e){var i=e.datasets[t.datasetIndex].label||"";return i&&(i+=": "),ut.isNullOrUndef(t.value)?i+=t.yLabel:i+=t.value,i},labelColor:function(t,e){var i=e.getDatasetMeta(t.datasetIndex).data[t.index]._view;return{borderColor:i.borderColor,backgroundColor:i.backgroundColor}},labelTextColor:function(){return this._options.bodyFontColor},afterLabel:ut.noop,afterBody:ut.noop,beforeFooter:ut.noop,footer:ut.noop,afterFooter:ut.noop}}});var qe={average:function(t){if(!t.length)return!1;var e,i,n=0,a=0,o=0;for(e=0,i=t.length;e<i;++e){var r=t[e];if(r&&r.hasValue()){var s=r.tooltipPosition();n+=s.x,a+=s.y,++o}}return{x:n/o,y:a/o}},nearest:function(t,e){var i,n,a,o=e.x,r=e.y,s=Number.POSITIVE_INFINITY;for(i=0,n=t.length;i<n;++i){var l=t[i];if(l&&l.hasValue()){var d=l.getCenterPoint(),u=ut.distanceBetweenPoints(e,d);u<s&&(s=u,a=l)}}if(a){var h=a.tooltipPosition();o=h.x,r=h.y}return{x:o,y:r}}};function Ye(t,e){return e&&(ut.isArray(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function Ue(t){return("string"==typeof t||t instanceof String)&&t.indexOf("\n")>-1?t.split("\n"):t}function Xe(t){var e=st.global;return{xPadding:t.xPadding,yPadding:t.yPadding,xAlign:t.xAlign,yAlign:t.yAlign,bodyFontColor:t.bodyFontColor,_bodyFontFamily:je(t.bodyFontFamily,e.defaultFontFamily),_bodyFontStyle:je(t.bodyFontStyle,e.defaultFontStyle),_bodyAlign:t.bodyAlign,bodyFontSize:je(t.bodyFontSize,e.defaultFontSize),bodySpacing:t.bodySpacing,titleFontColor:t.titleFontColor,_titleFontFamily:je(t.titleFontFamily,e.defaultFontFamily),_titleFontStyle:je(t.titleFontStyle,e.defaultFontStyle),titleFontSize:je(t.titleFontSize,e.defaultFontSize),_titleAlign:t.titleAlign,titleSpacing:t.titleSpacing,titleMarginBottom:t.titleMarginBottom,footerFontColor:t.footerFontColor,_footerFontFamily:je(t.footerFontFamily,e.defaultFontFamily),_footerFontStyle:je(t.footerFontStyle,e.defaultFontStyle),footerFontSize:je(t.footerFontSize,e.defaultFontSize),_footerAlign:t.footerAlign,footerSpacing:t.footerSpacing,footerMarginTop:t.footerMarginTop,caretSize:t.caretSize,cornerRadius:t.cornerRadius,backgroundColor:t.backgroundColor,opacity:0,legendColorBackground:t.multiKeyBackground,displayColors:t.displayColors,borderColor:t.borderColor,borderWidth:t.borderWidth}}function Ke(t,e){return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-t.xPadding:t.x+t.xPadding}function Ge(t){return Ye([],Ue(t))}var Ze=pt.extend({initialize:function(){this._model=Xe(this._options),this._lastActive=[]},getTitle:function(){var t=this._options.callbacks,e=t.beforeTitle.apply(this,arguments),i=t.title.apply(this,arguments),n=t.afterTitle.apply(this,arguments),a=[];return a=Ye(a,Ue(e)),a=Ye(a,Ue(i)),a=Ye(a,Ue(n))},getBeforeBody:function(){return Ge(this._options.callbacks.beforeBody.apply(this,arguments))},getBody:function(t,e){var i=this,n=i._options.callbacks,a=[];return ut.each(t,function(t){var o={before:[],lines:[],after:[]};Ye(o.before,Ue(n.beforeLabel.call(i,t,e))),Ye(o.lines,n.label.call(i,t,e)),Ye(o.after,Ue(n.afterLabel.call(i,t,e))),a.push(o)}),a},getAfterBody:function(){return Ge(this._options.callbacks.afterBody.apply(this,arguments))},getFooter:function(){var t=this._options.callbacks,e=t.beforeFooter.apply(this,arguments),i=t.footer.apply(this,arguments),n=t.afterFooter.apply(this,arguments),a=[];return a=Ye(a,Ue(e)),a=Ye(a,Ue(i)),a=Ye(a,Ue(n))},update:function(t){var e,i,n,a,o,r,s,l,d,u,h=this,c=h._options,f=h._model,g=h._model=Xe(c),p=h._active,m=h._data,v={xAlign:f.xAlign,yAlign:f.yAlign},b={x:f.x,y:f.y},x={width:f.width,height:f.height},y={x:f.caretX,y:f.caretY};if(p.length){g.opacity=1;var k=[],w=[];y=qe[c.position].call(h,p,h._eventPosition);var M=[];for(e=0,i=p.length;e<i;++e)M.push((n=p[e],a=void 0,o=void 0,r=void 0,s=void 0,l=void 0,d=void 0,u=void 0,a=n._xScale,o=n._yScale||n._scale,r=n._index,s=n._datasetIndex,l=n._chart.getDatasetMeta(s).controller,d=l._getIndexScale(),u=l._getValueScale(),{xLabel:a?a.getLabelForIndex(r,s):"",yLabel:o?o.getLabelForIndex(r,s):"",label:d?""+d.getLabelForIndex(r,s):"",value:u?""+u.getLabelForIndex(r,s):"",index:r,datasetIndex:s,x:n._model.x,y:n._model.y}));c.filter&&(M=M.filter(function(t){return c.filter(t,m)})),c.itemSort&&(M=M.sort(function(t,e){return c.itemSort(t,e,m)})),ut.each(M,function(t){k.push(c.callbacks.labelColor.call(h,t,h._chart)),w.push(c.callbacks.labelTextColor.call(h,t,h._chart))}),g.title=h.getTitle(M,m),g.beforeBody=h.getBeforeBody(M,m),g.body=h.getBody(M,m),g.afterBody=h.getAfterBody(M,m),g.footer=h.getFooter(M,m),g.x=y.x,g.y=y.y,g.caretPadding=c.caretPadding,g.labelColors=k,g.labelTextColors=w,g.dataPoints=M,x=function(t,e){var i=t._chart.ctx,n=2*e.yPadding,a=0,o=e.body,r=o.reduce(function(t,e){return t+e.before.length+e.lines.length+e.after.length},0);r+=e.beforeBody.length+e.afterBody.length;var s=e.title.length,l=e.footer.length,d=e.titleFontSize,u=e.bodyFontSize,h=e.footerFontSize;n+=s*d,n+=s?(s-1)*e.titleSpacing:0,n+=s?e.titleMarginBottom:0,n+=r*u,n+=r?(r-1)*e.bodySpacing:0,n+=l?e.footerMarginTop:0,n+=l*h,n+=l?(l-1)*e.footerSpacing:0;var c=0,f=function(t){a=Math.max(a,i.measureText(t).width+c)};return i.font=ut.fontString(d,e._titleFontStyle,e._titleFontFamily),ut.each(e.title,f),i.font=ut.fontString(u,e._bodyFontStyle,e._bodyFontFamily),ut.each(e.beforeBody.concat(e.afterBody),f),c=e.displayColors?u+2:0,ut.each(o,function(t){ut.each(t.before,f),ut.each(t.lines,f),ut.each(t.after,f)}),c=0,i.font=ut.fontString(h,e._footerFontStyle,e._footerFontFamily),ut.each(e.footer,f),{width:a+=2*e.xPadding,height:n}}(this,g),b=function(t,e,i,n){var a=t.x,o=t.y,r=t.caretSize,s=t.caretPadding,l=t.cornerRadius,d=i.xAlign,u=i.yAlign,h=r+s,c=l+s;return"right"===d?a-=e.width:"center"===d&&((a-=e.width/2)+e.width>n.width&&(a=n.width-e.width),a<0&&(a=0)),"top"===u?o+=h:o-="bottom"===u?e.height+h:e.height/2,"center"===u?"left"===d?a+=h:"right"===d&&(a-=h):"left"===d?a-=c:"right"===d&&(a+=c),{x:a,y:o}}(g,x,v=function(t,e){var i,n,a,o,r,s=t._model,l=t._chart,d=t._chart.chartArea,u="center",h="center";s.y<e.height?h="top":s.y>l.height-e.height&&(h="bottom");var c=(d.left+d.right)/2,f=(d.top+d.bottom)/2;"center"===h?(i=function(t){return t<=c},n=function(t){return t>c}):(i=function(t){return t<=e.width/2},n=function(t){return t>=l.width-e.width/2}),a=function(t){return t+e.width+s.caretSize+s.caretPadding>l.width},o=function(t){return t-e.width-s.caretSize-s.caretPadding<0},r=function(t){return t<=f?"top":"bottom"},i(s.x)?(u="left",a(s.x)&&(u="center",h=r(s.y))):n(s.x)&&(u="right",o(s.x)&&(u="center",h=r(s.y)));var g=t._options;return{xAlign:g.xAlign?g.xAlign:u,yAlign:g.yAlign?g.yAlign:h}}(this,x),h._chart)}else g.opacity=0;return g.xAlign=v.xAlign,g.yAlign=v.yAlign,g.x=b.x,g.y=b.y,g.width=x.width,g.height=x.height,g.caretX=y.x,g.caretY=y.y,h._model=g,t&&c.custom&&c.custom.call(h,g),h},drawCaret:function(t,e){var i=this._chart.ctx,n=this._view,a=this.getCaretPosition(t,e,n);i.lineTo(a.x1,a.y1),i.lineTo(a.x2,a.y2),i.lineTo(a.x3,a.y3)},getCaretPosition:function(t,e,i){var n,a,o,r,s,l,d=i.caretSize,u=i.cornerRadius,h=i.xAlign,c=i.yAlign,f=t.x,g=t.y,p=e.width,m=e.height;if("center"===c)s=g+m/2,"left"===h?(a=(n=f)-d,o=n,r=s+d,l=s-d):(a=(n=f+p)+d,o=n,r=s-d,l=s+d);else if("left"===h?(n=(a=f+u+d)-d,o=a+d):"right"===h?(n=(a=f+p-u-d)-d,o=a+d):(n=(a=i.caretX)-d,o=a+d),"top"===c)s=(r=g)-d,l=r;else{s=(r=g+m)+d,l=r;var v=o;o=n,n=v}return{x1:n,x2:a,x3:o,y1:r,y2:s,y3:l}},drawTitle:function(t,e,i){var n=e.title;if(n.length){t.x=Ke(e,e._titleAlign),i.textAlign=e._titleAlign,i.textBaseline="top";var a,o,r=e.titleFontSize,s=e.titleSpacing;for(i.fillStyle=e.titleFontColor,i.font=ut.fontString(r,e._titleFontStyle,e._titleFontFamily),a=0,o=n.length;a<o;++a)i.fillText(n[a],t.x,t.y),t.y+=r+s,a+1===n.length&&(t.y+=e.titleMarginBottom-s)}},drawBody:function(t,e,i){var n,a=e.bodyFontSize,o=e.bodySpacing,r=e._bodyAlign,s=e.body,l=e.displayColors,d=e.labelColors,u=0,h=l?Ke(e,"left"):0;i.textAlign=r,i.textBaseline="top",i.font=ut.fontString(a,e._bodyFontStyle,e._bodyFontFamily),t.x=Ke(e,r);var c=function(e){i.fillText(e,t.x+u,t.y),t.y+=a+o};i.fillStyle=e.bodyFontColor,ut.each(e.beforeBody,c),u=l&&"right"!==r?"center"===r?a/2+1:a+2:0,ut.each(s,function(o,r){n=e.labelTextColors[r],i.fillStyle=n,ut.each(o.before,c),ut.each(o.lines,function(o){l&&(i.fillStyle=e.legendColorBackground,i.fillRect(h,t.y,a,a),i.lineWidth=1,i.strokeStyle=d[r].borderColor,i.strokeRect(h,t.y,a,a),i.fillStyle=d[r].backgroundColor,i.fillRect(h+1,t.y+1,a-2,a-2),i.fillStyle=n),c(o)}),ut.each(o.after,c)}),u=0,ut.each(e.afterBody,c),t.y-=o},drawFooter:function(t,e,i){var n=e.footer;n.length&&(t.x=Ke(e,e._footerAlign),t.y+=e.footerMarginTop,i.textAlign=e._footerAlign,i.textBaseline="top",i.fillStyle=e.footerFontColor,i.font=ut.fontString(e.footerFontSize,e._footerFontStyle,e._footerFontFamily),ut.each(n,function(n){i.fillText(n,t.x,t.y),t.y+=e.footerFontSize+e.footerSpacing}))},drawBackground:function(t,e,i,n){i.fillStyle=e.backgroundColor,i.strokeStyle=e.borderColor,i.lineWidth=e.borderWidth;var a=e.xAlign,o=e.yAlign,r=t.x,s=t.y,l=n.width,d=n.height,u=e.cornerRadius;i.beginPath(),i.moveTo(r+u,s),"top"===o&&this.drawCaret(t,n),i.lineTo(r+l-u,s),i.quadraticCurveTo(r+l,s,r+l,s+u),"center"===o&&"right"===a&&this.drawCaret(t,n),i.lineTo(r+l,s+d-u),i.quadraticCurveTo(r+l,s+d,r+l-u,s+d),"bottom"===o&&this.drawCaret(t,n),i.lineTo(r+u,s+d),i.quadraticCurveTo(r,s+d,r,s+d-u),"center"===o&&"left"===a&&this.drawCaret(t,n),i.lineTo(r,s+u),i.quadraticCurveTo(r,s,r+u,s),i.closePath(),i.fill(),e.borderWidth>0&&i.stroke()},draw:function(){var t=this._chart.ctx,e=this._view;if(0!==e.opacity){var i={width:e.width,height:e.height},n={x:e.x,y:e.y},a=Math.abs(e.opacity<.001)?0:e.opacity,o=e.title.length||e.beforeBody.length||e.body.length||e.afterBody.length||e.footer.length;this._options.enabled&&o&&(t.save(),t.globalAlpha=a,this.drawBackground(n,e,t,i),n.y+=e.yPadding,this.drawTitle(n,e,t),this.drawBody(n,e,t),this.drawFooter(n,e,t),t.restore())}},handleEvent:function(t){var e,i=this,n=i._options;return i._lastActive=i._lastActive||[],"mouseout"===t.type?i._active=[]:i._active=i._chart.getElementsAtEventForMode(t,n.mode,n),(e=!ut.arrayEquals(i._active,i._lastActive))&&(i._lastActive=i._active,(n.enabled||n.custom)&&(i._eventPosition={x:t.x,y:t.y},i.update(!0),i.pivot())),e}}),$e=qe,Je=Ze;Je.positioners=$e;var Qe=ut.valueOrDefault;function ti(){return ut.merge({},[].slice.call(arguments),{merger:function(t,e,i,n){if("xAxes"===t||"yAxes"===t){var a,o,r,s=i[t].length;for(e[t]||(e[t]=[]),a=0;a<s;++a)r=i[t][a],o=Qe(r.type,"xAxes"===t?"category":"linear"),a>=e[t].length&&e[t].push({}),!e[t][a].type||r.type&&r.type!==e[t][a].type?ut.merge(e[t][a],[He.getScaleDefaults(o),r]):ut.merge(e[t][a],r)}else ut._merger(t,e,i,n)}})}function ei(){return ut.merge({},[].slice.call(arguments),{merger:function(t,e,i,n){var a=e[t]||{},o=i[t];"scales"===t?e[t]=ti(a,o):"scale"===t?e[t]=ut.merge(a,[He.getScaleDefaults(o.type),o]):ut._merger(t,e,i,n)}})}function ii(t){return"top"===t||"bottom"===t}st._set("global",{elements:{},events:["mousemove","mouseout","click","touchstart","touchmove"],hover:{onHover:null,mode:"nearest",intersect:!0,animationDuration:400},onClick:null,maintainAspectRatio:!0,responsive:!0,responsiveAnimationDuration:0});var ni=function(t,e){return this.construct(t,e),this};ut.extend(ni.prototype,{construct:function(t,e){var i=this;e=function(t){var e=(t=t||{}).data=t.data||{};return e.datasets=e.datasets||[],e.labels=e.labels||[],t.options=ei(st.global,st[t.type],t.options||{}),t}(e);var n=Ve.acquireContext(t,e),a=n&&n.canvas,o=a&&a.height,r=a&&a.width;i.id=ut.uid(),i.ctx=n,i.canvas=a,i.config=e,i.width=r,i.height=o,i.aspectRatio=o?r/o:null,i.options=e.options,i._bufferedRender=!1,i.chart=i,i.controller=i,ni.instances[i.id]=i,Object.defineProperty(i,"data",{get:function(){return i.config.data},set:function(t){i.config.data=t}}),n&&a?(i.initialize(),i.update()):console.error("Failed to create chart: can't acquire context from the given item")},initialize:function(){var t=this;return Ee.notify(t,"beforeInit"),ut.retinaScale(t,t.options.devicePixelRatio),t.bindEvents(),t.options.responsive&&t.resize(!0),t.ensureScalesHaveIDs(),t.buildOrUpdateScales(),t.initToolTip(),Ee.notify(t,"afterInit"),t},clear:function(){return ut.canvas.clear(this),this},stop:function(){return bt.cancelAnimation(this),this},resize:function(t){var e=this,i=e.options,n=e.canvas,a=i.maintainAspectRatio&&e.aspectRatio||null,o=Math.max(0,Math.floor(ut.getMaximumWidth(n))),r=Math.max(0,Math.floor(a?o/a:ut.getMaximumHeight(n)));if((e.width!==o||e.height!==r)&&(n.width=e.width=o,n.height=e.height=r,n.style.width=o+"px",n.style.height=r+"px",ut.retinaScale(e,i.devicePixelRatio),!t)){var s={width:o,height:r};Ee.notify(e,"resize",[s]),i.onResize&&i.onResize(e,s),e.stop(),e.update({duration:i.responsiveAnimationDuration})}},ensureScalesHaveIDs:function(){var t=this.options,e=t.scales||{},i=t.scale;ut.each(e.xAxes,function(t,e){t.id=t.id||"x-axis-"+e}),ut.each(e.yAxes,function(t,e){t.id=t.id||"y-axis-"+e}),i&&(i.id=i.id||"scale")},buildOrUpdateScales:function(){var t=this,e=t.options,i=t.scales||{},n=[],a=Object.keys(i).reduce(function(t,e){return t[e]=!1,t},{});e.scales&&(n=n.concat((e.scales.xAxes||[]).map(function(t){return{options:t,dtype:"category",dposition:"bottom"}}),(e.scales.yAxes||[]).map(function(t){return{options:t,dtype:"linear",dposition:"left"}}))),e.scale&&n.push({options:e.scale,dtype:"radialLinear",isDefault:!0,dposition:"chartArea"}),ut.each(n,function(e){var n=e.options,o=n.id,r=Qe(n.type,e.dtype);ii(n.position)!==ii(e.dposition)&&(n.position=e.dposition),a[o]=!0;var s=null;if(o in i&&i[o].type===r)(s=i[o]).options=n,s.ctx=t.ctx,s.chart=t;else{var l=He.getScaleConstructor(r);if(!l)return;s=new l({id:o,type:r,options:n,ctx:t.ctx,chart:t}),i[s.id]=s}s.mergeTicksOptions(),e.isDefault&&(t.scale=s)}),ut.each(a,function(t,e){t||delete i[e]}),t.scales=i,He.addScalesToLayout(this)},buildOrUpdateControllers:function(){var t=this,e=[];return ut.each(t.data.datasets,function(i,n){var a=t.getDatasetMeta(n),o=i.type||t.config.type;if(a.type&&a.type!==o&&(t.destroyDatasetMeta(n),a=t.getDatasetMeta(n)),a.type=o,a.controller)a.controller.updateIndex(n),a.controller.linkScales();else{var r=ue[a.type];if(void 0===r)throw new Error('"'+a.type+'" is not a chart type.');a.controller=new r(t,n),e.push(a.controller)}},t),e},resetElements:function(){var t=this;ut.each(t.data.datasets,function(e,i){t.getDatasetMeta(i).controller.reset()},t)},reset:function(){this.resetElements(),this.tooltip.initialize()},update:function(t){var e,i,n=this;if(t&&"object"==typeof t||(t={duration:t,lazy:arguments[1]}),i=(e=n).options,ut.each(e.scales,function(t){ke.removeBox(e,t)}),i=ei(st.global,st[e.config.type],i),e.options=e.config.options=i,e.ensureScalesHaveIDs(),e.buildOrUpdateScales(),e.tooltip._options=i.tooltips,e.tooltip.initialize(),Ee._invalidate(n),!1!==Ee.notify(n,"beforeUpdate")){n.tooltip._data=n.data;var a=n.buildOrUpdateControllers();ut.each(n.data.datasets,function(t,e){n.getDatasetMeta(e).controller.buildOrUpdateElements()},n),n.updateLayout(),n.options.animation&&n.options.animation.duration&&ut.each(a,function(t){t.reset()}),n.updateDatasets(),n.tooltip.initialize(),n.lastActive=[],Ee.notify(n,"afterUpdate"),n._bufferedRender?n._bufferedRequest={duration:t.duration,easing:t.easing,lazy:t.lazy}:n.render(t)}},updateLayout:function(){!1!==Ee.notify(this,"beforeLayout")&&(ke.update(this,this.width,this.height),Ee.notify(this,"afterScaleUpdate"),Ee.notify(this,"afterLayout"))},updateDatasets:function(){if(!1!==Ee.notify(this,"beforeDatasetsUpdate")){for(var t=0,e=this.data.datasets.length;t<e;++t)this.updateDataset(t);Ee.notify(this,"afterDatasetsUpdate")}},updateDataset:function(t){var e=this.getDatasetMeta(t),i={meta:e,index:t};!1!==Ee.notify(this,"beforeDatasetUpdate",[i])&&(e.controller.update(),Ee.notify(this,"afterDatasetUpdate",[i]))},render:function(t){var e=this;t&&"object"==typeof t||(t={duration:t,lazy:arguments[1]});var i=e.options.animation,n=Qe(t.duration,i&&i.duration),a=t.lazy;if(!1!==Ee.notify(e,"beforeRender")){var o=function(t){Ee.notify(e,"afterRender"),ut.callback(i&&i.onComplete,[t],e)};if(i&&n){var r=new vt({numSteps:n/16.66,easing:t.easing||i.easing,render:function(t,e){var i=ut.easing.effects[e.easing],n=e.currentStep,a=n/e.numSteps;t.draw(i(a),a,n)},onAnimationProgress:i.onProgress,onAnimationComplete:o});bt.addAnimation(e,r,n,a)}else e.draw(),o(new vt({numSteps:0,chart:e}));return e}},draw:function(t){var e=this;e.clear(),ut.isNullOrUndef(t)&&(t=1),e.transition(t),e.width<=0||e.height<=0||!1!==Ee.notify(e,"beforeDraw",[t])&&(ut.each(e.boxes,function(t){t.draw(e.chartArea)},e),e.drawDatasets(t),e._drawTooltip(t),Ee.notify(e,"afterDraw",[t]))},transition:function(t){for(var e=0,i=(this.data.datasets||[]).length;e<i;++e)this.isDatasetVisible(e)&&this.getDatasetMeta(e).controller.transition(t);this.tooltip.transition(t)},drawDatasets:function(t){var e=this;if(!1!==Ee.notify(e,"beforeDatasetsDraw",[t])){for(var i=(e.data.datasets||[]).length-1;i>=0;--i)e.isDatasetVisible(i)&&e.drawDataset(i,t);Ee.notify(e,"afterDatasetsDraw",[t])}},drawDataset:function(t,e){var i=this.getDatasetMeta(t),n={meta:i,index:t,easingValue:e};!1!==Ee.notify(this,"beforeDatasetDraw",[n])&&(i.controller.draw(e),Ee.notify(this,"afterDatasetDraw",[n]))},_drawTooltip:function(t){var e=this.tooltip,i={tooltip:e,easingValue:t};!1!==Ee.notify(this,"beforeTooltipDraw",[i])&&(e.draw(),Ee.notify(this,"afterTooltipDraw",[i]))},getElementAtEvent:function(t){return ve.modes.single(this,t)},getElementsAtEvent:function(t){return ve.modes.label(this,t,{intersect:!0})},getElementsAtXAxis:function(t){return ve.modes["x-axis"](this,t,{intersect:!0})},getElementsAtEventForMode:function(t,e,i){var n=ve.modes[e];return"function"==typeof n?n(this,t,i):[]},getDatasetAtEvent:function(t){return ve.modes.dataset(this,t,{intersect:!0})},getDatasetMeta:function(t){var e=this.data.datasets[t];e._meta||(e._meta={});var i=e._meta[this.id];return i||(i=e._meta[this.id]={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null}),i},getVisibleDatasetCount:function(){for(var t=0,e=0,i=this.data.datasets.length;e<i;++e)this.isDatasetVisible(e)&&t++;return t},isDatasetVisible:function(t){var e=this.getDatasetMeta(t);return"boolean"==typeof e.hidden?!e.hidden:!this.data.datasets[t].hidden},generateLegend:function(){return this.options.legendCallback(this)},destroyDatasetMeta:function(t){var e=this.id,i=this.data.datasets[t],n=i._meta&&i._meta[e];n&&(n.controller.destroy(),delete i._meta[e])},destroy:function(){var t,e,i=this,n=i.canvas;for(i.stop(),t=0,e=i.data.datasets.length;t<e;++t)i.destroyDatasetMeta(t);n&&(i.unbindEvents(),ut.canvas.clear(i),Ve.releaseContext(i.ctx),i.canvas=null,i.ctx=null),Ee.notify(i,"destroy"),delete ni.instances[i.id]},toBase64Image:function(){return this.canvas.toDataURL.apply(this.canvas,arguments)},initToolTip:function(){var t=this;t.tooltip=new Je({_chart:t,_chartInstance:t,_data:t.data,_options:t.options.tooltips},t)},bindEvents:function(){var t=this,e=t._listeners={},i=function(){t.eventHandler.apply(t,arguments)};ut.each(t.options.events,function(n){Ve.addEventListener(t,n,i),e[n]=i}),t.options.responsive&&(i=function(){t.resize()},Ve.addEventListener(t,"resize",i),e.resize=i)},unbindEvents:function(){var t=this,e=t._listeners;e&&(delete t._listeners,ut.each(e,function(e,i){Ve.removeEventListener(t,i,e)}))},updateHoverStyle:function(t,e,i){var n,a,o,r=i?"setHoverStyle":"removeHoverStyle";for(a=0,o=t.length;a<o;++a)(n=t[a])&&this.getDatasetMeta(n._datasetIndex).controller[r](n)},eventHandler:function(t){var e=this,i=e.tooltip;if(!1!==Ee.notify(e,"beforeEvent",[t])){e._bufferedRender=!0,e._bufferedRequest=null;var n=e.handleEvent(t);i&&(n=i._start?i.handleEvent(t):n|i.handleEvent(t)),Ee.notify(e,"afterEvent",[t]);var a=e._bufferedRequest;return a?e.render(a):n&&!e.animating&&(e.stop(),e.render({duration:e.options.hover.animationDuration,lazy:!0})),e._bufferedRender=!1,e._bufferedRequest=null,e}},handleEvent:function(t){var e,i=this,n=i.options||{},a=n.hover;return i.lastActive=i.lastActive||[],"mouseout"===t.type?i.active=[]:i.active=i.getElementsAtEventForMode(t,a.mode,a),ut.callback(n.onHover||n.hover.onHover,[t.native,i.active],i),"mouseup"!==t.type&&"click"!==t.type||n.onClick&&n.onClick.call(i,t.native,i.active),i.lastActive.length&&i.updateHoverStyle(i.lastActive,a.mode,!1),i.active.length&&a.mode&&i.updateHoverStyle(i.active,a.mode,!0),e=!ut.arrayEquals(i.active,i.lastActive),i.lastActive=i.active,e}}),ni.instances={};var ai=ni;ni.Controller=ni,ni.types={},ut.configMerge=ei,ut.scaleMerge=ti;function oi(){throw new Error("This method is not implemented: either no adapter can be found or an incomplete integration was provided.")}function ri(t){this.options=t||{}}ut.extend(ri.prototype,{formats:oi,parse:oi,format:oi,add:oi,diff:oi,startOf:oi,endOf:oi,_create:function(t){return t}}),ri.override=function(t){ut.extend(ri.prototype,t)};var si={_date:ri},li={formatters:{values:function(t){return ut.isArray(t)?t:""+t},linear:function(t,e,i){var n=i.length>3?i[2]-i[1]:i[1]-i[0];Math.abs(n)>1&&t!==Math.floor(t)&&(n=t-Math.floor(t));var a=ut.log10(Math.abs(n)),o="";if(0!==t)if(Math.max(Math.abs(i[0]),Math.abs(i[i.length-1]))<1e-4){var r=ut.log10(Math.abs(t));o=t.toExponential(Math.floor(r)-Math.floor(a))}else{var s=-1*Math.floor(a);s=Math.max(Math.min(s,20),0),o=t.toFixed(s)}else o="0";return o},logarithmic:function(t,e,i){var n=t/Math.pow(10,Math.floor(ut.log10(t)));return 0===t?"0":1===n||2===n||5===n||0===e||e===i.length-1?t.toExponential():""}}},di=ut.valueOrDefault,ui=ut.valueAtIndexOrDefault;function hi(t){var e,i,n=[];for(e=0,i=t.length;e<i;++e)n.push(t[e].label);return n}function ci(t,e,i){return ut.isArray(e)?ut.longestText(t,i,e):t.measureText(e).width}st._set("scale",{display:!0,position:"left",offset:!1,gridLines:{display:!0,color:"rgba(0, 0, 0, 0.1)",lineWidth:1,drawBorder:!0,drawOnChartArea:!0,drawTicks:!0,tickMarkLength:10,zeroLineWidth:1,zeroLineColor:"rgba(0,0,0,0.25)",zeroLineBorderDash:[],zeroLineBorderDashOffset:0,offsetGridLines:!1,borderDash:[],borderDashOffset:0},scaleLabel:{display:!1,labelString:"",padding:{top:4,bottom:4}},ticks:{beginAtZero:!1,minRotation:0,maxRotation:50,mirror:!1,padding:0,reverse:!1,display:!0,autoSkip:!0,autoSkipPadding:0,labelOffset:0,callback:li.formatters.values,minor:{},major:{}}});var fi=pt.extend({getPadding:function(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}},getTicks:function(){return this._ticks},mergeTicksOptions:function(){var t=this.options.ticks;for(var e in!1===t.minor&&(t.minor={display:!1}),!1===t.major&&(t.major={display:!1}),t)"major"!==e&&"minor"!==e&&(void 0===t.minor[e]&&(t.minor[e]=t[e]),void 0===t.major[e]&&(t.major[e]=t[e]))},beforeUpdate:function(){ut.callback(this.options.beforeUpdate,[this])},update:function(t,e,i){var n,a,o,r,s,l,d=this;for(d.beforeUpdate(),d.maxWidth=t,d.maxHeight=e,d.margins=ut.extend({left:0,right:0,top:0,bottom:0},i),d._maxLabelLines=0,d.longestLabelWidth=0,d.longestTextCache=d.longestTextCache||{},d.beforeSetDimensions(),d.setDimensions(),d.afterSetDimensions(),d.beforeDataLimits(),d.determineDataLimits(),d.afterDataLimits(),d.beforeBuildTicks(),s=d.buildTicks()||[],s=d.afterBuildTicks(s)||s,d.beforeTickToLabelConversion(),o=d.convertTicksToLabels(s)||d.ticks,d.afterTickToLabelConversion(),d.ticks=o,n=0,a=o.length;n<a;++n)r=o[n],(l=s[n])?l.label=r:s.push(l={label:r,major:!1});return d._ticks=s,d.beforeCalculateTickRotation(),d.calculateTickRotation(),d.afterCalculateTickRotation(),d.beforeFit(),d.fit(),d.afterFit(),d.afterUpdate(),d.minSize},afterUpdate:function(){ut.callback(this.options.afterUpdate,[this])},beforeSetDimensions:function(){ut.callback(this.options.beforeSetDimensions,[this])},setDimensions:function(){var t=this;t.isHorizontal()?(t.width=t.maxWidth,t.left=0,t.right=t.width):(t.height=t.maxHeight,t.top=0,t.bottom=t.height),t.paddingLeft=0,t.paddingTop=0,t.paddingRight=0,t.paddingBottom=0},afterSetDimensions:function(){ut.callback(this.options.afterSetDimensions,[this])},beforeDataLimits:function(){ut.callback(this.options.beforeDataLimits,[this])},determineDataLimits:ut.noop,afterDataLimits:function(){ut.callback(this.options.afterDataLimits,[this])},beforeBuildTicks:function(){ut.callback(this.options.beforeBuildTicks,[this])},buildTicks:ut.noop,afterBuildTicks:function(t){var e=this;return ut.isArray(t)&&t.length?ut.callback(e.options.afterBuildTicks,[e,t]):(e.ticks=ut.callback(e.options.afterBuildTicks,[e,e.ticks])||e.ticks,t)},beforeTickToLabelConversion:function(){ut.callback(this.options.beforeTickToLabelConversion,[this])},convertTicksToLabels:function(){var t=this.options.ticks;this.ticks=this.ticks.map(t.userCallback||t.callback,this)},afterTickToLabelConversion:function(){ut.callback(this.options.afterTickToLabelConversion,[this])},beforeCalculateTickRotation:function(){ut.callback(this.options.beforeCalculateTickRotation,[this])},calculateTickRotation:function(){var t=this,e=t.ctx,i=t.options.ticks,n=hi(t._ticks),a=ut.options._parseFont(i);e.font=a.string;var o=i.minRotation||0;if(n.length&&t.options.display&&t.isHorizontal())for(var r,s=ut.longestText(e,a.string,n,t.longestTextCache),l=s,d=t.getPixelForTick(1)-t.getPixelForTick(0)-6;l>d&&o<i.maxRotation;){var u=ut.toRadians(o);if(r=Math.cos(u),Math.sin(u)*s>t.maxHeight){o--;break}o++,l=r*s}t.labelRotation=o},afterCalculateTickRotation:function(){ut.callback(this.options.afterCalculateTickRotation,[this])},beforeFit:function(){ut.callback(this.options.beforeFit,[this])},fit:function(){var t=this,e=t.minSize={width:0,height:0},i=hi(t._ticks),n=t.options,a=n.ticks,o=n.scaleLabel,r=n.gridLines,s=t._isVisible(),l=n.position,d=t.isHorizontal(),u=ut.options._parseFont,h=u(a),c=n.gridLines.tickMarkLength;if(e.width=d?t.isFullWidth()?t.maxWidth-t.margins.left-t.margins.right:t.maxWidth:s&&r.drawTicks?c:0,e.height=d?s&&r.drawTicks?c:0:t.maxHeight,o.display&&s){var f=u(o),g=ut.options.toPadding(o.padding),p=f.lineHeight+g.height;d?e.height+=p:e.width+=p}if(a.display&&s){var m=ut.longestText(t.ctx,h.string,i,t.longestTextCache),v=ut.numberOfLabelLines(i),b=.5*h.size,x=t.options.ticks.padding;if(t._maxLabelLines=v,t.longestLabelWidth=m,d){var y=ut.toRadians(t.labelRotation),k=Math.cos(y),w=Math.sin(y)*m+h.lineHeight*v+b;e.height=Math.min(t.maxHeight,e.height+w+x),t.ctx.font=h.string;var M,_,C=ci(t.ctx,i[0],h.string),S=ci(t.ctx,i[i.length-1],h.string),P=t.getPixelForTick(0)-t.left,I=t.right-t.getPixelForTick(i.length-1);0!==t.labelRotation?(M="bottom"===l?k*C:k*b,_="bottom"===l?k*b:k*S):(M=C/2,_=S/2),t.paddingLeft=Math.max(M-P,0)+3,t.paddingRight=Math.max(_-I,0)+3}else a.mirror?m=0:m+=x+b,e.width=Math.min(t.maxWidth,e.width+m),t.paddingTop=h.size/2,t.paddingBottom=h.size/2}t.handleMargins(),t.width=e.width,t.height=e.height},handleMargins:function(){var t=this;t.margins&&(t.paddingLeft=Math.max(t.paddingLeft-t.margins.left,0),t.paddingTop=Math.max(t.paddingTop-t.margins.top,0),t.paddingRight=Math.max(t.paddingRight-t.margins.right,0),t.paddingBottom=Math.max(t.paddingBottom-t.margins.bottom,0))},afterFit:function(){ut.callback(this.options.afterFit,[this])},isHorizontal:function(){return"top"===this.options.position||"bottom"===this.options.position},isFullWidth:function(){return this.options.fullWidth},getRightValue:function(t){if(ut.isNullOrUndef(t))return NaN;if(("number"==typeof t||t instanceof Number)&&!isFinite(t))return NaN;if(t)if(this.isHorizontal()){if(void 0!==t.x)return this.getRightValue(t.x)}else if(void 0!==t.y)return this.getRightValue(t.y);return t},getLabelForIndex:ut.noop,getPixelForValue:ut.noop,getValueForPixel:ut.noop,getPixelForTick:function(t){var e=this,i=e.options.offset;if(e.isHorizontal()){var n=(e.width-(e.paddingLeft+e.paddingRight))/Math.max(e._ticks.length-(i?0:1),1),a=n*t+e.paddingLeft;i&&(a+=n/2);var o=e.left+a;return o+=e.isFullWidth()?e.margins.left:0}var r=e.height-(e.paddingTop+e.paddingBottom);return e.top+t*(r/(e._ticks.length-1))},getPixelForDecimal:function(t){var e=this;if(e.isHorizontal()){var i=(e.width-(e.paddingLeft+e.paddingRight))*t+e.paddingLeft,n=e.left+i;return n+=e.isFullWidth()?e.margins.left:0}return e.top+t*e.height},getBasePixel:function(){return this.getPixelForValue(this.getBaseValue())},getBaseValue:function(){var t=this.min,e=this.max;return this.beginAtZero?0:t<0&&e<0?e:t>0&&e>0?t:0},_autoSkip:function(t){var e,i,n=this,a=n.isHorizontal(),o=n.options.ticks.minor,r=t.length,s=!1,l=o.maxTicksLimit,d=n._tickSize()*(r-1),u=a?n.width-(n.paddingLeft+n.paddingRight):n.height-(n.paddingTop+n.PaddingBottom),h=[];for(d>u&&(s=1+Math.floor(d/u)),r>l&&(s=Math.max(s,1+Math.floor(r/l))),e=0;e<r;e++)i=t[e],s>1&&e%s>0&&delete i.label,h.push(i);return h},_tickSize:function(){var t=this,e=t.isHorizontal(),i=t.options.ticks.minor,n=ut.toRadians(t.labelRotation),a=Math.abs(Math.cos(n)),o=Math.abs(Math.sin(n)),r=i.autoSkipPadding||0,s=t.longestLabelWidth+r||0,l=ut.options._parseFont(i),d=t._maxLabelLines*l.lineHeight+r||0;return e?d*a>s*o?s/a:d/o:d*o<s*a?d/a:s/o},_isVisible:function(){var t,e,i,n=this.chart,a=this.options.display;if("auto"!==a)return!!a;for(t=0,e=n.data.datasets.length;t<e;++t)if(n.isDatasetVisible(t)&&((i=n.getDatasetMeta(t)).xAxisID===this.id||i.yAxisID===this.id))return!0;return!1},draw:function(t){var e=this,i=e.options;if(e._isVisible()){var n,a,o,r=e.chart,s=e.ctx,l=st.global.defaultFontColor,d=i.ticks.minor,u=i.ticks.major||d,h=i.gridLines,c=i.scaleLabel,f=i.position,g=0!==e.labelRotation,p=d.mirror,m=e.isHorizontal(),v=ut.options._parseFont,b=d.display&&d.autoSkip?e._autoSkip(e.getTicks()):e.getTicks(),x=di(d.fontColor,l),y=v(d),k=y.lineHeight,w=di(u.fontColor,l),M=v(u),_=d.padding,C=d.labelOffset,S=h.drawTicks?h.tickMarkLength:0,P=di(c.fontColor,l),I=v(c),A=ut.options.toPadding(c.padding),D=ut.toRadians(e.labelRotation),T=[],F=h.drawBorder?ui(h.lineWidth,0,0):0,L=ut._alignPixel;"top"===f?(n=L(r,e.bottom,F),a=e.bottom-S,o=n-F/2):"bottom"===f?(n=L(r,e.top,F),a=n+F/2,o=e.top+S):"left"===f?(n=L(r,e.right,F),a=e.right-S,o=n-F/2):(n=L(r,e.left,F),a=n+F/2,o=e.left+S);if(ut.each(b,function(n,s){if(!ut.isNullOrUndef(n.label)){var l,d,u,c,v,b,x,y,w,M,P,I,A,R,O,z,B=n.label;s===e.zeroLineIndex&&i.offset===h.offsetGridLines?(l=h.zeroLineWidth,d=h.zeroLineColor,u=h.zeroLineBorderDash||[],c=h.zeroLineBorderDashOffset||0):(l=ui(h.lineWidth,s),d=ui(h.color,s),u=h.borderDash||[],c=h.borderDashOffset||0);var N=ut.isArray(B)?B.length:1,W=function(t,e,i){var n=t.getPixelForTick(e);return i&&(1===t.getTicks().length?n-=t.isHorizontal()?Math.max(n-t.left,t.right-n):Math.max(n-t.top,t.bottom-n):n-=0===e?(t.getPixelForTick(1)-n)/2:(n-t.getPixelForTick(e-1))/2),n}(e,s,h.offsetGridLines);if(m){var V=S+_;W<e.left-1e-7&&(d="rgba(0,0,0,0)"),v=x=w=P=L(r,W,l),b=a,y=o,A=e.getPixelForTick(s)+C,"top"===f?(M=L(r,t.top,F)+F/2,I=t.bottom,O=((g?1:.5)-N)*k,z=g?"left":"center",R=e.bottom-V):(M=t.top,I=L(r,t.bottom,F)-F/2,O=(g?0:.5)*k,z=g?"right":"center",R=e.top+V)}else{var E=(p?0:S)+_;W<e.top-1e-7&&(d="rgba(0,0,0,0)"),v=a,x=o,b=y=M=I=L(r,W,l),R=e.getPixelForTick(s)+C,O=(1-N)*k/2,"left"===f?(w=L(r,t.left,F)+F/2,P=t.right,z=p?"left":"right",A=e.right-E):(w=t.left,P=L(r,t.right,F)-F/2,z=p?"right":"left",A=e.left+E)}T.push({tx1:v,ty1:b,tx2:x,ty2:y,x1:w,y1:M,x2:P,y2:I,labelX:A,labelY:R,glWidth:l,glColor:d,glBorderDash:u,glBorderDashOffset:c,rotation:-1*D,label:B,major:n.major,textOffset:O,textAlign:z})}}),ut.each(T,function(t){var e=t.glWidth,i=t.glColor;if(h.display&&e&&i&&(s.save(),s.lineWidth=e,s.strokeStyle=i,s.setLineDash&&(s.setLineDash(t.glBorderDash),s.lineDashOffset=t.glBorderDashOffset),s.beginPath(),h.drawTicks&&(s.moveTo(t.tx1,t.ty1),s.lineTo(t.tx2,t.ty2)),h.drawOnChartArea&&(s.moveTo(t.x1,t.y1),s.lineTo(t.x2,t.y2)),s.stroke(),s.restore()),d.display){s.save(),s.translate(t.labelX,t.labelY),s.rotate(t.rotation),s.font=t.major?M.string:y.string,s.fillStyle=t.major?w:x,s.textBaseline="middle",s.textAlign=t.textAlign;var n=t.label,a=t.textOffset;if(ut.isArray(n))for(var o=0;o<n.length;++o)s.fillText(""+n[o],0,a),a+=k;else s.fillText(n,0,a);s.restore()}}),c.display){var R,O,z=0,B=I.lineHeight/2;if(m)R=e.left+(e.right-e.left)/2,O="bottom"===f?e.bottom-B-A.bottom:e.top+B+A.top;else{var N="left"===f;R=N?e.left+B+A.top:e.right-B-A.top,O=e.top+(e.bottom-e.top)/2,z=N?-.5*Math.PI:.5*Math.PI}s.save(),s.translate(R,O),s.rotate(z),s.textAlign="center",s.textBaseline="middle",s.fillStyle=P,s.font=I.string,s.fillText(c.labelString,0,0),s.restore()}if(F){var W,V,E,H,j=F,q=ui(h.lineWidth,b.length-1,0);m?(W=L(r,e.left,j)-j/2,V=L(r,e.right,q)+q/2,E=H=n):(E=L(r,e.top,j)-j/2,H=L(r,e.bottom,q)+q/2,W=V=n),s.lineWidth=F,s.strokeStyle=ui(h.color,0),s.beginPath(),s.moveTo(W,E),s.lineTo(V,H),s.stroke()}}}}),gi=fi.extend({getLabels:function(){var t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels},determineDataLimits:function(){var t,e=this,i=e.getLabels();e.minIndex=0,e.maxIndex=i.length-1,void 0!==e.options.ticks.min&&(t=i.indexOf(e.options.ticks.min),e.minIndex=-1!==t?t:e.minIndex),void 0!==e.options.ticks.max&&(t=i.indexOf(e.options.ticks.max),e.maxIndex=-1!==t?t:e.maxIndex),e.min=i[e.minIndex],e.max=i[e.maxIndex]},buildTicks:function(){var t=this,e=t.getLabels();t.ticks=0===t.minIndex&&t.maxIndex===e.length-1?e:e.slice(t.minIndex,t.maxIndex+1)},getLabelForIndex:function(t,e){var i=this,n=i.chart;return n.getDatasetMeta(e).controller._getValueScaleId()===i.id?i.getRightValue(n.data.datasets[e].data[t]):i.ticks[t-i.minIndex]},getPixelForValue:function(t,e){var i,n=this,a=n.options.offset,o=Math.max(n.maxIndex+1-n.minIndex-(a?0:1),1);if(null!=t&&(i=n.isHorizontal()?t.x:t.y),void 0!==i||void 0!==t&&isNaN(e)){t=i||t;var r=n.getLabels().indexOf(t);e=-1!==r?r:e}if(n.isHorizontal()){var s=n.width/o,l=s*(e-n.minIndex);return a&&(l+=s/2),n.left+l}var d=n.height/o,u=d*(e-n.minIndex);return a&&(u+=d/2),n.top+u},getPixelForTick:function(t){return this.getPixelForValue(this.ticks[t],t+this.minIndex,null)},getValueForPixel:function(t){var e=this,i=e.options.offset,n=Math.max(e._ticks.length-(i?0:1),1),a=e.isHorizontal(),o=(a?e.width:e.height)/n;return t-=a?e.left:e.top,i&&(t-=o/2),(t<=0?0:Math.round(t/o))+e.minIndex},getBasePixel:function(){return this.bottom}}),pi={position:"bottom"};gi._defaults=pi;var mi=ut.noop,vi=ut.isNullOrUndef;var bi=fi.extend({getRightValue:function(t){return"string"==typeof t?+t:fi.prototype.getRightValue.call(this,t)},handleTickRangeOptions:function(){var t=this,e=t.options.ticks;if(e.beginAtZero){var i=ut.sign(t.min),n=ut.sign(t.max);i<0&&n<0?t.max=0:i>0&&n>0&&(t.min=0)}var a=void 0!==e.min||void 0!==e.suggestedMin,o=void 0!==e.max||void 0!==e.suggestedMax;void 0!==e.min?t.min=e.min:void 0!==e.suggestedMin&&(null===t.min?t.min=e.suggestedMin:t.min=Math.min(t.min,e.suggestedMin)),void 0!==e.max?t.max=e.max:void 0!==e.suggestedMax&&(null===t.max?t.max=e.suggestedMax:t.max=Math.max(t.max,e.suggestedMax)),a!==o&&t.min>=t.max&&(a?t.max=t.min+1:t.min=t.max-1),t.min===t.max&&(t.max++,e.beginAtZero||t.min--)},getTickLimit:function(){var t,e=this.options.ticks,i=e.stepSize,n=e.maxTicksLimit;return i?t=Math.ceil(this.max/i)-Math.floor(this.min/i)+1:(t=this._computeTickLimit(),n=n||11),n&&(t=Math.min(n,t)),t},_computeTickLimit:function(){return Number.POSITIVE_INFINITY},handleDirectionalChanges:mi,buildTicks:function(){var t=this,e=t.options.ticks,i=t.getTickLimit(),n={maxTicks:i=Math.max(2,i),min:e.min,max:e.max,precision:e.precision,stepSize:ut.valueOrDefault(e.fixedStepSize,e.stepSize)},a=t.ticks=function(t,e){var i,n,a,o,r=[],s=t.stepSize,l=s||1,d=t.maxTicks-1,u=t.min,h=t.max,c=t.precision,f=e.min,g=e.max,p=ut.niceNum((g-f)/d/l)*l;if(p<1e-14&&vi(u)&&vi(h))return[f,g];(o=Math.ceil(g/p)-Math.floor(f/p))>d&&(p=ut.niceNum(o*p/d/l)*l),s||vi(c)?i=Math.pow(10,ut._decimalPlaces(p)):(i=Math.pow(10,c),p=Math.ceil(p*i)/i),n=Math.floor(f/p)*p,a=Math.ceil(g/p)*p,s&&(!vi(u)&&ut.almostWhole(u/p,p/1e3)&&(n=u),!vi(h)&&ut.almostWhole(h/p,p/1e3)&&(a=h)),o=(a-n)/p,o=ut.almostEquals(o,Math.round(o),p/1e3)?Math.round(o):Math.ceil(o),n=Math.round(n*i)/i,a=Math.round(a*i)/i,r.push(vi(u)?n:u);for(var m=1;m<o;++m)r.push(Math.round((n+m*p)*i)/i);return r.push(vi(h)?a:h),r}(n,t);t.handleDirectionalChanges(),t.max=ut.max(a),t.min=ut.min(a),e.reverse?(a.reverse(),t.start=t.max,t.end=t.min):(t.start=t.min,t.end=t.max)},convertTicksToLabels:function(){var t=this;t.ticksAsNumbers=t.ticks.slice(),t.zeroLineIndex=t.ticks.indexOf(0),fi.prototype.convertTicksToLabels.call(t)}}),xi={position:"left",ticks:{callback:li.formatters.linear}},yi=bi.extend({determineDataLimits:function(){var t=this,e=t.options,i=t.chart,n=i.data.datasets,a=t.isHorizontal();function o(e){return a?e.xAxisID===t.id:e.yAxisID===t.id}t.min=null,t.max=null;var r=e.stacked;if(void 0===r&&ut.each(n,function(t,e){if(!r){var n=i.getDatasetMeta(e);i.isDatasetVisible(e)&&o(n)&&void 0!==n.stack&&(r=!0)}}),e.stacked||r){var s={};ut.each(n,function(n,a){var r=i.getDatasetMeta(a),l=[r.type,void 0===e.stacked&&void 0===r.stack?a:"",r.stack].join(".");void 0===s[l]&&(s[l]={positiveValues:[],negativeValues:[]});var d=s[l].positiveValues,u=s[l].negativeValues;i.isDatasetVisible(a)&&o(r)&&ut.each(n.data,function(i,n){var a=+t.getRightValue(i);isNaN(a)||r.data[n].hidden||(d[n]=d[n]||0,u[n]=u[n]||0,e.relativePoints?d[n]=100:a<0?u[n]+=a:d[n]+=a)})}),ut.each(s,function(e){var i=e.positiveValues.concat(e.negativeValues),n=ut.min(i),a=ut.max(i);t.min=null===t.min?n:Math.min(t.min,n),t.max=null===t.max?a:Math.max(t.max,a)})}else ut.each(n,function(e,n){var a=i.getDatasetMeta(n);i.isDatasetVisible(n)&&o(a)&&ut.each(e.data,function(e,i){var n=+t.getRightValue(e);isNaN(n)||a.data[i].hidden||(null===t.min?t.min=n:n<t.min&&(t.min=n),null===t.max?t.max=n:n>t.max&&(t.max=n))})});t.min=isFinite(t.min)&&!isNaN(t.min)?t.min:0,t.max=isFinite(t.max)&&!isNaN(t.max)?t.max:1,this.handleTickRangeOptions()},_computeTickLimit:function(){var t;return this.isHorizontal()?Math.ceil(this.width/40):(t=ut.options._parseFont(this.options.ticks),Math.ceil(this.height/t.lineHeight))},handleDirectionalChanges:function(){this.isHorizontal()||this.ticks.reverse()},getLabelForIndex:function(t,e){return+this.getRightValue(this.chart.data.datasets[e].data[t])},getPixelForValue:function(t){var e=this,i=e.start,n=+e.getRightValue(t),a=e.end-i;return e.isHorizontal()?e.left+e.width/a*(n-i):e.bottom-e.height/a*(n-i)},getValueForPixel:function(t){var e=this,i=e.isHorizontal(),n=i?e.width:e.height,a=(i?t-e.left:e.bottom-t)/n;return e.start+(e.end-e.start)*a},getPixelForTick:function(t){return this.getPixelForValue(this.ticksAsNumbers[t])}}),ki=xi;yi._defaults=ki;var wi=ut.valueOrDefault;var Mi={position:"left",ticks:{callback:li.formatters.logarithmic}};function _i(t,e){return ut.isFinite(t)&&t>=0?t:e}var Ci=fi.extend({determineDataLimits:function(){var t=this,e=t.options,i=t.chart,n=i.data.datasets,a=t.isHorizontal();function o(e){return a?e.xAxisID===t.id:e.yAxisID===t.id}t.min=null,t.max=null,t.minNotZero=null;var r=e.stacked;if(void 0===r&&ut.each(n,function(t,e){if(!r){var n=i.getDatasetMeta(e);i.isDatasetVisible(e)&&o(n)&&void 0!==n.stack&&(r=!0)}}),e.stacked||r){var s={};ut.each(n,function(n,a){var r=i.getDatasetMeta(a),l=[r.type,void 0===e.stacked&&void 0===r.stack?a:"",r.stack].join(".");i.isDatasetVisible(a)&&o(r)&&(void 0===s[l]&&(s[l]=[]),ut.each(n.data,function(e,i){var n=s[l],a=+t.getRightValue(e);isNaN(a)||r.data[i].hidden||a<0||(n[i]=n[i]||0,n[i]+=a)}))}),ut.each(s,function(e){if(e.length>0){var i=ut.min(e),n=ut.max(e);t.min=null===t.min?i:Math.min(t.min,i),t.max=null===t.max?n:Math.max(t.max,n)}})}else ut.each(n,function(e,n){var a=i.getDatasetMeta(n);i.isDatasetVisible(n)&&o(a)&&ut.each(e.data,function(e,i){var n=+t.getRightValue(e);isNaN(n)||a.data[i].hidden||n<0||(null===t.min?t.min=n:n<t.min&&(t.min=n),null===t.max?t.max=n:n>t.max&&(t.max=n),0!==n&&(null===t.minNotZero||n<t.minNotZero)&&(t.minNotZero=n))})});this.handleTickRangeOptions()},handleTickRangeOptions:function(){var t=this,e=t.options.ticks;t.min=_i(e.min,t.min),t.max=_i(e.max,t.max),t.min===t.max&&(0!==t.min&&null!==t.min?(t.min=Math.pow(10,Math.floor(ut.log10(t.min))-1),t.max=Math.pow(10,Math.floor(ut.log10(t.max))+1)):(t.min=1,t.max=10)),null===t.min&&(t.min=Math.pow(10,Math.floor(ut.log10(t.max))-1)),null===t.max&&(t.max=0!==t.min?Math.pow(10,Math.floor(ut.log10(t.min))+1):10),null===t.minNotZero&&(t.min>0?t.minNotZero=t.min:t.max<1?t.minNotZero=Math.pow(10,Math.floor(ut.log10(t.max))):t.minNotZero=1)},buildTicks:function(){var t=this,e=t.options.ticks,i=!t.isHorizontal(),n={min:_i(e.min),max:_i(e.max)},a=t.ticks=function(t,e){var i,n,a=[],o=wi(t.min,Math.pow(10,Math.floor(ut.log10(e.min)))),r=Math.floor(ut.log10(e.max)),s=Math.ceil(e.max/Math.pow(10,r));0===o?(i=Math.floor(ut.log10(e.minNotZero)),n=Math.floor(e.minNotZero/Math.pow(10,i)),a.push(o),o=n*Math.pow(10,i)):(i=Math.floor(ut.log10(o)),n=Math.floor(o/Math.pow(10,i)));var l=i<0?Math.pow(10,Math.abs(i)):1;do{a.push(o),10==++n&&(n=1,l=++i>=0?1:l),o=Math.round(n*Math.pow(10,i)*l)/l}while(i<r||i===r&&n<s);var d=wi(t.max,o);return a.push(d),a}(n,t);t.max=ut.max(a),t.min=ut.min(a),e.reverse?(i=!i,t.start=t.max,t.end=t.min):(t.start=t.min,t.end=t.max),i&&a.reverse()},convertTicksToLabels:function(){this.tickValues=this.ticks.slice(),fi.prototype.convertTicksToLabels.call(this)},getLabelForIndex:function(t,e){return+this.getRightValue(this.chart.data.datasets[e].data[t])},getPixelForTick:function(t){return this.getPixelForValue(this.tickValues[t])},_getFirstTickValue:function(t){var e=Math.floor(ut.log10(t));return Math.floor(t/Math.pow(10,e))*Math.pow(10,e)},getPixelForValue:function(t){var e,i,n,a,o,r=this,s=r.options.ticks,l=s.reverse,d=ut.log10,u=r._getFirstTickValue(r.minNotZero),h=0;return t=+r.getRightValue(t),l?(n=r.end,a=r.start,o=-1):(n=r.start,a=r.end,o=1),r.isHorizontal()?(e=r.width,i=l?r.right:r.left):(e=r.height,o*=-1,i=l?r.top:r.bottom),t!==n&&(0===n&&(e-=h=wi(s.fontSize,st.global.defaultFontSize),n=u),0!==t&&(h+=e/(d(a)-d(n))*(d(t)-d(n))),i+=o*h),i},getValueForPixel:function(t){var e,i,n,a,o=this,r=o.options.ticks,s=r.reverse,l=ut.log10,d=o._getFirstTickValue(o.minNotZero);if(s?(i=o.end,n=o.start):(i=o.start,n=o.end),o.isHorizontal()?(e=o.width,a=s?o.right-t:t-o.left):(e=o.height,a=s?t-o.top:o.bottom-t),a!==i){if(0===i){var u=wi(r.fontSize,st.global.defaultFontSize);a-=u,e-=u,i=d}a*=l(n)-l(i),a/=e,a=Math.pow(10,l(i)+a)}return a}}),Si=Mi;Ci._defaults=Si;var Pi=ut.valueOrDefault,Ii=ut.valueAtIndexOrDefault,Ai=ut.options.resolve,Di={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,color:"rgba(0, 0, 0, 0.1)",lineWidth:1,borderDash:[],borderDashOffset:0},gridLines:{circular:!1},ticks:{showLabelBackdrop:!0,backdropColor:"rgba(255,255,255,0.75)",backdropPaddingY:2,backdropPaddingX:2,callback:li.formatters.linear},pointLabels:{display:!0,fontSize:10,callback:function(t){return t}}};function Ti(t){var e=t.options;return e.angleLines.display||e.pointLabels.display?t.chart.data.labels.length:0}function Fi(t){var e=t.ticks;return e.display&&t.display?Pi(e.fontSize,st.global.defaultFontSize)+2*e.backdropPaddingY:0}function Li(t,e,i,n,a){return t===n||t===a?{start:e-i/2,end:e+i/2}:t<n||t>a?{start:e-i,end:e}:{start:e,end:e+i}}function Ri(t){return 0===t||180===t?"center":t<180?"left":"right"}function Oi(t,e,i,n){var a,o,r=i.y+n/2;if(ut.isArray(e))for(a=0,o=e.length;a<o;++a)t.fillText(e[a],i.x,r),r+=n;else t.fillText(e,i.x,r)}function zi(t,e,i){90===t||270===t?i.y-=e.h/2:(t>270||t<90)&&(i.y-=e.h)}function Bi(t){return ut.isNumber(t)?t:0}var Ni=bi.extend({setDimensions:function(){var t=this;t.width=t.maxWidth,t.height=t.maxHeight,t.paddingTop=Fi(t.options)/2,t.xCenter=Math.floor(t.width/2),t.yCenter=Math.floor((t.height-t.paddingTop)/2),t.drawingArea=Math.min(t.height-t.paddingTop,t.width)/2},determineDataLimits:function(){var t=this,e=t.chart,i=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY;ut.each(e.data.datasets,function(a,o){if(e.isDatasetVisible(o)){var r=e.getDatasetMeta(o);ut.each(a.data,function(e,a){var o=+t.getRightValue(e);isNaN(o)||r.data[a].hidden||(i=Math.min(o,i),n=Math.max(o,n))})}}),t.min=i===Number.POSITIVE_INFINITY?0:i,t.max=n===Number.NEGATIVE_INFINITY?0:n,t.handleTickRangeOptions()},_computeTickLimit:function(){return Math.ceil(this.drawingArea/Fi(this.options))},convertTicksToLabels:function(){var t=this;bi.prototype.convertTicksToLabels.call(t),t.pointLabels=t.chart.data.labels.map(t.options.pointLabels.callback,t)},getLabelForIndex:function(t,e){return+this.getRightValue(this.chart.data.datasets[e].data[t])},fit:function(){var t=this.options;t.display&&t.pointLabels.display?function(t){var e,i,n,a=ut.options._parseFont(t.options.pointLabels),o={l:0,r:t.width,t:0,b:t.height-t.paddingTop},r={};t.ctx.font=a.string,t._pointLabelSizes=[];var s,l,d,u=Ti(t);for(e=0;e<u;e++){n=t.getPointPosition(e,t.drawingArea+5),s=t.ctx,l=a.lineHeight,d=t.pointLabels[e]||"",i=ut.isArray(d)?{w:ut.longestText(s,s.font,d),h:d.length*l}:{w:s.measureText(d).width,h:l},t._pointLabelSizes[e]=i;var h=t.getIndexAngle(e),c=ut.toDegrees(h)%360,f=Li(c,n.x,i.w,0,180),g=Li(c,n.y,i.h,90,270);f.start<o.l&&(o.l=f.start,r.l=h),f.end>o.r&&(o.r=f.end,r.r=h),g.start<o.t&&(o.t=g.start,r.t=h),g.end>o.b&&(o.b=g.end,r.b=h)}t.setReductions(t.drawingArea,o,r)}(this):this.setCenterPoint(0,0,0,0)},setReductions:function(t,e,i){var n=this,a=e.l/Math.sin(i.l),o=Math.max(e.r-n.width,0)/Math.sin(i.r),r=-e.t/Math.cos(i.t),s=-Math.max(e.b-(n.height-n.paddingTop),0)/Math.cos(i.b);a=Bi(a),o=Bi(o),r=Bi(r),s=Bi(s),n.drawingArea=Math.min(Math.floor(t-(a+o)/2),Math.floor(t-(r+s)/2)),n.setCenterPoint(a,o,r,s)},setCenterPoint:function(t,e,i,n){var a=this,o=a.width-e-a.drawingArea,r=t+a.drawingArea,s=i+a.drawingArea,l=a.height-a.paddingTop-n-a.drawingArea;a.xCenter=Math.floor((r+o)/2+a.left),a.yCenter=Math.floor((s+l)/2+a.top+a.paddingTop)},getIndexAngle:function(t){return t*(2*Math.PI/Ti(this))+(this.chart.options&&this.chart.options.startAngle?this.chart.options.startAngle:0)*Math.PI*2/360},getDistanceFromCenterForValue:function(t){var e=this;if(null===t)return 0;var i=e.drawingArea/(e.max-e.min);return e.options.ticks.reverse?(e.max-t)*i:(t-e.min)*i},getPointPosition:function(t,e){var i=this.getIndexAngle(t)-Math.PI/2;return{x:Math.cos(i)*e+this.xCenter,y:Math.sin(i)*e+this.yCenter}},getPointPositionForValue:function(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))},getBasePosition:function(){var t=this.min,e=this.max;return this.getPointPositionForValue(0,this.beginAtZero?0:t<0&&e<0?e:t>0&&e>0?t:0)},draw:function(){var t=this,e=t.options,i=e.gridLines,n=e.ticks;if(e.display){var a=t.ctx,o=this.getIndexAngle(0),r=ut.options._parseFont(n);(e.angleLines.display||e.pointLabels.display)&&function(t){var e=t.ctx,i=t.options,n=i.angleLines,a=i.gridLines,o=i.pointLabels,r=Pi(n.lineWidth,a.lineWidth),s=Pi(n.color,a.color),l=Fi(i);e.save(),e.lineWidth=r,e.strokeStyle=s,e.setLineDash&&(e.setLineDash(Ai([n.borderDash,a.borderDash,[]])),e.lineDashOffset=Ai([n.borderDashOffset,a.borderDashOffset,0]));var d=t.getDistanceFromCenterForValue(i.ticks.reverse?t.min:t.max),u=ut.options._parseFont(o);e.font=u.string,e.textBaseline="middle";for(var h=Ti(t)-1;h>=0;h--){if(n.display&&r&&s){var c=t.getPointPosition(h,d);e.beginPath(),e.moveTo(t.xCenter,t.yCenter),e.lineTo(c.x,c.y),e.stroke()}if(o.display){var f=0===h?l/2:0,g=t.getPointPosition(h,d+f+5),p=Ii(o.fontColor,h,st.global.defaultFontColor);e.fillStyle=p;var m=t.getIndexAngle(h),v=ut.toDegrees(m);e.textAlign=Ri(v),zi(v,t._pointLabelSizes[h],g),Oi(e,t.pointLabels[h]||"",g,u.lineHeight)}}e.restore()}(t),ut.each(t.ticks,function(e,s){if(s>0||n.reverse){var l=t.getDistanceFromCenterForValue(t.ticksAsNumbers[s]);if(i.display&&0!==s&&function(t,e,i,n){var a,o=t.ctx,r=e.circular,s=Ti(t),l=Ii(e.color,n-1),d=Ii(e.lineWidth,n-1);if((r||s)&&l&&d){if(o.save(),o.strokeStyle=l,o.lineWidth=d,o.setLineDash&&(o.setLineDash(e.borderDash||[]),o.lineDashOffset=e.borderDashOffset||0),o.beginPath(),r)o.arc(t.xCenter,t.yCenter,i,0,2*Math.PI);else{a=t.getPointPosition(0,i),o.moveTo(a.x,a.y);for(var u=1;u<s;u++)a=t.getPointPosition(u,i),o.lineTo(a.x,a.y)}o.closePath(),o.stroke(),o.restore()}}(t,i,l,s),n.display){var d=Pi(n.fontColor,st.global.defaultFontColor);if(a.font=r.string,a.save(),a.translate(t.xCenter,t.yCenter),a.rotate(o),n.showLabelBackdrop){var u=a.measureText(e).width;a.fillStyle=n.backdropColor,a.fillRect(-u/2-n.backdropPaddingX,-l-r.size/2-n.backdropPaddingY,u+2*n.backdropPaddingX,r.size+2*n.backdropPaddingY)}a.textAlign="center",a.textBaseline="middle",a.fillStyle=d,a.fillText(e,0,-l),a.restore()}}})}}}),Wi=Di;Ni._defaults=Wi;var Vi=ut.valueOrDefault,Ei=Number.MIN_SAFE_INTEGER||-9007199254740991,Hi=Number.MAX_SAFE_INTEGER||9007199254740991,ji={millisecond:{common:!0,size:1,steps:[1,2,5,10,20,50,100,250,500]},second:{common:!0,size:1e3,steps:[1,2,5,10,15,30]},minute:{common:!0,size:6e4,steps:[1,2,5,10,15,30]},hour:{common:!0,size:36e5,steps:[1,2,3,6,12]},day:{common:!0,size:864e5,steps:[1,2,5]},week:{common:!1,size:6048e5,steps:[1,2,3,4]},month:{common:!0,size:2628e6,steps:[1,2,3]},quarter:{common:!1,size:7884e6,steps:[1,2,3,4]},year:{common:!0,size:3154e7}},qi=Object.keys(ji);function Yi(t,e){return t-e}function Ui(t){var e,i,n,a={},o=[];for(e=0,i=t.length;e<i;++e)a[n=t[e]]||(a[n]=!0,o.push(n));return o}function Xi(t,e,i,n){var a=function(t,e,i){for(var n,a,o,r=0,s=t.length-1;r>=0&&r<=s;){if(a=t[(n=r+s>>1)-1]||null,o=t[n],!a)return{lo:null,hi:o};if(o[e]<i)r=n+1;else{if(!(a[e]>i))return{lo:a,hi:o};s=n-1}}return{lo:o,hi:null}}(t,e,i),o=a.lo?a.hi?a.lo:t[t.length-2]:t[0],r=a.lo?a.hi?a.hi:t[t.length-1]:t[1],s=r[e]-o[e],l=s?(i-o[e])/s:0,d=(r[n]-o[n])*l;return o[n]+d}function Ki(t,e){var i=t._adapter,n=t.options.time,a=n.parser,o=a||n.format,r=e;return"function"==typeof a&&(r=a(r)),ut.isFinite(r)||(r="string"==typeof o?i.parse(r,o):i.parse(r)),null!==r?+r:(a||"function"!=typeof o||(r=o(e),ut.isFinite(r)||(r=i.parse(r))),r)}function Gi(t,e){if(ut.isNullOrUndef(e))return null;var i=t.options.time,n=Ki(t,t.getRightValue(e));return null===n?n:(i.round&&(n=+t._adapter.startOf(n,i.round)),n)}function Zi(t){for(var e=qi.indexOf(t)+1,i=qi.length;e<i;++e)if(ji[qi[e]].common)return qi[e]}function $i(t,e,i,n){var a,o=t._adapter,r=t.options,s=r.time,l=s.unit||function(t,e,i,n){var a,o,r,s=qi.length;for(a=qi.indexOf(t);a<s-1;++a)if(r=(o=ji[qi[a]]).steps?o.steps[o.steps.length-1]:Hi,o.common&&Math.ceil((i-e)/(r*o.size))<=n)return qi[a];return qi[s-1]}(s.minUnit,e,i,n),d=Zi(l),u=Vi(s.stepSize,s.unitStepSize),h="week"===l&&s.isoWeekday,c=r.ticks.major.enabled,f=ji[l],g=e,p=i,m=[];for(u||(u=function(t,e,i,n){var a,o,r,s=e-t,l=ji[i],d=l.size,u=l.steps;if(!u)return Math.ceil(s/(n*d));for(a=0,o=u.length;a<o&&(r=u[a],!(Math.ceil(s/(d*r))<=n));++a);return r}(e,i,l,n)),h&&(g=+o.startOf(g,"isoWeek",h),p=+o.startOf(p,"isoWeek",h)),g=+o.startOf(g,h?"day":l),(p=+o.startOf(p,h?"day":l))<i&&(p=+o.add(p,1,l)),a=g,c&&d&&!h&&!s.round&&(a=+o.startOf(a,d),a=+o.add(a,~~((g-a)/(f.size*u))*u,l));a<p;a=+o.add(a,u,l))m.push(+a);return m.push(+a),m}var Ji=fi.extend({initialize:function(){this.mergeTicksOptions(),fi.prototype.initialize.call(this)},update:function(){var t=this.options,e=t.time||(t.time={}),i=this._adapter=new si._date(t.adapters.date);return e.format&&console.warn("options.time.format is deprecated and replaced by options.time.parser."),ut.mergeIf(e.displayFormats,i.formats()),fi.prototype.update.apply(this,arguments)},getRightValue:function(t){return t&&void 0!==t.t&&(t=t.t),fi.prototype.getRightValue.call(this,t)},determineDataLimits:function(){var t,e,i,n,a,o,r=this,s=r.chart,l=r._adapter,d=r.options.time,u=d.unit||"day",h=Hi,c=Ei,f=[],g=[],p=[],m=s.data.labels||[];for(t=0,i=m.length;t<i;++t)p.push(Gi(r,m[t]));for(t=0,i=(s.data.datasets||[]).length;t<i;++t)if(s.isDatasetVisible(t))if(a=s.data.datasets[t].data,ut.isObject(a[0]))for(g[t]=[],e=0,n=a.length;e<n;++e)o=Gi(r,a[e]),f.push(o),g[t][e]=o;else{for(e=0,n=p.length;e<n;++e)f.push(p[e]);g[t]=p.slice(0)}else g[t]=[];p.length&&(p=Ui(p).sort(Yi),h=Math.min(h,p[0]),c=Math.max(c,p[p.length-1])),f.length&&(f=Ui(f).sort(Yi),h=Math.min(h,f[0]),c=Math.max(c,f[f.length-1])),h=Gi(r,d.min)||h,c=Gi(r,d.max)||c,h=h===Hi?+l.startOf(Date.now(),u):h,c=c===Ei?+l.endOf(Date.now(),u)+1:c,r.min=Math.min(h,c),r.max=Math.max(h+1,c),r._horizontal=r.isHorizontal(),r._table=[],r._timestamps={data:f,datasets:g,labels:p}},buildTicks:function(){var t,e,i,n=this,a=n.min,o=n.max,r=n.options,s=r.time,l=[],d=[];switch(r.ticks.source){case"data":l=n._timestamps.data;break;case"labels":l=n._timestamps.labels;break;case"auto":default:l=$i(n,a,o,n.getLabelCapacity(a))}for("ticks"===r.bounds&&l.length&&(a=l[0],o=l[l.length-1]),a=Gi(n,s.min)||a,o=Gi(n,s.max)||o,t=0,e=l.length;t<e;++t)(i=l[t])>=a&&i<=o&&d.push(i);return n.min=a,n.max=o,n._unit=s.unit||function(t,e,i,n,a){var o,r;for(o=qi.length-1;o>=qi.indexOf(i);o--)if(r=qi[o],ji[r].common&&t._adapter.diff(a,n,r)>=e.length)return r;return qi[i?qi.indexOf(i):0]}(n,d,s.minUnit,n.min,n.max),n._majorUnit=Zi(n._unit),n._table=function(t,e,i,n){if("linear"===n||!t.length)return[{time:e,pos:0},{time:i,pos:1}];var a,o,r,s,l,d=[],u=[e];for(a=0,o=t.length;a<o;++a)(s=t[a])>e&&s<i&&u.push(s);for(u.push(i),a=0,o=u.length;a<o;++a)l=u[a+1],r=u[a-1],s=u[a],void 0!==r&&void 0!==l&&Math.round((l+r)/2)===s||d.push({time:s,pos:a/(o-1)});return d}(n._timestamps.data,a,o,r.distribution),n._offsets=function(t,e,i,n,a){var o,r,s=0,l=0;return a.offset&&e.length&&(a.time.min||(o=Xi(t,"time",e[0],"pos"),s=1===e.length?1-o:(Xi(t,"time",e[1],"pos")-o)/2),a.time.max||(r=Xi(t,"time",e[e.length-1],"pos"),l=1===e.length?r:(r-Xi(t,"time",e[e.length-2],"pos"))/2)),{start:s,end:l}}(n._table,d,0,0,r),r.ticks.reverse&&d.reverse(),function(t,e,i){var n,a,o,r,s=[];for(n=0,a=e.length;n<a;++n)o=e[n],r=!!i&&o===+t._adapter.startOf(o,i),s.push({value:o,major:r});return s}(n,d,n._majorUnit)},getLabelForIndex:function(t,e){var i=this,n=i._adapter,a=i.chart.data,o=i.options.time,r=a.labels&&t<a.labels.length?a.labels[t]:"",s=a.datasets[e].data[t];return ut.isObject(s)&&(r=i.getRightValue(s)),o.tooltipFormat?n.format(Ki(i,r),o.tooltipFormat):"string"==typeof r?r:n.format(Ki(i,r),o.displayFormats.datetime)},tickFormatFunction:function(t,e,i,n){var a=this._adapter,o=this.options,r=o.time.displayFormats,s=r[this._unit],l=this._majorUnit,d=r[l],u=+a.startOf(t,l),h=o.ticks.major,c=h.enabled&&l&&d&&t===u,f=a.format(t,n||(c?d:s)),g=c?h:o.ticks.minor,p=Vi(g.callback,g.userCallback);return p?p(f,e,i):f},convertTicksToLabels:function(t){var e,i,n=[];for(e=0,i=t.length;e<i;++e)n.push(this.tickFormatFunction(t[e].value,e,t));return n},getPixelForOffset:function(t){var e=this,i=e.options.ticks.reverse,n=e._horizontal?e.width:e.height,a=e._horizontal?i?e.right:e.left:i?e.bottom:e.top,o=Xi(e._table,"time",t,"pos"),r=n*(e._offsets.start+o)/(e._offsets.start+1+e._offsets.end);return i?a-r:a+r},getPixelForValue:function(t,e,i){var n=null;if(void 0!==e&&void 0!==i&&(n=this._timestamps.datasets[i][e]),null===n&&(n=Gi(this,t)),null!==n)return this.getPixelForOffset(n)},getPixelForTick:function(t){var e=this.getTicks();return t>=0&&t<e.length?this.getPixelForOffset(e[t].value):null},getValueForPixel:function(t){var e=this,i=e._horizontal?e.width:e.height,n=e._horizontal?e.left:e.top,a=(i?(t-n)/i:0)*(e._offsets.start+1+e._offsets.start)-e._offsets.end,o=Xi(e._table,"pos",a,"time");return e._adapter._create(o)},getLabelWidth:function(t){var e=this.options.ticks,i=this.ctx.measureText(t).width,n=ut.toRadians(e.maxRotation),a=Math.cos(n),o=Math.sin(n);return i*a+Vi(e.fontSize,st.global.defaultFontSize)*o},getLabelCapacity:function(t){var e=this,i=e.options.time.displayFormats.millisecond,n=e.tickFormatFunction(t,0,[],i),a=e.getLabelWidth(n),o=e.isHorizontal()?e.width:e.height,r=Math.floor(o/a);return r>0?r:1}}),Qi={position:"bottom",distribution:"linear",bounds:"data",adapters:{},time:{parser:!1,format:!1,unit:!1,round:!1,displayFormat:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{autoSkip:!1,source:"auto",major:{enabled:!1}}};Ji._defaults=Qi;var tn={category:gi,linear:yi,logarithmic:Ci,radialLinear:Ni,time:Ji},en={datetime:"MMM D, YYYY, h:mm:ss a",millisecond:"h:mm:ss.SSS a",second:"h:mm:ss a",minute:"h:mm a",hour:"hA",day:"MMM D",week:"ll",month:"MMM YYYY",quarter:"[Q]Q - YYYY",year:"YYYY"};si._date.override("function"==typeof t?{_id:"moment",formats:function(){return en},parse:function(e,i){return"string"==typeof e&&"string"==typeof i?e=t(e,i):e instanceof t||(e=t(e)),e.isValid()?e.valueOf():null},format:function(e,i){return t(e).format(i)},add:function(e,i,n){return t(e).add(i,n).valueOf()},diff:function(e,i,n){return t.duration(t(e).diff(t(i))).as(n)},startOf:function(e,i,n){return e=t(e),"isoWeek"===i?e.isoWeekday(n).valueOf():e.startOf(i).valueOf()},endOf:function(e,i){return t(e).endOf(i).valueOf()},_create:function(e){return t(e)}}:{}),st._set("global",{plugins:{filler:{propagate:!0}}});var nn={dataset:function(t){var e=t.fill,i=t.chart,n=i.getDatasetMeta(e),a=n&&i.isDatasetVisible(e)&&n.dataset._children||[],o=a.length||0;return o?function(t,e){return e<o&&a[e]._view||null}:null},boundary:function(t){var e=t.boundary,i=e?e.x:null,n=e?e.y:null;return function(t){return{x:null===i?t.x:i,y:null===n?t.y:n}}}};function an(t,e,i){var n,a=t._model||{},o=a.fill;if(void 0===o&&(o=!!a.backgroundColor),!1===o||null===o)return!1;if(!0===o)return"origin";if(n=parseFloat(o,10),isFinite(n)&&Math.floor(n)===n)return"-"!==o[0]&&"+"!==o[0]||(n=e+n),!(n===e||n<0||n>=i)&&n;switch(o){case"bottom":return"start";case"top":return"end";case"zero":return"origin";case"origin":case"start":case"end":return o;default:return!1}}function on(t){var e,i=t.el._model||{},n=t.el._scale||{},a=t.fill,o=null;if(isFinite(a))return null;if("start"===a?o=void 0===i.scaleBottom?n.bottom:i.scaleBottom:"end"===a?o=void 0===i.scaleTop?n.top:i.scaleTop:void 0!==i.scaleZero?o=i.scaleZero:n.getBasePosition?o=n.getBasePosition():n.getBasePixel&&(o=n.getBasePixel()),null!=o){if(void 0!==o.x&&void 0!==o.y)return o;if(ut.isFinite(o))return{x:(e=n.isHorizontal())?o:null,y:e?null:o}}return null}function rn(t,e,i){var n,a=t[e].fill,o=[e];if(!i)return a;for(;!1!==a&&-1===o.indexOf(a);){if(!isFinite(a))return a;if(!(n=t[a]))return!1;if(n.visible)return a;o.push(a),a=n.fill}return!1}function sn(t){var e=t.fill,i="dataset";return!1===e?null:(isFinite(e)||(i="boundary"),nn[i](t))}function ln(t){return t&&!t.skip}function dn(t,e,i,n,a){var o;if(n&&a){for(t.moveTo(e[0].x,e[0].y),o=1;o<n;++o)ut.canvas.lineTo(t,e[o-1],e[o]);for(t.lineTo(i[a-1].x,i[a-1].y),o=a-1;o>0;--o)ut.canvas.lineTo(t,i[o],i[o-1],!0)}}var un={id:"filler",afterDatasetsUpdate:function(t,e){var i,n,a,o,r=(t.data.datasets||[]).length,s=e.propagate,l=[];for(n=0;n<r;++n)o=null,(a=(i=t.getDatasetMeta(n)).dataset)&&a._model&&a instanceof Wt.Line&&(o={visible:t.isDatasetVisible(n),fill:an(a,n,r),chart:t,el:a}),i.$filler=o,l.push(o);for(n=0;n<r;++n)(o=l[n])&&(o.fill=rn(l,n,s),o.boundary=on(o),o.mapper=sn(o))},beforeDatasetDraw:function(t,e){var i=e.meta.$filler;if(i){var n=t.ctx,a=i.el,o=a._view,r=a._children||[],s=i.mapper,l=o.backgroundColor||st.global.defaultColor;s&&l&&r.length&&(ut.canvas.clipArea(n,t.chartArea),function(t,e,i,n,a,o){var r,s,l,d,u,h,c,f=e.length,g=n.spanGaps,p=[],m=[],v=0,b=0;for(t.beginPath(),r=0,s=f+!!o;r<s;++r)u=i(d=e[l=r%f]._view,l,n),h=ln(d),c=ln(u),h&&c?(v=p.push(d),b=m.push(u)):v&&b&&(g?(h&&p.push(d),c&&m.push(u)):(dn(t,p,m,v,b),v=b=0,p=[],m=[]));dn(t,p,m,v,b),t.closePath(),t.fillStyle=a,t.fill()}(n,r,s,o,l,a._loop),ut.canvas.unclipArea(n))}}},hn=ut.noop,cn=ut.valueOrDefault;function fn(t,e){return t.usePointStyle&&t.boxWidth>e?e:t.boxWidth}st._set("global",{legend:{display:!0,position:"top",fullWidth:!0,reverse:!1,weight:1e3,onClick:function(t,e){var i=e.datasetIndex,n=this.chart,a=n.getDatasetMeta(i);a.hidden=null===a.hidden?!n.data.datasets[i].hidden:null,n.update()},onHover:null,onLeave:null,labels:{boxWidth:40,padding:10,generateLabels:function(t){var e=t.data;return ut.isArray(e.datasets)?e.datasets.map(function(e,i){return{text:e.label,fillStyle:ut.isArray(e.backgroundColor)?e.backgroundColor[0]:e.backgroundColor,hidden:!t.isDatasetVisible(i),lineCap:e.borderCapStyle,lineDash:e.borderDash,lineDashOffset:e.borderDashOffset,lineJoin:e.borderJoinStyle,lineWidth:e.borderWidth,strokeStyle:e.borderColor,pointStyle:e.pointStyle,datasetIndex:i}},this):[]}}},legendCallback:function(t){var e=[];e.push('<ul class="'+t.id+'-legend">');for(var i=0;i<t.data.datasets.length;i++)e.push('<li><span style="background-color:'+t.data.datasets[i].backgroundColor+'"></span>'),t.data.datasets[i].label&&e.push(t.data.datasets[i].label),e.push("</li>");return e.push("</ul>"),e.join("")}});var gn=pt.extend({initialize:function(t){ut.extend(this,t),this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1},beforeUpdate:hn,update:function(t,e,i){var n=this;return n.beforeUpdate(),n.maxWidth=t,n.maxHeight=e,n.margins=i,n.beforeSetDimensions(),n.setDimensions(),n.afterSetDimensions(),n.beforeBuildLabels(),n.buildLabels(),n.afterBuildLabels(),n.beforeFit(),n.fit(),n.afterFit(),n.afterUpdate(),n.minSize},afterUpdate:hn,beforeSetDimensions:hn,setDimensions:function(){var t=this;t.isHorizontal()?(t.width=t.maxWidth,t.left=0,t.right=t.width):(t.height=t.maxHeight,t.top=0,t.bottom=t.height),t.paddingLeft=0,t.paddingTop=0,t.paddingRight=0,t.paddingBottom=0,t.minSize={width:0,height:0}},afterSetDimensions:hn,beforeBuildLabels:hn,buildLabels:function(){var t=this,e=t.options.labels||{},i=ut.callback(e.generateLabels,[t.chart],t)||[];e.filter&&(i=i.filter(function(i){return e.filter(i,t.chart.data)})),t.options.reverse&&i.reverse(),t.legendItems=i},afterBuildLabels:hn,beforeFit:hn,fit:function(){var t=this,e=t.options,i=e.labels,n=e.display,a=t.ctx,o=ut.options._parseFont(i),r=o.size,s=t.legendHitBoxes=[],l=t.minSize,d=t.isHorizontal();if(d?(l.width=t.maxWidth,l.height=n?10:0):(l.width=n?10:0,l.height=t.maxHeight),n)if(a.font=o.string,d){var u=t.lineWidths=[0],h=0;a.textAlign="left",a.textBaseline="top",ut.each(t.legendItems,function(t,e){var n=fn(i,r)+r/2+a.measureText(t.text).width;(0===e||u[u.length-1]+n+i.padding>l.width)&&(h+=r+i.padding,u[u.length-(e>0?0:1)]=i.padding),s[e]={left:0,top:0,width:n,height:r},u[u.length-1]+=n+i.padding}),l.height+=h}else{var c=i.padding,f=t.columnWidths=[],g=i.padding,p=0,m=0,v=r+c;ut.each(t.legendItems,function(t,e){var n=fn(i,r)+r/2+a.measureText(t.text).width;e>0&&m+v>l.height-c&&(g+=p+i.padding,f.push(p),p=0,m=0),p=Math.max(p,n),m+=v,s[e]={left:0,top:0,width:n,height:r}}),g+=p,f.push(p),l.width+=g}t.width=l.width,t.height=l.height},afterFit:hn,isHorizontal:function(){return"top"===this.options.position||"bottom"===this.options.position},draw:function(){var t=this,e=t.options,i=e.labels,n=st.global,a=n.defaultColor,o=n.elements.line,r=t.width,s=t.lineWidths;if(e.display){var l,d=t.ctx,u=cn(i.fontColor,n.defaultFontColor),h=ut.options._parseFont(i),c=h.size;d.textAlign="left",d.textBaseline="middle",d.lineWidth=.5,d.strokeStyle=u,d.fillStyle=u,d.font=h.string;var f=fn(i,c),g=t.legendHitBoxes,p=t.isHorizontal();l=p?{x:t.left+(r-s[0])/2+i.padding,y:t.top+i.padding,line:0}:{x:t.left+i.padding,y:t.top+i.padding,line:0};var m=c+i.padding;ut.each(t.legendItems,function(n,u){var h=d.measureText(n.text).width,v=f+c/2+h,b=l.x,x=l.y;p?u>0&&b+v+i.padding>t.left+t.minSize.width&&(x=l.y+=m,l.line++,b=l.x=t.left+(r-s[l.line])/2+i.padding):u>0&&x+m>t.top+t.minSize.height&&(b=l.x=b+t.columnWidths[l.line]+i.padding,x=l.y=t.top+i.padding,l.line++),function(t,i,n){if(!(isNaN(f)||f<=0)){d.save();var r=cn(n.lineWidth,o.borderWidth);if(d.fillStyle=cn(n.fillStyle,a),d.lineCap=cn(n.lineCap,o.borderCapStyle),d.lineDashOffset=cn(n.lineDashOffset,o.borderDashOffset),d.lineJoin=cn(n.lineJoin,o.borderJoinStyle),d.lineWidth=r,d.strokeStyle=cn(n.strokeStyle,a),d.setLineDash&&d.setLineDash(cn(n.lineDash,o.borderDash)),e.labels&&e.labels.usePointStyle){var s=f*Math.SQRT2/2,l=t+f/2,u=i+c/2;ut.canvas.drawPoint(d,n.pointStyle,s,l,u)}else 0!==r&&d.strokeRect(t,i,f,c),d.fillRect(t,i,f,c);d.restore()}}(b,x,n),g[u].left=b,g[u].top=x,function(t,e,i,n){var a=c/2,o=f+a+t,r=e+a;d.fillText(i.text,o,r),i.hidden&&(d.beginPath(),d.lineWidth=2,d.moveTo(o,r),d.lineTo(o+n,r),d.stroke())}(b,x,n,h),p?l.x+=v+i.padding:l.y+=m})}},_getLegendItemAt:function(t,e){var i,n,a,o=this;if(t>=o.left&&t<=o.right&&e>=o.top&&e<=o.bottom)for(a=o.legendHitBoxes,i=0;i<a.length;++i)if(t>=(n=a[i]).left&&t<=n.left+n.width&&e>=n.top&&e<=n.top+n.height)return o.legendItems[i];return null},handleEvent:function(t){var e,i=this,n=i.options,a="mouseup"===t.type?"click":t.type;if("mousemove"===a){if(!n.onHover&&!n.onLeave)return}else{if("click"!==a)return;if(!n.onClick)return}e=i._getLegendItemAt(t.x,t.y),"click"===a?e&&n.onClick&&n.onClick.call(i,t.native,e):(n.onLeave&&e!==i._hoveredItem&&(i._hoveredItem&&n.onLeave.call(i,t.native,i._hoveredItem),i._hoveredItem=e),n.onHover&&e&&n.onHover.call(i,t.native,e))}});function pn(t,e){var i=new gn({ctx:t.ctx,options:e,chart:t});ke.configure(t,i,e),ke.addBox(t,i),t.legend=i}var mn={id:"legend",_element:gn,beforeInit:function(t){var e=t.options.legend;e&&pn(t,e)},beforeUpdate:function(t){var e=t.options.legend,i=t.legend;e?(ut.mergeIf(e,st.global.legend),i?(ke.configure(t,i,e),i.options=e):pn(t,e)):i&&(ke.removeBox(t,i),delete t.legend)},afterEvent:function(t,e){var i=t.legend;i&&i.handleEvent(e)}},vn=ut.noop;st._set("global",{title:{display:!1,fontStyle:"bold",fullWidth:!0,padding:10,position:"top",text:"",weight:2e3}});var bn=pt.extend({initialize:function(t){ut.extend(this,t),this.legendHitBoxes=[]},beforeUpdate:vn,update:function(t,e,i){var n=this;return n.beforeUpdate(),n.maxWidth=t,n.maxHeight=e,n.margins=i,n.beforeSetDimensions(),n.setDimensions(),n.afterSetDimensions(),n.beforeBuildLabels(),n.buildLabels(),n.afterBuildLabels(),n.beforeFit(),n.fit(),n.afterFit(),n.afterUpdate(),n.minSize},afterUpdate:vn,beforeSetDimensions:vn,setDimensions:function(){var t=this;t.isHorizontal()?(t.width=t.maxWidth,t.left=0,t.right=t.width):(t.height=t.maxHeight,t.top=0,t.bottom=t.height),t.paddingLeft=0,t.paddingTop=0,t.paddingRight=0,t.paddingBottom=0,t.minSize={width:0,height:0}},afterSetDimensions:vn,beforeBuildLabels:vn,buildLabels:vn,afterBuildLabels:vn,beforeFit:vn,fit:function(){var t=this,e=t.options,i=e.display,n=t.minSize,a=ut.isArray(e.text)?e.text.length:1,o=ut.options._parseFont(e),r=i?a*o.lineHeight+2*e.padding:0;t.isHorizontal()?(n.width=t.maxWidth,n.height=r):(n.width=r,n.height=t.maxHeight),t.width=n.width,t.height=n.height},afterFit:vn,isHorizontal:function(){var t=this.options.position;return"top"===t||"bottom"===t},draw:function(){var t=this,e=t.ctx,i=t.options;if(i.display){var n,a,o,r=ut.options._parseFont(i),s=r.lineHeight,l=s/2+i.padding,d=0,u=t.top,h=t.left,c=t.bottom,f=t.right;e.fillStyle=ut.valueOrDefault(i.fontColor,st.global.defaultFontColor),e.font=r.string,t.isHorizontal()?(a=h+(f-h)/2,o=u+l,n=f-h):(a="left"===i.position?h+l:f-l,o=u+(c-u)/2,n=c-u,d=Math.PI*("left"===i.position?-.5:.5)),e.save(),e.translate(a,o),e.rotate(d),e.textAlign="center",e.textBaseline="middle";var g=i.text;if(ut.isArray(g))for(var p=0,m=0;m<g.length;++m)e.fillText(g[m],0,p,n),p+=s;else e.fillText(g,0,0,n);e.restore()}}});function xn(t,e){var i=new bn({ctx:t.ctx,options:e,chart:t});ke.configure(t,i,e),ke.addBox(t,i),t.titleBlock=i}var yn={},kn=un,wn=mn,Mn={id:"title",_element:bn,beforeInit:function(t){var e=t.options.title;e&&xn(t,e)},beforeUpdate:function(t){var e=t.options.title,i=t.titleBlock;e?(ut.mergeIf(e,st.global.title),i?(ke.configure(t,i,e),i.options=e):xn(t,e)):i&&(ke.removeBox(t,i),delete t.titleBlock)}};for(var _n in yn.filler=kn,yn.legend=wn,yn.title=Mn,ai.helpers=ut,function(){function t(t,e,i){var n;return"string"==typeof t?(n=parseInt(t,10),-1!==t.indexOf("%")&&(n=n/100*e.parentNode[i])):n=t,n}function e(t){return null!=t&&"none"!==t}function i(i,n,a){var o=document.defaultView,r=ut._getParentNode(i),s=o.getComputedStyle(i)[n],l=o.getComputedStyle(r)[n],d=e(s),u=e(l),h=Number.POSITIVE_INFINITY;return d||u?Math.min(d?t(s,i,a):h,u?t(l,r,a):h):"none"}ut.where=function(t,e){if(ut.isArray(t)&&Array.prototype.filter)return t.filter(e);var i=[];return ut.each(t,function(t){e(t)&&i.push(t)}),i},ut.findIndex=Array.prototype.findIndex?function(t,e,i){return t.findIndex(e,i)}:function(t,e,i){i=void 0===i?t:i;for(var n=0,a=t.length;n<a;++n)if(e.call(i,t[n],n,t))return n;return-1},ut.findNextWhere=function(t,e,i){ut.isNullOrUndef(i)&&(i=-1);for(var n=i+1;n<t.length;n++){var a=t[n];if(e(a))return a}},ut.findPreviousWhere=function(t,e,i){ut.isNullOrUndef(i)&&(i=t.length);for(var n=i-1;n>=0;n--){var a=t[n];if(e(a))return a}},ut.isNumber=function(t){return!isNaN(parseFloat(t))&&isFinite(t)},ut.almostEquals=function(t,e,i){return Math.abs(t-e)<i},ut.almostWhole=function(t,e){var i=Math.round(t);return i-e<t&&i+e>t},ut.max=function(t){return t.reduce(function(t,e){return isNaN(e)?t:Math.max(t,e)},Number.NEGATIVE_INFINITY)},ut.min=function(t){return t.reduce(function(t,e){return isNaN(e)?t:Math.min(t,e)},Number.POSITIVE_INFINITY)},ut.sign=Math.sign?function(t){return Math.sign(t)}:function(t){return 0==(t=+t)||isNaN(t)?t:t>0?1:-1},ut.log10=Math.log10?function(t){return Math.log10(t)}:function(t){var e=Math.log(t)*Math.LOG10E,i=Math.round(e);return t===Math.pow(10,i)?i:e},ut.toRadians=function(t){return t*(Math.PI/180)},ut.toDegrees=function(t){return t*(180/Math.PI)},ut._decimalPlaces=function(t){if(ut.isFinite(t)){for(var e=1,i=0;Math.round(t*e)/e!==t;)e*=10,i++;return i}},ut.getAngleFromPoint=function(t,e){var i=e.x-t.x,n=e.y-t.y,a=Math.sqrt(i*i+n*n),o=Math.atan2(n,i);return o<-.5*Math.PI&&(o+=2*Math.PI),{angle:o,distance:a}},ut.distanceBetweenPoints=function(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))},ut.aliasPixel=function(t){return t%2==0?0:.5},ut._alignPixel=function(t,e,i){var n=t.currentDevicePixelRatio,a=i/2;return Math.round((e-a)*n)/n+a},ut.splineCurve=function(t,e,i,n){var a=t.skip?e:t,o=e,r=i.skip?e:i,s=Math.sqrt(Math.pow(o.x-a.x,2)+Math.pow(o.y-a.y,2)),l=Math.sqrt(Math.pow(r.x-o.x,2)+Math.pow(r.y-o.y,2)),d=s/(s+l),u=l/(s+l),h=n*(d=isNaN(d)?0:d),c=n*(u=isNaN(u)?0:u);return{previous:{x:o.x-h*(r.x-a.x),y:o.y-h*(r.y-a.y)},next:{x:o.x+c*(r.x-a.x),y:o.y+c*(r.y-a.y)}}},ut.EPSILON=Number.EPSILON||1e-14,ut.splineCurveMonotone=function(t){var e,i,n,a,o,r,s,l,d,u=(t||[]).map(function(t){return{model:t._model,deltaK:0,mK:0}}),h=u.length;for(e=0;e<h;++e)if(!(n=u[e]).model.skip){if(i=e>0?u[e-1]:null,(a=e<h-1?u[e+1]:null)&&!a.model.skip){var c=a.model.x-n.model.x;n.deltaK=0!==c?(a.model.y-n.model.y)/c:0}!i||i.model.skip?n.mK=n.deltaK:!a||a.model.skip?n.mK=i.deltaK:this.sign(i.deltaK)!==this.sign(n.deltaK)?n.mK=0:n.mK=(i.deltaK+n.deltaK)/2}for(e=0;e<h-1;++e)n=u[e],a=u[e+1],n.model.skip||a.model.skip||(ut.almostEquals(n.deltaK,0,this.EPSILON)?n.mK=a.mK=0:(o=n.mK/n.deltaK,r=a.mK/n.deltaK,(l=Math.pow(o,2)+Math.pow(r,2))<=9||(s=3/Math.sqrt(l),n.mK=o*s*n.deltaK,a.mK=r*s*n.deltaK)));for(e=0;e<h;++e)(n=u[e]).model.skip||(i=e>0?u[e-1]:null,a=e<h-1?u[e+1]:null,i&&!i.model.skip&&(d=(n.model.x-i.model.x)/3,n.model.controlPointPreviousX=n.model.x-d,n.model.controlPointPreviousY=n.model.y-d*n.mK),a&&!a.model.skip&&(d=(a.model.x-n.model.x)/3,n.model.controlPointNextX=n.model.x+d,n.model.controlPointNextY=n.model.y+d*n.mK))},ut.nextItem=function(t,e,i){return i?e>=t.length-1?t[0]:t[e+1]:e>=t.length-1?t[t.length-1]:t[e+1]},ut.previousItem=function(t,e,i){return i?e<=0?t[t.length-1]:t[e-1]:e<=0?t[0]:t[e-1]},ut.niceNum=function(t,e){var i=Math.floor(ut.log10(t)),n=t/Math.pow(10,i);return(e?n<1.5?1:n<3?2:n<7?5:10:n<=1?1:n<=2?2:n<=5?5:10)*Math.pow(10,i)},ut.requestAnimFrame="undefined"==typeof window?function(t){t()}:window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){return window.setTimeout(t,1e3/60)},ut.getRelativePosition=function(t,e){var i,n,a=t.originalEvent||t,o=t.target||t.srcElement,r=o.getBoundingClientRect(),s=a.touches;s&&s.length>0?(i=s[0].clientX,n=s[0].clientY):(i=a.clientX,n=a.clientY);var l=parseFloat(ut.getStyle(o,"padding-left")),d=parseFloat(ut.getStyle(o,"padding-top")),u=parseFloat(ut.getStyle(o,"padding-right")),h=parseFloat(ut.getStyle(o,"padding-bottom")),c=r.right-r.left-l-u,f=r.bottom-r.top-d-h;return{x:i=Math.round((i-r.left-l)/c*o.width/e.currentDevicePixelRatio),y:n=Math.round((n-r.top-d)/f*o.height/e.currentDevicePixelRatio)}},ut.getConstraintWidth=function(t){return i(t,"max-width","clientWidth")},ut.getConstraintHeight=function(t){return i(t,"max-height","clientHeight")},ut._calculatePadding=function(t,e,i){return(e=ut.getStyle(t,e)).indexOf("%")>-1?i*parseInt(e,10)/100:parseInt(e,10)},ut._getParentNode=function(t){var e=t.parentNode;return e&&"[object ShadowRoot]"===e.toString()&&(e=e.host),e},ut.getMaximumWidth=function(t){var e=ut._getParentNode(t);if(!e)return t.clientWidth;var i=e.clientWidth,n=i-ut._calculatePadding(e,"padding-left",i)-ut._calculatePadding(e,"padding-right",i),a=ut.getConstraintWidth(t);return isNaN(a)?n:Math.min(n,a)},ut.getMaximumHeight=function(t){var e=ut._getParentNode(t);if(!e)return t.clientHeight;var i=e.clientHeight,n=i-ut._calculatePadding(e,"padding-top",i)-ut._calculatePadding(e,"padding-bottom",i),a=ut.getConstraintHeight(t);return isNaN(a)?n:Math.min(n,a)},ut.getStyle=function(t,e){return t.currentStyle?t.currentStyle[e]:document.defaultView.getComputedStyle(t,null).getPropertyValue(e)},ut.retinaScale=function(t,e){var i=t.currentDevicePixelRatio=e||"undefined"!=typeof window&&window.devicePixelRatio||1;if(1!==i){var n=t.canvas,a=t.height,o=t.width;n.height=a*i,n.width=o*i,t.ctx.scale(i,i),n.style.height||n.style.width||(n.style.height=a+"px",n.style.width=o+"px")}},ut.fontString=function(t,e,i){return e+" "+t+"px "+i},ut.longestText=function(t,e,i,n){var a=(n=n||{}).data=n.data||{},o=n.garbageCollect=n.garbageCollect||[];n.font!==e&&(a=n.data={},o=n.garbageCollect=[],n.font=e),t.font=e;var r=0;ut.each(i,function(e){null!=e&&!0!==ut.isArray(e)?r=ut.measureText(t,a,o,r,e):ut.isArray(e)&&ut.each(e,function(e){null==e||ut.isArray(e)||(r=ut.measureText(t,a,o,r,e))})});var s=o.length/2;if(s>i.length){for(var l=0;l<s;l++)delete a[o[l]];o.splice(0,s)}return r},ut.measureText=function(t,e,i,n,a){var o=e[a];return o||(o=e[a]=t.measureText(a).width,i.push(a)),o>n&&(n=o),n},ut.numberOfLabelLines=function(t){var e=1;return ut.each(t,function(t){ut.isArray(t)&&t.length>e&&(e=t.length)}),e},ut.color=X?function(t){return t instanceof CanvasGradient&&(t=st.global.defaultColor),X(t)}:function(t){return console.error("Color.js not found!"),t},ut.getHoverColor=function(t){return t instanceof CanvasPattern||t instanceof CanvasGradient?t:ut.color(t).saturate(.5).darken(.1).rgbString()}}(),ai._adapters=si,ai.Animation=vt,ai.animationService=bt,ai.controllers=ue,ai.DatasetController=Mt,ai.defaults=st,ai.Element=pt,ai.elements=Wt,ai.Interaction=ve,ai.layouts=ke,ai.platform=Ve,ai.plugins=Ee,ai.Scale=fi,ai.scaleService=He,ai.Ticks=li,ai.Tooltip=Je,ai.helpers.each(tn,function(t,e){ai.scaleService.registerScaleType(e,t,t._defaults)}),yn)yn.hasOwnProperty(_n)&&ai.plugins.register(yn[_n]);ai.platform.initialize();var Cn=ai;return"undefined"!=typeof window&&(window.Chart=ai),ai.Chart=ai,ai.Legend=yn.legend._element,ai.Title=yn.title._element,ai.pluginService=ai.plugins,ai.PluginBase=ai.Element.extend({}),ai.canvasHelpers=ai.helpers.canvas,ai.layoutService=ai.layouts,ai.LinearScaleBase=bi,ai.helpers.each(["Bar","Bubble","Doughnut","Line","PolarArea","Radar","Scatter"],function(t){ai[t]=function(e,i){return new ai(e,ai.helpers.merge(i||{},{type:t.charAt(0).toLowerCase()+t.slice(1)}))}}),Cn});
assets/lib/chosen/chosen.jquery.min.js CHANGED
@@ -1,2 +1,3 @@
1
- /* Chosen v1.5.1 | (c) 2011-2016 by Harvest | MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md */
2
- (function(){var a,AbstractChosen,Chosen,SelectParser,b,c={}.hasOwnProperty,d=function(a,b){function d(){this.constructor=a}for(var e in b)c.call(b,e)&&(a[e]=b[e]);return d.prototype=b.prototype,a.prototype=new d,a.__super__=b.prototype,a};SelectParser=function(){function SelectParser(){this.options_index=0,this.parsed=[]}return SelectParser.prototype.add_node=function(a){return"OPTGROUP"===a.nodeName.toUpperCase()?this.add_group(a):this.add_option(a)},SelectParser.prototype.add_group=function(a){var b,c,d,e,f,g;for(b=this.parsed.length,this.parsed.push({array_index:b,group:!0,label:this.escapeExpression(a.label),title:a.title?a.title:void 0,children:0,disabled:a.disabled,classes:a.className}),f=a.childNodes,g=[],d=0,e=f.length;e>d;d++)c=f[d],g.push(this.add_option(c,b,a.disabled));return g},SelectParser.prototype.add_option=function(a,b,c){return"OPTION"===a.nodeName.toUpperCase()?(""!==a.text?(null!=b&&(this.parsed[b].children+=1),this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,value:a.value,text:a.text,html:a.innerHTML,title:a.title?a.title:void 0,selected:a.selected,disabled:c===!0?c:a.disabled,group_array_index:b,group_label:null!=b?this.parsed[b].label:null,classes:a.className,style:a.style.cssText})):this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,empty:!0}),this.options_index+=1):void 0},SelectParser.prototype.escapeExpression=function(a){var b,c;return null==a||a===!1?"":/[\&\<\>\"\'\`]/.test(a)?(b={"<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},c=/&(?!\w+;)|[\<\>\"\'\`]/g,a.replace(c,function(a){return b[a]||"&amp;"})):a},SelectParser}(),SelectParser.select_to_array=function(a){var b,c,d,e,f;for(c=new SelectParser,f=a.childNodes,d=0,e=f.length;e>d;d++)b=f[d],c.add_node(b);return c.parsed},AbstractChosen=function(){function AbstractChosen(a,b){this.form_field=a,this.options=null!=b?b:{},AbstractChosen.browser_is_supported()&&(this.is_multiple=this.form_field.multiple,this.set_default_text(),this.set_default_values(),this.setup(),this.set_up_html(),this.register_observers(),this.on_ready())}return AbstractChosen.prototype.set_default_values=function(){var a=this;return this.click_test_action=function(b){return a.test_active_click(b)},this.activate_action=function(b){return a.activate_field(b)},this.active_field=!1,this.mouse_on_container=!1,this.results_showing=!1,this.result_highlighted=null,this.allow_single_deselect=null!=this.options.allow_single_deselect&&null!=this.form_field.options[0]&&""===this.form_field.options[0].text?this.options.allow_single_deselect:!1,this.disable_search_threshold=this.options.disable_search_threshold||0,this.disable_search=this.options.disable_search||!1,this.enable_split_word_search=null!=this.options.enable_split_word_search?this.options.enable_split_word_search:!0,this.group_search=null!=this.options.group_search?this.options.group_search:!0,this.search_contains=this.options.search_contains||!1,this.single_backstroke_delete=null!=this.options.single_backstroke_delete?this.options.single_backstroke_delete:!0,this.max_selected_options=this.options.max_selected_options||1/0,this.inherit_select_classes=this.options.inherit_select_classes||!1,this.display_selected_options=null!=this.options.display_selected_options?this.options.display_selected_options:!0,this.display_disabled_options=null!=this.options.display_disabled_options?this.options.display_disabled_options:!0,this.include_group_label_in_selected=this.options.include_group_label_in_selected||!1,this.max_shown_results=this.options.max_shown_results||Number.POSITIVE_INFINITY},AbstractChosen.prototype.set_default_text=function(){return this.form_field.getAttribute("data-placeholder")?this.default_text=this.form_field.getAttribute("data-placeholder"):this.is_multiple?this.default_text=this.options.placeholder_text_multiple||this.options.placeholder_text||AbstractChosen.default_multiple_text:this.default_text=this.options.placeholder_text_single||this.options.placeholder_text||AbstractChosen.default_single_text,this.results_none_found=this.form_field.getAttribute("data-no_results_text")||this.options.no_results_text||AbstractChosen.default_no_result_text},AbstractChosen.prototype.choice_label=function(a){return this.include_group_label_in_selected&&null!=a.group_label?"<b class='group-name'>"+a.group_label+"</b>"+a.html:a.html},AbstractChosen.prototype.mouse_enter=function(){return this.mouse_on_container=!0},AbstractChosen.prototype.mouse_leave=function(){return this.mouse_on_container=!1},AbstractChosen.prototype.input_focus=function(a){var b=this;if(this.is_multiple){if(!this.active_field)return setTimeout(function(){return b.container_mousedown()},50)}else if(!this.active_field)return this.activate_field()},AbstractChosen.prototype.input_blur=function(a){var b=this;return this.mouse_on_container?void 0:(this.active_field=!1,setTimeout(function(){return b.blur_test()},100))},AbstractChosen.prototype.results_option_build=function(a){var b,c,d,e,f,g,h;for(b="",e=0,h=this.results_data,f=0,g=h.length;g>f&&(c=h[f],d="",d=c.group?this.result_add_group(c):this.result_add_option(c),""!==d&&(e++,b+=d),(null!=a?a.first:void 0)&&(c.selected&&this.is_multiple?this.choice_build(c):c.selected&&!this.is_multiple&&this.single_set_selected_text(this.choice_label(c))),!(e>=this.max_shown_results));f++);return b},AbstractChosen.prototype.result_add_option=function(a){var b,c;return a.search_match&&this.include_option_in_results(a)?(b=[],a.disabled||a.selected&&this.is_multiple||b.push("active-result"),!a.disabled||a.selected&&this.is_multiple||b.push("disabled-result"),a.selected&&b.push("result-selected"),null!=a.group_array_index&&b.push("group-option"),""!==a.classes&&b.push(a.classes),c=document.createElement("li"),c.className=b.join(" "),c.style.cssText=a.style,c.setAttribute("data-option-array-index",a.array_index),c.innerHTML=a.search_text,a.title&&(c.title=a.title),this.outerHTML(c)):""},AbstractChosen.prototype.result_add_group=function(a){var b,c;return(a.search_match||a.group_match)&&a.active_options>0?(b=[],b.push("group-result"),a.classes&&b.push(a.classes),c=document.createElement("li"),c.className=b.join(" "),c.innerHTML=a.search_text,a.title&&(c.title=a.title),this.outerHTML(c)):""},AbstractChosen.prototype.results_update_field=function(){return this.set_default_text(),this.is_multiple||this.results_reset_cleanup(),this.result_clear_highlight(),this.results_build(),this.results_showing?this.winnow_results():void 0},AbstractChosen.prototype.reset_single_select_options=function(){var a,b,c,d,e;for(d=this.results_data,e=[],b=0,c=d.length;c>b;b++)a=d[b],a.selected?e.push(a.selected=!1):e.push(void 0);return e},AbstractChosen.prototype.results_toggle=function(){return this.results_showing?this.results_hide():this.results_show()},AbstractChosen.prototype.results_search=function(a){return this.results_showing?this.winnow_results():this.results_show()},AbstractChosen.prototype.winnow_results=function(){var a,b,c,d,e,f,g,h,i,j,k,l;for(this.no_results_clear(),d=0,f=this.get_search_text(),a=f.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),i=new RegExp(a,"i"),c=this.get_search_regex(a),l=this.results_data,j=0,k=l.length;k>j;j++)b=l[j],b.search_match=!1,e=null,this.include_option_in_results(b)&&(b.group&&(b.group_match=!1,b.active_options=0),null!=b.group_array_index&&this.results_data[b.group_array_index]&&(e=this.results_data[b.group_array_index],0===e.active_options&&e.search_match&&(d+=1),e.active_options+=1),b.search_text=b.group?b.label:b.html,(!b.group||this.group_search)&&(b.search_match=this.search_string_match(b.search_text,c),b.search_match&&!b.group&&(d+=1),b.search_match?(f.length&&(g=b.search_text.search(i),h=b.search_text.substr(0,g+f.length)+"</em>"+b.search_text.substr(g+f.length),b.search_text=h.substr(0,g)+"<em>"+h.substr(g)),null!=e&&(e.group_match=!0)):null!=b.group_array_index&&this.results_data[b.group_array_index].search_match&&(b.search_match=!0)));return this.result_clear_highlight(),1>d&&f.length?(this.update_results_content(""),this.no_results(f)):(this.update_results_content(this.results_option_build()),this.winnow_results_set_highlight())},AbstractChosen.prototype.get_search_regex=function(a){var b;return b=this.search_contains?"":"^",new RegExp(b+a,"i")},AbstractChosen.prototype.search_string_match=function(a,b){var c,d,e,f;if(b.test(a))return!0;if(this.enable_split_word_search&&(a.indexOf(" ")>=0||0===a.indexOf("["))&&(d=a.replace(/\[|\]/g,"").split(" "),d.length))for(e=0,f=d.length;f>e;e++)if(c=d[e],b.test(c))return!0},AbstractChosen.prototype.choices_count=function(){var a,b,c,d;if(null!=this.selected_option_count)return this.selected_option_count;for(this.selected_option_count=0,d=this.form_field.options,b=0,c=d.length;c>b;b++)a=d[b],a.selected&&(this.selected_option_count+=1);return this.selected_option_count},AbstractChosen.prototype.choices_click=function(a){return a.preventDefault(),this.results_showing||this.is_disabled?void 0:this.results_show()},AbstractChosen.prototype.keyup_checker=function(a){var b,c;switch(b=null!=(c=a.which)?c:a.keyCode,this.search_field_scale(),b){case 8:if(this.is_multiple&&this.backstroke_length<1&&this.choices_count()>0)return this.keydown_backstroke();if(!this.pending_backstroke)return this.result_clear_highlight(),this.results_search();break;case 13:if(a.preventDefault(),this.results_showing)return this.result_select(a);break;case 27:return this.results_showing&&this.results_hide(),!0;case 9:case 38:case 40:case 16:case 91:case 17:case 18:break;default:return this.results_search()}},AbstractChosen.prototype.clipboard_event_checker=function(a){var b=this;return setTimeout(function(){return b.results_search()},50)},AbstractChosen.prototype.container_width=function(){return null!=this.options.width?this.options.width:""+this.form_field.offsetWidth+"px"},AbstractChosen.prototype.include_option_in_results=function(a){return this.is_multiple&&!this.display_selected_options&&a.selected?!1:!this.display_disabled_options&&a.disabled?!1:a.empty?!1:!0},AbstractChosen.prototype.search_results_touchstart=function(a){return this.touch_started=!0,this.search_results_mouseover(a)},AbstractChosen.prototype.search_results_touchmove=function(a){return this.touch_started=!1,this.search_results_mouseout(a)},AbstractChosen.prototype.search_results_touchend=function(a){return this.touch_started?this.search_results_mouseup(a):void 0},AbstractChosen.prototype.outerHTML=function(a){var b;return a.outerHTML?a.outerHTML:(b=document.createElement("div"),b.appendChild(a),b.innerHTML)},AbstractChosen.browser_is_supported=function(){return/iP(od|hone)/i.test(window.navigator.userAgent)?!1:/Android/i.test(window.navigator.userAgent)&&/Mobile/i.test(window.navigator.userAgent)?!1:/IEMobile/i.test(window.navigator.userAgent)?!1:/Windows Phone/i.test(window.navigator.userAgent)?!1:/BlackBerry/i.test(window.navigator.userAgent)?!1:/BB10/i.test(window.navigator.userAgent)?!1:"Microsoft Internet Explorer"===window.navigator.appName?document.documentMode>=8:!0},AbstractChosen.default_multiple_text="Select Some Options",AbstractChosen.default_single_text="Select an Option",AbstractChosen.default_no_result_text="No results match",AbstractChosen}(),a=jQuery,a.fn.extend({chosen:function(b){return AbstractChosen.browser_is_supported()?this.each(function(c){var d,e;return d=a(this),e=d.data("chosen"),"destroy"===b?void(e instanceof Chosen&&e.destroy()):void(e instanceof Chosen||d.data("chosen",new Chosen(this,b)))}):this}}),Chosen=function(c){function Chosen(){return b=Chosen.__super__.constructor.apply(this,arguments)}return d(Chosen,c),Chosen.prototype.setup=function(){return this.form_field_jq=a(this.form_field),this.current_selectedIndex=this.form_field.selectedIndex,this.is_rtl=this.form_field_jq.hasClass("chosen-rtl")},Chosen.prototype.set_up_html=function(){var b,c;return b=["chosen-container"],b.push("chosen-container-"+(this.is_multiple?"multi":"single")),this.inherit_select_classes&&this.form_field.className&&b.push(this.form_field.className),this.is_rtl&&b.push("chosen-rtl"),c={"class":b.join(" "),style:"width: "+this.container_width()+";",title:this.form_field.title},this.form_field.id.length&&(c.id=this.form_field.id.replace(/[^\w]/g,"_")+"_chosen"),this.container=a("<div />",c),this.is_multiple?this.container.html('<ul class="chosen-choices"><li class="search-field"><input type="text" value="'+this.default_text+'" class="default" autocomplete="off" style="width:25px;" /></li></ul><div class="chosen-drop"><ul class="chosen-results"></ul></div>'):this.container.html('<a class="chosen-single chosen-default"><span>'+this.default_text+'</span><div><b></b></div></a><div class="chosen-drop"><div class="chosen-search"><input type="text" autocomplete="off" /></div><ul class="chosen-results"></ul></div>'),this.form_field_jq.hide().after(this.container),this.dropdown=this.container.find("div.chosen-drop").first(),this.search_field=this.container.find("input").first(),this.search_results=this.container.find("ul.chosen-results").first(),this.search_field_scale(),this.search_no_results=this.container.find("li.no-results").first(),this.is_multiple?(this.search_choices=this.container.find("ul.chosen-choices").first(),this.search_container=this.container.find("li.search-field").first()):(this.search_container=this.container.find("div.chosen-search").first(),this.selected_item=this.container.find(".chosen-single").first()),this.results_build(),this.set_tab_index(),this.set_label_behavior()},Chosen.prototype.on_ready=function(){return this.form_field_jq.trigger("chosen:ready",{chosen:this})},Chosen.prototype.register_observers=function(){var a=this;return this.container.bind("touchstart.chosen",function(b){return a.container_mousedown(b),b.preventDefault()}),this.container.bind("touchend.chosen",function(b){return a.container_mouseup(b),b.preventDefault()}),this.container.bind("mousedown.chosen",function(b){a.container_mousedown(b)}),this.container.bind("mouseup.chosen",function(b){a.container_mouseup(b)}),this.container.bind("mouseenter.chosen",function(b){a.mouse_enter(b)}),this.container.bind("mouseleave.chosen",function(b){a.mouse_leave(b)}),this.search_results.bind("mouseup.chosen",function(b){a.search_results_mouseup(b)}),this.search_results.bind("mouseover.chosen",function(b){a.search_results_mouseover(b)}),this.search_results.bind("mouseout.chosen",function(b){a.search_results_mouseout(b)}),this.search_results.bind("mousewheel.chosen DOMMouseScroll.chosen",function(b){a.search_results_mousewheel(b)}),this.search_results.bind("touchstart.chosen",function(b){a.search_results_touchstart(b)}),this.search_results.bind("touchmove.chosen",function(b){a.search_results_touchmove(b)}),this.search_results.bind("touchend.chosen",function(b){a.search_results_touchend(b)}),this.form_field_jq.bind("chosen:updated.chosen",function(b){a.results_update_field(b)}),this.form_field_jq.bind("chosen:activate.chosen",function(b){a.activate_field(b)}),this.form_field_jq.bind("chosen:open.chosen",function(b){a.container_mousedown(b)}),this.form_field_jq.bind("chosen:close.chosen",function(b){a.input_blur(b)}),this.search_field.bind("blur.chosen",function(b){a.input_blur(b)}),this.search_field.bind("keyup.chosen",function(b){a.keyup_checker(b)}),this.search_field.bind("keydown.chosen",function(b){a.keydown_checker(b)}),this.search_field.bind("focus.chosen",function(b){a.input_focus(b)}),this.search_field.bind("cut.chosen",function(b){a.clipboard_event_checker(b)}),this.search_field.bind("paste.chosen",function(b){a.clipboard_event_checker(b)}),this.is_multiple?this.search_choices.bind("click.chosen",function(b){a.choices_click(b)}):this.container.bind("click.chosen",function(a){a.preventDefault()})},Chosen.prototype.destroy=function(){return a(this.container[0].ownerDocument).unbind("click.chosen",this.click_test_action),this.search_field[0].tabIndex&&(this.form_field_jq[0].tabIndex=this.search_field[0].tabIndex),this.container.remove(),this.form_field_jq.removeData("chosen"),this.form_field_jq.show()},Chosen.prototype.search_field_disabled=function(){return this.is_disabled=this.form_field_jq[0].disabled,this.is_disabled?(this.container.addClass("chosen-disabled"),this.search_field[0].disabled=!0,this.is_multiple||this.selected_item.unbind("focus.chosen",this.activate_action),this.close_field()):(this.container.removeClass("chosen-disabled"),this.search_field[0].disabled=!1,this.is_multiple?void 0:this.selected_item.bind("focus.chosen",this.activate_action))},Chosen.prototype.container_mousedown=function(b){return this.is_disabled||(b&&"mousedown"===b.type&&!this.results_showing&&b.preventDefault(),null!=b&&a(b.target).hasClass("search-choice-close"))?void 0:(this.active_field?this.is_multiple||!b||a(b.target)[0]!==this.selected_item[0]&&!a(b.target).parents("a.chosen-single").length||(b.preventDefault(),this.results_toggle()):(this.is_multiple&&this.search_field.val(""),a(this.container[0].ownerDocument).bind("click.chosen",this.click_test_action),this.results_show()),this.activate_field())},Chosen.prototype.container_mouseup=function(a){return"ABBR"!==a.target.nodeName||this.is_disabled?void 0:this.results_reset(a)},Chosen.prototype.search_results_mousewheel=function(a){var b;return a.originalEvent&&(b=a.originalEvent.deltaY||-a.originalEvent.wheelDelta||a.originalEvent.detail),null!=b?(a.preventDefault(),"DOMMouseScroll"===a.type&&(b=40*b),this.search_results.scrollTop(b+this.search_results.scrollTop())):void 0},Chosen.prototype.blur_test=function(a){return!this.active_field&&this.container.hasClass("chosen-container-active")?this.close_field():void 0},Chosen.prototype.close_field=function(){return a(this.container[0].ownerDocument).unbind("click.chosen",this.click_test_action),this.active_field=!1,this.results_hide(),this.container.removeClass("chosen-container-active"),this.clear_backstroke(),this.show_search_field_default(),this.search_field_scale()},Chosen.prototype.activate_field=function(){return this.container.addClass("chosen-container-active"),this.active_field=!0,this.search_field.val(this.search_field.val()),this.search_field.focus()},Chosen.prototype.test_active_click=function(b){var c;return c=a(b.target).closest(".chosen-container"),c.length&&this.container[0]===c[0]?this.active_field=!0:this.close_field()},Chosen.prototype.results_build=function(){return this.parsing=!0,this.selected_option_count=null,this.results_data=SelectParser.select_to_array(this.form_field),this.is_multiple?this.search_choices.find("li.search-choice").remove():this.is_multiple||(this.single_set_selected_text(),this.disable_search||this.form_field.options.length<=this.disable_search_threshold?(this.search_field[0].readOnly=!0,this.container.addClass("chosen-container-single-nosearch")):(this.search_field[0].readOnly=!1,this.container.removeClass("chosen-container-single-nosearch"))),this.update_results_content(this.results_option_build({first:!0})),this.search_field_disabled(),this.show_search_field_default(),this.search_field_scale(),this.parsing=!1},Chosen.prototype.result_do_highlight=function(a){var b,c,d,e,f;if(a.length){if(this.result_clear_highlight(),this.result_highlight=a,this.result_highlight.addClass("highlighted"),d=parseInt(this.search_results.css("maxHeight"),10),f=this.search_results.scrollTop(),e=d+f,c=this.result_highlight.position().top+this.search_results.scrollTop(),b=c+this.result_highlight.outerHeight(),b>=e)return this.search_results.scrollTop(b-d>0?b-d:0);if(f>c)return this.search_results.scrollTop(c)}},Chosen.prototype.result_clear_highlight=function(){return this.result_highlight&&this.result_highlight.removeClass("highlighted"),this.result_highlight=null},Chosen.prototype.results_show=function(){return this.is_multiple&&this.max_selected_options<=this.choices_count()?(this.form_field_jq.trigger("chosen:maxselected",{chosen:this}),!1):(this.container.addClass("chosen-with-drop"),this.results_showing=!0,this.search_field.focus(),this.search_field.val(this.search_field.val()),this.winnow_results(),this.form_field_jq.trigger("chosen:showing_dropdown",{chosen:this}))},Chosen.prototype.update_results_content=function(a){return this.search_results.html(a)},Chosen.prototype.results_hide=function(){return this.results_showing&&(this.result_clear_highlight(),this.container.removeClass("chosen-with-drop"),this.form_field_jq.trigger("chosen:hiding_dropdown",{chosen:this})),this.results_showing=!1},Chosen.prototype.set_tab_index=function(a){var b;return this.form_field.tabIndex?(b=this.form_field.tabIndex,this.form_field.tabIndex=-1,this.search_field[0].tabIndex=b):void 0},Chosen.prototype.set_label_behavior=function(){var b=this;return this.form_field_label=this.form_field_jq.parents("label"),!this.form_field_label.length&&this.form_field.id.length&&(this.form_field_label=a("label[for='"+this.form_field.id+"']")),this.form_field_label.length>0?this.form_field_label.bind("click.chosen",function(a){return b.is_multiple?b.container_mousedown(a):b.activate_field()}):void 0},Chosen.prototype.show_search_field_default=function(){return this.is_multiple&&this.choices_count()<1&&!this.active_field?(this.search_field.val(this.default_text),this.search_field.addClass("default")):(this.search_field.val(""),this.search_field.removeClass("default"))},Chosen.prototype.search_results_mouseup=function(b){var c;return c=a(b.target).hasClass("active-result")?a(b.target):a(b.target).parents(".active-result").first(),c.length?(this.result_highlight=c,this.result_select(b),this.search_field.focus()):void 0},Chosen.prototype.search_results_mouseover=function(b){var c;return c=a(b.target).hasClass("active-result")?a(b.target):a(b.target).parents(".active-result").first(),c?this.result_do_highlight(c):void 0},Chosen.prototype.search_results_mouseout=function(b){return a(b.target).hasClass("active-result")?this.result_clear_highlight():void 0},Chosen.prototype.choice_build=function(b){var c,d,e=this;return c=a("<li />",{"class":"search-choice"}).html("<span>"+this.choice_label(b)+"</span>"),b.disabled?c.addClass("search-choice-disabled"):(d=a("<a />",{"class":"search-choice-close","data-option-array-index":b.array_index}),d.bind("click.chosen",function(a){return e.choice_destroy_link_click(a)}),c.append(d)),this.search_container.before(c)},Chosen.prototype.choice_destroy_link_click=function(b){return b.preventDefault(),b.stopPropagation(),this.is_disabled?void 0:this.choice_destroy(a(b.target))},Chosen.prototype.choice_destroy=function(a){return this.result_deselect(a[0].getAttribute("data-option-array-index"))?(this.show_search_field_default(),this.is_multiple&&this.choices_count()>0&&this.search_field.val().length<1&&this.results_hide(),a.parents("li").first().remove(),this.search_field_scale()):void 0},Chosen.prototype.results_reset=function(){return this.reset_single_select_options(),this.form_field.options[0].selected=!0,this.single_set_selected_text(),this.show_search_field_default(),this.results_reset_cleanup(),this.form_field_jq.trigger("change"),this.active_field?this.results_hide():void 0},Chosen.prototype.results_reset_cleanup=function(){return this.current_selectedIndex=this.form_field.selectedIndex,this.selected_item.find("abbr").remove()},Chosen.prototype.result_select=function(a){var b,c;return this.result_highlight?(b=this.result_highlight,this.result_clear_highlight(),this.is_multiple&&this.max_selected_options<=this.choices_count()?(this.form_field_jq.trigger("chosen:maxselected",{chosen:this}),!1):(this.is_multiple?b.removeClass("active-result"):this.reset_single_select_options(),b.addClass("result-selected"),c=this.results_data[b[0].getAttribute("data-option-array-index")],c.selected=!0,this.form_field.options[c.options_index].selected=!0,this.selected_option_count=null,this.is_multiple?this.choice_build(c):this.single_set_selected_text(this.choice_label(c)),(a.metaKey||a.ctrlKey)&&this.is_multiple||this.results_hide(),this.show_search_field_default(),(this.is_multiple||this.form_field.selectedIndex!==this.current_selectedIndex)&&this.form_field_jq.trigger("change",{selected:this.form_field.options[c.options_index].value}),this.current_selectedIndex=this.form_field.selectedIndex,a.preventDefault(),this.search_field_scale())):void 0},Chosen.prototype.single_set_selected_text=function(a){return null==a&&(a=this.default_text),a===this.default_text?this.selected_item.addClass("chosen-default"):(this.single_deselect_control_build(),this.selected_item.removeClass("chosen-default")),this.selected_item.find("span").html(a)},Chosen.prototype.result_deselect=function(a){var b;return b=this.results_data[a],this.form_field.options[b.options_index].disabled?!1:(b.selected=!1,this.form_field.options[b.options_index].selected=!1,this.selected_option_count=null,this.result_clear_highlight(),this.results_showing&&this.winnow_results(),this.form_field_jq.trigger("change",{deselected:this.form_field.options[b.options_index].value}),this.search_field_scale(),!0)},Chosen.prototype.single_deselect_control_build=function(){return this.allow_single_deselect?(this.selected_item.find("abbr").length||this.selected_item.find("span").first().after('<abbr class="search-choice-close"></abbr>'),this.selected_item.addClass("chosen-single-with-deselect")):void 0},Chosen.prototype.get_search_text=function(){return a("<div/>").text(a.trim(this.search_field.val())).html()},Chosen.prototype.winnow_results_set_highlight=function(){var a,b;return b=this.is_multiple?[]:this.search_results.find(".result-selected.active-result"),a=b.length?b.first():this.search_results.find(".active-result").first(),null!=a?this.result_do_highlight(a):void 0},Chosen.prototype.no_results=function(b){var c;return c=a('<li class="no-results">'+this.results_none_found+' "<span></span>"</li>'),c.find("span").first().html(b),this.search_results.append(c),this.form_field_jq.trigger("chosen:no_results",{chosen:this})},Chosen.prototype.no_results_clear=function(){return this.search_results.find(".no-results").remove()},Chosen.prototype.keydown_arrow=function(){var a;return this.results_showing&&this.result_highlight?(a=this.result_highlight.nextAll("li.active-result").first())?this.result_do_highlight(a):void 0:this.results_show()},Chosen.prototype.keyup_arrow=function(){var a;return this.results_showing||this.is_multiple?this.result_highlight?(a=this.result_highlight.prevAll("li.active-result"),a.length?this.result_do_highlight(a.first()):(this.choices_count()>0&&this.results_hide(),this.result_clear_highlight())):void 0:this.results_show()},Chosen.prototype.keydown_backstroke=function(){var a;return this.pending_backstroke?(this.choice_destroy(this.pending_backstroke.find("a").first()),this.clear_backstroke()):(a=this.search_container.siblings("li.search-choice").last(),a.length&&!a.hasClass("search-choice-disabled")?(this.pending_backstroke=a,this.single_backstroke_delete?this.keydown_backstroke():this.pending_backstroke.addClass("search-choice-focus")):void 0)},Chosen.prototype.clear_backstroke=function(){return this.pending_backstroke&&this.pending_backstroke.removeClass("search-choice-focus"),this.pending_backstroke=null},Chosen.prototype.keydown_checker=function(a){var b,c;switch(b=null!=(c=a.which)?c:a.keyCode,this.search_field_scale(),8!==b&&this.pending_backstroke&&this.clear_backstroke(),b){case 8:this.backstroke_length=this.search_field.val().length;break;case 9:this.results_showing&&!this.is_multiple&&this.result_select(a),this.mouse_on_container=!1;break;case 13:this.results_showing&&a.preventDefault();break;case 32:this.disable_search&&a.preventDefault();break;case 38:a.preventDefault(),this.keyup_arrow();break;case 40:a.preventDefault(),this.keydown_arrow()}},Chosen.prototype.search_field_scale=function(){var b,c,d,e,f,g,h,i,j;if(this.is_multiple){for(d=0,h=0,f="position:absolute; left: -1000px; top: -1000px; display:none;",g=["font-size","font-style","font-weight","font-family","line-height","text-transform","letter-spacing"],i=0,j=g.length;j>i;i++)e=g[i],f+=e+":"+this.search_field.css(e)+";";return b=a("<div />",{style:f}),b.text(this.search_field.val()),a("body").append(b),h=b.width()+25,b.remove(),c=this.container.outerWidth(),h>c-10&&(h=c-10),this.search_field.css({width:h+"px"})}},Chosen}(AbstractChosen)}).call(this);
 
1
+ /* Chosen v1.8.7 | (c) 2011-2019 by Harvest | MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md */
2
+
3
+ (function(){var t,e,s,i,n=function(t,e){return function(){return t.apply(e,arguments)}},r=function(t,e){function s(){this.constructor=t}for(var i in e)o.call(e,i)&&(t[i]=e[i]);return s.prototype=e.prototype,t.prototype=new s,t.__super__=e.prototype,t},o={}.hasOwnProperty;(i=function(){function t(){this.options_index=0,this.parsed=[]}return t.prototype.add_node=function(t){return"OPTGROUP"===t.nodeName.toUpperCase()?this.add_group(t):this.add_option(t)},t.prototype.add_group=function(t){var e,s,i,n,r,o;for(e=this.parsed.length,this.parsed.push({array_index:e,group:!0,label:t.label,title:t.title?t.title:void 0,children:0,disabled:t.disabled,classes:t.className}),o=[],s=0,i=(r=t.childNodes).length;s<i;s++)n=r[s],o.push(this.add_option(n,e,t.disabled));return o},t.prototype.add_option=function(t,e,s){if("OPTION"===t.nodeName.toUpperCase())return""!==t.text?(null!=e&&(this.parsed[e].children+=1),this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,value:t.value,text:t.text,html:t.innerHTML,title:t.title?t.title:void 0,selected:t.selected,disabled:!0===s?s:t.disabled,group_array_index:e,group_label:null!=e?this.parsed[e].label:null,classes:t.className,style:t.style.cssText})):this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,empty:!0}),this.options_index+=1},t}()).select_to_array=function(t){var e,s,n,r,o;for(r=new i,s=0,n=(o=t.childNodes).length;s<n;s++)e=o[s],r.add_node(e);return r.parsed},e=function(){function t(e,s){this.form_field=e,this.options=null!=s?s:{},this.label_click_handler=n(this.label_click_handler,this),t.browser_is_supported()&&(this.is_multiple=this.form_field.multiple,this.set_default_text(),this.set_default_values(),this.setup(),this.set_up_html(),this.register_observers(),this.on_ready())}return t.prototype.set_default_values=function(){return this.click_test_action=function(t){return function(e){return t.test_active_click(e)}}(this),this.activate_action=function(t){return function(e){return t.activate_field(e)}}(this),this.active_field=!1,this.mouse_on_container=!1,this.results_showing=!1,this.result_highlighted=null,this.is_rtl=this.options.rtl||/\bchosen-rtl\b/.test(this.form_field.className),this.allow_single_deselect=null!=this.options.allow_single_deselect&&null!=this.form_field.options[0]&&""===this.form_field.options[0].text&&this.options.allow_single_deselect,this.disable_search_threshold=this.options.disable_search_threshold||0,this.disable_search=this.options.disable_search||!1,this.enable_split_word_search=null==this.options.enable_split_word_search||this.options.enable_split_word_search,this.group_search=null==this.options.group_search||this.options.group_search,this.search_contains=this.options.search_contains||!1,this.single_backstroke_delete=null==this.options.single_backstroke_delete||this.options.single_backstroke_delete,this.max_selected_options=this.options.max_selected_options||Infinity,this.inherit_select_classes=this.options.inherit_select_classes||!1,this.display_selected_options=null==this.options.display_selected_options||this.options.display_selected_options,this.display_disabled_options=null==this.options.display_disabled_options||this.options.display_disabled_options,this.include_group_label_in_selected=this.options.include_group_label_in_selected||!1,this.max_shown_results=this.options.max_shown_results||Number.POSITIVE_INFINITY,this.case_sensitive_search=this.options.case_sensitive_search||!1,this.hide_results_on_select=null==this.options.hide_results_on_select||this.options.hide_results_on_select},t.prototype.set_default_text=function(){return this.form_field.getAttribute("data-placeholder")?this.default_text=this.form_field.getAttribute("data-placeholder"):this.is_multiple?this.default_text=this.options.placeholder_text_multiple||this.options.placeholder_text||t.default_multiple_text:this.default_text=this.options.placeholder_text_single||this.options.placeholder_text||t.default_single_text,this.default_text=this.escape_html(this.default_text),this.results_none_found=this.form_field.getAttribute("data-no_results_text")||this.options.no_results_text||t.default_no_result_text},t.prototype.choice_label=function(t){return this.include_group_label_in_selected&&null!=t.group_label?"<b class='group-name'>"+this.escape_html(t.group_label)+"</b>"+t.html:t.html},t.prototype.mouse_enter=function(){return this.mouse_on_container=!0},t.prototype.mouse_leave=function(){return this.mouse_on_container=!1},t.prototype.input_focus=function(t){if(this.is_multiple){if(!this.active_field)return setTimeout(function(t){return function(){return t.container_mousedown()}}(this),50)}else if(!this.active_field)return this.activate_field()},t.prototype.input_blur=function(t){if(!this.mouse_on_container)return this.active_field=!1,setTimeout(function(t){return function(){return t.blur_test()}}(this),100)},t.prototype.label_click_handler=function(t){return this.is_multiple?this.container_mousedown(t):this.activate_field()},t.prototype.results_option_build=function(t){var e,s,i,n,r,o,h;for(e="",h=0,n=0,r=(o=this.results_data).length;n<r&&(s=o[n],i="",""!==(i=s.group?this.result_add_group(s):this.result_add_option(s))&&(h++,e+=i),(null!=t?t.first:void 0)&&(s.selected&&this.is_multiple?this.choice_build(s):s.selected&&!this.is_multiple&&this.single_set_selected_text(this.choice_label(s))),!(h>=this.max_shown_results));n++);return e},t.prototype.result_add_option=function(t){var e,s;return t.search_match&&this.include_option_in_results(t)?(e=[],t.disabled||t.selected&&this.is_multiple||e.push("active-result"),!t.disabled||t.selected&&this.is_multiple||e.push("disabled-result"),t.selected&&e.push("result-selected"),null!=t.group_array_index&&e.push("group-option"),""!==t.classes&&e.push(t.classes),s=document.createElement("li"),s.className=e.join(" "),t.style&&(s.style.cssText=t.style),s.setAttribute("data-option-array-index",t.array_index),s.innerHTML=t.highlighted_html||t.html,t.title&&(s.title=t.title),this.outerHTML(s)):""},t.prototype.result_add_group=function(t){var e,s;return(t.search_match||t.group_match)&&t.active_options>0?((e=[]).push("group-result"),t.classes&&e.push(t.classes),s=document.createElement("li"),s.className=e.join(" "),s.innerHTML=t.highlighted_html||this.escape_html(t.label),t.title&&(s.title=t.title),this.outerHTML(s)):""},t.prototype.results_update_field=function(){if(this.set_default_text(),this.is_multiple||this.results_reset_cleanup(),this.result_clear_highlight(),this.results_build(),this.results_showing)return this.winnow_results()},t.prototype.reset_single_select_options=function(){var t,e,s,i,n;for(n=[],t=0,e=(s=this.results_data).length;t<e;t++)(i=s[t]).selected?n.push(i.selected=!1):n.push(void 0);return n},t.prototype.results_toggle=function(){return this.results_showing?this.results_hide():this.results_show()},t.prototype.results_search=function(t){return this.results_showing?this.winnow_results():this.results_show()},t.prototype.winnow_results=function(t){var e,s,i,n,r,o,h,l,c,_,a,u,d,p,f;for(this.no_results_clear(),_=0,e=(h=this.get_search_text()).replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),c=this.get_search_regex(e),i=0,n=(l=this.results_data).length;i<n;i++)(r=l[i]).search_match=!1,a=null,u=null,r.highlighted_html="",this.include_option_in_results(r)&&(r.group&&(r.group_match=!1,r.active_options=0),null!=r.group_array_index&&this.results_data[r.group_array_index]&&(0===(a=this.results_data[r.group_array_index]).active_options&&a.search_match&&(_+=1),a.active_options+=1),f=r.group?r.label:r.text,r.group&&!this.group_search||(u=this.search_string_match(f,c),r.search_match=null!=u,r.search_match&&!r.group&&(_+=1),r.search_match?(h.length&&(d=u.index,o=f.slice(0,d),s=f.slice(d,d+h.length),p=f.slice(d+h.length),r.highlighted_html=this.escape_html(o)+"<em>"+this.escape_html(s)+"</em>"+this.escape_html(p)),null!=a&&(a.group_match=!0)):null!=r.group_array_index&&this.results_data[r.group_array_index].search_match&&(r.search_match=!0)));return this.result_clear_highlight(),_<1&&h.length?(this.update_results_content(""),this.no_results(h)):(this.update_results_content(this.results_option_build()),(null!=t?t.skip_highlight:void 0)?void 0:this.winnow_results_set_highlight())},t.prototype.get_search_regex=function(t){var e,s;return s=this.search_contains?t:"(^|\\s|\\b)"+t+"[^\\s]*",this.enable_split_word_search||this.search_contains||(s="^"+s),e=this.case_sensitive_search?"":"i",new RegExp(s,e)},t.prototype.search_string_match=function(t,e){var s;return s=e.exec(t),!this.search_contains&&(null!=s?s[1]:void 0)&&(s.index+=1),s},t.prototype.choices_count=function(){var t,e,s;if(null!=this.selected_option_count)return this.selected_option_count;for(this.selected_option_count=0,t=0,e=(s=this.form_field.options).length;t<e;t++)s[t].selected&&(this.selected_option_count+=1);return this.selected_option_count},t.prototype.choices_click=function(t){if(t.preventDefault(),this.activate_field(),!this.results_showing&&!this.is_disabled)return this.results_show()},t.prototype.keydown_checker=function(t){var e,s;switch(s=null!=(e=t.which)?e:t.keyCode,this.search_field_scale(),8!==s&&this.pending_backstroke&&this.clear_backstroke(),s){case 8:this.backstroke_length=this.get_search_field_value().length;break;case 9:this.results_showing&&!this.is_multiple&&this.result_select(t),this.mouse_on_container=!1;break;case 13:case 27:this.results_showing&&t.preventDefault();break;case 32:this.disable_search&&t.preventDefault();break;case 38:t.preventDefault(),this.keyup_arrow();break;case 40:t.preventDefault(),this.keydown_arrow()}},t.prototype.keyup_checker=function(t){var e,s;switch(s=null!=(e=t.which)?e:t.keyCode,this.search_field_scale(),s){case 8:this.is_multiple&&this.backstroke_length<1&&this.choices_count()>0?this.keydown_backstroke():this.pending_backstroke||(this.result_clear_highlight(),this.results_search());break;case 13:t.preventDefault(),this.results_showing&&this.result_select(t);break;case 27:this.results_showing&&this.results_hide();break;case 9:case 16:case 17:case 18:case 38:case 40:case 91:break;default:this.results_search()}},t.prototype.clipboard_event_checker=function(t){if(!this.is_disabled)return setTimeout(function(t){return function(){return t.results_search()}}(this),50)},t.prototype.container_width=function(){return null!=this.options.width?this.options.width:this.form_field.offsetWidth+"px"},t.prototype.include_option_in_results=function(t){return!(this.is_multiple&&!this.display_selected_options&&t.selected)&&(!(!this.display_disabled_options&&t.disabled)&&!t.empty)},t.prototype.search_results_touchstart=function(t){return this.touch_started=!0,this.search_results_mouseover(t)},t.prototype.search_results_touchmove=function(t){return this.touch_started=!1,this.search_results_mouseout(t)},t.prototype.search_results_touchend=function(t){if(this.touch_started)return this.search_results_mouseup(t)},t.prototype.outerHTML=function(t){var e;return t.outerHTML?t.outerHTML:((e=document.createElement("div")).appendChild(t),e.innerHTML)},t.prototype.get_single_html=function(){return'<a class="chosen-single chosen-default">\n <span>'+this.default_text+'</span>\n <div><b></b></div>\n</a>\n<div class="chosen-drop">\n <div class="chosen-search">\n <input class="chosen-search-input" type="text" autocomplete="off" />\n </div>\n <ul class="chosen-results"></ul>\n</div>'},t.prototype.get_multi_html=function(){return'<ul class="chosen-choices">\n <li class="search-field">\n <input class="chosen-search-input" type="text" autocomplete="off" value="'+this.default_text+'" />\n </li>\n</ul>\n<div class="chosen-drop">\n <ul class="chosen-results"></ul>\n</div>'},t.prototype.get_no_results_html=function(t){return'<li class="no-results">\n '+this.results_none_found+" <span>"+this.escape_html(t)+"</span>\n</li>"},t.browser_is_supported=function(){return"Microsoft Internet Explorer"===window.navigator.appName?document.documentMode>=8:!(/iP(od|hone)/i.test(window.navigator.userAgent)||/IEMobile/i.test(window.navigator.userAgent)||/Windows Phone/i.test(window.navigator.userAgent)||/BlackBerry/i.test(window.navigator.userAgent)||/BB10/i.test(window.navigator.userAgent)||/Android.*Mobile/i.test(window.navigator.userAgent))},t.default_multiple_text="Select Some Options",t.default_single_text="Select an Option",t.default_no_result_text="No results match",t}(),(t=jQuery).fn.extend({chosen:function(i){return e.browser_is_supported()?this.each(function(e){var n,r;r=(n=t(this)).data("chosen"),"destroy"!==i?r instanceof s||n.data("chosen",new s(this,i)):r instanceof s&&r.destroy()}):this}}),s=function(s){function n(){return n.__super__.constructor.apply(this,arguments)}return r(n,e),n.prototype.setup=function(){return this.form_field_jq=t(this.form_field),this.current_selectedIndex=this.form_field.selectedIndex},n.prototype.set_up_html=function(){var e,s;return(e=["chosen-container"]).push("chosen-container-"+(this.is_multiple?"multi":"single")),this.inherit_select_classes&&this.form_field.className&&e.push(this.form_field.className),this.is_rtl&&e.push("chosen-rtl"),s={"class":e.join(" "),title:this.form_field.title},this.form_field.id.length&&(s.id=this.form_field.id.replace(/[^\w]/g,"_")+"_chosen"),this.container=t("<div />",s),this.container.width(this.container_width()),this.is_multiple?this.container.html(this.get_multi_html()):this.container.html(this.get_single_html()),this.form_field_jq.hide().after(this.container),this.dropdown=this.container.find("div.chosen-drop").first(),this.search_field=this.container.find("input").first(),this.search_results=this.container.find("ul.chosen-results").first(),this.search_field_scale(),this.search_no_results=this.container.find("li.no-results").first(),this.is_multiple?(this.search_choices=this.container.find("ul.chosen-choices").first(),this.search_container=this.container.find("li.search-field").first()):(this.search_container=this.container.find("div.chosen-search").first(),this.selected_item=this.container.find(".chosen-single").first()),this.results_build(),this.set_tab_index(),this.set_label_behavior()},n.prototype.on_ready=function(){return this.form_field_jq.trigger("chosen:ready",{chosen:this})},n.prototype.register_observers=function(){return this.container.on("touchstart.chosen",function(t){return function(e){t.container_mousedown(e)}}(this)),this.container.on("touchend.chosen",function(t){return function(e){t.container_mouseup(e)}}(this)),this.container.on("mousedown.chosen",function(t){return function(e){t.container_mousedown(e)}}(this)),this.container.on("mouseup.chosen",function(t){return function(e){t.container_mouseup(e)}}(this)),this.container.on("mouseenter.chosen",function(t){return function(e){t.mouse_enter(e)}}(this)),this.container.on("mouseleave.chosen",function(t){return function(e){t.mouse_leave(e)}}(this)),this.search_results.on("mouseup.chosen",function(t){return function(e){t.search_results_mouseup(e)}}(this)),this.search_results.on("mouseover.chosen",function(t){return function(e){t.search_results_mouseover(e)}}(this)),this.search_results.on("mouseout.chosen",function(t){return function(e){t.search_results_mouseout(e)}}(this)),this.search_results.on("mousewheel.chosen DOMMouseScroll.chosen",function(t){return function(e){t.search_results_mousewheel(e)}}(this)),this.search_results.on("touchstart.chosen",function(t){return function(e){t.search_results_touchstart(e)}}(this)),this.search_results.on("touchmove.chosen",function(t){return function(e){t.search_results_touchmove(e)}}(this)),this.search_results.on("touchend.chosen",function(t){return function(e){t.search_results_touchend(e)}}(this)),this.form_field_jq.on("chosen:updated.chosen",function(t){return function(e){t.results_update_field(e)}}(this)),this.form_field_jq.on("chosen:activate.chosen",function(t){return function(e){t.activate_field(e)}}(this)),this.form_field_jq.on("chosen:open.chosen",function(t){return function(e){t.container_mousedown(e)}}(this)),this.form_field_jq.on("chosen:close.chosen",function(t){return function(e){t.close_field(e)}}(this)),this.search_field.on("blur.chosen",function(t){return function(e){t.input_blur(e)}}(this)),this.search_field.on("keyup.chosen",function(t){return function(e){t.keyup_checker(e)}}(this)),this.search_field.on("keydown.chosen",function(t){return function(e){t.keydown_checker(e)}}(this)),this.search_field.on("focus.chosen",function(t){return function(e){t.input_focus(e)}}(this)),this.search_field.on("cut.chosen",function(t){return function(e){t.clipboard_event_checker(e)}}(this)),this.search_field.on("paste.chosen",function(t){return function(e){t.clipboard_event_checker(e)}}(this)),this.is_multiple?this.search_choices.on("click.chosen",function(t){return function(e){t.choices_click(e)}}(this)):this.container.on("click.chosen",function(t){t.preventDefault()})},n.prototype.destroy=function(){return t(this.container[0].ownerDocument).off("click.chosen",this.click_test_action),this.form_field_label.length>0&&this.form_field_label.off("click.chosen"),this.search_field[0].tabIndex&&(this.form_field_jq[0].tabIndex=this.search_field[0].tabIndex),this.container.remove(),this.form_field_jq.removeData("chosen"),this.form_field_jq.show()},n.prototype.search_field_disabled=function(){return this.is_disabled=this.form_field.disabled||this.form_field_jq.parents("fieldset").is(":disabled"),this.container.toggleClass("chosen-disabled",this.is_disabled),this.search_field[0].disabled=this.is_disabled,this.is_multiple||this.selected_item.off("focus.chosen",this.activate_field),this.is_disabled?this.close_field():this.is_multiple?void 0:this.selected_item.on("focus.chosen",this.activate_field)},n.prototype.container_mousedown=function(e){var s;if(!this.is_disabled)return!e||"mousedown"!==(s=e.type)&&"touchstart"!==s||this.results_showing||e.preventDefault(),null!=e&&t(e.target).hasClass("search-choice-close")?void 0:(this.active_field?this.is_multiple||!e||t(e.target)[0]!==this.selected_item[0]&&!t(e.target).parents("a.chosen-single").length||(e.preventDefault(),this.results_toggle()):(this.is_multiple&&this.search_field.val(""),t(this.container[0].ownerDocument).on("click.chosen",this.click_test_action),this.results_show()),this.activate_field())},n.prototype.container_mouseup=function(t){if("ABBR"===t.target.nodeName&&!this.is_disabled)return this.results_reset(t)},n.prototype.search_results_mousewheel=function(t){var e;if(t.originalEvent&&(e=t.originalEvent.deltaY||-t.originalEvent.wheelDelta||t.originalEvent.detail),null!=e)return t.preventDefault(),"DOMMouseScroll"===t.type&&(e*=40),this.search_results.scrollTop(e+this.search_results.scrollTop())},n.prototype.blur_test=function(t){if(!this.active_field&&this.container.hasClass("chosen-container-active"))return this.close_field()},n.prototype.close_field=function(){return t(this.container[0].ownerDocument).off("click.chosen",this.click_test_action),this.active_field=!1,this.results_hide(),this.container.removeClass("chosen-container-active"),this.clear_backstroke(),this.show_search_field_default(),this.search_field_scale(),this.search_field.blur()},n.prototype.activate_field=function(){if(!this.is_disabled)return this.container.addClass("chosen-container-active"),this.active_field=!0,this.search_field.val(this.search_field.val()),this.search_field.focus()},n.prototype.test_active_click=function(e){var s;return(s=t(e.target).closest(".chosen-container")).length&&this.container[0]===s[0]?this.active_field=!0:this.close_field()},n.prototype.results_build=function(){return this.parsing=!0,this.selected_option_count=null,this.results_data=i.select_to_array(this.form_field),this.is_multiple?this.search_choices.find("li.search-choice").remove():(this.single_set_selected_text(),this.disable_search||this.form_field.options.length<=this.disable_search_threshold?(this.search_field[0].readOnly=!0,this.container.addClass("chosen-container-single-nosearch")):(this.search_field[0].readOnly=!1,this.container.removeClass("chosen-container-single-nosearch"))),this.update_results_content(this.results_option_build({first:!0})),this.search_field_disabled(),this.show_search_field_default(),this.search_field_scale(),this.parsing=!1},n.prototype.result_do_highlight=function(t){var e,s,i,n,r;if(t.length){if(this.result_clear_highlight(),this.result_highlight=t,this.result_highlight.addClass("highlighted"),i=parseInt(this.search_results.css("maxHeight"),10),r=this.search_results.scrollTop(),n=i+r,s=this.result_highlight.position().top+this.search_results.scrollTop(),(e=s+this.result_highlight.outerHeight())>=n)return this.search_results.scrollTop(e-i>0?e-i:0);if(s<r)return this.search_results.scrollTop(s)}},n.prototype.result_clear_highlight=function(){return this.result_highlight&&this.result_highlight.removeClass("highlighted"),this.result_highlight=null},n.prototype.results_show=function(){return this.is_multiple&&this.max_selected_options<=this.choices_count()?(this.form_field_jq.trigger("chosen:maxselected",{chosen:this}),!1):(this.container.addClass("chosen-with-drop"),this.results_showing=!0,this.search_field.focus(),this.search_field.val(this.get_search_field_value()),this.winnow_results(),this.form_field_jq.trigger("chosen:showing_dropdown",{chosen:this}))},n.prototype.update_results_content=function(t){return this.search_results.html(t)},n.prototype.results_hide=function(){return this.results_showing&&(this.result_clear_highlight(),this.container.removeClass("chosen-with-drop"),this.form_field_jq.trigger("chosen:hiding_dropdown",{chosen:this})),this.results_showing=!1},n.prototype.set_tab_index=function(t){var e;if(this.form_field.tabIndex)return e=this.form_field.tabIndex,this.form_field.tabIndex=-1,this.search_field[0].tabIndex=e},n.prototype.set_label_behavior=function(){if(this.form_field_label=this.form_field_jq.parents("label"),!this.form_field_label.length&&this.form_field.id.length&&(this.form_field_label=t("label[for='"+this.form_field.id+"']")),this.form_field_label.length>0)return this.form_field_label.on("click.chosen",this.label_click_handler)},n.prototype.show_search_field_default=function(){return this.is_multiple&&this.choices_count()<1&&!this.active_field?(this.search_field.val(this.default_text),this.search_field.addClass("default")):(this.search_field.val(""),this.search_field.removeClass("default"))},n.prototype.search_results_mouseup=function(e){var s;if((s=t(e.target).hasClass("active-result")?t(e.target):t(e.target).parents(".active-result").first()).length)return this.result_highlight=s,this.result_select(e),this.search_field.focus()},n.prototype.search_results_mouseover=function(e){var s;if(s=t(e.target).hasClass("active-result")?t(e.target):t(e.target).parents(".active-result").first())return this.result_do_highlight(s)},n.prototype.search_results_mouseout=function(e){if(t(e.target).hasClass("active-result")||t(e.target).parents(".active-result").first())return this.result_clear_highlight()},n.prototype.choice_build=function(e){var s,i;return s=t("<li />",{"class":"search-choice"}).html("<span>"+this.choice_label(e)+"</span>"),e.disabled?s.addClass("search-choice-disabled"):((i=t("<a />",{"class":"search-choice-close","data-option-array-index":e.array_index})).on("click.chosen",function(t){return function(e){return t.choice_destroy_link_click(e)}}(this)),s.append(i)),this.search_container.before(s)},n.prototype.choice_destroy_link_click=function(e){if(e.preventDefault(),e.stopPropagation(),!this.is_disabled)return this.choice_destroy(t(e.target))},n.prototype.choice_destroy=function(t){if(this.result_deselect(t[0].getAttribute("data-option-array-index")))return this.active_field?this.search_field.focus():this.show_search_field_default(),this.is_multiple&&this.choices_count()>0&&this.get_search_field_value().length<1&&this.results_hide(),t.parents("li").first().remove(),this.search_field_scale()},n.prototype.results_reset=function(){if(this.reset_single_select_options(),this.form_field.options[0].selected=!0,this.single_set_selected_text(),this.show_search_field_default(),this.results_reset_cleanup(),this.trigger_form_field_change(),this.active_field)return this.results_hide()},n.prototype.results_reset_cleanup=function(){return this.current_selectedIndex=this.form_field.selectedIndex,this.selected_item.find("abbr").remove()},n.prototype.result_select=function(t){var e,s;if(this.result_highlight)return e=this.result_highlight,this.result_clear_highlight(),this.is_multiple&&this.max_selected_options<=this.choices_count()?(this.form_field_jq.trigger("chosen:maxselected",{chosen:this}),!1):(this.is_multiple?e.removeClass("active-result"):this.reset_single_select_options(),e.addClass("result-selected"),s=this.results_data[e[0].getAttribute("data-option-array-index")],s.selected=!0,this.form_field.options[s.options_index].selected=!0,this.selected_option_count=null,this.is_multiple?this.choice_build(s):this.single_set_selected_text(this.choice_label(s)),this.is_multiple&&(!this.hide_results_on_select||t.metaKey||t.ctrlKey)?t.metaKey||t.ctrlKey?this.winnow_results({skip_highlight:!0}):(this.search_field.val(""),this.winnow_results()):(this.results_hide(),this.show_search_field_default()),(this.is_multiple||this.form_field.selectedIndex!==this.current_selectedIndex)&&this.trigger_form_field_change({selected:this.form_field.options[s.options_index].value}),this.current_selectedIndex=this.form_field.selectedIndex,t.preventDefault(),this.search_field_scale())},n.prototype.single_set_selected_text=function(t){return null==t&&(t=this.default_text),t===this.default_text?this.selected_item.addClass("chosen-default"):(this.single_deselect_control_build(),this.selected_item.removeClass("chosen-default")),this.selected_item.find("span").html(t)},n.prototype.result_deselect=function(t){var e;return e=this.results_data[t],!this.form_field.options[e.options_index].disabled&&(e.selected=!1,this.form_field.options[e.options_index].selected=!1,this.selected_option_count=null,this.result_clear_highlight(),this.results_showing&&this.winnow_results(),this.trigger_form_field_change({deselected:this.form_field.options[e.options_index].value}),this.search_field_scale(),!0)},n.prototype.single_deselect_control_build=function(){if(this.allow_single_deselect)return this.selected_item.find("abbr").length||this.selected_item.find("span").first().after('<abbr class="search-choice-close"></abbr>'),this.selected_item.addClass("chosen-single-with-deselect")},n.prototype.get_search_field_value=function(){return this.search_field.val()},n.prototype.get_search_text=function(){return t.trim(this.get_search_field_value())},n.prototype.escape_html=function(e){return t("<div/>").text(e).html()},n.prototype.winnow_results_set_highlight=function(){var t,e;if(e=this.is_multiple?[]:this.search_results.find(".result-selected.active-result"),null!=(t=e.length?e.first():this.search_results.find(".active-result").first()))return this.result_do_highlight(t)},n.prototype.no_results=function(t){var e;return e=this.get_no_results_html(t),this.search_results.append(e),this.form_field_jq.trigger("chosen:no_results",{chosen:this})},n.prototype.no_results_clear=function(){return this.search_results.find(".no-results").remove()},n.prototype.keydown_arrow=function(){var t;return this.results_showing&&this.result_highlight?(t=this.result_highlight.nextAll("li.active-result").first())?this.result_do_highlight(t):void 0:this.results_show()},n.prototype.keyup_arrow=function(){var t;return this.results_showing||this.is_multiple?this.result_highlight?(t=this.result_highlight.prevAll("li.active-result")).length?this.result_do_highlight(t.first()):(this.choices_count()>0&&this.results_hide(),this.result_clear_highlight()):void 0:this.results_show()},n.prototype.keydown_backstroke=function(){var t;return this.pending_backstroke?(this.choice_destroy(this.pending_backstroke.find("a").first()),this.clear_backstroke()):(t=this.search_container.siblings("li.search-choice").last()).length&&!t.hasClass("search-choice-disabled")?(this.pending_backstroke=t,this.single_backstroke_delete?this.keydown_backstroke():this.pending_backstroke.addClass("search-choice-focus")):void 0},n.prototype.clear_backstroke=function(){return this.pending_backstroke&&this.pending_backstroke.removeClass("search-choice-focus"),this.pending_backstroke=null},n.prototype.search_field_scale=function(){var e,s,i,n,r,o,h;if(this.is_multiple){for(r={position:"absolute",left:"-1000px",top:"-1000px",display:"none",whiteSpace:"pre"},s=0,i=(o=["fontSize","fontStyle","fontWeight","fontFamily","lineHeight","textTransform","letterSpacing"]).length;s<i;s++)r[n=o[s]]=this.search_field.css(n);return(e=t("<div />").css(r)).text(this.get_search_field_value()),t("body").append(e),h=e.width()+25,e.remove(),this.container.is(":visible")&&(h=Math.min(this.container.outerWidth()-10,h)),this.search_field.width(h)}},n.prototype.trigger_form_field_change=function(t){return this.form_field_jq.trigger("input",t),this.form_field_jq.trigger("change",t)},n}()}).call(this);
assets/lib/chosen/chosen.min.css CHANGED
@@ -1,3 +1,11 @@
1
- /* Chosen v1.5.1 | (c) 2011-2016 by Harvest | MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md */
 
 
2
 
3
- .chosen-container{position:relative;display:inline-block;vertical-align:middle;font-size:13px;-webkit-user-select:none;-moz-user-select:none;user-select:none}.chosen-container *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.chosen-container .chosen-drop{position:absolute;top:100%;left:-9999px;z-index:1010;width:100%;border:1px solid #aaa;border-top:0;background:#fff;box-shadow:0 4px 5px rgba(0,0,0,.15)}.chosen-container.chosen-with-drop .chosen-drop{left:0}.chosen-container a{cursor:pointer}.chosen-container .search-choice .group-name,.chosen-container .chosen-single .group-name{margin-right:4px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-weight:400;color:#999}.chosen-container .search-choice .group-name:after,.chosen-container .chosen-single .group-name:after{content:":";padding-left:2px;vertical-align:top}.chosen-container-single .chosen-single{position:relative;display:block;overflow:hidden;padding:0 0 0 8px;height:25px;border:1px solid #aaa;border-radius:5px;background-color:#fff;background:-webkit-gradient(linear,50% 0,50% 100%,color-stop(20%,#fff),color-stop(50%,#f6f6f6),color-stop(52%,#eee),color-stop(100%,#f4f4f4));background:-webkit-linear-gradient(#fff 20%,#f6f6f6 50%,#eee 52%,#f4f4f4 100%);background:-moz-linear-gradient(#fff 20%,#f6f6f6 50%,#eee 52%,#f4f4f4 100%);background:-o-linear-gradient(#fff 20%,#f6f6f6 50%,#eee 52%,#f4f4f4 100%);background:linear-gradient(#fff 20%,#f6f6f6 50%,#eee 52%,#f4f4f4 100%);background-clip:padding-box;box-shadow:0 0 3px #fff inset,0 1px 1px rgba(0,0,0,.1);color:#444;text-decoration:none;white-space:nowrap;line-height:24px}.chosen-container-single .chosen-default{color:#999}.chosen-container-single .chosen-single span{display:block;overflow:hidden;margin-right:26px;text-overflow:ellipsis;white-space:nowrap}.chosen-container-single .chosen-single-with-deselect span{margin-right:38px}.chosen-container-single .chosen-single abbr{position:absolute;top:6px;right:26px;display:block;width:12px;height:12px;background:url(../chosen/img/chosen-sprite.png) -42px 1px no-repeat;font-size:1px}.chosen-container-single .chosen-single abbr:hover{background-position:-42px -10px}.chosen-container-single.chosen-disabled .chosen-single abbr:hover{background-position:-42px -10px}.chosen-container-single .chosen-single div{position:absolute;top:0;right:0;display:block;width:18px;height:100%}.chosen-container-single .chosen-single div b{display:block;width:100%;height:100%;background:url(../chosen/img/chosen-sprite.png) no-repeat 0 2px}.chosen-container-single .chosen-search{position:relative;z-index:1010;margin:0;padding:3px 4px;white-space:nowrap}.chosen-container-single .chosen-search input[type=text]{margin:1px 0;padding:4px 20px 4px 5px;width:100%;height:auto;outline:0;border:1px solid #aaa;background:#fff url(../chosen/img/chosen-sprite.png) no-repeat 100% -20px;background:url(../chosen/img/chosen-sprite.png) no-repeat 100% -20px;font-size:1em;font-family:sans-serif;line-height:normal;border-radius:0}.chosen-container-single .chosen-drop{margin-top:-1px;border-radius:0 0 4px 4px;background-clip:padding-box}.chosen-container-single.chosen-container-single-nosearch .chosen-search{position:absolute;left:-9999px}.chosen-container .chosen-results{color:#444;position:relative;overflow-x:hidden;overflow-y:auto;margin:0 4px 4px 0;padding:0 0 0 4px;max-height:240px;-webkit-overflow-scrolling:touch}.chosen-container .chosen-results li{display:none;margin:0;padding:5px 6px;list-style:none;line-height:15px;word-wrap:break-word;-webkit-touch-callout:none}.chosen-container .chosen-results li.active-result{display:list-item;cursor:pointer}.chosen-container .chosen-results li.disabled-result{display:list-item;color:#ccc;cursor:default}.chosen-container .chosen-results li.highlighted{background-color:#3875d7;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(20%,#3875d7),color-stop(90%,#2a62bc));background-image:-webkit-linear-gradient(#3875d7 20%,#2a62bc 90%);background-image:-moz-linear-gradient(#3875d7 20%,#2a62bc 90%);background-image:-o-linear-gradient(#3875d7 20%,#2a62bc 90%);background-image:linear-gradient(#3875d7 20%,#2a62bc 90%);color:#fff}.chosen-container .chosen-results li.no-results{color:#777;display:list-item;background:#f4f4f4}.chosen-container .chosen-results li.group-result{display:list-item;font-weight:700;cursor:default}.chosen-container .chosen-results li.group-option{padding-left:15px}.chosen-container .chosen-results li em{font-style:normal;text-decoration:underline}.chosen-container-multi .chosen-choices{position:relative;overflow:hidden;margin:0;padding:0 5px;width:100%;height:auto!important;height:1%;border:1px solid #aaa;background-color:#fff;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(1%,#eee),color-stop(15%,#fff));background-image:-webkit-linear-gradient(#eee 1%,#fff 15%);background-image:-moz-linear-gradient(#eee 1%,#fff 15%);background-image:-o-linear-gradient(#eee 1%,#fff 15%);background-image:linear-gradient(#eee 1%,#fff 15%);cursor:text}.chosen-container-multi .chosen-choices li{float:left;list-style:none}.chosen-container-multi .chosen-choices li.search-field{margin:0;padding:0;white-space:nowrap}.chosen-container-multi .chosen-choices li.search-field input[type=text]{margin:1px 0;padding:0;height:25px;outline:0;border:0!important;background:transparent!important;box-shadow:none;color:#999;font-size:100%;font-family:sans-serif;line-height:normal;border-radius:0}.chosen-container-multi .chosen-choices li.search-choice{position:relative;margin:3px 5px 3px 0;padding:3px 20px 3px 5px;border:1px solid #aaa;max-width:100%;border-radius:3px;background-color:#eee;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(20%,#f4f4f4),color-stop(50%,#f0f0f0),color-stop(52%,#e8e8e8),color-stop(100%,#eee));background-image:-webkit-linear-gradient(#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);background-image:-moz-linear-gradient(#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);background-image:-o-linear-gradient(#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);background-image:linear-gradient(#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);background-size:100% 19px;background-repeat:repeat-x;background-clip:padding-box;box-shadow:0 0 2px #fff inset,0 1px 0 rgba(0,0,0,.05);color:#333;line-height:13px;cursor:default}.chosen-container-multi .chosen-choices li.search-choice span{word-wrap:break-word}.chosen-container-multi .chosen-choices li.search-choice .search-choice-close{position:absolute;top:4px;right:3px;display:block;width:12px;height:12px;background:url(../chosen/img/chosen-sprite.png) -42px 1px no-repeat;font-size:1px}.chosen-container-multi .chosen-choices li.search-choice .search-choice-close:hover{background-position:-42px -10px}.chosen-container-multi .chosen-choices li.search-choice-disabled{padding-right:5px;border:1px solid #ccc;background-color:#e4e4e4;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(20%,#f4f4f4),color-stop(50%,#f0f0f0),color-stop(52%,#e8e8e8),color-stop(100%,#eee));background-image:-webkit-linear-gradient(#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);background-image:-moz-linear-gradient(#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);background-image:-o-linear-gradient(#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);background-image:linear-gradient(#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);color:#666}.chosen-container-multi .chosen-choices li.search-choice-focus{background:#d4d4d4}.chosen-container-multi .chosen-choices li.search-choice-focus .search-choice-close{background-position:-42px -10px}.chosen-container-multi .chosen-results{margin:0;padding:0}.chosen-container-multi .chosen-drop .result-selected{display:list-item;color:#ccc;cursor:default}.chosen-container-active .chosen-single{border:1px solid #5897fb;box-shadow:0 0 5px rgba(0,0,0,.3)}.chosen-container-active.chosen-with-drop .chosen-single{border:1px solid #aaa;-moz-border-radius-bottomright:0;border-bottom-right-radius:0;-moz-border-radius-bottomleft:0;border-bottom-left-radius:0;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(20%,#eee),color-stop(80%,#fff));background-image:-webkit-linear-gradient(#eee 20%,#fff 80%);background-image:-moz-linear-gradient(#eee 20%,#fff 80%);background-image:-o-linear-gradient(#eee 20%,#fff 80%);background-image:linear-gradient(#eee 20%,#fff 80%);box-shadow:0 1px 0 #fff inset}.chosen-container-active.chosen-with-drop .chosen-single div{border-left:0;background:transparent}.chosen-container-active.chosen-with-drop .chosen-single div b{background-position:-18px 2px}.chosen-container-active .chosen-choices{border:1px solid #5897fb;box-shadow:0 0 5px rgba(0,0,0,.3)}.chosen-container-active .chosen-choices li.search-field input[type=text]{color:#222!important}.chosen-disabled{opacity:.5!important;cursor:default}.chosen-disabled .chosen-single{cursor:default}.chosen-disabled .chosen-choices .search-choice .search-choice-close{cursor:default}.chosen-rtl{text-align:right}.chosen-rtl .chosen-single{overflow:visible;padding:0 8px 0 0}.chosen-rtl .chosen-single span{margin-right:0;margin-left:26px;direction:rtl}.chosen-rtl .chosen-single-with-deselect span{margin-left:38px}.chosen-rtl .chosen-single div{right:auto;left:3px}.chosen-rtl .chosen-single abbr{right:auto;left:26px}.chosen-rtl .chosen-choices li{float:right}.chosen-rtl .chosen-choices li.search-field input[type=text]{direction:rtl}.chosen-rtl .chosen-choices li.search-choice{margin:3px 5px 3px 0;padding:3px 5px 3px 19px}.chosen-rtl .chosen-choices li.search-choice .search-choice-close{right:auto;left:4px}.chosen-rtl.chosen-container-single-nosearch .chosen-search,.chosen-rtl .chosen-drop{left:9999px}.chosen-rtl.chosen-container-single .chosen-results{margin:0 0 4px 4px;padding:0 4px 0 0}.chosen-rtl .chosen-results li.group-option{padding-right:15px;padding-left:0}.chosen-rtl.chosen-container-active.chosen-with-drop .chosen-single div{border-right:0}.chosen-rtl .chosen-search input[type=text]{padding:4px 5px 4px 20px;background:#fff url(../chosen/img/chosen-sprite.png) no-repeat -30px -20px;background:url(../chosen/img/chosen-sprite.png) no-repeat -30px -20px;direction:rtl}.chosen-rtl.chosen-container-single .chosen-single div b{background-position:6px 2px}.chosen-rtl.chosen-container-single.chosen-with-drop .chosen-single div b{background-position:-12px 2px}@media only screen and (-webkit-min-device-pixel-ratio:1.5),only screen and (min-resolution:144dpi),only screen and (min-resolution:1.5dppx){.chosen-rtl .chosen-search input[type=text],.chosen-container-single .chosen-single abbr,.chosen-container-single .chosen-single div b,.chosen-container-single .chosen-search input[type=text],.chosen-container-multi .chosen-choices .search-choice .search-choice-close,.chosen-container .chosen-results-scroll-down span,.chosen-container .chosen-results-scroll-up span{background-image:url(../chosen/img/chosen-sprite@2x.png)!important;background-size:52px 37px!important;background-repeat:no-repeat!important}}
 
 
 
 
 
 
1
+ /*!
2
+ Chosen, a Select Box Enhancer for jQuery and Prototype
3
+ by Patrick Filler for Harvest, http://getharvest.com
4
 
5
+ Version 1.8.7
6
+ Full source at https://github.com/harvesthq/chosen
7
+ Copyright (c) 2011-2019 Harvest http://getharvest.com
8
+
9
+ MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md
10
+ This file is generated by `grunt build`, do not edit it by hand.
11
+ */.chosen-container{position:relative;display:inline-block;vertical-align:middle;font-size:13px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.chosen-container *{-webkit-box-sizing:border-box;box-sizing:border-box}.chosen-container .chosen-drop{position:absolute;top:100%;z-index:1010;width:100%;border:1px solid #aaa;border-top:0;background:#fff;-webkit-box-shadow:0 4px 5px rgba(0,0,0,.15);box-shadow:0 4px 5px rgba(0,0,0,.15);clip:rect(0,0,0,0);-webkit-clip-path:inset(100% 100%);clip-path:inset(100% 100%)}.chosen-container.chosen-with-drop .chosen-drop{clip:auto;-webkit-clip-path:none;clip-path:none}.chosen-container a{cursor:pointer}.chosen-container .chosen-single .group-name,.chosen-container .search-choice .group-name{margin-right:4px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-weight:400;color:#999}.chosen-container .chosen-single .group-name:after,.chosen-container .search-choice .group-name:after{content:":";padding-left:2px;vertical-align:top}.chosen-container-single .chosen-single{position:relative;display:block;overflow:hidden;padding:0 0 0 8px;height:25px;border:1px solid #aaa;border-radius:5px;background-color:#fff;background:-webkit-gradient(linear,left top,left bottom,color-stop(20%,#fff),color-stop(50%,#f6f6f6),color-stop(52%,#eee),to(#f4f4f4));background:linear-gradient(#fff 20%,#f6f6f6 50%,#eee 52%,#f4f4f4 100%);background-clip:padding-box;-webkit-box-shadow:0 0 3px #fff inset,0 1px 1px rgba(0,0,0,.1);box-shadow:0 0 3px #fff inset,0 1px 1px rgba(0,0,0,.1);color:#444;text-decoration:none;white-space:nowrap;line-height:24px}.chosen-container-single .chosen-default{color:#999}.chosen-container-single .chosen-single span{display:block;overflow:hidden;margin-right:26px;text-overflow:ellipsis;white-space:nowrap}.chosen-container-single .chosen-single-with-deselect span{margin-right:38px}.chosen-container-single .chosen-single abbr{position:absolute;top:6px;right:26px;display:block;width:12px;height:12px;background:url(../chosen/img/chosen-sprite.png) -42px 1px no-repeat;font-size:1px}.chosen-container-single .chosen-single abbr:hover{background-position:-42px -10px}.chosen-container-single.chosen-disabled .chosen-single abbr:hover{background-position:-42px -10px}.chosen-container-single .chosen-single div{position:absolute;top:0;right:0;display:block;width:18px;height:100%}.chosen-container-single .chosen-single div b{display:block;width:100%;height:100%;background:url(../chosen/img/chosen-sprite.png) no-repeat 0 2px}.chosen-container-single .chosen-search{position:relative;z-index:1010;margin:0;padding:3px 4px;white-space:nowrap}.chosen-container-single .chosen-search input[type=text]{margin:1px 0;padding:4px 20px 4px 5px;width:100%;height:auto;outline:0;border:1px solid #aaa;background:url(../chosen/img/chosen-sprite.png) no-repeat 100% -20px;font-size:1em;font-family:sans-serif;line-height:normal;border-radius:0}.chosen-container-single .chosen-drop{margin-top:-1px;border-radius:0 0 4px 4px;background-clip:padding-box}.chosen-container-single.chosen-container-single-nosearch .chosen-search{position:absolute;clip:rect(0,0,0,0);-webkit-clip-path:inset(100% 100%);clip-path:inset(100% 100%)}.chosen-container .chosen-results{color:#444;position:relative;overflow-x:hidden;overflow-y:auto;margin:0 4px 4px 0;padding:0 0 0 4px;max-height:240px;-webkit-overflow-scrolling:touch}.chosen-container .chosen-results li{display:none;margin:0;padding:5px 6px;list-style:none;line-height:15px;word-wrap:break-word;-webkit-touch-callout:none}.chosen-container .chosen-results li.active-result{display:list-item;cursor:pointer}.chosen-container .chosen-results li.disabled-result{display:list-item;color:#ccc;cursor:default}.chosen-container .chosen-results li.highlighted{background-color:#3875d7;background-image:-webkit-gradient(linear,left top,left bottom,color-stop(20%,#3875d7),color-stop(90%,#2a62bc));background-image:linear-gradient(#3875d7 20%,#2a62bc 90%);color:#fff}.chosen-container .chosen-results li.no-results{color:#777;display:list-item;background:#f4f4f4}.chosen-container .chosen-results li.group-result{display:list-item;font-weight:700;cursor:default}.chosen-container .chosen-results li.group-option{padding-left:15px}.chosen-container .chosen-results li em{font-style:normal;text-decoration:underline}.chosen-container-multi .chosen-choices{position:relative;overflow:hidden;margin:0;padding:0 5px;width:100%;height:auto;border:1px solid #aaa;background-color:#fff;background-image:-webkit-gradient(linear,left top,left bottom,color-stop(1%,#eee),color-stop(15%,#fff));background-image:linear-gradient(#eee 1%,#fff 15%);cursor:text}.chosen-container-multi .chosen-choices li{float:left;list-style:none}.chosen-container-multi .chosen-choices li.search-field{margin:0;padding:0;white-space:nowrap}.chosen-container-multi .chosen-choices li.search-field input[type=text]{margin:1px 0;padding:0;height:25px;outline:0;border:0!important;background:0 0!important;-webkit-box-shadow:none;box-shadow:none;color:#999;font-size:100%;font-family:sans-serif;line-height:normal;border-radius:0;width:25px}.chosen-container-multi .chosen-choices li.search-choice{position:relative;margin:3px 5px 3px 0;padding:3px 20px 3px 5px;border:1px solid #aaa;max-width:100%;border-radius:3px;background-color:#eee;background-image:-webkit-gradient(linear,left top,left bottom,color-stop(20%,#f4f4f4),color-stop(50%,#f0f0f0),color-stop(52%,#e8e8e8),to(#eee));background-image:linear-gradient(#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);background-size:100% 19px;background-repeat:repeat-x;background-clip:padding-box;-webkit-box-shadow:0 0 2px #fff inset,0 1px 0 rgba(0,0,0,.05);box-shadow:0 0 2px #fff inset,0 1px 0 rgba(0,0,0,.05);color:#333;line-height:13px;cursor:default}.chosen-container-multi .chosen-choices li.search-choice span{word-wrap:break-word}.chosen-container-multi .chosen-choices li.search-choice .search-choice-close{position:absolute;top:4px;right:3px;display:block;width:12px;height:12px;background:url(../chosen/img/chosen-sprite.png) -42px 1px no-repeat;font-size:1px}.chosen-container-multi .chosen-choices li.search-choice .search-choice-close:hover{background-position:-42px -10px}.chosen-container-multi .chosen-choices li.search-choice-disabled{padding-right:5px;border:1px solid #ccc;background-color:#e4e4e4;background-image:-webkit-gradient(linear,left top,left bottom,color-stop(20%,#f4f4f4),color-stop(50%,#f0f0f0),color-stop(52%,#e8e8e8),to(#eee));background-image:linear-gradient(#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);color:#666}.chosen-container-multi .chosen-choices li.search-choice-focus{background:#d4d4d4}.chosen-container-multi .chosen-choices li.search-choice-focus .search-choice-close{background-position:-42px -10px}.chosen-container-multi .chosen-results{margin:0;padding:0}.chosen-container-multi .chosen-drop .result-selected{display:list-item;color:#ccc;cursor:default}.chosen-container-active .chosen-single{border:1px solid #5897fb;-webkit-box-shadow:0 0 5px rgba(0,0,0,.3);box-shadow:0 0 5px rgba(0,0,0,.3)}.chosen-container-active.chosen-with-drop .chosen-single{border:1px solid #aaa;border-bottom-right-radius:0;border-bottom-left-radius:0;background-image:-webkit-gradient(linear,left top,left bottom,color-stop(20%,#eee),color-stop(80%,#fff));background-image:linear-gradient(#eee 20%,#fff 80%);-webkit-box-shadow:0 1px 0 #fff inset;box-shadow:0 1px 0 #fff inset}.chosen-container-active.chosen-with-drop .chosen-single div{border-left:none;background:0 0}.chosen-container-active.chosen-with-drop .chosen-single div b{background-position:-18px 2px}.chosen-container-active .chosen-choices{border:1px solid #5897fb;-webkit-box-shadow:0 0 5px rgba(0,0,0,.3);box-shadow:0 0 5px rgba(0,0,0,.3)}.chosen-container-active .chosen-choices li.search-field input[type=text]{color:#222!important}.chosen-disabled{opacity:.5!important;cursor:default}.chosen-disabled .chosen-single{cursor:default}.chosen-disabled .chosen-choices .search-choice .search-choice-close{cursor:default}.chosen-rtl{text-align:right}.chosen-rtl .chosen-single{overflow:visible;padding:0 8px 0 0}.chosen-rtl .chosen-single span{margin-right:0;margin-left:26px;direction:rtl}.chosen-rtl .chosen-single-with-deselect span{margin-left:38px}.chosen-rtl .chosen-single div{right:auto;left:3px}.chosen-rtl .chosen-single abbr{right:auto;left:26px}.chosen-rtl .chosen-choices li{float:right}.chosen-rtl .chosen-choices li.search-field input[type=text]{direction:rtl}.chosen-rtl .chosen-choices li.search-choice{margin:3px 5px 3px 0;padding:3px 5px 3px 19px}.chosen-rtl .chosen-choices li.search-choice .search-choice-close{right:auto;left:4px}.chosen-rtl.chosen-container-single .chosen-results{margin:0 0 4px 4px;padding:0 4px 0 0}.chosen-rtl .chosen-results li.group-option{padding-right:15px;padding-left:0}.chosen-rtl.chosen-container-active.chosen-with-drop .chosen-single div{border-right:none}.chosen-rtl .chosen-search input[type=text]{padding:4px 5px 4px 20px;background:url(../chosen/img/chosen-sprite.png) no-repeat -30px -20px;direction:rtl}.chosen-rtl.chosen-container-single .chosen-single div b{background-position:6px 2px}.chosen-rtl.chosen-container-single.chosen-with-drop .chosen-single div b{background-position:-12px 2px}@media only screen and (-webkit-min-device-pixel-ratio:1.5),only screen and (min-resolution:144dpi),only screen and (min-resolution:1.5dppx){.chosen-container .chosen-results-scroll-down span,.chosen-container .chosen-results-scroll-up span,.chosen-container-multi .chosen-choices .search-choice .search-choice-close,.chosen-container-single .chosen-search input[type=text],.chosen-container-single .chosen-single abbr,.chosen-container-single .chosen-single div b,.chosen-rtl .chosen-search input[type=text]{background-image:url(../chosen/img/chosen-sprite@2x.png)!important;background-size:52px 37px!important;background-repeat:no-repeat!important}}
assets/lib/datepicker/css/bootstrap-datepicker3.min.css CHANGED
@@ -1,9 +1,7 @@
1
  /*!
2
- * Datepicker for Bootstrap v1.6.1 (https://github.com/eternicode/bootstrap-datepicker)
3
  *
4
- * Copyright 2012 Stefan Petre
5
- * Improvements by Andrew Rowls
6
  * Licensed under the Apache License v2.0 (http://www.apache.org/licenses/LICENSE-2.0)
7
  */
8
- .datepicker{border-radius:4px;direction:ltr}.datepicker-inline{width:220px}.datepicker.datepicker-rtl{direction:rtl}.datepicker.datepicker-rtl table tr td span{float:right}.datepicker-dropdown{top:0;left:0;padding:4px}.datepicker-dropdown:before{content:'';display:inline-block;border-left:7px solid transparent;border-right:7px solid transparent;border-bottom:7px solid rgba(0,0,0,.15);border-top:0;border-bottom-color:rgba(0,0,0,.2);position:absolute}.datepicker-dropdown:after{content:'';display:inline-block;border-left:6px solid transparent;border-right:6px solid transparent;border-bottom:6px solid #fff;border-top:0;position:absolute}.datepicker-dropdown.datepicker-orient-left:before{left:6px}.datepicker-dropdown.datepicker-orient-left:after{left:7px}.datepicker-dropdown.datepicker-orient-right:before{right:6px}.datepicker-dropdown.datepicker-orient-right:after{right:7px}.datepicker-dropdown.datepicker-orient-bottom:before{top:-7px}.datepicker-dropdown.datepicker-orient-bottom:after{top:-6px}.datepicker-dropdown.datepicker-orient-top:before{bottom:-7px;border-bottom:0;border-top:7px solid rgba(0,0,0,.15)}.datepicker-dropdown.datepicker-orient-top:after{bottom:-6px;border-bottom:0;border-top:6px solid #fff}.datepicker>div{display:none}.datepicker table{margin:0;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.datepicker table tr td,.datepicker table tr th{text-align:center;width:30px;height:30px;border-radius:4px;border:none}.table-striped .datepicker table tr td,.table-striped .datepicker table tr th{background-color:transparent}.datepicker table tr td.new,.datepicker table tr td.old{color:#777}.datepicker table tr td.day:hover,.datepicker table tr td.focused{background:#eee;cursor:pointer}.datepicker table tr td.disabled,.datepicker table tr td.disabled:hover{background:0 0;color:#777;cursor:default}.datepicker table tr td.highlighted{color:#000;background-color:#d9edf7;border-color:#85c5e5;border-radius:0}.datepicker table tr td.highlighted.focus,.datepicker table tr td.highlighted:focus{color:#000;background-color:#afd9ee;border-color:#298fc2}.datepicker table tr td.highlighted:hover{color:#000;background-color:#afd9ee;border-color:#52addb}.datepicker table tr td.highlighted.active,.datepicker table tr td.highlighted:active{color:#000;background-color:#afd9ee;border-color:#52addb}.datepicker table tr td.highlighted.active.focus,.datepicker table tr td.highlighted.active:focus,.datepicker table tr td.highlighted.active:hover,.datepicker table tr td.highlighted:active.focus,.datepicker table tr td.highlighted:active:focus,.datepicker table tr td.highlighted:active:hover{color:#000;background-color:#91cbe8;border-color:#298fc2}.datepicker table tr td.highlighted.disabled.focus,.datepicker table tr td.highlighted.disabled:focus,.datepicker table tr td.highlighted.disabled:hover,.datepicker table tr td.highlighted[disabled].focus,.datepicker table tr td.highlighted[disabled]:focus,.datepicker table tr td.highlighted[disabled]:hover,fieldset[disabled] .datepicker table tr td.highlighted.focus,fieldset[disabled] .datepicker table tr td.highlighted:focus,fieldset[disabled] .datepicker table tr td.highlighted:hover{background-color:#d9edf7;border-color:#85c5e5}.datepicker table tr td.highlighted.focused{background:#afd9ee}.datepicker table tr td.highlighted.disabled,.datepicker table tr td.highlighted.disabled:active{background:#d9edf7;color:#777}.datepicker table tr td.today{color:#000;background-color:#ffdb99;border-color:#ffb733}.datepicker table tr td.today.focus,.datepicker table tr td.today:focus{color:#000;background-color:#ffc966;border-color:#b37400}.datepicker table tr td.today:hover{color:#000;background-color:#ffc966;border-color:#f59e00}.datepicker table tr td.today.active,.datepicker table tr td.today:active{color:#000;background-color:#ffc966;border-color:#f59e00}.datepicker table tr td.today.active.focus,.datepicker table tr td.today.active:focus,.datepicker table tr td.today.active:hover,.datepicker table tr td.today:active.focus,.datepicker table tr td.today:active:focus,.datepicker table tr td.today:active:hover{color:#000;background-color:#ffbc42;border-color:#b37400}.datepicker table tr td.today.disabled.focus,.datepicker table tr td.today.disabled:focus,.datepicker table tr td.today.disabled:hover,.datepicker table tr td.today[disabled].focus,.datepicker table tr td.today[disabled]:focus,.datepicker table tr td.today[disabled]:hover,fieldset[disabled] .datepicker table tr td.today.focus,fieldset[disabled] .datepicker table tr td.today:focus,fieldset[disabled] .datepicker table tr td.today:hover{background-color:#ffdb99;border-color:#ffb733}.datepicker table tr td.today.focused{background:#ffc966}.datepicker table tr td.today.disabled,.datepicker table tr td.today.disabled:active{background:#ffdb99;color:#777}.datepicker table tr td.range{color:#000;background-color:#eee;border-color:#bbb;border-radius:0}.datepicker table tr td.range.focus,.datepicker table tr td.range:focus{color:#000;background-color:#d5d5d5;border-color:#7c7c7c}.datepicker table tr td.range:hover{color:#000;background-color:#d5d5d5;border-color:#9d9d9d}.datepicker table tr td.range.active,.datepicker table tr td.range:active{color:#000;background-color:#d5d5d5;border-color:#9d9d9d}.datepicker table tr td.range.active.focus,.datepicker table tr td.range.active:focus,.datepicker table tr td.range.active:hover,.datepicker table tr td.range:active.focus,.datepicker table tr td.range:active:focus,.datepicker table tr td.range:active:hover{color:#000;background-color:#c3c3c3;border-color:#7c7c7c}.datepicker table tr td.range.disabled.focus,.datepicker table tr td.range.disabled:focus,.datepicker table tr td.range.disabled:hover,.datepicker table tr td.range[disabled].focus,.datepicker table tr td.range[disabled]:focus,.datepicker table tr td.range[disabled]:hover,fieldset[disabled] .datepicker table tr td.range.focus,fieldset[disabled] .datepicker table tr td.range:focus,fieldset[disabled] .datepicker table tr td.range:hover{background-color:#eee;border-color:#bbb}.datepicker table tr td.range.focused{background:#d5d5d5}.datepicker table tr td.range.disabled,.datepicker table tr td.range.disabled:active{background:#eee;color:#777}.datepicker table tr td.range.highlighted{color:#000;background-color:#e4eef3;border-color:#9dc1d3}.datepicker table tr td.range.highlighted.focus,.datepicker table tr td.range.highlighted:focus{color:#000;background-color:#c1d7e3;border-color:#4b88a6}.datepicker table tr td.range.highlighted:hover{color:#000;background-color:#c1d7e3;border-color:#73a6c0}.datepicker table tr td.range.highlighted.active,.datepicker table tr td.range.highlighted:active{color:#000;background-color:#c1d7e3;border-color:#73a6c0}.datepicker table tr td.range.highlighted.active.focus,.datepicker table tr td.range.highlighted.active:focus,.datepicker table tr td.range.highlighted.active:hover,.datepicker table tr td.range.highlighted:active.focus,.datepicker table tr td.range.highlighted:active:focus,.datepicker table tr td.range.highlighted:active:hover{color:#000;background-color:#a8c8d8;border-color:#4b88a6}.datepicker table tr td.range.highlighted.disabled.focus,.datepicker table tr td.range.highlighted.disabled:focus,.datepicker table tr td.range.highlighted.disabled:hover,.datepicker table tr td.range.highlighted[disabled].focus,.datepicker table tr td.range.highlighted[disabled]:focus,.datepicker table tr td.range.highlighted[disabled]:hover,fieldset[disabled] .datepicker table tr td.range.highlighted.focus,fieldset[disabled] .datepicker table tr td.range.highlighted:focus,fieldset[disabled] .datepicker table tr td.range.highlighted:hover{background-color:#e4eef3;border-color:#9dc1d3}.datepicker table tr td.range.highlighted.focused{background:#c1d7e3}.datepicker table tr td.range.highlighted.disabled,.datepicker table tr td.range.highlighted.disabled:active{background:#e4eef3;color:#777}.datepicker table tr td.range.today{color:#000;background-color:#f7ca77;border-color:#f1a417}.datepicker table tr td.range.today.focus,.datepicker table tr td.range.today:focus{color:#000;background-color:#f4b747;border-color:#815608}.datepicker table tr td.range.today:hover{color:#000;background-color:#f4b747;border-color:#bf800c}.datepicker table tr td.range.today.active,.datepicker table tr td.range.today:active{color:#000;background-color:#f4b747;border-color:#bf800c}.datepicker table tr td.range.today.active.focus,.datepicker table tr td.range.today.active:focus,.datepicker table tr td.range.today.active:hover,.datepicker table tr td.range.today:active.focus,.datepicker table tr td.range.today:active:focus,.datepicker table tr td.range.today:active:hover{color:#000;background-color:#f2aa25;border-color:#815608}.datepicker table tr td.range.today.disabled.focus,.datepicker table tr td.range.today.disabled:focus,.datepicker table tr td.range.today.disabled:hover,.datepicker table tr td.range.today[disabled].focus,.datepicker table tr td.range.today[disabled]:focus,.datepicker table tr td.range.today[disabled]:hover,fieldset[disabled] .datepicker table tr td.range.today.focus,fieldset[disabled] .datepicker table tr td.range.today:focus,fieldset[disabled] .datepicker table tr td.range.today:hover{background-color:#f7ca77;border-color:#f1a417}.datepicker table tr td.range.today.disabled,.datepicker table tr td.range.today.disabled:active{background:#f7ca77;color:#777}.datepicker table tr td.selected,.datepicker table tr td.selected.highlighted{color:#fff;background-color:#777;border-color:#555;text-shadow:0 -1px 0 rgba(0,0,0,.25)}.datepicker table tr td.selected.focus,.datepicker table tr td.selected.highlighted.focus,.datepicker table tr td.selected.highlighted:focus,.datepicker table tr td.selected:focus{color:#fff;background-color:#5e5e5e;border-color:#161616}.datepicker table tr td.selected.highlighted:hover,.datepicker table tr td.selected:hover{color:#fff;background-color:#5e5e5e;border-color:#373737}.datepicker table tr td.selected.active,.datepicker table tr td.selected.highlighted.active,.datepicker table tr td.selected.highlighted:active,.datepicker table tr td.selected:active{color:#fff;background-color:#5e5e5e;border-color:#373737}.datepicker table tr td.selected.active.focus,.datepicker table tr td.selected.active:focus,.datepicker table tr td.selected.active:hover,.datepicker table tr td.selected.highlighted.active.focus,.datepicker table tr td.selected.highlighted.active:focus,.datepicker table tr td.selected.highlighted.active:hover,.datepicker table tr td.selected.highlighted:active.focus,.datepicker table tr td.selected.highlighted:active:focus,.datepicker table tr td.selected.highlighted:active:hover,.datepicker table tr td.selected:active.focus,.datepicker table tr td.selected:active:focus,.datepicker table tr td.selected:active:hover{color:#fff;background-color:#4c4c4c;border-color:#161616}.datepicker table tr td.selected.disabled.focus,.datepicker table tr td.selected.disabled:focus,.datepicker table tr td.selected.disabled:hover,.datepicker table tr td.selected.highlighted.disabled.focus,.datepicker table tr td.selected.highlighted.disabled:focus,.datepicker table tr td.selected.highlighted.disabled:hover,.datepicker table tr td.selected.highlighted[disabled].focus,.datepicker table tr td.selected.highlighted[disabled]:focus,.datepicker table tr td.selected.highlighted[disabled]:hover,.datepicker table tr td.selected[disabled].focus,.datepicker table tr td.selected[disabled]:focus,.datepicker table tr td.selected[disabled]:hover,fieldset[disabled] .datepicker table tr td.selected.focus,fieldset[disabled] .datepicker table tr td.selected.highlighted.focus,fieldset[disabled] .datepicker table tr td.selected.highlighted:focus,fieldset[disabled] .datepicker table tr td.selected.highlighted:hover,fieldset[disabled] .datepicker table tr td.selected:focus,fieldset[disabled] .datepicker table tr td.selected:hover{background-color:#777;border-color:#555}.datepicker table tr td.active,.datepicker table tr td.active.highlighted{color:#fff;background-color:#337ab7;border-color:#2e6da4;text-shadow:0 -1px 0 rgba(0,0,0,.25)}.datepicker table tr td.active.focus,.datepicker table tr td.active.highlighted.focus,.datepicker table tr td.active.highlighted:focus,.datepicker table tr td.active:focus{color:#fff;background-color:#286090;border-color:#122b40}.datepicker table tr td.active.highlighted:hover,.datepicker table tr td.active:hover{color:#fff;background-color:#286090;border-color:#204d74}.datepicker table tr td.active.active,.datepicker table tr td.active.highlighted.active,.datepicker table tr td.active.highlighted:active,.datepicker table tr td.active:active{color:#fff;background-color:#286090;border-color:#204d74}.datepicker table tr td.active.active.focus,.datepicker table tr td.active.active:focus,.datepicker table tr td.active.active:hover,.datepicker table tr td.active.highlighted.active.focus,.datepicker table tr td.active.highlighted.active:focus,.datepicker table tr td.active.highlighted.active:hover,.datepicker table tr td.active.highlighted:active.focus,.datepicker table tr td.active.highlighted:active:focus,.datepicker table tr td.active.highlighted:active:hover,.datepicker table tr td.active:active.focus,.datepicker table tr td.active:active:focus,.datepicker table tr td.active:active:hover{color:#fff;background-color:#204d74;border-color:#122b40}.datepicker table tr td.active.disabled.focus,.datepicker table tr td.active.disabled:focus,.datepicker table tr td.active.disabled:hover,.datepicker table tr td.active.highlighted.disabled.focus,.datepicker table tr td.active.highlighted.disabled:focus,.datepicker table tr td.active.highlighted.disabled:hover,.datepicker table tr td.active.highlighted[disabled].focus,.datepicker table tr td.active.highlighted[disabled]:focus,.datepicker table tr td.active.highlighted[disabled]:hover,.datepicker table tr td.active[disabled].focus,.datepicker table tr td.active[disabled]:focus,.datepicker table tr td.active[disabled]:hover,fieldset[disabled] .datepicker table tr td.active.focus,fieldset[disabled] .datepicker table tr td.active.highlighted.focus,fieldset[disabled] .datepicker table tr td.active.highlighted:focus,fieldset[disabled] .datepicker table tr td.active.highlighted:hover,fieldset[disabled] .datepicker table tr td.active:focus,fieldset[disabled] .datepicker table tr td.active:hover{background-color:#337ab7;border-color:#2e6da4}.datepicker table tr td span{display:block;width:23%;height:54px;line-height:54px;float:left;margin:1%;cursor:pointer;border-radius:4px}.datepicker table tr td span.focused,.datepicker table tr td span:hover{background:#eee}.datepicker table tr td span.disabled,.datepicker table tr td span.disabled:hover{background:0 0;color:#777;cursor:default}.datepicker table tr td span.active,.datepicker table tr td span.active.disabled,.datepicker table tr td span.active.disabled:hover,.datepicker table tr td span.active:hover{color:#fff;background-color:#337ab7;border-color:#2e6da4;text-shadow:0 -1px 0 rgba(0,0,0,.25)}.datepicker table tr td span.active.disabled.focus,.datepicker table tr td span.active.disabled:focus,.datepicker table tr td span.active.disabled:hover.focus,.datepicker table tr td span.active.disabled:hover:focus,.datepicker table tr td span.active.focus,.datepicker table tr td span.active:focus,.datepicker table tr td span.active:hover.focus,.datepicker table tr td span.active:hover:focus{color:#fff;background-color:#286090;border-color:#122b40}.datepicker table tr td span.active.disabled:hover,.datepicker table tr td span.active.disabled:hover:hover,.datepicker table tr td span.active:hover,.datepicker table tr td span.active:hover:hover{color:#fff;background-color:#286090;border-color:#204d74}.datepicker table tr td span.active.active,.datepicker table tr td span.active.disabled.active,.datepicker table tr td span.active.disabled:active,.datepicker table tr td span.active.disabled:hover.active,.datepicker table tr td span.active.disabled:hover:active,.datepicker table tr td span.active:active,.datepicker table tr td span.active:hover.active,.datepicker table tr td span.active:hover:active{color:#fff;background-color:#286090;border-color:#204d74}.datepicker table tr td span.active.active.focus,.datepicker table tr td span.active.active:focus,.datepicker table tr td span.active.active:hover,.datepicker table tr td span.active.disabled.active.focus,.datepicker table tr td span.active.disabled.active:focus,.datepicker table tr td span.active.disabled.active:hover,.datepicker table tr td span.active.disabled:active.focus,.datepicker table tr td span.active.disabled:active:focus,.datepicker table tr td span.active.disabled:active:hover,.datepicker table tr td span.active.disabled:hover.active.focus,.datepicker table tr td span.active.disabled:hover.active:focus,.datepicker table tr td span.active.disabled:hover.active:hover,.datepicker table tr td span.active.disabled:hover:active.focus,.datepicker table tr td span.active.disabled:hover:active:focus,.datepicker table tr td span.active.disabled:hover:active:hover,.datepicker table tr td span.active:active.focus,.datepicker table tr td span.active:active:focus,.datepicker table tr td span.active:active:hover,.datepicker table tr td span.active:hover.active.focus,.datepicker table tr td span.active:hover.active:focus,.datepicker table tr td span.active:hover.active:hover,.datepicker table tr td span.active:hover:active.focus,.datepicker table tr td span.active:hover:active:focus,.datepicker table tr td span.active:hover:active:hover{color:#fff;background-color:#204d74;border-color:#122b40}.datepicker table tr td span.active.disabled.disabled.focus,.datepicker table tr td span.active.disabled.disabled:focus,.datepicker table tr td span.active.disabled.disabled:hover,.datepicker table tr td span.active.disabled.focus,.datepicker table tr td span.active.disabled:focus,.datepicker table tr td span.active.disabled:hover,.datepicker table tr td span.active.disabled:hover.disabled.focus,.datepicker table tr td span.active.disabled:hover.disabled:focus,.datepicker table tr td span.active.disabled:hover.disabled:hover,.datepicker table tr td span.active.disabled:hover[disabled].focus,.datepicker table tr td span.active.disabled:hover[disabled]:focus,.datepicker table tr td span.active.disabled:hover[disabled]:hover,.datepicker table tr td span.active.disabled[disabled].focus,.datepicker table tr td span.active.disabled[disabled]:focus,.datepicker table tr td span.active.disabled[disabled]:hover,.datepicker table tr td span.active:hover.disabled.focus,.datepicker table tr td span.active:hover.disabled:focus,.datepicker table tr td span.active:hover.disabled:hover,.datepicker table tr td span.active:hover[disabled].focus,.datepicker table tr td span.active:hover[disabled]:focus,.datepicker table tr td span.active:hover[disabled]:hover,.datepicker table tr td span.active[disabled].focus,.datepicker table tr td span.active[disabled]:focus,.datepicker table tr td span.active[disabled]:hover,fieldset[disabled] .datepicker table tr td span.active.disabled.focus,fieldset[disabled] .datepicker table tr td span.active.disabled:focus,fieldset[disabled] .datepicker table tr td span.active.disabled:hover,fieldset[disabled] .datepicker table tr td span.active.disabled:hover.focus,fieldset[disabled] .datepicker table tr td span.active.disabled:hover:focus,fieldset[disabled] .datepicker table tr td span.active.disabled:hover:hover,fieldset[disabled] .datepicker table tr td span.active.focus,fieldset[disabled] .datepicker table tr td span.active:focus,fieldset[disabled] .datepicker table tr td span.active:hover,fieldset[disabled] .datepicker table tr td span.active:hover.focus,fieldset[disabled] .datepicker table tr td span.active:hover:focus,fieldset[disabled] .datepicker table tr td span.active:hover:hover{background-color:#337ab7;border-color:#2e6da4}.datepicker table tr td span.new,.datepicker table tr td span.old{color:#777}.datepicker .datepicker-switch{width:145px}.datepicker .datepicker-switch,.datepicker .next,.datepicker .prev,.datepicker tfoot tr th{cursor:pointer}.datepicker .datepicker-switch:hover,.datepicker .next:hover,.datepicker .prev:hover,.datepicker tfoot tr th:hover{background:#eee}.datepicker .cw{font-size:10px;width:12px;padding:0 2px 0 5px;vertical-align:middle}.input-group.date .input-group-addon{cursor:pointer}.input-daterange{width:100%}.input-daterange input{text-align:center}.input-daterange input:first-child{border-radius:3px 0 0 3px}.input-daterange input:last-child{border-radius:0 3px 3px 0}.input-daterange .input-group-addon{width:auto;min-width:16px;padding:4px 5px;line-height:1.42857143;text-shadow:0 1px 0 #fff;border-width:1px 0;margin-left:-5px;margin-right:-5px}
9
- /*# sourceMappingURL=bootstrap-datepicker3.min.css.map */
1
  /*!
2
+ * Datepicker for Bootstrap v1.9.0 (https://github.com/uxsolutions/bootstrap-datepicker)
3
  *
 
 
4
  * Licensed under the Apache License v2.0 (http://www.apache.org/licenses/LICENSE-2.0)
5
  */
6
+
7
+ .datepicker{border-radius:4px;direction:ltr}.datepicker-inline{width:220px}.datepicker-rtl{direction:rtl}.datepicker-rtl.dropdown-menu{left:auto}.datepicker-rtl table tr td span{float:right}.datepicker-dropdown{top:0;left:0;padding:4px}.datepicker-dropdown:before{content:'';display:inline-block;border-left:7px solid transparent;border-right:7px solid transparent;border-bottom:7px solid rgba(0,0,0,.15);border-top:0;border-bottom-color:rgba(0,0,0,.2);position:absolute}.datepicker-dropdown:after{content:'';display:inline-block;border-left:6px solid transparent;border-right:6px solid transparent;border-bottom:6px solid #fff;border-top:0;position:absolute}.datepicker-dropdown.datepicker-orient-left:before{left:6px}.datepicker-dropdown.datepicker-orient-left:after{left:7px}.datepicker-dropdown.datepicker-orient-right:before{right:6px}.datepicker-dropdown.datepicker-orient-right:after{right:7px}.datepicker-dropdown.datepicker-orient-bottom:before{top:-7px}.datepicker-dropdown.datepicker-orient-bottom:after{top:-6px}.datepicker-dropdown.datepicker-orient-top:before{bottom:-7px;border-bottom:0;border-top:7px solid rgba(0,0,0,.15)}.datepicker-dropdown.datepicker-orient-top:after{bottom:-6px;border-bottom:0;border-top:6px solid #fff}.datepicker table{margin:0;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.datepicker table tr td,.datepicker table tr th{text-align:center;width:30px;height:30px;border-radius:4px;border:none}.table-striped .datepicker table tr td,.table-striped .datepicker table tr th{background-color:transparent}.datepicker table tr td.new,.datepicker table tr td.old{color:#777}.datepicker table tr td.day:hover,.datepicker table tr td.focused{background:#eee;cursor:pointer}.datepicker table tr td.disabled,.datepicker table tr td.disabled:hover{background:0 0;color:#777;cursor:default}.datepicker table tr td.highlighted{color:#000;background-color:#d9edf7;border-color:#85c5e5;border-radius:0}.datepicker table tr td.highlighted.focus,.datepicker table tr td.highlighted:focus{color:#000;background-color:#afd9ee;border-color:#298fc2}.datepicker table tr td.highlighted:hover{color:#000;background-color:#afd9ee;border-color:#52addb}.datepicker table tr td.highlighted.active,.datepicker table tr td.highlighted:active{color:#000;background-color:#afd9ee;border-color:#52addb}.datepicker table tr td.highlighted.active.focus,.datepicker table tr td.highlighted.active:focus,.datepicker table tr td.highlighted.active:hover,.datepicker table tr td.highlighted:active.focus,.datepicker table tr td.highlighted:active:focus,.datepicker table tr td.highlighted:active:hover{color:#000;background-color:#91cbe8;border-color:#298fc2}.datepicker table tr td.highlighted.disabled.focus,.datepicker table tr td.highlighted.disabled:focus,.datepicker table tr td.highlighted.disabled:hover,.datepicker table tr td.highlighted[disabled].focus,.datepicker table tr td.highlighted[disabled]:focus,.datepicker table tr td.highlighted[disabled]:hover,fieldset[disabled] .datepicker table tr td.highlighted.focus,fieldset[disabled] .datepicker table tr td.highlighted:focus,fieldset[disabled] .datepicker table tr td.highlighted:hover{background-color:#d9edf7;border-color:#85c5e5}.datepicker table tr td.highlighted.focused{background:#afd9ee}.datepicker table tr td.highlighted.disabled,.datepicker table tr td.highlighted.disabled:active{background:#d9edf7;color:#777}.datepicker table tr td.today{color:#000;background-color:#ffdb99;border-color:#ffb733}.datepicker table tr td.today.focus,.datepicker table tr td.today:focus{color:#000;background-color:#ffc966;border-color:#b37400}.datepicker table tr td.today:hover{color:#000;background-color:#ffc966;border-color:#f59e00}.datepicker table tr td.today.active,.datepicker table tr td.today:active{color:#000;background-color:#ffc966;border-color:#f59e00}.datepicker table tr td.today.active.focus,.datepicker table tr td.today.active:focus,.datepicker table tr td.today.active:hover,.datepicker table tr td.today:active.focus,.datepicker table tr td.today:active:focus,.datepicker table tr td.today:active:hover{color:#000;background-color:#ffbc42;border-color:#b37400}.datepicker table tr td.today.disabled.focus,.datepicker table tr td.today.disabled:focus,.datepicker table tr td.today.disabled:hover,.datepicker table tr td.today[disabled].focus,.datepicker table tr td.today[disabled]:focus,.datepicker table tr td.today[disabled]:hover,fieldset[disabled] .datepicker table tr td.today.focus,fieldset[disabled] .datepicker table tr td.today:focus,fieldset[disabled] .datepicker table tr td.today:hover{background-color:#ffdb99;border-color:#ffb733}.datepicker table tr td.today.focused{background:#ffc966}.datepicker table tr td.today.disabled,.datepicker table tr td.today.disabled:active{background:#ffdb99;color:#777}.datepicker table tr td.range{color:#000;background-color:#eee;border-color:#bbb;border-radius:0}.datepicker table tr td.range.focus,.datepicker table tr td.range:focus{color:#000;background-color:#d5d5d5;border-color:#7c7c7c}.datepicker table tr td.range:hover{color:#000;background-color:#d5d5d5;border-color:#9d9d9d}.datepicker table tr td.range.active,.datepicker table tr td.range:active{color:#000;background-color:#d5d5d5;border-color:#9d9d9d}.datepicker table tr td.range.active.focus,.datepicker table tr td.range.active:focus,.datepicker table tr td.range.active:hover,.datepicker table tr td.range:active.focus,.datepicker table tr td.range:active:focus,.datepicker table tr td.range:active:hover{color:#000;background-color:#c3c3c3;border-color:#7c7c7c}.datepicker table tr td.range.disabled.focus,.datepicker table tr td.range.disabled:focus,.datepicker table tr td.range.disabled:hover,.datepicker table tr td.range[disabled].focus,.datepicker table tr td.range[disabled]:focus,.datepicker table tr td.range[disabled]:hover,fieldset[disabled] .datepicker table tr td.range.focus,fieldset[disabled] .datepicker table tr td.range:focus,fieldset[disabled] .datepicker table tr td.range:hover{background-color:#eee;border-color:#bbb}.datepicker table tr td.range.focused{background:#d5d5d5}.datepicker table tr td.range.disabled,.datepicker table tr td.range.disabled:active{background:#eee;color:#777}.datepicker table tr td.range.highlighted{color:#000;background-color:#e4eef3;border-color:#9dc1d3}.datepicker table tr td.range.highlighted.focus,.datepicker table tr td.range.highlighted:focus{color:#000;background-color:#c1d7e3;border-color:#4b88a6}.datepicker table tr td.range.highlighted:hover{color:#000;background-color:#c1d7e3;border-color:#73a6c0}.datepicker table tr td.range.highlighted.active,.datepicker table tr td.range.highlighted:active{color:#000;background-color:#c1d7e3;border-color:#73a6c0}.datepicker table tr td.range.highlighted.active.focus,.datepicker table tr td.range.highlighted.active:focus,.datepicker table tr td.range.highlighted.active:hover,.datepicker table tr td.range.highlighted:active.focus,.datepicker table tr td.range.highlighted:active:focus,.datepicker table tr td.range.highlighted:active:hover{color:#000;background-color:#a8c8d8;border-color:#4b88a6}.datepicker table tr td.range.highlighted.disabled.focus,.datepicker table tr td.range.highlighted.disabled:focus,.datepicker table tr td.range.highlighted.disabled:hover,.datepicker table tr td.range.highlighted[disabled].focus,.datepicker table tr td.range.highlighted[disabled]:focus,.datepicker table tr td.range.highlighted[disabled]:hover,fieldset[disabled] .datepicker table tr td.range.highlighted.focus,fieldset[disabled] .datepicker table tr td.range.highlighted:focus,fieldset[disabled] .datepicker table tr td.range.highlighted:hover{background-color:#e4eef3;border-color:#9dc1d3}.datepicker table tr td.range.highlighted.focused{background:#c1d7e3}.datepicker table tr td.range.highlighted.disabled,.datepicker table tr td.range.highlighted.disabled:active{background:#e4eef3;color:#777}.datepicker table tr td.range.today{color:#000;background-color:#f7ca77;border-color:#f1a417}.datepicker table tr td.range.today.focus,.datepicker table tr td.range.today:focus{color:#000;background-color:#f4b747;border-color:#815608}.datepicker table tr td.range.today:hover{color:#000;background-color:#f4b747;border-color:#bf800c}.datepicker table tr td.range.today.active,.datepicker table tr td.range.today:active{color:#000;background-color:#f4b747;border-color:#bf800c}.datepicker table tr td.range.today.active.focus,.datepicker table tr td.range.today.active:focus,.datepicker table tr td.range.today.active:hover,.datepicker table tr td.range.today:active.focus,.datepicker table tr td.range.today:active:focus,.datepicker table tr td.range.today:active:hover{color:#000;background-color:#f2aa25;border-color:#815608}.datepicker table tr td.range.today.disabled.focus,.datepicker table tr td.range.today.disabled:focus,.datepicker table tr td.range.today.disabled:hover,.datepicker table tr td.range.today[disabled].focus,.datepicker table tr td.range.today[disabled]:focus,.datepicker table tr td.range.today[disabled]:hover,fieldset[disabled] .datepicker table tr td.range.today.focus,fieldset[disabled] .datepicker table tr td.range.today:focus,fieldset[disabled] .datepicker table tr td.range.today:hover{background-color:#f7ca77;border-color:#f1a417}.datepicker table tr td.range.today.disabled,.datepicker table tr td.range.today.disabled:active{background:#f7ca77;color:#777}.datepicker table tr td.selected,.datepicker table tr td.selected.highlighted{color:#fff;background-color:#777;border-color:#555;text-shadow:0 -1px 0 rgba(0,0,0,.25)}.datepicker table tr td.selected.focus,.datepicker table tr td.selected.highlighted.focus,.datepicker table tr td.selected.highlighted:focus,.datepicker table tr td.selected:focus{color:#fff;background-color:#5e5e5e;border-color:#161616}.datepicker table tr td.selected.highlighted:hover,.datepicker table tr td.selected:hover{color:#fff;background-color:#5e5e5e;border-color:#373737}.datepicker table tr td.selected.active,.datepicker table tr td.selected.highlighted.active,.datepicker table tr td.selected.highlighted:active,.datepicker table tr td.selected:active{color:#fff;background-color:#5e5e5e;border-color:#373737}.datepicker table tr td.selected.active.focus,.datepicker table tr td.selected.active:focus,.datepicker table tr td.selected.active:hover,.datepicker table tr td.selected.highlighted.active.focus,.datepicker table tr td.selected.highlighted.active:focus,.datepicker table tr td.selected.highlighted.active:hover,.datepicker table tr td.selected.highlighted:active.focus,.datepicker table tr td.selected.highlighted:active:focus,.datepicker table tr td.selected.highlighted:active:hover,.datepicker table tr td.selected:active.focus,.datepicker table tr td.selected:active:focus,.datepicker table tr td.selected:active:hover{color:#fff;background-color:#4c4c4c;border-color:#161616}.datepicker table tr td.selected.disabled.focus,.datepicker table tr td.selected.disabled:focus,.datepicker table tr td.selected.disabled:hover,.datepicker table tr td.selected.highlighted.disabled.focus,.datepicker table tr td.selected.highlighted.disabled:focus,.datepicker table tr td.selected.highlighted.disabled:hover,.datepicker table tr td.selected.highlighted[disabled].focus,.datepicker table tr td.selected.highlighted[disabled]:focus,.datepicker table tr td.selected.highlighted[disabled]:hover,.datepicker table tr td.selected[disabled].focus,.datepicker table tr td.selected[disabled]:focus,.datepicker table tr td.selected[disabled]:hover,fieldset[disabled] .datepicker table tr td.selected.focus,fieldset[disabled] .datepicker table tr td.selected.highlighted.focus,fieldset[disabled] .datepicker table tr td.selected.highlighted:focus,fieldset[disabled] .datepicker table tr td.selected.highlighted:hover,fieldset[disabled] .datepicker table tr td.selected:focus,fieldset[disabled] .datepicker table tr td.selected:hover{background-color:#777;border-color:#555}.datepicker table tr td.active,.datepicker table tr td.active.highlighted{color:#fff;background-color:#337ab7;border-color:#2e6da4;text-shadow:0 -1px 0 rgba(0,0,0,.25)}.datepicker table tr td.active.focus,.datepicker table tr td.active.highlighted.focus,.datepicker table tr td.active.highlighted:focus,.datepicker table tr td.active:focus{color:#fff;background-color:#286090;border-color:#122b40}.datepicker table tr td.active.highlighted:hover,.datepicker table tr td.active:hover{color:#fff;background-color:#286090;border-color:#204d74}.datepicker table tr td.active.active,.datepicker table tr td.active.highlighted.active,.datepicker table tr td.active.highlighted:active,.datepicker table tr td.active:active{color:#fff;background-color:#286090;border-color:#204d74}.datepicker table tr td.active.active.focus,.datepicker table tr td.active.active:focus,.datepicker table tr td.active.active:hover,.datepicker table tr td.active.highlighted.active.focus,.datepicker table tr td.active.highlighted.active:focus,.datepicker table tr td.active.highlighted.active:hover,.datepicker table tr td.active.highlighted:active.focus,.datepicker table tr td.active.highlighted:active:focus,.datepicker table tr td.active.highlighted:active:hover,.datepicker table tr td.active:active.focus,.datepicker table tr td.active:active:focus,.datepicker table tr td.active:active:hover{color:#fff;background-color:#204d74;border-color:#122b40}.datepicker table tr td.active.disabled.focus,.datepicker table tr td.active.disabled:focus,.datepicker table tr td.active.disabled:hover,.datepicker table tr td.active.highlighted.disabled.focus,.datepicker table tr td.active.highlighted.disabled:focus,.datepicker table tr td.active.highlighted.disabled:hover,.datepicker table tr td.active.highlighted[disabled].focus,.datepicker table tr td.active.highlighted[disabled]:focus,.datepicker table tr td.active.highlighted[disabled]:hover,.datepicker table tr td.active[disabled].focus,.datepicker table tr td.active[disabled]:focus,.datepicker table tr td.active[disabled]:hover,fieldset[disabled] .datepicker table tr td.active.focus,fieldset[disabled] .datepicker table tr td.active.highlighted.focus,fieldset[disabled] .datepicker table tr td.active.highlighted:focus,fieldset[disabled] .datepicker table tr td.active.highlighted:hover,fieldset[disabled] .datepicker table tr td.active:focus,fieldset[disabled] .datepicker table tr td.active:hover{background-color:#337ab7;border-color:#2e6da4}.datepicker table tr td span{display:block;width:23%;height:54px;line-height:54px;float:left;margin:1%;cursor:pointer;border-radius:4px}.datepicker table tr td span.focused,.datepicker table tr td span:hover{background:#eee}.datepicker table tr td span.disabled,.datepicker table tr td span.disabled:hover{background:0 0;color:#777;cursor:default}.datepicker table tr td span.active,.datepicker table tr td span.active.disabled,.datepicker table tr td span.active.disabled:hover,.datepicker table tr td span.active:hover{color:#fff;background-color:#337ab7;border-color:#2e6da4;text-shadow:0 -1px 0 rgba(0,0,0,.25)}.datepicker table tr td span.active.disabled.focus,.datepicker table tr td span.active.disabled:focus,.datepicker table tr td span.active.disabled:hover.focus,.datepicker table tr td span.active.disabled:hover:focus,.datepicker table tr td span.active.focus,.datepicker table tr td span.active:focus,.datepicker table tr td span.active:hover.focus,.datepicker table tr td span.active:hover:focus{color:#fff;background-color:#286090;border-color:#122b40}.datepicker table tr td span.active.disabled:hover,.datepicker table tr td span.active.disabled:hover:hover,.datepicker table tr td span.active:hover,.datepicker table tr td span.active:hover:hover{color:#fff;background-color:#286090;border-color:#204d74}.datepicker table tr td span.active.active,.datepicker table tr td span.active.disabled.active,.datepicker table tr td span.active.disabled:active,.datepicker table tr td span.active.disabled:hover.active,.datepicker table tr td span.active.disabled:hover:active,.datepicker table tr td span.active:active,.datepicker table tr td span.active:hover.active,.datepicker table tr td span.active:hover:active{color:#fff;background-color:#286090;border-color:#204d74}.datepicker table tr td span.active.active.focus,.datepicker table tr td span.active.active:focus,.datepicker table tr td span.active.active:hover,.datepicker table tr td span.active.disabled.active.focus,.datepicker table tr td span.active.disabled.active:focus,.datepicker table tr td span.active.disabled.active:hover,.datepicker table tr td span.active.disabled:active.focus,.datepicker table tr td span.active.disabled:active:focus,.datepicker table tr td span.active.disabled:active:hover,.datepicker table tr td span.active.disabled:hover.active.focus,.datepicker table tr td span.active.disabled:hover.active:focus,.datepicker table tr td span.active.disabled:hover.active:hover,.datepicker table tr td span.active.disabled:hover:active.focus,.datepicker table tr td span.active.disabled:hover:active:focus,.datepicker table tr td span.active.disabled:hover:active:hover,.datepicker table tr td span.active:active.focus,.datepicker table tr td span.active:active:focus,.datepicker table tr td span.active:active:hover,.datepicker table tr td span.active:hover.active.focus,.datepicker table tr td span.active:hover.active:focus,.datepicker table tr td span.active:hover.active:hover,.datepicker table tr td span.active:hover:active.focus,.datepicker table tr td span.active:hover:active:focus,.datepicker table tr td span.active:hover:active:hover{color:#fff;background-color:#204d74;border-color:#122b40}.datepicker table tr td span.active.disabled.disabled.focus,.datepicker table tr td span.active.disabled.disabled:focus,.datepicker table tr td span.active.disabled.disabled:hover,.datepicker table tr td span.active.disabled.focus,.datepicker table tr td span.active.disabled:focus,.datepicker table tr td span.active.disabled:hover,.datepicker table tr td span.active.disabled:hover.disabled.focus,.datepicker table tr td span.active.disabled:hover.disabled:focus,.datepicker table tr td span.active.disabled:hover.disabled:hover,.datepicker table tr td span.active.disabled:hover[disabled].focus,.datepicker table tr td span.active.disabled:hover[disabled]:focus,.datepicker table tr td span.active.disabled:hover[disabled]:hover,.datepicker table tr td span.active.disabled[disabled].focus,.datepicker table tr td span.active.disabled[disabled]:focus,.datepicker table tr td span.active.disabled[disabled]:hover,.datepicker table tr td span.active:hover.disabled.focus,.datepicker table tr td span.active:hover.disabled:focus,.datepicker table tr td span.active:hover.disabled:hover,.datepicker table tr td span.active:hover[disabled].focus,.datepicker table tr td span.active:hover[disabled]:focus,.datepicker table tr td span.active:hover[disabled]:hover,.datepicker table tr td span.active[disabled].focus,.datepicker table tr td span.active[disabled]:focus,.datepicker table tr td span.active[disabled]:hover,fieldset[disabled] .datepicker table tr td span.active.disabled.focus,fieldset[disabled] .datepicker table tr td span.active.disabled:focus,fieldset[disabled] .datepicker table tr td span.active.disabled:hover,fieldset[disabled] .datepicker table tr td span.active.disabled:hover.focus,fieldset[disabled] .datepicker table tr td span.active.disabled:hover:focus,fieldset[disabled] .datepicker table tr td span.active.disabled:hover:hover,fieldset[disabled] .datepicker table tr td span.active.focus,fieldset[disabled] .datepicker table tr td span.active:focus,fieldset[disabled] .datepicker table tr td span.active:hover,fieldset[disabled] .datepicker table tr td span.active:hover.focus,fieldset[disabled] .datepicker table tr td span.active:hover:focus,fieldset[disabled] .datepicker table tr td span.active:hover:hover{background-color:#337ab7;border-color:#2e6da4}.datepicker table tr td span.new,.datepicker table tr td span.old{color:#777}.datepicker .datepicker-switch{width:145px}.datepicker .datepicker-switch,.datepicker .next,.datepicker .prev,.datepicker tfoot tr th{cursor:pointer}.datepicker .datepicker-switch:hover,.datepicker .next:hover,.datepicker .prev:hover,.datepicker tfoot tr th:hover{background:#eee}.datepicker .next.disabled,.datepicker .prev.disabled{visibility:hidden}.datepicker .cw{font-size:10px;width:12px;padding:0 2px 0 5px;vertical-align:middle}.input-group.date .input-group-addon{cursor:pointer}.input-daterange{width:100%}.input-daterange input{text-align:center}.input-daterange input:first-child{border-radius:3px 0 0 3px}.input-daterange input:last-child{border-radius:0 3px 3px 0}.input-daterange .input-group-addon{width:auto;min-width:16px;padding:4px 5px;line-height:1.42857143;border-width:1px 0;margin-left:-5px;margin-right:-5px}
assets/lib/datepicker/js/bootstrap-datepicker.min.js CHANGED
@@ -1,9 +1,8 @@
1
  /*!
2
- * Datepicker for Bootstrap v1.6.1 (https://github.com/eternicode/bootstrap-datepicker)
3
  *
4
- * Copyright 2012 Stefan Petre
5
- * Improvements by Andrew Rowls
6
  * Licensed under the Apache License v2.0 (http://www.apache.org/licenses/LICENSE-2.0)
7
  */
8
- !function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a("object"==typeof exports?require("jquery"):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,b){return a.getUTCFullYear()===b.getUTCFullYear()&&a.getUTCMonth()===b.getUTCMonth()&&a.getUTCDate()===b.getUTCDate()}function f(a){return function(){return this[a].apply(this,arguments)}}function g(a){return a&&!isNaN(a.getTime())}function h(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 i(b){var c={};if(q[b]||(b=b.split("-")[0],q[b])){var d=q[b];return a.each(p,function(a,b){b in d&&(c[b]=d[b])}),c}}var j=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.length=0},copy:function(){var a=new j;return a.replace(this),a}};return function(){var c=[];return c.push.apply(c,arguments),a.extend(c,b),c}}(),k=function(b,c){a(b).data("datepicker",this),this._process_options(c),this.dates=new j,this.viewDate=this.o.defaultViewDate,this.focusDate=null,this.element=a(b),this.isInput=this.element.is("input"),this.inputField=this.isInput?this.element:this.element.find("input"),this.component=this.element.hasClass("date")?this.element.find(".add-on, .input-group-addon, .btn"):!1,this.hasInput=this.component&&this.inputField.length,this.component&&0===this.component.length&&(this.component=!1),this.isInline=!this.component&&this.element.is("div"),this.picker=a(r.template),this._check_template(this.o.templates.leftArrow)&&this.picker.find(".prev").html(this.o.templates.leftArrow),this._check_template(this.o.templates.rightArrow)&&this.picker.find(".next").html(this.o.templates.rightArrow),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("thead .datepicker-title, tfoot .today, tfoot .clear").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.setDaysOfWeekHighlighted(this.o.daysOfWeekHighlighted),this.setDatesDisabled(this.o.datesDisabled),this.fillDow(),this.fillMonths(),this._allow_update=!0,this.update(),this.showMode(),this.isInline&&this.show()};k.prototype={constructor:k,_resolveViewName:function(a,c){return 0===a||"days"===a||"month"===a?0:1===a||"months"===a||"year"===a?1:2===a||"years"===a||"decade"===a?2:3===a||"decades"===a||"century"===a?3:4===a||"centuries"===a||"millennium"===a?4:c===b?!1:c},_check_template:function(c){try{if(c===b||""===c)return!1;if((c.match(/[<>]/g)||[]).length<=0)return!0;var d=a(c);return d.length>0}catch(e){return!1}},_process_options:function(b){this._o=a.extend({},this._o,b);var e=this.o=a.extend({},this._o),f=e.language;q[f]||(f=f.split("-")[0],q[f]||(f=o.language)),e.language=f,e.startView=this._resolveViewName(e.startView,0),e.minViewMode=this._resolveViewName(e.minViewMode,0),e.maxViewMode=this._resolveViewName(e.maxViewMode,4),e.startView=Math.min(e.startView,e.maxViewMode),e.startView=Math.max(e.startView,e.minViewMode),e.multidate!==!0&&(e.multidate=Number(e.multidate)||!1,e.multidate!==!1&&(e.multidate=Math.max(0,e.multidate))),e.multidateSeparator=String(e.multidateSeparator),e.weekStart%=7,e.weekEnd=(e.weekStart+6)%7;var g=r.parseFormat(e.format);e.startDate!==-(1/0)&&(e.startDate?e.startDate instanceof Date?e.startDate=this._local_to_utc(this._zero_time(e.startDate)):e.startDate=r.parseDate(e.startDate,g,e.language,e.assumeNearbyYear):e.startDate=-(1/0)),e.endDate!==1/0&&(e.endDate?e.endDate instanceof Date?e.endDate=this._local_to_utc(this._zero_time(e.endDate)):e.endDate=r.parseDate(e.endDate,g,e.language,e.assumeNearbyYear):e.endDate=1/0),e.daysOfWeekDisabled=e.daysOfWeekDisabled||[],a.isArray(e.daysOfWeekDisabled)||(e.daysOfWeekDisabled=e.daysOfWeekDisabled.split(/[,\s]*/)),e.daysOfWeekDisabled=a.map(e.daysOfWeekDisabled,function(a){return parseInt(a,10)}),e.daysOfWeekHighlighted=e.daysOfWeekHighlighted||[],a.isArray(e.daysOfWeekHighlighted)||(e.daysOfWeekHighlighted=e.daysOfWeekHighlighted.split(/[,\s]*/)),e.daysOfWeekHighlighted=a.map(e.daysOfWeekHighlighted,function(a){return parseInt(a,10)}),e.datesDisabled=e.datesDisabled||[],a.isArray(e.datesDisabled)||(e.datesDisabled=[e.datesDisabled]),e.datesDisabled=a.map(e.datesDisabled,function(a){return r.parseDate(a,g,e.language,e.assumeNearbyYear)});var h=String(e.orientation).toLowerCase().split(/\s+/g),i=e.orientation.toLowerCase();if(h=a.grep(h,function(a){return/^auto|left|right|top|bottom$/.test(a)}),e.orientation={x:"auto",y:"auto"},i&&"auto"!==i)if(1===h.length)switch(h[0]){case"top":case"bottom":e.orientation.y=h[0];break;case"left":case"right":e.orientation.x=h[0]}else i=a.grep(h,function(a){return/^left|right$/.test(a)}),e.orientation.x=i[0]||"auto",i=a.grep(h,function(a){return/^top|bottom$/.test(a)}),e.orientation.y=i[0]||"auto";else;if(e.defaultViewDate){var j=e.defaultViewDate.year||(new Date).getFullYear(),k=e.defaultViewDate.month||0,l=e.defaultViewDate.day||1;e.defaultViewDate=c(j,k,l)}else e.defaultViewDate=d()},_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(){var b={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),paste:a.proxy(this.paste,this)};this.o.showOnFocus===!0&&(b.focus=a.proxy(this.show,this)),this.isInput?this._events=[[this.element,b]]:this.component&&this.hasInput?this._events=[[this.inputField,b],[this.component,{click:a.proxy(this.show,this)}]]:this._events=[[this.element,{click:a.proxy(this.show,this),keydown:a.proxy(this.keydown,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.o.immediateUpdates&&this._events.push([this.element,{"changeYear changeMonth":a.proxy(function(a){this.update(a.date)},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).length||this.picker.is(a.target)||this.picker.find(a.target).length||this.isInline||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 r.formatDate(c,b,this.o.language)},this)})},show:function(){return this.inputField.prop("disabled")||this.inputField.prop("readonly")&&this.o.enableOnReadonly===!1?void 0:(this.isInline||this.picker.appendTo(this.o.container),this.place(),this.picker.show(),this._attachSecondaryEvents(),this._trigger("show"),(window.navigator.msMaxTouchPoints||"ontouchstart"in document)&&this.o.disableTouchKeyboard&&a(this.element).blur(),this)},hide:function(){return this.isInline||!this.picker.is(":visible")?this:(this.focusDate=null,this.picker.hide().detach(),this._detachSecondaryEvents(),this.viewMode=this.o.startView,this.showMode(),this.o.forceParse&&this.inputField.val()&&this.setValue(),this._trigger("hide"),this)},destroy:function(){return this.hide(),this._detachEvents(),this._detachSecondaryEvents(),this.picker.remove(),delete this.element.data().datepicker,this.isInput||delete this.element.data().date,this},paste:function(b){var c;if(b.originalEvent.clipboardData&&b.originalEvent.clipboardData.types&&-1!==a.inArray("text/plain",b.originalEvent.clipboardData.types))c=b.originalEvent.clipboardData.getData("text/plain");else{if(!window.clipboardData)return;c=window.clipboardData.getData("Text")}this.setDate(c),this.update(),b.preventDefault()},_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(){var a=this.dates.get(-1);return"undefined"!=typeof a?new Date(a):null},clearDates:function(){this.inputField&&this.inputField.val(""),this.update(),this._trigger("changeDate"),this.o.autoclose&&this.hide()},setDates:function(){var b=a.isArray(arguments[0])?arguments[0]:arguments;return this.update.apply(this,b),this._trigger("changeDate"),this.setValue(),this},setUTCDates:function(){var b=a.isArray(arguments[0])?arguments[0]:arguments;return this.update.apply(this,a.map(b,this._utc_to_local)),this._trigger("changeDate"),this.setValue(),this},setDate:f("setDates"),setUTCDate:f("setUTCDates"),remove:f("destroy"),setValue:function(){var a=this.getFormattedDate();return this.inputField.val(a),this},getFormattedDate:function(c){c===b&&(c=this.o.format);var d=this.o.language;return a.map(this.dates,function(a){return r.formatDate(a,c,d)}).join(this.o.multidateSeparator)},getStartDate:function(){return this.o.startDate},setStartDate:function(a){return this._process_options({startDate:a}),this.update(),this.updateNavArrows(),this},getEndDate:function(){return this.o.endDate},setEndDate:function(a){return this._process_options({endDate:a}),this.update(),this.updateNavArrows(),this},setDaysOfWeekDisabled:function(a){return this._process_options({daysOfWeekDisabled:a}),this.update(),this.updateNavArrows(),this},setDaysOfWeekHighlighted:function(a){return this._process_options({daysOfWeekHighlighted:a}),this.update(),this},setDatesDisabled:function(a){this._process_options({datesDisabled:a}),this.update(),this.updateNavArrows()},place:function(){if(this.isInline)return this;var b=this.picker.outerWidth(),c=this.picker.outerHeight(),d=10,e=a(this.o.container),f=e.width(),g="body"===this.o.container?a(document).scrollTop():e.scrollTop(),h=e.offset(),i=[];this.element.parents().each(function(){var b=a(this).css("z-index");"auto"!==b&&0!==b&&i.push(parseInt(b))});var j=Math.max.apply(Math,i)+this.o.zIndexOffset,k=this.component?this.component.parent().offset():this.element.offset(),l=this.component?this.component.outerHeight(!0):this.element.outerHeight(!1),m=this.component?this.component.outerWidth(!0):this.element.outerWidth(!1),n=k.left-h.left,o=k.top-h.top;"body"!==this.o.container&&(o+=g),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&&(n-=b-m)):k.left<0?(this.picker.addClass("datepicker-orient-left"),n-=k.left-d):n+b>f?(this.picker.addClass("datepicker-orient-right"),n+=m-b):this.picker.addClass("datepicker-orient-left");var p,q=this.o.orientation.y;if("auto"===q&&(p=-g+o-c,q=0>p?"bottom":"top"),this.picker.addClass("datepicker-orient-"+q),"top"===q?o-=c+parseInt(this.picker.css("padding-top")):o+=l,this.o.rtl){var r=f-(n+m);this.picker.css({top:o,right:r,zIndex:j})}else this.picker.css({top:o,left:n,zIndex:j});return this},_allow_update:!0,update:function(){if(!this._allow_update)return this;var b=this.dates.copy(),c=[],d=!1;return 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.inputField.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 r.parseDate(a,this.o.format,this.o.language,this.o.assumeNearbyYear)},this)),c=a.grep(c,a.proxy(function(a){return!this.dateWithinRange(a)||!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):this.viewDate=this.o.defaultViewDate,d?this.setValue():c.length&&String(b)!==String(this.dates)&&this._trigger("changeDate"),!this.dates.length&&b.length&&this._trigger("clearDate"),this.fill(),this.element.change(),this},fillDow:function(){var b=this.o.weekStart,c="<tr>";for(this.o.calendarWeeks&&(this.picker.find(".datepicker-days .datepicker-switch").attr("colspan",function(a,b){return parseInt(b)+1}),c+='<th class="cw">&#160;</th>');b<this.o.weekStart+7;)c+='<th class="dow',a.inArray(b,this.o.daysOfWeekDisabled)>-1&&(c+=" disabled"),c+='">'+q[this.o.language].daysMin[b++%7]+"</th>";c+="</tr>",this.picker.find(".datepicker-days thead").append(c)},fillMonths:function(){for(var a=this._utc_to_local(this.viewDate),b="",c=0;12>c;){var d=a&&a.getMonth()===c?" focused":"";b+='<span class="month'+d+'">'+q[this.o.language].monthsShort[c++]+"</span>"}this.picker.find(".datepicker-months td").html(b)},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"),this.dateWithinRange(b)||c.push("disabled"),this.dateIsDisabled(b)&&c.push("disabled","disabled-date"),-1!==a.inArray(b.getUTCDay(),this.o.daysOfWeekHighlighted)&&c.push("highlighted"),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"),b.valueOf()===this.range[0]&&c.push("range-start"),b.valueOf()===this.range[this.range.length-1]&&c.push("range-end")),c},_fill_yearsView:function(c,d,e,f,g,h,i,j){var k,l,m,n,o,p,q,r,s,t,u;for(k="",l=this.picker.find(c),m=parseInt(g/e,10)*e,o=parseInt(h/f,10)*f,p=parseInt(i/f,10)*f,n=a.map(this.dates,function(a){return parseInt(a.getUTCFullYear()/f,10)*f}),l.find(".datepicker-switch").text(m+"-"+(m+9*f)),q=m-f,r=-1;11>r;r+=1)s=[d],t=null,-1===r?s.push("old"):10===r&&s.push("new"),-1!==a.inArray(q,n)&&s.push("active"),(o>q||q>p)&&s.push("disabled"),q===this.viewDate.getFullYear()&&s.push("focused"),j!==a.noop&&(u=j(new Date(q,0,1)),u===b?u={}:"boolean"==typeof u?u={enabled:u}:"string"==typeof u&&(u={classes:u}),u.enabled===!1&&s.push("disabled"),u.classes&&(s=s.concat(u.classes.split(/\s+/))),u.tooltip&&(t=u.tooltip)),k+='<span class="'+s.join(" ")+'"'+(t?' title="'+t+'"':"")+">"+q+"</span>",q+=f;l.find("td").html(k)},fill:function(){var d,e,f=new Date(this.viewDate),g=f.getUTCFullYear(),h=f.getUTCMonth(),i=this.o.startDate!==-(1/0)?this.o.startDate.getUTCFullYear():-(1/0),j=this.o.startDate!==-(1/0)?this.o.startDate.getUTCMonth():-(1/0),k=this.o.endDate!==1/0?this.o.endDate.getUTCFullYear():1/0,l=this.o.endDate!==1/0?this.o.endDate.getUTCMonth():1/0,m=q[this.o.language].today||q.en.today||"",n=q[this.o.language].clear||q.en.clear||"",o=q[this.o.language].titleFormat||q.en.titleFormat;if(!isNaN(g)&&!isNaN(h)){this.picker.find(".datepicker-days .datepicker-switch").text(r.formatDate(f,o,this.o.language)),this.picker.find("tfoot .today").text(m).toggle(this.o.todayBtn!==!1),this.picker.find("tfoot .clear").text(n).toggle(this.o.clearBtn!==!1),this.picker.find("thead .datepicker-title").text(this.o.title).toggle(""!==this.o.title),this.updateNavArrows(),this.fillMonths();var p=c(g,h-1,28),s=r.getDaysInMonth(p.getUTCFullYear(),p.getUTCMonth());p.setUTCDate(s),p.setUTCDate(s-(p.getUTCDay()-this.o.weekStart+7)%7);var t=new Date(p);p.getUTCFullYear()<100&&t.setUTCFullYear(p.getUTCFullYear()),t.setUTCDate(t.getUTCDate()+42),t=t.valueOf();for(var u,v=[];p.valueOf()<t;){if(p.getUTCDay()===this.o.weekStart&&(v.push("<tr>"),this.o.calendarWeeks)){var w=new Date(+p+(this.o.weekStart-p.getUTCDay()-7)%7*864e5),x=new Date(Number(w)+(11-w.getUTCDay())%7*864e5),y=new Date(Number(y=c(x.getUTCFullYear(),0,1))+(11-y.getUTCDay())%7*864e5),z=(x-y)/864e5/7+1;v.push('<td class="cw">'+z+"</td>")}u=this.getClassNames(p),u.push("day"),this.o.beforeShowDay!==a.noop&&(e=this.o.beforeShowDay(this._utc_to_local(p)),e===b?e={}:"boolean"==typeof e?e={enabled:e}:"string"==typeof e&&(e={classes:e}),e.enabled===!1&&u.push("disabled"),e.classes&&(u=u.concat(e.classes.split(/\s+/))),e.tooltip&&(d=e.tooltip)),u=a.unique(u),v.push('<td class="'+u.join(" ")+'"'+(d?' title="'+d+'"':"")+">"+p.getUTCDate()+"</td>"),d=null,p.getUTCDay()===this.o.weekEnd&&v.push("</tr>"),p.setUTCDate(p.getUTCDate()+1)}this.picker.find(".datepicker-days tbody").empty().append(v.join(""));var A=q[this.o.language].monthsTitle||q.en.monthsTitle||"Months",B=this.picker.find(".datepicker-months").find(".datepicker-switch").text(this.o.maxViewMode<2?A:g).end().find("span").removeClass("active");if(a.each(this.dates,function(a,b){b.getUTCFullYear()===g&&B.eq(b.getUTCMonth()).addClass("active")}),(i>g||g>k)&&B.addClass("disabled"),g===i&&B.slice(0,j).addClass("disabled"),g===k&&B.slice(l+1).addClass("disabled"),this.o.beforeShowMonth!==a.noop){var C=this;a.each(B,function(c,d){var e=new Date(g,c,1),f=C.o.beforeShowMonth(e);f===b?f={}:"boolean"==typeof f?f={enabled:f}:"string"==typeof f&&(f={classes:f}),f.enabled!==!1||a(d).hasClass("disabled")||a(d).addClass("disabled"),f.classes&&a(d).addClass(f.classes),f.tooltip&&a(d).prop("title",f.tooltip)})}this._fill_yearsView(".datepicker-years","year",10,1,g,i,k,this.o.beforeShowYear),this._fill_yearsView(".datepicker-decades","decade",100,10,g,i,k,this.o.beforeShowDecade),this._fill_yearsView(".datepicker-centuries","century",1e3,100,g,i,k,this.o.beforeShowCentury)}},updateNavArrows:function(){if(this._allow_update){var a=new Date(this.viewDate),b=a.getUTCFullYear(),c=a.getUTCMonth();switch(this.viewMode){case 0:this.o.startDate!==-(1/0)&&b<=this.o.startDate.getUTCFullYear()&&c<=this.o.startDate.getUTCMonth()?this.picker.find(".prev").css({visibility:"hidden"}):this.picker.find(".prev").css({visibility:"visible"}),this.o.endDate!==1/0&&b>=this.o.endDate.getUTCFullYear()&&c>=this.o.endDate.getUTCMonth()?this.picker.find(".next").css({visibility:"hidden"}):this.picker.find(".next").css({visibility:"visible"});break;case 1:case 2:case 3:case 4:this.o.startDate!==-(1/0)&&b<=this.o.startDate.getUTCFullYear()||this.o.maxViewMode<2?this.picker.find(".prev").css({visibility:"hidden"}):this.picker.find(".prev").css({visibility:"visible"}),this.o.endDate!==1/0&&b>=this.o.endDate.getUTCFullYear()||this.o.maxViewMode<2?this.picker.find(".next").css({visibility:"hidden"}):this.picker.find(".next").css({visibility:"visible"})}}},click:function(b){b.preventDefault(),b.stopPropagation();var e,f,g,h,i,j,k;e=a(b.target),e.hasClass("datepicker-switch")&&this.showMode(1);var l=e.closest(".prev, .next");l.length>0&&(f=r.modes[this.viewMode].navStep*(l.hasClass("prev")?-1:1),0===this.viewMode?(this.viewDate=this.moveMonth(this.viewDate,f),this._trigger("changeMonth",this.viewDate)):(this.viewDate=this.moveYear(this.viewDate,f),1===this.viewMode&&this._trigger("changeYear",this.viewDate)),this.fill()),e.hasClass("today")&&!e.hasClass("day")&&(this.showMode(-2),this._setDate(d(),"linked"===this.o.todayBtn?null:"view")),e.hasClass("clear")&&this.clearDates(),e.hasClass("disabled")||(e.hasClass("day")&&(g=parseInt(e.text(),10)||1,h=this.viewDate.getUTCFullYear(),i=this.viewDate.getUTCMonth(),e.hasClass("old")&&(0===i?(i=11,h-=1,j=!0,k=!0):(i-=1,j=!0)),e.hasClass("new")&&(11===i?(i=0,h+=1,j=!0,k=!0):(i+=1,j=!0)),this._setDate(c(h,i,g)),k&&this._trigger("changeYear",this.viewDate),j&&this._trigger("changeMonth",this.viewDate)),e.hasClass("month")&&(this.viewDate.setUTCDate(1),g=1,i=e.parent().find("span").index(e),h=this.viewDate.getUTCFullYear(),this.viewDate.setUTCMonth(i),this._trigger("changeMonth",this.viewDate),1===this.o.minViewMode?(this._setDate(c(h,i,g)),this.showMode()):this.showMode(-1),this.fill()),(e.hasClass("year")||e.hasClass("decade")||e.hasClass("century"))&&(this.viewDate.setUTCDate(1),g=1,i=0,h=parseInt(e.text(),10)||0,this.viewDate.setUTCFullYear(h),e.hasClass("year")&&(this._trigger("changeYear",this.viewDate),2===this.o.minViewMode&&this._setDate(c(h,i,g))),e.hasClass("decade")&&(this._trigger("changeDecade",this.viewDate),3===this.o.minViewMode&&this._setDate(c(h,i,g))),e.hasClass("century")&&(this._trigger("changeCentury",this.viewDate),4===this.o.minViewMode&&this._setDate(c(h,i,g))),this.showMode(-1),this.fill())),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||this.dates.clear(),-1!==b?(this.o.multidate===!0||this.o.multidate>1||this.o.toggleActive)&&this.dates.remove(b):this.o.multidate===!1?(this.dates.clear(),this.dates.push(a)):this.dates.push(a),"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(),b&&"view"===b||this._trigger("changeDate"),this.inputField&&this.inputField.change(),!this.o.autoclose||b&&"date"!==b||this.hide()},moveDay:function(a,b){var c=new Date(a);return c.setUTCDate(a.getUTCDate()+b),c},moveWeek:function(a,b){return this.moveDay(a,7*b)},moveMonth:function(a,b){if(!g(a))return this.o.defaultViewDate;if(!b)return a;var c,d,e=new Date(a.valueOf()),f=e.getUTCDate(),h=e.getUTCMonth(),i=Math.abs(b);if(b=b>0?1:-1,1===i)d=-1===b?function(){return e.getUTCMonth()===h}:function(){return e.getUTCMonth()!==c},c=h+b,e.setUTCMonth(c),(0>c||c>11)&&(c=(c+12)%12);else{for(var j=0;i>j;j++)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)},moveAvailableDate:function(a,b,c){do{if(a=this[c](a,b),!this.dateWithinRange(a))return!1;c="moveDay"}while(this.dateIsDisabled(a));return a},weekOfDateIsDisabled:function(b){return-1!==a.inArray(b.getUTCDay(),this.o.daysOfWeekDisabled)},dateIsDisabled:function(b){return this.weekOfDateIsDisabled(b)||a.grep(this.o.datesDisabled,function(a){return e(b,a)}).length>0},dateWithinRange:function(a){return a>=this.o.startDate&&a<=this.o.endDate},keydown:function(a){if(!this.picker.is(":visible"))return void((40===a.keyCode||27===a.keyCode)&&(this.show(),a.stopPropagation()));var b,c,d=!1,e=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(),a.stopPropagation();break;case 37:case 38:case 39:case 40:if(!this.o.keyboardNavigation||7===this.o.daysOfWeekDisabled.length)break;b=37===a.keyCode||38===a.keyCode?-1:1,0===this.viewMode?a.ctrlKey?(c=this.moveAvailableDate(e,b,"moveYear"),c&&this._trigger("changeYear",this.viewDate)):a.shiftKey?(c=this.moveAvailableDate(e,b,"moveMonth"),c&&this._trigger("changeMonth",this.viewDate)):37===a.keyCode||39===a.keyCode?c=this.moveAvailableDate(e,b,"moveDay"):this.weekOfDateIsDisabled(e)||(c=this.moveAvailableDate(e,b,"moveWeek")):1===this.viewMode?((38===a.keyCode||40===a.keyCode)&&(b=4*b),c=this.moveAvailableDate(e,b,"moveMonth")):2===this.viewMode&&((38===a.keyCode||40===a.keyCode)&&(b=4*b),c=this.moveAvailableDate(e,b,"moveYear")),c&&(this.focusDate=this.viewDate=c,this.setValue(),this.fill(),a.preventDefault());break;case 13:if(!this.o.forceParse)break;e=this.focusDate||this.dates.get(-1)||this.viewDate,this.o.keyboardNavigation&&(this._toggle_multidate(e),d=!0),this.focusDate=null,this.viewDate=this.dates.get(-1)||this.viewDate,this.setValue(),this.fill(),this.picker.is(":visible")&&(a.preventDefault(),a.stopPropagation(),this.o.autoclose&&this.hide());break;case 9:this.focusDate=null,this.viewDate=this.dates.get(-1)||this.viewDate,this.fill(),this.hide()}d&&(this.dates.length?this._trigger("changeDate"):this._trigger("clearDate"),this.inputField&&this.inputField.change())},showMode:function(a){a&&(this.viewMode=Math.max(this.o.minViewMode,Math.min(this.o.maxViewMode,this.viewMode+a))),this.picker.children("div").hide().filter(".datepicker-"+r.modes[this.viewMode].clsName).show(),this.updateNavArrows()}};var l=function(b,c){a(b).data("datepicker",this),this.element=a(b),this.inputs=a.map(c.inputs,function(a){return a.jquery?a[0]:a}),delete c.inputs,n.call(a(this.inputs),c).on("changeDate",a.proxy(this.dateUpdated,this)),this.pickers=a.map(this.inputs,function(b){return a(b).data("datepicker")}),this.updateDates()};l.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");if("undefined"!=typeof c){var d=c.getUTCDate(),e=a.inArray(b.target,this.inputs),f=e-1,g=e+1,h=this.inputs.length;if(-1!==e){if(a.each(this.pickers,function(a,b){b.getUTCDate()||b.setUTCDate(d)}),d<this.dates[f])for(;f>=0&&d<this.dates[f];)this.pickers[f--].setUTCDate(d);else if(d>this.dates[g])for(;h>g&&d>this.dates[g];)this.pickers[g++].setUTCDate(d);this.updateDates(),delete this.updating}}}},remove:function(){a.map(this.pickers,function(a){a.remove()}),delete this.element.data().datepicker}};var m=a.fn.datepicker,n=function(c){var d=Array.apply(null,arguments);d.shift();var e;if(this.each(function(){var b=a(this),f=b.data("datepicker"),g="object"==typeof c&&c;if(!f){var j=h(this,"date"),m=a.extend({},o,j,g),n=i(m.language),p=a.extend({},o,n,j,g);b.hasClass("input-daterange")||p.inputs?(a.extend(p,{inputs:p.inputs||b.find("input").toArray()}),f=new l(this,p)):f=new k(this,p),b.data("datepicker",f)}"string"==typeof c&&"function"==typeof f[c]&&(e=f[c].apply(f,d))}),e===b||e instanceof k||e instanceof l)return this;if(this.length>1)throw new Error("Using only allowed for the collection of a single element ("+c+" function)");return e};a.fn.datepicker=n;var o=a.fn.datepicker.defaults={assumeNearbyYear:!1,autoclose:!1,beforeShowDay:a.noop,beforeShowMonth:a.noop,beforeShowYear:a.noop,beforeShowDecade:a.noop,beforeShowCentury:a.noop,calendarWeeks:!1,clearBtn:!1,toggleActive:!1,daysOfWeekDisabled:[],daysOfWeekHighlighted:[],datesDisabled:[],endDate:1/0,forceParse:!0,format:"mm/dd/yyyy",keyboardNavigation:!0,language:"en",minViewMode:0,maxViewMode:4,multidate:!1,multidateSeparator:",",orientation:"auto",rtl:!1,startDate:-(1/0),startView:0,todayBtn:!1,todayHighlight:!1,weekStart:0,disableTouchKeyboard:!1,enableOnReadonly:!0,showOnFocus:!0,zIndexOffset:10,container:"body",immediateUpdates:!1,title:"",templates:{leftArrow:"&laquo;",rightArrow:"&raquo;"}},p=a.fn.datepicker.locale_opts=["format","rtl","weekStart"];a.fn.datepicker.Constructor=k;var q=a.fn.datepicker.dates={en:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa"],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",titleFormat:"MM yyyy"}},r={modes:[{clsName:"days",navFnc:"Month",navStep:1},{clsName:"months",navFnc:"FullYear",navStep:1},{clsName:"years",navFnc:"FullYear",navStep:10},{clsName:"decades",navFnc:"FullDecade",navStep:100},{clsName:"centuries",navFnc:"FullCentury",navStep:1e3}],isLeapYear:function(a){return a%4===0&&a%100!==0||a%400===0},getDaysInMonth:function(a,b){return[31,r.isLeapYear(a)?29:28,31,30,31,30,31,31,30,31,30,31][b]},validParts:/dd?|DD?|mm?|MM?|yy(?:yy)?/g,nonpunctuation:/[^ -\/:-@\u5e74\u6708\u65e5\[-`{-~\t\n\r]+/g,parseFormat:function(a){if("function"==typeof a.toValue&&"function"==typeof a.toDisplay)return 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(e,f,g,h){function i(a,b){return b===!0&&(b=10),100>a&&(a+=2e3,a>(new Date).getFullYear()+b&&(a-=100)),a}function j(){var a=this.slice(0,s[n].length),b=s[n].slice(0,a.length);return a.toLowerCase()===b.toLowerCase()}if(!e)return b;if(e instanceof Date)return e;if("string"==typeof f&&(f=r.parseFormat(f)),f.toValue)return f.toValue(e,f,g);var l,m,n,o,p=/([\-+]\d+)([dmwy])/,s=e.match(/([\-+]\d+)([dmwy])/g),t={d:"moveDay",m:"moveMonth",w:"moveWeek",y:"moveYear"},u={yesterday:"-1d",today:"+0d",tomorrow:"+1d"};if(/^[\-+]\d+[dmwy]([\s,]+[\-+]\d+[dmwy])*$/.test(e)){for(e=new Date,n=0;n<s.length;n++)l=p.exec(s[n]),m=parseInt(l[1]),o=t[l[2]],e=k.prototype[o](e,m);return c(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate())}if("undefined"!=typeof u[e]&&(e=u[e],s=e.match(/([\-+]\d+)([dmwy])/g),/^[\-+]\d+[dmwy]([\s,]+[\-+]\d+[dmwy])*$/.test(e))){for(e=new Date,n=0;n<s.length;n++)l=p.exec(s[n]),m=parseInt(l[1]),o=t[l[2]],e=k.prototype[o](e,m);return c(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate())}s=e&&e.match(this.nonpunctuation)||[],e=new Date;var v,w,x={},y=["yyyy","yy","M","MM","m","mm","d","dd"],z={yyyy:function(a,b){return a.setUTCFullYear(h?i(b,h):b)},yy:function(a,b){return a.setUTCFullYear(h?i(b,h):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)}};z.M=z.MM=z.mm=z.m,z.dd=z.d,e=d();var A=f.parts.slice();if(s.length!==A.length&&(A=a(A).filter(function(b,c){return-1!==a.inArray(c,y)}).toArray()),s.length===A.length){var B;for(n=0,B=A.length;B>n;n++){if(v=parseInt(s[n],10),l=A[n],isNaN(v))switch(l){case"MM":w=a(q[g].months).filter(j),v=a.inArray(w[0],q[g].months)+1;break;case"M":w=a(q[g].monthsShort).filter(j),v=a.inArray(w[0],q[g].monthsShort)+1}x[l]=v}var C,D;for(n=0;n<y.length;n++)D=y[n],D in x&&!isNaN(x[D])&&(C=new Date(e),z[D](C,x[D]),isNaN(C)||(e=C))}return e},formatDate:function(b,c,d){if(!b)return"";if("string"==typeof c&&(c=r.parseFormat(c)),c.toDisplay)return c.toDisplay(b,c,d);
9
- var e={d:b.getUTCDate(),D:q[d].daysShort[b.getUTCDay()],DD:q[d].days[b.getUTCDay()],m:b.getUTCMonth()+1,M:q[d].monthsShort[b.getUTCMonth()],MM:q[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 colspan="7" class="datepicker-title"></th></tr><tr><th class="prev">&laquo;</th><th colspan="5" class="datepicker-switch"></th><th class="next">&raquo;</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>'};r.template='<div class="datepicker"><div class="datepicker-days"><table class="table-condensed">'+r.headTemplate+"<tbody></tbody>"+r.footTemplate+'</table></div><div class="datepicker-months"><table class="table-condensed">'+r.headTemplate+r.contTemplate+r.footTemplate+'</table></div><div class="datepicker-years"><table class="table-condensed">'+r.headTemplate+r.contTemplate+r.footTemplate+'</table></div><div class="datepicker-decades"><table class="table-condensed">'+r.headTemplate+r.contTemplate+r.footTemplate+'</table></div><div class="datepicker-centuries"><table class="table-condensed">'+r.headTemplate+r.contTemplate+r.footTemplate+"</table></div></div>",a.fn.datepicker.DPGlobal=r,a.fn.datepicker.noConflict=function(){return a.fn.datepicker=m,this},a.fn.datepicker.version="1.6.1",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(),n.call(c,"show"))}),a(function(){n.call(a('[data-provide="datepicker-inline"]'))})});
 
1
  /*!
2
+ * Datepicker for Bootstrap v1.9.0 (https://github.com/uxsolutions/bootstrap-datepicker)
3
  *
 
 
4
  * Licensed under the Apache License v2.0 (http://www.apache.org/licenses/LICENSE-2.0)
5
  */
6
+
7
+ !function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a("object"==typeof exports?require("jquery"):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,b){return a.getUTCFullYear()===b.getUTCFullYear()&&a.getUTCMonth()===b.getUTCMonth()&&a.getUTCDate()===b.getUTCDate()}function f(c,d){return function(){return d!==b&&a.fn.datepicker.deprecated(d),this[c].apply(this,arguments)}}function g(a){return a&&!isNaN(a.getTime())}function h(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 i(b){var c={};if(q[b]||(b=b.split("-")[0],q[b])){var d=q[b];return a.each(p,function(a,b){b in d&&(c[b]=d[b])}),c}}var j=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;c<d;c++)if(0<=this[c].valueOf()-b&&this[c].valueOf()-b<864e5)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.length=0},copy:function(){var a=new j;return a.replace(this),a}};return function(){var c=[];return c.push.apply(c,arguments),a.extend(c,b),c}}(),k=function(b,c){a.data(b,"datepicker",this),this._events=[],this._secondaryEvents=[],this._process_options(c),this.dates=new j,this.viewDate=this.o.defaultViewDate,this.focusDate=null,this.element=a(b),this.isInput=this.element.is("input"),this.inputField=this.isInput?this.element:this.element.find("input"),this.component=!!this.element.hasClass("date")&&this.element.find(".add-on, .input-group-addon, .input-group-append, .input-group-prepend, .btn"),this.component&&0===this.component.length&&(this.component=!1),this.isInline=!this.component&&this.element.is("div"),this.picker=a(r.template),this._check_template(this.o.templates.leftArrow)&&this.picker.find(".prev").html(this.o.templates.leftArrow),this._check_template(this.o.templates.rightArrow)&&this.picker.find(".next").html(this.o.templates.rightArrow),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.o.calendarWeeks&&this.picker.find(".datepicker-days .datepicker-switch, thead .datepicker-title, tfoot .today, tfoot .clear").attr("colspan",function(a,b){return Number(b)+1}),this._process_options({startDate:this._o.startDate,endDate:this._o.endDate,daysOfWeekDisabled:this.o.daysOfWeekDisabled,daysOfWeekHighlighted:this.o.daysOfWeekHighlighted,datesDisabled:this.o.datesDisabled}),this._allow_update=!1,this.setViewMode(this.o.startView),this._allow_update=!0,this.fillDow(),this.fillMonths(),this.update(),this.isInline&&this.show()};k.prototype={constructor:k,_resolveViewName:function(b){return a.each(r.viewModes,function(c,d){if(b===c||-1!==a.inArray(b,d.names))return b=c,!1}),b},_resolveDaysOfWeek:function(b){return a.isArray(b)||(b=b.split(/[,\s]*/)),a.map(b,Number)},_check_template:function(c){try{if(c===b||""===c)return!1;if((c.match(/[<>]/g)||[]).length<=0)return!0;return a(c).length>0}catch(a){return!1}},_process_options:function(b){this._o=a.extend({},this._o,b);var e=this.o=a.extend({},this._o),f=e.language;q[f]||(f=f.split("-")[0],q[f]||(f=o.language)),e.language=f,e.startView=this._resolveViewName(e.startView),e.minViewMode=this._resolveViewName(e.minViewMode),e.maxViewMode=this._resolveViewName(e.maxViewMode),e.startView=Math.max(this.o.minViewMode,Math.min(this.o.maxViewMode,e.startView)),!0!==e.multidate&&(e.multidate=Number(e.multidate)||!1,!1!==e.multidate&&(e.multidate=Math.max(0,e.multidate))),e.multidateSeparator=String(e.multidateSeparator),e.weekStart%=7,e.weekEnd=(e.weekStart+6)%7;var g=r.parseFormat(e.format);e.startDate!==-1/0&&(e.startDate?e.startDate instanceof Date?e.startDate=this._local_to_utc(this._zero_time(e.startDate)):e.startDate=r.parseDate(e.startDate,g,e.language,e.assumeNearbyYear):e.startDate=-1/0),e.endDate!==1/0&&(e.endDate?e.endDate instanceof Date?e.endDate=this._local_to_utc(this._zero_time(e.endDate)):e.endDate=r.parseDate(e.endDate,g,e.language,e.assumeNearbyYear):e.endDate=1/0),e.daysOfWeekDisabled=this._resolveDaysOfWeek(e.daysOfWeekDisabled||[]),e.daysOfWeekHighlighted=this._resolveDaysOfWeek(e.daysOfWeekHighlighted||[]),e.datesDisabled=e.datesDisabled||[],a.isArray(e.datesDisabled)||(e.datesDisabled=e.datesDisabled.split(",")),e.datesDisabled=a.map(e.datesDisabled,function(a){return r.parseDate(a,g,e.language,e.assumeNearbyYear)});var h=String(e.orientation).toLowerCase().split(/\s+/g),i=e.orientation.toLowerCase();if(h=a.grep(h,function(a){return/^auto|left|right|top|bottom$/.test(a)}),e.orientation={x:"auto",y:"auto"},i&&"auto"!==i)if(1===h.length)switch(h[0]){case"top":case"bottom":e.orientation.y=h[0];break;case"left":case"right":e.orientation.x=h[0]}else i=a.grep(h,function(a){return/^left|right$/.test(a)}),e.orientation.x=i[0]||"auto",i=a.grep(h,function(a){return/^top|bottom$/.test(a)}),e.orientation.y=i[0]||"auto";else;if(e.defaultViewDate instanceof Date||"string"==typeof e.defaultViewDate)e.defaultViewDate=r.parseDate(e.defaultViewDate,g,e.language,e.assumeNearbyYear);else if(e.defaultViewDate){var j=e.defaultViewDate.year||(new Date).getFullYear(),k=e.defaultViewDate.month||0,l=e.defaultViewDate.day||1;e.defaultViewDate=c(j,k,l)}else e.defaultViewDate=d()},_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(){var b={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),paste:a.proxy(this.paste,this)};!0===this.o.showOnFocus&&(b.focus=a.proxy(this.show,this)),this.isInput?this._events=[[this.element,b]]:this.component&&this.inputField.length?this._events=[[this.inputField,b],[this.component,{click:a.proxy(this.show,this)}]]:this._events=[[this.element,{click:a.proxy(this.show,this),keydown:a.proxy(this.keydown,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.o.immediateUpdates&&this._events.push([this.element,{"changeYear changeMonth":a.proxy(function(a){this.update(a.date)},this)}]),this._secondaryEvents=[[this.picker,{click:a.proxy(this.click,this)}],[this.picker,".prev, .next",{click:a.proxy(this.navArrowsClick,this)}],[this.picker,".day:not(.disabled)",{click:a.proxy(this.dayCellClick,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.isInline||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,viewMode:this.viewMode,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 r.formatDate(c,b,this.o.language)},this)})},show:function(){if(!(this.inputField.is(":disabled")||this.inputField.prop("readonly")&&!1===this.o.enableOnReadonly))return this.isInline||this.picker.appendTo(this.o.container),this.place(),this.picker.show(),this._attachSecondaryEvents(),this._trigger("show"),(window.navigator.msMaxTouchPoints||"ontouchstart"in document)&&this.o.disableTouchKeyboard&&a(this.element).blur(),this},hide:function(){return this.isInline||!this.picker.is(":visible")?this:(this.focusDate=null,this.picker.hide().detach(),this._detachSecondaryEvents(),this.setViewMode(this.o.startView),this.o.forceParse&&this.inputField.val()&&this.setValue(),this._trigger("hide"),this)},destroy:function(){return this.hide(),this._detachEvents(),this._detachSecondaryEvents(),this.picker.remove(),delete this.element.data().datepicker,this.isInput||delete this.element.data().date,this},paste:function(b){var c;if(b.originalEvent.clipboardData&&b.originalEvent.clipboardData.types&&-1!==a.inArray("text/plain",b.originalEvent.clipboardData.types))c=b.originalEvent.clipboardData.getData("text/plain");else{if(!window.clipboardData)return;c=window.clipboardData.getData("Text")}this.setDate(c),this.update(),b.preventDefault()},_utc_to_local:function(a){if(!a)return a;var b=new Date(a.getTime()+6e4*a.getTimezoneOffset());return b.getTimezoneOffset()!==a.getTimezoneOffset()&&(b=new Date(a.getTime()+6e4*b.getTimezoneOffset())),b},_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&&c(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(){var a=this.dates.get(-1);return a!==b?new Date(a):null},clearDates:function(){this.inputField.val(""),this.update(),this._trigger("changeDate"),this.o.autoclose&&this.hide()},setDates:function(){var b=a.isArray(arguments[0])?arguments[0]:arguments;return this.update.apply(this,b),this._trigger("changeDate"),this.setValue(),this},setUTCDates:function(){var b=a.isArray(arguments[0])?arguments[0]:arguments;return this.setDates.apply(this,a.map(b,this._utc_to_local)),this},setDate:f("setDates"),setUTCDate:f("setUTCDates"),remove:f("destroy","Method `remove` is deprecated and will be removed in version 2.0. Use `destroy` instead"),setValue:function(){var a=this.getFormattedDate();return this.inputField.val(a),this},getFormattedDate:function(c){c===b&&(c=this.o.format);var d=this.o.language;return a.map(this.dates,function(a){return r.formatDate(a,c,d)}).join(this.o.multidateSeparator)},getStartDate:function(){return this.o.startDate},setStartDate:function(a){return this._process_options({startDate:a}),this.update(),this.updateNavArrows(),this},getEndDate:function(){return this.o.endDate},setEndDate:function(a){return this._process_options({endDate:a}),this.update(),this.updateNavArrows(),this},setDaysOfWeekDisabled:function(a){return this._process_options({daysOfWeekDisabled:a}),this.update(),this},setDaysOfWeekHighlighted:function(a){return this._process_options({daysOfWeekHighlighted:a}),this.update(),this},setDatesDisabled:function(a){return this._process_options({datesDisabled:a}),this.update(),this},place:function(){if(this.isInline)return this;var b=this.picker.outerWidth(),c=this.picker.outerHeight(),d=a(this.o.container),e=d.width(),f="body"===this.o.container?a(document).scrollTop():d.scrollTop(),g=d.offset(),h=[0];this.element.parents().each(function(){var b=a(this).css("z-index");"auto"!==b&&0!==Number(b)&&h.push(Number(b))});var i=Math.max.apply(Math,h)+this.o.zIndexOffset,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-g.left,n=j.top-g.top;"body"!==this.o.container&&(n+=f),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)):j.left<0?(this.picker.addClass("datepicker-orient-left"),m-=j.left-10):m+b>e?(this.picker.addClass("datepicker-orient-right"),m+=l-b):this.o.rtl?this.picker.addClass("datepicker-orient-right"):this.picker.addClass("datepicker-orient-left");var o,p=this.o.orientation.y;if("auto"===p&&(o=-f+n-c,p=o<0?"bottom":"top"),this.picker.addClass("datepicker-orient-"+p),"top"===p?n-=c+parseInt(this.picker.css("padding-top")):n+=k,this.o.rtl){var q=e-(m+l);this.picker.css({top:n,right:q,zIndex:i})}else this.picker.css({top:n,left:m,zIndex:i});return this},_allow_update:!0,update:function(){if(!this._allow_update)return this;var b=this.dates.copy(),c=[],d=!1;return 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.inputField.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 r.parseDate(a,this.o.format,this.o.language,this.o.assumeNearbyYear)},this)),c=a.grep(c,a.proxy(function(a){return!this.dateWithinRange(a)||!a},this),!0),this.dates.replace(c),this.o.updateViewDate&&(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):this.viewDate=this.o.defaultViewDate),d?(this.setValue(),this.element.change()):this.dates.length&&String(b)!==String(this.dates)&&d&&(this._trigger("changeDate"),this.element.change()),!this.dates.length&&b.length&&(this._trigger("clearDate"),this.element.change()),this.fill(),this},fillDow:function(){if(this.o.showWeekDays){var b=this.o.weekStart,c="<tr>";for(this.o.calendarWeeks&&(c+='<th class="cw">&#160;</th>');b<this.o.weekStart+7;)c+='<th class="dow',-1!==a.inArray(b,this.o.daysOfWeekDisabled)&&(c+=" disabled"),c+='">'+q[this.o.language].daysMin[b++%7]+"</th>";c+="</tr>",this.picker.find(".datepicker-days thead").append(c)}},fillMonths:function(){for(var a,b=this._utc_to_local(this.viewDate),c="",d=0;d<12;d++)a=b&&b.getMonth()===d?" focused":"",c+='<span class="month'+a+'">'+q[this.o.language].monthsShort[d]+"</span>";this.picker.find(".datepicker-months td").html(c)},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=[],f=this.viewDate.getUTCFullYear(),g=this.viewDate.getUTCMonth(),h=d();return b.getUTCFullYear()<f||b.getUTCFullYear()===f&&b.getUTCMonth()<g?c.push("old"):(b.getUTCFullYear()>f||b.getUTCFullYear()===f&&b.getUTCMonth()>g)&&c.push("new"),this.focusDate&&b.valueOf()===this.focusDate.valueOf()&&c.push("focused"),this.o.todayHighlight&&e(b,h)&&c.push("today"),-1!==this.dates.contains(b)&&c.push("active"),this.dateWithinRange(b)||c.push("disabled"),this.dateIsDisabled(b)&&c.push("disabled","disabled-date"),-1!==a.inArray(b.getUTCDay(),this.o.daysOfWeekHighlighted)&&c.push("highlighted"),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"),b.valueOf()===this.range[0]&&c.push("range-start"),b.valueOf()===this.range[this.range.length-1]&&c.push("range-end")),c},_fill_yearsView:function(c,d,e,f,g,h,i){for(var j,k,l,m="",n=e/10,o=this.picker.find(c),p=Math.floor(f/e)*e,q=p+9*n,r=Math.floor(this.viewDate.getFullYear()/n)*n,s=a.map(this.dates,function(a){return Math.floor(a.getUTCFullYear()/n)*n}),t=p-n;t<=q+n;t+=n)j=[d],k=null,t===p-n?j.push("old"):t===q+n&&j.push("new"),-1!==a.inArray(t,s)&&j.push("active"),(t<g||t>h)&&j.push("disabled"),t===r&&j.push("focused"),i!==a.noop&&(l=i(new Date(t,0,1)),l===b?l={}:"boolean"==typeof l?l={enabled:l}:"string"==typeof l&&(l={classes:l}),!1===l.enabled&&j.push("disabled"),l.classes&&(j=j.concat(l.classes.split(/\s+/))),l.tooltip&&(k=l.tooltip)),m+='<span class="'+j.join(" ")+'"'+(k?' title="'+k+'"':"")+">"+t+"</span>";o.find(".datepicker-switch").text(p+"-"+q),o.find("td").html(m)},fill:function(){var e,f,g=new Date(this.viewDate),h=g.getUTCFullYear(),i=g.getUTCMonth(),j=this.o.startDate!==-1/0?this.o.startDate.getUTCFullYear():-1/0,k=this.o.startDate!==-1/0?this.o.startDate.getUTCMonth():-1/0,l=this.o.endDate!==1/0?this.o.endDate.getUTCFullYear():1/0,m=this.o.endDate!==1/0?this.o.endDate.getUTCMonth():1/0,n=q[this.o.language].today||q.en.today||"",o=q[this.o.language].clear||q.en.clear||"",p=q[this.o.language].titleFormat||q.en.titleFormat,s=d(),t=(!0===this.o.todayBtn||"linked"===this.o.todayBtn)&&s>=this.o.startDate&&s<=this.o.endDate&&!this.weekOfDateIsDisabled(s);if(!isNaN(h)&&!isNaN(i)){this.picker.find(".datepicker-days .datepicker-switch").text(r.formatDate(g,p,this.o.language)),this.picker.find("tfoot .today").text(n).css("display",t?"table-cell":"none"),this.picker.find("tfoot .clear").text(o).css("display",!0===this.o.clearBtn?"table-cell":"none"),this.picker.find("thead .datepicker-title").text(this.o.title).css("display","string"==typeof this.o.title&&""!==this.o.title?"table-cell":"none"),this.updateNavArrows(),this.fillMonths();var u=c(h,i,0),v=u.getUTCDate();u.setUTCDate(v-(u.getUTCDay()-this.o.weekStart+7)%7);var w=new Date(u);u.getUTCFullYear()<100&&w.setUTCFullYear(u.getUTCFullYear()),w.setUTCDate(w.getUTCDate()+42),w=w.valueOf();for(var x,y,z=[];u.valueOf()<w;){if((x=u.getUTCDay())===this.o.weekStart&&(z.push("<tr>"),this.o.calendarWeeks)){var A=new Date(+u+(this.o.weekStart-x-7)%7*864e5),B=new Date(Number(A)+(11-A.getUTCDay())%7*864e5),C=new Date(Number(C=c(B.getUTCFullYear(),0,1))+(11-C.getUTCDay())%7*864e5),D=(B-C)/864e5/7+1;z.push('<td class="cw">'+D+"</td>")}y=this.getClassNames(u),y.push("day");var E=u.getUTCDate();this.o.beforeShowDay!==a.noop&&(f=this.o.beforeShowDay(this._utc_to_local(u)),f===b?f={}:"boolean"==typeof f?f={enabled:f}:"string"==typeof f&&(f={classes:f}),!1===f.enabled&&y.push("disabled"),f.classes&&(y=y.concat(f.classes.split(/\s+/))),f.tooltip&&(e=f.tooltip),f.content&&(E=f.content)),y=a.isFunction(a.uniqueSort)?a.uniqueSort(y):a.unique(y),z.push('<td class="'+y.join(" ")+'"'+(e?' title="'+e+'"':"")+' data-date="'+u.getTime().toString()+'">'+E+"</td>"),e=null,x===this.o.weekEnd&&z.push("</tr>"),u.setUTCDate(u.getUTCDate()+1)}this.picker.find(".datepicker-days tbody").html(z.join(""));var F=q[this.o.language].monthsTitle||q.en.monthsTitle||"Months",G=this.picker.find(".datepicker-months").find(".datepicker-switch").text(this.o.maxViewMode<2?F:h).end().find("tbody span").removeClass("active");if(a.each(this.dates,function(a,b){b.getUTCFullYear()===h&&G.eq(b.getUTCMonth()).addClass("active")}),(h<j||h>l)&&G.addClass("disabled"),h===j&&G.slice(0,k).addClass("disabled"),h===l&&G.slice(m+1).addClass("disabled"),this.o.beforeShowMonth!==a.noop){var H=this;a.each(G,function(c,d){var e=new Date(h,c,1),f=H.o.beforeShowMonth(e);f===b?f={}:"boolean"==typeof f?f={enabled:f}:"string"==typeof f&&(f={classes:f}),!1!==f.enabled||a(d).hasClass("disabled")||a(d).addClass("disabled"),f.classes&&a(d).addClass(f.classes),f.tooltip&&a(d).prop("title",f.tooltip)})}this._fill_yearsView(".datepicker-years","year",10,h,j,l,this.o.beforeShowYear),this._fill_yearsView(".datepicker-decades","decade",100,h,j,l,this.o.beforeShowDecade),this._fill_yearsView(".datepicker-centuries","century",1e3,h,j,l,this.o.beforeShowCentury)}},updateNavArrows:function(){if(this._allow_update){var a,b,c=new Date(this.viewDate),d=c.getUTCFullYear(),e=c.getUTCMonth(),f=this.o.startDate!==-1/0?this.o.startDate.getUTCFullYear():-1/0,g=this.o.startDate!==-1/0?this.o.startDate.getUTCMonth():-1/0,h=this.o.endDate!==1/0?this.o.endDate.getUTCFullYear():1/0,i=this.o.endDate!==1/0?this.o.endDate.getUTCMonth():1/0,j=1;switch(this.viewMode){case 4:j*=10;case 3:j*=10;case 2:j*=10;case 1:a=Math.floor(d/j)*j<=f,b=Math.floor(d/j)*j+j>h;break;case 0:a=d<=f&&e<=g,b=d>=h&&e>=i}this.picker.find(".prev").toggleClass("disabled",a),this.picker.find(".next").toggleClass("disabled",b)}},click:function(b){b.preventDefault(),b.stopPropagation();var e,f,g,h;e=a(b.target),e.hasClass("datepicker-switch")&&this.viewMode!==this.o.maxViewMode&&this.setViewMode(this.viewMode+1),e.hasClass("today")&&!e.hasClass("day")&&(this.setViewMode(0),this._setDate(d(),"linked"===this.o.todayBtn?null:"view")),e.hasClass("clear")&&this.clearDates(),e.hasClass("disabled")||(e.hasClass("month")||e.hasClass("year")||e.hasClass("decade")||e.hasClass("century"))&&(this.viewDate.setUTCDate(1),f=1,1===this.viewMode?(h=e.parent().find("span").index(e),g=this.viewDate.getUTCFullYear(),this.viewDate.setUTCMonth(h)):(h=0,g=Number(e.text()),this.viewDate.setUTCFullYear(g)),this._trigger(r.viewModes[this.viewMode-1].e,this.viewDate),this.viewMode===this.o.minViewMode?this._setDate(c(g,h,f)):(this.setViewMode(this.viewMode-1),this.fill())),this.picker.is(":visible")&&this._focused_from&&this._focused_from.focus(),delete this._focused_from},dayCellClick:function(b){var c=a(b.currentTarget),d=c.data("date"),e=new Date(d);this.o.updateViewDate&&(e.getUTCFullYear()!==this.viewDate.getUTCFullYear()&&this._trigger("changeYear",this.viewDate),e.getUTCMonth()!==this.viewDate.getUTCMonth()&&this._trigger("changeMonth",this.viewDate)),this._setDate(e)},navArrowsClick:function(b){var c=a(b.currentTarget),d=c.hasClass("prev")?-1:1;0!==this.viewMode&&(d*=12*r.viewModes[this.viewMode].navStep),this.viewDate=this.moveMonth(this.viewDate,d),this._trigger(r.viewModes[this.viewMode].e,this.viewDate),this.fill()},_toggle_multidate:function(a){var b=this.dates.contains(a);if(a||this.dates.clear(),-1!==b?(!0===this.o.multidate||this.o.multidate>1||this.o.toggleActive)&&this.dates.remove(b):!1===this.o.multidate?(this.dates.clear(),this.dates.push(a)):this.dates.push(a),"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&&this.o.updateViewDate||"view"===b)&&(this.viewDate=a&&new Date(a)),this.fill(),this.setValue(),b&&"view"===b||this._trigger("changeDate"),this.inputField.trigger("change"),!this.o.autoclose||b&&"date"!==b||this.hide()},moveDay:function(a,b){var c=new Date(a);return c.setUTCDate(a.getUTCDate()+b),c},moveWeek:function(a,b){return this.moveDay(a,7*b)},moveMonth:function(a,b){if(!g(a))return this.o.defaultViewDate;if(!b)return a;var c,d,e=new Date(a.valueOf()),f=e.getUTCDate(),h=e.getUTCMonth(),i=Math.abs(b);if(b=b>0?1:-1,1===i)d=-1===b?function(){return e.getUTCMonth()===h}:function(){return e.getUTCMonth()!==c},c=h+b,e.setUTCMonth(c),c=(c+12)%12;else{for(var j=0;j<i;j++)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)},moveAvailableDate:function(a,b,c){do{if(a=this[c](a,b),!this.dateWithinRange(a))return!1;c="moveDay"}while(this.dateIsDisabled(a));return a},weekOfDateIsDisabled:function(b){return-1!==a.inArray(b.getUTCDay(),this.o.daysOfWeekDisabled)},dateIsDisabled:function(b){return this.weekOfDateIsDisabled(b)||a.grep(this.o.datesDisabled,function(a){return e(b,a)}).length>0},dateWithinRange:function(a){return a>=this.o.startDate&&a<=this.o.endDate},keydown:function(a){if(!this.picker.is(":visible"))return void(40!==a.keyCode&&27!==a.keyCode||(this.show(),a.stopPropagation()));var b,c,d=!1,e=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(),a.stopPropagation();break;case 37:case 38:case 39:case 40:if(!this.o.keyboardNavigation||7===this.o.daysOfWeekDisabled.length)break;b=37===a.keyCode||38===a.keyCode?-1:1,0===this.viewMode?a.ctrlKey?(c=this.moveAvailableDate(e,b,"moveYear"))&&this._trigger("changeYear",this.viewDate):a.shiftKey?(c=this.moveAvailableDate(e,b,"moveMonth"))&&this._trigger("changeMonth",this.viewDate):37===a.keyCode||39===a.keyCode?c=this.moveAvailableDate(e,b,"moveDay"):this.weekOfDateIsDisabled(e)||(c=this.moveAvailableDate(e,b,"moveWeek")):1===this.viewMode?(38!==a.keyCode&&40!==a.keyCode||(b*=4),c=this.moveAvailableDate(e,b,"moveMonth")):2===this.viewMode&&(38!==a.keyCode&&40!==a.keyCode||(b*=4),c=this.moveAvailableDate(e,b,"moveYear")),c&&(this.focusDate=this.viewDate=c,this.setValue(),this.fill(),a.preventDefault());break;case 13:if(!this.o.forceParse)break;e=this.focusDate||this.dates.get(-1)||this.viewDate,this.o.keyboardNavigation&&(this._toggle_multidate(e),d=!0),this.focusDate=null,this.viewDate=this.dates.get(-1)||this.viewDate,this.setValue(),this.fill(),this.picker.is(":visible")&&(a.preventDefault(),a.stopPropagation(),this.o.autoclose&&this.hide());break;case 9:this.focusDate=null,this.viewDate=this.dates.get(-1)||this.viewDate,this.fill(),this.hide()}d&&(this.dates.length?this._trigger("changeDate"):this._trigger("clearDate"),this.inputField.trigger("change"))},setViewMode:function(a){this.viewMode=a,this.picker.children("div").hide().filter(".datepicker-"+r.viewModes[this.viewMode].clsName).show(),this.updateNavArrows(),this._trigger("changeViewMode",new Date(this.viewDate))}};var l=function(b,c){a.data(b,"datepicker",this),this.element=a(b),this.inputs=a.map(c.inputs,function(a){return a.jquery?a[0]:a}),delete c.inputs,this.keepEmptyValues=c.keepEmptyValues,delete c.keepEmptyValues,n.call(a(this.inputs),c).on("changeDate",a.proxy(this.dateUpdated,this)),this.pickers=a.map(this.inputs,function(b){return a.data(b,"datepicker")}),this.updateDates()};l.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)})},clearDates:function(){a.each(this.pickers,function(a,b){b.clearDates()})},dateUpdated:function(c){if(!this.updating){this.updating=!0;var d=a.data(c.target,"datepicker");if(d!==b){var e=d.getUTCDate(),f=this.keepEmptyValues,g=a.inArray(c.target,this.inputs),h=g-1,i=g+1,j=this.inputs.length;if(-1!==g){if(a.each(this.pickers,function(a,b){b.getUTCDate()||b!==d&&f||b.setUTCDate(e)}),e<this.dates[h])for(;h>=0&&e<this.dates[h];)this.pickers[h--].setUTCDate(e);else if(e>this.dates[i])for(;i<j&&e>this.dates[i];)this.pickers[i++].setUTCDate(e);this.updateDates(),delete this.updating}}}},destroy:function(){a.map(this.pickers,function(a){a.destroy()}),a(this.inputs).off("changeDate",this.dateUpdated),delete this.element.data().datepicker},remove:f("destroy","Method `remove` is deprecated and will be removed in version 2.0. Use `destroy` instead")};var m=a.fn.datepicker,n=function(c){var d=Array.apply(null,arguments);d.shift();var e;if(this.each(function(){var b=a(this),f=b.data("datepicker"),g="object"==typeof c&&c;if(!f){var j=h(this,"date"),m=a.extend({},o,j,g),n=i(m.language),p=a.extend({},o,n,j,g);b.hasClass("input-daterange")||p.inputs?(a.extend(p,{inputs:p.inputs||b.find("input").toArray()}),f=new l(this,p)):f=new k(this,p),b.data("datepicker",f)}"string"==typeof c&&"function"==typeof f[c]&&(e=f[c].apply(f,d))}),e===b||e instanceof k||e instanceof l)return this;if(this.length>1)throw new Error("Using only allowed for the collection of a single element ("+c+" function)");return e};a.fn.datepicker=n;var o=a.fn.datepicker.defaults={assumeNearbyYear:!1,autoclose:!1,beforeShowDay:a.noop,beforeShowMonth:a.noop,beforeShowYear:a.noop,beforeShowDecade:a.noop,beforeShowCentury:a.noop,calendarWeeks:!1,clearBtn:!1,toggleActive:!1,daysOfWeekDisabled:[],daysOfWeekHighlighted:[],datesDisabled:[],endDate:1/0,forceParse:!0,format:"mm/dd/yyyy",keepEmptyValues:!1,keyboardNavigation:!0,language:"en",minViewMode:0,maxViewMode:4,multidate:!1,multidateSeparator:",",orientation:"auto",rtl:!1,startDate:-1/0,startView:0,todayBtn:!1,todayHighlight:!1,updateViewDate:!0,weekStart:0,disableTouchKeyboard:!1,enableOnReadonly:!0,showOnFocus:!0,zIndexOffset:10,container:"body",immediateUpdates:!1,title:"",templates:{leftArrow:"&#x00AB;",rightArrow:"&#x00BB;"},showWeekDays:!0},p=a.fn.datepicker.locale_opts=["format","rtl","weekStart"];a.fn.datepicker.Constructor=k;var q=a.fn.datepicker.dates={en:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa"],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",titleFormat:"MM yyyy"}},r={viewModes:[{names:["days","month"],clsName:"days",e:"changeMonth"},{names:["months","year"],clsName:"months",e:"changeYear",navStep:1},{names:["years","decade"],clsName:"years",e:"changeDecade",navStep:10},{names:["decades","century"],clsName:"decades",e:"changeCentury",navStep:100},{names:["centuries","millennium"],clsName:"centuries",e:"changeMillennium",navStep:1e3}],validParts:/dd?|DD?|mm?|MM?|yy(?:yy)?/g,nonpunctuation:/[^ -\/:-@\u5e74\u6708\u65e5\[-`{-~\t\n\r]+/g,parseFormat:function(a){if("function"==typeof a.toValue&&"function"==typeof a.toDisplay)return a;var b=a.replace(this.validParts,"\0").split("\0"),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,e,f,g){function h(a,b){return!0===b&&(b=10),a<100&&(a+=2e3)>(new Date).getFullYear()+b&&(a-=100),a}function i(){var a=this.slice(0,j[n].length),b=j[n].slice(0,a.length);return a.toLowerCase()===b.toLowerCase()}if(!c)return b;if(c instanceof Date)return c;if("string"==typeof e&&(e=r.parseFormat(e)),e.toValue)return e.toValue(c,e,f);var j,l,m,n,o,p={d:"moveDay",m:"moveMonth",w:"moveWeek",y:"moveYear"},s={yesterday:"-1d",today:"+0d",tomorrow:"+1d"};if(c in s&&(c=s[c]),/^[\-+]\d+[dmwy]([\s,]+[\-+]\d+[dmwy])*$/i.test(c)){for(j=c.match(/([\-+]\d+)([dmwy])/gi),c=new Date,n=0;n<j.length;n++)l=j[n].match(/([\-+]\d+)([dmwy])/i),m=Number(l[1]),o=p[l[2].toLowerCase()],c=k.prototype[o](c,m);return k.prototype._zero_utc_time(c)}j=c&&c.match(this.nonpunctuation)||[];var t,u,v={},w=["yyyy","yy","M","MM","m","mm","d","dd"],x={yyyy:function(a,b){return a.setUTCFullYear(g?h(b,g):b)},m:function(a,b){if(isNaN(a))return a;for(b-=1;b<0;)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)}};x.yy=x.yyyy,x.M=x.MM=x.mm=x.m,x.dd=x.d,c=d();var y=e.parts.slice();if(j.length!==y.length&&(y=a(y).filter(function(b,c){return-1!==a.inArray(c,w)}).toArray()),j.length===y.length){var z;for(n=0,z=y.length;n<z;n++){if(t=parseInt(j[n],10),l=y[n],isNaN(t))switch(l){case"MM":u=a(q[f].months).filter(i),t=a.inArray(u[0],q[f].months)+1;break;case"M":u=a(q[f].monthsShort).filter(i),t=a.inArray(u[0],q[f].monthsShort)+1}v[l]=t}var A,B;for(n=0;n<w.length;n++)(B=w[n])in v&&!isNaN(v[B])&&(A=new Date(c),x[B](A,v[B]),isNaN(A)||(c=A))}return c},formatDate:function(b,c,d){if(!b)return"";if("string"==typeof c&&(c=r.parseFormat(c)),c.toDisplay)return c.toDisplay(b,c,d);var e={d:b.getUTCDate(),D:q[d].daysShort[b.getUTCDay()],DD:q[d].days[b.getUTCDay()],m:b.getUTCMonth()+1,M:q[d].monthsShort[b.getUTCMonth()],MM:q[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;g<=h;g++)f.length&&b.push(f.shift()),b.push(e[c.parts[g]]);return b.join("")},
8
+ headTemplate:'<thead><tr><th colspan="7" class="datepicker-title"></th></tr><tr><th class="prev">'+o.templates.leftArrow+'</th><th colspan="5" class="datepicker-switch"></th><th class="next">'+o.templates.rightArrow+"</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>'};r.template='<div class="datepicker"><div class="datepicker-days"><table class="table-condensed">'+r.headTemplate+"<tbody></tbody>"+r.footTemplate+'</table></div><div class="datepicker-months"><table class="table-condensed">'+r.headTemplate+r.contTemplate+r.footTemplate+'</table></div><div class="datepicker-years"><table class="table-condensed">'+r.headTemplate+r.contTemplate+r.footTemplate+'</table></div><div class="datepicker-decades"><table class="table-condensed">'+r.headTemplate+r.contTemplate+r.footTemplate+'</table></div><div class="datepicker-centuries"><table class="table-condensed">'+r.headTemplate+r.contTemplate+r.footTemplate+"</table></div></div>",a.fn.datepicker.DPGlobal=r,a.fn.datepicker.noConflict=function(){return a.fn.datepicker=m,this},a.fn.datepicker.version="1.9.0",a.fn.datepicker.deprecated=function(a){var b=window.console;b&&b.warn&&b.warn("DEPRECATED: "+a)},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(),n.call(c,"show"))}),a(function(){n.call(a('[data-provide="datepicker-inline"]'))})});
assets/lib/fullcalendar/CHANGELOG.txt DELETED
@@ -1,1160 +0,0 @@
1
-
2
- v3.4.0 (2017-04-27)
3
- -------------------
4
-
5
- - composer.js for Composer (PHP package manager) (#3617)
6
- - fix toISOString for locales with non-trivial postformatting (#3619)
7
- - fix for nested inverse-background events (#3609)
8
- - Estonian locale (#3600)
9
- - fixed Latvian localization (#3525)
10
- - internal refactor of async systems
11
-
12
-
13
- v3.3.1 (2017-04-01)
14
- -------------------
15
-
16
- Bugfixes:
17
- - stale calendar title when navigate away from then back to the a view (#3604)
18
- - js error when gotoDate immediately after calendar initialization (#3598)
19
- - agenda view scrollbars causes misalignment in jquery 3.2.1 (#3612)
20
- - navigation bug when trying to navigate to a day of another week (#3610)
21
- - dateIncrement not working when duration and dateIncrement have different units
22
-
23
-
24
- v3.3.0 (2017-03-23)
25
- -------------------
26
-
27
- Features:
28
- - `visibleRange` - complete control over view's date range (#2847, #3105, #3245)
29
- - `validRange` - restrict date range (#429)
30
- - `changeView` - pass in a date or visibleRange as second param (#3366)
31
- - `dateIncrement` - customize prev/next jump (#2710)
32
- - `dateAlignment` - custom view alignment, like start-of-week (#3113)
33
- - `dayCount` - force a fixed number-of-days, even with hiddenDays (#2753)
34
- - `showNonCurrentDates` - option to hide day cells for prev/next months (#437)
35
- - can define a defaultView with a duration/visibleRange/dayCount with needing
36
- to create a custom view in the `views` object. Known as a "Generic View".
37
-
38
- Behavior Changes:
39
- - when custom view is specified with duration `{days:7}`,
40
- it will no longer align with the start of the week. (#2847)
41
- - when `gotoDate` is called on a custom view with a duration of multiple days,
42
- the view will always shift to begin with the given date. (#3515)
43
-
44
- Bugfixes:
45
- - event rendering when excessive `minTime`/`maxTime` (#2530)
46
- - event dragging not shown when excessive `minTime`/`maxTime` (#3055)
47
- - excessive `minTime`/`maxTime` not reflected in event fetching (#3514)
48
- - when minTime is negative, or maxTime beyond 24 hours, when event data is requested
49
- via a function or a feed, the given data params will have time parts.
50
- - external event dragging via touchpunch broken (#3544)
51
- - can't make an immediate new selection after existing selection, with mouse.
52
- introduced in v3.2.0 (#3558)
53
-
54
-
55
- v3.2.0 (2017-02-14)
56
- -------------------
57
-
58
- Features:
59
- - `selectMinDistance`, threshold before a mouse selection begins (#2428)
60
-
61
- Bugfixes:
62
- - iOS 10, unwanted scrolling while dragging events/selection (#3403)
63
- - dayClick triggered when swiping on touch devices (#3332)
64
- - dayClick not functioning on Firefix mobile (#3450)
65
- - title computed incorrectly for views with no weekends (#2884)
66
- - unwanted scrollbars in month-view when non-integer width (#3453, #3444)
67
- - incorrect date formatting for locales with non-standlone month/day names (#3478)
68
- - date formatting, incorrect omission of trailing period for certain locales (#2504, #3486)
69
- - formatRange should collapse same week numbers (#3467)
70
- - Taiwanese locale updated (#3426)
71
- - Finnish noEventsMessage updated (#3476)
72
- - Croatian (hr) buttonText is blank (#3270)
73
- - JSON feed PHP example, date range math bug (#3485)
74
-
75
-
76
- v3.1.0 (2016-12-05)
77
- -------------------
78
-
79
- - experimental support for implicitly batched ("debounced") event rendering (#2938)
80
- - `eventRenderWait` (off by default)
81
- - new `footer` option, similar to header toolbar (#654, #3299)
82
- - event rendering batch methods (#3351):
83
- - `renderEvents`
84
- - `updateEvents`
85
- - more granular touch settings (#3377):
86
- - `eventLongPressDelay`
87
- - `selectLongPressDelay`
88
- - eventDestroy not called when removing the popover (#3416, #3419)
89
- - print stylesheet and gcal extension now offered as minified (#3415)
90
- - fc-today in agenda header cells (#3361, #3365)
91
- - height-related options in tandem with other options (#3327, #3384)
92
- - Kazakh locale (#3394)
93
- - Afrikaans locale (#3390)
94
- - internal refactor related to timing of rendering and firing handlers.
95
- calls to rerender the current date-range and events from within handlers
96
- might not execute immediately. instead, will execute after handler finishes.
97
-
98
-
99
- v3.0.1 (2016-09-26)
100
- -------------------
101
-
102
- Bugfixes:
103
- - list view rendering event times incorrectly (#3334)
104
- - list view rendering events/days out of order (#3347)
105
- - events with no title rendering as "undefined"
106
- - add .fc scope to table print styles (#3343)
107
- - "display no events" text fix for German (#3354)
108
-
109
-
110
- v3.0.0 (2016-09-04)
111
- -------------------
112
-
113
- Features:
114
- - List View (#560)
115
- - new views: `listDay`, `listWeek`, `listMonth`, `listYear`, and simply `list`
116
- - `listDayFormat`
117
- - `listDayAltFormat`
118
- - `noEventsMessage`
119
- - Clickable day/week numbers for easier navigation (#424)
120
- - `navLinks`
121
- - `navLinkDayClick`
122
- - `navLinkWeekClick`
123
- - Programmatically allow/disallow user interactions:
124
- - `eventAllow` (#2740)
125
- - `selectAllow` (#2511)
126
- - Option to display week numbers in cells (#3024)
127
- - `weekNumbersWithinDays` (set to `true` to activate)
128
- - When week calc is ISO, default first day-of-week to Monday (#3255)
129
- - Macedonian locale (#2739)
130
- - Malay locale
131
-
132
- Breaking Changes:
133
- - IE8 support dropped
134
- - jQuery: minimum support raised to v2.0.0
135
- - MomentJS: minimum support raised to v2.9.0
136
- - `lang` option renamed to `locale`
137
- - dist files have been renamed to be more consistent with MomentJS:
138
- - `lang/` -> `locale/`
139
- - `lang-all.js` -> `locale-all.js`
140
- - behavior of moment methods no longer affected by ambiguousness:
141
- - `isSame`
142
- - `isBefore`
143
- - `isAfter`
144
- - View-Option-Hashes no longer supported (deprecated in 2.2.4)
145
- - removed `weekMode` setting
146
- - removed `axisFormat` setting
147
- - DOM structure of month/basic-view day cell numbers changed
148
-
149
- Bugfixes:
150
- - `$.fullCalendar.version` incorrect (#3292)
151
-
152
- Build System:
153
- - using gulp instead of grunt (faster)
154
- - using npm internally for dependencies instead of bower
155
- - changed repo directory structure
156
-
157
-
158
- v2.9.1 (2016-07-31)
159
- -------------------
160
-
161
- - multiple definitions for businessHours (#2686)
162
- - businessHours for single day doesn't display weekends (#2944)
163
- - height/contentHeight can accept a function or 'parent' for dynamic value (#3271)
164
- - fix +more popover clipped by overflow (#3232)
165
- - fix +more popover positioned incorrectly when scrolled (#3137)
166
- - Norwegian Nynorsk translation (#3246)
167
- - fix isAnimating JS error (#3285)
168
-
169
-
170
- v2.9.0 (2016-07-10)
171
- -------------------
172
-
173
- - Setters for (almost) all options (#564).
174
- See [docs](http://fullcalendar.io/docs/utilities/dynamic_options/) for more info.
175
- - Travis CI improvements (#3266)
176
-
177
-
178
- v2.8.0 (2016-06-19)
179
- -------------------
180
-
181
- - getEventSources method (#3103, #2433)
182
- - getEventSourceById method (#3223)
183
- - refetchEventSources method (#3103, #1328, #254)
184
- - removeEventSources method (#3165, #948)
185
- - prevent flicker when refetchEvents is called (#3123, #2558)
186
- - fix for removing event sources that share same URL (#3209)
187
- - jQuery 3 support (#3197, #3124)
188
- - Travis CI integration (#3218)
189
- - EditorConfig for promoting consistent code style (#141)
190
- - use en dash when formatting ranges (#3077)
191
- - height:auto always shows scrollbars in month view on FF (#3202)
192
- - new languages:
193
- - Basque (#2992)
194
- - Galician (#194)
195
- - Luxembourgish (#2979)
196
-
197
-
198
- v2.7.3 (2016-06-02)
199
- -------------------
200
-
201
- internal enhancements that plugins can benefit from:
202
- - EventEmitter not correctly working with stopListeningTo
203
- - normalizeEvent hook for manipulating event data
204
-
205
-
206
- v2.7.2 (2016-05-20)
207
- -------------------
208
-
209
- - fixed desktops/laptops with touch support not accepting mouse events for
210
- dayClick/dragging/resizing (#3154, #3149)
211
- - fixed dayClick incorrectly triggered on touch scroll (#3152)
212
- - fixed touch event dragging wrongfully beginning upon scrolling document (#3160)
213
- - fixed minified JS still contained comments
214
- - UI change: mouse users must hover over an event to reveal its resizers
215
-
216
-
217
- v2.7.1 (2016-05-01)
218
- -------------------
219
-
220
- - dayClick not firing on touch devices (#3138)
221
- - icons for prev/next not working in MS Edge (#2852)
222
- - fix bad languages troubles with firewalls (#3133, #3132)
223
- - update all dev dependencies (#3145, #3010, #2901, #251)
224
- - git-ignore npm debug logs (#3011)
225
- - misc automated test updates (#3139, #3147)
226
- - Google Calendar htmlLink not always defined (#2844)
227
-
228
-
229
- v2.7.0 (2016-04-23)
230
- -------------------
231
-
232
- touch device support (#994):
233
- - smoother scrolling
234
- - interactions initiated via "long press":
235
- - event drag-n-drop
236
- - event resize
237
- - time-range selecting
238
- - `longPressDelay`
239
-
240
-
241
- v2.6.1 (2016-02-17)
242
- -------------------
243
-
244
- - make `nowIndicator` positioning refresh on window resize
245
-
246
-
247
- v2.6.0 (2016-01-07)
248
- -------------------
249
-
250
- - current time indicator (#414)
251
- - bundled with most recent version of moment (2.11.0)
252
- - UMD wrapper around lang files now handles commonjs (#2918)
253
- - fix bug where external event dragging would not respect eventOverlap
254
- - fix bug where external event dropping would not render the whole-day highlight
255
-
256
-
257
- v2.5.0 (2015-11-30)
258
- -------------------
259
-
260
- - internal timezone refactor. fixes #2396, #2900, #2945, #2711
261
- - internal "grid" system refactor. improved API for plugins.
262
-
263
-
264
- v2.4.0 (2015-08-16)
265
- -------------------
266
-
267
- - add new buttons to the header via `customButtons` ([225])
268
- - control stacking order of events via `eventOrder` ([364])
269
- - control frequency of slot text via `slotLabelInterval` ([946])
270
- - `displayEventTime` ([1904])
271
- - `on` and `off` methods ([1910])
272
- - renamed `axisFormat` to `slotLabelFormat`
273
-
274
- [225]: https://code.google.com/p/fullcalendar/issues/detail?id=225
275
- [364]: https://code.google.com/p/fullcalendar/issues/detail?id=364
276
- [946]: https://code.google.com/p/fullcalendar/issues/detail?id=946
277
- [1904]: https://code.google.com/p/fullcalendar/issues/detail?id=1904
278
- [1910]: https://code.google.com/p/fullcalendar/issues/detail?id=1910
279
-
280
-
281
- v2.3.2 (2015-06-14)
282
- -------------------
283
-
284
- - minor code adjustment in preparation for plugins
285
-
286
-
287
- v2.3.1 (2015-03-08)
288
- -------------------
289
-
290
- - Fix week view column title for en-gb ([PR220])
291
- - Publish to NPM ([2447])
292
- - Detangle bower from npm package ([PR179])
293
-
294
- [PR220]: https://github.com/arshaw/fullcalendar/pull/220
295
- [2447]: https://code.google.com/p/fullcalendar/issues/detail?id=2447
296
- [PR179]: https://github.com/arshaw/fullcalendar/pull/179
297
-
298
-
299
- v2.3.0 (2015-02-21)
300
- -------------------
301
-
302
- - internal refactoring in preparation for other views
303
- - businessHours now renders on whole-days in addition to timed areas
304
- - events in "more" popover not sorted by time ([2385])
305
- - avoid using moment's deprecated zone method ([2443])
306
- - destroying the calendar sometimes causes all window resize handlers to be unbound ([2432])
307
- - multiple calendars on one page, can't accept external elements after navigating ([2433])
308
- - accept external events from jqui sortable ([1698])
309
- - external jqui drop processed before reverting ([1661])
310
- - IE8 fix: month view renders incorrectly ([2428])
311
- - IE8 fix: eventLimit:true wouldn't activate "more" link ([2330])
312
- - IE8 fix: dragging an event with an href
313
- - IE8 fix: invisible element while dragging agenda view events
314
- - IE8 fix: erratic external element dragging
315
-
316
- [2385]: https://code.google.com/p/fullcalendar/issues/detail?id=2385
317
- [2443]: https://code.google.com/p/fullcalendar/issues/detail?id=2443
318
- [2432]: https://code.google.com/p/fullcalendar/issues/detail?id=2432
319
- [2433]: https://code.google.com/p/fullcalendar/issues/detail?id=2433
320
- [1698]: https://code.google.com/p/fullcalendar/issues/detail?id=1698
321
- [1661]: https://code.google.com/p/fullcalendar/issues/detail?id=1661
322
- [2428]: https://code.google.com/p/fullcalendar/issues/detail?id=2428
323
- [2330]: https://code.google.com/p/fullcalendar/issues/detail?id=2330
324
-
325
-
326
- v2.2.7 (2015-02-10)
327
- -------------------
328
-
329
- - view.title wasn't defined in viewRender callback ([2407])
330
- - FullCalendar versions >= 2.2.5 brokenness with Moment versions <= 2.8.3 ([2417])
331
- - Support Bokmal Norwegian language specifically ([2427])
332
-
333
- [2407]: https://code.google.com/p/fullcalendar/issues/detail?id=2407
334
- [2417]: https://code.google.com/p/fullcalendar/issues/detail?id=2417
335
- [2427]: https://code.google.com/p/fullcalendar/issues/detail?id=2427
336
-
337
-
338
- v2.2.6 (2015-01-11)
339
- -------------------
340
-
341
- - Compatibility with Moment v2.9. Was breaking GCal plugin ([2408])
342
- - View object's `title` property mistakenly omitted ([2407])
343
- - Single-day views with hiddens days could cause prev/next misbehavior ([2406])
344
- - Don't let the current date ever be a hidden day (solves [2395])
345
- - Hebrew locale ([2157])
346
-
347
- [2408]: https://code.google.com/p/fullcalendar/issues/detail?id=2408
348
- [2407]: https://code.google.com/p/fullcalendar/issues/detail?id=2407
349
- [2406]: https://code.google.com/p/fullcalendar/issues/detail?id=2406
350
- [2395]: https://code.google.com/p/fullcalendar/issues/detail?id=2395
351
- [2157]: https://code.google.com/p/fullcalendar/issues/detail?id=2157
352
-
353
-
354
- v2.2.5 (2014-12-30)
355
- -------------------
356
-
357
- - `buttonText` specified for custom views via the `views` option
358
- - bugfix: wrong default value, couldn't override default
359
- - feature: default value taken from locale
360
-
361
-
362
- v2.2.4 (2014-12-29)
363
- -------------------
364
-
365
- - Arbitrary durations for basic/agenda views with the `views` option ([692])
366
- - Specify view-specific options using the `views` option. fixes [2283]
367
- - Deprecate view-option-hashes
368
- - Formalize and expose View API ([1055])
369
- - updateEvent method, more intuitive behavior. fixes [2194]
370
-
371
- [692]: https://code.google.com/p/fullcalendar/issues/detail?id=692
372
- [2283]: https://code.google.com/p/fullcalendar/issues/detail?id=2283
373
- [1055]: https://code.google.com/p/fullcalendar/issues/detail?id=1055
374
- [2194]: https://code.google.com/p/fullcalendar/issues/detail?id=2194
375
-
376
-
377
- v2.2.3 (2014-11-26)
378
- -------------------
379
-
380
- - removeEventSource with Google Calendar object source, would not remove ([2368])
381
- - Events with invalid end dates are still accepted and rendered ([2350], [2237], [2296])
382
- - Bug when rendering business hours and navigating away from original view ([2365])
383
- - Links to Google Calendar events will use current timezone ([2122])
384
- - Google Calendar plugin works with timezone names that have spaces
385
- - Google Calendar plugin accepts person email addresses as calendar IDs
386
- - Internally use numeric sort instead of alphanumeric sort ([2370])
387
-
388
- [2368]: https://code.google.com/p/fullcalendar/issues/detail?id=2368
389
- [2350]: https://code.google.com/p/fullcalendar/issues/detail?id=2350
390
- [2237]: https://code.google.com/p/fullcalendar/issues/detail?id=2237
391
- [2296]: https://code.google.com/p/fullcalendar/issues/detail?id=2296
392
- [2365]: https://code.google.com/p/fullcalendar/issues/detail?id=2365
393
- [2122]: https://code.google.com/p/fullcalendar/issues/detail?id=2122
394
- [2370]: https://code.google.com/p/fullcalendar/issues/detail?id=2370
395
-
396
-
397
- v2.2.2 (2014-11-19)
398
- -------------------
399
-
400
- - Fixes to Google Calendar API V3 code
401
- - wouldn't recognize a lone-string Google Calendar ID if periods before the @ symbol
402
- - removeEventSource wouldn't work when given a Google Calendar ID
403
-
404
-
405
- v2.2.1 (2014-11-19)
406
- -------------------
407
-
408
- - Migrate Google Calendar plugin to use V3 of the API ([1526])
409
-
410
- [1526]: https://code.google.com/p/fullcalendar/issues/detail?id=1526
411
-
412
-
413
- v2.2.0 (2014-11-14)
414
- -------------------
415
-
416
- - Background events. Event object's `rendering` property ([144], [1286])
417
- - `businessHours` option ([144])
418
- - Controlling where events can be dragged/resized and selections can go ([396], [1286], [2253])
419
- - `eventOverlap`, `selectOverlap`, and similar
420
- - `eventConstraint`, `selectConstraint`, and similar
421
- - Improvements to dragging and dropping external events ([2004])
422
- - Associating with real event data. used with `eventReceive`
423
- - Associating a `duration`
424
- - Performance boost for moment creation
425
- - Be aware, FullCalendar-specific methods now attached directly to global moment.fn
426
- - Helps with [issue 2259][2259]
427
- - Reintroduced forgotten `dropAccept` option ([2312])
428
-
429
- [144]: https://code.google.com/p/fullcalendar/issues/detail?id=144
430
- [396]: https://code.google.com/p/fullcalendar/issues/detail?id=396
431
- [1286]: https://code.google.com/p/fullcalendar/issues/detail?id=1286
432
- [2004]: https://code.google.com/p/fullcalendar/issues/detail?id=2004
433
- [2253]: https://code.google.com/p/fullcalendar/issues/detail?id=2253
434
- [2259]: https://code.google.com/p/fullcalendar/issues/detail?id=2259
435
- [2312]: https://code.google.com/p/fullcalendar/issues/detail?id=2312
436
-
437
-
438
- v2.1.1 (2014-08-29)
439
- -------------------
440
-
441
- - removeEventSource not working with array ([2203])
442
- - mouseout not triggered after mouseover+updateEvent ([829])
443
- - agenda event's render with no <a> href, not clickable ([2263])
444
-
445
- [2203]: https://code.google.com/p/fullcalendar/issues/detail?id=2203
446
- [829]: https://code.google.com/p/fullcalendar/issues/detail?id=829
447
- [2263]: https://code.google.com/p/fullcalendar/issues/detail?id=2263
448
-
449
-
450
- v2.1.0 (2014-08-25)
451
- -------------------
452
-
453
- Large code refactor with better OOP, better code reuse, and more comments.
454
- **No more reliance on jQuery UI** for event dragging, resizing, or anything else.
455
-
456
- Significant changes to HTML/CSS skeleton:
457
- - Leverages tables for liquid rendering of days and events. No costly manual repositioning ([809])
458
- - **Backwards-incompatibilities**:
459
- - **Many classNames have changed. Custom CSS will likely need to be adjusted.**
460
- - IE7 definitely not supported anymore
461
- - In `eventRender` callback, `element` will not be attached to DOM yet
462
- - Events are styled to be one line by default ([1992]). Can be undone through custom CSS,
463
- but not recommended (might get gaps [like this][111] in certain situations).
464
-
465
- A "more..." link when there are too many events on a day ([304]). Works with month and basic views
466
- as well as the all-day section of the agenda views. New options:
467
- - `eventLimit`. a number or `true`
468
- - `eventLimitClick`. the `"popover`" value will reveal all events in a raised panel (the default)
469
- - `eventLimitText`
470
- - `dayPopoverFormat`
471
-
472
- Changes related to height and scrollbars:
473
- - `aspectRatio`/`height`/`contentHeight` values will be honored *no matter what*
474
- - If too many events causing too much vertical space, scrollbars will be used ([728]).
475
- This is default behavior for month view (**backwards-incompatibility**)
476
- - If too few slots in agenda view, view will stretch to be the correct height ([2196])
477
- - `'auto'` value for `height`/`contentHeight` options. If content is too tall, the view will
478
- vertically stretch to accomodate and no scrollbars will be used ([521]).
479
- - Tall weeks in month view will borrow height from other weeks ([243])
480
- - Automatically scroll the view then dragging/resizing an event ([1025], [2078])
481
- - New `fixedWeekCount` option to determines the number of weeks in month view
482
- - Supersedes `weekMode` (**deprecated**). Instead, use a combination of `fixedWeekCount` and
483
- one of the height options, possibly with an `'auto'` value
484
-
485
- Much nicer, glitch-free rendering of calendar *for printers* ([35]). Things you might not expect:
486
- - Buttons will become hidden
487
- - Agenda views display a flat list of events where the time slots would be
488
-
489
- Other issues resolved along the way:
490
- - Space on right side of agenda events configurable through CSS ([204])
491
- - Problem with window resize ([259])
492
- - Events sorting stays consistent across weeks ([510])
493
- - Agenda's columns misaligned on wide screens ([511])
494
- - Run `selectHelper` through `eventRender` callbacks ([629])
495
- - Keyboard access, tabbing ([637])
496
- - Run resizing events through `eventRender` ([714])
497
- - Resize an event to a different day in agenda views ([736])
498
- - Allow selection across days in agenda views ([778])
499
- - Mouseenter delegated event not working on event elements ([936])
500
- - Agenda event dragging, snapping to different columns is erratic ([1101])
501
- - Android browser cuts off Day view at 8 PM with no scroll bar ([1203])
502
- - Don't fire `eventMouseover`/`eventMouseout` while dragging/resizing ([1297])
503
- - Customize the resize handle text ("=") ([1326])
504
- - If agenda event is too short, don't overwrite `.fc-event-time` ([1700])
505
- - Zooming calendar causes events to misalign ([1996])
506
- - Event destroy callback on event removal ([2017])
507
- - Agenda views, when RTL, should have axis on right ([2132])
508
- - Make header buttons more accessibile ([2151])
509
- - daySelectionMousedown should interpret OSX ctrl+click as a right mouse click ([2169])
510
- - Best way to display time text on multi-day events *with times* ([2172])
511
- - Eliminate table use for header layout ([2186])
512
- - Event delegation used for event-related callbacks (like `eventClick`). Speedier.
513
-
514
- [35]: https://code.google.com/p/fullcalendar/issues/detail?id=35
515
- [204]: https://code.google.com/p/fullcalendar/issues/detail?id=204
516
- [243]: https://code.google.com/p/fullcalendar/issues/detail?id=243
517
- [259]: https://code.google.com/p/fullcalendar/issues/detail?id=259
518
- [304]: https://code.google.com/p/fullcalendar/issues/detail?id=304
519
- [510]: https://code.google.com/p/fullcalendar/issues/detail?id=510
520
- [511]: https://code.google.com/p/fullcalendar/issues/detail?id=511
521
- [521]: https://code.google.com/p/fullcalendar/issues/detail?id=521
522
- [629]: https://code.google.com/p/fullcalendar/issues/detail?id=629
523
- [637]: https://code.google.com/p/fullcalendar/issues/detail?id=637
524
- [714]: https://code.google.com/p/fullcalendar/issues/detail?id=714
525
- [728]: https://code.google.com/p/fullcalendar/issues/detail?id=728
526
- [736]: https://code.google.com/p/fullcalendar/issues/detail?id=736
527
- [778]: https://code.google.com/p/fullcalendar/issues/detail?id=778
528
- [809]: https://code.google.com/p/fullcalendar/issues/detail?id=809
529
- [936]: https://code.google.com/p/fullcalendar/issues/detail?id=936
530
- [1025]: https://code.google.com/p/fullcalendar/issues/detail?id=1025
531
- [1101]: https://code.google.com/p/fullcalendar/issues/detail?id=1101
532
- [1203]: https://code.google.com/p/fullcalendar/issues/detail?id=1203
533
- [1297]: https://code.google.com/p/fullcalendar/issues/detail?id=1297
534
- [1326]: https://code.google.com/p/fullcalendar/issues/detail?id=1326
535
- [1700]: https://code.google.com/p/fullcalendar/issues/detail?id=1700
536
- [1992]: https://code.google.com/p/fullcalendar/issues/detail?id=1992
537
- [1996]: https://code.google.com/p/fullcalendar/issues/detail?id=1996
538
- [2017]: https://code.google.com/p/fullcalendar/issues/detail?id=2017
539
- [2078]: https://code.google.com/p/fullcalendar/issues/detail?id=2078
540
- [2132]: https://code.google.com/p/fullcalendar/issues/detail?id=2132
541
- [2151]: https://code.google.com/p/fullcalendar/issues/detail?id=2151
542
- [2169]: https://code.google.com/p/fullcalendar/issues/detail?id=2169
543
- [2172]: https://code.google.com/p/fullcalendar/issues/detail?id=2172
544
- [2186]: https://code.google.com/p/fullcalendar/issues/detail?id=2186
545
- [2196]: https://code.google.com/p/fullcalendar/issues/detail?id=2196
546
- [111]: https://code.google.com/p/fullcalendar/issues/detail?id=111
547
-
548
-
549
- v2.0.3 (2014-08-15)
550
- -------------------
551
-
552
- - moment-2.8.1 compatibility ([2221])
553
- - relative path in bower.json ([PR 117])
554
- - upgraded jquery-ui and misc dev dependencies
555
-
556
- [2221]: https://code.google.com/p/fullcalendar/issues/detail?id=2221
557
- [PR 117]: https://github.com/arshaw/fullcalendar/pull/177
558
-
559
-
560
- v2.0.2 (2014-06-24)
561
- -------------------
562
-
563
- - bug with persisting addEventSource calls ([2191])
564
- - bug with persisting removeEvents calls with an array source ([2187])
565
- - bug with removeEvents method when called with 0 removes all events ([2082])
566
-
567
- [2191]: https://code.google.com/p/fullcalendar/issues/detail?id=2191
568
- [2187]: https://code.google.com/p/fullcalendar/issues/detail?id=2187
569
- [2082]: https://code.google.com/p/fullcalendar/issues/detail?id=2082
570
-
571
-
572
- v2.0.1 (2014-06-15)
573
- -------------------
574
-
575
- - `delta` parameters reintroduced in `eventDrop` and `eventResize` handlers ([2156])
576
- - **Note**: this changes the argument order for `revertFunc`
577
- - wrongfully triggering a windowResize when resizing an agenda view event ([1116])
578
- - `this` values in event drag-n-drop/resize handlers consistently the DOM node ([1177])
579
- - `displayEventEnd` - v2 workaround to force display of an end time ([2090])
580
- - don't modify passed-in eventSource items ([954])
581
- - destroy method now removes fc-ltr class ([2033])
582
- - weeks of last/next month still visible when weekends are hidden ([2095])
583
- - fixed memory leak when destroying calendar with selectable/droppable ([2137])
584
- - Icelandic language ([2180])
585
- - Bahasa Indonesia language ([PR 172])
586
-
587
- [1116]: https://code.google.com/p/fullcalendar/issues/detail?id=1116
588
- [1177]: https://code.google.com/p/fullcalendar/issues/detail?id=1177
589
- [2090]: https://code.google.com/p/fullcalendar/issues/detail?id=2090
590
- [954]: https://code.google.com/p/fullcalendar/issues/detail?id=954
591
- [2033]: https://code.google.com/p/fullcalendar/issues/detail?id=2033
592
- [2095]: https://code.google.com/p/fullcalendar/issues/detail?id=2095
593
- [2137]: https://code.google.com/p/fullcalendar/issues/detail?id=2137
594
- [2156]: https://code.google.com/p/fullcalendar/issues/detail?id=2156
595
- [2180]: https://code.google.com/p/fullcalendar/issues/detail?id=2180
596
- [PR 172]: https://github.com/arshaw/fullcalendar/pull/172
597
-
598
-
599
- v2.0.0 (2014-06-01)
600
- -------------------
601
-
602
- Internationalization support, timezone support, and [MomentJS] integration. Extensive changes, many
603
- of which are backwards incompatible.
604
-
605
- [Full list of changes][Upgrading-to-v2] | [Affected Issues][Date-Milestone]
606
-
607
- An automated testing framework has been set up ([Karma] + [Jasmine]) and tests have been written
608
- which cover about half of FullCalendar's functionality. Special thanks to @incre-d, @vidbina, and
609
- @sirrocco for the help.
610
-
611
- In addition, the main development repo has been repurposed to also include the built distributable
612
- JS/CSS for the project and will serve as the new [Bower] endpoint.
613
-
614
- [MomentJS]: http://momentjs.com/
615
- [Upgrading-to-v2]: http://arshaw.com/fullcalendar/wiki/Upgrading-to-v2/
616
- [Date-Milestone]: https://code.google.com/p/fullcalendar/issues/list?can=1&q=milestone%3Ddate
617
- [Karma]: http://karma-runner.github.io/
618
- [Jasmine]: http://jasmine.github.io/
619
- [Bower]: http://bower.io/
620
-
621
-
622
- v1.6.4 (2013-09-01)
623
- -------------------
624
-
625
- - better algorithm for positioning timed agenda events ([1115])
626
- - `slotEventOverlap` option to tweak timed agenda event overlapping ([218])
627
- - selection bug when slot height is customized ([1035])
628
- - supply view argument in `loading` callback ([1018])
629
- - fixed week number not displaying in agenda views ([1951])
630
- - fixed fullCalendar not initializing with no options ([1356])
631
- - NPM's `package.json`, no more warnings or errors ([1762])
632
- - building the bower component should output `bower.json` instead of `component.json` ([PR 125])
633
- - use bower internally for fetching new versions of jQuery and jQuery UI
634
-
635
- [1115]: https://code.google.com/p/fullcalendar/issues/detail?id=1115
636
- [218]: https://code.google.com/p/fullcalendar/issues/detail?id=218
637
- [1035]: https://code.google.com/p/fullcalendar/issues/detail?id=1035
638
- [1018]: https://code.google.com/p/fullcalendar/issues/detail?id=1018
639
- [1951]: https://code.google.com/p/fullcalendar/issues/detail?id=1951
640
- [1356]: https://code.google.com/p/fullcalendar/issues/detail?id=1356
641
- [1762]: https://code.google.com/p/fullcalendar/issues/detail?id=1762
642
- [PR 125]: https://github.com/arshaw/fullcalendar/pull/125
643
-
644
-
645
- v1.6.3 (2013-08-10)
646
- -------------------
647
-
648
- - `viewRender` callback ([PR 15])
649
- - `viewDestroy` callback ([PR 15])
650
- - `eventDestroy` callback ([PR 111])
651
- - `handleWindowResize` option ([PR 54])
652
- - `eventStartEditable`/`startEditable` options ([PR 49])
653
- - `eventDurationEditable`/`durationEditable` options ([PR 49])
654
- - specify function for `$.ajax` `data` parameter for JSON event sources ([PR 59])
655
- - fixed bug with agenda event dropping in wrong column ([PR 55])
656
- - easier event element z-index customization ([PR 58])
657
- - classNames on past/future days ([PR 88])
658
- - allow `null`/`undefined` event titles ([PR 84])
659
- - small optimize for agenda event rendering ([PR 56])
660
- - deprecated:
661
- - `viewDisplay`
662
- - `disableDragging`
663
- - `disableResizing`
664
- - bundled with latest jQuery (1.10.2) and jQuery UI (1.10.3)
665
-
666
- [PR 15]: https://github.com/arshaw/fullcalendar/pull/15
667
- [PR 111]: https://github.com/arshaw/fullcalendar/pull/111
668
- [PR 54]: https://github.com/arshaw/fullcalendar/pull/54
669
- [PR 49]: https://github.com/arshaw/fullcalendar/pull/49
670
- [PR 59]: https://github.com/arshaw/fullcalendar/pull/59
671
- [PR 55]: https://github.com/arshaw/fullcalendar/pull/55
672
- [PR 58]: https://github.com/arshaw/fullcalendar/pull/58
673
- [PR 88]: https://github.com/arshaw/fullcalendar/pull/88
674
- [PR 84]: https://github.com/arshaw/fullcalendar/pull/84
675
- [PR 56]: https://github.com/arshaw/fullcalendar/pull/56
676
-
677
-
678
- v1.6.2 (2013-07-18)
679
- -------------------
680
-
681
- - `hiddenDays` option ([686])
682
- - bugfix: when `eventRender` returns `false`, incorrect stacking of events ([762])
683
- - bugfix: couldn't change `event.backgroundImage` when calling `updateEvent` (thx @stephenharris)
684
-
685
- [686]: https://code.google.com/p/fullcalendar/issues/detail?id=686
686
- [762]: https://code.google.com/p/fullcalendar/issues/detail?id=762
687
-
688
-
689
- v1.6.1 (2013-04-14)
690
- -------------------
691
-
692
- - fixed event inner content overflow bug ([1783])
693
- - fixed table header className bug [1772]
694
- - removed text-shadow on events (better for general use, thx @tkrotoff)
695
-
696
- [1783]: https://code.google.com/p/fullcalendar/issues/detail?id=1783
697
- [1772]: https://code.google.com/p/fullcalendar/issues/detail?id=1772
698
-
699
-
700
- v1.6.0 (2013-03-18)
701
- -------------------
702
-
703
- - visual facelift, with bootstrap-inspired buttons and colors
704
- - simplified HTML/CSS for events and buttons
705
- - `dayRender`, for modifying a day cell ([191], thx @althaus)
706
- - week numbers on side of calendar ([295])
707
- - `weekNumber`
708
- - `weekNumberCalculation`
709
- - `weekNumberTitle`
710
- - `W` formatting variable
711
- - finer snapping granularity for agenda view events ([495], thx @ms-doodle-com)
712
- - `eventAfterAllRender` ([753], thx @pdrakeweb)
713
- - `eventDataTransform` (thx @joeyspo)
714
- - `data-date` attributes on cells (thx @Jae)
715
- - expose `$.fullCalendar.dateFormatters`
716
- - when clicking fast on buttons, prevent text selection
717
- - bundled with latest jQuery (1.9.1) and jQuery UI (1.10.2)
718
- - Grunt/Lumbar build system for internal development
719
- - build for Bower package manager
720
- - build for jQuery plugin site
721
-
722
- [191]: https://code.google.com/p/fullcalendar/issues/detail?id=191
723
- [295]: https://code.google.com/p/fullcalendar/issues/detail?id=295
724
- [495]: https://code.google.com/p/fullcalendar/issues/detail?id=495
725
- [753]: https://code.google.com/p/fullcalendar/issues/detail?id=753
726
-
727
-
728
- v1.5.4 (2012-09-05)
729
- -------------------
730
-
731
- - made compatible with jQuery 1.8.* (thx @archaeron)
732
- - bundled with jQuery 1.8.1 and jQuery UI 1.8.23
733
-
734
-
735
- v1.5.3 (2012-02-06)
736
- -------------------
737
-
738
- - fixed dragging issue with jQuery UI 1.8.16 ([1168])
739
- - bundled with jQuery 1.7.1 and jQuery UI 1.8.17
740
-
741
- [1168]: https://code.google.com/p/fullcalendar/issues/detail?id=1168
742
-
743
-
744
- v1.5.2 (2011-08-21)
745
- -------------------
746
-
747
- - correctly process UTC "Z" ISO8601 date strings ([750])
748
-
749
- [750]: https://code.google.com/p/fullcalendar/issues/detail?id=750
750
-
751
-
752
- v1.5.1 (2011-04-09)
753
- -------------------
754
-
755
- - more flexible ISO8601 date parsing ([814])
756
- - more flexible parsing of UNIX timestamps ([826])
757
- - FullCalendar now buildable from source on a Mac ([795])
758
- - FullCalendar QA'd in FF4 ([883])
759
- - upgraded to jQuery 1.5.2 (which supports IE9) and jQuery UI 1.8.11
760
-
761
- [814]: https://code.google.com/p/fullcalendar/issues/detail?id=814
762
- [826]: https://code.google.com/p/fullcalendar/issues/detail?id=826
763
- [795]: https://code.google.com/p/fullcalendar/issues/detail?id=795
764
- [883]: https://code.google.com/p/fullcalendar/issues/detail?id=883
765
-
766
-
767
- v1.5 (2011-03-19)
768
- -----------------
769
-
770
- - slicker default styling for buttons
771
- - reworked a lot of the calendar's HTML and accompanying CSS (solves [327] and [395])
772
- - more printer-friendly (fullcalendar-print.css)
773
- - fullcalendar now inherits styles from jquery-ui themes differently.
774
- styles for buttons are distinct from styles for calendar cells.
775
- (solves [299])
776
- - can now color events through FullCalendar options and Event-Object properties ([117])
777
- THIS IS NOW THE PREFERRED METHOD OF COLORING EVENTS (as opposed to using className and CSS)
778
- - FullCalendar options:
779
- - eventColor (changes both background and border)
780
- - eventBackgroundColor
781
- - eventBorderColor
782
- - eventTextColor
783
- - Event-Object options:
784
- - color (changes both background and border)
785
- - backgroundColor
786
- - borderColor
787
- - textColor
788
- - can now specify an event source as an *object* with a `url` property (json feed) or
789
- an `events` property (function or array) with additional properties that will
790
- be applied to the entire event source:
791
- - color (changes both background and border)
792
- - backgroudColor
793
- - borderColor
794
- - textColor
795
- - className
796
- - editable
797
- - allDayDefault
798
- - ignoreTimezone
799
- - startParam (for a feed)
800
- - endParam (for a feed)
801
- - ANY OF THE JQUERY $.ajax OPTIONS
802
- allows for easily changing from GET to POST and sending additional parameters ([386])
803
- allows for easily attaching ajax handlers such as `error` ([754])
804
- allows for turning caching on ([355])
805
- - Google Calendar feeds are now specified differently:
806
- - specify a simple string of your feed's URL
807
- - specify an *object* with a `url` property of your feed's URL.
808
- you can include any of the new Event-Source options in this object.
809
- - the old `$.fullCalendar.gcalFeed` method still works
810
- - no more IE7 SSL popup ([504])
811
- - remove `cacheParam` - use json event source `cache` option instead
812
- - latest jquery/jquery-ui
813
-
814
- [327]: https://code.google.com/p/fullcalendar/issues/detail?id=327
815
- [395]: https://code.google.com/p/fullcalendar/issues/detail?id=395
816
- [299]: https://code.google.com/p/fullcalendar/issues/detail?id=299
817
- [117]: https://code.google.com/p/fullcalendar/issues/detail?id=117
818
- [386]: https://code.google.com/p/fullcalendar/issues/detail?id=386
819
- [754]: https://code.google.com/p/fullcalendar/issues/detail?id=754
820
- [355]: https://code.google.com/p/fullcalendar/issues/detail?id=355
821
- [504]: https://code.google.com/p/fullcalendar/issues/detail?id=504
822
-
823
-
824
- v1.4.11 (2011-02-22)
825
- --------------------
826
-
827
- - fixed rerenderEvents bug ([790])
828
- - fixed bug with faulty dragging of events from all-day slot in agenda views
829
- - bundled with jquery 1.5 and jquery-ui 1.8.9
830
-
831
- [790]: https://code.google.com/p/fullcalendar/issues/detail?id=790
832
-
833
-
834
- v1.4.10 (2011-01-02)
835
- --------------------
836
-
837
- - fixed bug with resizing event to different week in 5-day month view ([740])
838
- - fixed bug with events not sticking after a removeEvents call ([757])
839
- - fixed bug with underlying parseTime method, and other uses of parseInt ([688])
840
-
841
- [740]: https://code.google.com/p/fullcalendar/issues/detail?id=740
842
- [757]: https://code.google.com/p/fullcalendar/issues/detail?id=757
843
- [688]: https://code.google.com/p/fullcalendar/issues/detail?id=688
844
-
845
-
846
- v1.4.9 (2010-11-16)
847
- -------------------
848
-
849
- - new algorithm for vertically stacking events ([111])
850
- - resizing an event to a different week ([306])
851
- - bug: some events not rendered with consecutive calls to addEventSource ([679])
852
-
853
- [111]: https://code.google.com/p/fullcalendar/issues/detail?id=111
854
- [306]: https://code.google.com/p/fullcalendar/issues/detail?id=306
855
- [679]: https://code.google.com/p/fullcalendar/issues/detail?id=679
856
-
857
-
858
- v1.4.8 (2010-10-16)
859
- -------------------
860
-
861
- - ignoreTimezone option (set to `false` to process UTC offsets in ISO8601 dates)
862
- - bugfixes
863
- - event refetching not being called under certain conditions ([417], [554])
864
- - event refetching being called multiple times under certain conditions ([586], [616])
865
- - selection cannot be triggered by right mouse button ([558])
866
- - agenda view left axis sized incorrectly ([465])
867
- - IE js error when calendar is too narrow ([517])
868
- - agenda view looks strange when no scrollbars ([235])
869
- - improved parsing of ISO8601 dates with UTC offsets
870
- - $.fullCalendar.version
871
- - an internal refactor of the code, for easier future development and modularity
872
-
873
- [417]: https://code.google.com/p/fullcalendar/issues/detail?id=417
874
- [554]: https://code.google.com/p/fullcalendar/issues/detail?id=554
875
- [586]: https://code.google.com/p/fullcalendar/issues/detail?id=586
876
- [616]: https://code.google.com/p/fullcalendar/issues/detail?id=616
877
- [558]: https://code.google.com/p/fullcalendar/issues/detail?id=558
878
- [465]: https://code.google.com/p/fullcalendar/issues/detail?id=465
879
- [517]: https://code.google.com/p/fullcalendar/issues/detail?id=517
880
- [235]: https://code.google.com/p/fullcalendar/issues/detail?id=235
881
-
882
-
883
- v1.4.7 (2010-07-05)
884
- -------------------
885
-
886
- - "dropping" external objects onto the calendar
887
- - droppable (boolean, to turn on/off)
888
- - dropAccept (to filter which events the calendar will accept)
889
- - drop (trigger)
890
- - selectable options can now be specified with a View Option Hash
891
- - bugfixes
892
- - dragged & reverted events having wrong time text ([406])
893
- - bug rendering events that have an endtime with seconds, but no hours/minutes ([477])
894
- - gotoDate date overflow bug ([429])
895
- - wrong date reported when clicking on edge of last column in agenda views [412]
896
- - support newlines in event titles
897
- - select/unselect callbacks now passes native js event
898
-
899
- [406]: https://code.google.com/p/fullcalendar/issues/detail?id=406
900
- [477]: https://code.google.com/p/fullcalendar/issues/detail?id=477
901
- [429]: https://code.google.com/p/fullcalendar/issues/detail?id=429
902
- [412]: https://code.google.com/p/fullcalendar/issues/detail?id=412
903
-
904
-
905
- v1.4.6 (2010-05-31)
906
- -------------------
907
-
908
- - "selecting" days or timeslots
909
- - options: selectable, selectHelper, unselectAuto, unselectCancel
910
- - callbacks: select, unselect
911
- - methods: select, unselect
912
- - when dragging an event, the highlighting reflects the duration of the event
913
- - code compressing by Google Closure Compiler
914
- - bundled with jQuery 1.4.2 and jQuery UI 1.8.1
915
-
916
-
917
- v1.4.5 (2010-02-21)
918
- -------------------
919
-
920
- - lazyFetching option, which can force the calendar to fetch events on every view/date change
921
- - scroll state of agenda views are preserved when switching back to view
922
- - bugfixes
923
- - calling methods on an uninitialized fullcalendar throws error
924
- - IE6/7 bug where an entire view becomes invisible ([320])
925
- - error when rendering a hidden calendar (in jquery ui tabs for example) in IE ([340])
926
- - interconnected bugs related to calendar resizing and scrollbars
927
- - when switching views or clicking prev/next, calendar would "blink" ([333])
928
- - liquid-width calendar's events shifted (depending on initial height of browser) ([341])
929
- - more robust underlying algorithm for calendar resizing
930
-
931
- [320]: https://code.google.com/p/fullcalendar/issues/detail?id=320
932
- [340]: https://code.google.com/p/fullcalendar/issues/detail?id=340
933
- [333]: https://code.google.com/p/fullcalendar/issues/detail?id=333
934
- [341]: https://code.google.com/p/fullcalendar/issues/detail?id=341
935
-
936
-
937
- v1.4.4 (2010-02-03)
938
- -------------------
939
-
940
- - optimized event rendering in all views (events render in 1/10 the time)
941
- - gotoDate() does not force the calendar to unnecessarily rerender
942
- - render() method now correctly readjusts height
943
-
944
-
945
- v1.4.3 (2009-12-22)
946
- -------------------
947
-
948
- - added destroy method
949
- - Google Calendar event pages respect currentTimezone
950
- - caching now handled by jQuery's ajax
951
- - protection from setting aspectRatio to zero
952
- - bugfixes
953
- - parseISO8601 and DST caused certain events to display day before
954
- - button positioning problem in IE6
955
- - ajax event source removed after recently being added, events still displayed
956
- - event not displayed when end is an empty string
957
- - dynamically setting calendar height when no events have been fetched, throws error
958
-
959
-
960
- v1.4.2 (2009-12-02)
961
- -------------------
962
-
963
- - eventAfterRender trigger
964
- - getDate & getView methods
965
- - height & contentHeight options (explicitly sets the pixel height)
966
- - minTime & maxTime options (restricts shown hours in agenda view)
967
- - getters [for all options] and setters [for height, contentHeight, and aspectRatio ONLY! stay tuned..]
968
- - render method now readjusts calendar's size
969
- - bugfixes
970
- - lightbox scripts that use iframes (like fancybox)
971
- - day-of-week classNames were off when firstDay=1
972
- - guaranteed space on right side of agenda events (even when stacked)
973
- - accepts ISO8601 dates with a space (instead of 'T')
974
-
975
-
976
- v1.4.1 (2009-10-31)
977
- -------------------
978
-
979
- - can exclude weekends with new 'weekends' option
980
- - gcal feed 'currentTimezone' option
981
- - bugfixes
982
- - year/month/date option sometimes wouldn't set correctly (depending on current date)
983
- - daylight savings issue caused agenda views to start at 1am (for BST users)
984
- - cleanup of gcal.js code
985
-
986
-
987
- v1.4 (2009-10-19)
988
- -----------------
989
-
990
- - agendaWeek and agendaDay views
991
- - added some options for agenda views:
992
- - allDaySlot
993
- - allDayText
994
- - firstHour
995
- - slotMinutes
996
- - defaultEventMinutes
997
- - axisFormat
998
- - modified some existing options/triggers to work with agenda views:
999
- - dragOpacity and timeFormat can now accept a "View Hash" (a new concept)
1000
- - dayClick now has an allDay parameter
1001
- - eventDrop now has an an allDay parameter
1002
- (this will affect those who use revertFunc, adjust parameter list)
1003
- - added 'prevYear' and 'nextYear' for buttons in header
1004
- - minor change for theme users, ui-state-hover not applied to active/inactive buttons
1005
- - added event-color-changing example in docs
1006
- - better defaults for right-to-left themed button icons
1007
-
1008
-
1009
- v1.3.2 (2009-10-13)
1010
- -------------------
1011
-
1012
- - Bugfixes (please upgrade from 1.3.1!)
1013
- - squashed potential infinite loop when addMonths and addDays
1014
- is called with an invalid date
1015
- - $.fullCalendar.parseDate() now correctly parses IETF format
1016
- - when switching views, the 'today' button sticks inactive, fixed
1017
- - gotoDate now can accept a single Date argument
1018
- - documentation for changes in 1.3.1 and 1.3.2 now on website
1019
-
1020
-
1021
- v1.3.1 (2009-09-30)
1022
- -------------------
1023
-
1024
- - Important Bugfixes (please upgrade from 1.3!)
1025
- - When current date was late in the month, for long months, and prev/next buttons
1026
- were clicked in month-view, some months would be skipped/repeated
1027
- - In certain time zones, daylight savings time would cause certain days
1028
- to be misnumbered in month-view
1029
- - Subtle change in way week interval is chosen when switching from month to basicWeek/basicDay view
1030
- - Added 'allDayDefault' option
1031
- - Added 'changeView' and 'render' methods
1032
-
1033
-
1034
- v1.3 (2009-09-21)
1035
- -----------------
1036
-
1037
- - different 'views': month/basicWeek/basicDay
1038
- - more flexible 'header' system for buttons
1039
- - themable by jQuery UI themes
1040
- - resizable events (require jQuery UI resizable plugin)
1041
- - rescoped & rewritten CSS, enhanced default look
1042
- - cleaner css & rendering techniques for right-to-left
1043
- - reworked options & API to support multiple views / be consistent with jQuery UI
1044
- - refactoring of entire codebase
1045
- - broken into different JS & CSS files, assembled w/ build scripts
1046
- - new test suite for new features, uses firebug-lite
1047
- - refactored docs
1048
- - Options
1049
- - + date
1050
- - + defaultView
1051
- - + aspectRatio
1052
- - + disableResizing
1053
- - + monthNames (use instead of $.fullCalendar.monthNames)
1054
- - + monthNamesShort (use instead of $.fullCalendar.monthAbbrevs)
1055
- - + dayNames (use instead of $.fullCalendar.dayNames)
1056
- - + dayNamesShort (use instead of $.fullCalendar.dayAbbrevs)
1057
- - + theme
1058
- - + buttonText
1059
- - + buttonIcons
1060
- - x draggable -> editable/disableDragging
1061
- - x fixedWeeks -> weekMode
1062
- - x abbrevDayHeadings -> columnFormat
1063
- - x buttons/title -> header
1064
- - x eventDragOpacity -> dragOpacity
1065
- - x eventRevertDuration -> dragRevertDuration
1066
- - x weekStart -> firstDay
1067
- - x rightToLeft -> isRTL
1068
- - x showTime (use 'allDay' CalEvent property instead)
1069
- - Triggered Actions
1070
- - + eventResizeStart
1071
- - + eventResizeStop
1072
- - + eventResize
1073
- - x monthDisplay -> viewDisplay
1074
- - x resize -> windowResize
1075
- - 'eventDrop' params changed, can revert if ajax cuts out
1076
- - CalEvent Properties
1077
- - x showTime -> allDay
1078
- - x draggable -> editable
1079
- - 'end' is now INCLUSIVE when allDay=true
1080
- - 'url' now produces a real <a> tag, more native clicking/tab behavior
1081
- - Methods:
1082
- - + renderEvent
1083
- - x prevMonth -> prev
1084
- - x nextMonth -> next
1085
- - x prevYear/nextYear -> moveDate
1086
- - x refresh -> rerenderEvents/refetchEvents
1087
- - x removeEvent -> removeEvents
1088
- - x getEventsByID -> clientEvents
1089
- - Utilities:
1090
- - 'formatDate' format string completely changed (inspired by jQuery UI datepicker + datejs)
1091
- - 'formatDates' added to support date-ranges
1092
- - Google Calendar Options:
1093
- - x draggable -> editable
1094
- - Bugfixes
1095
- - gcal extension fetched 25 results max, now fetches all
1096
-
1097
-
1098
- v1.2.1 (2009-06-29)
1099
- -------------------
1100
-
1101
- - bugfixes
1102
- - allows and corrects invalid end dates for events
1103
- - doesn't throw an error in IE while rendering when display:none
1104
- - fixed 'loading' callback when used w/ multiple addEventSource calls
1105
- - gcal className can now be an array
1106
-
1107
-
1108
- v1.2 (2009-05-31)
1109
- -----------------
1110
-
1111
- - expanded API
1112
- - 'className' CalEvent attribute
1113
- - 'source' CalEvent attribute
1114
- - dynamically get/add/remove/update events of current month
1115
- - locale improvements: change month/day name text
1116
- - better date formatting ($.fullCalendar.formatDate)
1117
- - multiple 'event sources' allowed
1118
- - dynamically add/remove event sources
1119
- - options for prevYear and nextYear buttons
1120
- - docs have been reworked (include addition of Google Calendar docs)
1121
- - changed behavior of parseDate for number strings
1122
- (now interpets as unix timestamp, not MS times)
1123
- - bugfixes
1124
- - rightToLeft month start bug
1125
- - off-by-one errors with month formatting commands
1126
- - events from previous months sticking when clicking prev/next quickly
1127
- - Google Calendar API changed to work w/ multiple event sources
1128
- - can also provide 'className' and 'draggable' options
1129
- - date utilties moved from $ to $.fullCalendar
1130
- - more documentation in source code
1131
- - minified version of fullcalendar.js
1132
- - test suit (available from svn)
1133
- - top buttons now use `<button>` w/ an inner `<span>` for better css cusomization
1134
- - thus CSS has changed. IF UPGRADING FROM PREVIOUS VERSIONS,
1135
- UPGRADE YOUR FULLCALENDAR.CSS FILE
1136
-
1137
-
1138
- v1.1 (2009-05-10)
1139
- -----------------
1140
-
1141
- - Added the following options:
1142
- - weekStart
1143
- - rightToLeft
1144
- - titleFormat
1145
- - timeFormat
1146
- - cacheParam
1147
- - resize
1148
- - Fixed rendering bugs
1149
- - Opera 9.25 (events placement & window resizing)
1150
- - IE6 (window resizing)
1151
- - Optimized window resizing for ALL browsers
1152
- - Events on same day now sorted by start time (but first by timespan)
1153
- - Correct z-index when dragging
1154
- - Dragging contained in overflow DIV for IE6
1155
- - Modified fullcalendar.css
1156
- - for right-to-left support
1157
- - for variable start-of-week
1158
- - for IE6 resizing bug
1159
- - for THEAD and TBODY (in 1.0, just used TBODY, restructured in 1.1)
1160
- - IF UPGRADING FROM FULLCALENDAR 1.0, YOU MUST UPGRADE FULLCALENDAR.CSS
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/lib/fullcalendar/CONTRIBUTING.txt DELETED
@@ -1,127 +0,0 @@
1
-
2
- ## Reporting Bugs
3
-
4
- Each bug report MUST have a [JSFiddle/JSBin] recreation before any work can begin. [further instructions &raquo;](http://fullcalendar.io/wiki/Reporting-Bugs/)
5
-
6
-
7
- ## Requesting Features
8
-
9
- Please search the [Issue Tracker] to see if your feature has already been requested, and if so, subscribe to it. Otherwise, read these [further instructions &raquo;](http://fullcalendar.io/wiki/Requesting-Features/)
10
-
11
-
12
- ## Contributing Features
13
-
14
- The FullCalendar project welcomes [Pull Requests][Using Pull Requests] for new features, but because there are so many feature requests (over 100), and because every new feature requires refinement and maintenance, each PR will be prioritized against the project's other demands and might take a while to make it to an official release.
15
-
16
- Furthermore, each new feature should be designed as robustly as possible and be useful beyond the immediate usecase it was initially designed for. Feel free to start a ticket discussing the feature's specs before coding.
17
-
18
-
19
- ## Contributing Bugfixes
20
-
21
- In the description of your [Pull Request][Using Pull Requests], please include recreation steps for the bug as well as a [JSFiddle/JSBin] demo. Communicating the buggy behavior is a requirement before a merge can happen.
22
-
23
-
24
- ## Contributing Locales
25
-
26
- Please edit the original files in the `locale/` directory. DO NOT edit anything in the `dist/` directory. The build system will responsible for merging FullCalendar's `locale/` data with the [MomentJS locale data].
27
-
28
-
29
- ## Other Ways to Contribute
30
-
31
- [Read about other ways to contribute &raquo;](http://fullcalendar.io/wiki/Contributing/)
32
-
33
-
34
- ## Getting Set Up
35
-
36
- You will need [Git][git], [Node][node], and NPM installed. For clarification, please view the [jQuery readme][jq-readme], which requires a similar setup.
37
-
38
- Also, you will need the [gulp-cli][gulp-cli] package installed globally (`-g`) on your system:
39
-
40
- npm install -g gulp-cli
41
-
42
- Then, clone FullCalendar's git repo:
43
-
44
- git clone git://github.com/fullcalendar/fullcalendar.git
45
-
46
- Enter the directory and install FullCalendar's dependencies:
47
-
48
- cd fullcalendar
49
- npm install
50
-
51
-
52
- ## What to edit
53
-
54
- When modifying files, please do not edit the generated or minified files in the `dist/` directory. Please edit the original `src/` files.
55
-
56
-
57
- ## Development Workflow
58
-
59
- After you make code changes, you'll want to compile the JS/CSS so that it can be previewed from the tests and demos. You can either manually rebuild each time you make a change:
60
-
61
- gulp dev
62
-
63
- Or, you can run a script that automatically rebuilds whenever you save a source file:
64
-
65
- gulp watch
66
-
67
- When you are finished, run the following command to write the distributable files into the `./dist/` directory:
68
-
69
- gulp dist
70
-
71
- If you want to clean up the generated files, run:
72
-
73
- gulp clean
74
-
75
-
76
- ## Style Guide
77
-
78
- Please follow the [Google JavaScript Style Guide] as closely as possible. With the following exceptions:
79
-
80
- ```js
81
- if (true) {
82
- }
83
- else { // please put else, else if, and catch on a separate line
84
- }
85
-
86
- // please write one-line array literals with a one-space padding inside
87
- var a = [ 1, 2, 3 ];
88
-
89
- // please write one-line object literals with a one-space padding inside
90
- var o = { a: 1, b: 2, c: 3 };
91
- ```
92
-
93
- Other exceptions:
94
-
95
- - please ignore anything about Google Closure Compiler or the `goog` library
96
- - please do not write JSDoc comments
97
-
98
- Notes about whitespace:
99
-
100
- - **use *tabs* instead of spaces**
101
- - separate functions with *2* blank lines
102
- - separate logical blocks within functions with *1* blank line
103
-
104
- Run the command line tool to automatically check your style:
105
-
106
- gulp lint
107
-
108
-
109
- ## Before Submitting your Code
110
-
111
- If you have edited code (including **tests** and **translations**) and would like to submit a pull request, please make sure you have done the following:
112
-
113
- 1. Conformed to the style guide (successfully run `gulp lint`)
114
-
115
- 2. Written automated tests. View the [Automated Test Readme]
116
-
117
-
118
- [JSFiddle/JSBin]: http://fullcalendar.io/wiki/Reporting-Bugs/
119
- [Issue Tracker]: https://github.com/fullcalendar/fullcalendar/issues
120
- [Using Pull Requests]: https://help.github.com/articles/using-pull-requests/
121
- [MomentJS locale data]: https://github.com/moment/moment/tree/develop/locale
122
- [git]: http://git-scm.com/
123
- [node]: http://nodejs.org/
124
- [gulp-cli]: https://github.com/gulpjs/gulp/blob/master/docs/getting-started.md
125
- [jq-readme]: https://github.com/jquery/jquery/blob/master/README.md#what-you-need-to-build-your-own-jquery
126
- [Google JavaScript Style Guide]: http://google-styleguide.googlecode.com/svn/trunk/javascriptguide.xml
127
- [Automated Test Readme]: https://github.com/fullcalendar/fullcalendar/wiki/Automated-Tests
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/lib/fullcalendar/LICENSE.txt DELETED
@@ -1,20 +0,0 @@
1
- Copyright (c) 2015 Adam Shaw
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining
4
- a copy of this software and associated documentation files (the
5
- "Software"), to deal in the Software without restriction, including
6
- without limitation the rights to use, copy, modify, merge, publish,
7
- distribute, sublicense, and/or sell copies of the Software, and to
8
- permit persons to whom the Software is furnished to do so, subject to
9
- the following conditions:
10
-
11
- The above copyright notice and this permission notice shall be
12
- included in all copies or substantial portions of the Software.
13
-
14
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/lib/fullcalendar/fullcalendar.css DELETED
@@ -1,1418 +0,0 @@
1
- /*!
2
- * FullCalendar v3.4.0 Stylesheet
3
- * Docs & License: https://fullcalendar.io/
4
- * (c) 2017 Adam Shaw
5
- */
6
-
7
-
8
- .fc {
9
- direction: ltr;
10
- text-align: left;
11
- }
12
-
13
- .fc-rtl {
14
- text-align: right;
15
- }
16
-
17
- body .fc { /* extra precedence to overcome jqui */
18
- font-size: 1em;
19
- }
20
-
21
-
22
- /* Colors
23
- --------------------------------------------------------------------------------------------------*/
24
-
25
- .fc-unthemed th,
26
- .fc-unthemed td,
27
- .fc-unthemed thead,
28
- .fc-unthemed tbody,
29
- .fc-unthemed .fc-divider,
30
- .fc-unthemed .fc-row,
31
- .fc-unthemed .fc-content, /* for gutter border */
32
- .fc-unthemed .fc-popover,
33
- .fc-unthemed .fc-list-view,
34
- .fc-unthemed .fc-list-heading td {
35
- border-color: #ddd;
36
- }
37
-
38
- .fc-unthemed .fc-popover {
39
- background-color: #fff;
40
- }
41
-
42
- .fc-unthemed .fc-divider,
43
- .fc-unthemed .fc-popover .fc-header,
44
- .fc-unthemed .fc-list-heading td {
45
- background: #eee;
46
- font-size: 14px;
47
- font-weight: 600;
48
- }
49
-
50
- .fc-unthemed .fc-popover .fc-header .fc-close {
51
- color: #666;
52
- }
53
-
54
- .fc-unthemed td.fc-today {
55
- background: #fcf8e3;
56
- }
57
-
58
- .fc-highlight { /* when user is selecting cells */
59
- background: #bce8f1;
60
- opacity: .3;
61
- }
62
-
63
- .fc-bgevent { /* default look for background events */
64
- background: rgb(143, 223, 130);
65
- opacity: .3;
66
- }
67
-
68
- .fc-nonbusiness { /* default look for non-business-hours areas */
69
- /* will inherit .fc-bgevent's styles */
70
- background: #d7d7d7;
71
- }
72
-
73
- .fc-unthemed .fc-disabled-day {
74
- background: #d7d7d7;
75
- opacity: .3;
76
- }
77
-
78
- .ui-widget .fc-disabled-day { /* themed */
79
- background-image: none;
80
- }
81
-
82
-
83
- /* Icons (inline elements with styled text that mock arrow icons)
84
- --------------------------------------------------------------------------------------------------*/
85
-
86
- .fc-icon {
87
- display: inline-block;
88
- height: 1em;
89
- line-height: 1em;
90
- font-size: 1em;
91
- text-align: center;
92
- overflow: hidden;
93
- font-family: "Courier New", Courier, monospace;
94
-
95
- /* don't allow browser text-selection */
96
- -webkit-touch-callout: none;
97
- -webkit-user-select: none;
98
- -khtml-user-select: none;
99
- -moz-user-select: none;
100
- -ms-user-select: none;
101
- user-select: none;
102
- }
103
-
104
- /*
105
- Acceptable font-family overrides for individual icons:
106
- "Arial", sans-serif
107
- "Times New Roman", serif
108
-
109
- NOTE: use percentage font sizes or else old IE chokes
110
- */
111
-
112
- .fc-icon:after {
113
- position: relative;
114
- }
115
-
116
- .fc-icon-left-single-arrow:after {
117
- content: "\02039";
118
- font-weight: bold;
119
- font-size: 200%;
120
- top: -7%;
121
- }
122
-
123
- .fc-icon-right-single-arrow:after {
124
- content: "\0203A";
125
- font-weight: bold;
126
- font-size: 200%;
127
- top: -7%;
128
- }
129
-
130
- .fc-icon-left-double-arrow:after {
131
- content: "\000AB";
132
- font-size: 160%;
133
- top: -7%;
134
- }
135
-
136
- .fc-icon-right-double-arrow:after {
137
- content: "\000BB";
138
- font-size: 160%;
139
- top: -7%;
140
- }
141
-
142
- .fc-icon-left-triangle:after {
143
- content: "\25C4";
144
- font-size: 125%;
145
- top: 3%;
146
- }
147
-
148
- .fc-icon-right-triangle:after {
149
- content: "\25BA";
150
- font-size: 125%;
151
- top: 3%;
152
- }
153
-
154
- .fc-icon-down-triangle:after {
155
- content: "\25BC";
156
- font-size: 125%;
157
- top: 2%;
158
- }
159
-
160
- .fc-icon-x:after {
161
- content: "\000D7";
162
- font-size: 200%;
163
- top: 6%;
164
- }
165
-
166
-
167
- /* Buttons (styled <button> tags, normalized to work cross-browser)
168
- --------------------------------------------------------------------------------------------------*/
169
-
170
- .fc button {
171
- /* force height to include the border and padding */
172
- -moz-box-sizing: border-box;
173
- -webkit-box-sizing: border-box;
174
- box-sizing: border-box;
175
-
176
- /* dimensions */
177
- margin: 0;
178
- height: 2.1em;
179
- padding: 0 .6em;
180
-
181
- /* text & cursor */
182
- font-size: 1em; /* normalize */
183
- white-space: nowrap;
184
- cursor: pointer;
185
- }
186
-
187
- /* Firefox has an annoying inner border */
188
- .fc button::-moz-focus-inner { margin: 0; padding: 0; }
189
-
190
- .fc-state-default { /* non-theme */
191
- border: 1px solid;
192
- }
193
-
194
- .fc-state-default.fc-corner-left { /* non-theme */
195
- border-top-left-radius: 4px;
196
- border-bottom-left-radius: 4px;
197
- }
198
-
199
- .fc-state-default.fc-corner-right { /* non-theme */
200
- border-top-right-radius: 4px;
201
- border-bottom-right-radius: 4px;
202
- }
203
-
204
- /* icons in buttons */
205
-
206
- .fc button .fc-icon { /* non-theme */
207
- position: relative;
208
- top: -0.05em; /* seems to be a good adjustment across browsers */
209
- margin: 0 .2em;
210
- vertical-align: middle;
211
- }
212
-
213
- /*
214
- button states
215
- borrowed from twitter bootstrap (http://twitter.github.com/bootstrap/)
216
- */
217
-
218
- .fc-state-default {
219
- background-color: #f5f5f5;
220
- background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6);
221
- background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#e6e6e6));
222
- background-image: -webkit-linear-gradient(top, #ffffff, #e6e6e6);
223
- background-image: -o-linear-gradient(top, #ffffff, #e6e6e6);
224
- background-image: linear-gradient(to bottom, #ffffff, #e6e6e6);
225
- background-repeat: repeat-x;
226
- border-color: #e6e6e6 #e6e6e6 #bfbfbf;
227
- border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
228
- color: #333;
229
- text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75);
230
- box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
231
- }
232
-
233
- .fc-state-hover,
234
- .fc-state-down,
235
- .fc-state-active,
236
- .fc-state-disabled {
237
- color: #333333;
238
- background-color: #e6e6e6;
239
- }
240
-
241
- .fc-state-hover {
242
- color: #333333;
243
- text-decoration: none;
244
- background-position: 0 -15px;
245
- -webkit-transition: background-position 0.1s linear;
246
- -moz-transition: background-position 0.1s linear;
247
- -o-transition: background-position 0.1s linear;
248
- transition: background-position 0.1s linear;
249
- }
250
-
251
- .fc-state-down,
252
- .fc-state-active {
253
- background-color: #cccccc;
254
- background-image: none;
255
- box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
256
- }
257
-
258
- .fc-state-disabled {
259
- cursor: default;
260
- background-image: none;
261
- opacity: 0.65;
262
- box-shadow: none;
263
- }
264
-
265
-
266
- /* Buttons Groups
267
- --------------------------------------------------------------------------------------------------*/
268
-
269
- .fc-button-group {
270
- display: inline-block;
271
- }
272
-
273
- /*
274
- every button that is not first in a button group should scootch over one pixel and cover the
275
- previous button's border...
276
- */
277
-
278
- .fc .fc-button-group > * { /* extra precedence b/c buttons have margin set to zero */
279
- float: left;
280
- margin: 0 0 0 -1px;
281
- }
282
-
283
- .fc .fc-button-group > :first-child { /* same */
284
- margin-left: 0;
285
- }
286
-
287
-
288
- /* Popover
289
- --------------------------------------------------------------------------------------------------*/
290
-
291
- .fc-popover {
292
- position: absolute;
293
- box-shadow: 0 2px 6px rgba(0,0,0,.15);
294
- }
295
-
296
- .fc-popover .fc-header { /* TODO: be more consistent with fc-head/fc-body */
297
- padding: 2px 4px;
298
- }
299
-
300
- .fc-popover .fc-header .fc-title {
301
- margin: 0 2px;
302
- }
303
-
304
- .fc-popover .fc-header .fc-close {
305
- cursor: pointer;
306
- }
307
-
308
- .fc-ltr .fc-popover .fc-header .fc-title,
309
- .fc-rtl .fc-popover .fc-header .fc-close {
310
- float: left;
311
- }
312
-
313
- .fc-rtl .fc-popover .fc-header .fc-title,
314
- .fc-ltr .fc-popover .fc-header .fc-close {
315
- float: right;
316
- }
317
-
318
- /* unthemed */
319
-
320
- .fc-unthemed .fc-popover {
321
- border-width: 1px;
322
- border-style: solid;
323
- }
324
-
325
- .fc-unthemed .fc-popover .fc-header .fc-close {
326
- font-size: .9em;
327
- margin-top: 2px;
328
- }
329
-
330
- /* jqui themed */
331
-
332
- .fc-popover > .ui-widget-header + .ui-widget-content {
333
- border-top: 0; /* where they meet, let the header have the border */
334
- }
335
-
336
-
337
- /* Misc Reusable Components
338
- --------------------------------------------------------------------------------------------------*/
339
-
340
- .fc-divider {
341
- border-style: solid;
342
- border-width: 1px;
343
- }
344
-
345
- hr.fc-divider {
346
- height: 0;
347
- margin: 0;
348
- padding: 0 0 2px; /* height is unreliable across browsers, so use padding */
349
- border-width: 1px 0;
350
- }
351
-
352
- .fc-clear {
353
- clear: both;
354
- }
355
-
356
- .fc-bg,
357
- .fc-bgevent-skeleton,
358
- .fc-highlight-skeleton,
359
- .fc-helper-skeleton {
360
- /* these element should always cling to top-left/right corners */
361
- position: absolute;
362
- top: 0;
363
- left: 0;
364
- right: 0;
365
- }
366
-
367
- .fc-bg {
368
- bottom: 0; /* strech bg to bottom edge */
369
- }
370
-
371
- .fc-bg table {
372
- height: 100%; /* strech bg to bottom edge */
373
- }
374
-
375
-
376
- /* Tables
377
- --------------------------------------------------------------------------------------------------*/
378
-
379
- .fc table {
380
- width: 100%;
381
- box-sizing: border-box; /* fix scrollbar issue in firefox */
382
- table-layout: fixed;
383
- border-collapse: collapse;
384
- border-spacing: 0;
385
- font-size: 1em; /* normalize cross-browser */
386
- }
387
-
388
- .fc th {
389
- text-align: center;
390
- }
391
-
392
- .fc th,
393
- .fc td {
394
- border-style: solid;
395
- border-width: 1px;
396
- padding: 0;
397
- vertical-align: top;
398
- }
399
-
400
- .fc td.fc-today {
401
- border-style: double; /* overcome neighboring borders */
402
- }
403
-
404
-
405
- /* Internal Nav Links
406
- --------------------------------------------------------------------------------------------------*/
407
-
408
- a[data-goto] {
409
- cursor: pointer;
410
- }
411
-
412
- a[data-goto]:hover {
413
- text-decoration: underline;
414
- }
415
-
416
-
417
- /* Fake Table Rows
418
- --------------------------------------------------------------------------------------------------*/
419
-
420
- .fc .fc-row { /* extra precedence to overcome themes w/ .ui-widget-content forcing a 1px border */
421
- /* no visible border by default. but make available if need be (scrollbar width compensation) */
422
- border-style: solid;
423
- border-width: 0;
424
- }
425
-
426
- .fc-row table {
427
- /* don't put left/right border on anything within a fake row.
428
- the outer tbody will worry about this */
429
- border-left: 0 hidden transparent;
430
- border-right: 0 hidden transparent;
431
-
432
- /* no bottom borders on rows */
433
- border-bottom: 0 hidden transparent;
434
- }
435
-
436
- .fc-row:first-child table {
437
- border-top: 0 hidden transparent; /* no top border on first row */
438
- }
439
-
440
-
441
- /* Day Row (used within the header and the DayGrid)
442
- --------------------------------------------------------------------------------------------------*/
443
-
444
- .fc-row {
445
- position: relative;
446
- }
447
-
448
- .fc-row .fc-bg {
449
- z-index: 1;
450
- }
451
-
452
- /* highlighting cells & background event skeleton */
453
-
454
- .fc-row .fc-bgevent-skeleton,
455
- .fc-row .fc-highlight-skeleton {
456
- bottom: 0; /* stretch skeleton to bottom of row */
457
- }
458
-
459
- .fc-row .fc-bgevent-skeleton table,
460
- .fc-row .fc-highlight-skeleton table {
461
- height: 100%; /* stretch skeleton to bottom of row */
462
- }
463
-
464
- .fc-row .fc-highlight-skeleton td,
465
- .fc-row .fc-bgevent-skeleton td {
466
- border-color: transparent;
467
- }
468
-
469
- .fc-row .fc-bgevent-skeleton {
470
- z-index: 2;
471
-
472
- }
473
-
474
- .fc-row .fc-highlight-skeleton {
475
- z-index: 3;
476
- }
477
-
478
- /*
479
- row content (which contains day/week numbers and events) as well as "helper" (which contains
480
- temporary rendered events).
481
- */
482
-
483
- .fc-row .fc-content-skeleton {
484
- position: relative;
485
- z-index: 4;
486
- padding-bottom: 2px; /* matches the space above the events */
487
- }
488
-
489
- .fc-row .fc-helper-skeleton {
490
- z-index: 5;
491
- }
492
-
493
- .fc-row .fc-content-skeleton td,
494
- .fc-row .fc-helper-skeleton td {
495
- /* see-through to the background below */
496
- background: none; /* in case <td>s are globally styled */
497
- border-color: transparent;
498
-
499
- /* don't put a border between events and/or the day number */
500
- border-bottom: 0;
501
- }
502
-
503
- .fc-row .fc-content-skeleton tbody td, /* cells with events inside (so NOT the day number cell) */
504
- .fc-row .fc-helper-skeleton tbody td {
505
- /* don't put a border between event cells */
506
- border-top: 0;
507
- }
508
-
509
-
510
- /* Scrolling Container
511
- --------------------------------------------------------------------------------------------------*/
512
-
513
- .fc-scroller {
514
- -webkit-overflow-scrolling: touch;
515
- }
516
-
517
- /* TODO: move to agenda/basic */
518
- .fc-scroller > .fc-day-grid,
519
- .fc-scroller > .fc-time-grid {
520
- position: relative; /* re-scope all positions */
521
- width: 100%; /* hack to force re-sizing this inner element when scrollbars appear/disappear */
522
- }
523
-
524
-
525
- /* Global Event Styles
526
- --------------------------------------------------------------------------------------------------*/
527
-
528
- .fc-event {
529
- position: relative; /* for resize handle and other inner positioning */
530
- display: block; /* make the <a> tag block */
531
- font-size: .85em;
532
- line-height: 1.3;
533
- border-radius: 3px;
534
- border: 1px solid #3a87ad; /* default BORDER color */
535
- font-weight: normal; /* undo jqui's ui-widget-header bold */
536
- }
537
-
538
- .fc-event,
539
- .fc-event-dot {
540
- background-color: #3a87ad; /* default BACKGROUND color */
541
- }
542
-
543
- /* overpower some of bootstrap's and jqui's styles on <a> tags */
544
- .fc-event,
545
- .fc-event:hover,
546
- .ui-widget .fc-event {
547
- color: #fff; /* default TEXT color */
548
- text-decoration: none; /* if <a> has an href */
549
- }
550
-
551
- .fc-event[href],
552
- .fc-event.fc-draggable {
553
- cursor: pointer; /* give events with links and draggable events a hand mouse pointer */
554
- }
555
-
556
- .fc-not-allowed, /* causes a "warning" cursor. applied on body */
557
- .fc-not-allowed .fc-event { /* to override an event's custom cursor */
558
- cursor: not-allowed;
559
- }
560
-
561
- .fc-event .fc-bg { /* the generic .fc-bg already does position */
562
- z-index: 1;
563
- background: #fff;
564
- opacity: .25;
565
- }
566
-
567
- .fc-event .fc-content {
568
- position: relative;
569
- z-index: 2;
570
- }
571
-
572
- /* resizer (cursor AND touch devices) */
573
-
574
- .fc-event .fc-resizer {
575
- position: absolute;
576
- z-index: 4;
577
- }
578
-
579
- /* resizer (touch devices) */
580
-
581
- .fc-event .fc-resizer {
582
- display: none;
583
- }
584
-
585
- .fc-event.fc-allow-mouse-resize .fc-resizer,
586
- .fc-event.fc-selected .fc-resizer {
587
- /* only show when hovering or selected (with touch) */
588
- display: block;
589
- }
590
-
591
- /* hit area */
592
-
593
- .fc-event.fc-selected .fc-resizer:before {
594
- /* 40x40 touch area */
595
- content: "";
596
- position: absolute;
597
- z-index: 9999; /* user of this util can scope within a lower z-index */
598
- top: 50%;
599
- left: 50%;
600
- width: 40px;
601
- height: 40px;
602
- margin-left: -20px;
603
- margin-top: -20px;
604
- }
605
-
606
-
607
- /* Event Selection (only for touch devices)
608
- --------------------------------------------------------------------------------------------------*/
609
-
610
- .fc-event.fc-selected {
611
- z-index: 9999 !important; /* overcomes inline z-index */
612
- box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
613
- }
614
-
615
- .fc-event.fc-selected.fc-dragging {
616
- box-shadow: 0 2px 7px rgba(0, 0, 0, 0.3);
617
- }
618
-
619
-
620
- /* Horizontal Events
621
- --------------------------------------------------------------------------------------------------*/
622
-
623
- /* bigger touch area when selected */
624
- .fc-h-event.fc-selected:before {
625
- content: "";
626
- position: absolute;
627
- z-index: 3; /* below resizers */
628
- top: -10px;
629
- bottom: -10px;
630
- left: 0;
631
- right: 0;
632
- }
633
-
634
- /* events that are continuing to/from another week. kill rounded corners and butt up against edge */
635
-
636
- .fc-ltr .fc-h-event.fc-not-start,
637
- .fc-rtl .fc-h-event.fc-not-end {
638
- margin-left: 0;
639
- border-left-width: 0;
640
- padding-left: 1px; /* replace the border with padding */
641
- border-top-left-radius: 0;
642
- border-bottom-left-radius: 0;
643
- }
644
-
645
- .fc-ltr .fc-h-event.fc-not-end,
646
- .fc-rtl .fc-h-event.fc-not-start {
647
- margin-right: 0;
648
- border-right-width: 0;
649
- padding-right: 1px; /* replace the border with padding */
650
- border-top-right-radius: 0;
651
- border-bottom-right-radius: 0;
652
- }
653
-
654
- /* resizer (cursor AND touch devices) */
655
-
656
- /* left resizer */
657
- .fc-ltr .fc-h-event .fc-start-resizer,
658
- .fc-rtl .fc-h-event .fc-end-resizer {
659
- cursor: w-resize;
660
- left: -1px; /* overcome border */
661
- }
662
-
663
- /* right resizer */
664
- .fc-ltr .fc-h-event .fc-end-resizer,
665
- .fc-rtl .fc-h-event .fc-start-resizer {
666
- cursor: e-resize;
667
- right: -1px; /* overcome border */
668
- }
669
-
670
- /* resizer (mouse devices) */
671
-
672
- .fc-h-event.fc-allow-mouse-resize .fc-resizer {
673
- width: 7px;
674
- top: -1px; /* overcome top border */
675
- bottom: -1px; /* overcome bottom border */
676
- }
677
-
678
- /* resizer (touch devices) */
679
-
680
- .fc-h-event.fc-selected .fc-resizer {
681
- /* 8x8 little dot */
682
- border-radius: 4px;
683
- border-width: 1px;
684
- width: 6px;
685
- height: 6px;
686
- border-style: solid;
687
- border-color: inherit;
688
- background: #fff;
689
- /* vertically center */
690
- top: 50%;
691
- margin-top: -4px;
692
- }
693
-
694
- /* left resizer */
695
- .fc-ltr .fc-h-event.fc-selected .fc-start-resizer,
696
- .fc-rtl .fc-h-event.fc-selected .fc-end-resizer {
697
- margin-left: -4px; /* centers the 8x8 dot on the left edge */
698
- }
699
-
700
- /* right resizer */
701
- .fc-ltr .fc-h-event.fc-selected .fc-end-resizer,
702
- .fc-rtl .fc-h-event.fc-selected .fc-start-resizer {
703
- margin-right: -4px; /* centers the 8x8 dot on the right edge */
704
- }
705
-
706
-
707
- /* DayGrid events
708
- ----------------------------------------------------------------------------------------------------
709
- We use the full "fc-day-grid-event" class instead of using descendants because the event won't
710
- be a descendant of the grid when it is being dragged.
711
- */
712
-
713
- .fc-day-grid-event {
714
- margin: 5px 5px 0; /* spacing between events and edges */
715
- padding: 0 1px;
716
- }
717
-
718
- tr:first-child > td > .fc-day-grid-event {
719
- margin-top: 2px; /* a little bit more space before the first event */
720
- }
721
-
722
- .fc-day-grid-event.fc-selected:after {
723
- content: "";
724
- position: absolute;
725
- z-index: 1; /* same z-index as fc-bg, behind text */
726
- /* overcome the borders */
727
- top: -1px;
728
- right: -1px;
729
- bottom: -1px;
730
- left: -1px;
731
- /* darkening effect */
732
- background: #000;
733
- opacity: .25;
734
- }
735
-
736
- .fc-day-grid-event .fc-content { /* force events to be one-line tall */
737
- white-space: nowrap;
738
- overflow: hidden;
739
- }
740
-
741
- .fc-day-grid-event .fc-time {
742
- font-weight: bold;
743
- }
744
-
745
- /* resizer (cursor devices) */
746
-
747
- /* left resizer */
748
- .fc-ltr .fc-day-grid-event.fc-allow-mouse-resize .fc-start-resizer,
749
- .fc-rtl .fc-day-grid-event.fc-allow-mouse-resize .fc-end-resizer {
750
- margin-left: -2px; /* to the day cell's edge */
751
- }
752
-
753
- /* right resizer */
754
- .fc-ltr .fc-day-grid-event.fc-allow-mouse-resize .fc-end-resizer,
755
- .fc-rtl .fc-day-grid-event.fc-allow-mouse-resize .fc-start-resizer {
756
- margin-right: -2px; /* to the day cell's edge */
757
- }
758
-
759
-
760
- /* Event Limiting
761
- --------------------------------------------------------------------------------------------------*/
762
-
763
- /* "more" link that represents hidden events */
764
-
765
- a.fc-more {
766
- margin: 1px 3px;
767
- font-size: .85em;
768
- cursor: pointer;
769
- text-decoration: none;
770
- }
771
-
772
- a.fc-more:hover {
773
- text-decoration: underline;
774
- }
775
-
776
- .fc-limited { /* rows and cells that are hidden because of a "more" link */
777
- display: none;
778
- }
779
-
780
- /* popover that appears when "more" link is clicked */
781
-
782
- .fc-day-grid .fc-row {
783
- z-index: 1; /* make the "more" popover one higher than this */
784
- }
785
-
786
- .fc-more-popover {
787
- z-index: 2;
788
- width: 60%;
789
- box-shadow: 0 .9rem 1rem rgba(0, 0, 0, 0.55) !important;
790
- }
791
-
792
- .fc-more-popover .fc-event-container {
793
- padding: 10px;
794
- display: grid;
795
- grid-template-columns: 1fr 1fr 1fr;
796
- }
797
-
798
-
799
- /* Now Indicator
800
- --------------------------------------------------------------------------------------------------*/
801
-
802
- .fc-now-indicator {
803
- position: absolute;
804
- border: 0 solid red;
805
- }
806
-
807
-
808
- /* Utilities
809
- --------------------------------------------------------------------------------------------------*/
810
-
811
- .fc-unselectable {
812
- -webkit-user-select: none;
813
- -khtml-user-select: none;
814
- -moz-user-select: none;
815
- -ms-user-select: none;
816
- user-select: none;
817
- -webkit-touch-callout: none;
818
- -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
819
- }
820
-
821
-
822
-
823
- /* Toolbar
824
- --------------------------------------------------------------------------------------------------*/
825
-
826
- .fc-toolbar {
827
- text-align: center;
828
- }
829
-
830
- .fc-toolbar.fc-header-toolbar {
831
- margin-bottom: 1em;
832
- }
833
-
834
- .fc-toolbar.fc-footer-toolbar {
835
- margin-top: 1em;
836
- }
837
-
838
- .fc-toolbar .fc-left {
839
- float: left;
840
- }
841
-
842
- .fc-toolbar .fc-right {
843
- float: right;
844
- }
845
-
846
- .fc-toolbar .fc-center {
847
- display: inline-block;
848
- }
849
-
850
- /* the things within each left/right/center section */
851
- .fc .fc-toolbar > * > * { /* extra precedence to override button border margins */
852
- float: left;
853
- margin-left: .75em;
854
- }
855
-
856
- /* the first thing within each left/center/right section */
857
- .fc .fc-toolbar > * > :first-child { /* extra precedence to override button border margins */
858
- margin-left: 0;
859
- }
860
-
861
- /* title text */
862
-
863
- .fc-toolbar h2 {
864
- margin: 0;
865
- }
866
-
867
- /* button layering (for border precedence) */
868
-
869
- .fc-toolbar button {
870
- position: relative;
871
- }
872
-
873
- .fc-toolbar .fc-state-hover,
874
- .fc-toolbar .ui-state-hover {
875
- z-index: 2;
876
- }
877
-
878
- .fc-toolbar .fc-state-down {
879
- z-index: 3;
880
- }
881
-
882
- .fc-toolbar .fc-state-active,
883
- .fc-toolbar .ui-state-active {
884
- z-index: 4;
885
- }
886
-
887
- .fc-toolbar button:focus {
888
- z-index: 5;
889
- }
890
-
891
-
892
- /* View Structure
893
- --------------------------------------------------------------------------------------------------*/
894
-
895
- /* undo twitter bootstrap's box-sizing rules. normalizes positioning techniques */
896
- /* don't do this for the toolbar because we'll want bootstrap to style those buttons as some pt */
897
- .fc-view-container *,
898
- .fc-view-container *:before,
899
- .fc-view-container *:after {
900
- -webkit-box-sizing: content-box;
901
- -moz-box-sizing: content-box;
902
- box-sizing: content-box;
903
- }
904
-
905
- .fc-view, /* scope positioning and z-index's for everything within the view */
906
- .fc-view > table { /* so dragged elements can be above the view's main element */
907
- position: relative;
908
- z-index: 1;
909
- }
910
-
911
-
912
-
913
- /* BasicView
914
- --------------------------------------------------------------------------------------------------*/
915
-
916
- /* day row structure */
917
-
918
- .fc-basicWeek-view .fc-content-skeleton,
919
- .fc-basicDay-view .fc-content-skeleton {
920
- /* there may be week numbers in these views, so no padding-top */
921
- padding-bottom: 1em; /* ensure a space at bottom of cell for user selecting/clicking */
922
- }
923
-
924
- .fc-basic-view .fc-body .fc-row {
925
- min-height: 4em; /* ensure that all rows are at least this tall */
926
- }
927
-
928
- /* a "rigid" row will take up a constant amount of height because content-skeleton is absolute */
929
-
930
- .fc-row.fc-rigid {
931
- overflow: hidden;
932
- }
933
-
934
- .fc-row.fc-rigid .fc-content-skeleton {
935
- position: absolute;
936
- top: 0;
937
- left: 0;
938
- right: 0;
939
- }
940
-
941
- /* week and day number styling */
942
-
943
- .fc-day-top.fc-other-month {
944
- opacity: 0.3;
945
- }
946
-
947
- .fc-basic-view .fc-week-number,
948
- .fc-basic-view .fc-day-number {
949
- padding: 2px;
950
- }
951
-
952
- .fc-basic-view th.fc-week-number,
953
- .fc-basic-view th.fc-day-number {
954
- padding: 0 2px; /* column headers can't have as much v space */
955
- }
956
-
957
- .fc-ltr .fc-basic-view .fc-day-top .fc-day-number { float: right; }
958
- .fc-rtl .fc-basic-view .fc-day-top .fc-day-number { float: left; }
959
-
960
- .fc-ltr .fc-basic-view .fc-day-top .fc-week-number { float: left; border-radius: 0 0 3px 0; }
961
- .fc-rtl .fc-basic-view .fc-day-top .fc-week-number { float: right; border-radius: 0 0 0 3px; }
962
-
963
- .fc-basic-view .fc-day-top .fc-week-number {
964
- min-width: 1.5em;
965
- text-align: center;
966
- background-color: #f2f2f2;
967
- color: #808080;
968
- }
969
-
970
- /* when week/day number have own column */
971
-
972
- .fc-basic-view td.fc-week-number {
973
- text-align: center;
974
- }
975
-
976
- .fc-basic-view td.fc-week-number > * {
977
- /* work around the way we do column resizing and ensure a minimum width */
978
- display: inline-block;
979
- min-width: 1.25em;
980
- }
981
-
982
-
983
- /* AgendaView all-day area
984
- --------------------------------------------------------------------------------------------------*/
985
-
986
- .fc-agenda-view .fc-day-grid {
987
- position: relative;
988
- z-index: 2; /* so the "more.." popover will be over the time grid */
989
- }
990
-
991
- .fc-agenda-view .fc-day-grid .fc-row {
992
- min-height: 3em; /* all-day section will never get shorter than this */
993
- }
994
-
995
- .fc-agenda-view .fc-day-grid .fc-row .fc-content-skeleton {
996
- padding-bottom: 1em; /* give space underneath events for clicking/selecting days */
997
- }
998
-
999
-
1000
- /* TimeGrid axis running down the side (for both the all-day area and the slot area)
1001
- --------------------------------------------------------------------------------------------------*/
1002
-
1003
- .fc .fc-axis { /* .fc to overcome default cell styles */
1004
- vertical-align: middle;
1005
- padding: 0 4px;
1006
- white-space: nowrap;
1007
- }
1008
-
1009
- .fc-ltr .fc-axis {
1010
- text-align: right;
1011
- }
1012
-
1013
- .fc-rtl .fc-axis {
1014
- text-align: left;
1015
- }
1016
-
1017
- .ui-widget td.fc-axis {
1018
- font-weight: normal; /* overcome jqui theme making it bold */
1019
- }
1020
-
1021
-
1022
- /* TimeGrid Structure
1023
- --------------------------------------------------------------------------------------------------*/
1024
-
1025
- .fc-time-grid-container, /* so scroll container's z-index is below all-day */
1026
- .fc-time-grid { /* so slats/bg/content/etc positions get scoped within here */
1027
- position: relative;
1028
- z-index: 1;
1029
- }
1030
-
1031
- .fc-time-grid {
1032
- min-height: 100%; /* so if height setting is 'auto', .fc-bg stretches to fill height */
1033
- }
1034
-
1035
- .fc-time-grid table { /* don't put outer borders on slats/bg/content/etc */
1036
- border: 0 hidden transparent;
1037
- }
1038
-
1039
- .fc-time-grid > .fc-bg {
1040
- z-index: 1;
1041
- }
1042
-
1043
- .fc-time-grid .fc-slats,
1044
- .fc-time-grid > hr { /* the <hr> AgendaView injects when grid is shorter than scroller */
1045
- position: relative;
1046
- z-index: 2;
1047
- }
1048
-
1049
- .fc-time-grid .fc-content-col {
1050
- position: relative; /* because now-indicator lives directly inside */
1051
- }
1052
-
1053
- .fc-time-grid .fc-content-skeleton {
1054
- position: absolute;
1055
- z-index: 3;
1056
- top: 0;
1057
- left: 0;
1058
- right: 0;
1059
- }
1060
-
1061
- /* divs within a cell within the fc-content-skeleton */
1062
-
1063
- .fc-time-grid .fc-business-container {
1064
- position: relative;
1065
- z-index: 1;
1066
- }
1067
-
1068
- .fc-time-grid .fc-bgevent-container {
1069
- position: relative;
1070
- z-index: 2;
1071
- }
1072
-
1073
- .fc-time-grid .fc-highlight-container {
1074
- position: relative;
1075
- z-index: 3;
1076
- }
1077
-
1078
- .fc-time-grid .fc-event-container {
1079
- position: relative;
1080
- z-index: 4;
1081
- }
1082
-
1083
- .fc-time-grid .fc-now-indicator-line {
1084
- z-index: 5;
1085
- }
1086
-
1087
- .fc-time-grid .fc-helper-container { /* also is fc-event-container */
1088
- position: relative;
1089
- z-index: 6;
1090
- }
1091
-
1092
-
1093
- /* TimeGrid Slats (lines that run horizontally)
1094
- --------------------------------------------------------------------------------------------------*/
1095
-
1096
- .fc-time-grid .fc-slats td {
1097
- height: 1.5em;
1098
- border-bottom: 0; /* each cell is responsible for its top border */
1099
- }
1100
-
1101
- .fc-time-grid .fc-slats .fc-minor td {
1102
- border-top-style: dotted;
1103
- }
1104
-
1105
- .fc-time-grid .fc-slats .ui-widget-content { /* for jqui theme */
1106
- background: none; /* see through to fc-bg */
1107
- }
1108
-
1109
-
1110
- /* TimeGrid Highlighting Slots
1111
- --------------------------------------------------------------------------------------------------*/
1112
-
1113
- .fc-time-grid .fc-highlight-container { /* a div within a cell within the fc-highlight-skeleton */
1114
- position: relative; /* scopes the left/right of the fc-highlight to be in the column */
1115
- }
1116
-
1117
- .fc-time-grid .fc-highlight {
1118
- position: absolute;
1119
- left: 0;
1120
- right: 0;
1121
- /* top and bottom will be in by JS */
1122
- }
1123
-
1124
-
1125
- /* TimeGrid Event Containment
1126
- --------------------------------------------------------------------------------------------------*/
1127
-
1128
- .fc-ltr .fc-time-grid .fc-event-container { /* space on the sides of events for LTR (default) */
1129
- margin: 0 2.5% 0 2px;
1130
- }
1131
-
1132
- .fc-rtl .fc-time-grid .fc-event-container { /* space on the sides of events for RTL */
1133
- margin: 0 2px 0 2.5%;
1134
- }
1135
-
1136
- .fc-time-grid .fc-event,
1137
- .fc-time-grid .fc-bgevent {
1138
- position: absolute;
1139
- z-index: 1; /* scope inner z-index's */
1140
- }
1141
-
1142
- .fc-time-grid .fc-bgevent {
1143
- /* background events always span full width */
1144
- left: 0;
1145
- right: 0;
1146
- }
1147
-
1148
-
1149
- /* Generic Vertical Event
1150
- --------------------------------------------------------------------------------------------------*/
1151
-
1152
- .fc-v-event.fc-not-start { /* events that are continuing from another day */
1153
- /* replace space made by the top border with padding */
1154
- border-top-width: 0;
1155
- padding-top: 1px;
1156
-
1157
- /* remove top rounded corners */
1158
- border-top-left-radius: 0;
1159
- border-top-right-radius: 0;
1160
- }
1161
-
1162
- .fc-v-event.fc-not-end {
1163
- /* replace space made by the top border with padding */
1164
- border-bottom-width: 0;
1165
- padding-bottom: 1px;
1166
-
1167
- /* remove bottom rounded corners */
1168
- border-bottom-left-radius: 0;
1169
- border-bottom-right-radius: 0;
1170
- }
1171
-
1172
-
1173
- /* TimeGrid Event Styling
1174
- ----------------------------------------------------------------------------------------------------
1175
- We use the full "fc-time-grid-event" class instead of using descendants because the event won't
1176
- be a descendant of the grid when it is being dragged.
1177
- */
1178
-
1179
- .fc-time-grid-event {
1180
- overflow: hidden; /* don't let the bg flow over rounded corners */
1181
- }
1182
-
1183
- .fc-time-grid-event.fc-selected {
1184
- /* need to allow touch resizers to extend outside event's bounding box */
1185
- /* common fc-selected styles hide the fc-bg, so don't need this anyway */
1186
- overflow: visible;
1187
- }
1188
-
1189
- .fc-time-grid-event.fc-selected .fc-bg {
1190
- display: none; /* hide semi-white background, to appear darker */
1191
- }
1192
-
1193
- .fc-time-grid-event .fc-content {
1194
- overflow: hidden; /* for when .fc-selected */
1195
- }
1196
-
1197
- .fc-time-grid-event .fc-time,
1198
- .fc-time-grid-event .fc-title {
1199
- padding: 0 1px;
1200
- }
1201
-
1202
- .fc-time-grid-event .fc-time {
1203
- font-size: .85em;
1204
- white-space: nowrap;
1205
- }
1206
-
1207
- /* short mode, where time and title are on the same line */
1208
-
1209
- .fc-time-grid-event.fc-short .fc-content {
1210
- /* don't wrap to second line (now that contents will be inline) */
1211
- white-space: nowrap;
1212
- }
1213
-
1214
- .fc-time-grid-event.fc-short .fc-time,
1215
- .fc-time-grid-event.fc-short .fc-title {
1216
- /* put the time and title on the same line */
1217
- display: inline-block;
1218
- vertical-align: top;
1219
- }
1220
-
1221
- .fc-time-grid-event.fc-short .fc-time span {
1222
- display: none; /* don't display the full time text... */
1223
- }
1224
-
1225
- .fc-time-grid-event.fc-short .fc-time:before {
1226
- content: attr(data-start); /* ...instead, display only the start time */
1227
- }
1228
-
1229
- .fc-time-grid-event.fc-short .fc-time:after {
1230
- content: "\000A0-\000A0"; /* seperate with a dash, wrapped in nbsp's */
1231
- }
1232
-
1233
- .fc-time-grid-event.fc-short .fc-title {
1234
- font-size: .85em; /* make the title text the same size as the time */
1235
- padding: 0; /* undo padding from above */
1236
- }
1237
-
1238
- /* resizer (cursor device) */
1239
-
1240
- .fc-time-grid-event.fc-allow-mouse-resize .fc-resizer {
1241
- left: 0;
1242
- right: 0;
1243
- bottom: 0;
1244
- height: 8px;
1245
- overflow: hidden;
1246
- line-height: 8px;
1247
- font-size: 11px;
1248
- font-family: monospace;
1249
- text-align: center;
1250
- cursor: s-resize;
1251
- }
1252
-
1253
- .fc-time-grid-event.fc-allow-mouse-resize .fc-resizer:after {
1254
- content: "=";
1255
- }
1256
-
1257
- /* resizer (touch device) */
1258
-
1259
- .fc-time-grid-event.fc-selected .fc-resizer {
1260
- /* 10x10 dot */
1261
- border-radius: 5px;
1262
- border-width: 1px;
1263
- width: 8px;
1264
- height: 8px;
1265
- border-style: solid;
1266
- border-color: inherit;
1267
- background: #fff;
1268
- /* horizontally center */
1269
- left: 50%;
1270
- margin-left: -5px;
1271
- /* center on the bottom edge */
1272
- bottom: -5px;
1273
- }
1274
-
1275
-
1276
- /* Now Indicator
1277
- --------------------------------------------------------------------------------------------------*/
1278
-
1279
- .fc-time-grid .fc-now-indicator-line {
1280
- border-top-width: 1px;
1281
- left: 0;
1282
- right: 0;
1283
- }
1284
-
1285
- /* arrow on axis */
1286
-
1287
- .fc-time-grid .fc-now-indicator-arrow {
1288
- margin-top: -5px; /* vertically center on top coordinate */
1289
- }
1290
-
1291
- .fc-ltr .fc-time-grid .fc-now-indicator-arrow {
1292
- left: 0;
1293
- /* triangle pointing right... */
1294
- border-width: 5px 0 5px 6px;
1295
- border-top-color: transparent;
1296
- border-bottom-color: transparent;
1297
- }
1298
-
1299
- .fc-rtl .fc-time-grid .fc-now-indicator-arrow {
1300
- right: 0;
1301
- /* triangle pointing left... */
1302
- border-width: 5px 6px 5px 0;
1303
- border-top-color: transparent;
1304
- border-bottom-color: transparent;
1305
- }
1306
-
1307
-
1308
-
1309
- /* List View
1310
- --------------------------------------------------------------------------------------------------*/
1311
-
1312
- /* possibly reusable */
1313
-
1314
- .fc-event-dot {
1315
- display: inline-block;
1316
- width: 10px;
1317
- height: 10px;
1318
- border-radius: 5px;
1319
- }
1320
-
1321
- /* view wrapper */
1322
-
1323
- .fc-rtl .fc-list-view {
1324
- direction: rtl; /* unlike core views, leverage browser RTL */
1325
- }
1326
-
1327
- .fc-list-view {
1328
- border-width: 1px;
1329
- border-style: solid;
1330
- }
1331
-
1332
- /* table resets */
1333
-
1334
- .fc .fc-list-table {
1335
- table-layout: auto; /* for shrinkwrapping cell content */
1336
- }
1337
-
1338
- .fc-list-table td {
1339
- border-width: 1px 0 0;
1340
- padding: 8px 14px;
1341
- }
1342
-
1343
- .fc-list-table tr:first-child td {
1344
- border-top-width: 0;
1345
- }
1346
-
1347
- /* day headings with the list */
1348
-
1349
- .fc-list-heading {
1350
- border-bottom-width: 1px;
1351
- }
1352
-
1353
- .fc-list-heading td {
1354
- font-weight: bold;
1355
- }
1356
-
1357
- .fc-ltr .fc-list-heading-main { float: left; }
1358
- .fc-ltr .fc-list-heading-alt { float: right; }
1359
-
1360
- .fc-rtl .fc-list-heading-main { float: right; }
1361
- .fc-rtl .fc-list-heading-alt { float: left; }
1362
-
1363
- /* event list items */
1364
-
1365
- .fc-list-item.fc-has-url {
1366
- cursor: pointer; /* whole row will be clickable */
1367
- }
1368
-
1369
- .fc-list-item:hover td {
1370
- background-color: #f5f5f5;
1371
- }
1372
-
1373
- .fc-list-item-marker,
1374
- .fc-list-item-time {
1375
- white-space: nowrap;
1376
- width: 1px;
1377
- }
1378
-
1379
- /* make the dot closer to the event title */
1380
- .fc-ltr .fc-list-item-marker { padding-right: 0; }
1381
- .fc-rtl .fc-list-item-marker { padding-left: 0; }
1382
-
1383
- .fc-list-item-title a {
1384
- /* every event title cell has an <a> tag */
1385
- text-decoration: none;
1386
- color: inherit;
1387
- }
1388
-
1389
- .fc-list-item-title a[href]:hover {
1390
- /* hover effect only on titles with hrefs */
1391
- text-decoration: underline;
1392
- }
1393
-
1394
- /* message when no events */
1395
-
1396
- .fc-list-empty-wrap2 {
1397
- position: absolute;
1398
- top: 0;
1399
- left: 0;
1400
- right: 0;
1401
- bottom: 0;
1402
- }
1403
-
1404
- .fc-list-empty-wrap1 {
1405
- width: 100%;
1406
- height: 100%;
1407
- display: table;
1408
- }
1409
-
1410
- .fc-list-empty {
1411
- display: table-cell;
1412
- vertical-align: middle;
1413
- text-align: center;
1414
- }
1415
-
1416
- .fc-unthemed .fc-list-empty { /* theme will provide own background */
1417
- background-color: #eee;
1418
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/lib/fullcalendar/fullcalendar.js DELETED
@@ -1,15591 +0,0 @@
1
- /*!
2
- * FullCalendar v3.4.0
3
- * Docs & License: https://fullcalendar.io/
4
- * (c) 2017 Adam Shaw
5
- */
6
-
7
- (function(factory) {
8
- if (typeof define === 'function' && define.amd) {
9
- define([ 'jquery', 'moment' ], factory);
10
- }
11
- else if (typeof exports === 'object') { // Node/CommonJS
12
- module.exports = factory(require('jquery'), require('moment'));
13
- }
14
- else {
15
- factory(jQuery, moment);
16
- }
17
- })(function($, moment) {
18
-
19
- ;;
20
-
21
- var FC = $.fullCalendar = {
22
- version: "3.4.0",
23
- // When introducing internal API incompatibilities (where fullcalendar plugins would break),
24
- // the minor version of the calendar should be upped (ex: 2.7.2 -> 2.8.0)
25
- // and the below integer should be incremented.
26
- internalApiVersion: 9
27
- };
28
- var fcViews = FC.views = {};
29
-
30
-
31
- $.fn.fullCalendar = function(options) {
32
- var args = Array.prototype.slice.call(arguments, 1); // for a possible method call
33
- var res = this; // what this function will return (this jQuery object by default)
34
-
35
- this.each(function(i, _element) { // loop each DOM element involved
36
- var element = $(_element);
37
- var calendar = element.data('fullCalendar'); // get the existing calendar object (if any)
38
- var singleRes; // the returned value of this single method call
39
-
40
- // a method call
41
- if (typeof options === 'string') {
42
- if (calendar && $.isFunction(calendar[options])) {
43
- singleRes = calendar[options].apply(calendar, args);
44
- if (!i) {
45
- res = singleRes; // record the first method call result
46
- }
47
- if (options === 'destroy') { // for the destroy method, must remove Calendar object data
48
- element.removeData('fullCalendar');
49
- }
50
- }
51
- }
52
- // a new calendar initialization
53
- else if (!calendar) { // don't initialize twice
54
- calendar = new Calendar(element, options);
55
- element.data('fullCalendar', calendar);
56
- calendar.render();
57
- }
58
- });
59
-
60
- return res;
61
- };
62
-
63
-
64
- var complexOptions = [ // names of options that are objects whose properties should be combined
65
- 'header',
66
- 'footer',
67
- 'buttonText',
68
- 'buttonIcons',
69
- 'themeButtonIcons'
70
- ];
71
-
72
-
73
- // Merges an array of option objects into a single object
74
- function mergeOptions(optionObjs) {
75
- return mergeProps(optionObjs, complexOptions);
76
- }
77
-
78
- ;;
79
-
80
- // exports
81
- FC.intersectRanges = intersectRanges;
82
- FC.applyAll = applyAll;
83
- FC.debounce = debounce;
84
- FC.isInt = isInt;
85
- FC.htmlEscape = htmlEscape;
86
- FC.cssToStr = cssToStr;
87
- FC.proxy = proxy;
88
- FC.capitaliseFirstLetter = capitaliseFirstLetter;
89
-
90
-
91
- /* FullCalendar-specific DOM Utilities
92
- ----------------------------------------------------------------------------------------------------------------------*/
93
-
94
-
95
- // Given the scrollbar widths of some other container, create borders/margins on rowEls in order to match the left
96
- // and right space that was offset by the scrollbars. A 1-pixel border first, then margin beyond that.
97
- function compensateScroll(rowEls, scrollbarWidths) {
98
- if (scrollbarWidths.left) {
99
- rowEls.css({
100
- 'border-left-width': 1,
101
- 'margin-left': scrollbarWidths.left - 1
102
- });
103
- }
104
- if (scrollbarWidths.right) {
105
- rowEls.css({
106
- 'border-right-width': 1,
107
- 'margin-right': scrollbarWidths.right - 1
108
- });
109
- }
110
- }
111
-
112
-
113
- // Undoes compensateScroll and restores all borders/margins
114
- function uncompensateScroll(rowEls) {
115
- rowEls.css({
116
- 'margin-left': '',
117
- 'margin-right': '',
118
- 'border-left-width': '',
119
- 'border-right-width': ''
120
- });
121
- }
122
-
123
-
124
- // Make the mouse cursor express that an event is not allowed in the current area
125
- function disableCursor() {
126
- $('body').addClass('fc-not-allowed');
127
- }
128
-
129
-
130
- // Returns the mouse cursor to its original look
131
- function enableCursor() {
132
- $('body').removeClass('fc-not-allowed');
133
- }
134
-
135
-
136
- // Given a total available height to fill, have `els` (essentially child rows) expand to accomodate.
137
- // By default, all elements that are shorter than the recommended height are expanded uniformly, not considering
138
- // any other els that are already too tall. if `shouldRedistribute` is on, it considers these tall rows and
139
- // reduces the available height.
140
- function distributeHeight(els, availableHeight, shouldRedistribute) {
141
-
142
- // *FLOORING NOTE*: we floor in certain places because zoom can give inaccurate floating-point dimensions,
143
- // and it is better to be shorter than taller, to avoid creating unnecessary scrollbars.
144
-
145
- var minOffset1 = Math.floor(availableHeight / els.length); // for non-last element
146
- var minOffset2 = Math.floor(availableHeight - minOffset1 * (els.length - 1)); // for last element *FLOORING NOTE*
147
- var flexEls = []; // elements that are allowed to expand. array of DOM nodes
148
- var flexOffsets = []; // amount of vertical space it takes up
149
- var flexHeights = []; // actual css height
150
- var usedHeight = 0;
151
-
152
- undistributeHeight(els); // give all elements their natural height
153
-
154
- // find elements that are below the recommended height (expandable).
155
- // important to query for heights in a single first pass (to avoid reflow oscillation).
156
- els.each(function(i, el) {
157
- var minOffset = i === els.length - 1 ? minOffset2 : minOffset1;
158
- var naturalOffset = $(el).outerHeight(true);
159
-
160
- if (naturalOffset < minOffset) {
161
- flexEls.push(el);
162
- flexOffsets.push(naturalOffset);
163
- flexHeights.push($(el).height());
164
- }
165
- else {
166
- // this element stretches past recommended height (non-expandable). mark the space as occupied.
167
- usedHeight += naturalOffset;
168
- }
169
- });
170
-
171
- // readjust the recommended height to only consider the height available to non-maxed-out rows.
172
- if (shouldRedistribute) {
173
- availableHeight -= usedHeight;
174
- minOffset1 = Math.floor(availableHeight / flexEls.length);
175
- minOffset2 = Math.floor(availableHeight - minOffset1 * (flexEls.length - 1)); // *FLOORING NOTE*
176
- }
177
-
178
- // assign heights to all expandable elements
179
- $(flexEls).each(function(i, el) {
180
- var minOffset = i === flexEls.length - 1 ? minOffset2 : minOffset1;
181
- var naturalOffset = flexOffsets[i];
182
- var naturalHeight = flexHeights[i];
183
- var newHeight = minOffset - (naturalOffset - naturalHeight); // subtract the margin/padding
184
-
185
- if (naturalOffset < minOffset) { // we check this again because redistribution might have changed things
186
- $(el).height(newHeight);
187
- }
188
- });
189
- }
190
-
191
-
192
- // Undoes distrubuteHeight, restoring all els to their natural height
193
- function undistributeHeight(els) {
194
- els.height('');
195
- }
196
-
197
-
198
- // Given `els`, a jQuery set of <td> cells, find the cell with the largest natural width and set the widths of all the
199
- // cells to be that width.
200
- // PREREQUISITE: if you want a cell to take up width, it needs to have a single inner element w/ display:inline
201
- function matchCellWidths(els) {
202
- var maxInnerWidth = 0;
203
-
204
- els.find('> *').each(function(i, innerEl) {
205
- var innerWidth = $(innerEl).outerWidth();
206
- if (innerWidth > maxInnerWidth) {
207
- maxInnerWidth = innerWidth;
208
- }
209
- });
210
-
211
- maxInnerWidth++; // sometimes not accurate of width the text needs to stay on one line. insurance
212
-
213
- els.width(maxInnerWidth);
214
-
215
- return maxInnerWidth;
216
- }
217
-
218
-
219
- // Given one element that resides inside another,
220
- // Subtracts the height of the inner element from the outer element.
221
- function subtractInnerElHeight(outerEl, innerEl) {
222
- var both = outerEl.add(innerEl);
223
- var diff;
224
-
225
- // effin' IE8/9/10/11 sometimes returns 0 for dimensions. this weird hack was the only thing that worked
226
- both.css({
227
- position: 'relative', // cause a reflow, which will force fresh dimension recalculation
228
- left: -1 // ensure reflow in case the el was already relative. negative is less likely to cause new scroll
229
- });
230
- diff = outerEl.outerHeight() - innerEl.outerHeight(); // grab the dimensions
231
- both.css({ position: '', left: '' }); // undo hack
232
-
233
- return diff;
234
- }
235
-
236
-
237
- /* Element Geom Utilities
238
- ----------------------------------------------------------------------------------------------------------------------*/
239
-
240
- FC.getOuterRect = getOuterRect;
241
- FC.getClientRect = getClientRect;
242
- FC.getContentRect = getContentRect;
243
- FC.getScrollbarWidths = getScrollbarWidths;
244
-
245
-
246
- // borrowed from https://github.com/jquery/jquery-ui/blob/1.11.0/ui/core.js#L51
247
- function getScrollParent(el) {
248
- var position = el.css('position'),
249
- scrollParent = el.parents().filter(function() {
250
- var parent = $(this);
251
- return (/(auto|scroll)/).test(
252
- parent.css('overflow') + parent.css('overflow-y') + parent.css('overflow-x')
253
- );
254
- }).eq(0);
255
-
256
- return position === 'fixed' || !scrollParent.length ? $(el[0].ownerDocument || document) : scrollParent;
257
- }
258
-
259
-
260
- // Queries the outer bounding area of a jQuery element.
261
- // Returns a rectangle with absolute coordinates: left, right (exclusive), top, bottom (exclusive).
262
- // Origin is optional.
263
- function getOuterRect(el, origin) {
264
- var offset = el.offset();
265
- var left = offset.left - (origin ? origin.left : 0);
266
- var top = offset.top - (origin ? origin.top : 0);
267
-
268
- return {
269
- left: left,
270
- right: left + el.outerWidth(),
271
- top: top,
272
- bottom: top + el.outerHeight()
273
- };
274
- }
275
-
276
-
277
- // Queries the area within the margin/border/scrollbars of a jQuery element. Does not go within the padding.
278
- // Returns a rectangle with absolute coordinates: left, right (exclusive), top, bottom (exclusive).
279
- // Origin is optional.
280
- // WARNING: given element can't have borders
281
- // NOTE: should use clientLeft/clientTop, but very unreliable cross-browser.
282
- function getClientRect(el, origin) {
283
- var offset = el.offset();
284
- var scrollbarWidths = getScrollbarWidths(el);
285
- var left = offset.left + getCssFloat(el, 'border-left-width') + scrollbarWidths.left - (origin ? origin.left : 0);
286
- var top = offset.top + getCssFloat(el, 'border-top-width') + scrollbarWidths.top - (origin ? origin.top : 0);
287
-
288
- return {
289
- left: left,
290
- right: left + el[0].clientWidth, // clientWidth includes padding but NOT scrollbars
291
- top: top,
292
- bottom: top + el[0].clientHeight // clientHeight includes padding but NOT scrollbars
293
- };
294
- }
295
-
296
-
297
- // Queries the area within the margin/border/padding of a jQuery element. Assumed not to have scrollbars.
298
- // Returns a rectangle with absolute coordinates: left, right (exclusive), top, bottom (exclusive).
299
- // Origin is optional.
300
- function getContentRect(el, origin) {
301
- var offset = el.offset(); // just outside of border, margin not included
302
- var left = offset.left + getCssFloat(el, 'border-left-width') + getCssFloat(el, 'padding-left') -
303
- (origin ? origin.left : 0);
304
- var top = offset.top + getCssFloat(el, 'border-top-width') + getCssFloat(el, 'padding-top') -
305
- (origin ? origin.top : 0);
306
-
307
- return {
308
- left: left,
309
- right: left + el.width(),
310
- top: top,
311
- bottom: top + el.height()
312
- };
313
- }
314
-
315
-
316
- // Returns the computed left/right/top/bottom scrollbar widths for the given jQuery element.
317
- // WARNING: given element can't have borders (which will cause offsetWidth/offsetHeight to be larger).
318
- // NOTE: should use clientLeft/clientTop, but very unreliable cross-browser.
319
- function getScrollbarWidths(el) {
320
- var leftRightWidth = el[0].offsetWidth - el[0].clientWidth;
321
- var bottomWidth = el[0].offsetHeight - el[0].clientHeight;
322
- var widths;
323
-
324
- leftRightWidth = sanitizeScrollbarWidth(leftRightWidth);
325
- bottomWidth = sanitizeScrollbarWidth(bottomWidth);
326
-
327
- widths = { left: 0, right: 0, top: 0, bottom: bottomWidth };
328
-
329
- if (getIsLeftRtlScrollbars() && el.css('direction') == 'rtl') { // is the scrollbar on the left side?
330
- widths.left = leftRightWidth;
331
- }
332
- else {
333
- widths.right = leftRightWidth;
334
- }
335
-
336
- return widths;
337
- }
338
-
339
-
340
- // The scrollbar width computations in getScrollbarWidths are sometimes flawed when it comes to
341
- // retina displays, rounding, and IE11. Massage them into a usable value.
342
- function sanitizeScrollbarWidth(width) {
343
- width = Math.max(0, width); // no negatives
344
- width = Math.round(width);
345
- return width;
346
- }
347
-
348
-
349
- // Logic for determining if, when the element is right-to-left, the scrollbar appears on the left side
350
-
351
- var _isLeftRtlScrollbars = null;
352
-
353
- function getIsLeftRtlScrollbars() { // responsible for caching the computation
354
- if (_isLeftRtlScrollbars === null) {
355
- _isLeftRtlScrollbars = computeIsLeftRtlScrollbars();
356
- }
357
- return _isLeftRtlScrollbars;
358
- }
359
-
360
- function computeIsLeftRtlScrollbars() { // creates an offscreen test element, then removes it
361
- var el = $('<div><div/></div>')
362
- .css({
363
- position: 'absolute',
364
- top: -1000,
365
- left: 0,
366
- border: 0,
367
- padding: 0,
368
- overflow: 'scroll',
369
- direction: 'rtl'
370
- })
371
- .appendTo('body');
372
- var innerEl = el.children();
373
- var res = innerEl.offset().left > el.offset().left; // is the inner div shifted to accommodate a left scrollbar?
374
- el.remove();
375
- return res;
376
- }
377
-
378
-
379
- // Retrieves a jQuery element's computed CSS value as a floating-point number.
380
- // If the queried value is non-numeric (ex: IE can return "medium" for border width), will just return zero.
381
- function getCssFloat(el, prop) {
382
- return parseFloat(el.css(prop)) || 0;
383
- }
384
-
385
-
386
- /* Mouse / Touch Utilities
387
- ----------------------------------------------------------------------------------------------------------------------*/
388
-
389
- FC.preventDefault = preventDefault;
390
-
391
-
392
- // Returns a boolean whether this was a left mouse click and no ctrl key (which means right click on Mac)
393
- function isPrimaryMouseButton(ev) {
394
- return ev.which == 1 && !ev.ctrlKey;
395
- }
396
-
397
-
398
- function getEvX(ev) {
399
- var touches = ev.originalEvent.touches;
400
-
401
- // on mobile FF, pageX for touch events is present, but incorrect,
402
- // so, look at touch coordinates first.
403
- if (touches && touches.length) {
404
- return touches[0].pageX;
405
- }
406
-
407
- return ev.pageX;
408
- }
409
-
410
-
411
- function getEvY(ev) {
412
- var touches = ev.originalEvent.touches;
413
-
414
- // on mobile FF, pageX for touch events is present, but incorrect,
415
- // so, look at touch coordinates first.
416
- if (touches && touches.length) {
417
- return touches[0].pageY;
418
- }
419
-
420
- return ev.pageY;
421
- }
422
-
423
-
424
- function getEvIsTouch(ev) {
425
- return /^touch/.test(ev.type);
426
- }
427
-
428
-
429
- function preventSelection(el) {
430
- el.addClass('fc-unselectable')
431
- .on('selectstart', preventDefault);
432
- }
433
-
434
-
435
- function allowSelection(el) {
436
- el.removeClass('fc-unselectable')
437
- .off('selectstart', preventDefault);
438
- }
439
-
440
-
441
- // Stops a mouse/touch event from doing it's native browser action
442
- function preventDefault(ev) {
443
- ev.preventDefault();
444
- }
445
-
446
-
447
- /* General Geometry Utils
448
- ----------------------------------------------------------------------------------------------------------------------*/
449
-
450
- FC.intersectRects = intersectRects;
451
-
452
- // Returns a new rectangle that is the intersection of the two rectangles. If they don't intersect, returns false
453
- function intersectRects(rect1, rect2) {
454
- var res = {
455
- left: Math.max(rect1.left, rect2.left),
456
- right: Math.min(rect1.right, rect2.right),
457
- top: Math.max(rect1.top, rect2.top),
458
- bottom: Math.min(rect1.bottom, rect2.bottom)
459
- };
460
-
461
- if (res.left < res.right && res.top < res.bottom) {
462
- return res;
463
- }
464
- return false;
465
- }
466
-
467
-
468
- // Returns a new point that will have been moved to reside within the given rectangle
469
- function constrainPoint(point, rect) {
470
- return {
471
- left: Math.min(Math.max(point.left, rect.left), rect.right),
472
- top: Math.min(Math.max(point.top, rect.top), rect.bottom)
473
- };
474
- }
475
-
476
-
477
- // Returns a point that is the center of the given rectangle
478
- function getRectCenter(rect) {
479
- return {
480
- left: (rect.left + rect.right) / 2,
481
- top: (rect.top + rect.bottom) / 2
482
- };
483
- }
484
-
485
-
486
- // Subtracts point2's coordinates from point1's coordinates, returning a delta
487
- function diffPoints(point1, point2) {
488
- return {
489
- left: point1.left - point2.left,
490
- top: point1.top - point2.top
491
- };
492
- }
493
-
494
-
495
- /* Object Ordering by Field
496
- ----------------------------------------------------------------------------------------------------------------------*/
497
-
498
- FC.parseFieldSpecs = parseFieldSpecs;
499
- FC.compareByFieldSpecs = compareByFieldSpecs;
500
- FC.compareByFieldSpec = compareByFieldSpec;
501
- FC.flexibleCompare = flexibleCompare;
502
-
503
-
504
- function parseFieldSpecs(input) {
505
- var specs = [];
506
- var tokens = [];
507
- var i, token;
508
-
509
- if (typeof input === 'string') {
510
- tokens = input.split(/\s*,\s*/);
511
- }
512
- else if (typeof input === 'function') {
513
- tokens = [ input ];
514
- }
515
- else if ($.isArray(input)) {
516
- tokens = input;
517
- }
518
-
519
- for (i = 0; i < tokens.length; i++) {
520
- token = tokens[i];
521
-
522
- if (typeof token === 'string') {
523
- specs.push(
524
- token.charAt(0) == '-' ?
525
- { field: token.substring(1), order: -1 } :
526
- { field: token, order: 1 }
527
- );
528
- }
529
- else if (typeof token === 'function') {
530
- specs.push({ func: token });
531
- }
532
- }
533
-
534
- return specs;
535
- }
536
-
537
-
538
- function compareByFieldSpecs(obj1, obj2, fieldSpecs) {
539
- var i;
540
- var cmp;
541
-
542
- for (i = 0; i < fieldSpecs.length; i++) {
543
- cmp = compareByFieldSpec(obj1, obj2, fieldSpecs[i]);
544
- if (cmp) {
545
- return cmp;
546
- }
547
- }
548
-
549
- return 0;
550
- }
551
-
552
-
553
- function compareByFieldSpec(obj1, obj2, fieldSpec) {
554
- if (fieldSpec.func) {
555
- return fieldSpec.func(obj1, obj2);
556
- }
557
- return flexibleCompare(obj1[fieldSpec.field], obj2[fieldSpec.field]) *
558
- (fieldSpec.order || 1);
559
- }
560
-
561
-
562
- function flexibleCompare(a, b) {
563
- if (!a && !b) {
564
- return 0;
565
- }
566
- if (b == null) {
567
- return -1;
568
- }
569
- if (a == null) {
570
- return 1;
571
- }
572
- if ($.type(a) === 'string' || $.type(b) === 'string') {
573
- return String(a).localeCompare(String(b));
574
- }
575
- return a - b;
576
- }
577
-
578
-
579
- /* FullCalendar-specific Misc Utilities
580
- ----------------------------------------------------------------------------------------------------------------------*/
581
-
582
-
583
- // Computes the intersection of the two ranges. Will return fresh date clones in a range.
584
- // Returns undefined if no intersection.
585
- // Expects all dates to be normalized to the same timezone beforehand.
586
- // TODO: move to date section?
587
- function intersectRanges(subjectRange, constraintRange) {
588
- var subjectStart = subjectRange.start;
589
- var subjectEnd = subjectRange.end;
590
- var constraintStart = constraintRange.start;
591
- var constraintEnd = constraintRange.end;
592
- var segStart, segEnd;
593
- var isStart, isEnd;
594
-
595
- if (subjectEnd > constraintStart && subjectStart < constraintEnd) { // in bounds at all?
596
-
597
- if (subjectStart >= constraintStart) {
598
- segStart = subjectStart.clone();
599
- isStart = true;
600
- }
601
- else {
602
- segStart = constraintStart.clone();
603
- isStart = false;
604
- }
605
-
606
- if (subjectEnd <= constraintEnd) {
607
- segEnd = subjectEnd.clone();
608
- isEnd = true;
609
- }
610
- else {
611
- segEnd = constraintEnd.clone();
612
- isEnd = false;
613
- }
614
-
615
- return {
616
- start: segStart,
617
- end: segEnd,
618
- isStart: isStart,
619
- isEnd: isEnd
620
- };
621
- }
622
- }
623
-
624
-
625
- /* Date Utilities
626
- ----------------------------------------------------------------------------------------------------------------------*/
627
-
628
- FC.computeGreatestUnit = computeGreatestUnit;
629
- FC.divideRangeByDuration = divideRangeByDuration;
630
- FC.divideDurationByDuration = divideDurationByDuration;
631
- FC.multiplyDuration = multiplyDuration;
632
- FC.durationHasTime = durationHasTime;
633
-
634
- var dayIDs = [ 'sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat' ];
635
- var unitsDesc = [ 'year', 'month', 'week', 'day', 'hour', 'minute', 'second', 'millisecond' ]; // descending
636
-
637
-
638
- // Diffs the two moments into a Duration where full-days are recorded first, then the remaining time.
639
- // Moments will have their timezones normalized.
640
- function diffDayTime(a, b) {
641
- return moment.duration({
642
- days: a.clone().stripTime().diff(b.clone().stripTime(), 'days'),
643
- ms: a.time() - b.time() // time-of-day from day start. disregards timezone
644
- });
645
- }
646
-
647
-
648
- // Diffs the two moments via their start-of-day (regardless of timezone). Produces whole-day durations.
649
- function diffDay(a, b) {
650
- return moment.duration({
651
- days: a.clone().stripTime().diff(b.clone().stripTime(), 'days')
652
- });
653
- }
654
-
655
-
656
- // Diffs two moments, producing a duration, made of a whole-unit-increment of the given unit. Uses rounding.
657
- function diffByUnit(a, b, unit) {
658
- return moment.duration(
659
- Math.round(a.diff(b, unit, true)), // returnFloat=true
660
- unit
661
- );
662
- }
663
-
664
-
665
- // Computes the unit name of the largest whole-unit period of time.
666
- // For example, 48 hours will be "days" whereas 49 hours will be "hours".
667
- // Accepts start/end, a range object, or an original duration object.
668
- function computeGreatestUnit(start, end) {
669
- var i, unit;
670
- var val;
671
-
672
- for (i = 0; i < unitsDesc.length; i++) {
673
- unit = unitsDesc[i];
674
- val = computeRangeAs(unit, start, end);
675
-
676
- if (val >= 1 && isInt(val)) {
677
- break;
678
- }
679
- }
680
-
681
- return unit; // will be "milliseconds" if nothing else matches
682
- }
683
-
684
-
685
- // like computeGreatestUnit, but has special abilities to interpret the source input for clues
686
- function computeDurationGreatestUnit(duration, durationInput) {
687
- var unit = computeGreatestUnit(duration);
688
-
689
- // prevent days:7 from being interpreted as a week
690
- if (unit === 'week' && typeof durationInput === 'object' && durationInput.days) {
691
- unit = 'day';
692
- }
693
-
694
- return unit;
695
- }
696
-
697
-
698
- // Computes the number of units (like "hours") in the given range.
699
- // Range can be a {start,end} object, separate start/end args, or a Duration.
700
- // Results are based on Moment's .as() and .diff() methods, so results can depend on internal handling
701
- // of month-diffing logic (which tends to vary from version to version).
702
- function computeRangeAs(unit, start, end) {
703
-
704
- if (end != null) { // given start, end
705
- return end.diff(start, unit, true);
706
- }
707
- else if (moment.isDuration(start)) { // given duration
708
- return start.as(unit);
709
- }
710
- else { // given { start, end } range object
711
- return start.end.diff(start.start, unit, true);
712
- }
713
- }
714
-
715
-
716
- // Intelligently divides a range (specified by a start/end params) by a duration
717
- function divideRangeByDuration(start, end, dur) {
718
- var months;
719
-
720
- if (durationHasTime(dur)) {
721
- return (end - start) / dur;
722
- }
723
- months = dur.asMonths();
724
- if (Math.abs(months) >= 1 && isInt(months)) {
725
- return end.diff(start, 'months', true) / months;
726
- }
727
- return end.diff(start, 'days', true) / dur.asDays();
728
- }
729
-
730
-
731
- // Intelligently divides one duration by another
732
- function divideDurationByDuration(dur1, dur2) {
733
- var months1, months2;
734
-
735
- if (durationHasTime(dur1) || durationHasTime(dur2)) {
736
- return dur1 / dur2;
737
- }
738
- months1 = dur1.asMonths();
739
- months2 = dur2.asMonths();
740
- if (
741
- Math.abs(months1) >= 1 && isInt(months1) &&
742
- Math.abs(months2) >= 1 && isInt(months2)
743
- ) {
744
- return months1 / months2;
745
- }
746
- return dur1.asDays() / dur2.asDays();
747
- }
748
-
749
-
750
- // Intelligently multiplies a duration by a number
751
- function multiplyDuration(dur, n) {
752
- var months;
753
-
754
- if (durationHasTime(dur)) {
755
- return moment.duration(dur * n);
756
- }
757
- months = dur.asMonths();
758
- if (Math.abs(months) >= 1 && isInt(months)) {
759
- return moment.duration({ months: months * n });
760
- }
761
- return moment.duration({ days: dur.asDays() * n });
762
- }
763
-
764
-
765
- function cloneRange(range) {
766
- return {
767
- start: range.start.clone(),
768
- end: range.end.clone()
769
- };
770
- }
771
-
772
-
773
- // Trims the beginning and end of inner range to be completely within outerRange.
774
- // Returns a new range object.
775
- function constrainRange(innerRange, outerRange) {
776
- innerRange = cloneRange(innerRange);
777
-
778
- if (outerRange.start) {
779
- // needs to be inclusively before outerRange's end
780
- innerRange.start = constrainDate(innerRange.start, outerRange);
781
- }
782
-
783
- if (outerRange.end) {
784
- innerRange.end = minMoment(innerRange.end, outerRange.end);
785
- }
786
-
787
- return innerRange;
788
- }
789
-
790
-
791
- // If the given date is not within the given range, move it inside.
792
- // (If it's past the end, make it one millisecond before the end).
793
- // Always returns a new moment.
794
- function constrainDate(date, range) {
795
- date = date.clone();
796
-
797
- if (range.start) {
798
- date = maxMoment(date, range.start);
799
- }
800
-
801
- if (range.end && date >= range.end) {
802
- date = range.end.clone().subtract(1);
803
- }
804
-
805
- return date;
806
- }
807
-
808
-
809
- function isDateWithinRange(date, range) {
810
- return (!range.start || date >= range.start) &&
811
- (!range.end || date < range.end);
812
- }
813
-
814
-
815
- // TODO: deal with repeat code in intersectRanges
816
- // constraintRange can have unspecified start/end, an open-ended range.
817
- function doRangesIntersect(subjectRange, constraintRange) {
818
- return (!constraintRange.start || subjectRange.end >= constraintRange.start) &&
819
- (!constraintRange.end || subjectRange.start < constraintRange.end);
820
- }
821
-
822
-
823
- function isRangeWithinRange(innerRange, outerRange) {
824
- return (!outerRange.start || innerRange.start >= outerRange.start) &&
825
- (!outerRange.end || innerRange.end <= outerRange.end);
826
- }
827
-
828
-
829
- function isRangesEqual(range0, range1) {
830
- return ((range0.start && range1.start && range0.start.isSame(range1.start)) || (!range0.start && !range1.start)) &&
831
- ((range0.end && range1.end && range0.end.isSame(range1.end)) || (!range0.end && !range1.end));
832
- }
833
-
834
-
835
- // Returns the moment that's earlier in time. Always a copy.
836
- function minMoment(mom1, mom2) {
837
- return (mom1.isBefore(mom2) ? mom1 : mom2).clone();
838
- }
839
-
840
-
841
- // Returns the moment that's later in time. Always a copy.
842
- function maxMoment(mom1, mom2) {
843
- return (mom1.isAfter(mom2) ? mom1 : mom2).clone();
844
- }
845
-
846
-
847
- // Returns a boolean about whether the given duration has any time parts (hours/minutes/seconds/ms)
848
- function durationHasTime(dur) {
849
- return Boolean(dur.hours() || dur.minutes() || dur.seconds() || dur.milliseconds());
850
- }
851
-
852
-
853
- function isNativeDate(input) {
854
- return Object.prototype.toString.call(input) === '[object Date]' || input instanceof Date;
855
- }
856
-
857
-
858
- // Returns a boolean about whether the given input is a time string, like "06:40:00" or "06:00"
859
- function isTimeString(str) {
860
- return /^\d+\:\d+(?:\:\d+\.?(?:\d{3})?)?$/.test(str);
861
- }
862
-
863
-
864
- /* Logging and Debug
865
- ----------------------------------------------------------------------------------------------------------------------*/
866
-
867
- FC.log = function() {
868
- var console = window.console;
869
-
870
- if (console && console.log) {
871
- return console.log.apply(console, arguments);
872
- }
873
- };
874
-
875
- FC.warn = function() {
876
- var console = window.console;
877
-
878
- if (console && console.warn) {
879
- return console.warn.apply(console, arguments);
880
- }
881
- else {
882
- return FC.log.apply(FC, arguments);
883
- }
884
- };
885
-
886
-
887
- /* General Utilities
888
- ----------------------------------------------------------------------------------------------------------------------*/
889
-
890
- var hasOwnPropMethod = {}.hasOwnProperty;
891
-
892
-
893
- // Merges an array of objects into a single object.
894
- // The second argument allows for an array of property names who's object values will be merged together.
895
- function mergeProps(propObjs, complexProps) {
896
- var dest = {};
897
- var i, name;
898
- var complexObjs;
899
- var j, val;
900
- var props;
901
-
902
- if (complexProps) {
903
- for (i = 0; i < complexProps.length; i++) {
904
- name = complexProps[i];
905
- complexObjs = [];
906
-
907
- // collect the trailing object values, stopping when a non-object is discovered
908
- for (j = propObjs.length - 1; j >= 0; j--) {
909
- val = propObjs[j][name];
910
-
911
- if (typeof val === 'object') {
912
- complexObjs.unshift(val);
913
- }
914
- else if (val !== undefined) {
915
- dest[name] = val; // if there were no objects, this value will be used
916
- break;
917
- }
918
- }
919
-
920
- // if the trailing values were objects, use the merged value
921
- if (complexObjs.length) {
922
- dest[name] = mergeProps(complexObjs);
923
- }
924
- }
925
- }
926
-
927
- // copy values into the destination, going from last to first
928
- for (i = propObjs.length - 1; i >= 0; i--) {
929
- props = propObjs[i];
930
-
931
- for (name in props) {
932
- if (!(name in dest)) { // if already assigned by previous props or complex props, don't reassign
933
- dest[name] = props[name];
934
- }
935
- }
936
- }
937
-
938
- return dest;
939
- }
940
-
941
-
942
- // Create an object that has the given prototype. Just like Object.create
943
- function createObject(proto) {
944
- var f = function() {};
945
- f.prototype = proto;
946
- return new f();
947
- }
948
- FC.createObject = createObject;
949
-
950
-
951
- function copyOwnProps(src, dest) {
952
- for (var name in src) {
953
- if (hasOwnProp(src, name)) {
954
- dest[name] = src[name];
955
- }
956
- }
957
- }
958
-
959
-
960
- function hasOwnProp(obj, name) {
961
- return hasOwnPropMethod.call(obj, name);
962
- }
963
-
964
-
965
- // Is the given value a non-object non-function value?
966
- function isAtomic(val) {
967
- return /undefined|null|boolean|number|string/.test($.type(val));
968
- }
969
-
970
-
971
- function applyAll(functions, thisObj, args) {
972
- if ($.isFunction(functions)) {
973
- functions = [ functions ];
974
- }
975
- if (functions) {
976
- var i;
977
- var ret;
978
- for (i=0; i<functions.length; i++) {
979
- ret = functions[i].apply(thisObj, args) || ret;
980
- }
981
- return ret;
982
- }
983
- }
984
-
985
-
986
- function firstDefined() {
987
- for (var i=0; i<arguments.length; i++) {
988
- if (arguments[i] !== undefined) {
989
- return arguments[i];
990
- }
991
- }
992
- }
993
-
994
-
995
- function htmlEscape(s) {
996
- return (s + '').replace(/&/g, '&amp;')
997
- .replace(/</g, '&lt;')
998
- .replace(/>/g, '&gt;')
999
- .replace(/'/g, '&#039;')
1000
- .replace(/"/g, '&quot;')
1001
- .replace(/\n/g, '<br />');
1002
- }
1003
-
1004
-
1005
- function stripHtmlEntities(text) {
1006
- return text.replace(/&.*?;/g, '');
1007
- }
1008
-
1009
-
1010
- // Given a hash of CSS properties, returns a string of CSS.
1011
- // Uses property names as-is (no camel-case conversion). Will not make statements for null/undefined values.
1012
- function cssToStr(cssProps) {
1013
- var statements = [];
1014
-
1015
- $.each(cssProps, function(name, val) {
1016
- if (val != null) {
1017
- statements.push(name + ':' + val);
1018
- }
1019
- });
1020
-
1021
- return statements.join(';');
1022
- }
1023
-
1024
-
1025
- // Given an object hash of HTML attribute names to values,
1026
- // generates a string that can be injected between < > in HTML
1027
- function attrsToStr(attrs) {
1028
- var parts = [];
1029
-
1030
- $.each(attrs, function(name, val) {
1031
- if (val != null) {
1032
- parts.push(name + '="' + htmlEscape(val) + '"');
1033
- }
1034
- });
1035
-
1036
- return parts.join(' ');
1037
- }
1038
-
1039
-
1040
- function capitaliseFirstLetter(str) {
1041
- return str.charAt(0).toUpperCase() + str.slice(1);
1042
- }
1043
-
1044
-
1045
- function compareNumbers(a, b) { // for .sort()
1046
- return a - b;
1047
- }
1048
-
1049
-
1050
- function isInt(n) {
1051
- return n % 1 === 0;
1052
- }
1053
-
1054
-
1055
- // Returns a method bound to the given object context.
1056
- // Just like one of the jQuery.proxy signatures, but without the undesired behavior of treating the same method with
1057
- // different contexts as identical when binding/unbinding events.
1058
- function proxy(obj, methodName) {
1059
- var method = obj[methodName];
1060
-
1061
- return function() {
1062
- return method.apply(obj, arguments);
1063
- };
1064
- }
1065
-
1066
-
1067
- // Returns a function, that, as long as it continues to be invoked, will not
1068
- // be triggered. The function will be called after it stops being called for
1069
- // N milliseconds. If `immediate` is passed, trigger the function on the
1070
- // leading edge, instead of the trailing.
1071
- // https://github.com/jashkenas/underscore/blob/1.6.0/underscore.js#L714
1072
- function debounce(func, wait, immediate) {
1073
- var timeout, args, context, timestamp, result;
1074
-
1075
- var later = function() {
1076
- var last = +new Date() - timestamp;
1077
- if (last < wait) {
1078
- timeout = setTimeout(later, wait - last);
1079
- }
1080
- else {
1081
- timeout = null;
1082
- if (!immediate) {
1083
- result = func.apply(context, args);
1084
- context = args = null;
1085
- }
1086
- }
1087
- };
1088
-
1089
- return function() {
1090
- context = this;
1091
- args = arguments;
1092
- timestamp = +new Date();
1093
- var callNow = immediate && !timeout;
1094
- if (!timeout) {
1095
- timeout = setTimeout(later, wait);
1096
- }
1097
- if (callNow) {
1098
- result = func.apply(context, args);
1099
- context = args = null;
1100
- }
1101
- return result;
1102
- };
1103
- }
1104
-
1105
- ;;
1106
-
1107
- /*
1108
- GENERAL NOTE on moments throughout the *entire rest* of the codebase:
1109
- All moments are assumed to be ambiguously-zoned unless otherwise noted,
1110
- with the NOTABLE EXCEOPTION of start/end dates that live on *Event Objects*.
1111
- Ambiguously-TIMED moments are assumed to be ambiguously-zoned by nature.
1112
- */
1113
-
1114
- var ambigDateOfMonthRegex = /^\s*\d{4}-\d\d$/;
1115
- var ambigTimeOrZoneRegex =
1116
- /^\s*\d{4}-(?:(\d\d-\d\d)|(W\d\d$)|(W\d\d-\d)|(\d\d\d))((T| )(\d\d(:\d\d(:\d\d(\.\d+)?)?)?)?)?$/;
1117
- var newMomentProto = moment.fn; // where we will attach our new methods
1118
- var oldMomentProto = $.extend({}, newMomentProto); // copy of original moment methods
1119
-
1120
- // tell momentjs to transfer these properties upon clone
1121
- var momentProperties = moment.momentProperties;
1122
- momentProperties.push('_fullCalendar');
1123
- momentProperties.push('_ambigTime');
1124
- momentProperties.push('_ambigZone');
1125
-
1126
-
1127
- // Creating
1128
- // -------------------------------------------------------------------------------------------------
1129
-
1130
- // Creates a new moment, similar to the vanilla moment(...) constructor, but with
1131
- // extra features (ambiguous time, enhanced formatting). When given an existing moment,
1132
- // it will function as a clone (and retain the zone of the moment). Anything else will
1133
- // result in a moment in the local zone.
1134
- FC.moment = function() {
1135
- return makeMoment(arguments);
1136
- };
1137
-
1138
- // Sames as FC.moment, but forces the resulting moment to be in the UTC timezone.
1139
- FC.moment.utc = function() {
1140
- var mom = makeMoment(arguments, true);
1141
-
1142
- // Force it into UTC because makeMoment doesn't guarantee it
1143
- // (if given a pre-existing moment for example)
1144
- if (mom.hasTime()) { // don't give ambiguously-timed moments a UTC zone
1145
- mom.utc();
1146
- }
1147
-
1148
- return mom;
1149
- };
1150
-
1151
- // Same as FC.moment, but when given an ISO8601 string, the timezone offset is preserved.
1152
- // ISO8601 strings with no timezone offset will become ambiguously zoned.
1153
- FC.moment.parseZone = function() {
1154
- return makeMoment(arguments, true, true);
1155
- };
1156
-
1157
- // Builds an enhanced moment from args. When given an existing moment, it clones. When given a
1158
- // native Date, or called with no arguments (the current time), the resulting moment will be local.
1159
- // Anything else needs to be "parsed" (a string or an array), and will be affected by:
1160
- // parseAsUTC - if there is no zone information, should we parse the input in UTC?
1161
- // parseZone - if there is zone information, should we force the zone of the moment?
1162
- function makeMoment(args, parseAsUTC, parseZone) {
1163
- var input = args[0];
1164
- var isSingleString = args.length == 1 && typeof input === 'string';
1165
- var isAmbigTime;
1166
- var isAmbigZone;
1167
- var ambigMatch;
1168
- var mom;
1169
-
1170
- if (moment.isMoment(input) || isNativeDate(input) || input === undefined) {
1171
- mom = moment.apply(null, args);
1172
- }
1173
- else { // "parsing" is required
1174
- isAmbigTime = false;
1175
- isAmbigZone = false;
1176
-
1177
- if (isSingleString) {
1178
- if (ambigDateOfMonthRegex.test(input)) {
1179
- // accept strings like '2014-05', but convert to the first of the month
1180
- input += '-01';
1181
- args = [ input ]; // for when we pass it on to moment's constructor
1182
- isAmbigTime = true;
1183
- isAmbigZone = true;
1184
- }
1185
- else if ((ambigMatch = ambigTimeOrZoneRegex.exec(input))) {
1186
- isAmbigTime = !ambigMatch[5]; // no time part?
1187
- isAmbigZone = true;
1188
- }
1189
- }
1190
- else if ($.isArray(input)) {
1191
- // arrays have no timezone information, so assume ambiguous zone
1192
- isAmbigZone = true;
1193
- }
1194
- // otherwise, probably a string with a format
1195
-
1196
- if (parseAsUTC || isAmbigTime) {
1197
- mom = moment.utc.apply(moment, args);
1198
- }
1199
- else {
1200
- mom = moment.apply(null, args);
1201
- }
1202
-
1203
- if (isAmbigTime) {
1204
- mom._ambigTime = true;
1205
- mom._ambigZone = true; // ambiguous time always means ambiguous zone
1206
- }
1207
- else if (parseZone) { // let's record the inputted zone somehow
1208
- if (isAmbigZone) {
1209
- mom._ambigZone = true;
1210
- }
1211
- else if (isSingleString) {
1212
- mom.utcOffset(input); // if not a valid zone, will assign UTC
1213
- }
1214
- }
1215
- }
1216
-
1217
- mom._fullCalendar = true; // flag for extended functionality
1218
-
1219
- return mom;
1220
- }
1221
-
1222
-
1223
- // Week Number
1224
- // -------------------------------------------------------------------------------------------------
1225
-
1226
-
1227
- // Returns the week number, considering the locale's custom week number calcuation
1228
- // `weeks` is an alias for `week`
1229
- newMomentProto.week = newMomentProto.weeks = function(input) {
1230
- var weekCalc = this._locale._fullCalendar_weekCalc;
1231
-
1232
- if (input == null && typeof weekCalc === 'function') { // custom function only works for getter
1233
- return weekCalc(this);
1234
- }
1235
- else if (weekCalc === 'ISO') {
1236
- return oldMomentProto.isoWeek.apply(this, arguments); // ISO getter/setter
1237
- }
1238
-
1239
- return oldMomentProto.week.apply(this, arguments); // local getter/setter
1240
- };
1241
-
1242
-
1243
- // Time-of-day
1244
- // -------------------------------------------------------------------------------------------------
1245
-
1246
- // GETTER
1247
- // Returns a Duration with the hours/minutes/seconds/ms values of the moment.
1248
- // If the moment has an ambiguous time, a duration of 00:00 will be returned.
1249
- //
1250
- // SETTER
1251
- // You can supply a Duration, a Moment, or a Duration-like argument.
1252
- // When setting the time, and the moment has an ambiguous time, it then becomes unambiguous.
1253
- newMomentProto.time = function(time) {
1254
-
1255
- // Fallback to the original method (if there is one) if this moment wasn't created via FullCalendar.
1256
- // `time` is a generic enough method name where this precaution is necessary to avoid collisions w/ other plugins.
1257
- if (!this._fullCalendar) {
1258
- return oldMomentProto.time.apply(this, arguments);
1259
- }
1260
-
1261
- if (time == null) { // getter
1262
- return moment.duration({
1263
- hours: this.hours(),
1264
- minutes: this.minutes(),
1265
- seconds: this.seconds(),
1266
- milliseconds: this.milliseconds()
1267
- });
1268
- }
1269
- else { // setter
1270
-
1271
- this._ambigTime = false; // mark that the moment now has a time
1272
-
1273
- if (!moment.isDuration(time) && !moment.isMoment(time)) {
1274
- time = moment.duration(time);
1275
- }
1276
-
1277
- // The day value should cause overflow (so 24 hours becomes 00:00:00 of next day).
1278
- // Only for Duration times, not Moment times.
1279
- var dayHours = 0;
1280
- if (moment.isDuration(time)) {
1281
- dayHours = Math.floor(time.asDays()) * 24;
1282
- }
1283
-
1284
- // We need to set the individual fields.
1285
- // Can't use startOf('day') then add duration. In case of DST at start of day.
1286
- return this.hours(dayHours + time.hours())
1287
- .minutes(time.minutes())
1288
- .seconds(time.seconds())
1289
- .milliseconds(time.milliseconds());
1290
- }
1291
- };
1292
-
1293
- // Converts the moment to UTC, stripping out its time-of-day and timezone offset,
1294
- // but preserving its YMD. A moment with a stripped time will display no time
1295
- // nor timezone offset when .format() is called.
1296
- newMomentProto.stripTime = function() {
1297
-
1298
- if (!this._ambigTime) {
1299
-
1300
- this.utc(true); // keepLocalTime=true (for keeping *date* value)
1301
-
1302
- // set time to zero
1303
- this.set({
1304
- hours: 0,
1305
- minutes: 0,
1306
- seconds: 0,
1307
- ms: 0
1308
- });
1309
-
1310
- // Mark the time as ambiguous. This needs to happen after the .utc() call, which might call .utcOffset(),
1311
- // which clears all ambig flags.
1312
- this._ambigTime = true;
1313
- this._ambigZone = true; // if ambiguous time, also ambiguous timezone offset
1314
- }
1315
-
1316
- return this; // for chaining
1317
- };
1318
-
1319
- // Returns if the moment has a non-ambiguous time (boolean)
1320
- newMomentProto.hasTime = function() {
1321
- return !this._ambigTime;
1322
- };
1323
-
1324
-
1325
- // Timezone
1326
- // -------------------------------------------------------------------------------------------------
1327
-
1328
- // Converts the moment to UTC, stripping out its timezone offset, but preserving its
1329
- // YMD and time-of-day. A moment with a stripped timezone offset will display no
1330
- // timezone offset when .format() is called.
1331
- newMomentProto.stripZone = function() {
1332
- var wasAmbigTime;
1333
-
1334
- if (!this._ambigZone) {
1335
-
1336
- wasAmbigTime = this._ambigTime;
1337
-
1338
- this.utc(true); // keepLocalTime=true (for keeping date and time values)
1339
-
1340
- // the above call to .utc()/.utcOffset() unfortunately might clear the ambig flags, so restore
1341
- this._ambigTime = wasAmbigTime || false;
1342
-
1343
- // Mark the zone as ambiguous. This needs to happen after the .utc() call, which might call .utcOffset(),
1344
- // which clears the ambig flags.
1345
- this._ambigZone = true;
1346
- }
1347
-
1348
- return this; // for chaining
1349
- };
1350
-
1351
- // Returns of the moment has a non-ambiguous timezone offset (boolean)
1352
- newMomentProto.hasZone = function() {
1353
- return !this._ambigZone;
1354
- };
1355
-
1356
-
1357
- // implicitly marks a zone
1358
- newMomentProto.local = function(keepLocalTime) {
1359
-
1360
- // for when converting from ambiguously-zoned to local,
1361
- // keep the time values when converting from UTC -> local
1362
- oldMomentProto.local.call(this, this._ambigZone || keepLocalTime);
1363
-
1364
- // ensure non-ambiguous
1365
- // this probably already happened via local() -> utcOffset(), but don't rely on Moment's internals
1366
- this._ambigTime = false;
1367
- this._ambigZone = false;
1368
-
1369
- return this; // for chaining
1370
- };
1371
-
1372
-
1373
- // implicitly marks a zone
1374
- newMomentProto.utc = function(keepLocalTime) {
1375
-
1376
- oldMomentProto.utc.call(this, keepLocalTime);
1377
-
1378
- // ensure non-ambiguous
1379
- // this probably already happened via utc() -> utcOffset(), but don't rely on Moment's internals
1380
- this._ambigTime = false;
1381
- this._ambigZone = false;
1382
-
1383
- return this;
1384
- };
1385
-
1386
-
1387
- // implicitly marks a zone (will probably get called upon .utc() and .local())
1388
- newMomentProto.utcOffset = function(tzo) {
1389
-
1390
- if (tzo != null) { // setter
1391
- // these assignments needs to happen before the original zone method is called.
1392
- // I forget why, something to do with a browser crash.
1393
- this._ambigTime = false;
1394
- this._ambigZone = false;
1395
- }
1396
-
1397
- return oldMomentProto.utcOffset.apply(this, arguments);
1398
- };
1399
-
1400
-
1401
- // Formatting
1402
- // -------------------------------------------------------------------------------------------------
1403
-
1404
- newMomentProto.format = function() {
1405
-
1406
- if (this._fullCalendar && arguments[0]) { // an enhanced moment? and a format string provided?
1407
- return formatDate(this, arguments[0]); // our extended formatting
1408
- }
1409
- if (this._ambigTime) {
1410
- return oldMomentFormat(englishMoment(this), 'YYYY-MM-DD');
1411
- }
1412
- if (this._ambigZone) {
1413
- return oldMomentFormat(englishMoment(this), 'YYYY-MM-DD[T]HH:mm:ss');
1414
- }
1415
- if (this._fullCalendar) { // enhanced non-ambig moment?
1416
- // moment.format() doesn't ensure english, but we want to.
1417
- return oldMomentFormat(englishMoment(this));
1418
- }
1419
-
1420
- return oldMomentProto.format.apply(this, arguments);
1421
- };
1422
-
1423
- newMomentProto.toISOString = function() {
1424
-
1425
- if (this._ambigTime) {
1426
- return oldMomentFormat(englishMoment(this), 'YYYY-MM-DD');
1427
- }
1428
- if (this._ambigZone) {
1429
- return oldMomentFormat(englishMoment(this), 'YYYY-MM-DD[T]HH:mm:ss');
1430
- }
1431
- if (this._fullCalendar) { // enhanced non-ambig moment?
1432
- // depending on browser, moment might not output english. ensure english.
1433
- // https://github.com/moment/moment/blob/2.18.1/src/lib/moment/format.js#L22
1434
- return oldMomentProto.toISOString.apply(englishMoment(this), arguments);
1435
- }
1436
-
1437
- return oldMomentProto.toISOString.apply(this, arguments);
1438
- };
1439
-
1440
- function englishMoment(mom) {
1441
- if (mom.locale() !== 'en') {
1442
- return mom.clone().locale('en');
1443
- }
1444
- return mom;
1445
- }
1446
-
1447
- ;;
1448
- (function() {
1449
-
1450
- // exports
1451
- FC.formatDate = formatDate;
1452
- FC.formatRange = formatRange;
1453
- FC.oldMomentFormat = oldMomentFormat;
1454
- FC.queryMostGranularFormatUnit = queryMostGranularFormatUnit;
1455
-
1456
-
1457
- // Config
1458
- // ---------------------------------------------------------------------------------------------------------------------
1459
-
1460
- /*
1461
- Inserted between chunks in the fake ("intermediate") formatting string.
1462
- Important that it passes as whitespace (\s) because moment often identifies non-standalone months
1463
- via a regexp with an \s.
1464
- */
1465
- var PART_SEPARATOR = '\u000b'; // vertical tab
1466
-
1467
- /*
1468
- Inserted as the first character of a literal-text chunk to indicate that the literal text is not actually literal text,
1469
- but rather, a "special" token that has custom rendering (see specialTokens map).
1470
- */
1471
- var SPECIAL_TOKEN_MARKER = '\u001f'; // information separator 1
1472
-
1473
- /*
1474
- Inserted at the beginning and end of a span of text that must have non-zero numeric characters.
1475
- Handling of these markers is done in a post-processing step at the very end of text rendering.
1476
- */
1477
- var MAYBE_MARKER = '\u001e'; // information separator 2
1478
- var MAYBE_REGEXP = new RegExp(MAYBE_MARKER + '([^' + MAYBE_MARKER + ']*)' + MAYBE_MARKER, 'g'); // must be global
1479
-
1480
- /*
1481
- Addition formatting tokens we want recognized
1482
- */
1483
- var specialTokens = {
1484
- t: function(date) { // "a" or "p"
1485
- return oldMomentFormat(date, 'a').charAt(0);
1486
- },
1487
- T: function(date) { // "A" or "P"
1488
- return oldMomentFormat(date, 'A').charAt(0);
1489
- }
1490
- };
1491
-
1492
- /*
1493
- The first characters of formatting tokens for units that are 1 day or larger.
1494
- `value` is for ranking relative size (lower means bigger).
1495
- `unit` is a normalized unit, used for comparing moments.
1496
- */
1497
- var largeTokenMap = {
1498
- Y: { value: 1, unit: 'year' },
1499
- M: { value: 2, unit: 'month' },
1500
- W: { value: 3, unit: 'week' }, // ISO week
1501
- w: { value: 3, unit: 'week' }, // local week
1502
- D: { value: 4, unit: 'day' }, // day of month
1503
- d: { value: 4, unit: 'day' } // day of week
1504
- };
1505
-
1506
-
1507
- // Single Date Formatting
1508
- // ---------------------------------------------------------------------------------------------------------------------
1509
-
1510
- /*
1511
- Formats `date` with a Moment formatting string, but allow our non-zero areas and special token
1512
- */
1513
- function formatDate(date, formatStr) {
1514
- return renderFakeFormatString(
1515
- getParsedFormatString(formatStr).fakeFormatString,
1516
- date
1517
- );
1518
- }
1519
-
1520
- /*
1521
- Call this if you want Moment's original format method to be used
1522
- */
1523
- function oldMomentFormat(mom, formatStr) {
1524
- return oldMomentProto.format.call(mom, formatStr); // oldMomentProto defined in moment-ext.js
1525
- }
1526
-
1527
-
1528
- // Date Range Formatting
1529
- // -------------------------------------------------------------------------------------------------
1530
- // TODO: make it work with timezone offset
1531
-
1532
- /*
1533
- Using a formatting string meant for a single date, generate a range string, like
1534
- "Sep 2 - 9 2013", that intelligently inserts a separator where the dates differ.
1535
- If the dates are the same as far as the format string is concerned, just return a single
1536
- rendering of one date, without any separator.
1537
- */
1538
- function formatRange(date1, date2, formatStr, separator, isRTL) {
1539
- var localeData;
1540
-
1541
- date1 = FC.moment.parseZone(date1);
1542
- date2 = FC.moment.parseZone(date2);
1543
-
1544
- localeData = date1.localeData();
1545
-
1546
- // Expand localized format strings, like "LL" -> "MMMM D YYYY".
1547
- // BTW, this is not important for `formatDate` because it is impossible to put custom tokens
1548
- // or non-zero areas in Moment's localized format strings.
1549
- formatStr = localeData.longDateFormat(formatStr) || formatStr;
1550
-
1551
- return renderParsedFormat(
1552
- getParsedFormatString(formatStr),
1553
- date1,
1554
- date2,
1555
- separator || ' - ',
1556
- isRTL
1557
- );
1558
- }
1559
-
1560
- /*
1561
- Renders a range with an already-parsed format string.
1562
- */
1563
- function renderParsedFormat(parsedFormat, date1, date2, separator, isRTL) {
1564
- var sameUnits = parsedFormat.sameUnits;
1565
- var unzonedDate1 = date1.clone().stripZone(); // for same-unit comparisons
1566
- var unzonedDate2 = date2.clone().stripZone(); // "
1567
-
1568
- var renderedParts1 = renderFakeFormatStringParts(parsedFormat.fakeFormatString, date1);
1569
- var renderedParts2 = renderFakeFormatStringParts(parsedFormat.fakeFormatString, date2);
1570
-
1571
- var leftI;
1572
- var leftStr = '';
1573
- var rightI;
1574
- var rightStr = '';
1575
- var middleI;
1576
- var middleStr1 = '';
1577
- var middleStr2 = '';
1578
- var middleStr = '';
1579
-
1580
- // Start at the leftmost side of the formatting string and continue until you hit a token
1581
- // that is not the same between dates.
1582
- for (
1583
- leftI = 0;
1584
- leftI < sameUnits.length && (!sameUnits[leftI] || unzonedDate1.isSame(unzonedDate2, sameUnits[leftI]));
1585
- leftI++
1586
- ) {
1587
- leftStr += renderedParts1[leftI];
1588
- }
1589
-
1590
- // Similarly, start at the rightmost side of the formatting string and move left
1591
- for (
1592
- rightI = sameUnits.length - 1;
1593
- rightI > leftI && (!sameUnits[rightI] || unzonedDate1.isSame(unzonedDate2, sameUnits[rightI]));
1594
- rightI--
1595
- ) {
1596
- // If current chunk is on the boundary of unique date-content, and is a special-case
1597
- // date-formatting postfix character, then don't consume it. Consider it unique date-content.
1598
- // TODO: make configurable
1599
- if (rightI - 1 === leftI && renderedParts1[rightI] === '.') {
1600
- break;
1601
- }
1602
-
1603
- rightStr = renderedParts1[rightI] + rightStr;
1604
- }
1605
-
1606
- // The area in the middle is different for both of the dates.
1607
- // Collect them distinctly so we can jam them together later.
1608
- for (middleI = leftI; middleI <= rightI; middleI++) {
1609
- middleStr1 += renderedParts1[middleI];
1610
- middleStr2 += renderedParts2[middleI];
1611
- }
1612
-
1613
- if (middleStr1 || middleStr2) {
1614
- if (isRTL) {
1615
- middleStr = middleStr2 + separator + middleStr1;
1616
- }
1617
- else {
1618
- middleStr = middleStr1 + separator + middleStr2;
1619
- }
1620
- }
1621
-
1622
- return processMaybeMarkers(
1623
- leftStr + middleStr + rightStr
1624
- );
1625
- }
1626
-
1627
-
1628
- // Format String Parsing
1629
- // ---------------------------------------------------------------------------------------------------------------------
1630
-
1631
- var parsedFormatStrCache = {};
1632
-
1633
- /*
1634
- Returns a parsed format string, leveraging a cache.
1635
- */
1636
- function getParsedFormatString(formatStr) {
1637
- return parsedFormatStrCache[formatStr] ||
1638
- (parsedFormatStrCache[formatStr] = parseFormatString(formatStr));
1639
- }
1640
-
1641
- /*
1642
- Parses a format string into the following:
1643
- - fakeFormatString: a momentJS formatting string, littered with special control characters that get post-processed.
1644
- - sameUnits: for every part in fakeFormatString, if the part is a token, the value will be a unit string (like "day"),
1645
- that indicates how similar a range's start & end must be in order to share the same formatted text.
1646
- If not a token, then the value is null.
1647
- Always a flat array (not nested liked "chunks").
1648
- */
1649
- function parseFormatString(formatStr) {
1650
- var chunks = chunkFormatString(formatStr);
1651
-
1652
- return {
1653
- fakeFormatString: buildFakeFormatString(chunks),
1654
- sameUnits: buildSameUnits(chunks)
1655
- };
1656
- }
1657
-
1658
- /*
1659
- Break the formatting string into an array of chunks.
1660
- A 'maybe' chunk will have nested chunks.
1661
- */
1662
- function chunkFormatString(formatStr) {
1663
- var chunks = [];
1664
- var match;
1665
-
1666
- // TODO: more descrimination
1667
- // \4 is a backreference to the first character of a multi-character set.
1668
- var chunker = /\[([^\]]*)\]|\(([^\)]*)\)|(LTS|LT|(\w)\4*o?)|([^\w\[\(]+)/g;
1669
-
1670
- while ((match = chunker.exec(formatStr))) {
1671
- if (match[1]) { // a literal string inside [ ... ]
1672
- chunks.push.apply(chunks, // append
1673
- splitStringLiteral(match[1])
1674
- );
1675
- }
1676
- else if (match[2]) { // non-zero formatting inside ( ... )
1677
- chunks.push({ maybe: chunkFormatString(match[2]) });
1678
- }
1679
- else if (match[3]) { // a formatting token
1680
- chunks.push({ token: match[3] });
1681
- }
1682
- else if (match[5]) { // an unenclosed literal string
1683
- chunks.push.apply(chunks, // append
1684
- splitStringLiteral(match[5])
1685
- );
1686
- }
1687
- }
1688
-
1689
- return chunks;
1690
- }
1691
-
1692
- /*
1693
- Potentially splits a literal-text string into multiple parts. For special cases.
1694
- */
1695
- function splitStringLiteral(s) {
1696
- if (s === '. ') {
1697
- return [ '.', ' ' ]; // for locales with periods bound to the end of each year/month/date
1698
- }
1699
- else {
1700
- return [ s ];
1701
- }
1702
- }
1703
-
1704
- /*
1705
- Given chunks parsed from a real format string, generate a fake (aka "intermediate") format string with special control
1706
- characters that will eventually be given to moment for formatting, and then post-processed.
1707
- */
1708
- function buildFakeFormatString(chunks) {
1709
- var parts = [];
1710
- var i, chunk;
1711
-
1712
- for (i = 0; i < chunks.length; i++) {
1713
- chunk = chunks[i];
1714
-
1715
- if (typeof chunk === 'string') {
1716
- parts.push('[' + chunk + ']');
1717
- }
1718
- else if (chunk.token) {
1719
- if (chunk.token in specialTokens) {
1720
- parts.push(
1721
- SPECIAL_TOKEN_MARKER + // useful during post-processing
1722
- '[' + chunk.token + ']' // preserve as literal text
1723
- );
1724
- }
1725
- else {
1726
- parts.push(chunk.token); // unprotected text implies a format string
1727
- }
1728
- }
1729
- else if (chunk.maybe) {
1730
- parts.push(
1731
- MAYBE_MARKER + // useful during post-processing
1732
- buildFakeFormatString(chunk.maybe) +
1733
- MAYBE_MARKER
1734
- );
1735
- }
1736
- }
1737
-
1738
- return parts.join(PART_SEPARATOR);
1739
- }
1740
-
1741
- /*
1742
- Given parsed chunks from a real formatting string, generates an array of unit strings (like "day") that indicate
1743
- in which regard two dates must be similar in order to share range formatting text.
1744
- The `chunks` can be nested (because of "maybe" chunks), however, the returned array will be flat.
1745
- */
1746
- function buildSameUnits(chunks) {
1747
- var units = [];
1748
- var i, chunk;
1749
- var tokenInfo;
1750
-
1751
- for (i = 0; i < chunks.length; i++) {
1752
- chunk = chunks[i];
1753
-
1754
- if (chunk.token) {
1755
- tokenInfo = largeTokenMap[chunk.token.charAt(0)];
1756
- units.push(tokenInfo ? tokenInfo.unit : 'second'); // default to a very strict same-second
1757
- }
1758
- else if (chunk.maybe) {
1759
- units.push.apply(units, // append
1760
- buildSameUnits(chunk.maybe)
1761
- );
1762
- }
1763
- else {
1764
- units.push(null);
1765
- }
1766
- }
1767
-
1768
- return units;
1769
- }
1770
-
1771
-
1772
- // Rendering to text
1773
- // ---------------------------------------------------------------------------------------------------------------------
1774
-
1775
- /*
1776
- Formats a date with a fake format string, post-processes the control characters, then returns.
1777
- */
1778
- function renderFakeFormatString(fakeFormatString, date) {
1779
- return processMaybeMarkers(
1780
- renderFakeFormatStringParts(fakeFormatString, date).join('')
1781
- );
1782
- }
1783
-
1784
- /*
1785
- Formats a date into parts that will have been post-processed, EXCEPT for the "maybe" markers.
1786
- */
1787
- function renderFakeFormatStringParts(fakeFormatString, date) {
1788
- var parts = [];
1789
- var fakeRender = oldMomentFormat(date, fakeFormatString);
1790
- var fakeParts = fakeRender.split(PART_SEPARATOR);
1791
- var i, fakePart;
1792
-
1793
- for (i = 0; i < fakeParts.length; i++) {
1794
- fakePart = fakeParts[i];
1795
-
1796
- if (fakePart.charAt(0) === SPECIAL_TOKEN_MARKER) {
1797
- parts.push(
1798
- // the literal string IS the token's name.
1799
- // call special token's registered function.
1800
- specialTokens[fakePart.substring(1)](date)
1801
- );
1802
- }
1803
- else {
1804
- parts.push(fakePart);
1805
- }
1806
- }
1807
-
1808
- return parts;
1809
- }
1810
-
1811
- /*
1812
- Accepts an almost-finally-formatted string and processes the "maybe" control characters, returning a new string.
1813
- */
1814
- function processMaybeMarkers(s) {
1815
- return s.replace(MAYBE_REGEXP, function(m0, m1) { // regex assumed to have 'g' flag
1816
- if (m1.match(/[1-9]/)) { // any non-zero numeric characters?
1817
- return m1;
1818
- }
1819
- else {
1820
- return '';
1821
- }
1822
- });
1823
- }
1824
-
1825
-
1826
- // Misc Utils
1827
- // -------------------------------------------------------------------------------------------------
1828
-
1829
- /*
1830
- Returns a unit string, either 'year', 'month', 'day', or null for the most granular formatting token in the string.
1831
- */
1832
- function queryMostGranularFormatUnit(formatStr) {
1833
- var chunks = chunkFormatString(formatStr);
1834
- var i, chunk;
1835
- var candidate;
1836
- var best;
1837
-
1838
- for (i = 0; i < chunks.length; i++) {
1839
- chunk = chunks[i];
1840
-
1841
- if (chunk.token) {
1842
- candidate = largeTokenMap[chunk.token.charAt(0)];
1843
- if (candidate) {
1844
- if (!best || candidate.value > best.value) {
1845
- best = candidate;
1846
- }
1847
- }
1848
- }
1849
- }
1850
-
1851
- if (best) {
1852
- return best.unit;
1853
- }
1854
-
1855
- return null;
1856
- };
1857
-
1858
- })();
1859
-
1860
- // quick local references
1861
- var formatDate = FC.formatDate;
1862
- var formatRange = FC.formatRange;
1863
- var oldMomentFormat = FC.oldMomentFormat;
1864
-
1865
- ;;
1866
-
1867
- FC.Class = Class; // export
1868
-
1869
- // Class that all other classes will inherit from
1870
- function Class() { }
1871
-
1872
-
1873
- // Called on a class to create a subclass.
1874
- // Last argument contains instance methods. Any argument before the last are considered mixins.
1875
- Class.extend = function() {
1876
- var len = arguments.length;
1877
- var i;
1878
- var members;
1879
-
1880
- for (i = 0; i < len; i++) {
1881
- members = arguments[i];
1882
- if (i < len - 1) { // not the last argument?
1883
- mixIntoClass(this, members);
1884
- }
1885
- }
1886
-
1887
- return extendClass(this, members || {}); // members will be undefined if no arguments
1888
- };
1889
-
1890
-
1891
- // Adds new member variables/methods to the class's prototype.
1892
- // Can be called with another class, or a plain object hash containing new members.
1893
- Class.mixin = function(members) {
1894
- mixIntoClass(this, members);
1895
- };
1896
-
1897
-
1898
- function extendClass(superClass, members) {
1899
- var subClass;
1900
-
1901
- // ensure a constructor for the subclass, forwarding all arguments to the super-constructor if it doesn't exist
1902
- if (hasOwnProp(members, 'constructor')) {
1903
- subClass = members.constructor;
1904
- }
1905
- if (typeof subClass !== 'function') {
1906
- subClass = members.constructor = function() {
1907
- superClass.apply(this, arguments);
1908
- };
1909
- }
1910
-
1911
- // build the base prototype for the subclass, which is an new object chained to the superclass's prototype
1912
- subClass.prototype = createObject(superClass.prototype);
1913
-
1914
- // copy each member variable/method onto the the subclass's prototype
1915
- copyOwnProps(members, subClass.prototype);
1916
-
1917
- // copy over all class variables/methods to the subclass, such as `extend` and `mixin`
1918
- copyOwnProps(superClass, subClass);
1919
-
1920
- return subClass;
1921
- }
1922
-
1923
-
1924
- function mixIntoClass(theClass, members) {
1925
- copyOwnProps(members, theClass.prototype);
1926
- }
1927
- ;;
1928
-
1929
- var Model = Class.extend(EmitterMixin, ListenerMixin, {
1930
-
1931
- _props: null,
1932
- _watchers: null,
1933
- _globalWatchArgs: null,
1934
-
1935
- constructor: function() {
1936
- this._watchers = {};
1937
- this._props = {};
1938
- this.applyGlobalWatchers();
1939
- },
1940
-
1941
- applyGlobalWatchers: function() {
1942
- var argSets = this._globalWatchArgs || [];
1943
- var i;
1944
-
1945
- for (i = 0; i < argSets.length; i++) {
1946
- this.watch.apply(this, argSets[i]);
1947
- }
1948
- },
1949
-
1950
- has: function(name) {
1951
- return name in this._props;
1952
- },
1953
-
1954
- get: function(name) {
1955
- if (name === undefined) {
1956
- return this._props;
1957
- }
1958
-
1959
- return this._props[name];
1960
- },
1961
-
1962
- set: function(name, val) {
1963
- var newProps;
1964
-
1965
- if (typeof name === 'string') {
1966
- newProps = {};
1967
- newProps[name] = val === undefined ? null : val;
1968
- }
1969
- else {
1970
- newProps = name;
1971
- }
1972
-
1973
- this.setProps(newProps);
1974
- },
1975
-
1976
- reset: function(newProps) {
1977
- var oldProps = this._props;
1978
- var changeset = {}; // will have undefined's to signal unsets
1979
- var name;
1980
-
1981
- for (name in oldProps) {
1982
- changeset[name] = undefined;
1983
- }
1984
-
1985
- for (name in newProps) {
1986
- changeset[name] = newProps[name];
1987
- }
1988
-
1989
- this.setProps(changeset);
1990
- },
1991
-
1992
- unset: function(name) { // accepts a string or array of strings
1993
- var newProps = {};
1994
- var names;
1995
- var i;
1996
-
1997
- if (typeof name === 'string') {
1998
- names = [ name ];
1999
- }
2000
- else {
2001
- names = name;
2002
- }
2003
-
2004
- for (i = 0; i < names.length; i++) {
2005
- newProps[names[i]] = undefined;
2006
- }
2007
-
2008
- this.setProps(newProps);
2009
- },
2010
-
2011
- setProps: function(newProps) {
2012
- var changedProps = {};
2013
- var changedCnt = 0;
2014
- var name, val;
2015
-
2016
- for (name in newProps) {
2017
- val = newProps[name];
2018
-
2019
- // a change in value?
2020
- // if an object, don't check equality, because might have been mutated internally.
2021
- // TODO: eventually enforce immutability.
2022
- if (
2023
- typeof val === 'object' ||
2024
- val !== this._props[name]
2025
- ) {
2026
- changedProps[name] = val;
2027
- changedCnt++;
2028
- }
2029
- }
2030
-
2031
- if (changedCnt) {
2032
-
2033
- this.trigger('before:batchChange', changedProps);
2034
-
2035
- for (name in changedProps) {
2036
- val = changedProps[name];
2037
-
2038
- this.trigger('before:change', name, val);
2039
- this.trigger('before:change:' + name, val);
2040
- }
2041
-
2042
- for (name in changedProps) {
2043
- val = changedProps[name];
2044
-
2045
- if (val === undefined) {
2046
- delete this._props[name];
2047
- }
2048
- else {
2049
- this._props[name] = val;
2050
- }
2051
-
2052
- this.trigger('change:' + name, val);
2053
- this.trigger('change', name, val);
2054
- }
2055
-
2056
- this.trigger('batchChange', changedProps);
2057
- }
2058
- },
2059
-
2060
- watch: function(name, depList, startFunc, stopFunc) {
2061
- var _this = this;
2062
-
2063
- this.unwatch(name);
2064
-
2065
- this._watchers[name] = this._watchDeps(depList, function(deps) {
2066
- var res = startFunc.call(_this, deps);
2067
-
2068
- if (res && res.then) {
2069
- _this.unset(name); // put in an unset state while resolving
2070
- res.then(function(val) {
2071
- _this.set(name, val);
2072
- });
2073
- }
2074
- else {
2075
- _this.set(name, res);
2076
- }
2077
- }, function() {
2078
- _this.unset(name);
2079
-
2080
- if (stopFunc) {
2081
- stopFunc.call(_this);
2082
- }
2083
- });
2084
- },
2085
-
2086
- unwatch: function(name) {
2087
- var watcher = this._watchers[name];
2088
-
2089
- if (watcher) {
2090
- delete this._watchers[name];
2091
- watcher.teardown();
2092
- }
2093
- },
2094
-
2095
- _watchDeps: function(depList, startFunc, stopFunc) {
2096
- var _this = this;
2097
- var queuedChangeCnt = 0;
2098
- var depCnt = depList.length;
2099
- var satisfyCnt = 0;
2100
- var values = {}; // what's passed as the `deps` arguments
2101
- var bindTuples = []; // array of [ eventName, handlerFunc ] arrays
2102
- var isCallingStop = false;
2103
-
2104
- function onBeforeDepChange(depName, val, isOptional) {
2105
- queuedChangeCnt++;
2106
- if (queuedChangeCnt === 1) { // first change to cause a "stop" ?
2107
- if (satisfyCnt === depCnt) { // all deps previously satisfied?
2108
- isCallingStop = true;
2109
- stopFunc();
2110
- isCallingStop = false;
2111
- }
2112
- }
2113
- }
2114
-
2115
- function onDepChange(depName, val, isOptional) {
2116
-
2117
- if (val === undefined) { // unsetting a value?
2118
-
2119
- // required dependency that was previously set?
2120
- if (!isOptional && values[depName] !== undefined) {
2121
- satisfyCnt--;
2122
- }
2123
-
2124
- delete values[depName];
2125
- }
2126
- else { // setting a value?
2127
-
2128
- // required dependency that was previously unset?
2129
- if (!isOptional && values[depName] === undefined) {
2130
- satisfyCnt++;
2131
- }
2132
-
2133
- values[depName] = val;
2134
- }
2135
-
2136
- queuedChangeCnt--;
2137
- if (!queuedChangeCnt) { // last change to cause a "start"?
2138
-
2139
- // now finally satisfied or satisfied all along?
2140
- if (satisfyCnt === depCnt) {
2141
-
2142
- // if the stopFunc initiated another value change, ignore it.
2143
- // it will be processed by another change event anyway.
2144
- if (!isCallingStop) {
2145
- startFunc(values);
2146
- }
2147
- }
2148
- }
2149
- }
2150
-
2151
- // intercept for .on() that remembers handlers
2152
- function bind(eventName, handler) {
2153
- _this.on(eventName, handler);
2154
- bindTuples.push([ eventName, handler ]);
2155
- }
2156
-
2157
- // listen to dependency changes
2158
- depList.forEach(function(depName) {
2159
- var isOptional = false;
2160
-
2161
- if (depName.charAt(0) === '?') { // TODO: more DRY
2162
- depName = depName.substring(1);
2163
- isOptional = true;
2164
- }
2165
-
2166
- bind('before:change:' + depName, function(val) {
2167
- onBeforeDepChange(depName, val, isOptional);
2168
- });
2169
-
2170
- bind('change:' + depName, function(val) {
2171
- onDepChange(depName, val, isOptional);
2172
- });
2173
- });
2174
-
2175
- // process current dependency values
2176
- depList.forEach(function(depName) {
2177
- var isOptional = false;
2178
-
2179
- if (depName.charAt(0) === '?') { // TODO: more DRY
2180
- depName = depName.substring(1);
2181
- isOptional = true;
2182
- }
2183
-
2184
- if (_this.has(depName)) {
2185
- values[depName] = _this.get(depName);
2186
- satisfyCnt++;
2187
- }
2188
- else if (isOptional) {
2189
- satisfyCnt++;
2190
- }
2191
- });
2192
-
2193
- // initially satisfied
2194
- if (satisfyCnt === depCnt) {
2195
- startFunc(values);
2196
- }
2197
-
2198
- return {
2199
- teardown: function() {
2200
- // remove all handlers
2201
- for (var i = 0; i < bindTuples.length; i++) {
2202
- _this.off(bindTuples[i][0], bindTuples[i][1]);
2203
- }
2204
- bindTuples = null;
2205
-
2206
- // was satisfied, so call stopFunc
2207
- if (satisfyCnt === depCnt) {
2208
- stopFunc();
2209
- }
2210
- },
2211
- flash: function() {
2212
- if (satisfyCnt === depCnt) {
2213
- stopFunc();
2214
- startFunc(values);
2215
- }
2216
- }
2217
- };
2218
- },
2219
-
2220
- flash: function(name) {
2221
- var watcher = this._watchers[name];
2222
-
2223
- if (watcher) {
2224
- watcher.flash();
2225
- }
2226
- }
2227
-
2228
- });
2229
-
2230
-
2231
- Model.watch = function(/* same arguments as this.watch() */) {
2232
- var proto = this.prototype;
2233
-
2234
- if (!proto._globalWatchArgs) {
2235
- proto._globalWatchArgs = [];
2236
- }
2237
-
2238
- proto._globalWatchArgs.push(arguments);
2239
- };
2240
-
2241
-
2242
- FC.Model = Model;
2243
-
2244
-
2245
- ;;
2246
-
2247
- var Promise = {
2248
-
2249
- construct: function(executor) {
2250
- var deferred = $.Deferred();
2251
- var promise = deferred.promise();
2252
-
2253
- if (typeof executor === 'function') {
2254
- executor(
2255
- function(val) { // resolve
2256
- deferred.resolve(val);
2257
- attachImmediatelyResolvingThen(promise, val);
2258
- },
2259
- function() { // reject
2260
- deferred.reject();
2261
- attachImmediatelyRejectingThen(promise);
2262
- }
2263
- );
2264
- }
2265
-
2266
- return promise;
2267
- },
2268
-
2269
- resolve: function(val) {
2270
- var deferred = $.Deferred().resolve(val);
2271
- var promise = deferred.promise();
2272
-
2273
- attachImmediatelyResolvingThen(promise, val);
2274
-
2275
- return promise;
2276
- },
2277
-
2278
- reject: function() {
2279
- var deferred = $.Deferred().reject();
2280
- var promise = deferred.promise();
2281
-
2282
- attachImmediatelyRejectingThen(promise);
2283
-
2284
- return promise;
2285
- }
2286
-
2287
- };
2288
-
2289
-
2290
- function attachImmediatelyResolvingThen(promise, val) {
2291
- promise.then = function(onResolve) {
2292
- if (typeof onResolve === 'function') {
2293
- onResolve(val);
2294
- }
2295
- return promise; // for chaining
2296
- };
2297
- }
2298
-
2299
-
2300
- function attachImmediatelyRejectingThen(promise) {
2301
- promise.then = function(onResolve, onReject) {
2302
- if (typeof onReject === 'function') {
2303
- onReject();
2304
- }
2305
- return promise; // for chaining
2306
- };
2307
- }
2308
-
2309
-
2310
- FC.Promise = Promise;
2311
-
2312
- ;;
2313
-
2314
- var TaskQueue = Class.extend(EmitterMixin, {
2315
-
2316
- q: null,
2317
- isPaused: false,
2318
- isRunning: false,
2319
-
2320
-
2321
- constructor: function() {
2322
- this.q = [];
2323
- },
2324
-
2325
-
2326
- queue: function(/* taskFunc, taskFunc... */) {
2327
- this.q.push.apply(this.q, arguments); // append
2328
- this.tryStart();
2329
- },
2330
-
2331
-
2332
- pause: function() {
2333
- this.isPaused = true;
2334
- },
2335
-
2336
-
2337
- resume: function() {
2338
- this.isPaused = false;
2339
- this.tryStart();
2340
- },
2341
-
2342
-
2343
- tryStart: function() {
2344
- if (!this.isRunning && this.canRunNext()) {
2345
- this.isRunning = true;
2346
- this.trigger('start');
2347
- this.runNext();
2348
- }
2349
- },
2350
-
2351
-
2352
- canRunNext: function() {
2353
- return !this.isPaused && this.q.length;
2354
- },
2355
-
2356
-
2357
- runNext: function() { // does not check canRunNext
2358
- this.runTask(this.q.shift());
2359
- },
2360
-
2361
-
2362
- runTask: function(task) {
2363
- this.runTaskFunc(task);
2364
- },
2365
-
2366
-
2367
- runTaskFunc: function(taskFunc) {
2368
- var _this = this;
2369
- var res = taskFunc();
2370
-
2371
- if (res && res.then) {
2372
- res.then(done);
2373
- }
2374
- else {
2375
- done();
2376
- }
2377
-
2378
- function done() {
2379
- if (_this.canRunNext()) {
2380
- _this.runNext();
2381
- }
2382
- else {
2383
- _this.isRunning = false;
2384
- _this.trigger('stop');
2385
- }
2386
- }
2387
- }
2388
-
2389
- });
2390
-
2391
- FC.TaskQueue = TaskQueue;
2392
-
2393
- ;;
2394
-
2395
- var RenderQueue = TaskQueue.extend({
2396
-
2397
- waitsByNamespace: null,
2398
- waitNamespace: null,
2399
- waitId: null,
2400
-
2401
-
2402
- constructor: function(waitsByNamespace) {
2403
- TaskQueue.call(this); // super-constructor
2404
-
2405
- this.waitsByNamespace = waitsByNamespace || {};
2406
- },
2407
-
2408
-
2409
- queue: function(taskFunc, namespace, type) {
2410
- var task = {
2411
- func: taskFunc,
2412
- namespace: namespace,
2413
- type: type
2414
- };
2415
- var waitMs;
2416
-
2417
- if (namespace) {
2418
- waitMs = this.waitsByNamespace[namespace];
2419
- }
2420
-
2421
- if (this.waitNamespace) {
2422
- if (namespace === this.waitNamespace && waitMs != null) {
2423
- this.delayWait(waitMs);
2424
- }
2425
- else {
2426
- this.clearWait();
2427
- this.tryStart();
2428
- }
2429
- }
2430
-
2431
- if (this.compoundTask(task)) { // appended to queue?
2432
-
2433
- if (!this.waitNamespace && waitMs != null) {
2434
- this.startWait(namespace, waitMs);
2435
- }
2436
- else {
2437
- this.tryStart();
2438
- }
2439
- }
2440
- },
2441
-
2442
-
2443
- startWait: function(namespace, waitMs) {
2444
- this.waitNamespace = namespace;
2445
- this.spawnWait(waitMs);
2446
- },
2447
-
2448
-
2449
- delayWait: function(waitMs) {
2450
- clearTimeout(this.waitId);
2451
- this.spawnWait(waitMs);
2452
- },
2453
-
2454
-
2455
- spawnWait: function(waitMs) {
2456
- var _this = this;
2457
-
2458
- this.waitId = setTimeout(function() {
2459
- _this.waitNamespace = null;
2460
- _this.tryStart();
2461
- }, waitMs);
2462
- },
2463
-
2464
-
2465
- clearWait: function() {
2466
- if (this.waitNamespace) {
2467
- clearTimeout(this.waitId);
2468
- this.waitId = null;
2469
- this.waitNamespace = null;
2470
- }
2471
- },
2472
-
2473
-
2474
- canRunNext: function() {
2475
- if (!TaskQueue.prototype.canRunNext.apply(this, arguments)) {
2476
- return false;
2477
- }
2478
-
2479
- // waiting for a certain namespace to stop receiving tasks?
2480
- if (this.waitNamespace) {
2481
-
2482
- // if there was a different namespace task in the meantime,
2483
- // that forces all previously-waiting tasks to suddenly execute.
2484
- // TODO: find a way to do this in constant time.
2485
- for (var q = this.q, i = 0; i < q.length; i++) {
2486
- if (q[i].namespace !== this.waitNamespace) {
2487
- return true; // allow execution
2488
- }
2489
- }
2490
-
2491
- return false;
2492
- }
2493
-
2494
- return true;
2495
- },
2496
-
2497
-
2498
- runTask: function(task) {
2499
- this.runTaskFunc(task.func);
2500
- },
2501
-
2502
-
2503
- compoundTask: function(newTask) {
2504
- var q = this.q;
2505
- var shouldAppend = true;
2506
- var i, task;
2507
-
2508
- if (newTask.namespace) {
2509
-
2510
- if (newTask.type === 'destroy' || newTask.type === 'init') {
2511
-
2512
- // remove all add/remove ops with same namespace, regardless of order
2513
- for (i = q.length - 1; i >= 0; i--) {
2514
- task = q[i];
2515
-
2516
- if (
2517
- task.namespace === newTask.namespace &&
2518
- (task.type === 'add' || task.type === 'remove')
2519
- ) {
2520
- q.splice(i, 1); // remove task
2521
- }
2522
- }
2523
-
2524
- if (newTask.type === 'destroy') {
2525
- // eat away final init/destroy operation
2526
- if (q.length) {
2527
- task = q[q.length - 1]; // last task
2528
-
2529
- if (task.namespace === newTask.namespace) {
2530
-
2531
- // the init and our destroy cancel each other out
2532
- if (task.type === 'init') {
2533
- shouldAppend = false;
2534
- q.pop();
2535
- }
2536
- // prefer to use the destroy operation that's already present
2537
- else if (task.type === 'destroy') {
2538
- shouldAppend = false;
2539
- }
2540
- }
2541
- }
2542
- }
2543
- else if (newTask.type === 'init') {
2544
- // eat away final init operation
2545
- if (q.length) {
2546
- task = q[q.length - 1]; // last task
2547
-
2548
- if (
2549
- task.namespace === newTask.namespace &&
2550
- task.type === 'init'
2551
- ) {
2552
- // our init operation takes precedence
2553
- q.pop();
2554
- }
2555
- }
2556
- }
2557
- }
2558
- }
2559
-
2560
- if (shouldAppend) {
2561
- q.push(newTask);
2562
- }
2563
-
2564
- return shouldAppend;
2565
- }
2566
-
2567
- });
2568
-
2569
- FC.RenderQueue = RenderQueue;
2570
-
2571
- ;;
2572
-
2573
- var EmitterMixin = FC.EmitterMixin = {
2574
-
2575
- // jQuery-ification via $(this) allows a non-DOM object to have
2576
- // the same event handling capabilities (including namespaces).
2577
-
2578
-
2579
- on: function(types, handler) {
2580
- $(this).on(types, this._prepareIntercept(handler));
2581
- return this; // for chaining
2582
- },
2583
-
2584
-
2585
- one: function(types, handler) {
2586
- $(this).one(types, this._prepareIntercept(handler));
2587
- return this; // for chaining
2588
- },
2589
-
2590
-
2591
- _prepareIntercept: function(handler) {
2592
- // handlers are always called with an "event" object as their first param.
2593
- // sneak the `this` context and arguments into the extra parameter object
2594
- // and forward them on to the original handler.
2595
- var intercept = function(ev, extra) {
2596
- return handler.apply(
2597
- extra.context || this,
2598
- extra.args || []
2599
- );
2600
- };
2601
-
2602
- // mimick jQuery's internal "proxy" system (risky, I know)
2603
- // causing all functions with the same .guid to appear to be the same.
2604
- // https://github.com/jquery/jquery/blob/2.2.4/src/core.js#L448
2605
- // this is needed for calling .off with the original non-intercept handler.
2606
- if (!handler.guid) {
2607
- handler.guid = $.guid++;
2608
- }
2609
- intercept.guid = handler.guid;
2610
-
2611
- return intercept;
2612
- },
2613
-
2614
-
2615
- off: function(types, handler) {
2616
- $(this).off(types, handler);
2617
-
2618
- return this; // for chaining
2619
- },
2620
-
2621
-
2622
- trigger: function(types) {
2623
- var args = Array.prototype.slice.call(arguments, 1); // arguments after the first
2624
-
2625
- // pass in "extra" info to the intercept
2626
- $(this).triggerHandler(types, { args: args });
2627
-
2628
- return this; // for chaining
2629
- },
2630
-
2631
-
2632
- triggerWith: function(types, context, args) {
2633
-
2634
- // `triggerHandler` is less reliant on the DOM compared to `trigger`.
2635
- // pass in "extra" info to the intercept.
2636
- $(this).triggerHandler(types, { context: context, args: args });
2637
-
2638
- return this; // for chaining
2639
- }
2640
-
2641
- };
2642
-
2643
- ;;
2644
-
2645
- /*
2646
- Utility methods for easily listening to events on another object,
2647
- and more importantly, easily unlistening from them.
2648
- */
2649
- var ListenerMixin = FC.ListenerMixin = (function() {
2650
- var guid = 0;
2651
- var ListenerMixin = {
2652
-
2653
- listenerId: null,
2654
-
2655
- /*
2656
- Given an `other` object that has on/off methods, bind the given `callback` to an event by the given name.
2657
- The `callback` will be called with the `this` context of the object that .listenTo is being called on.
2658
- Can be called:
2659
- .listenTo(other, eventName, callback)
2660
- OR
2661
- .listenTo(other, {
2662
- eventName1: callback1,
2663
- eventName2: callback2
2664
- })
2665
- */
2666
- listenTo: function(other, arg, callback) {
2667
- if (typeof arg === 'object') { // given dictionary of callbacks
2668
- for (var eventName in arg) {
2669
- if (arg.hasOwnProperty(eventName)) {
2670
- this.listenTo(other, eventName, arg[eventName]);
2671
- }
2672
- }
2673
- }
2674
- else if (typeof arg === 'string') {
2675
- other.on(
2676
- arg + '.' + this.getListenerNamespace(), // use event namespacing to identify this object
2677
- $.proxy(callback, this) // always use `this` context
2678
- // the usually-undesired jQuery guid behavior doesn't matter,
2679
- // because we always unbind via namespace
2680
- );
2681
- }
2682
- },
2683
-
2684
- /*
2685
- Causes the current object to stop listening to events on the `other` object.
2686
- `eventName` is optional. If omitted, will stop listening to ALL events on `other`.
2687
- */
2688
- stopListeningTo: function(other, eventName) {
2689
- other.off((eventName || '') + '.' + this.getListenerNamespace());
2690
- },
2691
-
2692
- /*
2693
- Returns a string, unique to this object, to be used for event namespacing
2694
- */
2695
- getListenerNamespace: function() {
2696
- if (this.listenerId == null) {
2697
- this.listenerId = guid++;
2698
- }
2699
- return '_listener' + this.listenerId;
2700
- }
2701
-
2702
- };
2703
- return ListenerMixin;
2704
- })();
2705
- ;;
2706
-
2707
- /* A rectangular panel that is absolutely positioned over other content
2708
- ------------------------------------------------------------------------------------------------------------------------
2709
- Options:
2710
- - className (string)
2711
- - content (HTML string or jQuery element set)
2712
- - parentEl
2713
- - top
2714
- - left
2715
- - right (the x coord of where the right edge should be. not a "CSS" right)
2716
- - autoHide (boolean)
2717
- - show (callback)
2718
- - hide (callback)
2719
- */
2720
-
2721
- var Popover = Class.extend(ListenerMixin, {
2722
-
2723
- isHidden: true,
2724
- options: null,
2725
- el: null, // the container element for the popover. generated by this object
2726
- margin: 10, // the space required between the popover and the edges of the scroll container
2727
-
2728
-
2729
- constructor: function(options) {
2730
- this.options = options || {};
2731
- },
2732
-
2733
-
2734
- // Shows the popover on the specified position. Renders it if not already
2735
- show: function() {
2736
- if (this.isHidden) {
2737
- if (!this.el) {
2738
- this.render();
2739
- }
2740
- this.el.show();
2741
- this.position();
2742
- this.isHidden = false;
2743
- this.trigger('show');
2744
- }
2745
- },
2746
-
2747
-
2748
- // Hides the popover, through CSS, but does not remove it from the DOM
2749
- hide: function() {
2750
- if (!this.isHidden) {
2751
- this.el.hide();
2752
- this.isHidden = true;
2753
- this.trigger('hide');
2754
- }
2755
- },
2756
-
2757
-
2758
- // Creates `this.el` and renders content inside of it
2759
- render: function() {
2760
- var _this = this;
2761
- var options = this.options;
2762
-
2763
- this.el = $('<div class="fc-popover"/>')
2764
- .addClass(options.className || '')
2765
- .css({
2766
- // position initially to the top left to avoid creating scrollbars
2767
- top: 0,
2768
- left: 0
2769
- })
2770
- .append(options.content)
2771
- .appendTo(options.parentEl);
2772
-
2773
- // when a click happens on anything inside with a 'fc-close' className, hide the popover
2774
- this.el.on('click', '.fc-close', function() {
2775
- _this.hide();
2776
- });
2777
-
2778
- if (options.autoHide) {
2779
- this.listenTo($(document), 'mousedown', this.documentMousedown);
2780
- }
2781
- },
2782
-
2783
-
2784
- // Triggered when the user clicks *anywhere* in the document, for the autoHide feature
2785
- documentMousedown: function(ev) {
2786
- // only hide the popover if the click happened outside the popover
2787
- if (this.el && !$(ev.target).closest(this.el).length) {
2788
- this.hide();
2789
- }
2790
- },
2791
-
2792
-
2793
- // Hides and unregisters any handlers
2794
- removeElement: function() {
2795
- this.hide();
2796
-
2797
- if (this.el) {
2798
- this.el.remove();
2799
- this.el = null;
2800
- }
2801
-
2802
- this.stopListeningTo($(document), 'mousedown');
2803
- },
2804
-
2805
-
2806
- // Positions the popover optimally, using the top/left/right options
2807
- position: function() {
2808
- var options = this.options;
2809
- var origin = this.el.offsetParent().offset();
2810
- var width = this.el.outerWidth();
2811
- var height = this.el.outerHeight();
2812
- var windowEl = $(window);
2813
- var viewportEl = getScrollParent(this.el);
2814
- var viewportTop;
2815
- var viewportLeft;
2816
- var viewportOffset;
2817
- var top; // the "position" (not "offset") values for the popover
2818
- var left; //
2819
-
2820
- // compute top and left
2821
- top = options.top || 0;
2822
- if (options.left !== undefined) {
2823
- left = options.left;
2824
- }
2825
- else if (options.right !== undefined) {
2826
- left = options.right - width; // derive the left value from the right value
2827
- }
2828
- else {
2829
- left = 0;
2830
- }
2831
-
2832
- if (viewportEl.is(window) || viewportEl.is(document)) { // normalize getScrollParent's result
2833
- viewportEl = windowEl;
2834
- viewportTop = 0; // the window is always at the top left
2835
- viewportLeft = 0; // (and .offset() won't work if called here)
2836
- }
2837
- else {
2838
- viewportOffset = viewportEl.offset();
2839
- viewportTop = viewportOffset.top;
2840
- viewportLeft = viewportOffset.left;
2841
- }
2842
-
2843
- // if the window is scrolled, it causes the visible area to be further down
2844
- viewportTop += windowEl.scrollTop();
2845
- viewportLeft += windowEl.scrollLeft();
2846
-
2847
- // constrain to the view port. if constrained by two edges, give precedence to top/left
2848
- if (options.viewportConstrain !== false) {
2849
- top = Math.min(top, viewportTop + viewportEl.outerHeight() - height - this.margin);
2850
- top = Math.max(top, viewportTop + this.margin);
2851
- left = Math.min(left, viewportLeft + viewportEl.outerWidth() - width - this.margin);
2852
- left = Math.max(left, viewportLeft + this.margin);
2853
- }
2854
-
2855
- /*this.el.css({
2856
- top: top - origin.top,
2857
- left: left - origin.left
2858
- });*/
2859
- },
2860
-
2861
-
2862
- // Triggers a callback. Calls a function in the option hash of the same name.
2863
- // Arguments beyond the first `name` are forwarded on.
2864
- // TODO: better code reuse for this. Repeat code
2865
- trigger: function(name) {
2866
- if (this.options[name]) {
2867
- this.options[name].apply(this, Array.prototype.slice.call(arguments, 1));
2868
- }
2869
- }
2870
-
2871
- });
2872
-
2873
- ;;
2874
-
2875
- /*
2876
- A cache for the left/right/top/bottom/width/height values for one or more elements.
2877
- Works with both offset (from topleft document) and position (from offsetParent).
2878
-
2879
- options:
2880
- - els
2881
- - isHorizontal
2882
- - isVertical
2883
- */
2884
- var CoordCache = FC.CoordCache = Class.extend({
2885
-
2886
- els: null, // jQuery set (assumed to be siblings)
2887
- forcedOffsetParentEl: null, // options can override the natural offsetParent
2888
- origin: null, // {left,top} position of offsetParent of els
2889
- boundingRect: null, // constrain cordinates to this rectangle. {left,right,top,bottom} or null
2890
- isHorizontal: false, // whether to query for left/right/width
2891
- isVertical: false, // whether to query for top/bottom/height
2892
-
2893
- // arrays of coordinates (offsets from topleft of document)
2894
- lefts: null,
2895
- rights: null,
2896
- tops: null,
2897
- bottoms: null,
2898
-
2899
-
2900
- constructor: function(options) {
2901
- this.els = $(options.els);
2902
- this.isHorizontal = options.isHorizontal;
2903
- this.isVertical = options.isVertical;
2904
- this.forcedOffsetParentEl = options.offsetParent ? $(options.offsetParent) : null;
2905
- },
2906
-
2907
-
2908
- // Queries the els for coordinates and stores them.
2909
- // Call this method before using and of the get* methods below.
2910
- build: function() {
2911
- var offsetParentEl = this.forcedOffsetParentEl;
2912
- if (!offsetParentEl && this.els.length > 0) {
2913
- offsetParentEl = this.els.eq(0).offsetParent();
2914
- }
2915
-
2916
- this.origin = offsetParentEl ?
2917
- offsetParentEl.offset() :
2918
- null;
2919
-
2920
- this.boundingRect = this.queryBoundingRect();
2921
-
2922
- if (this.isHorizontal) {
2923
- this.buildElHorizontals();
2924
- }
2925
- if (this.isVertical) {
2926
- this.buildElVerticals();
2927
- }
2928
- },
2929
-
2930
-
2931
- // Destroys all internal data about coordinates, freeing memory
2932
- clear: function() {
2933
- this.origin = null;
2934
- this.boundingRect = null;
2935
- this.lefts = null;
2936
- this.rights = null;
2937
- this.tops = null;
2938
- this.bottoms = null;
2939
- },
2940
-
2941
-
2942
- // When called, if coord caches aren't built, builds them
2943
- ensureBuilt: function() {
2944
- if (!this.origin) {
2945
- this.build();
2946
- }
2947
- },
2948
-
2949
-
2950
- // Populates the left/right internal coordinate arrays
2951
- buildElHorizontals: function() {
2952
- var lefts = [];
2953
- var rights = [];
2954
-
2955
- this.els.each(function(i, node) {
2956
- var el = $(node);
2957
- var left = el.offset().left;
2958
- var width = el.outerWidth();
2959
-
2960
- lefts.push(left);
2961
- rights.push(left + width);
2962
- });
2963
-
2964
- this.lefts = lefts;
2965
- this.rights = rights;
2966
- },
2967
-
2968
-
2969
- // Populates the top/bottom internal coordinate arrays
2970
- buildElVerticals: function() {
2971
- var tops = [];
2972
- var bottoms = [];
2973
-
2974
- this.els.each(function(i, node) {
2975
- var el = $(node);
2976
- var top = el.offset().top;
2977
- var height = el.outerHeight();
2978
-
2979
- tops.push(top);
2980
- bottoms.push(top + height);
2981
- });
2982
-
2983
- this.tops = tops;
2984
- this.bottoms = bottoms;
2985
- },
2986
-
2987
-
2988
- // Given a left offset (from document left), returns the index of the el that it horizontally intersects.
2989
- // If no intersection is made, returns undefined.
2990
- getHorizontalIndex: function(leftOffset) {
2991
- this.ensureBuilt();
2992
-
2993
- var lefts = this.lefts;
2994
- var rights = this.rights;
2995
- var len = lefts.length;
2996
- var i;
2997
-
2998
- for (i = 0; i < len; i++) {
2999
- if (leftOffset >= lefts[i] && leftOffset < rights[i]) {
3000
- return i;
3001
- }
3002
- }
3003
- },
3004
-
3005
-
3006
- // Given a top offset (from document top), returns the index of the el that it vertically intersects.
3007
- // If no intersection is made, returns undefined.
3008
- getVerticalIndex: function(topOffset) {
3009
- this.ensureBuilt();
3010
-
3011
- var tops = this.tops;
3012
- var bottoms = this.bottoms;
3013
- var len = tops.length;
3014
- var i;
3015
-
3016
- for (i = 0; i < len; i++) {
3017
- if (topOffset >= tops[i] && topOffset < bottoms[i]) {
3018
- return i;
3019
- }
3020
- }
3021
- },
3022
-
3023
-
3024
- // Gets the left offset (from document left) of the element at the given index
3025
- getLeftOffset: function(leftIndex) {
3026
- this.ensureBuilt();
3027
- return this.lefts[leftIndex];
3028
- },
3029
-
3030
-
3031
- // Gets the left position (from offsetParent left) of the element at the given index
3032
- getLeftPosition: function(leftIndex) {
3033
- this.ensureBuilt();
3034
- return this.lefts[leftIndex] - this.origin.left;
3035
- },
3036
-
3037
-
3038
- // Gets the right offset (from document left) of the element at the given index.
3039
- // This value is NOT relative to the document's right edge, like the CSS concept of "right" would be.
3040
- getRightOffset: function(leftIndex) {
3041
- this.ensureBuilt();
3042
- return this.rights[leftIndex];
3043
- },
3044
-
3045
-
3046
- // Gets the right position (from offsetParent left) of the element at the given index.
3047
- // This value is NOT relative to the offsetParent's right edge, like the CSS concept of "right" would be.
3048
- getRightPosition: function(leftIndex) {
3049
- this.ensureBuilt();
3050
- return this.rights[leftIndex] - this.origin.left;
3051
- },
3052
-
3053
-
3054
- // Gets the width of the element at the given index
3055
- getWidth: function(leftIndex) {
3056
- this.ensureBuilt();
3057
- return this.rights[leftIndex] - this.lefts[leftIndex];
3058
- },
3059
-
3060
-
3061
- // Gets the top offset (from document top) of the element at the given index
3062
- getTopOffset: function(topIndex) {
3063
- this.ensureBuilt();
3064
- return this.tops[topIndex];
3065
- },
3066
-
3067
-
3068
- // Gets the top position (from offsetParent top) of the element at the given position
3069
- getTopPosition: function(topIndex) {
3070
- this.ensureBuilt();
3071
- return this.tops[topIndex] - this.origin.top;
3072
- },
3073
-
3074
- // Gets the bottom offset (from the document top) of the element at the given index.
3075
- // This value is NOT relative to the offsetParent's bottom edge, like the CSS concept of "bottom" would be.
3076
- getBottomOffset: function(topIndex) {
3077
- this.ensureBuilt();
3078
- return this.bottoms[topIndex];
3079
- },
3080
-
3081
-
3082
- // Gets the bottom position (from the offsetParent top) of the element at the given index.
3083
- // This value is NOT relative to the offsetParent's bottom edge, like the CSS concept of "bottom" would be.
3084
- getBottomPosition: function(topIndex) {
3085
- this.ensureBuilt();
3086
- return this.bottoms[topIndex] - this.origin.top;
3087
- },
3088
-
3089
-
3090
- // Gets the height of the element at the given index
3091
- getHeight: function(topIndex) {
3092
- this.ensureBuilt();
3093
- return this.bottoms[topIndex] - this.tops[topIndex];
3094
- },
3095
-
3096
-
3097
- // Bounding Rect
3098
- // TODO: decouple this from CoordCache
3099
-
3100
- // Compute and return what the elements' bounding rectangle is, from the user's perspective.
3101
- // Right now, only returns a rectangle if constrained by an overflow:scroll element.
3102
- // Returns null if there are no elements
3103
- queryBoundingRect: function() {
3104
- var scrollParentEl;
3105
-
3106
- if (this.els.length > 0) {
3107
- scrollParentEl = getScrollParent(this.els.eq(0));
3108
-
3109
- if (!scrollParentEl.is(document)) {
3110
- return getClientRect(scrollParentEl);
3111
- }
3112
- }
3113
-
3114
- return null;
3115
- },
3116
-
3117
- isPointInBounds: function(leftOffset, topOffset) {
3118
- return this.isLeftInBounds(leftOffset) && this.isTopInBounds(topOffset);
3119
- },
3120
-
3121
- isLeftInBounds: function(leftOffset) {
3122
- return !this.boundingRect || (leftOffset >= this.boundingRect.left && leftOffset < this.boundingRect.right);
3123
- },
3124
-
3125
- isTopInBounds: function(topOffset) {
3126
- return !this.boundingRect || (topOffset >= this.boundingRect.top && topOffset < this.boundingRect.bottom);
3127
- }
3128
-
3129
- });
3130
-
3131
- ;;
3132
-
3133
- /* Tracks a drag's mouse movement, firing various handlers
3134
- ----------------------------------------------------------------------------------------------------------------------*/
3135
- // TODO: use Emitter
3136
-
3137
- var DragListener = FC.DragListener = Class.extend(ListenerMixin, {
3138
-
3139
- options: null,
3140
- subjectEl: null,
3141
-
3142
- // coordinates of the initial mousedown
3143
- originX: null,
3144
- originY: null,
3145
-
3146
- // the wrapping element that scrolls, or MIGHT scroll if there's overflow.
3147
- // TODO: do this for wrappers that have overflow:hidden as well.
3148
- scrollEl: null,
3149
-
3150
- isInteracting: false,
3151
- isDistanceSurpassed: false,
3152
- isDelayEnded: false,
3153
- isDragging: false,
3154
- isTouch: false,
3155
- isGeneric: false, // initiated by 'dragstart' (jqui)
3156
-
3157
- delay: null,
3158
- delayTimeoutId: null,
3159
- minDistance: null,
3160
-
3161
- shouldCancelTouchScroll: true,
3162
- scrollAlwaysKills: false,
3163
-
3164
-
3165
- constructor: function(options) {
3166
- this.options = options || {};
3167
- },
3168
-
3169
-
3170
- // Interaction (high-level)
3171
- // -----------------------------------------------------------------------------------------------------------------
3172
-
3173
-
3174
- startInteraction: function(ev, extraOptions) {
3175
-
3176
- if (ev.type === 'mousedown') {
3177
- if (GlobalEmitter.get().shouldIgnoreMouse()) {
3178
- return;
3179
- }
3180
- else if (!isPrimaryMouseButton(ev)) {
3181
- return;
3182
- }
3183
- else {
3184
- ev.preventDefault(); // prevents native selection in most browsers
3185
- }
3186
- }
3187
-
3188
- if (!this.isInteracting) {
3189
-
3190
- // process options
3191
- extraOptions = extraOptions || {};
3192
- this.delay = firstDefined(extraOptions.delay, this.options.delay, 0);
3193
- this.minDistance = firstDefined(extraOptions.distance, this.options.distance, 0);
3194
- this.subjectEl = this.options.subjectEl;
3195
-
3196
- preventSelection($('body'));
3197
-
3198
- this.isInteracting = true;
3199
- this.isTouch = getEvIsTouch(ev);
3200
- this.isGeneric = ev.type === 'dragstart';
3201
- this.isDelayEnded = false;
3202
- this.isDistanceSurpassed = false;
3203
-
3204
- this.originX = getEvX(ev);
3205
- this.originY = getEvY(ev);
3206
- this.scrollEl = getScrollParent($(ev.target));
3207
-
3208
- this.bindHandlers();
3209
- this.initAutoScroll();
3210
- this.handleInteractionStart(ev);
3211
- this.startDelay(ev);
3212
-
3213
- if (!this.minDistance) {
3214
- this.handleDistanceSurpassed(ev);
3215
- }
3216
- }
3217
- },
3218
-
3219
-
3220
- handleInteractionStart: function(ev) {
3221
- this.trigger('interactionStart', ev);
3222
- },
3223
-
3224
-
3225
- endInteraction: function(ev, isCancelled) {
3226
- if (this.isInteracting) {
3227
- this.endDrag(ev);
3228
-
3229
- if (this.delayTimeoutId) {
3230
- clearTimeout(this.delayTimeoutId);
3231
- this.delayTimeoutId = null;
3232
- }
3233
-
3234
- this.destroyAutoScroll();
3235
- this.unbindHandlers();
3236
-
3237
- this.isInteracting = false;
3238
- this.handleInteractionEnd(ev, isCancelled);
3239
-
3240
- allowSelection($('body'));
3241
- }
3242
- },
3243
-
3244
-
3245
- handleInteractionEnd: function(ev, isCancelled) {
3246
- this.trigger('interactionEnd', ev, isCancelled || false);
3247
- },
3248
-
3249
-
3250
- // Binding To DOM
3251
- // -----------------------------------------------------------------------------------------------------------------
3252
-
3253
-
3254
- bindHandlers: function() {
3255
- // some browsers (Safari in iOS 10) don't allow preventDefault on touch events that are bound after touchstart,
3256
- // so listen to the GlobalEmitter singleton, which is always bound, instead of the document directly.
3257
- var globalEmitter = GlobalEmitter.get();
3258
-
3259
- if (this.isGeneric) {
3260
- this.listenTo($(document), { // might only work on iOS because of GlobalEmitter's bind :(
3261
- drag: this.handleMove,
3262
- dragstop: this.endInteraction
3263
- });
3264
- }
3265
- else if (this.isTouch) {
3266
- this.listenTo(globalEmitter, {
3267
- touchmove: this.handleTouchMove,
3268
- touchend: this.endInteraction,
3269
- scroll: this.handleTouchScroll
3270
- });
3271
- }
3272
- else {
3273
- this.listenTo(globalEmitter, {
3274
- mousemove: this.handleMouseMove,
3275
- mouseup: this.endInteraction
3276
- });
3277
- }
3278
-
3279
- this.listenTo(globalEmitter, {
3280
- selectstart: preventDefault, // don't allow selection while dragging
3281
- contextmenu: preventDefault // long taps would open menu on Chrome dev tools
3282
- });
3283
- },
3284
-
3285
-
3286
- unbindHandlers: function() {
3287
- this.stopListeningTo(GlobalEmitter.get());
3288
- this.stopListeningTo($(document)); // for isGeneric
3289
- },
3290
-
3291
-
3292
- // Drag (high-level)
3293
- // -----------------------------------------------------------------------------------------------------------------
3294
-
3295
-
3296
- // extraOptions ignored if drag already started
3297
- startDrag: function(ev, extraOptions) {
3298
- this.startInteraction(ev, extraOptions); // ensure interaction began
3299
-
3300
- if (!this.isDragging) {
3301
- this.isDragging = true;
3302
- this.handleDragStart(ev);
3303
- }
3304
- },
3305
-
3306
-
3307
- handleDragStart: function(ev) {
3308
- this.trigger('dragStart', ev);
3309
- },
3310
-
3311
-
3312
- handleMove: function(ev) {
3313
- var dx = getEvX(ev) - this.originX;
3314
- var dy = getEvY(ev) - this.originY;
3315
- var minDistance = this.minDistance;
3316
- var distanceSq; // current distance from the origin, squared
3317
-
3318
- if (!this.isDistanceSurpassed) {
3319
- distanceSq = dx * dx + dy * dy;
3320
- if (distanceSq >= minDistance * minDistance) { // use pythagorean theorem
3321
- this.handleDistanceSurpassed(ev);
3322
- }
3323
- }
3324
-
3325
- if (this.isDragging) {
3326
- this.handleDrag(dx, dy, ev);
3327
- }
3328
- },
3329
-
3330
-
3331
- // Called while the mouse is being moved and when we know a legitimate drag is taking place
3332
- handleDrag: function(dx, dy, ev) {
3333
- this.trigger('drag', dx, dy, ev);
3334
- this.updateAutoScroll(ev); // will possibly cause scrolling
3335
- },
3336
-
3337
-
3338
- endDrag: function(ev) {
3339
- if (this.isDragging) {
3340
- this.isDragging = false;
3341
- this.handleDragEnd(ev);
3342
- }
3343
- },
3344
-
3345
-
3346
- handleDragEnd: function(ev) {
3347
- this.trigger('dragEnd', ev);
3348
- },
3349
-
3350
-
3351
- // Delay
3352
- // -----------------------------------------------------------------------------------------------------------------
3353
-
3354
-
3355
- startDelay: function(initialEv) {
3356
- var _this = this;
3357
-
3358
- if (this.delay) {
3359
- this.delayTimeoutId = setTimeout(function() {
3360
- _this.handleDelayEnd(initialEv);
3361
- }, this.delay);
3362
- }
3363
- else {
3364
- this.handleDelayEnd(initialEv);
3365
- }
3366
- },
3367
-
3368
-
3369
- handleDelayEnd: function(initialEv) {
3370
- this.isDelayEnded = true;
3371
-
3372
- if (this.isDistanceSurpassed) {
3373
- this.startDrag(initialEv);
3374
- }
3375
- },
3376
-
3377
-
3378
- // Distance
3379
- // -----------------------------------------------------------------------------------------------------------------
3380
-
3381
-
3382
- handleDistanceSurpassed: function(ev) {
3383
- this.isDistanceSurpassed = true;
3384
-
3385
- if (this.isDelayEnded) {
3386
- this.startDrag(ev);
3387
- }
3388
- },
3389
-
3390
-
3391
- // Mouse / Touch
3392
- // -----------------------------------------------------------------------------------------------------------------
3393
-
3394
-
3395
- handleTouchMove: function(ev) {
3396
-
3397
- // prevent inertia and touchmove-scrolling while dragging
3398
- if (this.isDragging && this.shouldCancelTouchScroll) {
3399
- ev.preventDefault();
3400
- }
3401
-
3402
- this.handleMove(ev);
3403
- },
3404
-
3405
-
3406
- handleMouseMove: function(ev) {
3407
- this.handleMove(ev);
3408
- },
3409
-
3410
-
3411
- // Scrolling (unrelated to auto-scroll)
3412
- // -----------------------------------------------------------------------------------------------------------------
3413
-
3414
-
3415
- handleTouchScroll: function(ev) {
3416
- // if the drag is being initiated by touch, but a scroll happens before
3417
- // the drag-initiating delay is over, cancel the drag
3418
- if (!this.isDragging || this.scrollAlwaysKills) {
3419
- this.endInteraction(ev, true); // isCancelled=true
3420
- }
3421
- },
3422
-
3423
-
3424
- // Utils
3425
- // -----------------------------------------------------------------------------------------------------------------
3426
-
3427
-
3428
- // Triggers a callback. Calls a function in the option hash of the same name.
3429
- // Arguments beyond the first `name` are forwarded on.
3430
- trigger: function(name) {
3431
- if (this.options[name]) {
3432
- this.options[name].apply(this, Array.prototype.slice.call(arguments, 1));
3433
- }
3434
- // makes _methods callable by event name. TODO: kill this
3435
- if (this['_' + name]) {
3436
- this['_' + name].apply(this, Array.prototype.slice.call(arguments, 1));
3437
- }
3438
- }
3439
-
3440
-
3441
- });
3442
-
3443
- ;;
3444
- /*
3445
- this.scrollEl is set in DragListener
3446
- */
3447
- DragListener.mixin({
3448
-
3449
- isAutoScroll: false,
3450
-
3451
- scrollBounds: null, // { top, bottom, left, right }
3452
- scrollTopVel: null, // pixels per second
3453
- scrollLeftVel: null, // pixels per second
3454
- scrollIntervalId: null, // ID of setTimeout for scrolling animation loop
3455
-
3456
- // defaults
3457
- scrollSensitivity: 30, // pixels from edge for scrolling to start
3458
- scrollSpeed: 200, // pixels per second, at maximum speed
3459
- scrollIntervalMs: 50, // millisecond wait between scroll increment
3460
-
3461
-
3462
- initAutoScroll: function() {
3463
- var scrollEl = this.scrollEl;
3464
-
3465
- this.isAutoScroll =
3466
- this.options.scroll &&
3467
- scrollEl &&
3468
- !scrollEl.is(window) &&
3469
- !scrollEl.is(document);
3470
-
3471
- if (this.isAutoScroll) {
3472
- // debounce makes sure rapid calls don't happen
3473
- this.listenTo(scrollEl, 'scroll', debounce(this.handleDebouncedScroll, 100));
3474
- }
3475
- },
3476
-
3477
-
3478
- destroyAutoScroll: function() {
3479
- this.endAutoScroll(); // kill any animation loop
3480
-
3481
- // remove the scroll handler if there is a scrollEl
3482
- if (this.isAutoScroll) {
3483
- this.stopListeningTo(this.scrollEl, 'scroll'); // will probably get removed by unbindHandlers too :(
3484
- }
3485
- },
3486
-
3487
-
3488
- // Computes and stores the bounding rectangle of scrollEl
3489
- computeScrollBounds: function() {
3490
- if (this.isAutoScroll) {
3491
- this.scrollBounds = getOuterRect(this.scrollEl);
3492
- // TODO: use getClientRect in future. but prevents auto scrolling when on top of scrollbars
3493
- }
3494
- },
3495
-
3496
-
3497
- // Called when the dragging is in progress and scrolling should be updated
3498
- updateAutoScroll: function(ev) {
3499
- var sensitivity = this.scrollSensitivity;
3500
- var bounds = this.scrollBounds;
3501
- var topCloseness, bottomCloseness;
3502
- var leftCloseness, rightCloseness;
3503
- var topVel = 0;
3504
- var leftVel = 0;
3505
-
3506
- if (bounds) { // only scroll if scrollEl exists
3507
-
3508
- // compute closeness to edges. valid range is from 0.0 - 1.0
3509
- topCloseness = (sensitivity - (getEvY(ev) - bounds.top)) / sensitivity;
3510
- bottomCloseness = (sensitivity - (bounds.bottom - getEvY(ev))) / sensitivity;
3511
- leftCloseness = (sensitivity - (getEvX(ev) - bounds.left)) / sensitivity;
3512
- rightCloseness = (sensitivity - (bounds.right - getEvX(ev))) / sensitivity;
3513
-
3514
- // translate vertical closeness into velocity.
3515
- // mouse must be completely in bounds for velocity to happen.
3516
- if (topCloseness >= 0 && topCloseness <= 1) {
3517
- topVel = topCloseness * this.scrollSpeed * -1; // negative. for scrolling up
3518
- }
3519
- else if (bottomCloseness >= 0 && bottomCloseness <= 1) {
3520
- topVel = bottomCloseness * this.scrollSpeed;
3521
- }
3522
-
3523
- // translate horizontal closeness into velocity
3524
- if (leftCloseness >= 0 && leftCloseness <= 1) {
3525
- leftVel = leftCloseness * this.scrollSpeed * -1; // negative. for scrolling left
3526
- }
3527
- else if (rightCloseness >= 0 && rightCloseness <= 1) {
3528
- leftVel = rightCloseness * this.scrollSpeed;
3529
- }
3530
- }
3531
-
3532
- this.setScrollVel(topVel, leftVel);
3533
- },
3534
-
3535
-
3536
- // Sets the speed-of-scrolling for the scrollEl
3537
- setScrollVel: function(topVel, leftVel) {
3538
-
3539
- this.scrollTopVel = topVel;
3540
- this.scrollLeftVel = leftVel;
3541
-
3542
- this.constrainScrollVel(); // massages into realistic values
3543
-
3544
- // if there is non-zero velocity, and an animation loop hasn't already started, then START
3545
- if ((this.scrollTopVel || this.scrollLeftVel) && !this.scrollIntervalId) {
3546
- this.scrollIntervalId = setInterval(
3547
- proxy(this, 'scrollIntervalFunc'), // scope to `this`
3548
- this.scrollIntervalMs
3549
- );
3550
- }
3551
- },
3552
-
3553
-
3554
- // Forces scrollTopVel and scrollLeftVel to be zero if scrolling has already gone all the way
3555
- constrainScrollVel: function() {
3556
- var el = this.scrollEl;
3557
-
3558
- if (this.scrollTopVel < 0) { // scrolling up?
3559
- if (el.scrollTop() <= 0) { // already scrolled all the way up?
3560
- this.scrollTopVel = 0;
3561
- }
3562
- }
3563
- else if (this.scrollTopVel > 0) { // scrolling down?
3564
- if (el.scrollTop() + el[0].clientHeight >= el[0].scrollHeight) { // already scrolled all the way down?
3565
- this.scrollTopVel = 0;
3566
- }
3567
- }
3568
-
3569
- if (this.scrollLeftVel < 0) { // scrolling left?
3570
- if (el.scrollLeft() <= 0) { // already scrolled all the left?
3571
- this.scrollLeftVel = 0;
3572
- }
3573
- }
3574
- else if (this.scrollLeftVel > 0) { // scrolling right?
3575
- if (el.scrollLeft() + el[0].clientWidth >= el[0].scrollWidth) { // already scrolled all the way right?
3576
- this.scrollLeftVel = 0;
3577
- }
3578
- }
3579
- },
3580
-
3581
-
3582
- // This function gets called during every iteration of the scrolling animation loop
3583
- scrollIntervalFunc: function() {
3584
- var el = this.scrollEl;
3585
- var frac = this.scrollIntervalMs / 1000; // considering animation frequency, what the vel should be mult'd by
3586
-
3587
- // change the value of scrollEl's scroll
3588
- if (this.scrollTopVel) {
3589
- el.scrollTop(el.scrollTop() + this.scrollTopVel * frac);
3590
- }
3591
- if (this.scrollLeftVel) {
3592
- el.scrollLeft(el.scrollLeft() + this.scrollLeftVel * frac);
3593
- }
3594
-
3595
- this.constrainScrollVel(); // since the scroll values changed, recompute the velocities
3596
-
3597
- // if scrolled all the way, which causes the vels to be zero, stop the animation loop
3598
- if (!this.scrollTopVel && !this.scrollLeftVel) {
3599
- this.endAutoScroll();
3600
- }
3601
- },
3602
-
3603
-
3604
- // Kills any existing scrolling animation loop
3605
- endAutoScroll: function() {
3606
- if (this.scrollIntervalId) {
3607
- clearInterval(this.scrollIntervalId);
3608
- this.scrollIntervalId = null;
3609
-
3610
- this.handleScrollEnd();
3611
- }
3612
- },
3613
-
3614
-
3615
- // Get called when the scrollEl is scrolled (NOTE: this is delayed via debounce)
3616
- handleDebouncedScroll: function() {
3617
- // recompute all coordinates, but *only* if this is *not* part of our scrolling animation
3618
- if (!this.scrollIntervalId) {
3619
- this.handleScrollEnd();
3620
- }
3621
- },
3622
-
3623
-
3624
- // Called when scrolling has stopped, whether through auto scroll, or the user scrolling
3625
- handleScrollEnd: function() {
3626
- }
3627
-
3628
- });
3629
- ;;
3630
-
3631
- /* Tracks mouse movements over a component and raises events about which hit the mouse is over.
3632
- ------------------------------------------------------------------------------------------------------------------------
3633
- options:
3634
- - subjectEl
3635
- - subjectCenter
3636
- */
3637
-
3638
- var HitDragListener = DragListener.extend({
3639
-
3640
- component: null, // converts coordinates to hits
3641
- // methods: hitsNeeded, hitsNotNeeded, queryHit
3642
-
3643
- origHit: null, // the hit the mouse was over when listening started
3644
- hit: null, // the hit the mouse is over
3645
- coordAdjust: null, // delta that will be added to the mouse coordinates when computing collisions
3646
-
3647
-
3648
- constructor: function(component, options) {
3649
- DragListener.call(this, options); // call the super-constructor
3650
-
3651
- this.component = component;
3652
- },
3653
-
3654
-
3655
- // Called when drag listening starts (but a real drag has not necessarily began).
3656
- // ev might be undefined if dragging was started manually.
3657
- handleInteractionStart: function(ev) {
3658
- var subjectEl = this.subjectEl;
3659
- var subjectRect;
3660
- var origPoint;
3661
- var point;
3662
-
3663
- this.component.hitsNeeded();
3664
- this.computeScrollBounds(); // for autoscroll
3665
-
3666
- if (ev) {
3667
- origPoint = { left: getEvX(ev), top: getEvY(ev) };
3668
- point = origPoint;
3669
-
3670
- // constrain the point to bounds of the element being dragged
3671
- if (subjectEl) {
3672
- subjectRect = getOuterRect(subjectEl); // used for centering as well
3673
- point = constrainPoint(point, subjectRect);
3674
- }
3675
-
3676
- this.origHit = this.queryHit(point.left, point.top);
3677
-
3678
- // treat the center of the subject as the collision point?
3679
- if (subjectEl && this.options.subjectCenter) {
3680
-
3681
- // only consider the area the subject overlaps the hit. best for large subjects.
3682
- // TODO: skip this if hit didn't supply left/right/top/bottom
3683
- if (this.origHit) {
3684
- subjectRect = intersectRects(this.origHit, subjectRect) ||
3685
- subjectRect; // in case there is no intersection
3686
- }
3687
-
3688
- point = getRectCenter(subjectRect);
3689
- }
3690
-
3691
- this.coordAdjust = diffPoints(point, origPoint); // point - origPoint
3692
- }
3693
- else {
3694
- this.origHit = null;
3695
- this.coordAdjust = null;
3696
- }
3697
-
3698
- // call the super-method. do it after origHit has been computed
3699
- DragListener.prototype.handleInteractionStart.apply(this, arguments);
3700
- },
3701
-
3702
-
3703
- // Called when the actual drag has started
3704
- handleDragStart: function(ev) {
3705
- var hit;
3706
-
3707
- DragListener.prototype.handleDragStart.apply(this, arguments); // call the super-method
3708
-
3709
- // might be different from this.origHit if the min-distance is large
3710
- hit = this.queryHit(getEvX(ev), getEvY(ev));
3711
-
3712
- // report the initial hit the mouse is over
3713
- // especially important if no min-distance and drag starts immediately
3714
- if (hit) {
3715
- this.handleHitOver(hit);
3716
- }
3717
- },
3718
-
3719
-
3720
- // Called when the drag moves
3721
- handleDrag: function(dx, dy, ev) {
3722
- var hit;
3723
-
3724
- DragListener.prototype.handleDrag.apply(this, arguments); // call the super-method
3725
-
3726
- hit = this.queryHit(getEvX(ev), getEvY(ev));
3727
-
3728
- if (!isHitsEqual(hit, this.hit)) { // a different hit than before?
3729
- if (this.hit) {
3730
- this.handleHitOut();
3731
- }
3732
- if (hit) {
3733
- this.handleHitOver(hit);
3734
- }
3735
- }
3736
- },
3737
-
3738
-
3739
- // Called when dragging has been stopped
3740
- handleDragEnd: function() {
3741
- this.handleHitDone();
3742
- DragListener.prototype.handleDragEnd.apply(this, arguments); // call the super-method
3743
- },
3744
-
3745
-
3746
- // Called when a the mouse has just moved over a new hit
3747
- handleHitOver: function(hit) {
3748
- var isOrig = isHitsEqual(hit, this.origHit);
3749
-
3750
- this.hit = hit;
3751
-
3752
- this.trigger('hitOver', this.hit, isOrig, this.origHit);
3753
- },
3754
-
3755
-
3756
- // Called when the mouse has just moved out of a hit
3757
- handleHitOut: function() {
3758
- if (this.hit) {
3759
- this.trigger('hitOut', this.hit);
3760
- this.handleHitDone();
3761
- this.hit = null;
3762
- }
3763
- },
3764
-
3765
-
3766
- // Called after a hitOut. Also called before a dragStop
3767
- handleHitDone: function() {
3768
- if (this.hit) {
3769
- this.trigger('hitDone', this.hit);
3770
- }
3771
- },
3772
-
3773
-
3774
- // Called when the interaction ends, whether there was a real drag or not
3775
- handleInteractionEnd: function() {
3776
- DragListener.prototype.handleInteractionEnd.apply(this, arguments); // call the super-method
3777
-
3778
- this.origHit = null;
3779
- this.hit = null;
3780
-
3781
- this.component.hitsNotNeeded();
3782
- },
3783
-
3784
-
3785
- // Called when scrolling has stopped, whether through auto scroll, or the user scrolling
3786
- handleScrollEnd: function() {
3787
- DragListener.prototype.handleScrollEnd.apply(this, arguments); // call the super-method
3788
-
3789
- // hits' absolute positions will be in new places after a user's scroll.
3790
- // HACK for recomputing.
3791
- if (this.isDragging) {
3792
- this.component.releaseHits();
3793
- this.component.prepareHits();
3794
- }
3795
- },
3796
-
3797
-
3798
- // Gets the hit underneath the coordinates for the given mouse event
3799
- queryHit: function(left, top) {
3800
-
3801
- if (this.coordAdjust) {
3802
- left += this.coordAdjust.left;
3803
- top += this.coordAdjust.top;
3804
- }
3805
-
3806
- return this.component.queryHit(left, top);
3807
- }
3808
-
3809
- });
3810
-
3811
-
3812
- // Returns `true` if the hits are identically equal. `false` otherwise. Must be from the same component.
3813
- // Two null values will be considered equal, as two "out of the component" states are the same.
3814
- function isHitsEqual(hit0, hit1) {
3815
-
3816
- if (!hit0 && !hit1) {
3817
- return true;
3818
- }
3819
-
3820
- if (hit0 && hit1) {
3821
- return hit0.component === hit1.component &&
3822
- isHitPropsWithin(hit0, hit1) &&
3823
- isHitPropsWithin(hit1, hit0); // ensures all props are identical
3824
- }
3825
-
3826
- return false;
3827
- }
3828
-
3829
-
3830
- // Returns true if all of subHit's non-standard properties are within superHit
3831
- function isHitPropsWithin(subHit, superHit) {
3832
- for (var propName in subHit) {
3833
- if (!/^(component|left|right|top|bottom)$/.test(propName)) {
3834
- if (subHit[propName] !== superHit[propName]) {
3835
- return false;
3836
- }
3837
- }
3838
- }
3839
- return true;
3840
- }
3841
-
3842
- ;;
3843
-
3844
- /*
3845
- Listens to document and window-level user-interaction events, like touch events and mouse events,
3846
- and fires these events as-is to whoever is observing a GlobalEmitter.
3847
- Best when used as a singleton via GlobalEmitter.get()
3848
-
3849
- Normalizes mouse/touch events. For examples:
3850
- - ignores the the simulated mouse events that happen after a quick tap: mousemove+mousedown+mouseup+click
3851
- - compensates for various buggy scenarios where a touchend does not fire
3852
- */
3853
-
3854
- FC.touchMouseIgnoreWait = 500;
3855
-
3856
- var GlobalEmitter = Class.extend(ListenerMixin, EmitterMixin, {
3857
-
3858
- isTouching: false,
3859
- mouseIgnoreDepth: 0,
3860
- handleScrollProxy: null,
3861
-
3862
-
3863
- bind: function() {
3864
- var _this = this;
3865
-
3866
- this.listenTo($(document), {
3867
- touchstart: this.handleTouchStart,
3868
- touchcancel: this.handleTouchCancel,
3869
- touchend: this.handleTouchEnd,
3870
- mousedown: this.handleMouseDown,
3871
- mousemove: this.handleMouseMove,
3872
- mouseup: this.handleMouseUp,
3873
- click: this.handleClick,
3874
- selectstart: this.handleSelectStart,
3875
- contextmenu: this.handleContextMenu
3876
- });
3877
-
3878
- // because we need to call preventDefault
3879
- // because https://www.chromestatus.com/features/5093566007214080
3880
- // TODO: investigate performance because this is a global handler
3881
- window.addEventListener(
3882
- 'touchmove',
3883
- this.handleTouchMoveProxy = function(ev) {
3884
- _this.handleTouchMove($.Event(ev));
3885
- },
3886
- { passive: false } // allows preventDefault()
3887
- );
3888
-
3889
- // attach a handler to get called when ANY scroll action happens on the page.
3890
- // this was impossible to do with normal on/off because 'scroll' doesn't bubble.
3891
- // http://stackoverflow.com/a/32954565/96342
3892
- window.addEventListener(
3893
- 'scroll',
3894
- this.handleScrollProxy = function(ev) {
3895
- _this.handleScroll($.Event(ev));
3896
- },
3897
- true // useCapture
3898
- );
3899
- },
3900
-
3901
- unbind: function() {
3902
- this.stopListeningTo($(document));
3903
-
3904
- window.removeEventListener(
3905
- 'touchmove',
3906
- this.handleTouchMoveProxy
3907
- );
3908
-
3909
- window.removeEventListener(
3910
- 'scroll',
3911
- this.handleScrollProxy,
3912
- true // useCapture
3913
- );
3914
- },
3915
-
3916
-
3917
- // Touch Handlers
3918
- // -----------------------------------------------------------------------------------------------------------------
3919
-
3920
- handleTouchStart: function(ev) {
3921
-
3922
- // if a previous touch interaction never ended with a touchend, then implicitly end it,
3923
- // but since a new touch interaction is about to begin, don't start the mouse ignore period.
3924
- this.stopTouch(ev, true); // skipMouseIgnore=true
3925
-
3926
- this.isTouching = true;
3927
- this.trigger('touchstart', ev);
3928
- },
3929
-
3930
- handleTouchMove: function(ev) {
3931
- if (this.isTouching) {
3932
- this.trigger('touchmove', ev);
3933
- }
3934
- },
3935
-
3936
- handleTouchCancel: function(ev) {
3937
- if (this.isTouching) {
3938
- this.trigger('touchcancel', ev);
3939
-
3940
- // Have touchcancel fire an artificial touchend. That way, handlers won't need to listen to both.
3941
- // If touchend fires later, it won't have any effect b/c isTouching will be false.
3942
- this.stopTouch(ev);
3943
- }
3944
- },
3945
-
3946
- handleTouchEnd: function(ev) {
3947
- this.stopTouch(ev);
3948
- },
3949
-
3950
-
3951
- // Mouse Handlers
3952
- // -----------------------------------------------------------------------------------------------------------------
3953
-
3954
- handleMouseDown: function(ev) {
3955
- if (!this.shouldIgnoreMouse()) {
3956
- this.trigger('mousedown', ev);
3957
- }
3958
- },
3959
-
3960
- handleMouseMove: function(ev) {
3961
- if (!this.shouldIgnoreMouse()) {
3962
- this.trigger('mousemove', ev);
3963
- }
3964
- },
3965
-
3966
- handleMouseUp: function(ev) {
3967
- if (!this.shouldIgnoreMouse()) {
3968
- this.trigger('mouseup', ev);
3969
- }
3970
- },
3971
-
3972
- handleClick: function(ev) {
3973
- if (!this.shouldIgnoreMouse()) {
3974
- this.trigger('click', ev);
3975
- }
3976
- },
3977
-
3978
-
3979
- // Misc Handlers
3980
- // -----------------------------------------------------------------------------------------------------------------
3981
-
3982
- handleSelectStart: function(ev) {
3983
- this.trigger('selectstart', ev);
3984
- },
3985
-
3986
- handleContextMenu: function(ev) {
3987
- this.trigger('contextmenu', ev);
3988
- },
3989
-
3990
- handleScroll: function(ev) {
3991
- this.trigger('scroll', ev);
3992
- },
3993
-
3994
-
3995
- // Utils
3996
- // -----------------------------------------------------------------------------------------------------------------
3997
-
3998
- stopTouch: function(ev, skipMouseIgnore) {
3999
- if (this.isTouching) {
4000
- this.isTouching = false;
4001
- this.trigger('touchend', ev);
4002
-
4003
- if (!skipMouseIgnore) {
4004
- this.startTouchMouseIgnore();
4005
- }
4006
- }
4007
- },
4008
-
4009
- startTouchMouseIgnore: function() {
4010
- var _this = this;
4011
- var wait = FC.touchMouseIgnoreWait;
4012
-
4013
- if (wait) {
4014
- this.mouseIgnoreDepth++;
4015
- setTimeout(function() {
4016
- _this.mouseIgnoreDepth--;
4017
- }, wait);
4018
- }
4019
- },
4020
-
4021
- shouldIgnoreMouse: function() {
4022
- return this.isTouching || Boolean(this.mouseIgnoreDepth);
4023
- }
4024
-
4025
- });
4026
-
4027
-
4028
- // Singleton
4029
- // ---------------------------------------------------------------------------------------------------------------------
4030
-
4031
- (function() {
4032
- var globalEmitter = null;
4033
- var neededCount = 0;
4034
-
4035
-
4036
- // gets the singleton
4037
- GlobalEmitter.get = function() {
4038
-
4039
- if (!globalEmitter) {
4040
- globalEmitter = new GlobalEmitter();
4041
- globalEmitter.bind();
4042
- }
4043
-
4044
- return globalEmitter;
4045
- };
4046
-
4047
-
4048
- // called when an object knows it will need a GlobalEmitter in the near future.
4049
- GlobalEmitter.needed = function() {
4050
- GlobalEmitter.get(); // ensures globalEmitter
4051
- neededCount++;
4052
- };
4053
-
4054
-
4055
- // called when the object that originally called needed() doesn't need a GlobalEmitter anymore.
4056
- GlobalEmitter.unneeded = function() {
4057
- neededCount--;
4058
-
4059
- if (!neededCount) { // nobody else needs it
4060
- globalEmitter.unbind();
4061
- globalEmitter = null;
4062
- }
4063
- };
4064
-
4065
- })();
4066
-
4067
- ;;
4068
-
4069
- /* Creates a clone of an element and lets it track the mouse as it moves
4070
- ----------------------------------------------------------------------------------------------------------------------*/
4071
-
4072
- var MouseFollower = Class.extend(ListenerMixin, {
4073
-
4074
- options: null,
4075
-
4076
- sourceEl: null, // the element that will be cloned and made to look like it is dragging
4077
- el: null, // the clone of `sourceEl` that will track the mouse
4078
- parentEl: null, // the element that `el` (the clone) will be attached to
4079
-
4080
- // the initial position of el, relative to the offset parent. made to match the initial offset of sourceEl
4081
- top0: null,
4082
- left0: null,
4083
-
4084
- // the absolute coordinates of the initiating touch/mouse action
4085
- y0: null,
4086
- x0: null,
4087
-
4088
- // the number of pixels the mouse has moved from its initial position
4089
- topDelta: null,
4090
- leftDelta: null,
4091
-
4092
- isFollowing: false,
4093
- isHidden: false,
4094
- isAnimating: false, // doing the revert animation?
4095
-
4096
- constructor: function(sourceEl, options) {
4097
- this.options = options = options || {};
4098
- this.sourceEl = sourceEl;
4099
- this.parentEl = options.parentEl ? $(options.parentEl) : sourceEl.parent(); // default to sourceEl's parent
4100
- },
4101
-
4102
-
4103
- // Causes the element to start following the mouse
4104
- start: function(ev) {
4105
- if (!this.isFollowing) {
4106
- this.isFollowing = true;
4107
-
4108
- this.y0 = getEvY(ev);
4109
- this.x0 = getEvX(ev);
4110
- this.topDelta = 0;
4111
- this.leftDelta = 0;
4112
-
4113
- if (!this.isHidden) {
4114
- this.updatePosition();
4115
- }
4116
-
4117
- if (getEvIsTouch(ev)) {
4118
- this.listenTo($(document), 'touchmove', this.handleMove);
4119
- }
4120
- else {
4121
- this.listenTo($(document), 'mousemove', this.handleMove);
4122
- }
4123
- }
4124
- },
4125
-
4126
-
4127
- // Causes the element to stop following the mouse. If shouldRevert is true, will animate back to original position.
4128
- // `callback` gets invoked when the animation is complete. If no animation, it is invoked immediately.
4129
- stop: function(shouldRevert, callback) {
4130
- var _this = this;
4131
- var revertDuration = this.options.revertDuration;
4132
-
4133
- function complete() { // might be called by .animate(), which might change `this` context
4134
- _this.isAnimating = false;
4135
- _this.removeElement();
4136
-
4137
- _this.top0 = _this.left0 = null; // reset state for future updatePosition calls
4138
-
4139
- if (callback) {
4140
- callback();
4141
- }
4142
- }
4143
-
4144
- if (this.isFollowing && !this.isAnimating) { // disallow more than one stop animation at a time
4145
- this.isFollowing = false;
4146
-
4147
- this.stopListeningTo($(document));
4148
-
4149
- if (shouldRevert && revertDuration && !this.isHidden) { // do a revert animation?
4150
- this.isAnimating = true;
4151
- this.el.animate({
4152
- top: this.top0,
4153
- left: this.left0
4154
- }, {
4155
- duration: revertDuration,
4156
- complete: complete
4157
- });
4158
- }
4159
- else {
4160
- complete();
4161
- }
4162
- }
4163
- },
4164
-
4165
-
4166
- // Gets the tracking element. Create it if necessary
4167
- getEl: function() {
4168
- var el = this.el;
4169
-
4170
- if (!el) {
4171
- el = this.el = this.sourceEl.clone()
4172
- .addClass(this.options.additionalClass || '')
4173
- .css({
4174
- position: 'absolute',
4175
- visibility: '', // in case original element was hidden (commonly through hideEvents())
4176
- display: this.isHidden ? 'none' : '', // for when initially hidden
4177
- margin: 0,
4178
- right: 'auto', // erase and set width instead
4179
- bottom: 'auto', // erase and set height instead
4180
- width: this.sourceEl.width(), // explicit height in case there was a 'right' value
4181
- height: this.sourceEl.height(), // explicit width in case there was a 'bottom' value
4182
- opacity: this.options.opacity || '',
4183
- zIndex: this.options.zIndex
4184
- });
4185
-
4186
- // we don't want long taps or any mouse interaction causing selection/menus.
4187
- // would use preventSelection(), but that prevents selectstart, causing problems.
4188
- el.addClass('fc-unselectable');
4189
-
4190
- el.appendTo(this.parentEl);
4191
- }
4192
-
4193
- return el;
4194
- },
4195
-
4196
-
4197
- // Removes the tracking element if it has already been created
4198
- removeElement: function() {
4199
- if (this.el) {
4200
- this.el.remove();
4201
- this.el = null;
4202
- }
4203
- },
4204
-
4205
-
4206
- // Update the CSS position of the tracking element
4207
- updatePosition: function() {
4208
- var sourceOffset;
4209
- var origin;
4210
-
4211
- this.getEl(); // ensure this.el
4212
-
4213
- // make sure origin info was computed
4214
- if (this.top0 === null) {
4215
- sourceOffset = this.sourceEl.offset();
4216
- origin = this.el.offsetParent().offset();
4217
- this.top0 = sourceOffset.top - origin.top;
4218
- this.left0 = sourceOffset.left - origin.left;
4219
- }
4220
-
4221
- this.el.css({
4222
- top: this.top0 + this.topDelta,
4223
- left: this.left0 + this.leftDelta
4224
- });
4225
- },
4226
-
4227
-
4228
- // Gets called when the user moves the mouse
4229
- handleMove: function(ev) {
4230
- this.topDelta = getEvY(ev) - this.y0;
4231
- this.leftDelta = getEvX(ev) - this.x0;
4232
-
4233
- if (!this.isHidden) {
4234
- this.updatePosition();
4235
- }
4236
- },
4237
-
4238
-
4239
- // Temporarily makes the tracking element invisible. Can be called before following starts
4240
- hide: function() {
4241
- if (!this.isHidden) {
4242
- this.isHidden = true;
4243
- if (this.el) {
4244
- this.el.hide();
4245
- }
4246
- }
4247
- },
4248
-
4249
-
4250
- // Show the tracking element after it has been temporarily hidden
4251
- show: function() {
4252
- if (this.isHidden) {
4253
- this.isHidden = false;
4254
- this.updatePosition();
4255
- this.getEl().show();
4256
- }
4257
- }
4258
-
4259
- });
4260
-
4261
- ;;
4262
-
4263
- /* An abstract class comprised of a "grid" of areas that each represent a specific datetime
4264
- ----------------------------------------------------------------------------------------------------------------------*/
4265
-
4266
- var Grid = FC.Grid = Class.extend(ListenerMixin, {
4267
-
4268
- // self-config, overridable by subclasses
4269
- hasDayInteractions: true, // can user click/select ranges of time?
4270
-
4271
- view: null, // a View object
4272
- isRTL: null, // shortcut to the view's isRTL option
4273
-
4274
- start: null,
4275
- end: null,
4276
-
4277
- el: null, // the containing element
4278
- elsByFill: null, // a hash of jQuery element sets used for rendering each fill. Keyed by fill name.
4279
-
4280
- // derived from options
4281
- eventTimeFormat: null,
4282
- displayEventTime: null,
4283
- displayEventEnd: null,
4284
-
4285
- minResizeDuration: null, // TODO: hack. set by subclasses. minumum event resize duration
4286
-
4287
- // if defined, holds the unit identified (ex: "year" or "month") that determines the level of granularity
4288
- // of the date areas. if not defined, assumes to be day and time granularity.
4289
- // TODO: port isTimeScale into same system?
4290
- largeUnit: null,
4291
-
4292
- dayClickListener: null,
4293
- daySelectListener: null,
4294
- segDragListener: null,
4295
- segResizeListener: null,
4296
- externalDragListener: null,
4297
-
4298
-
4299
- constructor: function(view) {
4300
- this.view = view;
4301
- this.isRTL = view.opt('isRTL');
4302
- this.elsByFill = {};
4303
-
4304
- this.dayClickListener = this.buildDayClickListener();
4305
- this.daySelectListener = this.buildDaySelectListener();
4306
- },
4307
-
4308
-
4309
- /* Options
4310
- ------------------------------------------------------------------------------------------------------------------*/
4311
-
4312
-
4313
- // Generates the format string used for event time text, if not explicitly defined by 'timeFormat'
4314
- computeEventTimeFormat: function() {
4315
- return this.view.opt('smallTimeFormat');
4316
- },
4317
-
4318
-
4319
- // Determines whether events should have their end times displayed, if not explicitly defined by 'displayEventTime'.
4320
- // Only applies to non-all-day events.
4321
- computeDisplayEventTime: function() {
4322
- return true;
4323
- },
4324
-
4325
-
4326
- // Determines whether events should have their end times displayed, if not explicitly defined by 'displayEventEnd'
4327
- computeDisplayEventEnd: function() {
4328
- return true;
4329
- },
4330
-
4331
-
4332
- /* Dates
4333
- ------------------------------------------------------------------------------------------------------------------*/
4334
-
4335
-
4336
- // Tells the grid about what period of time to display.
4337
- // Any date-related internal data should be generated.
4338
- setRange: function(range) {
4339
- this.start = range.start.clone();
4340
- this.end = range.end.clone();
4341
-
4342
- this.rangeUpdated();
4343
- this.processRangeOptions();
4344
- },
4345
-
4346
-
4347
- // Called when internal variables that rely on the range should be updated
4348
- rangeUpdated: function() {
4349
- },
4350
-
4351
-
4352
- // Updates values that rely on options and also relate to range
4353
- processRangeOptions: function() {
4354
- var view = this.view;
4355
- var displayEventTime;
4356
- var displayEventEnd;
4357
-
4358
- this.eventTimeFormat =
4359
- view.opt('eventTimeFormat') ||
4360
- view.opt('timeFormat') || // deprecated
4361
- this.computeEventTimeFormat();
4362
-
4363
- displayEventTime = view.opt('displayEventTime');
4364
- if (displayEventTime == null) {
4365
- displayEventTime = this.computeDisplayEventTime(); // might be based off of range
4366
- }
4367
-
4368
- displayEventEnd = view.opt('displayEventEnd');
4369
- if (displayEventEnd == null) {
4370
- displayEventEnd = this.computeDisplayEventEnd(); // might be based off of range
4371
- }
4372
-
4373
- this.displayEventTime = displayEventTime;
4374
- this.displayEventEnd = displayEventEnd;
4375
- },
4376
-
4377
-
4378
- // Converts a span (has unzoned start/end and any other grid-specific location information)
4379
- // into an array of segments (pieces of events whose format is decided by the grid).
4380
- spanToSegs: function(span) {
4381
- // subclasses must implement
4382
- },
4383
-
4384
-
4385
- // Diffs the two dates, returning a duration, based on granularity of the grid
4386
- // TODO: port isTimeScale into this system?
4387
- diffDates: function(a, b) {
4388
- if (this.largeUnit) {
4389
- return diffByUnit(a, b, this.largeUnit);
4390
- }
4391
- else {
4392
- return diffDayTime(a, b);
4393
- }
4394
- },
4395
-
4396
-
4397
- /* Hit Area
4398
- ------------------------------------------------------------------------------------------------------------------*/
4399
-
4400
- hitsNeededDepth: 0, // necessary because multiple callers might need the same hits
4401
-
4402
- hitsNeeded: function() {
4403
- if (!(this.hitsNeededDepth++)) {
4404
- this.prepareHits();
4405
- }
4406
- },
4407
-
4408
- hitsNotNeeded: function() {
4409
- if (this.hitsNeededDepth && !(--this.hitsNeededDepth)) {
4410
- this.releaseHits();
4411
- }
4412
- },
4413
-
4414
-
4415
- // Called before one or more queryHit calls might happen. Should prepare any cached coordinates for queryHit
4416
- prepareHits: function() {
4417
- },
4418
-
4419
-
4420
- // Called when queryHit calls have subsided. Good place to clear any coordinate caches.
4421
- releaseHits: function() {
4422
- },
4423
-
4424
-
4425
- // Given coordinates from the topleft of the document, return data about the date-related area underneath.
4426
- // Can return an object with arbitrary properties (although top/right/left/bottom are encouraged).
4427
- // Must have a `grid` property, a reference to this current grid. TODO: avoid this
4428
- // The returned object will be processed by getHitSpan and getHitEl.
4429
- queryHit: function(leftOffset, topOffset) {
4430
- },
4431
-
4432
-
4433
- // like getHitSpan, but returns null if the resulting span's range is invalid
4434
- getSafeHitSpan: function(hit) {
4435
- var hitSpan = this.getHitSpan(hit);
4436
-
4437
- if (!isRangeWithinRange(hitSpan, this.view.activeRange)) {
4438
- return null;
4439
- }
4440
-
4441
- return hitSpan;
4442
- },
4443
-
4444
-
4445
- // Given position-level information about a date-related area within the grid,
4446
- // should return an object with at least a start/end date. Can provide other information as well.
4447
- getHitSpan: function(hit) {
4448
- },
4449
-
4450
-
4451
- // Given position-level information about a date-related area within the grid,
4452
- // should return a jQuery element that best represents it. passed to dayClick callback.
4453
- getHitEl: function(hit) {
4454
- },
4455
-
4456
-
4457
- /* Rendering
4458
- ------------------------------------------------------------------------------------------------------------------*/
4459
-
4460
-
4461
- // Sets the container element that the grid should render inside of.
4462
- // Does other DOM-related initializations.
4463
- setElement: function(el) {
4464
- this.el = el;
4465
-
4466
- if (this.hasDayInteractions) {
4467
- preventSelection(el);
4468
-
4469
- this.bindDayHandler('touchstart', this.dayTouchStart);
4470
- this.bindDayHandler('mousedown', this.dayMousedown);
4471
- }
4472
-
4473
- // attach event-element-related handlers. in Grid.events
4474
- // same garbage collection note as above.
4475
- this.bindSegHandlers();
4476
-
4477
- this.bindGlobalHandlers();
4478
- },
4479
-
4480
-
4481
- bindDayHandler: function(name, handler) {
4482
- var _this = this;
4483
-
4484
- // attach a handler to the grid's root element.
4485
- // jQuery will take care of unregistering them when removeElement gets called.
4486
- this.el.on(name, function(ev) {
4487
- if (
4488
- !$(ev.target).is(
4489
- _this.segSelector + ',' + // directly on an event element
4490
- _this.segSelector + ' *,' + // within an event element
4491
- '.fc-more,' + // a "more.." link
4492
- 'a[data-goto]' // a clickable nav link
4493
- )
4494
- ) {
4495
- return handler.call(_this, ev);
4496
- }
4497
- });
4498
- },
4499
-
4500
-
4501
- // Removes the grid's container element from the DOM. Undoes any other DOM-related attachments.
4502
- // DOES NOT remove any content beforehand (doesn't clear events or call unrenderDates), unlike View
4503
- removeElement: function() {
4504
- this.unbindGlobalHandlers();
4505
- this.clearDragListeners();
4506
-
4507
- this.el.remove();
4508
-
4509
- // NOTE: we don't null-out this.el for the same reasons we don't do it within View::removeElement
4510
- },
4511
-
4512
-
4513
- // Renders the basic structure of grid view before any content is rendered
4514
- renderSkeleton: function() {
4515
- // subclasses should implement
4516
- },
4517
-
4518
-
4519
- // Renders the grid's date-related content (like areas that represent days/times).
4520
- // Assumes setRange has already been called and the skeleton has already been rendered.
4521
- renderDates: function() {
4522
- // subclasses should implement
4523
- },
4524
-
4525
-
4526
- // Unrenders the grid's date-related content
4527
- unrenderDates: function() {
4528
- // subclasses should implement
4529
- },
4530
-
4531
-
4532
- /* Handlers
4533
- ------------------------------------------------------------------------------------------------------------------*/
4534
-
4535
-
4536
- // Binds DOM handlers to elements that reside outside the grid, such as the document
4537
- bindGlobalHandlers: function() {
4538
- this.listenTo($(document), {
4539
- dragstart: this.externalDragStart, // jqui
4540
- sortstart: this.externalDragStart // jqui
4541
- });
4542
- },
4543
-
4544
-
4545
- // Unbinds DOM handlers from elements that reside outside the grid
4546
- unbindGlobalHandlers: function() {
4547
- this.stopListeningTo($(document));
4548
- },
4549
-
4550
-
4551
- // Process a mousedown on an element that represents a day. For day clicking and selecting.
4552
- dayMousedown: function(ev) {
4553
- var view = this.view;
4554
-
4555
- // HACK
4556
- // This will still work even though bindDayHandler doesn't use GlobalEmitter.
4557
- if (GlobalEmitter.get().shouldIgnoreMouse()) {
4558
- return;
4559
- }
4560
-
4561
- this.dayClickListener.startInteraction(ev);
4562
-
4563
- if (view.opt('selectable')) {
4564
- this.daySelectListener.startInteraction(ev, {
4565
- distance: view.opt('selectMinDistance')
4566
- });
4567
- }
4568
- },
4569
-
4570
-
4571
- dayTouchStart: function(ev) {
4572
- var view = this.view;
4573
- var selectLongPressDelay;
4574
-
4575
- // On iOS (and Android?) when a new selection is initiated overtop another selection,
4576
- // the touchend never fires because the elements gets removed mid-touch-interaction (my theory).
4577
- // HACK: simply don't allow this to happen.
4578
- // ALSO: prevent selection when an *event* is already raised.
4579
- if (view.isSelected || view.selectedEvent) {
4580
- return;
4581
- }
4582
-
4583
- selectLongPressDelay = view.opt('selectLongPressDelay');
4584
- if (selectLongPressDelay == null) {
4585
- selectLongPressDelay = view.opt('longPressDelay'); // fallback
4586
- }
4587
-
4588
- this.dayClickListener.startInteraction(ev);
4589
-
4590
- if (view.opt('selectable')) {
4591
- this.daySelectListener.startInteraction(ev, {
4592
- delay: selectLongPressDelay
4593
- });
4594
- }
4595
- },
4596
-
4597
-
4598
- // Creates a listener that tracks the user's drag across day elements, for day clicking.
4599
- buildDayClickListener: function() {
4600
- var _this = this;
4601
- var view = this.view;
4602
- var dayClickHit; // null if invalid dayClick
4603
-
4604
- var dragListener = new HitDragListener(this, {
4605
- scroll: view.opt('dragScroll'),
4606
- interactionStart: function() {
4607
- dayClickHit = dragListener.origHit;
4608
- },
4609
- hitOver: function(hit, isOrig, origHit) {
4610
- // if user dragged to another cell at any point, it can no longer be a dayClick
4611
- if (!isOrig) {
4612
- dayClickHit = null;
4613
- }
4614
- },
4615
- hitOut: function() { // called before mouse moves to a different hit OR moved out of all hits
4616
- dayClickHit = null;
4617
- },
4618
- interactionEnd: function(ev, isCancelled) {
4619
- var hitSpan;
4620
-
4621
- if (!isCancelled && dayClickHit) {
4622
- hitSpan = _this.getSafeHitSpan(dayClickHit);
4623
-
4624
- if (hitSpan) {
4625
- view.triggerDayClick(hitSpan, _this.getHitEl(dayClickHit), ev);
4626
- }
4627
- }
4628
- }
4629
- });
4630
-
4631
- // because dayClickListener won't be called with any time delay, "dragging" will begin immediately,
4632
- // which will kill any touchmoving/scrolling. Prevent this.
4633
- dragListener.shouldCancelTouchScroll = false;
4634
-
4635
- dragListener.scrollAlwaysKills = true;
4636
-
4637
- return dragListener;
4638
- },
4639
-
4640
-
4641
- // Creates a listener that tracks the user's drag across day elements, for day selecting.
4642
- buildDaySelectListener: function() {
4643
- var _this = this;
4644
- var view = this.view;
4645
- var selectionSpan; // null if invalid selection
4646
-
4647
- var dragListener = new HitDragListener(this, {
4648
- scroll: view.opt('dragScroll'),
4649
- interactionStart: function() {
4650
- selectionSpan = null;
4651
- },
4652
- dragStart: function() {
4653
- view.unselect(); // since we could be rendering a new selection, we want to clear any old one
4654
- },
4655
- hitOver: function(hit, isOrig, origHit) {
4656
- var origHitSpan;
4657
- var hitSpan;
4658
-
4659
- if (origHit) { // click needs to have started on a hit
4660
-
4661
- origHitSpan = _this.getSafeHitSpan(origHit);
4662
- hitSpan = _this.getSafeHitSpan(hit);
4663
-
4664
- if (origHitSpan && hitSpan) {
4665
- selectionSpan = _this.computeSelection(origHitSpan, hitSpan);
4666
- }
4667
- else {
4668
- selectionSpan = null;
4669
- }
4670
-
4671
- if (selectionSpan) {
4672
- _this.renderSelection(selectionSpan);
4673
- }
4674
- else if (selectionSpan === false) {
4675
- disableCursor();
4676
- }
4677
- }
4678
- },
4679
- hitOut: function() { // called before mouse moves to a different hit OR moved out of all hits
4680
- selectionSpan = null;
4681
- _this.unrenderSelection();
4682
- },
4683
- hitDone: function() { // called after a hitOut OR before a dragEnd
4684
- enableCursor();
4685
- },
4686
- interactionEnd: function(ev, isCancelled) {
4687
- if (!isCancelled && selectionSpan) {
4688
- // the selection will already have been rendered. just report it
4689
- view.reportSelection(selectionSpan, ev);
4690
- }
4691
- }
4692
- });
4693
-
4694
- return dragListener;
4695
- },
4696
-
4697
-
4698
- // Kills all in-progress dragging.
4699
- // Useful for when public API methods that result in re-rendering are invoked during a drag.
4700
- // Also useful for when touch devices misbehave and don't fire their touchend.
4701
- clearDragListeners: function() {
4702
- this.dayClickListener.endInteraction();
4703
- this.daySelectListener.endInteraction();
4704
-
4705
- if (this.segDragListener) {
4706
- this.segDragListener.endInteraction(); // will clear this.segDragListener
4707
- }
4708
- if (this.segResizeListener) {
4709
- this.segResizeListener.endInteraction(); // will clear this.segResizeListener
4710
- }
4711
- if (this.externalDragListener) {
4712
- this.externalDragListener.endInteraction(); // will clear this.externalDragListener
4713
- }
4714
- },
4715
-
4716
-
4717
- /* Event Helper
4718
- ------------------------------------------------------------------------------------------------------------------*/
4719
- // TODO: should probably move this to Grid.events, like we did event dragging / resizing
4720
-
4721
-
4722
- // Renders a mock event at the given event location, which contains zoned start/end properties.
4723
- // Returns all mock event elements.
4724
- renderEventLocationHelper: function(eventLocation, sourceSeg) {
4725
- var fakeEvent = this.fabricateHelperEvent(eventLocation, sourceSeg);
4726
-
4727
- return this.renderHelper(fakeEvent, sourceSeg); // do the actual rendering
4728
- },
4729
-
4730
-
4731
- // Builds a fake event given zoned event date properties and a segment is should be inspired from.
4732
- // The range's end can be null, in which case the mock event that is rendered will have a null end time.
4733
- // `sourceSeg` is the internal segment object involved in the drag. If null, something external is dragging.
4734
- fabricateHelperEvent: function(eventLocation, sourceSeg) {
4735
- var fakeEvent = sourceSeg ? createObject(sourceSeg.event) : {}; // mask the original event object if possible
4736
-
4737
- fakeEvent.start = eventLocation.start.clone();
4738
- fakeEvent.end = eventLocation.end ? eventLocation.end.clone() : null;
4739
- fakeEvent.allDay = null; // force it to be freshly computed by normalizeEventDates
4740
- this.view.calendar.normalizeEventDates(fakeEvent);
4741
-
4742
- // this extra className will be useful for differentiating real events from mock events in CSS
4743
- fakeEvent.className = (fakeEvent.className || []).concat('fc-helper');
4744
-
4745
- // if something external is being dragged in, don't render a resizer
4746
- if (!sourceSeg) {
4747
- fakeEvent.editable = false;
4748
- }
4749
-
4750
- return fakeEvent;
4751
- },
4752
-
4753
-
4754
- // Renders a mock event. Given zoned event date properties.
4755
- // Must return all mock event elements.
4756
- renderHelper: function(eventLocation, sourceSeg) {
4757
- // subclasses must implement
4758
- },
4759
-
4760
-
4761
- // Unrenders a mock event
4762
- unrenderHelper: function() {
4763
- // subclasses must implement
4764
- },
4765
-
4766
-
4767
- /* Selection
4768
- ------------------------------------------------------------------------------------------------------------------*/
4769
-
4770
-
4771
- // Renders a visual indication of a selection. Will highlight by default but can be overridden by subclasses.
4772
- // Given a span (unzoned start/end and other misc data)
4773
- renderSelection: function(span) {
4774
- this.renderHighlight(span);
4775
- },
4776
-
4777
-
4778
- // Unrenders any visual indications of a selection. Will unrender a highlight by default.
4779
- unrenderSelection: function() {
4780
- this.unrenderHighlight();
4781
- },
4782
-
4783
-
4784
- // Given the first and last date-spans of a selection, returns another date-span object.
4785
- // Subclasses can override and provide additional data in the span object. Will be passed to renderSelection().
4786
- // Will return false if the selection is invalid and this should be indicated to the user.
4787
- // Will return null/undefined if a selection invalid but no error should be reported.
4788
- computeSelection: function(span0, span1) {
4789
- var span = this.computeSelectionSpan(span0, span1);
4790
-
4791
- if (span && !this.view.calendar.isSelectionSpanAllowed(span)) {
4792
- return false;
4793
- }
4794
-
4795
- return span;
4796
- },
4797
-
4798
-
4799
- // Given two spans, must return the combination of the two.
4800
- // TODO: do this separation of concerns (combining VS validation) for event dnd/resize too.
4801
- computeSelectionSpan: function(span0, span1) {
4802
- var dates = [ span0.start, span0.end, span1.start, span1.end ];
4803
-
4804
- dates.sort(compareNumbers); // sorts chronologically. works with Moments
4805
-
4806
- return { start: dates[0].clone(), end: dates[3].clone() };
4807
- },
4808
-
4809
-
4810
- /* Highlight
4811
- ------------------------------------------------------------------------------------------------------------------*/
4812
-
4813
-
4814
- // Renders an emphasis on the given date range. Given a span (unzoned start/end and other misc data)
4815
- renderHighlight: function(span) {
4816
- this.renderFill('highlight', this.spanToSegs(span));
4817
- },
4818
-
4819
-
4820
- // Unrenders the emphasis on a date range
4821
- unrenderHighlight: function() {
4822
- this.unrenderFill('highlight');
4823
- },
4824
-
4825
-
4826
- // Generates an array of classNames for rendering the highlight. Used by the fill system.
4827
- highlightSegClasses: function() {
4828
- return [ 'fc-highlight' ];
4829
- },
4830
-
4831
-
4832
- /* Business Hours
4833
- ------------------------------------------------------------------------------------------------------------------*/
4834
-
4835
-
4836
- renderBusinessHours: function() {
4837
- },
4838
-
4839
-
4840
- unrenderBusinessHours: function() {
4841
- },
4842
-
4843
-
4844
- /* Now Indicator
4845
- ------------------------------------------------------------------------------------------------------------------*/
4846
-
4847
-
4848
- getNowIndicatorUnit: function() {
4849
- },
4850
-
4851
-
4852
- renderNowIndicator: function(date) {
4853
- },
4854
-
4855
-
4856
- unrenderNowIndicator: function() {
4857
- },
4858
-
4859
-
4860
- /* Fill System (highlight, background events, business hours)
4861
- --------------------------------------------------------------------------------------------------------------------
4862
- TODO: remove this system. like we did in TimeGrid
4863
- */
4864
-
4865
-
4866
- // Renders a set of rectangles over the given segments of time.
4867
- // MUST RETURN a subset of segs, the segs that were actually rendered.
4868
- // Responsible for populating this.elsByFill. TODO: better API for expressing this requirement
4869
- renderFill: function(type, segs) {
4870
- // subclasses must implement
4871
- },
4872
-
4873
-
4874
- // Unrenders a specific type of fill that is currently rendered on the grid
4875
- unrenderFill: function(type) {
4876
- var el = this.elsByFill[type];
4877
-
4878
- if (el) {
4879
- el.remove();
4880
- delete this.elsByFill[type];
4881
- }
4882
- },
4883
-
4884
-
4885
- // Renders and assigns an `el` property for each fill segment. Generic enough to work with different types.
4886
- // Only returns segments that successfully rendered.
4887
- // To be harnessed by renderFill (implemented by subclasses).
4888
- // Analagous to renderFgSegEls.
4889
- renderFillSegEls: function(type, segs) {
4890
- var _this = this;
4891
- var segElMethod = this[type + 'SegEl'];
4892
- var html = '';
4893
- var renderedSegs = [];
4894
- var i;
4895
-
4896
- if (segs.length) {
4897
-
4898
- // build a large concatenation of segment HTML
4899
- for (i = 0; i < segs.length; i++) {
4900
- html += this.fillSegHtml(type, segs[i]);
4901
- }
4902
-
4903
- // Grab individual elements from the combined HTML string. Use each as the default rendering.
4904
- // Then, compute the 'el' for each segment.
4905
- $(html).each(function(i, node) {
4906
- var seg = segs[i];
4907
- var el = $(node);
4908
-
4909
- // allow custom filter methods per-type
4910
- if (segElMethod) {
4911
- el = segElMethod.call(_this, seg, el);
4912
- }
4913
-
4914
- if (el) { // custom filters did not cancel the render
4915
- el = $(el); // allow custom filter to return raw DOM node
4916
-
4917
- // correct element type? (would be bad if a non-TD were inserted into a table for example)
4918
- if (el.is(_this.fillSegTag)) {
4919
- seg.el = el;
4920
- renderedSegs.push(seg);
4921
- }
4922
- }
4923
- });
4924
- }
4925
-
4926
- return renderedSegs;
4927
- },
4928
-
4929
-
4930
- fillSegTag: 'div', // subclasses can override
4931
-
4932
-
4933
- // Builds the HTML needed for one fill segment. Generic enough to work with different types.
4934
- fillSegHtml: function(type, seg) {
4935
-
4936
- // custom hooks per-type
4937
- var classesMethod = this[type + 'SegClasses'];
4938
- var cssMethod = this[type + 'SegCss'];
4939
-
4940
- var classes = classesMethod ? classesMethod.call(this, seg) : [];
4941
- var css = cssToStr(cssMethod ? cssMethod.call(this, seg) : {});
4942
-
4943
- return '<' + this.fillSegTag +
4944
- (classes.length ? ' class="' + classes.join(' ') + '"' : '') +
4945
- (css ? ' style="' + css + '"' : '') +
4946
- ' />';
4947
- },
4948
-
4949
-
4950
-
4951
- /* Generic rendering utilities for subclasses
4952
- ------------------------------------------------------------------------------------------------------------------*/
4953
-
4954
-
4955
- // Computes HTML classNames for a single-day element
4956
- getDayClasses: function(date, noThemeHighlight) {
4957
- var view = this.view;
4958
- var classes = [];
4959
- var today;
4960
-
4961
- if (!isDateWithinRange(date, view.activeRange)) {
4962
- classes.push('fc-disabled-day'); // TODO: jQuery UI theme?
4963
- }
4964
- else {
4965
- classes.push('fc-' + dayIDs[date.day()]);
4966
-
4967
- if (
4968
- view.currentRangeAs('months') == 1 && // TODO: somehow get into MonthView
4969
- date.month() != view.currentRange.start.month()
4970
- ) {
4971
- classes.push('fc-other-month');
4972
- }
4973
-
4974
- today = view.calendar.getNow();
4975
-
4976
- if (date.isSame(today, 'day')) {
4977
- classes.push('fc-today');
4978
-
4979
- if (noThemeHighlight !== true) {
4980
- classes.push(view.highlightStateClass);
4981
- }
4982
- }
4983
- else if (date < today) {
4984
- classes.push('fc-past');
4985
- }
4986
- else {
4987
- classes.push('fc-future');
4988
- }
4989
- }
4990
-
4991
- return classes;
4992
- }
4993
-
4994
- });
4995
-
4996
- ;;
4997
-
4998
- /* Event-rendering and event-interaction methods for the abstract Grid class
4999
- ----------------------------------------------------------------------------------------------------------------------
5000
-
5001
- Data Types:
5002
- event - { title, id, start, (end), whatever }
5003
- location - { start, (end), allDay }
5004
- rawEventRange - { start, end }
5005
- eventRange - { start, end, isStart, isEnd }
5006
- eventSpan - { start, end, isStart, isEnd, whatever }
5007
- eventSeg - { event, whatever }
5008
- seg - { whatever }
5009
- */
5010
-
5011
- Grid.mixin({
5012
-
5013
- // self-config, overridable by subclasses
5014
- segSelector: '.fc-event-container > *', // what constitutes an event element?
5015
-
5016
- mousedOverSeg: null, // the segment object the user's mouse is over. null if over nothing
5017
- isDraggingSeg: false, // is a segment being dragged? boolean
5018
- isResizingSeg: false, // is a segment being resized? boolean
5019
- isDraggingExternal: false, // jqui-dragging an external element? boolean
5020
- segs: null, // the *event* segments currently rendered in the grid. TODO: rename to `eventSegs`
5021
-
5022
-
5023
- // Renders the given events onto the grid
5024
- renderEvents: function(events) {
5025
- var bgEvents = [];
5026
- var fgEvents = [];
5027
- var i;
5028
-
5029
- for (i = 0; i < events.length; i++) {
5030
- (isBgEvent(events[i]) ? bgEvents : fgEvents).push(events[i]);
5031
- }
5032
-
5033
- this.segs = [].concat( // record all segs
5034
- this.renderBgEvents(bgEvents),
5035
- this.renderFgEvents(fgEvents)
5036
- );
5037
- },
5038
-
5039
-
5040
- renderBgEvents: function(events) {
5041
- var segs = this.eventsToSegs(events);
5042
-
5043
- // renderBgSegs might return a subset of segs, segs that were actually rendered
5044
- return this.renderBgSegs(segs) || segs;
5045
- },
5046
-
5047
-
5048
- renderFgEvents: function(events) {
5049
- var segs = this.eventsToSegs(events);
5050
-
5051
- // renderFgSegs might return a subset of segs, segs that were actually rendered
5052
- return this.renderFgSegs(segs) || segs;
5053
- },
5054
-
5055
-
5056
- // Unrenders all events currently rendered on the grid
5057
- unrenderEvents: function() {
5058
- this.handleSegMouseout(); // trigger an eventMouseout if user's mouse is over an event
5059
- this.clearDragListeners();
5060
-
5061
- this.unrenderFgSegs();
5062
- this.unrenderBgSegs();
5063
-
5064
- this.segs = null;
5065
- },
5066
-
5067
-
5068
- // Retrieves all rendered segment objects currently rendered on the grid
5069
- getEventSegs: function() {
5070
- return this.segs || [];
5071
- },
5072
-
5073
-
5074
- /* Foreground Segment Rendering
5075
- ------------------------------------------------------------------------------------------------------------------*/
5076
-
5077
-
5078
- // Renders foreground event segments onto the grid. May return a subset of segs that were rendered.
5079
- renderFgSegs: function(segs) {
5080
- // subclasses must implement
5081
- },
5082
-
5083
-
5084
- // Unrenders all currently rendered foreground segments
5085
- unrenderFgSegs: function() {
5086
- // subclasses must implement
5087
- },
5088
-
5089
-
5090
- // Renders and assigns an `el` property for each foreground event segment.
5091
- // Only returns segments that successfully rendered.
5092
- // A utility that subclasses may use.
5093
- renderFgSegEls: function(segs, disableResizing) {
5094
- var view = this.view;
5095
- var html = '';
5096
- var renderedSegs = [];
5097
- var i;
5098
-
5099
- if (segs.length) { // don't build an empty html string
5100
-
5101
- // build a large concatenation of event segment HTML
5102
- for (i = 0; i < segs.length; i++) {
5103
- html += this.fgSegHtml(segs[i], disableResizing);
5104
- }
5105
-
5106
- // Grab individual elements from the combined HTML string. Use each as the default rendering.
5107
- // Then, compute the 'el' for each segment. An el might be null if the eventRender callback returned false.
5108
- $(html).each(function(i, node) {
5109
- var seg = segs[i];
5110
- var el = view.resolveEventEl(seg.event, $(node));
5111
-
5112
- if (el) {
5113
- el.data('fc-seg', seg); // used by handlers
5114
- seg.el = el;
5115
- renderedSegs.push(seg);
5116
- }
5117
- });
5118
- }
5119
-
5120
- return renderedSegs;
5121
- },
5122
-
5123
-
5124
- // Generates the HTML for the default rendering of a foreground event segment. Used by renderFgSegEls()
5125
- fgSegHtml: function(seg, disableResizing) {
5126
- // subclasses should implement
5127
- },
5128
-
5129
-
5130
- /* Background Segment Rendering
5131
- ------------------------------------------------------------------------------------------------------------------*/
5132
-
5133
-
5134
- // Renders the given background event segments onto the grid.
5135
- // Returns a subset of the segs that were actually rendered.
5136
- renderBgSegs: function(segs) {
5137
- return this.renderFill('bgEvent', segs);
5138
- },
5139
-
5140
-
5141
- // Unrenders all the currently rendered background event segments
5142
- unrenderBgSegs: function() {
5143
- this.unrenderFill('bgEvent');
5144
- },
5145
-
5146
-
5147
- // Renders a background event element, given the default rendering. Called by the fill system.
5148
- bgEventSegEl: function(seg, el) {
5149
- return this.view.resolveEventEl(seg.event, el); // will filter through eventRender
5150
- },
5151
-
5152
-
5153
- // Generates an array of classNames to be used for the default rendering of a background event.
5154
- // Called by fillSegHtml.
5155
- bgEventSegClasses: function(seg) {
5156
- var event = seg.event;
5157
- var source = event.source || {};
5158
-
5159
- return [ 'fc-bgevent' ].concat(
5160
- event.className,
5161
- source.className || []
5162
- );
5163
- },
5164
-
5165
-
5166
- // Generates a semicolon-separated CSS string to be used for the default rendering of a background event.
5167
- // Called by fillSegHtml.
5168
- bgEventSegCss: function(seg) {
5169
- return {
5170
- 'background-color': this.getSegSkinCss(seg)['background-color']
5171
- };
5172
- },
5173
-
5174
-
5175
- // Generates an array of classNames to be used for the rendering business hours overlay. Called by the fill system.
5176
- // Called by fillSegHtml.
5177
- businessHoursSegClasses: function(seg) {
5178
- return [ 'fc-nonbusiness', 'fc-bgevent' ];
5179
- },
5180
-
5181
-
5182
- /* Business Hours
5183
- ------------------------------------------------------------------------------------------------------------------*/
5184
-
5185
-
5186
- // Compute business hour segs for the grid's current date range.
5187
- // Caller must ask if whole-day business hours are needed.
5188
- // If no `businessHours` configuration value is specified, assumes the calendar default.
5189
- buildBusinessHourSegs: function(wholeDay, businessHours) {
5190
- return this.eventsToSegs(
5191
- this.buildBusinessHourEvents(wholeDay, businessHours)
5192
- );
5193
- },
5194
-
5195
-
5196
- // Compute business hour *events* for the grid's current date range.
5197
- // Caller must ask if whole-day business hours are needed.
5198
- // If no `businessHours` configuration value is specified, assumes the calendar default.
5199
- buildBusinessHourEvents: function(wholeDay, businessHours) {
5200
- var calendar = this.view.calendar;
5201
- var events;
5202
-
5203
- if (businessHours == null) {
5204
- // fallback
5205
- // access from calendawr. don't access from view. doesn't update with dynamic options.
5206
- businessHours = calendar.opt('businessHours');
5207
- }
5208
-
5209
- events = calendar.computeBusinessHourEvents(wholeDay, businessHours);
5210
-
5211
- // HACK. Eventually refactor business hours "events" system.
5212
- // If no events are given, but businessHours is activated, this means the entire visible range should be
5213
- // marked as *not* business-hours, via inverse-background rendering.
5214
- if (!events.length && businessHours) {
5215
- events = [
5216
- $.extend({}, BUSINESS_HOUR_EVENT_DEFAULTS, {
5217
- start: this.view.activeRange.end, // guaranteed out-of-range
5218
- end: this.view.activeRange.end, // "
5219
- dow: null
5220
- })
5221
- ];
5222
- }
5223
-
5224
- return events;
5225
- },
5226
-
5227
-
5228
- /* Handlers
5229
- ------------------------------------------------------------------------------------------------------------------*/
5230
-
5231
-
5232
- // Attaches event-element-related handlers for *all* rendered event segments of the view.
5233
- bindSegHandlers: function() {
5234
- this.bindSegHandlersToEl(this.el);
5235
- },
5236
-
5237
-
5238
- // Attaches event-element-related handlers to an arbitrary container element. leverages bubbling.
5239
- bindSegHandlersToEl: function(el) {
5240
- this.bindSegHandlerToEl(el, 'touchstart', this.handleSegTouchStart);
5241
- this.bindSegHandlerToEl(el, 'mouseenter', this.handleSegMouseover);
5242
- this.bindSegHandlerToEl(el, 'mouseleave', this.handleSegMouseout);
5243
- this.bindSegHandlerToEl(el, 'mousedown', this.handleSegMousedown);
5244
- this.bindSegHandlerToEl(el, 'click', this.handleSegClick);
5245
- },
5246
-
5247
-
5248
- // Executes a handler for any a user-interaction on a segment.
5249
- // Handler gets called with (seg, ev), and with the `this` context of the Grid
5250
- bindSegHandlerToEl: function(el, name, handler) {
5251
- var _this = this;
5252
-
5253
- el.on(name, this.segSelector, function(ev) {
5254
- var seg = $(this).data('fc-seg'); // grab segment data. put there by View::renderEvents
5255
-
5256
- // only call the handlers if there is not a drag/resize in progress
5257
- if (seg && !_this.isDraggingSeg && !_this.isResizingSeg) {
5258
- return handler.call(_this, seg, ev); // context will be the Grid
5259
- }
5260
- });
5261
- },
5262
-
5263
-
5264
- handleSegClick: function(seg, ev) {
5265
- var res = this.view.publiclyTrigger('eventClick', seg.el[0], seg.event, ev); // can return `false` to cancel
5266
- if (res === false) {
5267
- ev.preventDefault();
5268
- }
5269
- },
5270
-
5271
-
5272
- // Updates internal state and triggers handlers for when an event element is moused over
5273
- handleSegMouseover: function(seg, ev) {
5274
- if (
5275
- !GlobalEmitter.get().shouldIgnoreMouse() &&
5276
- !this.mousedOverSeg
5277
- ) {
5278
- this.mousedOverSeg = seg;
5279
- if (this.view.isEventResizable(seg.event)) {
5280
- seg.el.addClass('fc-allow-mouse-resize');
5281
- }
5282
- this.view.publiclyTrigger('eventMouseover', seg.el[0], seg.event, ev);
5283
- }
5284
- },
5285
-
5286
-
5287
- // Updates internal state and triggers handlers for when an event element is moused out.
5288
- // Can be given no arguments, in which case it will mouseout the segment that was previously moused over.
5289
- handleSegMouseout: function(seg, ev) {
5290
- ev = ev || {}; // if given no args, make a mock mouse event
5291
-
5292
- if (this.mousedOverSeg) {
5293
- seg = seg || this.mousedOverSeg; // if given no args, use the currently moused-over segment
5294
- this.mousedOverSeg = null;
5295
- if (this.view.isEventResizable(seg.event)) {
5296
- seg.el.removeClass('fc-allow-mouse-resize');
5297
- }
5298
- this.view.publiclyTrigger('eventMouseout', seg.el[0], seg.event, ev);
5299
- }
5300
- },
5301
-
5302
-
5303
- handleSegMousedown: function(seg, ev) {
5304
- var isResizing = this.startSegResize(seg, ev, { distance: 5 });
5305
-
5306
- if (!isResizing && this.view.isEventDraggable(seg.event)) {
5307
- this.buildSegDragListener(seg)
5308
- .startInteraction(ev, {
5309
- distance: 5
5310
- });
5311
- }
5312
- },
5313
-
5314
-
5315
- handleSegTouchStart: function(seg, ev) {
5316
- var view = this.view;
5317
- var event = seg.event;
5318
- var isSelected = view.isEventSelected(event);
5319
- var isDraggable = view.isEventDraggable(event);
5320
- var isResizable = view.isEventResizable(event);
5321
- var isResizing = false;
5322
- var dragListener;
5323
- var eventLongPressDelay;
5324
-
5325
- if (isSelected && isResizable) {
5326
- // only allow resizing of the event is selected
5327
- isResizing = this.startSegResize(seg, ev);
5328
- }
5329
-
5330
- if (!isResizing && (isDraggable || isResizable)) { // allowed to be selected?
5331
-
5332
- eventLongPressDelay = view.opt('eventLongPressDelay');
5333
- if (eventLongPressDelay == null) {
5334
- eventLongPressDelay = view.opt('longPressDelay'); // fallback
5335
- }
5336
-
5337
- dragListener = isDraggable ?
5338
- this.buildSegDragListener(seg) :
5339
- this.buildSegSelectListener(seg); // seg isn't draggable, but still needs to be selected
5340
-
5341
- dragListener.startInteraction(ev, { // won't start if already started
5342
- delay: isSelected ? 0 : eventLongPressDelay // do delay if not already selected
5343
- });
5344
- }
5345
- },
5346
-
5347
-
5348
- // returns boolean whether resizing actually started or not.
5349
- // assumes the seg allows resizing.
5350
- // `dragOptions` are optional.
5351
- startSegResize: function(seg, ev, dragOptions) {
5352
- if ($(ev.target).is('.fc-resizer')) {
5353
- this.buildSegResizeListener(seg, $(ev.target).is('.fc-start-resizer'))
5354
- .startInteraction(ev, dragOptions);
5355
- return true;
5356
- }
5357
- return false;
5358
- },
5359
-
5360
-
5361
-
5362
- /* Event Dragging
5363
- ------------------------------------------------------------------------------------------------------------------*/
5364
-
5365
-
5366
- // Builds a listener that will track user-dragging on an event segment.
5367
- // Generic enough to work with any type of Grid.
5368
- // Has side effect of setting/unsetting `segDragListener`
5369
- buildSegDragListener: function(seg) {
5370
- var _this = this;
5371
- var view = this.view;
5372
- var el = seg.el;
5373
- var event = seg.event;
5374
- var isDragging;
5375
- var mouseFollower; // A clone of the original element that will move with the mouse
5376
- var dropLocation; // zoned event date properties
5377
-
5378
- if (this.segDragListener) {
5379
- return this.segDragListener;
5380
- }
5381
-
5382
- // Tracks mouse movement over the *view's* coordinate map. Allows dragging and dropping between subcomponents
5383
- // of the view.
5384
- var dragListener = this.segDragListener = new HitDragListener(view, {
5385
- scroll: view.opt('dragScroll'),
5386
- subjectEl: el,
5387
- subjectCenter: true,
5388
- interactionStart: function(ev) {
5389
- seg.component = _this; // for renderDrag
5390
- isDragging = false;
5391
- mouseFollower = new MouseFollower(seg.el, {
5392
- additionalClass: 'fc-dragging',
5393
- parentEl: view.el,
5394
- opacity: dragListener.isTouch ? null : view.opt('dragOpacity'),
5395
- revertDuration: view.opt('dragRevertDuration'),
5396
- zIndex: 2 // one above the .fc-view
5397
- });
5398
- mouseFollower.hide(); // don't show until we know this is a real drag
5399
- mouseFollower.start(ev);
5400
- },
5401
- dragStart: function(ev) {
5402
- if (dragListener.isTouch && !view.isEventSelected(event)) {
5403
- // if not previously selected, will fire after a delay. then, select the event
5404
- view.selectEvent(event);
5405
- }
5406
- isDragging = true;
5407
- _this.handleSegMouseout(seg, ev); // ensure a mouseout on the manipulated event has been reported
5408
- _this.segDragStart(seg, ev);
5409
- view.hideEvent(event); // hide all event segments. our mouseFollower will take over
5410
- },
5411
- hitOver: function(hit, isOrig, origHit) {
5412
- var isAllowed = true;
5413
- var origHitSpan;
5414
- var hitSpan;
5415
- var dragHelperEls;
5416
-
5417
- // starting hit could be forced (DayGrid.limit)
5418
- if (seg.hit) {
5419
- origHit = seg.hit;
5420
- }
5421
-
5422
- // hit might not belong to this grid, so query origin grid
5423
- origHitSpan = origHit.component.getSafeHitSpan(origHit);
5424
- hitSpan = hit.component.getSafeHitSpan(hit);
5425
-
5426
- if (origHitSpan && hitSpan) {
5427
- dropLocation = _this.computeEventDrop(origHitSpan, hitSpan, event);
5428
- isAllowed = dropLocation && _this.isEventLocationAllowed(dropLocation, event);
5429
- }
5430
- else {
5431
- isAllowed = false;
5432
- }
5433
-
5434
- if (!isAllowed) {
5435
- dropLocation = null;
5436
- disableCursor();
5437
- }
5438
-
5439
- // if a valid drop location, have the subclass render a visual indication
5440
- if (dropLocation && (dragHelperEls = view.renderDrag(dropLocation, seg))) {
5441
-
5442
- dragHelperEls.addClass('fc-dragging');
5443
- if (!dragListener.isTouch) {
5444
- _this.applyDragOpacity(dragHelperEls);
5445
- }
5446
-
5447
- mouseFollower.hide(); // if the subclass is already using a mock event "helper", hide our own
5448
- }
5449
- else {
5450
- mouseFollower.show(); // otherwise, have the helper follow the mouse (no snapping)
5451
- }
5452
-
5453
- if (isOrig) {
5454
- dropLocation = null; // needs to have moved hits to be a valid drop
5455
- }
5456
- },
5457
- hitOut: function() { // called before mouse moves to a different hit OR moved out of all hits
5458
- view.unrenderDrag(); // unrender whatever was done in renderDrag
5459
- mouseFollower.show(); // show in case we are moving out of all hits
5460
- dropLocation = null;
5461
- },
5462
- hitDone: function() { // Called after a hitOut OR before a dragEnd
5463
- enableCursor();
5464
- },
5465
- interactionEnd: function(ev) {
5466
- delete seg.component; // prevent side effects
5467
-
5468
- // do revert animation if hasn't changed. calls a callback when finished (whether animation or not)
5469
- mouseFollower.stop(!dropLocation, function() {
5470
- if (isDragging) {
5471
- view.unrenderDrag();
5472
- _this.segDragStop(seg, ev);
5473
- }
5474
-
5475
- if (dropLocation) {
5476
- // no need to re-show original, will rerender all anyways. esp important if eventRenderWait
5477
- view.reportSegDrop(seg, dropLocation, _this.largeUnit, el, ev);
5478
- }
5479
- else {
5480
- view.showEvent(event);
5481
- }
5482
- });
5483
- _this.segDragListener = null;
5484
- }
5485
- });
5486
-
5487
- return dragListener;
5488
- },
5489
-
5490
-
5491
- // seg isn't draggable, but let's use a generic DragListener
5492
- // simply for the delay, so it can be selected.
5493
- // Has side effect of setting/unsetting `segDragListener`
5494
- buildSegSelectListener: function(seg) {
5495
- var _this = this;
5496
- var view = this.view;
5497
- var event = seg.event;
5498
-
5499
- if (this.segDragListener) {
5500
- return this.segDragListener;
5501
- }
5502
-
5503
- var dragListener = this.segDragListener = new DragListener({
5504
- dragStart: function(ev) {
5505
- if (dragListener.isTouch && !view.isEventSelected(event)) {
5506
- // if not previously selected, will fire after a delay. then, select the event
5507
- view.selectEvent(event);
5508
- }
5509
- },
5510
- interactionEnd: function(ev) {
5511
- _this.segDragListener = null;
5512
- }
5513
- });
5514
-
5515
- return dragListener;
5516
- },
5517
-
5518
-
5519
- // Called before event segment dragging starts
5520
- segDragStart: function(seg, ev) {
5521
- this.isDraggingSeg = true;
5522
- this.view.publiclyTrigger('eventDragStart', seg.el[0], seg.event, ev, {}); // last argument is jqui dummy
5523
- },
5524
-
5525
-
5526
- // Called after event segment dragging stops
5527
- segDragStop: function(seg, ev) {
5528
- this.isDraggingSeg = false;
5529
- this.view.publiclyTrigger('eventDragStop', seg.el[0], seg.event, ev, {}); // last argument is jqui dummy
5530
- },
5531
-
5532
-
5533
- // Given the spans an event drag began, and the span event was dropped, calculates the new zoned start/end/allDay
5534
- // values for the event. Subclasses may override and set additional properties to be used by renderDrag.
5535
- // A falsy returned value indicates an invalid drop.
5536
- // DOES NOT consider overlap/constraint.
5537
- computeEventDrop: function(startSpan, endSpan, event) {
5538
- var calendar = this.view.calendar;
5539
- var dragStart = startSpan.start;
5540
- var dragEnd = endSpan.start;
5541
- var delta;
5542
- var dropLocation; // zoned event date properties
5543
-
5544
- if (dragStart.hasTime() === dragEnd.hasTime()) {
5545
- delta = this.diffDates(dragEnd, dragStart);
5546
-
5547
- // if an all-day event was in a timed area and it was dragged to a different time,
5548
- // guarantee an end and adjust start/end to have times
5549
- if (event.allDay && durationHasTime(delta)) {
5550
- dropLocation = {
5551
- start: event.start.clone(),
5552
- end: calendar.getEventEnd(event), // will be an ambig day
5553
- allDay: false // for normalizeEventTimes
5554
- };
5555
- calendar.normalizeEventTimes(dropLocation);
5556
- }
5557
- // othewise, work off existing values
5558
- else {
5559
- dropLocation = pluckEventDateProps(event);
5560
- }
5561
-
5562
- dropLocation.start.add(delta);
5563
- if (dropLocation.end) {
5564
- dropLocation.end.add(delta);
5565
- }
5566
- }
5567
- else {
5568
- // if switching from day <-> timed, start should be reset to the dropped date, and the end cleared
5569
- dropLocation = {
5570
- start: dragEnd.clone(),
5571
- end: null, // end should be cleared
5572
- allDay: !dragEnd.hasTime()
5573
- };
5574
- }
5575
-
5576
- return dropLocation;
5577
- },
5578
-
5579
-
5580
- // Utility for apply dragOpacity to a jQuery set
5581
- applyDragOpacity: function(els) {
5582
- var opacity = this.view.opt('dragOpacity');
5583
-
5584
- if (opacity != null) {
5585
- els.css('opacity', opacity);
5586
- }
5587
- },
5588
-
5589
-
5590
- /* External Element Dragging
5591
- ------------------------------------------------------------------------------------------------------------------*/
5592
-
5593
-
5594
- // Called when a jQuery UI drag is initiated anywhere in the DOM
5595
- externalDragStart: function(ev, ui) {
5596
- var view = this.view;
5597
- var el;
5598
- var accept;
5599
-
5600
- if (view.opt('droppable')) { // only listen if this setting is on
5601
- el = $((ui ? ui.item : null) || ev.target);
5602
-
5603
- // Test that the dragged element passes the dropAccept selector or filter function.
5604
- // FYI, the default is "*" (matches all)
5605
- accept = view.opt('dropAccept');
5606
- if ($.isFunction(accept) ? accept.call(el[0], el) : el.is(accept)) {
5607
- if (!this.isDraggingExternal) { // prevent double-listening if fired twice
5608
- this.listenToExternalDrag(el, ev, ui);
5609
- }
5610
- }
5611
- }
5612
- },
5613
-
5614
-
5615
- // Called when a jQuery UI drag starts and it needs to be monitored for dropping
5616
- listenToExternalDrag: function(el, ev, ui) {
5617
- var _this = this;
5618
- var view = this.view;
5619
- var meta = getDraggedElMeta(el); // extra data about event drop, including possible event to create
5620
- var dropLocation; // a null value signals an unsuccessful drag
5621
-
5622
- // listener that tracks mouse movement over date-associated pixel regions
5623
- var dragListener = _this.externalDragListener = new HitDragListener(this, {
5624
- interactionStart: function() {
5625
- _this.isDraggingExternal = true;
5626
- },
5627
- hitOver: function(hit) {
5628
- var isAllowed = true;
5629
- var hitSpan = hit.component.getSafeHitSpan(hit); // hit might not belong to this grid
5630
-
5631
- if (hitSpan) {
5632
- dropLocation = _this.computeExternalDrop(hitSpan, meta);
5633
- isAllowed = dropLocation && _this.isExternalLocationAllowed(dropLocation, meta.eventProps);
5634
- }
5635
- else {
5636
- isAllowed = false;
5637
- }
5638
-
5639
- if (!isAllowed) {
5640
- dropLocation = null;
5641
- disableCursor();
5642
- }
5643
-
5644
- if (dropLocation) {
5645
- _this.renderDrag(dropLocation); // called without a seg parameter
5646
- }
5647
- },
5648
- hitOut: function() {
5649
- dropLocation = null; // signal unsuccessful
5650
- },
5651
- hitDone: function() { // Called after a hitOut OR before a dragEnd
5652
- enableCursor();
5653
- _this.unrenderDrag();
5654
- },
5655
- interactionEnd: function(ev) {
5656
- if (dropLocation) { // element was dropped on a valid hit
5657
- view.reportExternalDrop(meta, dropLocation, el, ev, ui);
5658
- }
5659
- _this.isDraggingExternal = false;
5660
- _this.externalDragListener = null;
5661
- }
5662
- });
5663
-
5664
- dragListener.startDrag(ev); // start listening immediately
5665
- },
5666
-
5667
-
5668
- // Given a hit to be dropped upon, and misc data associated with the jqui drag (guaranteed to be a plain object),
5669
- // returns the zoned start/end dates for the event that would result from the hypothetical drop. end might be null.
5670
- // Returning a null value signals an invalid drop hit.
5671
- // DOES NOT consider overlap/constraint.
5672
- computeExternalDrop: function(span, meta) {
5673
- var calendar = this.view.calendar;
5674
- var dropLocation = {
5675
- start: calendar.applyTimezone(span.start), // simulate a zoned event start date
5676
- end: null
5677
- };
5678
-
5679
- // if dropped on an all-day span, and element's metadata specified a time, set it
5680
- if (meta.startTime && !dropLocation.start.hasTime()) {
5681
- dropLocation.start.time(meta.startTime);
5682
- }
5683
-
5684
- if (meta.duration) {
5685
- dropLocation.end = dropLocation.start.clone().add(meta.duration);
5686
- }
5687
-
5688
- return dropLocation;
5689
- },
5690
-
5691
-
5692
-
5693
- /* Drag Rendering (for both events and an external elements)
5694
- ------------------------------------------------------------------------------------------------------------------*/
5695
-
5696
-
5697
- // Renders a visual indication of an event or external element being dragged.
5698
- // `dropLocation` contains hypothetical start/end/allDay values the event would have if dropped. end can be null.
5699
- // `seg` is the internal segment object that is being dragged. If dragging an external element, `seg` is null.
5700
- // A truthy returned value indicates this method has rendered a helper element.
5701
- // Must return elements used for any mock events.
5702
- renderDrag: function(dropLocation, seg) {
5703
- // subclasses must implement
5704
- },
5705
-
5706
-
5707
- // Unrenders a visual indication of an event or external element being dragged
5708
- unrenderDrag: function() {
5709
- // subclasses must implement
5710
- },
5711
-
5712
-
5713
- /* Resizing
5714
- ------------------------------------------------------------------------------------------------------------------*/
5715
-
5716
-
5717
- // Creates a listener that tracks the user as they resize an event segment.
5718
- // Generic enough to work with any type of Grid.
5719
- buildSegResizeListener: function(seg, isStart) {
5720
- var _this = this;
5721
- var view = this.view;
5722
- var calendar = view.calendar;
5723
- var el = seg.el;
5724
- var event = seg.event;
5725
- var eventEnd = calendar.getEventEnd(event);
5726
- var isDragging;
5727
- var resizeLocation; // zoned event date properties. falsy if invalid resize
5728
-
5729
- // Tracks mouse movement over the *grid's* coordinate map
5730
- var dragListener = this.segResizeListener = new HitDragListener(this, {
5731
- scroll: view.opt('dragScroll'),
5732
- subjectEl: el,
5733
- interactionStart: function() {
5734
- isDragging = false;
5735
- },
5736
- dragStart: function(ev) {
5737
- isDragging = true;
5738
- _this.handleSegMouseout(seg, ev); // ensure a mouseout on the manipulated event has been reported
5739
- _this.segResizeStart(seg, ev);
5740
- },
5741
- hitOver: function(hit, isOrig, origHit) {
5742
- var isAllowed = true;
5743
- var origHitSpan = _this.getSafeHitSpan(origHit);
5744
- var hitSpan = _this.getSafeHitSpan(hit);
5745
-
5746
- if (origHitSpan && hitSpan) {
5747
- resizeLocation = isStart ?
5748
- _this.computeEventStartResize(origHitSpan, hitSpan, event) :
5749
- _this.computeEventEndResize(origHitSpan, hitSpan, event);
5750
-
5751
- isAllowed = resizeLocation && _this.isEventLocationAllowed(resizeLocation, event);
5752
- }
5753
- else {
5754
- isAllowed = false;
5755
- }
5756
-
5757
- if (!isAllowed) {
5758
- resizeLocation = null;
5759
- disableCursor();
5760
- }
5761
- else {
5762
- if (
5763
- resizeLocation.start.isSame(event.start.clone().stripZone()) &&
5764
- resizeLocation.end.isSame(eventEnd.clone().stripZone())
5765
- ) {
5766
- // no change. (FYI, event dates might have zones)
5767
- resizeLocation = null;
5768
- }
5769
- }
5770
-
5771
- if (resizeLocation) {
5772
- view.hideEvent(event);
5773
- _this.renderEventResize(resizeLocation, seg);
5774
- }
5775
- },
5776
- hitOut: function() { // called before mouse moves to a different hit OR moved out of all hits
5777
- resizeLocation = null;
5778
- view.showEvent(event); // for when out-of-bounds. show original
5779
- },
5780
- hitDone: function() { // resets the rendering to show the original event
5781
- _this.unrenderEventResize();
5782
- enableCursor();
5783
- },
5784
- interactionEnd: function(ev) {
5785
- if (isDragging) {
5786
- _this.segResizeStop(seg, ev);
5787
- }
5788
-
5789
- if (resizeLocation) { // valid date to resize to?
5790
- // no need to re-show original, will rerender all anyways. esp important if eventRenderWait
5791
- view.reportSegResize(seg, resizeLocation, _this.largeUnit, el, ev);
5792
- }
5793
- else {
5794
- view.showEvent(event);
5795
- }
5796
- _this.segResizeListener = null;
5797
- }
5798
- });
5799
-
5800
- return dragListener;
5801
- },
5802
-
5803
-
5804
- // Called before event segment resizing starts
5805
- segResizeStart: function(seg, ev) {
5806
- this.isResizingSeg = true;
5807
- this.view.publiclyTrigger('eventResizeStart', seg.el[0], seg.event, ev, {}); // last argument is jqui dummy
5808
- },
5809
-
5810
-
5811
- // Called after event segment resizing stops
5812
- segResizeStop: function(seg, ev) {
5813
- this.isResizingSeg = false;
5814
- this.view.publiclyTrigger('eventResizeStop', seg.el[0], seg.event, ev, {}); // last argument is jqui dummy
5815
- },
5816
-
5817
-
5818
- // Returns new date-information for an event segment being resized from its start
5819
- computeEventStartResize: function(startSpan, endSpan, event) {
5820
- return this.computeEventResize('start', startSpan, endSpan, event);
5821
- },
5822
-
5823
-
5824
- // Returns new date-information for an event segment being resized from its end
5825
- computeEventEndResize: function(startSpan, endSpan, event) {
5826
- return this.computeEventResize('end', startSpan, endSpan, event);
5827
- },
5828
-
5829
-
5830
- // Returns new zoned date information for an event segment being resized from its start OR end
5831
- // `type` is either 'start' or 'end'.
5832
- // DOES NOT consider overlap/constraint.
5833
- computeEventResize: function(type, startSpan, endSpan, event) {
5834
- var calendar = this.view.calendar;
5835
- var delta = this.diffDates(endSpan[type], startSpan[type]);
5836
- var resizeLocation; // zoned event date properties
5837
- var defaultDuration;
5838
-
5839
- // build original values to work from, guaranteeing a start and end
5840
- resizeLocation = {
5841
- start: event.start.clone(),
5842
- end: calendar.getEventEnd(event),
5843
- allDay: event.allDay
5844
- };
5845
-
5846
- // if an all-day event was in a timed area and was resized to a time, adjust start/end to have times
5847
- if (resizeLocation.allDay && durationHasTime(delta)) {
5848
- resizeLocation.allDay = false;
5849
- calendar.normalizeEventTimes(resizeLocation);
5850
- }
5851
-
5852
- resizeLocation[type].add(delta); // apply delta to start or end
5853
-
5854
- // if the event was compressed too small, find a new reasonable duration for it
5855
- if (!resizeLocation.start.isBefore(resizeLocation.end)) {
5856
-
5857
- defaultDuration =
5858
- this.minResizeDuration || // TODO: hack
5859
- (event.allDay ?
5860
- calendar.defaultAllDayEventDuration :
5861
- calendar.defaultTimedEventDuration);
5862
-
5863
- if (type == 'start') { // resizing the start?
5864
- resizeLocation.start = resizeLocation.end.clone().subtract(defaultDuration);
5865
- }
5866
- else { // resizing the end?
5867
- resizeLocation.end = resizeLocation.start.clone().add(defaultDuration);
5868
- }
5869
- }
5870
-
5871
- return resizeLocation;
5872
- },
5873
-
5874
-
5875
- // Renders a visual indication of an event being resized.
5876
- // `range` has the updated dates of the event. `seg` is the original segment object involved in the drag.
5877
- // Must return elements used for any mock events.
5878
- renderEventResize: function(range, seg) {
5879
- // subclasses must implement
5880
- },
5881
-
5882
-
5883
- // Unrenders a visual indication of an event being resized.
5884
- unrenderEventResize: function() {
5885
- // subclasses must implement
5886
- },
5887
-
5888
-
5889
- /* Rendering Utils
5890
- ------------------------------------------------------------------------------------------------------------------*/
5891
-
5892
-
5893
- // Compute the text that should be displayed on an event's element.
5894
- // `range` can be the Event object itself, or something range-like, with at least a `start`.
5895
- // If event times are disabled, or the event has no time, will return a blank string.
5896
- // If not specified, formatStr will default to the eventTimeFormat setting,
5897
- // and displayEnd will default to the displayEventEnd setting.
5898
- getEventTimeText: function(range, formatStr, displayEnd) {
5899
-
5900
- if (formatStr == null) {
5901
- formatStr = this.eventTimeFormat;
5902
- }
5903
-
5904
- if (displayEnd == null) {
5905
- displayEnd = this.displayEventEnd;
5906
- }
5907
-
5908
- if (this.displayEventTime && range.start.hasTime()) {
5909
- if (displayEnd && range.end) {
5910
- return this.view.formatRange(range, formatStr);
5911
- }
5912
- else {
5913
- return range.start.format(formatStr);
5914
- }
5915
- }
5916
-
5917
- return '';
5918
- },
5919
-
5920
-
5921
- // Generic utility for generating the HTML classNames for an event segment's element
5922
- getSegClasses: function(seg, isDraggable, isResizable) {
5923
- var view = this.view;
5924
- var classes = [
5925
- 'fc-event',
5926
- seg.isStart ? 'fc-start' : 'fc-not-start',
5927
- seg.isEnd ? 'fc-end' : 'fc-not-end'
5928
- ].concat(this.getSegCustomClasses(seg));
5929
-
5930
- if (isDraggable) {
5931
- classes.push('fc-draggable');
5932
- }
5933
- if (isResizable) {
5934
- classes.push('fc-resizable');
5935
- }
5936
-
5937
- // event is currently selected? attach a className.
5938
- if (view.isEventSelected(seg.event)) {
5939
- classes.push('fc-selected');
5940
- }
5941
-
5942
- return classes;
5943
- },
5944
-
5945
-
5946
- // List of classes that were defined by the caller of the API in some way
5947
- getSegCustomClasses: function(seg) {
5948
- var event = seg.event;
5949
-
5950
- return [].concat(
5951
- event.className, // guaranteed to be an array
5952
- event.source ? event.source.className : []
5953
- );
5954
- },
5955
-
5956
-
5957
- // Utility for generating event skin-related CSS properties
5958
- getSegSkinCss: function(seg) {
5959
- return {
5960
- 'background-color': this.getSegBackgroundColor(seg),
5961
- 'border-color': this.getSegBorderColor(seg),
5962
- color: this.getSegTextColor(seg)
5963
- };
5964
- },
5965
-
5966
-
5967
- // Queries for caller-specified color, then falls back to default
5968
- getSegBackgroundColor: function(seg) {
5969
- return seg.event.backgroundColor ||
5970
- seg.event.color ||
5971
- this.getSegDefaultBackgroundColor(seg);
5972
- },
5973
-
5974
-
5975
- getSegDefaultBackgroundColor: function(seg) {
5976
- var source = seg.event.source || {};
5977
-
5978
- return source.backgroundColor ||
5979
- source.color ||
5980
- this.view.opt('eventBackgroundColor') ||
5981
- this.view.opt('eventColor');
5982
- },
5983
-
5984
-
5985
- // Queries for caller-specified color, then falls back to default
5986
- getSegBorderColor: function(seg) {
5987
- return seg.event.borderColor ||
5988
- seg.event.color ||
5989
- this.getSegDefaultBorderColor(seg);
5990
- },
5991
-
5992
-
5993
- getSegDefaultBorderColor: function(seg) {
5994
- var source = seg.event.source || {};
5995
-
5996
- return source.borderColor ||
5997
- source.color ||
5998
- this.view.opt('eventBorderColor') ||
5999
- this.view.opt('eventColor');
6000
- },
6001
-
6002
-
6003
- // Queries for caller-specified color, then falls back to default
6004
- getSegTextColor: function(seg) {
6005
- return seg.event.textColor ||
6006
- this.getSegDefaultTextColor(seg);
6007
- },
6008
-
6009
-
6010
- getSegDefaultTextColor: function(seg) {
6011
- var source = seg.event.source || {};
6012
-
6013
- return source.textColor ||
6014
- this.view.opt('eventTextColor');
6015
- },
6016
-
6017
-
6018
- /* Event Location Validation
6019
- ------------------------------------------------------------------------------------------------------------------*/
6020
-
6021
-
6022
- isEventLocationAllowed: function(eventLocation, event) {
6023
- if (this.isEventLocationInRange(eventLocation)) {
6024
- var calendar = this.view.calendar;
6025
- var eventSpans = this.eventToSpans(eventLocation);
6026
- var i;
6027
-
6028
- if (eventSpans.length) {
6029
- for (i = 0; i < eventSpans.length; i++) {
6030
- if (!calendar.isEventSpanAllowed(eventSpans[i], event)) {
6031
- return false;
6032
- }
6033
- }
6034
-
6035
- return true;
6036
- }
6037
- }
6038
-
6039
- return false;
6040
- },
6041
-
6042
-
6043
- isExternalLocationAllowed: function(eventLocation, metaProps) { // FOR the external element
6044
- if (this.isEventLocationInRange(eventLocation)) {
6045
- var calendar = this.view.calendar;
6046
- var eventSpans = this.eventToSpans(eventLocation);
6047
- var i;
6048
-
6049
- if (eventSpans.length) {
6050
- for (i = 0; i < eventSpans.length; i++) {
6051
- if (!calendar.isExternalSpanAllowed(eventSpans[i], eventLocation, metaProps)) {
6052
- return false;
6053
- }
6054
- }
6055
-
6056
- return true;
6057
- }
6058
- }
6059
-
6060
- return false;
6061
- },
6062
-
6063
-
6064
- isEventLocationInRange: function(eventLocation) {
6065
- return isRangeWithinRange(
6066
- this.eventToRawRange(eventLocation),
6067
- this.view.validRange
6068
- );
6069
- },
6070
-
6071
-
6072
- /* Converting events -> eventRange -> eventSpan -> eventSegs
6073
- ------------------------------------------------------------------------------------------------------------------*/
6074
-
6075
-
6076
- // Generates an array of segments for the given single event
6077
- // Can accept an event "location" as well (which only has start/end and no allDay)
6078
- eventToSegs: function(event) {
6079
- return this.eventsToSegs([ event ]);
6080
- },
6081
-
6082
-
6083
- // Generates spans (always unzoned) for the given event.
6084
- // Does not do any inverting for inverse-background events.
6085
- // Can accept an event "location" as well (which only has start/end and no allDay)
6086
- eventToSpans: function(event) {
6087
- var eventRange = this.eventToRange(event); // { start, end, isStart, isEnd }
6088
-
6089
- if (eventRange) {
6090
- return this.eventRangeToSpans(eventRange, event);
6091
- }
6092
- else { // out of view's valid range
6093
- return [];
6094
- }
6095
- },
6096
-
6097
-
6098
-
6099
- // Converts an array of event objects into an array of event segment objects.
6100
- // A custom `segSliceFunc` may be given for arbitrarily slicing up events.
6101
- // Doesn't guarantee an order for the resulting array.
6102
- eventsToSegs: function(allEvents, segSliceFunc) {
6103
- var _this = this;
6104
- var eventsById = groupEventsById(allEvents);
6105
- var segs = [];
6106
-
6107
- $.each(eventsById, function(id, events) {
6108
- var visibleEvents = [];
6109
- var eventRanges = [];
6110
- var eventRange; // { start, end, isStart, isEnd }
6111
- var i;
6112
-
6113
- for (i = 0; i < events.length; i++) {
6114
- eventRange = _this.eventToRange(events[i]); // might be null if completely out of range
6115
-
6116
- if (eventRange) {
6117
- eventRanges.push(eventRange);
6118
- visibleEvents.push(events[i]);
6119
- }
6120
- }
6121
-
6122
- // inverse-background events (utilize only the first event in calculations)
6123
- if (isInverseBgEvent(events[0])) {
6124
- eventRanges = _this.invertRanges(eventRanges); // will lose isStart/isEnd
6125
-
6126
- for (i = 0; i < eventRanges.length; i++) {
6127
- segs.push.apply(segs, // append to
6128
- _this.eventRangeToSegs(eventRanges[i], events[0], segSliceFunc)
6129
- );
6130
- }
6131
- }
6132
- // normal event ranges
6133
- else {
6134
- for (i = 0; i < eventRanges.length; i++) {
6135
- segs.push.apply(segs, // append to
6136
- _this.eventRangeToSegs(eventRanges[i], visibleEvents[i], segSliceFunc)
6137
- );
6138
- }
6139
- }
6140
- });
6141
-
6142
- return segs;
6143
- },
6144
-
6145
-
6146
- // Generates the unzoned start/end dates an event appears to occupy
6147
- // Can accept an event "location" as well (which only has start/end and no allDay)
6148
- // returns { start, end, isStart, isEnd }
6149
- // If the event is completely outside of the grid's valid range, will return undefined.
6150
- eventToRange: function(event) {
6151
- return this.refineRawEventRange(
6152
- this.eventToRawRange(event)
6153
- );
6154
- },
6155
-
6156
-
6157
- // Ensures the given range is within the view's activeRange and is correctly localized.
6158
- // Always returns a result
6159
- refineRawEventRange: function(rawRange) {
6160
- var view = this.view;
6161
- var calendar = view.calendar;
6162
- var range = intersectRanges(rawRange, view.activeRange);
6163
-
6164
- if (range) { // otherwise, event doesn't have valid range
6165
-
6166
- // hack: dynamic locale change forgets to upate stored event localed
6167
- calendar.localizeMoment(range.start);
6168
- calendar.localizeMoment(range.end);
6169
-
6170
- return range;
6171
- }
6172
- },
6173
-
6174
-
6175
- // not constrained to valid dates
6176
- // not given localizeMoment hack
6177
- eventToRawRange: function(event) {
6178
- var calendar = this.view.calendar;
6179
- var start = event.start.clone().stripZone();
6180
- var end = (
6181
- event.end ?
6182
- event.end.clone() :
6183
- // derive the end from the start and allDay. compute allDay if necessary
6184
- calendar.getDefaultEventEnd(
6185
- event.allDay != null ?
6186
- event.allDay :
6187
- !event.start.hasTime(),
6188
- event.start
6189
- )
6190
- ).stripZone();
6191
-
6192
- return { start: start, end: end };
6193
- },
6194
-
6195
-
6196
- // Given an event's range (unzoned start/end), and the event itself,
6197
- // slice into segments (using the segSliceFunc function if specified)
6198
- // eventRange - { start, end, isStart, isEnd }
6199
- eventRangeToSegs: function(eventRange, event, segSliceFunc) {
6200
- var eventSpans = this.eventRangeToSpans(eventRange, event);
6201
- var segs = [];
6202
- var i;
6203
-
6204
- for (i = 0; i < eventSpans.length; i++) {
6205
- segs.push.apply(segs, // append to
6206
- this.eventSpanToSegs(eventSpans[i], event, segSliceFunc)
6207
- );
6208
- }
6209
-
6210
- return segs;
6211
- },
6212
-
6213
-
6214
- // Given an event's unzoned date range, return an array of eventSpan objects.
6215
- // eventSpan - { start, end, isStart, isEnd, otherthings... }
6216
- // Subclasses can override.
6217
- // Subclasses are obligated to forward eventRange.isStart/isEnd to the resulting spans.
6218
- eventRangeToSpans: function(eventRange, event) {
6219
- return [ $.extend({}, eventRange) ]; // copy into a single-item array
6220
- },
6221
-
6222
-
6223
- // Given an event's span (unzoned start/end and other misc data), and the event itself,
6224
- // slices into segments and attaches event-derived properties to them.
6225
- // eventSpan - { start, end, isStart, isEnd, otherthings... }
6226
- eventSpanToSegs: function(eventSpan, event, segSliceFunc) {
6227
- var segs = segSliceFunc ? segSliceFunc(eventSpan) : this.spanToSegs(eventSpan);
6228
- var i, seg;
6229
-
6230
- for (i = 0; i < segs.length; i++) {
6231
- seg = segs[i];
6232
-
6233
- // the eventSpan's isStart/isEnd takes precedence over the seg's
6234
- if (!eventSpan.isStart) {
6235
- seg.isStart = false;
6236
- }
6237
- if (!eventSpan.isEnd) {
6238
- seg.isEnd = false;
6239
- }
6240
-
6241
- seg.event = event;
6242
- seg.eventStartMS = +eventSpan.start; // TODO: not the best name after making spans unzoned
6243
- seg.eventDurationMS = eventSpan.end - eventSpan.start;
6244
- }
6245
-
6246
- return segs;
6247
- },
6248
-
6249
-
6250
- // Produces a new array of range objects that will cover all the time NOT covered by the given ranges.
6251
- // SIDE EFFECT: will mutate the given array and will use its date references.
6252
- invertRanges: function(ranges) {
6253
- var view = this.view;
6254
- var viewStart = view.activeRange.start.clone(); // need a copy
6255
- var viewEnd = view.activeRange.end.clone(); // need a copy
6256
- var inverseRanges = [];
6257
- var start = viewStart; // the end of the previous range. the start of the new range
6258
- var i, range;
6259
-
6260
- // ranges need to be in order. required for our date-walking algorithm
6261
- ranges.sort(compareRanges);
6262
-
6263
- for (i = 0; i < ranges.length; i++) {
6264
- range = ranges[i];
6265
-
6266
- // add the span of time before the event (if there is any)
6267
- if (range.start > start) { // compare millisecond time (skip any ambig logic)
6268
- inverseRanges.push({
6269
- start: start,
6270
- end: range.start
6271
- });
6272
- }
6273
-
6274
- if (range.end > start) {
6275
- start = range.end;
6276
- }
6277
- }
6278
-
6279
- // add the span of time after the last event (if there is any)
6280
- if (start < viewEnd) { // compare millisecond time (skip any ambig logic)
6281
- inverseRanges.push({
6282
- start: start,
6283
- end: viewEnd
6284
- });
6285
- }
6286
-
6287
- return inverseRanges;
6288
- },
6289
-
6290
-
6291
- sortEventSegs: function(segs) {
6292
- segs.sort(proxy(this, 'compareEventSegs'));
6293
- },
6294
-
6295
-
6296
- // A cmp function for determining which segments should take visual priority
6297
- compareEventSegs: function(seg1, seg2) {
6298
- return seg1.eventStartMS - seg2.eventStartMS || // earlier events go first
6299
- seg2.eventDurationMS - seg1.eventDurationMS || // tie? longer events go first
6300
- seg2.event.allDay - seg1.event.allDay || // tie? put all-day events first (booleans cast to 0/1)
6301
- compareByFieldSpecs(seg1.event, seg2.event, this.view.eventOrderSpecs);
6302
- }
6303
-
6304
- });
6305
-
6306
-
6307
- /* Utilities
6308
- ----------------------------------------------------------------------------------------------------------------------*/
6309
-
6310
-
6311
- function pluckEventDateProps(event) {
6312
- return {
6313
- start: event.start.clone(),
6314
- end: event.end ? event.end.clone() : null,
6315
- allDay: event.allDay // keep it the same
6316
- };
6317
- }
6318
- FC.pluckEventDateProps = pluckEventDateProps;
6319
-
6320
-
6321
- function isBgEvent(event) { // returns true if background OR inverse-background
6322
- var rendering = getEventRendering(event);
6323
- return rendering === 'background' || rendering === 'inverse-background';
6324
- }
6325
- FC.isBgEvent = isBgEvent; // export
6326
-
6327
-
6328
- function isInverseBgEvent(event) {
6329
- return getEventRendering(event) === 'inverse-background';
6330
- }
6331
-
6332
-
6333
- function getEventRendering(event) {
6334
- return firstDefined((event.source || {}).rendering, event.rendering);
6335
- }
6336
-
6337
-
6338
- function groupEventsById(events) {
6339
- var eventsById = {};
6340
- var i, event;
6341
-
6342
- for (i = 0; i < events.length; i++) {
6343
- event = events[i];
6344
- (eventsById[event._id] || (eventsById[event._id] = [])).push(event);
6345
- }
6346
-
6347
- return eventsById;
6348
- }
6349
-
6350
-
6351
- // A cmp function for determining which non-inverted "ranges" (see above) happen earlier
6352
- function compareRanges(range1, range2) {
6353
- return range1.start - range2.start; // earlier ranges go first
6354
- }
6355
-
6356
-
6357
- /* External-Dragging-Element Data
6358
- ----------------------------------------------------------------------------------------------------------------------*/
6359
-
6360
- // Require all HTML5 data-* attributes used by FullCalendar to have this prefix.
6361
- // A value of '' will query attributes like data-event. A value of 'fc' will query attributes like data-fc-event.
6362
- FC.dataAttrPrefix = '';
6363
-
6364
- // Given a jQuery element that might represent a dragged FullCalendar event, returns an intermediate data structure
6365
- // to be used for Event Object creation.
6366
- // A defined `.eventProps`, even when empty, indicates that an event should be created.
6367
- function getDraggedElMeta(el) {
6368
- var prefix = FC.dataAttrPrefix;
6369
- var eventProps; // properties for creating the event, not related to date/time
6370
- var startTime; // a Duration
6371
- var duration;
6372
- var stick;
6373
-
6374
- if (prefix) { prefix += '-'; }
6375
- eventProps = el.data(prefix + 'event') || null;
6376
-
6377
- if (eventProps) {
6378
- if (typeof eventProps === 'object') {
6379
- eventProps = $.extend({}, eventProps); // make a copy
6380
- }
6381
- else { // something like 1 or true. still signal event creation
6382
- eventProps = {};
6383
- }
6384
-
6385
- // pluck special-cased date/time properties
6386
- startTime = eventProps.start;
6387
- if (startTime == null) { startTime = eventProps.time; } // accept 'time' as well
6388
- duration = eventProps.duration;
6389
- stick = eventProps.stick;
6390
- delete eventProps.start;
6391
- delete eventProps.time;
6392
- delete eventProps.duration;
6393
- delete eventProps.stick;
6394
- }
6395
-
6396
- // fallback to standalone attribute values for each of the date/time properties
6397
- if (startTime == null) { startTime = el.data(prefix + 'start'); }
6398
- if (startTime == null) { startTime = el.data(prefix + 'time'); } // accept 'time' as well
6399
- if (duration == null) { duration = el.data(prefix + 'duration'); }
6400
- if (stick == null) { stick = el.data(prefix + 'stick'); }
6401
-
6402
- // massage into correct data types
6403
- startTime = startTime != null ? moment.duration(startTime) : null;
6404
- duration = duration != null ? moment.duration(duration) : null;
6405
- stick = Boolean(stick);
6406
-
6407
- return { eventProps: eventProps, startTime: startTime, duration: duration, stick: stick };
6408
- }
6409
-
6410
-
6411
- ;;
6412
-
6413
- /*
6414
- A set of rendering and date-related methods for a visual component comprised of one or more rows of day columns.
6415
- Prerequisite: the object being mixed into needs to be a *Grid*
6416
- */
6417
- var DayTableMixin = FC.DayTableMixin = {
6418
-
6419
- breakOnWeeks: false, // should create a new row for each week?
6420
- dayDates: null, // whole-day dates for each column. left to right
6421
- dayIndices: null, // for each day from start, the offset
6422
- daysPerRow: null,
6423
- rowCnt: null,
6424
- colCnt: null,
6425
- colHeadFormat: null,
6426
-
6427
-
6428
- // Populates internal variables used for date calculation and rendering
6429
- updateDayTable: function() {
6430
- var view = this.view;
6431
- var date = this.start.clone();
6432
- var dayIndex = -1;
6433
- var dayIndices = [];
6434
- var dayDates = [];
6435
- var daysPerRow;
6436
- var firstDay;
6437
- var rowCnt;
6438
-
6439
- while (date.isBefore(this.end)) { // loop each day from start to end
6440
- if (view.isHiddenDay(date)) {
6441
- dayIndices.push(dayIndex + 0.5); // mark that it's between indices
6442
- }
6443
- else {
6444
- dayIndex++;
6445
- dayIndices.push(dayIndex);
6446
- dayDates.push(date.clone());
6447
- }
6448
- date.add(1, 'days');
6449
- }
6450
-
6451
- if (this.breakOnWeeks) {
6452
- // count columns until the day-of-week repeats
6453
- firstDay = dayDates[0].day();
6454
- for (daysPerRow = 1; daysPerRow < dayDates.length; daysPerRow++) {
6455
- if (dayDates[daysPerRow].day() == firstDay) {
6456
- break;
6457
- }
6458
- }
6459
- rowCnt = Math.ceil(dayDates.length / daysPerRow);
6460
- }
6461
- else {
6462
- rowCnt = 1;
6463
- daysPerRow = dayDates.length;
6464
- }
6465
-
6466
- this.dayDates = dayDates;
6467
- this.dayIndices = dayIndices;
6468
- this.daysPerRow = daysPerRow;
6469
- this.rowCnt = rowCnt;
6470
-
6471
- this.updateDayTableCols();
6472
- },
6473
-
6474
-
6475
- // Computes and assigned the colCnt property and updates any options that may be computed from it
6476
- updateDayTableCols: function() {
6477
- this.colCnt = this.computeColCnt();
6478
- this.colHeadFormat = this.view.opt('columnFormat') || this.computeColHeadFormat();
6479
- },
6480
-
6481
-
6482
- // Determines how many columns there should be in the table
6483
- computeColCnt: function() {
6484
- return this.daysPerRow;
6485
- },
6486
-
6487
-
6488
- // Computes the ambiguously-timed moment for the given cell
6489
- getCellDate: function(row, col) {
6490
- return this.dayDates[
6491
- this.getCellDayIndex(row, col)
6492
- ].clone();
6493
- },
6494
-
6495
-
6496
- // Computes the ambiguously-timed date range for the given cell
6497
- getCellRange: function(row, col) {
6498
- var start = this.getCellDate(row, col);
6499
- var end = start.clone().add(1, 'days');
6500
-
6501
- return { start: start, end: end };
6502
- },
6503
-
6504
-
6505
- // Returns the number of day cells, chronologically, from the first of the grid (0-based)
6506
- getCellDayIndex: function(row, col) {
6507
- return row * this.daysPerRow + this.getColDayIndex(col);
6508
- },
6509
-
6510
-
6511
- // Returns the numner of day cells, chronologically, from the first cell in *any given row*
6512
- getColDayIndex: function(col) {
6513
- if (this.isRTL) {
6514
- return this.colCnt - 1 - col;
6515
- }
6516
- else {
6517
- return col;
6518
- }
6519
- },
6520
-
6521
-
6522
- // Given a date, returns its chronolocial cell-index from the first cell of the grid.
6523
- // If the date lies between cells (because of hiddenDays), returns a floating-point value between offsets.
6524
- // If before the first offset, returns a negative number.
6525
- // If after the last offset, returns an offset past the last cell offset.
6526
- // Only works for *start* dates of cells. Will not work for exclusive end dates for cells.
6527
- getDateDayIndex: function(date) {
6528
- var dayIndices = this.dayIndices;
6529
- var dayOffset = date.diff(this.start, 'days');
6530
-
6531
- if (dayOffset < 0) {
6532
- return dayIndices[0] - 1;
6533
- }
6534
- else if (dayOffset >= dayIndices.length) {
6535
- return dayIndices[dayIndices.length - 1] + 1;
6536
- }
6537
- else {
6538
- return dayIndices[dayOffset];
6539
- }
6540
- },
6541
-
6542
-
6543
- /* Options
6544
- ------------------------------------------------------------------------------------------------------------------*/
6545
-
6546
-
6547
- // Computes a default column header formatting string if `colFormat` is not explicitly defined
6548
- computeColHeadFormat: function() {
6549
- // if more than one week row, or if there are a lot of columns with not much space,
6550
- // put just the day numbers will be in each cell
6551
- if (this.rowCnt > 1 || this.colCnt > 10) {
6552
- return 'ddd'; // "Sat"
6553
- }
6554
- // multiple days, so full single date string WON'T be in title text
6555
- else if (this.colCnt > 1) {
6556
- return this.view.opt('dayOfMonthFormat'); // "Sat 12/10"
6557
- }
6558
- // single day, so full single date string will probably be in title text
6559
- else {
6560
- return 'dddd'; // "Saturday"
6561
- }
6562
- },
6563
-
6564
-
6565
- /* Slicing
6566
- ------------------------------------------------------------------------------------------------------------------*/
6567
-
6568
-
6569
- // Slices up a date range into a segment for every week-row it intersects with
6570
- sliceRangeByRow: function(range) {
6571
- var daysPerRow = this.daysPerRow;
6572
- var normalRange = this.view.computeDayRange(range); // make whole-day range, considering nextDayThreshold
6573
- var rangeFirst = this.getDateDayIndex(normalRange.start); // inclusive first index
6574
- var rangeLast = this.getDateDayIndex(normalRange.end.clone().subtract(1, 'days')); // inclusive last index
6575
- var segs = [];
6576
- var row;
6577
- var rowFirst, rowLast; // inclusive day-index range for current row
6578
- var segFirst, segLast; // inclusive day-index range for segment
6579
-
6580
- for (row = 0; row < this.rowCnt; row++) {
6581
- rowFirst = row * daysPerRow;
6582
- rowLast = rowFirst + daysPerRow - 1;
6583
-
6584
- // intersect segment's offset range with the row's
6585
- segFirst = Math.max(rangeFirst, rowFirst);
6586
- segLast = Math.min(rangeLast, rowLast);
6587
-
6588
- // deal with in-between indices
6589
- segFirst = Math.ceil(segFirst); // in-between starts round to next cell
6590
- segLast = Math.floor(segLast); // in-between ends round to prev cell
6591
-
6592
- if (segFirst <= segLast) { // was there any intersection with the current row?
6593
- segs.push({
6594
- row: row,
6595
-
6596
- // normalize to start of row
6597
- firstRowDayIndex: segFirst - rowFirst,
6598
- lastRowDayIndex: segLast - rowFirst,
6599
-
6600
- // must be matching integers to be the segment's start/end
6601
- isStart: segFirst === rangeFirst,
6602
- isEnd: segLast === rangeLast
6603
- });
6604
- }
6605
- }
6606
-
6607
- return segs;
6608
- },
6609
-
6610
-
6611
- // Slices up a date range into a segment for every day-cell it intersects with.
6612
- // TODO: make more DRY with sliceRangeByRow somehow.
6613
- sliceRangeByDay: function(range) {
6614
- var daysPerRow = this.daysPerRow;
6615
- var normalRange = this.view.computeDayRange(range); // make whole-day range, considering nextDayThreshold
6616
- var rangeFirst = this.getDateDayIndex(normalRange.start); // inclusive first index
6617
- var rangeLast = this.getDateDayIndex(normalRange.end.clone().subtract(1, 'days')); // inclusive last index
6618
- var segs = [];
6619
- var row;
6620
- var rowFirst, rowLast; // inclusive day-index range for current row
6621
- var i;
6622
- var segFirst, segLast; // inclusive day-index range for segment
6623
-
6624
- for (row = 0; row < this.rowCnt; row++) {
6625
- rowFirst = row * daysPerRow;
6626
- rowLast = rowFirst + daysPerRow - 1;
6627
-
6628
- for (i = rowFirst; i <= rowLast; i++) {
6629
-
6630
- // intersect segment's offset range with the row's
6631
- segFirst = Math.max(rangeFirst, i);
6632
- segLast = Math.min(rangeLast, i);
6633
-
6634
- // deal with in-between indices
6635
- segFirst = Math.ceil(segFirst); // in-between starts round to next cell
6636
- segLast = Math.floor(segLast); // in-between ends round to prev cell
6637
-
6638
- if (segFirst <= segLast) { // was there any intersection with the current row?
6639
- segs.push({
6640
- row: row,
6641
-
6642
- // normalize to start of row
6643
- firstRowDayIndex: segFirst - rowFirst,
6644
- lastRowDayIndex: segLast - rowFirst,
6645
-
6646
- // must be matching integers to be the segment's start/end
6647
- isStart: segFirst === rangeFirst,
6648
- isEnd: segLast === rangeLast
6649
- });
6650
- }
6651
- }
6652
- }
6653
-
6654
- return segs;
6655
- },
6656
-
6657
-
6658
- /* Header Rendering
6659
- ------------------------------------------------------------------------------------------------------------------*/
6660
-
6661
-
6662
- renderHeadHtml: function() {
6663
- var view = this.view;
6664
-
6665
- return '' +
6666
- '<div class="fc-row ' + view.widgetHeaderClass + '">' +
6667
- '<table>' +
6668
- '<thead>' +
6669
- this.renderHeadTrHtml() +
6670
- '</thead>' +
6671
- '</table>' +
6672
- '</div>';
6673
- },
6674
-
6675
-
6676
- renderHeadIntroHtml: function() {
6677
- return this.renderIntroHtml(); // fall back to generic
6678
- },
6679
-
6680
-
6681
- renderHeadTrHtml: function() {
6682
- return '' +
6683
- '<tr>' +
6684
- (this.isRTL ? '' : this.renderHeadIntroHtml()) +
6685
- this.renderHeadDateCellsHtml() +
6686
- (this.isRTL ? this.renderHeadIntroHtml() : '') +
6687
- '</tr>';
6688
- },
6689
-
6690
-
6691
- renderHeadDateCellsHtml: function() {
6692
- var htmls = [];
6693
- var col, date;
6694
-
6695
- for (col = 0; col < this.colCnt; col++) {
6696
- date = this.getCellDate(0, col);
6697
- htmls.push(this.renderHeadDateCellHtml(date));
6698
- }
6699
-
6700
- return htmls.join('');
6701
- },
6702
-
6703
-
6704
- // TODO: when internalApiVersion, accept an object for HTML attributes
6705
- // (colspan should be no different)
6706
- renderHeadDateCellHtml: function(date, colspan, otherAttrs) {
6707
- var view = this.view;
6708
- var isDateValid = isDateWithinRange(date, view.activeRange); // TODO: called too frequently. cache somehow.
6709
- var classNames = [
6710
- 'fc-day-header',
6711
- view.widgetHeaderClass
6712
- ];
6713
- var innerHtml = htmlEscape(date.format(this.colHeadFormat));
6714
-
6715
- // if only one row of days, the classNames on the header can represent the specific days beneath
6716
- if (this.rowCnt === 1) {
6717
- classNames = classNames.concat(
6718
- // includes the day-of-week class
6719
- // noThemeHighlight=true (don't highlight the header)
6720
- this.getDayClasses(date, true)
6721
- );
6722
- }
6723
- else {
6724
- classNames.push('fc-' + dayIDs[date.day()]); // only add the day-of-week class
6725
- }
6726
-
6727
- return '' +
6728
- '<th class="' + classNames.join(' ') + '"' +
6729
- ((isDateValid && this.rowCnt) === 1 ?
6730
- ' data-date="' + date.format('YYYY-MM-DD') + '"' :
6731
- '') +
6732
- (colspan > 1 ?
6733
- ' colspan="' + colspan + '"' :
6734
- '') +
6735
- (otherAttrs ?
6736
- ' ' + otherAttrs :
6737
- '') +
6738
- '>' +
6739
- (isDateValid ?
6740
- // don't make a link if the heading could represent multiple days, or if there's only one day (forceOff)
6741
- view.buildGotoAnchorHtml(
6742
- { date: date, forceOff: this.rowCnt > 1 || this.colCnt === 1 },
6743
- innerHtml
6744
- ) :
6745
- // if not valid, display text, but no link
6746
- innerHtml
6747
- ) +
6748
- '</th>';
6749
- },
6750
-
6751
-
6752
- /* Background Rendering
6753
- ------------------------------------------------------------------------------------------------------------------*/
6754
-
6755
-
6756
- renderBgTrHtml: function(row) {
6757
- return '' +
6758
- '<tr>' +
6759
- (this.isRTL ? '' : this.renderBgIntroHtml(row)) +
6760
- this.renderBgCellsHtml(row) +
6761
- (this.isRTL ? this.renderBgIntroHtml(row) : '') +
6762
- '</tr>';
6763
- },
6764
-
6765
-
6766
- renderBgIntroHtml: function(row) {
6767
- return this.renderIntroHtml(); // fall back to generic
6768
- },
6769
-
6770
-
6771
- renderBgCellsHtml: function(row) {
6772
- var htmls = [];
6773
- var col, date;
6774
-
6775
- for (col = 0; col < this.colCnt; col++) {
6776
- date = this.getCellDate(row, col);
6777
- htmls.push(this.renderBgCellHtml(date));
6778
- }
6779
-
6780
- return htmls.join('');
6781
- },
6782
-
6783
-
6784
- renderBgCellHtml: function(date, otherAttrs) {
6785
- var view = this.view;
6786
- var isDateValid = isDateWithinRange(date, view.activeRange); // TODO: called too frequently. cache somehow.
6787
- var classes = this.getDayClasses(date);
6788
-
6789
- classes.unshift('fc-day', view.widgetContentClass);
6790
-
6791
- return '<td class="' + classes.join(' ') + '"' +
6792
- (isDateValid ?
6793
- ' data-date="' + date.format('YYYY-MM-DD') + '"' : // if date has a time, won't format it
6794
- '') +
6795
- (otherAttrs ?
6796
- ' ' + otherAttrs :
6797
- '') +
6798
- '></td>';
6799
- },
6800
-
6801
-
6802
- /* Generic
6803
- ------------------------------------------------------------------------------------------------------------------*/
6804
-
6805
-
6806
- // Generates the default HTML intro for any row. User classes should override
6807
- renderIntroHtml: function() {
6808
- },
6809
-
6810
-
6811
- // TODO: a generic method for dealing with <tr>, RTL, intro
6812
- // when increment internalApiVersion
6813
- // wrapTr (scheduler)
6814
-
6815
-
6816
- /* Utils
6817
- ------------------------------------------------------------------------------------------------------------------*/
6818
-
6819
-
6820
- // Applies the generic "intro" and "outro" HTML to the given cells.
6821
- // Intro means the leftmost cell when the calendar is LTR and the rightmost cell when RTL. Vice-versa for outro.
6822
- bookendCells: function(trEl) {
6823
- var introHtml = this.renderIntroHtml();
6824
-
6825
- if (introHtml) {
6826
- if (this.isRTL) {
6827
- trEl.append(introHtml);
6828
- }
6829
- else {
6830
- trEl.prepend(introHtml);
6831
- }
6832
- }
6833
- }
6834
-
6835
- };
6836
-
6837
- ;;
6838
-
6839
- /* A component that renders a grid of whole-days that runs horizontally. There can be multiple rows, one per week.
6840
- ----------------------------------------------------------------------------------------------------------------------*/
6841
-
6842
- var DayGrid = FC.DayGrid = Grid.extend(DayTableMixin, {
6843
-
6844
- numbersVisible: false, // should render a row for day/week numbers? set by outside view. TODO: make internal
6845
- bottomCoordPadding: 0, // hack for extending the hit area for the last row of the coordinate grid
6846
-
6847
- rowEls: null, // set of fake row elements
6848
- cellEls: null, // set of whole-day elements comprising the row's background
6849
- helperEls: null, // set of cell skeleton elements for rendering the mock event "helper"
6850
-
6851
- rowCoordCache: null,
6852
- colCoordCache: null,
6853
-
6854
-
6855
- // Renders the rows and columns into the component's `this.el`, which should already be assigned.
6856
- // isRigid determins whether the individual rows should ignore the contents and be a constant height.
6857
- // Relies on the view's colCnt and rowCnt. In the future, this component should probably be self-sufficient.
6858
- renderDates: function(isRigid) {
6859
- var view = this.view;
6860
- var rowCnt = this.rowCnt;
6861
- var colCnt = this.colCnt;
6862
- var html = '';
6863
- var row;
6864
- var col;
6865
-
6866
- for (row = 0; row < rowCnt; row++) {
6867
- html += this.renderDayRowHtml(row, isRigid);
6868
- }
6869
- this.el.html(html);
6870
-
6871
- this.rowEls = this.el.find('.fc-row');
6872
- this.cellEls = this.el.find('.fc-day, .fc-disabled-day');
6873
-
6874
- this.rowCoordCache = new CoordCache({
6875
- els: this.rowEls,
6876
- isVertical: true
6877
- });
6878
- this.colCoordCache = new CoordCache({
6879
- els: this.cellEls.slice(0, this.colCnt), // only the first row
6880
- isHorizontal: true
6881
- });
6882
-
6883
- // trigger dayRender with each cell's element
6884
- for (row = 0; row < rowCnt; row++) {
6885
- for (col = 0; col < colCnt; col++) {
6886
- view.publiclyTrigger(
6887
- 'dayRender',
6888
- null,
6889
- this.getCellDate(row, col),
6890
- this.getCellEl(row, col)
6891
- );
6892
- }
6893
- }
6894
- },
6895
-
6896
-
6897
- unrenderDates: function() {
6898
- this.removeSegPopover();
6899
- },
6900
-
6901
-
6902
- renderBusinessHours: function() {
6903
- var segs = this.buildBusinessHourSegs(true); // wholeDay=true
6904
- this.renderFill('businessHours', segs, 'bgevent');
6905
- },
6906
-
6907
-
6908
- unrenderBusinessHours: function() {
6909
- this.unrenderFill('businessHours');
6910
- },
6911
-
6912
-
6913
- // Generates the HTML for a single row, which is a div that wraps a table.
6914
- // `row` is the row number.
6915
- renderDayRowHtml: function(row, isRigid) {
6916
- var view = this.view;
6917
- var classes = [ 'fc-row', 'fc-week', view.widgetContentClass ];
6918
-
6919
- if (isRigid) {
6920
- classes.push('fc-rigid');
6921
- }
6922
-
6923
- return '' +
6924
- '<div class="' + classes.join(' ') + '">' +
6925
- '<div class="fc-bg">' +
6926
- '<table>' +
6927
- this.renderBgTrHtml(row) +
6928
- '</table>' +
6929
- '</div>' +
6930
- '<div class="fc-content-skeleton">' +
6931
- '<table>' +
6932
- (this.numbersVisible ?
6933
- '<thead>' +
6934
- this.renderNumberTrHtml(row) +
6935
- '</thead>' :
6936
- ''
6937
- ) +
6938
- '</table>' +
6939
- '</div>' +
6940
- '</div>';
6941
- },
6942
-
6943
-
6944
- /* Grid Number Rendering
6945
- ------------------------------------------------------------------------------------------------------------------*/
6946
-
6947
-
6948
- renderNumberTrHtml: function(row) {
6949
- return '' +
6950
- '<tr>' +
6951
- (this.isRTL ? '' : this.renderNumberIntroHtml(row)) +
6952
- this.renderNumberCellsHtml(row) +
6953
- (this.isRTL ? this.renderNumberIntroHtml(row) : '') +
6954
- '</tr>';
6955
- },
6956
-
6957
-
6958
- renderNumberIntroHtml: function(row) {
6959
- return this.renderIntroHtml();
6960
- },
6961
-
6962
-
6963
- renderNumberCellsHtml: function(row) {
6964
- var htmls = [];
6965
- var col, date;
6966
-
6967
- for (col = 0; col < this.colCnt; col++) {
6968
- date = this.getCellDate(row, col);
6969
- htmls.push(this.renderNumberCellHtml(date));
6970
- }
6971
-
6972
- return htmls.join('');
6973
- },
6974
-
6975
-
6976
- // Generates the HTML for the <td>s of the "number" row in the DayGrid's content skeleton.
6977
- // The number row will only exist if either day numbers or week numbers are turned on.
6978
- renderNumberCellHtml: function(date) {
6979
- var view = this.view;
6980
- var html = '';
6981
- var isDateValid = isDateWithinRange(date, view.activeRange); // TODO: called too frequently. cache somehow.
6982
- var isDayNumberVisible = view.dayNumbersVisible && isDateValid;
6983
- var classes;
6984
- var weekCalcFirstDoW;
6985
-
6986
- if (!isDayNumberVisible && !view.cellWeekNumbersVisible) {
6987
- // no numbers in day cell (week number must be along the side)
6988
- return '<td/>'; // will create an empty space above events :(
6989
- }
6990
-
6991
- classes = this.getDayClasses(date);
6992
- classes.unshift('fc-day-top');
6993
-
6994
- if (view.cellWeekNumbersVisible) {
6995
- // To determine the day of week number change under ISO, we cannot
6996
- // rely on moment.js methods such as firstDayOfWeek() or weekday(),
6997
- // because they rely on the locale's dow (possibly overridden by
6998
- // our firstDay option), which may not be Monday. We cannot change
6999
- // dow, because that would affect the calendar start day as well.
7000
- if (date._locale._fullCalendar_weekCalc === 'ISO') {
7001
- weekCalcFirstDoW = 1; // Monday by ISO 8601 definition
7002
- }
7003
- else {
7004
- weekCalcFirstDoW = date._locale.firstDayOfWeek();
7005
- }
7006
- }
7007
-
7008
- html += '<td class="' + classes.join(' ') + '"' +
7009
- (isDateValid ?
7010
- ' data-date="' + date.format() + '"' :
7011
- ''
7012
- ) +
7013
- '>';
7014
-
7015
- if (view.cellWeekNumbersVisible && (date.day() == weekCalcFirstDoW)) {
7016
- html += view.buildGotoAnchorHtml(
7017
- { date: date, type: 'week' },
7018
- { 'class': 'fc-week-number' },
7019
- date.format('w') // inner HTML
7020
- );
7021
- }
7022
-
7023
- if (isDayNumberVisible) {
7024
- html += view.buildGotoAnchorHtml(
7025
- date,
7026
- { 'class': 'fc-day-number' },
7027
- date.date() // inner HTML
7028
- );
7029
- }
7030
-
7031
- html += '</td>';
7032
-
7033
- return html;
7034
- },
7035
-
7036
-
7037
- /* Options
7038
- ------------------------------------------------------------------------------------------------------------------*/
7039
-
7040
-
7041
- // Computes a default event time formatting string if `timeFormat` is not explicitly defined
7042
- computeEventTimeFormat: function() {
7043
- return this.view.opt('extraSmallTimeFormat'); // like "6p" or "6:30p"
7044
- },
7045
-
7046
-
7047
- // Computes a default `displayEventEnd` value if one is not expliclty defined
7048
- computeDisplayEventEnd: function() {
7049
- return this.colCnt == 1; // we'll likely have space if there's only one day
7050
- },
7051
-
7052
-
7053
- /* Dates
7054
- ------------------------------------------------------------------------------------------------------------------*/
7055
-
7056
-
7057
- rangeUpdated: function() {
7058
- this.updateDayTable();
7059
- },
7060
-
7061
-
7062
- // Slices up the given span (unzoned start/end with other misc data) into an array of segments
7063
- spanToSegs: function(span) {
7064
- var segs = this.sliceRangeByRow(span);
7065
- var i, seg;
7066
-
7067
- for (i = 0; i < segs.length; i++) {
7068
- seg = segs[i];
7069
- if (this.isRTL) {
7070
- seg.leftCol = this.daysPerRow - 1 - seg.lastRowDayIndex;
7071
- seg.rightCol = this.daysPerRow - 1 - seg.firstRowDayIndex;
7072
- }
7073
- else {
7074
- seg.leftCol = seg.firstRowDayIndex;
7075
- seg.rightCol = seg.lastRowDayIndex;
7076
- }
7077
- }
7078
-
7079
- return segs;
7080
- },
7081
-
7082
-
7083
- /* Hit System
7084
- ------------------------------------------------------------------------------------------------------------------*/
7085
-
7086
-
7087
- prepareHits: function() {
7088
- this.colCoordCache.build();
7089
- this.rowCoordCache.build();
7090
- this.rowCoordCache.bottoms[this.rowCnt - 1] += this.bottomCoordPadding; // hack
7091
- },
7092
-
7093
-
7094
- releaseHits: function() {
7095
- this.colCoordCache.clear();
7096
- this.rowCoordCache.clear();
7097
- },
7098
-
7099
-
7100
- queryHit: function(leftOffset, topOffset) {
7101
- if (this.colCoordCache.isLeftInBounds(leftOffset) && this.rowCoordCache.isTopInBounds(topOffset)) {
7102
- var col = this.colCoordCache.getHorizontalIndex(leftOffset);
7103
- var row = this.rowCoordCache.getVerticalIndex(topOffset);
7104
-
7105
- if (row != null && col != null) {
7106
- return this.getCellHit(row, col);
7107
- }
7108
- }
7109
- },
7110
-
7111
-
7112
- getHitSpan: function(hit) {
7113
- return this.getCellRange(hit.row, hit.col);
7114
- },
7115
-
7116
-
7117
- getHitEl: function(hit) {
7118
- return this.getCellEl(hit.row, hit.col);
7119
- },
7120
-
7121
-
7122
- /* Cell System
7123
- ------------------------------------------------------------------------------------------------------------------*/
7124
- // FYI: the first column is the leftmost column, regardless of date
7125
-
7126
-
7127
- getCellHit: function(row, col) {
7128
- return {
7129
- row: row,
7130
- col: col,
7131
- component: this, // needed unfortunately :(
7132
- left: this.colCoordCache.getLeftOffset(col),
7133
- right: this.colCoordCache.getRightOffset(col),
7134
- top: this.rowCoordCache.getTopOffset(row),
7135
- bottom: this.rowCoordCache.getBottomOffset(row)
7136
- };
7137
- },
7138
-
7139
-
7140
- getCellEl: function(row, col) {
7141
- return this.cellEls.eq(row * this.colCnt + col);
7142
- },
7143
-
7144
-
7145
- /* Event Drag Visualization
7146
- ------------------------------------------------------------------------------------------------------------------*/
7147
- // TODO: move to DayGrid.event, similar to what we did with Grid's drag methods
7148
-
7149
-
7150
- // Renders a visual indication of an event or external element being dragged.
7151
- // `eventLocation` has zoned start and end (optional)
7152
- renderDrag: function(eventLocation, seg) {
7153
- var eventSpans = this.eventToSpans(eventLocation);
7154
- var i;
7155
-
7156
- // always render a highlight underneath
7157
- for (i = 0; i < eventSpans.length; i++) {
7158
- this.renderHighlight(eventSpans[i]);
7159
- }
7160
-
7161
- // if a segment from the same calendar but another component is being dragged, render a helper event
7162
- if (seg && seg.component !== this) {
7163
- return this.renderEventLocationHelper(eventLocation, seg); // returns mock event elements
7164
- }
7165
- },
7166
-
7167
-
7168
- // Unrenders any visual indication of a hovering event
7169
- unrenderDrag: function() {
7170
- this.unrenderHighlight();
7171
- this.unrenderHelper();
7172
- },
7173
-
7174
-
7175
- /* Event Resize Visualization
7176
- ------------------------------------------------------------------------------------------------------------------*/
7177
-
7178
-
7179
- // Renders a visual indication of an event being resized
7180
- renderEventResize: function(eventLocation, seg) {
7181
- var eventSpans = this.eventToSpans(eventLocation);
7182
- var i;
7183
-
7184
- for (i = 0; i < eventSpans.length; i++) {
7185
- this.renderHighlight(eventSpans[i]);
7186
- }
7187
-
7188
- return this.renderEventLocationHelper(eventLocation, seg); // returns mock event elements
7189
- },
7190
-
7191
-
7192
- // Unrenders a visual indication of an event being resized
7193
- unrenderEventResize: function() {
7194
- this.unrenderHighlight();
7195
- this.unrenderHelper();
7196
- },
7197
-
7198
-
7199
- /* Event Helper
7200
- ------------------------------------------------------------------------------------------------------------------*/
7201
-
7202
-
7203
- // Renders a mock "helper" event. `sourceSeg` is the associated internal segment object. It can be null.
7204
- renderHelper: function(event, sourceSeg) {
7205
- var helperNodes = [];
7206
- var segs = this.eventToSegs(event);
7207
- var rowStructs;
7208
-
7209
- segs = this.renderFgSegEls(segs); // assigns each seg's el and returns a subset of segs that were rendered
7210
- rowStructs = this.renderSegRows(segs);
7211
-
7212
- // inject each new event skeleton into each associated row
7213
- this.rowEls.each(function(row, rowNode) {
7214
- var rowEl = $(rowNode); // the .fc-row
7215
- var skeletonEl = $('<div class="fc-helper-skeleton"><table/></div>'); // will be absolutely positioned
7216
- var skeletonTop;
7217
-
7218
- // If there is an original segment, match the top position. Otherwise, put it at the row's top level
7219
- if (sourceSeg && sourceSeg.row === row) {
7220
- skeletonTop = sourceSeg.el.position().top;
7221
- }
7222
- else {
7223
- skeletonTop = rowEl.find('.fc-content-skeleton tbody').position().top;
7224
- }
7225
-
7226
- skeletonEl.css('top', skeletonTop)
7227
- .find('table')
7228
- .append(rowStructs[row].tbodyEl);
7229
-
7230
- rowEl.append(skeletonEl);
7231
- helperNodes.push(skeletonEl[0]);
7232
- });
7233
-
7234
- return ( // must return the elements rendered
7235
- this.helperEls = $(helperNodes) // array -> jQuery set
7236
- );
7237
- },
7238
-
7239
-
7240
- // Unrenders any visual indication of a mock helper event
7241
- unrenderHelper: function() {
7242
- if (this.helperEls) {
7243
- this.helperEls.remove();
7244
- this.helperEls = null;
7245
- }
7246
- },
7247
-
7248
-
7249
- /* Fill System (highlight, background events, business hours)
7250
- ------------------------------------------------------------------------------------------------------------------*/
7251
-
7252
-
7253
- fillSegTag: 'td', // override the default tag name
7254
-
7255
-
7256
- // Renders a set of rectangles over the given segments of days.
7257
- // Only returns segments that successfully rendered.
7258
- renderFill: function(type, segs, className) {
7259
- var nodes = [];
7260
- var i, seg;
7261
- var skeletonEl;
7262
-
7263
- segs = this.renderFillSegEls(type, segs); // assignes `.el` to each seg. returns successfully rendered segs
7264
-
7265
- for (i = 0; i < segs.length; i++) {
7266
- seg = segs[i];
7267
- skeletonEl = this.renderFillRow(type, seg, className);
7268
- this.rowEls.eq(seg.row).append(skeletonEl);
7269
- nodes.push(skeletonEl[0]);
7270
- }
7271
-
7272
- this.elsByFill[type] = $(nodes);
7273
-
7274
- return segs;
7275
- },
7276
-
7277
-
7278
- // Generates the HTML needed for one row of a fill. Requires the seg's el to be rendered.
7279
- renderFillRow: function(type, seg, className) {
7280
- var colCnt = this.colCnt;
7281
- var startCol = seg.leftCol;
7282
- var endCol = seg.rightCol + 1;
7283
- var skeletonEl;
7284
- var trEl;
7285
-
7286
- className = className || type.toLowerCase();
7287
-
7288
- skeletonEl = $(
7289
- '<div class="fc-' + className + '-skeleton">' +
7290
- '<table><tr/></table>' +
7291
- '</div>'
7292
- );
7293
- trEl = skeletonEl.find('tr');
7294
-
7295
- if (startCol > 0) {
7296
- trEl.append('<td colspan="' + startCol + '"/>');
7297
- }
7298
-
7299
- trEl.append(
7300
- seg.el.attr('colspan', endCol - startCol)
7301
- );
7302
-
7303
- if (endCol < colCnt) {
7304
- trEl.append('<td colspan="' + (colCnt - endCol) + '"/>');
7305
- }
7306
-
7307
- this.bookendCells(trEl);
7308
-
7309
- return skeletonEl;
7310
- }
7311
-
7312
- });
7313
-
7314
- ;;
7315
-
7316
- /* Event-rendering methods for the DayGrid class
7317
- ----------------------------------------------------------------------------------------------------------------------*/
7318
-
7319
- DayGrid.mixin({
7320
-
7321
- rowStructs: null, // an array of objects, each holding information about a row's foreground event-rendering
7322
-
7323
-
7324
- // Unrenders all events currently rendered on the grid
7325
- unrenderEvents: function() {
7326
- this.removeSegPopover(); // removes the "more.." events popover
7327
- Grid.prototype.unrenderEvents.apply(this, arguments); // calls the super-method
7328
- },
7329
-
7330
-
7331
- // Retrieves all rendered segment objects currently rendered on the grid
7332
- getEventSegs: function() {
7333
- return Grid.prototype.getEventSegs.call(this) // get the segments from the super-method
7334
- .concat(this.popoverSegs || []); // append the segments from the "more..." popover
7335
- },
7336
-
7337
-
7338
- // Renders the given background event segments onto the grid
7339
- renderBgSegs: function(segs) {
7340
-
7341
- // don't render timed background events
7342
- var allDaySegs = $.grep(segs, function(seg) {
7343
- return seg.event.allDay;
7344
- });
7345
-
7346
- return Grid.prototype.renderBgSegs.call(this, allDaySegs); // call the super-method
7347
- },
7348
-
7349
-
7350
- // Renders the given foreground event segments onto the grid
7351
- renderFgSegs: function(segs) {
7352
- var rowStructs;
7353
-
7354
- // render an `.el` on each seg
7355
- // returns a subset of the segs. segs that were actually rendered
7356
- segs = this.renderFgSegEls(segs);
7357
-
7358
- rowStructs = this.rowStructs = this.renderSegRows(segs);
7359
-
7360
- // append to each row's content skeleton
7361
- this.rowEls.each(function(i, rowNode) {
7362
- $(rowNode).find('.fc-content-skeleton > table').append(
7363
- rowStructs[i].tbodyEl
7364
- );
7365
- });
7366
-
7367
- return segs; // return only the segs that were actually rendered
7368
- },
7369
-
7370
-
7371
- // Unrenders all currently rendered foreground event segments
7372
- unrenderFgSegs: function() {
7373
- var rowStructs = this.rowStructs || [];
7374
- var rowStruct;
7375
-
7376
- while ((rowStruct = rowStructs.pop())) {
7377
- rowStruct.tbodyEl.remove();
7378
- }
7379
-
7380
- this.rowStructs = null;
7381
- },
7382
-
7383
-
7384
- // Uses the given events array to generate <tbody> elements that should be appended to each row's content skeleton.
7385
- // Returns an array of rowStruct objects (see the bottom of `renderSegRow`).
7386
- // PRECONDITION: each segment shoud already have a rendered and assigned `.el`
7387
- renderSegRows: function(segs) {
7388
- var rowStructs = [];
7389
- var segRows;
7390
- var row;
7391
-
7392
- segRows = this.groupSegRows(segs); // group into nested arrays
7393
-
7394
- // iterate each row of segment groupings
7395
- for (row = 0; row < segRows.length; row++) {
7396
- rowStructs.push(
7397
- this.renderSegRow(row, segRows[row])
7398
- );
7399
- }
7400
-
7401
- return rowStructs;
7402
- },
7403
-
7404
-
7405
- // Builds the HTML to be used for the default element for an individual segment
7406
- fgSegHtml: function(seg, disableResizing) {
7407
- var view = this.view;
7408
- var event = seg.event;
7409
- var isDraggable = view.isEventDraggable(event);
7410
- var isResizableFromStart = !disableResizing && event.allDay &&
7411
- seg.isStart && view.isEventResizableFromStart(event);
7412
- var isResizableFromEnd = !disableResizing && event.allDay &&
7413
- seg.isEnd && view.isEventResizableFromEnd(event);
7414
- var classes = this.getSegClasses(seg, isDraggable, isResizableFromStart || isResizableFromEnd);
7415
- var skinCss = cssToStr(this.getSegSkinCss(seg));
7416
- var timeHtml = '';
7417
- var timeText;
7418
- var titleHtml;
7419
-
7420
- classes.unshift('fc-day-grid-event', 'fc-h-event');
7421
-
7422
- // Only display a timed events time if it is the starting segment
7423
- if (seg.isStart) {
7424
- timeText = this.getEventTimeText(event);
7425
- if (timeText) {
7426
- timeHtml = '<span class="fc-time">' + htmlEscape(timeText) + '</span>';
7427
- }
7428
- }
7429
-
7430
- titleHtml =
7431
- '<span class="fc-title">' +
7432
- (htmlEscape(event.title || '') || '&nbsp;') + // we always want one line of height
7433
- '</span>';
7434
-
7435
- return '<a class="' + classes.join(' ') + '"' +
7436
- (event.url ?
7437
- ' href="' + htmlEscape(event.url) + '"' :
7438
- ''
7439
- ) +
7440
- (skinCss ?
7441
- ' style="' + skinCss + '"' :
7442
- ''
7443
- ) +
7444
- '>' +
7445
- '<div class="fc-content">' +
7446
- (this.isRTL ?
7447
- titleHtml + ' ' + timeHtml : // put a natural space in between
7448
- timeHtml + ' ' + titleHtml //
7449
- ) +
7450
- '</div>' +
7451
- (isResizableFromStart ?
7452
- '<div class="fc-resizer fc-start-resizer" />' :
7453
- ''
7454
- ) +
7455
- (isResizableFromEnd ?
7456
- '<div class="fc-resizer fc-end-resizer" />' :
7457
- ''
7458
- ) +
7459
- '</a>';
7460
- },
7461
-
7462
-
7463
- // Given a row # and an array of segments all in the same row, render a <tbody> element, a skeleton that contains
7464
- // the segments. Returns object with a bunch of internal data about how the render was calculated.
7465
- // NOTE: modifies rowSegs
7466
- renderSegRow: function(row, rowSegs) {
7467
- var colCnt = this.colCnt;
7468
- var segLevels = this.buildSegLevels(rowSegs); // group into sub-arrays of levels
7469
- var levelCnt = Math.max(1, segLevels.length); // ensure at least one level
7470
- var tbody = $('<tbody/>');
7471
- var segMatrix = []; // lookup for which segments are rendered into which level+col cells
7472
- var cellMatrix = []; // lookup for all <td> elements of the level+col matrix
7473
- var loneCellMatrix = []; // lookup for <td> elements that only take up a single column
7474
- var i, levelSegs;
7475
- var col;
7476
- var tr;
7477
- var j, seg;
7478
- var td;
7479
-
7480
- // populates empty cells from the current column (`col`) to `endCol`
7481
- function emptyCellsUntil(endCol) {
7482
- while (col < endCol) {
7483
- // try to grab a cell from the level above and extend its rowspan. otherwise, create a fresh cell
7484
- td = (loneCellMatrix[i - 1] || [])[col];
7485
- if (td) {
7486
- td.attr(
7487
- 'rowspan',
7488
- parseInt(td.attr('rowspan') || 1, 10) + 1
7489
- );
7490
- }
7491
- else {
7492
- td = $('<td/>');
7493
- tr.append(td);
7494
- }
7495
- cellMatrix[i][col] = td;
7496
- loneCellMatrix[i][col] = td;
7497
- col++;
7498
- }
7499
- }
7500
-
7501
- for (i = 0; i < levelCnt; i++) { // iterate through all levels
7502
- levelSegs = segLevels[i];
7503
- col = 0;
7504
- tr = $('<tr/>');
7505
-
7506
- segMatrix.push([]);
7507
- cellMatrix.push([]);
7508
- loneCellMatrix.push([]);
7509
-
7510
- // levelCnt might be 1 even though there are no actual levels. protect against this.
7511
- // this single empty row is useful for styling.
7512
- if (levelSegs) {
7513
- for (j = 0; j < levelSegs.length; j++) { // iterate through segments in level
7514
- seg = levelSegs[j];
7515
-
7516
- emptyCellsUntil(seg.leftCol);
7517
-
7518
- // create a container that occupies or more columns. append the event element.
7519
- td = $('<td class="fc-event-container"/>').append(seg.el);
7520
- if (seg.leftCol != seg.rightCol) {
7521
- td.attr('colspan', seg.rightCol - seg.leftCol + 1);
7522
- }
7523
- else { // a single-column segment
7524
- loneCellMatrix[i][col] = td;
7525
- }
7526
-
7527
- while (col <= seg.rightCol) {
7528
- cellMatrix[i][col] = td;
7529
- segMatrix[i][col] = seg;
7530
- col++;
7531
- }
7532
-
7533
- tr.append(td);
7534
- }
7535
- }
7536
-
7537
- emptyCellsUntil(colCnt); // finish off the row
7538
- this.bookendCells(tr);
7539
- tbody.append(tr);
7540
- }
7541
-
7542
- return { // a "rowStruct"
7543
- row: row, // the row number
7544
- tbodyEl: tbody,
7545
- cellMatrix: cellMatrix,
7546
- segMatrix: segMatrix,
7547
- segLevels: segLevels,
7548
- segs: rowSegs
7549
- };
7550
- },
7551
-
7552
-
7553
- // Stacks a flat array of segments, which are all assumed to be in the same row, into subarrays of vertical levels.
7554
- // NOTE: modifies segs
7555
- buildSegLevels: function(segs) {
7556
- var levels = [];
7557
- var i, seg;
7558
- var j;
7559
-
7560
- // Give preference to elements with certain criteria, so they have
7561
- // a chance to be closer to the top.
7562
- this.sortEventSegs(segs);
7563
-
7564
- for (i = 0; i < segs.length; i++) {
7565
- seg = segs[i];
7566
-
7567
- // loop through levels, starting with the topmost, until the segment doesn't collide with other segments
7568
- for (j = 0; j < levels.length; j++) {
7569
- if (!isDaySegCollision(seg, levels[j])) {
7570
- break;
7571
- }
7572
- }
7573
- // `j` now holds the desired subrow index
7574
- seg.level = j;
7575
-
7576
- // create new level array if needed and append segment
7577
- (levels[j] || (levels[j] = [])).push(seg);
7578
- }
7579
-
7580
- // order segments left-to-right. very important if calendar is RTL
7581
- for (j = 0; j < levels.length; j++) {
7582
- levels[j].sort(compareDaySegCols);
7583
- }
7584
-
7585
- return levels;
7586
- },
7587
-
7588
-
7589
- // Given a flat array of segments, return an array of sub-arrays, grouped by each segment's row
7590
- groupSegRows: function(segs) {
7591
- var segRows = [];
7592
- var i;
7593
-
7594
- for (i = 0; i < this.rowCnt; i++) {
7595
- segRows.push([]);
7596
- }
7597
-
7598
- for (i = 0; i < segs.length; i++) {
7599
- segRows[segs[i].row].push(segs[i]);
7600
- }
7601
-
7602
- return segRows;
7603
- }
7604
-
7605
- });
7606
-
7607
-
7608
- // Computes whether two segments' columns collide. They are assumed to be in the same row.
7609
- function isDaySegCollision(seg, otherSegs) {
7610
- var i, otherSeg;
7611
-
7612
- for (i = 0; i < otherSegs.length; i++) {
7613
- otherSeg = otherSegs[i];
7614
-
7615
- if (
7616
- otherSeg.leftCol <= seg.rightCol &&
7617
- otherSeg.rightCol >= seg.leftCol
7618
- ) {
7619
- return true;
7620
- }
7621
- }
7622
-
7623
- return false;
7624
- }
7625
-
7626
-
7627
- // A cmp function for determining the leftmost event
7628
- function compareDaySegCols(a, b) {
7629
- return a.leftCol - b.leftCol;
7630
- }
7631
-
7632
- ;;
7633
-
7634
- /* Methods relate to limiting the number events for a given day on a DayGrid
7635
- ----------------------------------------------------------------------------------------------------------------------*/
7636
- // NOTE: all the segs being passed around in here are foreground segs
7637
-
7638
- DayGrid.mixin({
7639
-
7640
- segPopover: null, // the Popover that holds events that can't fit in a cell. null when not visible
7641
- popoverSegs: null, // an array of segment objects that the segPopover holds. null when not visible
7642
-
7643
-
7644
- removeSegPopover: function() {
7645
- if (this.segPopover) {
7646
- this.segPopover.hide(); // in handler, will call segPopover's removeElement
7647
- }
7648
- },
7649
-
7650
-
7651
- // Limits the number of "levels" (vertically stacking layers of events) for each row of the grid.
7652
- // `levelLimit` can be false (don't limit), a number, or true (should be computed).
7653
- limitRows: function(levelLimit) {
7654
- var rowStructs = this.rowStructs || [];
7655
- var row; // row #
7656
- var rowLevelLimit;
7657
-
7658
- for (row = 0; row < rowStructs.length; row++) {
7659
- this.unlimitRow(row);
7660
-
7661
- if (!levelLimit) {
7662
- rowLevelLimit = false;
7663
- }
7664
- else if (typeof levelLimit === 'number') {
7665
- rowLevelLimit = levelLimit;
7666
- }
7667
- else {
7668
- rowLevelLimit = this.computeRowLevelLimit(row);
7669
- }
7670
-
7671
- if (rowLevelLimit !== false) {
7672
- this.limitRow(row, rowLevelLimit);
7673
- }
7674
- }
7675
- },
7676
-
7677
-
7678
- // Computes the number of levels a row will accomodate without going outside its bounds.
7679
- // Assumes the row is "rigid" (maintains a constant height regardless of what is inside).
7680
- // `row` is the row number.
7681
- computeRowLevelLimit: function(row) {
7682
- var rowEl = this.rowEls.eq(row); // the containing "fake" row div
7683
- var rowHeight = rowEl.height(); // TODO: cache somehow?
7684
- var trEls = this.rowStructs[row].tbodyEl.children();
7685
- var i, trEl;
7686
- var trHeight;
7687
-
7688
- function iterInnerHeights(i, childNode) {
7689
- trHeight = Math.max(trHeight, $(childNode).outerHeight());
7690
- }
7691
-
7692
- // Reveal one level <tr> at a time and stop when we find one out of bounds
7693
- for (i = 0; i < trEls.length; i++) {
7694
- trEl = trEls.eq(i).removeClass('fc-limited'); // reset to original state (reveal)
7695
-
7696
- // with rowspans>1 and IE8, trEl.outerHeight() would return the height of the largest cell,
7697
- // so instead, find the tallest inner content element.
7698
- trHeight = 0;
7699
- trEl.find('> td > :first-child').each(iterInnerHeights);
7700
-
7701
- if (trEl.position().top + trHeight > rowHeight) {
7702
- return i;
7703
- }
7704
- }
7705
-
7706
- return false; // should not limit at all
7707
- },
7708
-
7709
-
7710
- // Limits the given grid row to the maximum number of levels and injects "more" links if necessary.
7711
- // `row` is the row number.
7712
- // `levelLimit` is a number for the maximum (inclusive) number of levels allowed.
7713
- limitRow: function(row, levelLimit) {
7714
- var _this = this;
7715
- var rowStruct = this.rowStructs[row];
7716
- var moreNodes = []; // array of "more" <a> links and <td> DOM nodes
7717
- var col = 0; // col #, left-to-right (not chronologically)
7718
- var levelSegs; // array of segment objects in the last allowable level, ordered left-to-right
7719
- var cellMatrix; // a matrix (by level, then column) of all <td> jQuery elements in the row
7720
- var limitedNodes; // array of temporarily hidden level <tr> and segment <td> DOM nodes
7721
- var i, seg;
7722
- var segsBelow; // array of segment objects below `seg` in the current `col`
7723
- var totalSegsBelow; // total number of segments below `seg` in any of the columns `seg` occupies
7724
- var colSegsBelow; // array of segment arrays, below seg, one for each column (offset from segs's first column)
7725
- var td, rowspan;
7726
- var segMoreNodes; // array of "more" <td> cells that will stand-in for the current seg's cell
7727
- var j;
7728
- var moreTd, moreWrap, moreLink;
7729
-
7730
- // Iterates through empty level cells and places "more" links inside if need be
7731
- function emptyCellsUntil(endCol) { // goes from current `col` to `endCol`
7732
- while (col < endCol) {
7733
- segsBelow = _this.getCellSegs(row, col, levelLimit);
7734
- if (segsBelow.length) {
7735
- td = cellMatrix[levelLimit - 1][col];
7736
- moreLink = _this.renderMoreLink(row, col, segsBelow);
7737
- moreWrap = $('<div/>').append(moreLink);
7738
- td.append(moreWrap);
7739
- moreNodes.push(moreWrap[0]);
7740
- }
7741
- col++;
7742
- }
7743
- }
7744
-
7745
- if (levelLimit && levelLimit < rowStruct.segLevels.length) { // is it actually over the limit?
7746
- levelSegs = rowStruct.segLevels[levelLimit - 1];
7747
- cellMatrix = rowStruct.cellMatrix;
7748
-
7749
- limitedNodes = rowStruct.tbodyEl.children().slice(levelLimit) // get level <tr> elements past the limit
7750
- .addClass('fc-limited').get(); // hide elements and get a simple DOM-nodes array
7751
-
7752
- // iterate though segments in the last allowable level
7753
- for (i = 0; i < levelSegs.length; i++) {
7754
- seg = levelSegs[i];
7755
- emptyCellsUntil(seg.leftCol); // process empty cells before the segment
7756
-
7757
- // determine *all* segments below `seg` that occupy the same columns
7758
- colSegsBelow = [];
7759
- totalSegsBelow = 0;
7760
- while (col <= seg.rightCol) {
7761
- segsBelow = this.getCellSegs(row, col, levelLimit);
7762
- colSegsBelow.push(segsBelow);
7763
- totalSegsBelow += segsBelow.length;
7764
- col++;
7765
- }
7766
-
7767
- if (totalSegsBelow) { // do we need to replace this segment with one or many "more" links?
7768
- td = cellMatrix[levelLimit - 1][seg.leftCol]; // the segment's parent cell
7769
- rowspan = td.attr('rowspan') || 1;
7770
- segMoreNodes = [];
7771
-
7772
- // make a replacement <td> for each column the segment occupies. will be one for each colspan
7773
- for (j = 0; j < colSegsBelow.length; j++) {
7774
- moreTd = $('<td class="fc-more-cell"/>').attr('rowspan', rowspan);
7775
- segsBelow = colSegsBelow[j];
7776
- moreLink = this.renderMoreLink(
7777
- row,
7778
- seg.leftCol + j,
7779
- [ seg ].concat(segsBelow) // count seg as hidden too
7780
- );
7781
- moreWrap = $('<div/>').append(moreLink);
7782
- moreTd.append(moreWrap);
7783
- segMoreNodes.push(moreTd[0]);
7784
- moreNodes.push(moreTd[0]);
7785
- }
7786
-
7787
- td.addClass('fc-limited').after($(segMoreNodes)); // hide original <td> and inject replacements
7788
- limitedNodes.push(td[0]);
7789
- }
7790
- }
7791
-
7792
- emptyCellsUntil(this.colCnt); // finish off the level
7793
- rowStruct.moreEls = $(moreNodes); // for easy undoing later
7794
- rowStruct.limitedEls = $(limitedNodes); // for easy undoing later
7795
- }
7796
- },
7797
-
7798
-
7799
- // Reveals all levels and removes all "more"-related elements for a grid's row.
7800
- // `row` is a row number.
7801
- unlimitRow: function(row) {
7802
- var rowStruct = this.rowStructs[row];
7803
-
7804
- if (rowStruct.moreEls) {
7805
- rowStruct.moreEls.remove();
7806
- rowStruct.moreEls = null;
7807
- }
7808
-
7809
- if (rowStruct.limitedEls) {
7810
- rowStruct.limitedEls.removeClass('fc-limited');
7811
- rowStruct.limitedEls = null;
7812
- }
7813
- },
7814
-
7815
-
7816
- // Renders an <a> element that represents hidden event element for a cell.
7817
- // Responsible for attaching click handler as well.
7818
- renderMoreLink: function(row, col, hiddenSegs) {
7819
- var _this = this;
7820
- var view = this.view;
7821
-
7822
- return $('<a class="fc-more"/>')
7823
- .text(
7824
- this.getMoreLinkText(hiddenSegs.length)
7825
- )
7826
- .on('click', function(ev) {
7827
- var clickOption = view.opt('eventLimitClick');
7828
- var date = _this.getCellDate(row, col);
7829
- var moreEl = $(this);
7830
- var dayEl = _this.getCellEl(row, col);
7831
- var allSegs = _this.getCellSegs(row, col);
7832
-
7833
- // rescope the segments to be within the cell's date
7834
- var reslicedAllSegs = _this.resliceDaySegs(allSegs, date);
7835
- var reslicedHiddenSegs = _this.resliceDaySegs(hiddenSegs, date);
7836
-
7837
- if (typeof clickOption === 'function') {
7838
- // the returned value can be an atomic option
7839
- clickOption = view.publiclyTrigger('eventLimitClick', null, {
7840
- date: date,
7841
- dayEl: dayEl,
7842
- moreEl: moreEl,
7843
- segs: reslicedAllSegs,
7844
- hiddenSegs: reslicedHiddenSegs
7845
- }, ev);
7846
- }
7847
-
7848
- if (clickOption === 'popover') {
7849
- _this.showSegPopover(row, col, moreEl, reslicedAllSegs);
7850
- }
7851
- else if (typeof clickOption === 'string') { // a view name
7852
- view.calendar.zoomTo(date, clickOption);
7853
- }
7854
- });
7855
- },
7856
-
7857
-
7858
- // Reveals the popover that displays all events within a cell
7859
- showSegPopover: function(row, col, moreLink, segs) {
7860
- var _this = this;
7861
- var view = this.view;
7862
- var moreWrap = moreLink.parent(); // the <div> wrapper around the <a>
7863
- var topEl; // the element we want to match the top coordinate of
7864
- var options;
7865
-
7866
- if (this.rowCnt == 1) {
7867
- topEl = view.el; // will cause the popover to cover any sort of header
7868
- }
7869
- else {
7870
- topEl = this.rowEls.eq(row); // will align with top of row
7871
- }
7872
-
7873
- options = {
7874
- className: 'fc-more-popover',
7875
- content: this.renderSegPopoverContent(row, col, segs),
7876
- parentEl: this.view.el, // attach to root of view. guarantees outside of scrollbars.
7877
- top: topEl.offset().top,
7878
- autoHide: true, // when the user clicks elsewhere, hide the popover
7879
- viewportConstrain: view.opt('popoverViewportConstrain'),
7880
- hide: function() {
7881
- // kill everything when the popover is hidden
7882
- // notify events to be removed
7883
- if (_this.popoverSegs) {
7884
- var seg;
7885
- for (var i = 0; i < _this.popoverSegs.length; ++i) {
7886
- seg = _this.popoverSegs[i];
7887
- view.publiclyTrigger('eventDestroy', seg.event, seg.event, seg.el);
7888
- }
7889
- }
7890
- _this.segPopover.removeElement();
7891
- _this.segPopover = null;
7892
- _this.popoverSegs = null;
7893
- }
7894
- };
7895
-
7896
- // Determine horizontal coordinate.
7897
- // We use the moreWrap instead of the <td> to avoid border confusion.
7898
- if (this.isRTL) {
7899
- options.right = moreWrap.offset().left + moreWrap.outerWidth() + 1; // +1 to be over cell border
7900
- }
7901
- else {
7902
- options.left = moreWrap.offset().left - 1; // -1 to be over cell border
7903
- }
7904
-
7905
- this.segPopover = new Popover(options);
7906
- this.segPopover.show();
7907
-
7908
- // the popover doesn't live within the grid's container element, and thus won't get the event
7909
- // delegated-handlers for free. attach event-related handlers to the popover.
7910
- this.bindSegHandlersToEl(this.segPopover.el);
7911
- },
7912
-
7913
-
7914
- // Builds the inner DOM contents of the segment popover
7915
- renderSegPopoverContent: function(row, col, segs) {
7916
- var view = this.view;
7917
- var isTheme = view.opt('theme');
7918
- var title = this.getCellDate(row, col).format(view.opt('dayPopoverFormat'));
7919
- var content = $(
7920
- '<div class="fc-header ' + view.widgetHeaderClass + '">' +
7921
- '<span class="fc-close ' +
7922
- (isTheme ? 'ui-icon ui-icon-closethick' : 'fc-icon fc-icon-x') +
7923
- '"></span>' +
7924
- '<span class="fc-title">' +
7925
- htmlEscape(title) +
7926
- '</span>' +
7927
- '<div class="fc-clear"/>' +
7928
- '</div>' +
7929
- '<div class="fc-body ' + view.widgetContentClass + '">' +
7930
- '<div class="fc-event-container"></div>' +
7931
- '</div>'
7932
- );
7933
- var segContainer = content.find('.fc-event-container');
7934
- var i;
7935
-
7936
- // render each seg's `el` and only return the visible segs
7937
- segs = this.renderFgSegEls(segs, true); // disableResizing=true
7938
- this.popoverSegs = segs;
7939
-
7940
- for (i = 0; i < segs.length; i++) {
7941
-
7942
- // because segments in the popover are not part of a grid coordinate system, provide a hint to any
7943
- // grids that want to do drag-n-drop about which cell it came from
7944
- this.hitsNeeded();
7945
- segs[i].hit = this.getCellHit(row, col);
7946
- this.hitsNotNeeded();
7947
-
7948
- segContainer.append(segs[i].el);
7949
- }
7950
-
7951
- return content;
7952
- },
7953
-
7954
-
7955
- // Given the events within an array of segment objects, reslice them to be in a single day
7956
- resliceDaySegs: function(segs, dayDate) {
7957
-
7958
- // build an array of the original events
7959
- var events = $.map(segs, function(seg) {
7960
- return seg.event;
7961
- });
7962
-
7963
- var dayStart = dayDate.clone();
7964
- var dayEnd = dayStart.clone().add(1, 'days');
7965
- var dayRange = { start: dayStart, end: dayEnd };
7966
-
7967
- // slice the events with a custom slicing function
7968
- segs = this.eventsToSegs(
7969
- events,
7970
- function(range) {
7971
- var seg = intersectRanges(range, dayRange); // undefind if no intersection
7972
- return seg ? [ seg ] : []; // must return an array of segments
7973
- }
7974
- );
7975
-
7976
- // force an order because eventsToSegs doesn't guarantee one
7977
- this.sortEventSegs(segs);
7978
-
7979
- return segs;
7980
- },
7981
-
7982
-
7983
- // Generates the text that should be inside a "more" link, given the number of events it represents
7984
- getMoreLinkText: function(num) {
7985
- var opt = this.view.opt('eventLimitText');
7986
-
7987
- if (typeof opt === 'function') {
7988
- return opt(num);
7989
- }
7990
- else {
7991
- return '+' + num + ' ' + opt;
7992
- }
7993
- },
7994
-
7995
-
7996
- // Returns segments within a given cell.
7997
- // If `startLevel` is specified, returns only events including and below that level. Otherwise returns all segs.
7998
- getCellSegs: function(row, col, startLevel) {
7999
- var segMatrix = this.rowStructs[row].segMatrix;
8000
- var level = startLevel || 0;
8001
- var segs = [];
8002
- var seg;
8003
-
8004
- while (level < segMatrix.length) {
8005
- seg = segMatrix[level][col];
8006
- if (seg) {
8007
- segs.push(seg);
8008
- }
8009
- level++;
8010
- }
8011
-
8012
- return segs;
8013
- }
8014
-
8015
- });
8016
-
8017
- ;;
8018
-
8019
- /* A component that renders one or more columns of vertical time slots
8020
- ----------------------------------------------------------------------------------------------------------------------*/
8021
- // We mixin DayTable, even though there is only a single row of days
8022
-
8023
- var TimeGrid = FC.TimeGrid = Grid.extend(DayTableMixin, {
8024
-
8025
- slotDuration: null, // duration of a "slot", a distinct time segment on given day, visualized by lines
8026
- snapDuration: null, // granularity of time for dragging and selecting
8027
- snapsPerSlot: null,
8028
- labelFormat: null, // formatting string for times running along vertical axis
8029
- labelInterval: null, // duration of how often a label should be displayed for a slot
8030
-
8031
- colEls: null, // cells elements in the day-row background
8032
- slatContainerEl: null, // div that wraps all the slat rows
8033
- slatEls: null, // elements running horizontally across all columns
8034
- nowIndicatorEls: null,
8035
-
8036
- colCoordCache: null,
8037
- slatCoordCache: null,
8038
-
8039
-
8040
- constructor: function() {
8041
- Grid.apply(this, arguments); // call the super-constructor
8042
-
8043
- this.processOptions();
8044
- },
8045
-
8046
-
8047
- // Renders the time grid into `this.el`, which should already be assigned.
8048
- // Relies on the view's colCnt. In the future, this component should probably be self-sufficient.
8049
- renderDates: function() {
8050
- this.el.html(this.renderHtml());
8051
- this.colEls = this.el.find('.fc-day, .fc-disabled-day');
8052
- this.slatContainerEl = this.el.find('.fc-slats');
8053
- this.slatEls = this.slatContainerEl.find('tr');
8054
-
8055
- this.colCoordCache = new CoordCache({
8056
- els: this.colEls,
8057
- isHorizontal: true
8058
- });
8059
- this.slatCoordCache = new CoordCache({
8060
- els: this.slatEls,
8061
- isVertical: true
8062
- });
8063
-
8064
- this.renderContentSkeleton();
8065
- },
8066
-
8067
-
8068
- // Renders the basic HTML skeleton for the grid
8069
- renderHtml: function() {
8070
- return '' +
8071
- '<div class="fc-bg">' +
8072
- '<table>' +
8073
- this.renderBgTrHtml(0) + // row=0
8074
- '</table>' +
8075
- '</div>' +
8076
- '<div class="fc-slats">' +
8077
- '<table>' +
8078
- this.renderSlatRowHtml() +
8079
- '</table>' +
8080
- '</div>';
8081
- },
8082
-
8083
-
8084
- // Generates the HTML for the horizontal "slats" that run width-wise. Has a time axis on a side. Depends on RTL.
8085
- renderSlatRowHtml: function() {
8086
- var view = this.view;
8087
- var isRTL = this.isRTL;
8088
- var html = '';
8089
- var slotTime = moment.duration(+this.view.minTime); // wish there was .clone() for durations
8090
- var slotDate; // will be on the view's first day, but we only care about its time
8091
- var isLabeled;
8092
- var axisHtml;
8093
-
8094
- // Calculate the time for each slot
8095
- while (slotTime < this.view.maxTime) {
8096
- slotDate = this.start.clone().time(slotTime);
8097
- isLabeled = isInt(divideDurationByDuration(slotTime, this.labelInterval));
8098
-
8099
- axisHtml =
8100
- '<td class="fc-axis fc-time ' + view.widgetContentClass + '" ' + view.axisStyleAttr() + '>' +
8101
- (isLabeled ?
8102
- '<span>' + // for matchCellWidths
8103
- htmlEscape(slotDate.format(this.labelFormat)) +
8104
- '</span>' :
8105
- ''
8106
- ) +
8107
- '</td>';
8108
-
8109
- html +=
8110
- '<tr data-time="' + slotDate.format('HH:mm:ss') + '"' +
8111
- (isLabeled ? '' : ' class="fc-minor"') +
8112
- '>' +
8113
- (!isRTL ? axisHtml : '') +
8114
- '<td class="' + view.widgetContentClass + '"/>' +
8115
- (isRTL ? axisHtml : '') +
8116
- "</tr>";
8117
-
8118
- slotTime.add(this.slotDuration);
8119
- }
8120
-
8121
- return html;
8122
- },
8123
-
8124
-
8125
- /* Options
8126
- ------------------------------------------------------------------------------------------------------------------*/
8127
-
8128
-
8129
- // Parses various options into properties of this object
8130
- processOptions: function() {
8131
- var view = this.view;
8132
- var slotDuration = view.opt('slotDuration');
8133
- var snapDuration = view.opt('snapDuration');
8134
- var input;
8135
-
8136
- slotDuration = moment.duration(slotDuration);
8137
- snapDuration = snapDuration ? moment.duration(snapDuration) : slotDuration;
8138
-
8139
- this.slotDuration = slotDuration;
8140
- this.snapDuration = snapDuration;
8141
- this.snapsPerSlot = slotDuration / snapDuration; // TODO: ensure an integer multiple?
8142
-
8143
- this.minResizeDuration = snapDuration; // hack
8144
-
8145
- // might be an array value (for TimelineView).
8146
- // if so, getting the most granular entry (the last one probably).
8147
- input = view.opt('slotLabelFormat');
8148
- if ($.isArray(input)) {
8149
- input = input[input.length - 1];
8150
- }
8151
-
8152
- this.labelFormat =
8153
- input ||
8154
- view.opt('smallTimeFormat'); // the computed default
8155
-
8156
- input = view.opt('slotLabelInterval');
8157
- this.labelInterval = input ?
8158
- moment.duration(input) :
8159
- this.computeLabelInterval(slotDuration);
8160
- },
8161
-
8162
-
8163
- // Computes an automatic value for slotLabelInterval
8164
- computeLabelInterval: function(slotDuration) {
8165
- var i;
8166
- var labelInterval;
8167
- var slotsPerLabel;
8168
-
8169
- // find the smallest stock label interval that results in more than one slots-per-label
8170
- for (i = AGENDA_STOCK_SUB_DURATIONS.length - 1; i >= 0; i--) {
8171
- labelInterval = moment.duration(AGENDA_STOCK_SUB_DURATIONS[i]);
8172
- slotsPerLabel = divideDurationByDuration(labelInterval, slotDuration);
8173
- if (isInt(slotsPerLabel) && slotsPerLabel > 1) {
8174
- return labelInterval;
8175
- }
8176
- }
8177
-
8178
- return moment.duration(slotDuration); // fall back. clone
8179
- },
8180
-
8181
-
8182
- // Computes a default event time formatting string if `timeFormat` is not explicitly defined
8183
- computeEventTimeFormat: function() {
8184
- return this.view.opt('noMeridiemTimeFormat'); // like "6:30" (no AM/PM)
8185
- },
8186
-
8187
-
8188
- // Computes a default `displayEventEnd` value if one is not expliclty defined
8189
- computeDisplayEventEnd: function() {
8190
- return true;
8191
- },
8192
-
8193
-
8194
- /* Hit System
8195
- ------------------------------------------------------------------------------------------------------------------*/
8196
-
8197
-
8198
- prepareHits: function() {
8199
- this.colCoordCache.build();
8200
- this.slatCoordCache.build();
8201
- },
8202
-
8203
-
8204
- releaseHits: function() {
8205
- this.colCoordCache.clear();
8206
- // NOTE: don't clear slatCoordCache because we rely on it for computeTimeTop
8207
- },
8208
-
8209
-
8210
- queryHit: function(leftOffset, topOffset) {
8211
- var snapsPerSlot = this.snapsPerSlot;
8212
- var colCoordCache = this.colCoordCache;
8213
- var slatCoordCache = this.slatCoordCache;
8214
-
8215
- if (colCoordCache.isLeftInBounds(leftOffset) && slatCoordCache.isTopInBounds(topOffset)) {
8216
- var colIndex = colCoordCache.getHorizontalIndex(leftOffset);
8217
- var slatIndex = slatCoordCache.getVerticalIndex(topOffset);
8218
-
8219
- if (colIndex != null && slatIndex != null) {
8220
- var slatTop = slatCoordCache.getTopOffset(slatIndex);
8221
- var slatHeight = slatCoordCache.getHeight(slatIndex);
8222
- var partial = (topOffset - slatTop) / slatHeight; // floating point number between 0 and 1
8223
- var localSnapIndex = Math.floor(partial * snapsPerSlot); // the snap # relative to start of slat
8224
- var snapIndex = slatIndex * snapsPerSlot + localSnapIndex;
8225
- var snapTop = slatTop + (localSnapIndex / snapsPerSlot) * slatHeight;
8226
- var snapBottom = slatTop + ((localSnapIndex + 1) / snapsPerSlot) * slatHeight;
8227
-
8228
- return {
8229
- col: colIndex,
8230
- snap: snapIndex,
8231
- component: this, // needed unfortunately :(
8232
- left: colCoordCache.getLeftOffset(colIndex),
8233
- right: colCoordCache.getRightOffset(colIndex),
8234
- top: snapTop,
8235
- bottom: snapBottom
8236
- };
8237
- }
8238
- }
8239
- },
8240
-
8241
-
8242
- getHitSpan: function(hit) {
8243
- var start = this.getCellDate(0, hit.col); // row=0
8244
- var time = this.computeSnapTime(hit.snap); // pass in the snap-index
8245
- var end;
8246
-
8247
- start.time(time);
8248
- end = start.clone().add(this.snapDuration);
8249
-
8250
- return { start: start, end: end };
8251
- },
8252
-
8253
-
8254
- getHitEl: function(hit) {
8255
- return this.colEls.eq(hit.col);
8256
- },
8257
-
8258
-
8259
- /* Dates
8260
- ------------------------------------------------------------------------------------------------------------------*/
8261
-
8262
-
8263
- rangeUpdated: function() {
8264
- this.updateDayTable();
8265
- },
8266
-
8267
-
8268
- // Given a row number of the grid, representing a "snap", returns a time (Duration) from its start-of-day
8269
- computeSnapTime: function(snapIndex) {
8270
- return moment.duration(this.view.minTime + this.snapDuration * snapIndex);
8271
- },
8272
-
8273
-
8274
- // Slices up the given span (unzoned start/end with other misc data) into an array of segments
8275
- spanToSegs: function(span) {
8276
- var segs = this.sliceRangeByTimes(span);
8277
- var i;
8278
-
8279
- for (i = 0; i < segs.length; i++) {
8280
- if (this.isRTL) {
8281
- segs[i].col = this.daysPerRow - 1 - segs[i].dayIndex;
8282
- }
8283
- else {
8284
- segs[i].col = segs[i].dayIndex;
8285
- }
8286
- }
8287
-
8288
- return segs;
8289
- },
8290
-
8291
-
8292
- sliceRangeByTimes: function(range) {
8293
- var segs = [];
8294
- var seg;
8295
- var dayIndex;
8296
- var dayDate;
8297
- var dayRange;
8298
-
8299
- for (dayIndex = 0; dayIndex < this.daysPerRow; dayIndex++) {
8300
- dayDate = this.dayDates[dayIndex].clone().time(0); // TODO: better API for this?
8301
- dayRange = {
8302
- start: dayDate.clone().add(this.view.minTime), // don't use .time() because it sux with negatives
8303
- end: dayDate.clone().add(this.view.maxTime)
8304
- };
8305
- seg = intersectRanges(range, dayRange); // both will be ambig timezone
8306
- if (seg) {
8307
- seg.dayIndex = dayIndex;
8308
- segs.push(seg);
8309
- }
8310
- }
8311
-
8312
- return segs;
8313
- },
8314
-
8315
-
8316
- /* Coordinates
8317
- ------------------------------------------------------------------------------------------------------------------*/
8318
-
8319
-
8320
- updateSize: function(isResize) { // NOT a standard Grid method
8321
- this.slatCoordCache.build();
8322
-
8323
- if (isResize) {
8324
- this.updateSegVerticals(
8325
- [].concat(this.fgSegs || [], this.bgSegs || [], this.businessSegs || [])
8326
- );
8327
- }
8328
- },
8329
-
8330
-
8331
- getTotalSlatHeight: function() {
8332
- return this.slatContainerEl.outerHeight();
8333
- },
8334
-
8335
-
8336
- // Computes the top coordinate, relative to the bounds of the grid, of the given date.
8337
- // A `startOfDayDate` must be given for avoiding ambiguity over how to treat midnight.
8338
- computeDateTop: function(date, startOfDayDate) {
8339
- return this.computeTimeTop(
8340
- moment.duration(
8341
- date - startOfDayDate.clone().stripTime()
8342
- )
8343
- );
8344
- },
8345
-
8346
-
8347
- // Computes the top coordinate, relative to the bounds of the grid, of the given time (a Duration).
8348
- computeTimeTop: function(time) {
8349
- var len = this.slatEls.length;
8350
- var slatCoverage = (time - this.view.minTime) / this.slotDuration; // floating-point value of # of slots covered
8351
- var slatIndex;
8352
- var slatRemainder;
8353
-
8354
- // compute a floating-point number for how many slats should be progressed through.
8355
- // from 0 to number of slats (inclusive)
8356
- // constrained because minTime/maxTime might be customized.
8357
- slatCoverage = Math.max(0, slatCoverage);
8358
- slatCoverage = Math.min(len, slatCoverage);
8359
-
8360
- // an integer index of the furthest whole slat
8361
- // from 0 to number slats (*exclusive*, so len-1)
8362
- slatIndex = Math.floor(slatCoverage);
8363
- slatIndex = Math.min(slatIndex, len - 1);
8364
-
8365
- // how much further through the slatIndex slat (from 0.0-1.0) must be covered in addition.
8366
- // could be 1.0 if slatCoverage is covering *all* the slots
8367
- slatRemainder = slatCoverage - slatIndex;
8368
-
8369
- return this.slatCoordCache.getTopPosition(slatIndex) +
8370
- this.slatCoordCache.getHeight(slatIndex) * slatRemainder;
8371
- },
8372
-
8373
-
8374
-
8375
- /* Event Drag Visualization
8376
- ------------------------------------------------------------------------------------------------------------------*/
8377
-
8378
-
8379
- // Renders a visual indication of an event being dragged over the specified date(s).
8380
- // A returned value of `true` signals that a mock "helper" event has been rendered.
8381
- renderDrag: function(eventLocation, seg) {
8382
- var eventSpans;
8383
- var i;
8384
-
8385
- if (seg) { // if there is event information for this drag, render a helper event
8386
-
8387
- // returns mock event elements
8388
- // signal that a helper has been rendered
8389
- return this.renderEventLocationHelper(eventLocation, seg);
8390
- }
8391
- else { // otherwise, just render a highlight
8392
- eventSpans = this.eventToSpans(eventLocation);
8393
-
8394
- for (i = 0; i < eventSpans.length; i++) {
8395
- this.renderHighlight(eventSpans[i]);
8396
- }
8397
- }
8398
- },
8399
-
8400
-
8401
- // Unrenders any visual indication of an event being dragged
8402
- unrenderDrag: function() {
8403
- this.unrenderHelper();
8404
- this.unrenderHighlight();
8405
- },
8406
-
8407
-
8408
- /* Event Resize Visualization
8409
- ------------------------------------------------------------------------------------------------------------------*/
8410
-
8411
-
8412
- // Renders a visual indication of an event being resized
8413
- renderEventResize: function(eventLocation, seg) {
8414
- return this.renderEventLocationHelper(eventLocation, seg); // returns mock event elements
8415
- },
8416
-
8417
-
8418
- // Unrenders any visual indication of an event being resized
8419
- unrenderEventResize: function() {
8420
- this.unrenderHelper();
8421
- },
8422
-
8423
-
8424
- /* Event Helper
8425
- ------------------------------------------------------------------------------------------------------------------*/
8426
-
8427
-
8428
- // Renders a mock "helper" event. `sourceSeg` is the original segment object and might be null (an external drag)
8429
- renderHelper: function(event, sourceSeg) {
8430
- return this.renderHelperSegs(this.eventToSegs(event), sourceSeg); // returns mock event elements
8431
- },
8432
-
8433
-
8434
- // Unrenders any mock helper event
8435
- unrenderHelper: function() {
8436
- this.unrenderHelperSegs();
8437
- },
8438
-
8439
-
8440
- /* Business Hours
8441
- ------------------------------------------------------------------------------------------------------------------*/
8442
-
8443
-
8444
- renderBusinessHours: function() {
8445
- this.renderBusinessSegs(
8446
- this.buildBusinessHourSegs()
8447
- );
8448
- },
8449
-
8450
-
8451
- unrenderBusinessHours: function() {
8452
- this.unrenderBusinessSegs();
8453
- },
8454
-
8455
-
8456
- /* Now Indicator
8457
- ------------------------------------------------------------------------------------------------------------------*/
8458
-
8459
-
8460
- getNowIndicatorUnit: function() {
8461
- return 'minute'; // will refresh on the minute
8462
- },
8463
-
8464
-
8465
- renderNowIndicator: function(date) {
8466
- // seg system might be overkill, but it handles scenario where line needs to be rendered
8467
- // more than once because of columns with the same date (resources columns for example)
8468
- var segs = this.spanToSegs({ start: date, end: date });
8469
- var top = this.computeDateTop(date, date);
8470
- var nodes = [];
8471
- var i;
8472
-
8473
- // render lines within the columns
8474
- for (i = 0; i < segs.length; i++) {
8475
- nodes.push($('<div class="fc-now-indicator fc-now-indicator-line"></div>')
8476
- .css('top', top)
8477
- .appendTo(this.colContainerEls.eq(segs[i].col))[0]);
8478
- }
8479
-
8480
- // render an arrow over the axis
8481
- if (segs.length > 0) { // is the current time in view?
8482
- nodes.push($('<div class="fc-now-indicator fc-now-indicator-arrow"></div>')
8483
- .css('top', top)
8484
- .appendTo(this.el.find('.fc-content-skeleton'))[0]);
8485
- }
8486
-
8487
- this.nowIndicatorEls = $(nodes);
8488
- },
8489
-
8490
-
8491
- unrenderNowIndicator: function() {
8492
- if (this.nowIndicatorEls) {
8493
- this.nowIndicatorEls.remove();
8494
- this.nowIndicatorEls = null;
8495
- }
8496
- },
8497
-
8498
-
8499
- /* Selection
8500
- ------------------------------------------------------------------------------------------------------------------*/
8501
-
8502
-
8503
- // Renders a visual indication of a selection. Overrides the default, which was to simply render a highlight.
8504
- renderSelection: function(span) {
8505
- if (this.view.opt('selectHelper')) { // this setting signals that a mock helper event should be rendered
8506
-
8507
- // normally acceps an eventLocation, span has a start/end, which is good enough
8508
- this.renderEventLocationHelper(span);
8509
- }
8510
- else {
8511
- this.renderHighlight(span);
8512
- }
8513
- },
8514
-
8515
-
8516
- // Unrenders any visual indication of a selection
8517
- unrenderSelection: function() {
8518
- this.unrenderHelper();
8519
- this.unrenderHighlight();
8520
- },
8521
-
8522
-
8523
- /* Highlight
8524
- ------------------------------------------------------------------------------------------------------------------*/
8525
-
8526
-
8527
- renderHighlight: function(span) {
8528
- this.renderHighlightSegs(this.spanToSegs(span));
8529
- },
8530
-
8531
-
8532
- unrenderHighlight: function() {
8533
- this.unrenderHighlightSegs();
8534
- }
8535
-
8536
- });
8537
-
8538
- ;;
8539
-
8540
- /* Methods for rendering SEGMENTS, pieces of content that live on the view
8541
- ( this file is no longer just for events )
8542
- ----------------------------------------------------------------------------------------------------------------------*/
8543
-
8544
- TimeGrid.mixin({
8545
-
8546
- colContainerEls: null, // containers for each column
8547
-
8548
- // inner-containers for each column where different types of segs live
8549
- fgContainerEls: null,
8550
- bgContainerEls: null,
8551
- helperContainerEls: null,
8552
- highlightContainerEls: null,
8553
- businessContainerEls: null,
8554
-
8555
- // arrays of different types of displayed segments
8556
- fgSegs: null,
8557
- bgSegs: null,
8558
- helperSegs: null,
8559
- highlightSegs: null,
8560
- businessSegs: null,
8561
-
8562
-
8563
- // Renders the DOM that the view's content will live in
8564
- renderContentSkeleton: function() {
8565
- var cellHtml = '';
8566
- var i;
8567
- var skeletonEl;
8568
-
8569
- for (i = 0; i < this.colCnt; i++) {
8570
- cellHtml +=
8571
- '<td>' +
8572
- '<div class="fc-content-col">' +
8573
- '<div class="fc-event-container fc-helper-container"></div>' +
8574
- '<div class="fc-event-container"></div>' +
8575
- '<div class="fc-highlight-container"></div>' +
8576
- '<div class="fc-bgevent-container"></div>' +
8577
- '<div class="fc-business-container"></div>' +
8578
- '</div>' +
8579
- '</td>';
8580
- }
8581
-
8582
- skeletonEl = $(
8583
- '<div class="fc-content-skeleton">' +
8584
- '<table>' +
8585
- '<tr>' + cellHtml + '</tr>' +
8586
- '</table>' +
8587
- '</div>'
8588
- );
8589
-
8590
- this.colContainerEls = skeletonEl.find('.fc-content-col');
8591
- this.helperContainerEls = skeletonEl.find('.fc-helper-container');
8592
- this.fgContainerEls = skeletonEl.find('.fc-event-container:not(.fc-helper-container)');
8593
- this.bgContainerEls = skeletonEl.find('.fc-bgevent-container');
8594
- this.highlightContainerEls = skeletonEl.find('.fc-highlight-container');
8595
- this.businessContainerEls = skeletonEl.find('.fc-business-container');
8596
-
8597
- this.bookendCells(skeletonEl.find('tr')); // TODO: do this on string level
8598
- this.el.append(skeletonEl);
8599
- },
8600
-
8601
-
8602
- /* Foreground Events
8603
- ------------------------------------------------------------------------------------------------------------------*/
8604
-
8605
-
8606
- renderFgSegs: function(segs) {
8607
- segs = this.renderFgSegsIntoContainers(segs, this.fgContainerEls);
8608
- this.fgSegs = segs;
8609
- return segs; // needed for Grid::renderEvents
8610
- },
8611
-
8612
-
8613
- unrenderFgSegs: function() {
8614
- this.unrenderNamedSegs('fgSegs');
8615
- },
8616
-
8617
-
8618
- /* Foreground Helper Events
8619
- ------------------------------------------------------------------------------------------------------------------*/
8620
-
8621
-
8622
- renderHelperSegs: function(segs, sourceSeg) {
8623
- var helperEls = [];
8624
- var i, seg;
8625
- var sourceEl;
8626
-
8627
- segs = this.renderFgSegsIntoContainers(segs, this.helperContainerEls);
8628
-
8629
- // Try to make the segment that is in the same row as sourceSeg look the same
8630
- for (i = 0; i < segs.length; i++) {
8631
- seg = segs[i];
8632
- if (sourceSeg && sourceSeg.col === seg.col) {
8633
- sourceEl = sourceSeg.el;
8634
- seg.el.css({
8635
- left: sourceEl.css('left'),
8636
- right: sourceEl.css('right'),
8637
- 'margin-left': sourceEl.css('margin-left'),
8638
- 'margin-right': sourceEl.css('margin-right')
8639
- });
8640
- }
8641
- helperEls.push(seg.el[0]);
8642
- }
8643
-
8644
- this.helperSegs = segs;
8645
-
8646
- return $(helperEls); // must return rendered helpers
8647
- },
8648
-
8649
-
8650
- unrenderHelperSegs: function() {
8651
- this.unrenderNamedSegs('helperSegs');
8652
- },
8653
-
8654
-
8655
- /* Background Events
8656
- ------------------------------------------------------------------------------------------------------------------*/
8657
-
8658
-
8659
- renderBgSegs: function(segs) {
8660
- segs = this.renderFillSegEls('bgEvent', segs); // TODO: old fill system
8661
- this.updateSegVerticals(segs);
8662
- this.attachSegsByCol(this.groupSegsByCol(segs), this.bgContainerEls);
8663
- this.bgSegs = segs;
8664
- return segs; // needed for Grid::renderEvents
8665
- },
8666
-
8667
-
8668
- unrenderBgSegs: function() {
8669
- this.unrenderNamedSegs('bgSegs');
8670
- },
8671
-
8672
-
8673
- /* Highlight
8674
- ------------------------------------------------------------------------------------------------------------------*/
8675
-
8676
-
8677
- renderHighlightSegs: function(segs) {
8678
- segs = this.renderFillSegEls('highlight', segs); // TODO: old fill system
8679
- this.updateSegVerticals(segs);
8680
- this.attachSegsByCol(this.groupSegsByCol(segs), this.highlightContainerEls);
8681
- this.highlightSegs = segs;
8682
- },
8683
-
8684
-
8685
- unrenderHighlightSegs: function() {
8686
- this.unrenderNamedSegs('highlightSegs');
8687
- },
8688
-
8689
-
8690
- /* Business Hours
8691
- ------------------------------------------------------------------------------------------------------------------*/
8692
-
8693
-
8694
- renderBusinessSegs: function(segs) {
8695
- segs = this.renderFillSegEls('businessHours', segs); // TODO: old fill system
8696
- this.updateSegVerticals(segs);
8697
- this.attachSegsByCol(this.groupSegsByCol(segs), this.businessContainerEls);
8698
- this.businessSegs = segs;
8699
- },
8700
-
8701
-
8702
- unrenderBusinessSegs: function() {
8703
- this.unrenderNamedSegs('businessSegs');
8704
- },
8705
-
8706
-
8707
- /* Seg Rendering Utils
8708
- ------------------------------------------------------------------------------------------------------------------*/
8709
-
8710
-
8711
- // Given a flat array of segments, return an array of sub-arrays, grouped by each segment's col
8712
- groupSegsByCol: function(segs) {
8713
- var segsByCol = [];
8714
- var i;
8715
-
8716
- for (i = 0; i < this.colCnt; i++) {
8717
- segsByCol.push([]);
8718
- }
8719
-
8720
- for (i = 0; i < segs.length; i++) {
8721
- segsByCol[segs[i].col].push(segs[i]);
8722
- }
8723
-
8724
- return segsByCol;
8725
- },
8726
-
8727
-
8728
- // Given segments grouped by column, insert the segments' elements into a parallel array of container
8729
- // elements, each living within a column.
8730
- attachSegsByCol: function(segsByCol, containerEls) {
8731
- var col;
8732
- var segs;
8733
- var i;
8734
-
8735
- for (col = 0; col < this.colCnt; col++) { // iterate each column grouping
8736
- segs = segsByCol[col];
8737
-
8738
- for (i = 0; i < segs.length; i++) {
8739
- containerEls.eq(col).append(segs[i].el);
8740
- }
8741
- }
8742
- },
8743
-
8744
-
8745
- // Given the name of a property of `this` object, assumed to be an array of segments,
8746
- // loops through each segment and removes from DOM. Will null-out the property afterwards.
8747
- unrenderNamedSegs: function(propName) {
8748
- var segs = this[propName];
8749
- var i;
8750
-
8751
- if (segs) {
8752
- for (i = 0; i < segs.length; i++) {
8753
- segs[i].el.remove();
8754
- }
8755
- this[propName] = null;
8756
- }
8757
- },
8758
-
8759
-
8760
-
8761
- /* Foreground Event Rendering Utils
8762
- ------------------------------------------------------------------------------------------------------------------*/
8763
-
8764
-
8765
- // Given an array of foreground segments, render a DOM element for each, computes position,
8766
- // and attaches to the column inner-container elements.
8767
- renderFgSegsIntoContainers: function(segs, containerEls) {
8768
- var segsByCol;
8769
- var col;
8770
-
8771
- segs = this.renderFgSegEls(segs); // will call fgSegHtml
8772
- segsByCol = this.groupSegsByCol(segs);
8773
-
8774
- for (col = 0; col < this.colCnt; col++) {
8775
- this.updateFgSegCoords(segsByCol[col]);
8776
- }
8777
-
8778
- this.attachSegsByCol(segsByCol, containerEls);
8779
-
8780
- return segs;
8781
- },
8782
-
8783
-
8784
- // Renders the HTML for a single event segment's default rendering
8785
- fgSegHtml: function(seg, disableResizing) {
8786
- var view = this.view;
8787
- var event = seg.event;
8788
- var isDraggable = view.isEventDraggable(event);
8789
- var isResizableFromStart = !disableResizing && seg.isStart && view.isEventResizableFromStart(event);
8790
- var isResizableFromEnd = !disableResizing && seg.isEnd && view.isEventResizableFromEnd(event);
8791
- var classes = this.getSegClasses(seg, isDraggable, isResizableFromStart || isResizableFromEnd);
8792
- var skinCss = cssToStr(this.getSegSkinCss(seg));
8793
- var timeText;
8794
- var fullTimeText; // more verbose time text. for the print stylesheet
8795
- var startTimeText; // just the start time text
8796
-
8797
- classes.unshift('fc-time-grid-event', 'fc-v-event');
8798
-
8799
- if (view.isMultiDayEvent(event)) { // if the event appears to span more than one day...
8800
- // Don't display time text on segments that run entirely through a day.
8801
- // That would appear as midnight-midnight and would look dumb.
8802
- // Otherwise, display the time text for the *segment's* times (like 6pm-midnight or midnight-10am)
8803
- if (seg.isStart || seg.isEnd) {
8804
- timeText = this.getEventTimeText(seg);
8805
- fullTimeText = this.getEventTimeText(seg, 'LT');
8806
- startTimeText = this.getEventTimeText(seg, null, false); // displayEnd=false
8807
- }
8808
- } else {
8809
- // Display the normal time text for the *event's* times
8810
- timeText = this.getEventTimeText(event);
8811
- fullTimeText = this.getEventTimeText(event, 'LT');
8812
- startTimeText = this.getEventTimeText(event, null, false); // displayEnd=false
8813
- }
8814
-
8815
- return '<a class="' + classes.join(' ') + '"' +
8816
- (event.url ?
8817
- ' href="' + htmlEscape(event.url) + '"' :
8818
- ''
8819
- ) +
8820
- (skinCss ?
8821
- ' style="' + skinCss + '"' :
8822
- ''
8823
- ) +
8824
- '>' +
8825
- '<div class="fc-content">' +
8826
- (timeText ?
8827
- '<div class="fc-time"' +
8828
- ' data-start="' + htmlEscape(startTimeText) + '"' +
8829
- ' data-full="' + htmlEscape(fullTimeText) + '"' +
8830
- '>' +
8831
- '<span>' + htmlEscape(timeText) + '</span>' +
8832
- '</div>' :
8833
- ''
8834
- ) +
8835
- (event.title ?
8836
- '<div class="fc-title">' +
8837
- htmlEscape(event.title) +
8838
- '</div>' :
8839
- ''
8840
- ) +
8841
- '</div>' +
8842
- '<div class="fc-bg"/>' +
8843
- /* TODO: write CSS for this
8844
- (isResizableFromStart ?
8845
- '<div class="fc-resizer fc-start-resizer" />' :
8846
- ''
8847
- ) +
8848
- */
8849
- (isResizableFromEnd ?
8850
- '<div class="fc-resizer fc-end-resizer" />' :
8851
- ''
8852
- ) +
8853
- '</a>';
8854
- },
8855
-
8856
-
8857
- /* Seg Position Utils
8858
- ------------------------------------------------------------------------------------------------------------------*/
8859
-
8860
-
8861
- // Refreshes the CSS top/bottom coordinates for each segment element.
8862
- // Works when called after initial render, after a window resize/zoom for example.
8863
- updateSegVerticals: function(segs) {
8864
- this.computeSegVerticals(segs);
8865
- this.assignSegVerticals(segs);
8866
- },
8867
-
8868
-
8869
- // For each segment in an array, computes and assigns its top and bottom properties
8870
- computeSegVerticals: function(segs) {
8871
- var i, seg;
8872
- var dayDate;
8873
-
8874
- for (i = 0; i < segs.length; i++) {
8875
- seg = segs[i];
8876
- dayDate = this.dayDates[seg.dayIndex];
8877
-
8878
- seg.top = this.computeDateTop(seg.start, dayDate);
8879
- seg.bottom = this.computeDateTop(seg.end, dayDate);
8880
- }
8881
- },
8882
-
8883
-
8884
- // Given segments that already have their top/bottom properties computed, applies those values to
8885
- // the segments' elements.
8886
- assignSegVerticals: function(segs) {
8887
- var i, seg;
8888
-
8889
- for (i = 0; i < segs.length; i++) {
8890
- seg = segs[i];
8891
- seg.el.css(this.generateSegVerticalCss(seg));
8892
- }
8893
- },
8894
-
8895
-
8896
- // Generates an object with CSS properties for the top/bottom coordinates of a segment element
8897
- generateSegVerticalCss: function(seg) {
8898
- return {
8899
- top: seg.top,
8900
- bottom: -seg.bottom // flipped because needs to be space beyond bottom edge of event container
8901
- };
8902
- },
8903
-
8904
-
8905
- /* Foreground Event Positioning Utils
8906
- ------------------------------------------------------------------------------------------------------------------*/
8907
-
8908
-
8909
- // Given segments that are assumed to all live in the *same column*,
8910
- // compute their verical/horizontal coordinates and assign to their elements.
8911
- updateFgSegCoords: function(segs) {
8912
- this.computeSegVerticals(segs); // horizontals relies on this
8913
- this.computeFgSegHorizontals(segs); // compute horizontal coordinates, z-index's, and reorder the array
8914
- this.assignSegVerticals(segs);
8915
- this.assignFgSegHorizontals(segs);
8916
- },
8917
-
8918
-
8919
- // Given an array of segments that are all in the same column, sets the backwardCoord and forwardCoord on each.
8920
- // NOTE: Also reorders the given array by date!
8921
- computeFgSegHorizontals: function(segs) {
8922
- var levels;
8923
- var level0;
8924
- var i;
8925
-
8926
- this.sortEventSegs(segs); // order by certain criteria
8927
- levels = buildSlotSegLevels(segs);
8928
- computeForwardSlotSegs(levels);
8929
-
8930
- if ((level0 = levels[0])) {
8931
-
8932
- for (i = 0; i < level0.length; i++) {
8933
- computeSlotSegPressures(level0[i]);
8934
- }
8935
-
8936
- for (i = 0; i < level0.length; i++) {
8937
- this.computeFgSegForwardBack(level0[i], 0, 0);
8938
- }
8939
- }
8940
- },
8941
-
8942
-
8943
- // Calculate seg.forwardCoord and seg.backwardCoord for the segment, where both values range
8944
- // from 0 to 1. If the calendar is left-to-right, the seg.backwardCoord maps to "left" and
8945
- // seg.forwardCoord maps to "right" (via percentage). Vice-versa if the calendar is right-to-left.
8946
- //
8947
- // The segment might be part of a "series", which means consecutive segments with the same pressure
8948
- // who's width is unknown until an edge has been hit. `seriesBackwardPressure` is the number of
8949
- // segments behind this one in the current series, and `seriesBackwardCoord` is the starting
8950
- // coordinate of the first segment in the series.
8951
- computeFgSegForwardBack: function(seg, seriesBackwardPressure, seriesBackwardCoord) {
8952
- var forwardSegs = seg.forwardSegs;
8953
- var i;
8954
-
8955
- if (seg.forwardCoord === undefined) { // not already computed
8956
-
8957
- if (!forwardSegs.length) {
8958
-
8959
- // if there are no forward segments, this segment should butt up against the edge
8960
- seg.forwardCoord = 1;
8961
- }
8962
- else {
8963
-
8964
- // sort highest pressure first
8965
- this.sortForwardSegs(forwardSegs);
8966
-
8967
- // this segment's forwardCoord will be calculated from the backwardCoord of the
8968
- // highest-pressure forward segment.
8969
- this.computeFgSegForwardBack(forwardSegs[0], seriesBackwardPressure + 1, seriesBackwardCoord);
8970
- seg.forwardCoord = forwardSegs[0].backwardCoord;
8971
- }
8972
-
8973
- // calculate the backwardCoord from the forwardCoord. consider the series
8974
- seg.backwardCoord = seg.forwardCoord -
8975
- (seg.forwardCoord - seriesBackwardCoord) / // available width for series
8976
- (seriesBackwardPressure + 1); // # of segments in the series
8977
-
8978
- // use this segment's coordinates to computed the coordinates of the less-pressurized
8979
- // forward segments
8980
- for (i=0; i<forwardSegs.length; i++) {
8981
- this.computeFgSegForwardBack(forwardSegs[i], 0, seg.forwardCoord);
8982
- }
8983
- }
8984
- },
8985
-
8986
-
8987
- sortForwardSegs: function(forwardSegs) {
8988
- forwardSegs.sort(proxy(this, 'compareForwardSegs'));
8989
- },
8990
-
8991
-
8992
- // A cmp function for determining which forward segment to rely on more when computing coordinates.
8993
- compareForwardSegs: function(seg1, seg2) {
8994
- // put higher-pressure first
8995
- return seg2.forwardPressure - seg1.forwardPressure ||
8996
- // put segments that are closer to initial edge first (and favor ones with no coords yet)
8997
- (seg1.backwardCoord || 0) - (seg2.backwardCoord || 0) ||
8998
- // do normal sorting...
8999
- this.compareEventSegs(seg1, seg2);
9000
- },
9001
-
9002
-
9003
- // Given foreground event segments that have already had their position coordinates computed,
9004
- // assigns position-related CSS values to their elements.
9005
- assignFgSegHorizontals: function(segs) {
9006
- var i, seg;
9007
-
9008
- for (i = 0; i < segs.length; i++) {
9009
- seg = segs[i];
9010
- seg.el.css(this.generateFgSegHorizontalCss(seg));
9011
-
9012
- // if the height is short, add a className for alternate styling
9013
- if (seg.bottom - seg.top < 30) {
9014
- seg.el.addClass('fc-short');
9015
- }
9016
- }
9017
- },
9018
-
9019
-
9020
- // Generates an object with CSS properties/values that should be applied to an event segment element.
9021
- // Contains important positioning-related properties that should be applied to any event element, customized or not.
9022
- generateFgSegHorizontalCss: function(seg) {
9023
- var shouldOverlap = this.view.opt('slotEventOverlap');
9024
- var backwardCoord = seg.backwardCoord; // the left side if LTR. the right side if RTL. floating-point
9025
- var forwardCoord = seg.forwardCoord; // the right side if LTR. the left side if RTL. floating-point
9026
- var props = this.generateSegVerticalCss(seg); // get top/bottom first
9027
- var left; // amount of space from left edge, a fraction of the total width
9028
- var right; // amount of space from right edge, a fraction of the total width
9029
-
9030
- if (shouldOverlap) {
9031
- // double the width, but don't go beyond the maximum forward coordinate (1.0)
9032
- forwardCoord = Math.min(1, backwardCoord + (forwardCoord - backwardCoord) * 2);
9033
- }
9034
-
9035
- if (this.isRTL) {
9036
- left = 1 - forwardCoord;
9037
- right = backwardCoord;
9038
- }
9039
- else {
9040
- left = backwardCoord;
9041
- right = 1 - forwardCoord;
9042
- }
9043
-
9044
- props.zIndex = seg.level + 1; // convert from 0-base to 1-based
9045
- props.left = left * 100 + '%';
9046
- props.right = right * 100 + '%';
9047
-
9048
- if (shouldOverlap && seg.forwardPressure) {
9049
- // add padding to the edge so that forward stacked events don't cover the resizer's icon
9050
- props[this.isRTL ? 'marginLeft' : 'marginRight'] = 10 * 2; // 10 is a guesstimate of the icon's width
9051
- }
9052
-
9053
- return props;
9054
- }
9055
-
9056
- });
9057
-
9058
-
9059
- // Builds an array of segments "levels". The first level will be the leftmost tier of segments if the calendar is
9060
- // left-to-right, or the rightmost if the calendar is right-to-left. Assumes the segments are already ordered by date.
9061
- function buildSlotSegLevels(segs) {
9062
- var levels = [];
9063
- var i, seg;
9064
- var j;
9065
-
9066
- for (i=0; i<segs.length; i++) {
9067
- seg = segs[i];
9068
-
9069
- // go through all the levels and stop on the first level where there are no collisions
9070
- for (j=0; j<levels.length; j++) {
9071
- if (!computeSlotSegCollisions(seg, levels[j]).length) {
9072
- break;
9073
- }
9074
- }
9075
-
9076
- seg.level = j;
9077
-
9078
- (levels[j] || (levels[j] = [])).push(seg);
9079
- }
9080
-
9081
- return levels;
9082
- }
9083
-
9084
-
9085
- // For every segment, figure out the other segments that are in subsequent
9086
- // levels that also occupy the same vertical space. Accumulate in seg.forwardSegs
9087
- function computeForwardSlotSegs(levels) {
9088
- var i, level;
9089
- var j, seg;
9090
- var k;
9091
-
9092
- for (i=0; i<levels.length; i++) {
9093
- level = levels[i];
9094
-
9095
- for (j=0; j<level.length; j++) {
9096
- seg = level[j];
9097
-
9098
- seg.forwardSegs = [];
9099
- for (k=i+1; k<levels.length; k++) {
9100
- computeSlotSegCollisions(seg, levels[k], seg.forwardSegs);
9101
- }
9102
- }
9103
- }
9104
- }
9105
-
9106
-
9107
- // Figure out which path forward (via seg.forwardSegs) results in the longest path until
9108
- // the furthest edge is reached. The number of segments in this path will be seg.forwardPressure
9109
- function computeSlotSegPressures(seg) {
9110
- var forwardSegs = seg.forwardSegs;
9111
- var forwardPressure = 0;
9112
- var i, forwardSeg;
9113
-
9114
- if (seg.forwardPressure === undefined) { // not already computed
9115
-
9116
- for (i=0; i<forwardSegs.length; i++) {
9117
- forwardSeg = forwardSegs[i];
9118
-
9119
- // figure out the child's maximum forward path
9120
- computeSlotSegPressures(forwardSeg);
9121
-
9122
- // either use the existing maximum, or use the child's forward pressure
9123
- // plus one (for the forwardSeg itself)
9124
- forwardPressure = Math.max(
9125
- forwardPressure,
9126
- 1 + forwardSeg.forwardPressure
9127
- );
9128
- }
9129
-
9130
- seg.forwardPressure = forwardPressure;
9131
- }
9132
- }
9133
-
9134
-
9135
- // Find all the segments in `otherSegs` that vertically collide with `seg`.
9136
- // Append into an optionally-supplied `results` array and return.
9137
- function computeSlotSegCollisions(seg, otherSegs, results) {
9138
- results = results || [];
9139
-
9140
- for (var i=0; i<otherSegs.length; i++) {
9141
- if (isSlotSegCollision(seg, otherSegs[i])) {
9142
- results.push(otherSegs[i]);
9143
- }
9144
- }
9145
-
9146
- return results;
9147
- }
9148
-
9149
-
9150
- // Do these segments occupy the same vertical space?
9151
- function isSlotSegCollision(seg1, seg2) {
9152
- return seg1.bottom > seg2.top && seg1.top < seg2.bottom;
9153
- }
9154
-
9155
- ;;
9156
-
9157
- /* An abstract class from which other views inherit from
9158
- ----------------------------------------------------------------------------------------------------------------------*/
9159
-
9160
- var View = FC.View = Model.extend({
9161
-
9162
- type: null, // subclass' view name (string)
9163
- name: null, // deprecated. use `type` instead
9164
- title: null, // the text that will be displayed in the header's title
9165
-
9166
- calendar: null, // owner Calendar object
9167
- viewSpec: null,
9168
- options: null, // hash containing all options. already merged with view-specific-options
9169
- el: null, // the view's containing element. set by Calendar
9170
-
9171
- renderQueue: null,
9172
- batchRenderDepth: 0,
9173
- isDatesRendered: false,
9174
- isEventsRendered: false,
9175
- isBaseRendered: false, // related to viewRender/viewDestroy triggers
9176
-
9177
- queuedScroll: null,
9178
-
9179
- isRTL: false,
9180
- isSelected: false, // boolean whether a range of time is user-selected or not
9181
- selectedEvent: null,
9182
-
9183
- eventOrderSpecs: null, // criteria for ordering events when they have same date/time
9184
-
9185
- // classNames styled by jqui themes
9186
- widgetHeaderClass: null,
9187
- widgetContentClass: null,
9188
- highlightStateClass: null,
9189
-
9190
- // for date utils, computed from options
9191
- nextDayThreshold: null,
9192
- isHiddenDayHash: null,
9193
-
9194
- // now indicator
9195
- isNowIndicatorRendered: null,
9196
- initialNowDate: null, // result first getNow call
9197
- initialNowQueriedMs: null, // ms time the getNow was called
9198
- nowIndicatorTimeoutID: null, // for refresh timing of now indicator
9199
- nowIndicatorIntervalID: null, // "
9200
-
9201
-
9202
- constructor: function(calendar, viewSpec) {
9203
- Model.prototype.constructor.call(this);
9204
-
9205
- this.calendar = calendar;
9206
- this.viewSpec = viewSpec;
9207
-
9208
- // shortcuts
9209
- this.type = viewSpec.type;
9210
- this.options = viewSpec.options;
9211
-
9212
- // .name is deprecated
9213
- this.name = this.type;
9214
-
9215
- this.nextDayThreshold = moment.duration(this.opt('nextDayThreshold'));
9216
- this.initThemingProps();
9217
- this.initHiddenDays();
9218
- this.isRTL = this.opt('isRTL');
9219
-
9220
- this.eventOrderSpecs = parseFieldSpecs(this.opt('eventOrder'));
9221
-
9222
- this.renderQueue = this.buildRenderQueue();
9223
- this.initAutoBatchRender();
9224
-
9225
- this.initialize();
9226
- },
9227
-
9228
-
9229
- buildRenderQueue: function() {
9230
- var _this = this;
9231
- var renderQueue = new RenderQueue({
9232
- event: this.opt('eventRenderWait')
9233
- });
9234
-
9235
- renderQueue.on('start', function() {
9236
- _this.freezeHeight();
9237
- _this.addScroll(_this.queryScroll());
9238
- });
9239
-
9240
- renderQueue.on('stop', function() {
9241
- _this.thawHeight();
9242
- _this.popScroll();
9243
- });
9244
-
9245
- return renderQueue;
9246
- },
9247
-
9248
-
9249
- initAutoBatchRender: function() {
9250
- var _this = this;
9251
-
9252
- this.on('before:change', function() {
9253
- _this.startBatchRender();
9254
- });
9255
-
9256
- this.on('change', function() {
9257
- _this.stopBatchRender();
9258
- });
9259
- },
9260
-
9261
-
9262
- startBatchRender: function() {
9263
- if (!(this.batchRenderDepth++)) {
9264
- this.renderQueue.pause();
9265
- }
9266
- },
9267
-
9268
-
9269
- stopBatchRender: function() {
9270
- if (!(--this.batchRenderDepth)) {
9271
- this.renderQueue.resume();
9272
- }
9273
- },
9274
-
9275
-
9276
- // A good place for subclasses to initialize member variables
9277
- initialize: function() {
9278
- // subclasses can implement
9279
- },
9280
-
9281
-
9282
- // Retrieves an option with the given name
9283
- opt: function(name) {
9284
- return this.options[name];
9285
- },
9286
-
9287
-
9288
- // Triggers handlers that are view-related. Modifies args before passing to calendar.
9289
- publiclyTrigger: function(name, thisObj) { // arguments beyond thisObj are passed along
9290
- var calendar = this.calendar;
9291
-
9292
- return calendar.publiclyTrigger.apply(
9293
- calendar,
9294
- [name, thisObj || this].concat(
9295
- Array.prototype.slice.call(arguments, 2), // arguments beyond thisObj
9296
- [ this ] // always make the last argument a reference to the view. TODO: deprecate
9297
- )
9298
- );
9299
- },
9300
-
9301
-
9302
- /* Title and Date Formatting
9303
- ------------------------------------------------------------------------------------------------------------------*/
9304
-
9305
-
9306
- // Sets the view's title property to the most updated computed value
9307
- updateTitle: function() {
9308
- this.title = this.computeTitle();
9309
- this.calendar.setToolbarsTitle(this.title);
9310
- },
9311
-
9312
-
9313
- // Computes what the title at the top of the calendar should be for this view
9314
- computeTitle: function() {
9315
- var range;
9316
-
9317
- // for views that span a large unit of time, show the proper interval, ignoring stray days before and after
9318
- if (/^(year|month)$/.test(this.currentRangeUnit)) {
9319
- range = this.currentRange;
9320
- }
9321
- else { // for day units or smaller, use the actual day range
9322
- range = this.activeRange;
9323
- }
9324
-
9325
- return this.formatRange(
9326
- {
9327
- // in case currentRange has a time, make sure timezone is correct
9328
- start: this.calendar.applyTimezone(range.start),
9329
- end: this.calendar.applyTimezone(range.end)
9330
- },
9331
- this.opt('titleFormat') || this.computeTitleFormat(),
9332
- this.opt('titleRangeSeparator')
9333
- );
9334
- },
9335
-
9336
-
9337
- // Generates the format string that should be used to generate the title for the current date range.
9338
- // Attempts to compute the most appropriate format if not explicitly specified with `titleFormat`.
9339
- computeTitleFormat: function() {
9340
- if (this.currentRangeUnit == 'year') {
9341
- return 'YYYY';
9342
- }
9343
- else if (this.currentRangeUnit == 'month') {
9344
- return this.opt('monthYearFormat'); // like "September 2014"
9345
- }
9346
- else if (this.currentRangeAs('days') > 1) {
9347
- return 'll'; // multi-day range. shorter, like "Sep 9 - 10 2014"
9348
- }
9349
- else {
9350
- return 'LL'; // one day. longer, like "September 9 2014"
9351
- }
9352
- },
9353
-
9354
-
9355
- // Utility for formatting a range. Accepts a range object, formatting string, and optional separator.
9356
- // Displays all-day ranges naturally, with an inclusive end. Takes the current isRTL into account.
9357
- // The timezones of the dates within `range` will be respected.
9358
- formatRange: function(range, formatStr, separator) {
9359
- var end = range.end;
9360
-
9361
- if (!end.hasTime()) { // all-day?
9362
- end = end.clone().subtract(1); // convert to inclusive. last ms of previous day
9363
- }
9364
-
9365
- return formatRange(range.start, end, formatStr, separator, this.opt('isRTL'));
9366
- },
9367
-
9368
-
9369
- getAllDayHtml: function() {
9370
- return this.opt('allDayHtml') || htmlEscape(this.opt('allDayText'));
9371
- },
9372
-
9373
-
9374
- /* Navigation
9375
- ------------------------------------------------------------------------------------------------------------------*/
9376
-
9377
-
9378
- // Generates HTML for an anchor to another view into the calendar.
9379
- // Will either generate an <a> tag or a non-clickable <span> tag, depending on enabled settings.
9380
- // `gotoOptions` can either be a moment input, or an object with the form:
9381
- // { date, type, forceOff }
9382
- // `type` is a view-type like "day" or "week". default value is "day".
9383
- // `attrs` and `innerHtml` are use to generate the rest of the HTML tag.
9384
- buildGotoAnchorHtml: function(gotoOptions, attrs, innerHtml) {
9385
- var date, type, forceOff;
9386
- var finalOptions;
9387
-
9388
- if ($.isPlainObject(gotoOptions)) {
9389
- date = gotoOptions.date;
9390
- type = gotoOptions.type;
9391
- forceOff = gotoOptions.forceOff;
9392
- }
9393
- else {
9394
- date = gotoOptions; // a single moment input
9395
- }
9396
- date = FC.moment(date); // if a string, parse it
9397
-
9398
- finalOptions = { // for serialization into the link
9399
- date: date.format('YYYY-MM-DD'),
9400
- type: type || 'day'
9401
- };
9402
-
9403
- if (typeof attrs === 'string') {
9404
- innerHtml = attrs;
9405
- attrs = null;
9406
- }
9407
-
9408
- attrs = attrs ? ' ' + attrsToStr(attrs) : ''; // will have a leading space
9409
- innerHtml = innerHtml || '';
9410
-
9411
- if (!forceOff && this.opt('navLinks')) {
9412
- return '<a' + attrs +
9413
- ' data-goto="' + htmlEscape(JSON.stringify(finalOptions)) + '">' +
9414
- innerHtml +
9415
- '</a>';
9416
- }
9417
- else {
9418
- return '<span' + attrs + '>' +
9419
- innerHtml +
9420
- '</span>';
9421
- }
9422
- },
9423
-
9424
-
9425
- // Rendering Non-date-related Content
9426
- // -----------------------------------------------------------------------------------------------------------------
9427
-
9428
-
9429
- // Sets the container element that the view should render inside of, does global DOM-related initializations,
9430
- // and renders all the non-date-related content inside.
9431
- setElement: function(el) {
9432
- this.el = el;
9433
- this.bindGlobalHandlers();
9434
- this.bindBaseRenderHandlers();
9435
- this.renderSkeleton();
9436
- },
9437
-
9438
-
9439
- // Removes the view's container element from the DOM, clearing any content beforehand.
9440
- // Undoes any other DOM-related attachments.
9441
- removeElement: function() {
9442
- this.unsetDate();
9443
- this.unrenderSkeleton();
9444
-
9445
- this.unbindGlobalHandlers();
9446
- this.unbindBaseRenderHandlers();
9447
-
9448
- this.el.remove();
9449
- // NOTE: don't null-out this.el in case the View was destroyed within an API callback.
9450
- // We don't null-out the View's other jQuery element references upon destroy,
9451
- // so we shouldn't kill this.el either.
9452
- },
9453
-
9454
-
9455
- // Renders the basic structure of the view before any content is rendered
9456
- renderSkeleton: function() {
9457
- // subclasses should implement
9458
- },
9459
-
9460
-
9461
- // Unrenders the basic structure of the view
9462
- unrenderSkeleton: function() {
9463
- // subclasses should implement
9464
- },
9465
-
9466
-
9467
- // Date Setting/Unsetting
9468
- // -----------------------------------------------------------------------------------------------------------------
9469
-
9470
-
9471
- setDate: function(date) {
9472
- var currentDateProfile = this.get('dateProfile');
9473
- var newDateProfile = this.buildDateProfile(date, null, true); // forceToValid=true
9474
-
9475
- if (
9476
- !currentDateProfile ||
9477
- !isRangesEqual(currentDateProfile.activeRange, newDateProfile.activeRange)
9478
- ) {
9479
- this.set('dateProfile', newDateProfile);
9480
- }
9481
-
9482
- return newDateProfile.date;
9483
- },
9484
-
9485
-
9486
- unsetDate: function() {
9487
- this.unset('dateProfile');
9488
- },
9489
-
9490
-
9491
- // Date Rendering
9492
- // -----------------------------------------------------------------------------------------------------------------
9493
-
9494
-
9495
- requestDateRender: function(dateProfile) {
9496
- var _this = this;
9497
-
9498
- this.renderQueue.queue(function() {
9499
- _this.executeDateRender(dateProfile);
9500
- }, 'date', 'init');
9501
- },
9502
-
9503
-
9504
- requestDateUnrender: function() {
9505
- var _this = this;
9506
-
9507
- this.renderQueue.queue(function() {
9508
- _this.executeDateUnrender();
9509
- }, 'date', 'destroy');
9510
- },
9511
-
9512
-
9513
- // Event Data
9514
- // -----------------------------------------------------------------------------------------------------------------
9515
-
9516
-
9517
- fetchInitialEvents: function(dateProfile) {
9518
- return this.calendar.requestEvents(
9519
- dateProfile.activeRange.start,
9520
- dateProfile.activeRange.end
9521
- );
9522
- },
9523
-
9524
-
9525
- bindEventChanges: function() {
9526
- this.listenTo(this.calendar, 'eventsReset', this.resetEvents);
9527
- },
9528
-
9529
-
9530
- unbindEventChanges: function() {
9531
- this.stopListeningTo(this.calendar, 'eventsReset');
9532
- },
9533
-
9534
-
9535
- setEvents: function(events) {
9536
- this.set('currentEvents', events);
9537
- this.set('hasEvents', true);
9538
- },
9539
-
9540
-
9541
- unsetEvents: function() {
9542
- this.unset('currentEvents');
9543
- this.unset('hasEvents');
9544
- },
9545
-
9546
-
9547
- resetEvents: function(events) {
9548
- this.startBatchRender();
9549
- this.unsetEvents();
9550
- this.setEvents(events);
9551
- this.stopBatchRender();
9552
- },
9553
-
9554
-
9555
- // Event Rendering
9556
- // -----------------------------------------------------------------------------------------------------------------
9557
-
9558
-
9559
- requestEventsRender: function(events) {
9560
- var _this = this;
9561
-
9562
- this.renderQueue.queue(function() {
9563
- _this.executeEventsRender(events);
9564
- }, 'event', 'init');
9565
- },
9566
-
9567
-
9568
- requestEventsUnrender: function() {
9569
- var _this = this;
9570
-
9571
- this.renderQueue.queue(function() {
9572
- _this.executeEventsUnrender();
9573
- }, 'event', 'destroy');
9574
- },
9575
-
9576
-
9577
- // Date High-level Rendering
9578
- // -----------------------------------------------------------------------------------------------------------------
9579
-
9580
-
9581
- // if dateProfile not specified, uses current
9582
- executeDateRender: function(dateProfile, skipScroll) {
9583
-
9584
- this.setDateProfileForRendering(dateProfile);
9585
- this.updateTitle();
9586
- this.calendar.updateToolbarButtons();
9587
-
9588
- if (this.render) {
9589
- this.render(); // TODO: deprecate
9590
- }
9591
-
9592
- this.renderDates();
9593
- this.updateSize();
9594
- this.renderBusinessHours(); // might need coordinates, so should go after updateSize()
9595
- this.startNowIndicator();
9596
-
9597
- if (!skipScroll) {
9598
- this.addScroll(this.computeInitialDateScroll());
9599
- }
9600
-
9601
- this.isDatesRendered = true;
9602
- this.trigger('datesRendered');
9603
- },
9604
-
9605
-
9606
- executeDateUnrender: function() {
9607
-
9608
- this.unselect();
9609
- this.stopNowIndicator();
9610
-
9611
- this.trigger('before:datesUnrendered');
9612
-
9613
- this.unrenderBusinessHours();
9614
- this.unrenderDates();
9615
-
9616
- if (this.destroy) {
9617
- this.destroy(); // TODO: deprecate
9618
- }
9619
-
9620
- this.isDatesRendered = false;
9621
- },
9622
-
9623
-
9624
- // Date Low-level Rendering
9625
- // -----------------------------------------------------------------------------------------------------------------
9626
-
9627
-
9628
- // date-cell content only
9629
- renderDates: function() {
9630
- // subclasses should implement
9631
- },
9632
-
9633
-
9634
- // date-cell content only
9635
- unrenderDates: function() {
9636
- // subclasses should override
9637
- },
9638
-
9639
-
9640
- // Determing when the "meat" of the view is rendered (aka the base)
9641
- // -----------------------------------------------------------------------------------------------------------------
9642
-
9643
-
9644
- bindBaseRenderHandlers: function() {
9645
- var _this = this;
9646
-
9647
- this.on('datesRendered.baseHandler', function() {
9648
- _this.onBaseRender();
9649
- });
9650
-
9651
- this.on('before:datesUnrendered.baseHandler', function() {
9652
- _this.onBeforeBaseUnrender();
9653
- });
9654
- },
9655
-
9656
-
9657
- unbindBaseRenderHandlers: function() {
9658
- this.off('.baseHandler');
9659
- },
9660
-
9661
-
9662
- onBaseRender: function() {
9663
- this.applyScreenState();
9664
- this.publiclyTrigger('viewRender', this, this, this.el);
9665
- },
9666
-
9667
-
9668
- onBeforeBaseUnrender: function() {
9669
- this.applyScreenState();
9670
- this.publiclyTrigger('viewDestroy', this, this, this.el);
9671
- },
9672
-
9673
-
9674
- // Misc view rendering utils
9675
- // -----------------------------------------------------------------------------------------------------------------
9676
-
9677
-
9678
- // Binds DOM handlers to elements that reside outside the view container, such as the document
9679
- bindGlobalHandlers: function() {
9680
- this.listenTo(GlobalEmitter.get(), {
9681
- touchstart: this.processUnselect,
9682
- mousedown: this.handleDocumentMousedown
9683
- });
9684
- },
9685
-
9686
-
9687
- // Unbinds DOM handlers from elements that reside outside the view container
9688
- unbindGlobalHandlers: function() {
9689
- this.stopListeningTo(GlobalEmitter.get());
9690
- },
9691
-
9692
-
9693
- // Initializes internal variables related to theming
9694
- initThemingProps: function() {
9695
- var tm = this.opt('theme') ? 'ui' : 'fc';
9696
-
9697
- this.widgetHeaderClass = tm + '-widget-header';
9698
- this.widgetContentClass = tm + '-widget-content';
9699
- this.highlightStateClass = tm + '-state-highlight';
9700
- },
9701
-
9702
-
9703
- /* Business Hours
9704
- ------------------------------------------------------------------------------------------------------------------*/
9705
-
9706
-
9707
- // Renders business-hours onto the view. Assumes updateSize has already been called.
9708
- renderBusinessHours: function() {
9709
- // subclasses should implement
9710
- },
9711
-
9712
-
9713
- // Unrenders previously-rendered business-hours
9714
- unrenderBusinessHours: function() {
9715
- // subclasses should implement
9716
- },
9717
-
9718
-
9719
- /* Now Indicator
9720
- ------------------------------------------------------------------------------------------------------------------*/
9721
-
9722
-
9723
- // Immediately render the current time indicator and begins re-rendering it at an interval,
9724
- // which is defined by this.getNowIndicatorUnit().
9725
- // TODO: somehow do this for the current whole day's background too
9726
- startNowIndicator: function() {
9727
- var _this = this;
9728
- var unit;
9729
- var update;
9730
- var delay; // ms wait value
9731
-
9732
- if (this.opt('nowIndicator')) {
9733
- unit = this.getNowIndicatorUnit();
9734
- if (unit) {
9735
- update = proxy(this, 'updateNowIndicator'); // bind to `this`
9736
-
9737
- this.initialNowDate = this.calendar.getNow();
9738
- this.initialNowQueriedMs = +new Date();
9739
- this.renderNowIndicator(this.initialNowDate);
9740
- this.isNowIndicatorRendered = true;
9741
-
9742
- // wait until the beginning of the next interval
9743
- delay = this.initialNowDate.clone().startOf(unit).add(1, unit) - this.initialNowDate;
9744
- this.nowIndicatorTimeoutID = setTimeout(function() {
9745
- _this.nowIndicatorTimeoutID = null;
9746
- update();
9747
- delay = +moment.duration(1, unit);
9748
- delay = Math.max(100, delay); // prevent too frequent
9749
- _this.nowIndicatorIntervalID = setInterval(update, delay); // update every interval
9750
- }, delay);
9751
- }
9752
- }
9753
- },
9754
-
9755
-
9756
- // rerenders the now indicator, computing the new current time from the amount of time that has passed
9757
- // since the initial getNow call.
9758
- updateNowIndicator: function() {
9759
- if (this.isNowIndicatorRendered) {
9760
- this.unrenderNowIndicator();
9761
- this.renderNowIndicator(
9762
- this.initialNowDate.clone().add(new Date() - this.initialNowQueriedMs) // add ms
9763
- );
9764
- }
9765
- },
9766
-
9767
-
9768
- // Immediately unrenders the view's current time indicator and stops any re-rendering timers.
9769
- // Won't cause side effects if indicator isn't rendered.
9770
- stopNowIndicator: function() {
9771
- if (this.isNowIndicatorRendered) {
9772
-
9773
- if (this.nowIndicatorTimeoutID) {
9774
- clearTimeout(this.nowIndicatorTimeoutID);
9775
- this.nowIndicatorTimeoutID = null;
9776
- }
9777
- if (this.nowIndicatorIntervalID) {
9778
- clearTimeout(this.nowIndicatorIntervalID);
9779
- this.nowIndicatorIntervalID = null;
9780
- }
9781
-
9782
- this.unrenderNowIndicator();
9783
- this.isNowIndicatorRendered = false;
9784
- }
9785
- },
9786
-
9787
-
9788
- // Returns a string unit, like 'second' or 'minute' that defined how often the current time indicator
9789
- // should be refreshed. If something falsy is returned, no time indicator is rendered at all.
9790
- getNowIndicatorUnit: function() {
9791
- // subclasses should implement
9792
- },
9793
-
9794
-
9795
- // Renders a current time indicator at the given datetime
9796
- renderNowIndicator: function(date) {
9797
- // subclasses should implement
9798
- },
9799
-
9800
-
9801
- // Undoes the rendering actions from renderNowIndicator
9802
- unrenderNowIndicator: function() {
9803
- // subclasses should implement
9804
- },
9805
-
9806
-
9807
- /* Dimensions
9808
- ------------------------------------------------------------------------------------------------------------------*/
9809
-
9810
-
9811
- // Refreshes anything dependant upon sizing of the container element of the grid
9812
- updateSize: function(isResize) {
9813
- var scroll;
9814
-
9815
- if (isResize) {
9816
- scroll = this.queryScroll();
9817
- }
9818
-
9819
- this.updateHeight(isResize);
9820
- this.updateWidth(isResize);
9821
- this.updateNowIndicator();
9822
-
9823
- if (isResize) {
9824
- this.applyScroll(scroll);
9825
- }
9826
- },
9827
-
9828
-
9829
- // Refreshes the horizontal dimensions of the calendar
9830
- updateWidth: function(isResize) {
9831
- // subclasses should implement
9832
- },
9833
-
9834
-
9835
- // Refreshes the vertical dimensions of the calendar
9836
- updateHeight: function(isResize) {
9837
- var calendar = this.calendar; // we poll the calendar for height information
9838
-
9839
- this.setHeight(
9840
- calendar.getSuggestedViewHeight(),
9841
- calendar.isHeightAuto()
9842
- );
9843
- },
9844
-
9845
-
9846
- // Updates the vertical dimensions of the calendar to the specified height.
9847
- // if `isAuto` is set to true, height becomes merely a suggestion and the view should use its "natural" height.
9848
- setHeight: function(height, isAuto) {
9849
- // subclasses should implement
9850
- },
9851
-
9852
-
9853
- /* Scroller
9854
- ------------------------------------------------------------------------------------------------------------------*/
9855
-
9856
-
9857
- addForcedScroll: function(scroll) {
9858
- this.addScroll(
9859
- $.extend(scroll, { isForced: true })
9860
- );
9861
- },
9862
-
9863
-
9864
- addScroll: function(scroll) {
9865
- var queuedScroll = this.queuedScroll || (this.queuedScroll = {});
9866
-
9867
- if (!queuedScroll.isForced) {
9868
- $.extend(queuedScroll, scroll);
9869
- }
9870
- },
9871
-
9872
-
9873
- popScroll: function() {
9874
- this.applyQueuedScroll();
9875
- this.queuedScroll = null;
9876
- },
9877
-
9878
-
9879
- applyQueuedScroll: function() {
9880
- if (this.queuedScroll) {
9881
- this.applyScroll(this.queuedScroll);
9882
- }
9883
- },
9884
-
9885
-
9886
- queryScroll: function() {
9887
- var scroll = {};
9888
-
9889
- if (this.isDatesRendered) {
9890
- $.extend(scroll, this.queryDateScroll());
9891
- }
9892
-
9893
- return scroll;
9894
- },
9895
-
9896
-
9897
- applyScroll: function(scroll) {
9898
- if (this.isDatesRendered) {
9899
- this.applyDateScroll(scroll);
9900
- }
9901
- },
9902
-
9903
-
9904
- computeInitialDateScroll: function() {
9905
- return {}; // subclasses must implement
9906
- },
9907
-
9908
-
9909
- queryDateScroll: function() {
9910
- return {}; // subclasses must implement
9911
- },
9912
-
9913
-
9914
- applyDateScroll: function(scroll) {
9915
- ; // subclasses must implement
9916
- },
9917
-
9918
-
9919
- /* Height Freezing
9920
- ------------------------------------------------------------------------------------------------------------------*/
9921
-
9922
-
9923
- freezeHeight: function() {
9924
- this.calendar.freezeContentHeight();
9925
- },
9926
-
9927
-
9928
- thawHeight: function() {
9929
- this.calendar.thawContentHeight();
9930
- },
9931
-
9932
-
9933
- // Event High-level Rendering
9934
- // -----------------------------------------------------------------------------------------------------------------
9935
-
9936
-
9937
- executeEventsRender: function(events) {
9938
- this.renderEvents(events);
9939
- this.isEventsRendered = true;
9940
-
9941
- this.onEventsRender();
9942
- },
9943
-
9944
-
9945
- executeEventsUnrender: function() {
9946
- this.onBeforeEventsUnrender();
9947
-
9948
- if (this.destroyEvents) {
9949
- this.destroyEvents(); // TODO: deprecate
9950
- }
9951
-
9952
- this.unrenderEvents();
9953
- this.isEventsRendered = false;
9954
- },
9955
-
9956
-
9957
- // Event Rendering Triggers
9958
- // -----------------------------------------------------------------------------------------------------------------
9959
-
9960
-
9961
- // Signals that all events have been rendered
9962
- onEventsRender: function() {
9963
- this.applyScreenState();
9964
-
9965
- this.renderedEventSegEach(function(seg) {
9966
- this.publiclyTrigger('eventAfterRender', seg.event, seg.event, seg.el);
9967
- });
9968
- this.publiclyTrigger('eventAfterAllRender');
9969
- },
9970
-
9971
-
9972
- // Signals that all event elements are about to be removed
9973
- onBeforeEventsUnrender: function() {
9974
- this.applyScreenState();
9975
-
9976
- this.renderedEventSegEach(function(seg) {
9977
- this.publiclyTrigger('eventDestroy', seg.event, seg.event, seg.el);
9978
- });
9979
- },
9980
-
9981
-
9982
- applyScreenState: function() {
9983
- this.thawHeight();
9984
- this.freezeHeight();
9985
- this.applyQueuedScroll();
9986
- },
9987
-
9988
-
9989
- // Event Low-level Rendering
9990
- // -----------------------------------------------------------------------------------------------------------------
9991
-
9992
-
9993
- // Renders the events onto the view.
9994
- renderEvents: function(events) {
9995
- // subclasses should implement
9996
- },
9997
-
9998
-
9999
- // Removes event elements from the view.
10000
- unrenderEvents: function() {
10001
- // subclasses should implement
10002
- },
10003
-
10004
-
10005
- // Event Rendering Utils
10006
- // -----------------------------------------------------------------------------------------------------------------
10007
-
10008
-
10009
- // Given an event and the default element used for rendering, returns the element that should actually be used.
10010
- // Basically runs events and elements through the eventRender hook.
10011
- resolveEventEl: function(event, el) {
10012
- var custom = this.publiclyTrigger('eventRender', event, event, el);
10013
-
10014
- if (custom === false) { // means don't render at all
10015
- el = null;
10016
- }
10017
- else if (custom && custom !== true) {
10018
- el = $(custom);
10019
- }
10020
-
10021
- return el;
10022
- },
10023
-
10024
-
10025
- // Hides all rendered event segments linked to the given event
10026
- showEvent: function(event) {
10027
- this.renderedEventSegEach(function(seg) {
10028
- seg.el.css('visibility', '');
10029
- }, event);
10030
- },
10031
-
10032
-
10033
- // Shows all rendered event segments linked to the given event
10034
- hideEvent: function(event) {
10035
- this.renderedEventSegEach(function(seg) {
10036
- seg.el.css('visibility', 'hidden');
10037
- }, event);
10038
- },
10039
-
10040
-
10041
- // Iterates through event segments that have been rendered (have an el). Goes through all by default.
10042
- // If the optional `event` argument is specified, only iterates through segments linked to that event.
10043
- // The `this` value of the callback function will be the view.
10044
- renderedEventSegEach: function(func, event) {
10045
- var segs = this.getEventSegs();
10046
- var i;
10047
-
10048
- for (i = 0; i < segs.length; i++) {
10049
- if (!event || segs[i].event._id === event._id) {
10050
- if (segs[i].el) {
10051
- func.call(this, segs[i]);
10052
- }
10053
- }
10054
- }
10055
- },
10056
-
10057
-
10058
- // Retrieves all the rendered segment objects for the view
10059
- getEventSegs: function() {
10060
- // subclasses must implement
10061
- return [];
10062
- },
10063
-
10064
-
10065
- /* Event Drag-n-Drop
10066
- ------------------------------------------------------------------------------------------------------------------*/
10067
-
10068
-
10069
- // Computes if the given event is allowed to be dragged by the user
10070
- isEventDraggable: function(event) {
10071
- return this.isEventStartEditable(event);
10072
- },
10073
-
10074
-
10075
- isEventStartEditable: function(event) {
10076
- return firstDefined(
10077
- event.startEditable,
10078
- (event.source || {}).startEditable,
10079
- this.opt('eventStartEditable'),
10080
- this.isEventGenerallyEditable(event)
10081
- );
10082
- },
10083
-
10084
-
10085
- isEventGenerallyEditable: function(event) {
10086
- return firstDefined(
10087
- event.editable,
10088
- (event.source || {}).editable,
10089
- this.opt('editable')
10090
- );
10091
- },
10092
-
10093
-
10094
- // Must be called when an event in the view is dropped onto new location.
10095
- // `dropLocation` is an object that contains the new zoned start/end/allDay values for the event.
10096
- reportSegDrop: function(seg, dropLocation, largeUnit, el, ev) {
10097
- var calendar = this.calendar;
10098
- var mutateResult = calendar.mutateSeg(seg, dropLocation, largeUnit);
10099
- var undoFunc = function() {
10100
- mutateResult.undo();
10101
- calendar.reportEventChange();
10102
- };
10103
-
10104
- this.triggerEventDrop(seg.event, mutateResult.dateDelta, undoFunc, el, ev);
10105
- calendar.reportEventChange(); // will rerender events
10106
- },
10107
-
10108
-
10109
- // Triggers event-drop handlers that have subscribed via the API
10110
- triggerEventDrop: function(event, dateDelta, undoFunc, el, ev) {
10111
- this.publiclyTrigger('eventDrop', el[0], event, dateDelta, undoFunc, ev, {}); // {} = jqui dummy
10112
- },
10113
-
10114
-
10115
- /* External Element Drag-n-Drop
10116
- ------------------------------------------------------------------------------------------------------------------*/
10117
-
10118
-
10119
- // Must be called when an external element, via jQuery UI, has been dropped onto the calendar.
10120
- // `meta` is the parsed data that has been embedded into the dragging event.
10121
- // `dropLocation` is an object that contains the new zoned start/end/allDay values for the event.
10122
- reportExternalDrop: function(meta, dropLocation, el, ev, ui) {
10123
- var eventProps = meta.eventProps;
10124
- var eventInput;
10125
- var event;
10126
-
10127
- // Try to build an event object and render it. TODO: decouple the two
10128
- if (eventProps) {
10129
- eventInput = $.extend({}, eventProps, dropLocation);
10130
- event = this.calendar.renderEvent(eventInput, meta.stick)[0]; // renderEvent returns an array
10131
- }
10132
-
10133
- this.triggerExternalDrop(event, dropLocation, el, ev, ui);
10134
- },
10135
-
10136
-
10137
- // Triggers external-drop handlers that have subscribed via the API
10138
- triggerExternalDrop: function(event, dropLocation, el, ev, ui) {
10139
-
10140
- // trigger 'drop' regardless of whether element represents an event
10141
- this.publiclyTrigger('drop', el[0], dropLocation.start, ev, ui);
10142
-
10143
- if (event) {
10144
- this.publiclyTrigger('eventReceive', null, event); // signal an external event landed
10145
- }
10146
- },
10147
-
10148
-
10149
- /* Drag-n-Drop Rendering (for both events and external elements)
10150
- ------------------------------------------------------------------------------------------------------------------*/
10151
-
10152
-
10153
- // Renders a visual indication of a event or external-element drag over the given drop zone.
10154
- // If an external-element, seg will be `null`.
10155
- // Must return elements used for any mock events.
10156
- renderDrag: function(dropLocation, seg) {
10157
- // subclasses must implement
10158
- },
10159
-
10160
-
10161
- // Unrenders a visual indication of an event or external-element being dragged.
10162
- unrenderDrag: function() {
10163
- // subclasses must implement
10164
- },
10165
-
10166
-
10167
- /* Event Resizing
10168
- ------------------------------------------------------------------------------------------------------------------*/
10169
-
10170
-
10171
- // Computes if the given event is allowed to be resized from its starting edge
10172
- isEventResizableFromStart: function(event) {
10173
- return this.opt('eventResizableFromStart') && this.isEventResizable(event);
10174
- },
10175
-
10176
-
10177
- // Computes if the given event is allowed to be resized from its ending edge
10178
- isEventResizableFromEnd: function(event) {
10179
- return this.isEventResizable(event);
10180
- },
10181
-
10182
-
10183
- // Computes if the given event is allowed to be resized by the user at all
10184
- isEventResizable: function(event) {
10185
- var source = event.source || {};
10186
-
10187
- return firstDefined(
10188
- event.durationEditable,
10189
- source.durationEditable,
10190
- this.opt('eventDurationEditable'),
10191
- event.editable,
10192
- source.editable,
10193
- this.opt('editable')
10194
- );
10195
- },
10196
-
10197
-
10198
- // Must be called when an event in the view has been resized to a new length
10199
- reportSegResize: function(seg, resizeLocation, largeUnit, el, ev) {
10200
- var calendar = this.calendar;
10201
- var mutateResult = calendar.mutateSeg(seg, resizeLocation, largeUnit);
10202
- var undoFunc = function() {
10203
- mutateResult.undo();
10204
- calendar.reportEventChange();
10205
- };
10206
-
10207
- this.triggerEventResize(seg.event, mutateResult.durationDelta, undoFunc, el, ev);
10208
- calendar.reportEventChange(); // will rerender events
10209
- },
10210
-
10211
-
10212
- // Triggers event-resize handlers that have subscribed via the API
10213
- triggerEventResize: function(event, durationDelta, undoFunc, el, ev) {
10214
- this.publiclyTrigger('eventResize', el[0], event, durationDelta, undoFunc, ev, {}); // {} = jqui dummy
10215
- },
10216
-
10217
-
10218
- /* Selection (time range)
10219
- ------------------------------------------------------------------------------------------------------------------*/
10220
-
10221
-
10222
- // Selects a date span on the view. `start` and `end` are both Moments.
10223
- // `ev` is the native mouse event that begin the interaction.
10224
- select: function(span, ev) {
10225
- this.unselect(ev);
10226
- this.renderSelection(span);
10227
- this.reportSelection(span, ev);
10228
- },
10229
-
10230
-
10231
- // Renders a visual indication of the selection
10232
- renderSelection: function(span) {
10233
- // subclasses should implement
10234
- },
10235
-
10236
-
10237
- // Called when a new selection is made. Updates internal state and triggers handlers.
10238
- reportSelection: function(span, ev) {
10239
- this.isSelected = true;
10240
- this.triggerSelect(span, ev);
10241
- },
10242
-
10243
-
10244
- // Triggers handlers to 'select'
10245
- triggerSelect: function(span, ev) {
10246
- this.publiclyTrigger(
10247
- 'select',
10248
- null,
10249
- this.calendar.applyTimezone(span.start), // convert to calendar's tz for external API
10250
- this.calendar.applyTimezone(span.end), // "
10251
- ev
10252
- );
10253
- },
10254
-
10255
-
10256
- // Undoes a selection. updates in the internal state and triggers handlers.
10257
- // `ev` is the native mouse event that began the interaction.
10258
- unselect: function(ev) {
10259
- if (this.isSelected) {
10260
- this.isSelected = false;
10261
- if (this.destroySelection) {
10262
- this.destroySelection(); // TODO: deprecate
10263
- }
10264
- this.unrenderSelection();
10265
- this.publiclyTrigger('unselect', null, ev);
10266
- }
10267
- },
10268
-
10269
-
10270
- // Unrenders a visual indication of selection
10271
- unrenderSelection: function() {
10272
- // subclasses should implement
10273
- },
10274
-
10275
-
10276
- /* Event Selection
10277
- ------------------------------------------------------------------------------------------------------------------*/
10278
-
10279
-
10280
- selectEvent: function(event) {
10281
- if (!this.selectedEvent || this.selectedEvent !== event) {
10282
- this.unselectEvent();
10283
- this.renderedEventSegEach(function(seg) {
10284
- seg.el.addClass('fc-selected');
10285
- }, event);
10286
- this.selectedEvent = event;
10287
- }
10288
- },
10289
-
10290
-
10291
- unselectEvent: function() {
10292
- if (this.selectedEvent) {
10293
- this.renderedEventSegEach(function(seg) {
10294
- seg.el.removeClass('fc-selected');
10295
- }, this.selectedEvent);
10296
- this.selectedEvent = null;
10297
- }
10298
- },
10299
-
10300
-
10301
- isEventSelected: function(event) {
10302
- // event references might change on refetchEvents(), while selectedEvent doesn't,
10303
- // so compare IDs
10304
- return this.selectedEvent && this.selectedEvent._id === event._id;
10305
- },
10306
-
10307
-
10308
- /* Mouse / Touch Unselecting (time range & event unselection)
10309
- ------------------------------------------------------------------------------------------------------------------*/
10310
- // TODO: move consistently to down/start or up/end?
10311
- // TODO: don't kill previous selection if touch scrolling
10312
-
10313
-
10314
- handleDocumentMousedown: function(ev) {
10315
- if (isPrimaryMouseButton(ev)) {
10316
- this.processUnselect(ev);
10317
- }
10318
- },
10319
-
10320
-
10321
- processUnselect: function(ev) {
10322
- this.processRangeUnselect(ev);
10323
- this.processEventUnselect(ev);
10324
- },
10325
-
10326
-
10327
- processRangeUnselect: function(ev) {
10328
- var ignore;
10329
-
10330
- // is there a time-range selection?
10331
- if (this.isSelected && this.opt('unselectAuto')) {
10332
- // only unselect if the clicked element is not identical to or inside of an 'unselectCancel' element
10333
- ignore = this.opt('unselectCancel');
10334
- if (!ignore || !$(ev.target).closest(ignore).length) {
10335
- this.unselect(ev);
10336
- }
10337
- }
10338
- },
10339
-
10340
-
10341
- processEventUnselect: function(ev) {
10342
- if (this.selectedEvent) {
10343
- if (!$(ev.target).closest('.fc-selected').length) {
10344
- this.unselectEvent();
10345
- }
10346
- }
10347
- },
10348
-
10349
-
10350
- /* Day Click
10351
- ------------------------------------------------------------------------------------------------------------------*/
10352
-
10353
-
10354
- // Triggers handlers to 'dayClick'
10355
- // Span has start/end of the clicked area. Only the start is useful.
10356
- triggerDayClick: function(span, dayEl, ev) {
10357
- this.publiclyTrigger(
10358
- 'dayClick',
10359
- dayEl,
10360
- this.calendar.applyTimezone(span.start), // convert to calendar's timezone for external API
10361
- ev
10362
- );
10363
- },
10364
-
10365
-
10366
- /* Date Utils
10367
- ------------------------------------------------------------------------------------------------------------------*/
10368
-
10369
-
10370
- // Returns the date range of the full days the given range visually appears to occupy.
10371
- // Returns a new range object.
10372
- computeDayRange: function(range) {
10373
- var startDay = range.start.clone().stripTime(); // the beginning of the day the range starts
10374
- var end = range.end;
10375
- var endDay = null;
10376
- var endTimeMS;
10377
-
10378
- if (end) {
10379
- endDay = end.clone().stripTime(); // the beginning of the day the range exclusively ends
10380
- endTimeMS = +end.time(); // # of milliseconds into `endDay`
10381
-
10382
- // If the end time is actually inclusively part of the next day and is equal to or
10383
- // beyond the next day threshold, adjust the end to be the exclusive end of `endDay`.
10384
- // Otherwise, leaving it as inclusive will cause it to exclude `endDay`.
10385
- if (endTimeMS && endTimeMS >= this.nextDayThreshold) {
10386
- endDay.add(1, 'days');
10387
- }
10388
- }
10389
-
10390
- // If no end was specified, or if it is within `startDay` but not past nextDayThreshold,
10391
- // assign the default duration of one day.
10392
- if (!end || endDay <= startDay) {
10393
- endDay = startDay.clone().add(1, 'days');
10394
- }
10395
-
10396
- return { start: startDay, end: endDay };
10397
- },
10398
-
10399
-
10400
- // Does the given event visually appear to occupy more than one day?
10401
- isMultiDayEvent: function(event) {
10402
- var range = this.computeDayRange(event); // event is range-ish
10403
-
10404
- return range.end.diff(range.start, 'days') > 1;
10405
- }
10406
-
10407
- });
10408
-
10409
-
10410
- View.watch('displayingDates', [ 'dateProfile' ], function(deps) {
10411
- this.requestDateRender(deps.dateProfile);
10412
- }, function() {
10413
- this.requestDateUnrender();
10414
- });
10415
-
10416
-
10417
- View.watch('initialEvents', [ 'dateProfile' ], function(deps) {
10418
- return this.fetchInitialEvents(deps.dateProfile);
10419
- });
10420
-
10421
-
10422
- View.watch('bindingEvents', [ 'initialEvents' ], function(deps) {
10423
- this.setEvents(deps.initialEvents);
10424
- this.bindEventChanges();
10425
- }, function() {
10426
- this.unbindEventChanges();
10427
- this.unsetEvents();
10428
- });
10429
-
10430
-
10431
- View.watch('displayingEvents', [ 'displayingDates', 'hasEvents' ], function() {
10432
- this.requestEventsRender(this.get('currentEvents')); // if there were event mutations after initialEvents
10433
- }, function() {
10434
- this.requestEventsUnrender();
10435
- });
10436
-
10437
- ;;
10438
-
10439
- View.mixin({
10440
-
10441
- // range the view is formally responsible for.
10442
- // for example, a month view might have 1st-31st, excluding padded dates
10443
- currentRange: null,
10444
- currentRangeUnit: null, // name of largest unit being displayed, like "month" or "week"
10445
-
10446
- // date range with a rendered skeleton
10447
- // includes not-active days that need some sort of DOM
10448
- renderRange: null,
10449
-
10450
- // dates that display events and accept drag-n-drop
10451
- activeRange: null,
10452
-
10453
- // constraint for where prev/next operations can go and where events can be dragged/resized to.
10454
- // an object with optional start and end properties.
10455
- validRange: null,
10456
-
10457
- // how far the current date will move for a prev/next operation
10458
- dateIncrement: null,
10459
-
10460
- minTime: null, // Duration object that denotes the first visible time of any given day
10461
- maxTime: null, // Duration object that denotes the exclusive visible end time of any given day
10462
- usesMinMaxTime: false, // whether minTime/maxTime will affect the activeRange. Views must opt-in.
10463
-
10464
- // DEPRECATED
10465
- start: null, // use activeRange.start
10466
- end: null, // use activeRange.end
10467
- intervalStart: null, // use currentRange.start
10468
- intervalEnd: null, // use currentRange.end
10469
-
10470
-
10471
- /* Date Range Computation
10472
- ------------------------------------------------------------------------------------------------------------------*/
10473
-
10474
-
10475
- setDateProfileForRendering: function(dateProfile) {
10476
- this.currentRange = dateProfile.currentRange;
10477
- this.currentRangeUnit = dateProfile.currentRangeUnit;
10478
- this.renderRange = dateProfile.renderRange;
10479
- this.activeRange = dateProfile.activeRange;
10480
- this.validRange = dateProfile.validRange;
10481
- this.dateIncrement = dateProfile.dateIncrement;
10482
- this.minTime = dateProfile.minTime;
10483
- this.maxTime = dateProfile.maxTime;
10484
-
10485
- // DEPRECATED, but we need to keep it updated
10486
- this.start = dateProfile.activeRange.start;
10487
- this.end = dateProfile.activeRange.end;
10488
- this.intervalStart = dateProfile.currentRange.start;
10489
- this.intervalEnd = dateProfile.currentRange.end;
10490
- },
10491
-
10492
-
10493
- // Builds a structure with info about what the dates/ranges will be for the "prev" view.
10494
- buildPrevDateProfile: function(date) {
10495
- var prevDate = date.clone().startOf(this.currentRangeUnit).subtract(this.dateIncrement);
10496
-
10497
- return this.buildDateProfile(prevDate, -1);
10498
- },
10499
-
10500
-
10501
- // Builds a structure with info about what the dates/ranges will be for the "next" view.
10502
- buildNextDateProfile: function(date) {
10503
- var nextDate = date.clone().startOf(this.currentRangeUnit).add(this.dateIncrement);
10504
-
10505
- return this.buildDateProfile(nextDate, 1);
10506
- },
10507
-
10508
-
10509
- // Builds a structure holding dates/ranges for rendering around the given date.
10510
- // Optional direction param indicates whether the date is being incremented/decremented
10511
- // from its previous value. decremented = -1, incremented = 1 (default).
10512
- buildDateProfile: function(date, direction, forceToValid) {
10513
- var validRange = this.buildValidRange();
10514
- var minTime = null;
10515
- var maxTime = null;
10516
- var currentInfo;
10517
- var renderRange;
10518
- var activeRange;
10519
- var isValid;
10520
-
10521
- if (forceToValid) {
10522
- date = constrainDate(date, validRange);
10523
- }
10524
-
10525
- currentInfo = this.buildCurrentRangeInfo(date, direction);
10526
- renderRange = this.buildRenderRange(currentInfo.range, currentInfo.unit);
10527
- activeRange = cloneRange(renderRange);
10528
-
10529
- if (!this.opt('showNonCurrentDates')) {
10530
- activeRange = constrainRange(activeRange, currentInfo.range);
10531
- }
10532
-
10533
- minTime = moment.duration(this.opt('minTime'));
10534
- maxTime = moment.duration(this.opt('maxTime'));
10535
- this.adjustActiveRange(activeRange, minTime, maxTime);
10536
-
10537
- activeRange = constrainRange(activeRange, validRange);
10538
- date = constrainDate(date, activeRange);
10539
-
10540
- // it's invalid if the originally requested date is not contained,
10541
- // or if the range is completely outside of the valid range.
10542
- isValid = doRangesIntersect(currentInfo.range, validRange);
10543
-
10544
- return {
10545
- validRange: validRange,
10546
- currentRange: currentInfo.range,
10547
- currentRangeUnit: currentInfo.unit,
10548
- activeRange: activeRange,
10549
- renderRange: renderRange,
10550
- minTime: minTime,
10551
- maxTime: maxTime,
10552
- isValid: isValid,
10553
- date: date,
10554
- dateIncrement: this.buildDateIncrement(currentInfo.duration)
10555
- // pass a fallback (might be null) ^
10556
- };
10557
- },
10558
-
10559
-
10560
- // Builds an object with optional start/end properties.
10561
- // Indicates the minimum/maximum dates to display.
10562
- buildValidRange: function() {
10563
- return this.getRangeOption('validRange', this.calendar.getNow()) || {};
10564
- },
10565
-
10566
-
10567
- // Builds a structure with info about the "current" range, the range that is
10568
- // highlighted as being the current month for example.
10569
- // See buildDateProfile for a description of `direction`.
10570
- // Guaranteed to have `range` and `unit` properties. `duration` is optional.
10571
- buildCurrentRangeInfo: function(date, direction) {
10572
- var duration = null;
10573
- var unit = null;
10574
- var range = null;
10575
- var dayCount;
10576
-
10577
- if (this.viewSpec.duration) {
10578
- duration = this.viewSpec.duration;
10579
- unit = this.viewSpec.durationUnit;
10580
- range = this.buildRangeFromDuration(date, direction, duration, unit);
10581
- }
10582
- else if ((dayCount = this.opt('dayCount'))) {
10583
- unit = 'day';
10584
- range = this.buildRangeFromDayCount(date, direction, dayCount);
10585
- }
10586
- else if ((range = this.buildCustomVisibleRange(date))) {
10587
- unit = computeGreatestUnit(range.start, range.end);
10588
- }
10589
- else {
10590
- duration = this.getFallbackDuration();
10591
- unit = computeGreatestUnit(duration);
10592
- range = this.buildRangeFromDuration(date, direction, duration, unit);
10593
- }
10594
-
10595
- this.normalizeCurrentRange(range, unit); // modifies in-place
10596
-
10597
- return { duration: duration, unit: unit, range: range };
10598
- },
10599
-
10600
-
10601
- getFallbackDuration: function() {
10602
- return moment.duration({ days: 1 });
10603
- },
10604
-
10605
-
10606
- // If the range has day units or larger, remove times. Otherwise, ensure times.
10607
- normalizeCurrentRange: function(range, unit) {
10608
-
10609
- if (/^(year|month|week|day)$/.test(unit)) { // whole-days?
10610
- range.start.stripTime();
10611
- range.end.stripTime();
10612
- }
10613
- else { // needs to have a time?
10614
- if (!range.start.hasTime()) {
10615
- range.start.time(0); // give 00:00 time
10616
- }
10617
- if (!range.end.hasTime()) {
10618
- range.end.time(0); // give 00:00 time
10619
- }
10620
- }
10621
- },
10622
-
10623
-
10624
- // Mutates the given activeRange to have time values (un-ambiguate)
10625
- // if the minTime or maxTime causes the range to expand.
10626
- // TODO: eventually activeRange should *always* have times.
10627
- adjustActiveRange: function(range, minTime, maxTime) {
10628
- var hasSpecialTimes = false;
10629
-
10630
- if (this.usesMinMaxTime) {
10631
-
10632
- if (minTime < 0) {
10633
- range.start.time(0).add(minTime);
10634
- hasSpecialTimes = true;
10635
- }
10636
-
10637
- if (maxTime > 24 * 60 * 60 * 1000) { // beyond 24 hours?
10638
- range.end.time(maxTime - (24 * 60 * 60 * 1000));
10639
- hasSpecialTimes = true;
10640
- }
10641
-
10642
- if (hasSpecialTimes) {
10643
- if (!range.start.hasTime()) {
10644
- range.start.time(0);
10645
- }
10646
- if (!range.end.hasTime()) {
10647
- range.end.time(0);
10648
- }
10649
- }
10650
- }
10651
- },
10652
-
10653
-
10654
- // Builds the "current" range when it is specified as an explicit duration.
10655
- // `unit` is the already-computed computeGreatestUnit value of duration.
10656
- buildRangeFromDuration: function(date, direction, duration, unit) {
10657
- var alignment = this.opt('dateAlignment');
10658
- var start = date.clone();
10659
- var end;
10660
- var dateIncrementInput;
10661
- var dateIncrementDuration;
10662
-
10663
- // if the view displays a single day or smaller
10664
- if (duration.as('days') <= 1) {
10665
- if (this.isHiddenDay(start)) {
10666
- start = this.skipHiddenDays(start, direction);
10667
- start.startOf('day');
10668
- }
10669
- }
10670
-
10671
- // compute what the alignment should be
10672
- if (!alignment) {
10673
- dateIncrementInput = this.opt('dateIncrement');
10674
-
10675
- if (dateIncrementInput) {
10676
- dateIncrementDuration = moment.duration(dateIncrementInput);
10677
-
10678
- // use the smaller of the two units
10679
- if (dateIncrementDuration < duration) {
10680
- alignment = computeDurationGreatestUnit(dateIncrementDuration, dateIncrementInput);
10681
- }
10682
- else {
10683
- alignment = unit;
10684
- }
10685
- }
10686
- else {
10687
- alignment = unit;
10688
- }
10689
- }
10690
-
10691
- start.startOf(alignment);
10692
- end = start.clone().add(duration);
10693
-
10694
- return { start: start, end: end };
10695
- },
10696
-
10697
-
10698
- // Builds the "current" range when a dayCount is specified.
10699
- buildRangeFromDayCount: function(date, direction, dayCount) {
10700
- var customAlignment = this.opt('dateAlignment');
10701
- var runningCount = 0;
10702
- var start = date.clone();
10703
- var end;
10704
-
10705
- if (customAlignment) {
10706
- start.startOf(customAlignment);
10707
- }
10708
-
10709
- start.startOf('day');
10710
- start = this.skipHiddenDays(start, direction);
10711
-
10712
- end = start.clone();
10713
- do {
10714
- end.add(1, 'day');
10715
- if (!this.isHiddenDay(end)) {
10716
- runningCount++;
10717
- }
10718
- } while (runningCount < dayCount);
10719
-
10720
- return { start: start, end: end };
10721
- },
10722
-
10723
-
10724
- // Builds a normalized range object for the "visible" range,
10725
- // which is a way to define the currentRange and activeRange at the same time.
10726
- buildCustomVisibleRange: function(date) {
10727
- var visibleRange = this.getRangeOption(
10728
- 'visibleRange',
10729
- this.calendar.moment(date) // correct zone. also generates new obj that avoids mutations
10730
- );
10731
-
10732
- if (visibleRange && (!visibleRange.start || !visibleRange.end)) {
10733
- return null;
10734
- }
10735
-
10736
- return visibleRange;
10737
- },
10738
-
10739
-
10740
- // Computes the range that will represent the element/cells for *rendering*,
10741
- // but which may have voided days/times.
10742
- buildRenderRange: function(currentRange, currentRangeUnit) {
10743
- // cut off days in the currentRange that are hidden
10744
- return this.trimHiddenDays(currentRange);
10745
- },
10746
-
10747
-
10748
- // Compute the duration value that should be added/substracted to the current date
10749
- // when a prev/next operation happens.
10750
- buildDateIncrement: function(fallback) {
10751
- var dateIncrementInput = this.opt('dateIncrement');
10752
- var customAlignment;
10753
-
10754
- if (dateIncrementInput) {
10755
- return moment.duration(dateIncrementInput);
10756
- }
10757
- else if ((customAlignment = this.opt('dateAlignment'))) {
10758
- return moment.duration(1, customAlignment);
10759
- }
10760
- else if (fallback) {
10761
- return fallback;
10762
- }
10763
- else {
10764
- return moment.duration({ days: 1 });
10765
- }
10766
- },
10767
-
10768
-
10769
- // Remove days from the beginning and end of the range that are computed as hidden.
10770
- trimHiddenDays: function(inputRange) {
10771
- return {
10772
- start: this.skipHiddenDays(inputRange.start),
10773
- end: this.skipHiddenDays(inputRange.end, -1, true) // exclusively move backwards
10774
- };
10775
- },
10776
-
10777
-
10778
- // Compute the number of the give units in the "current" range.
10779
- // Will return a floating-point number. Won't round.
10780
- currentRangeAs: function(unit) {
10781
- var currentRange = this.currentRange;
10782
- return currentRange.end.diff(currentRange.start, unit, true);
10783
- },
10784
-
10785
-
10786
- // Arguments after name will be forwarded to a hypothetical function value
10787
- // WARNING: passed-in arguments will be given to generator functions as-is and can cause side-effects.
10788
- // Always clone your objects if you fear mutation.
10789
- getRangeOption: function(name) {
10790
- var val = this.opt(name);
10791
-
10792
- if (typeof val === 'function') {
10793
- val = val.apply(
10794
- null,
10795
- Array.prototype.slice.call(arguments, 1)
10796
- );
10797
- }
10798
-
10799
- if (val) {
10800
- return this.calendar.parseRange(val);
10801
- }
10802
- },
10803
-
10804
-
10805
- /* Hidden Days
10806
- ------------------------------------------------------------------------------------------------------------------*/
10807
-
10808
-
10809
- // Initializes internal variables related to calculating hidden days-of-week
10810
- initHiddenDays: function() {
10811
- var hiddenDays = this.opt('hiddenDays') || []; // array of day-of-week indices that are hidden
10812
- var isHiddenDayHash = []; // is the day-of-week hidden? (hash with day-of-week-index -> bool)
10813
- var dayCnt = 0;
10814
- var i;
10815
-
10816
- if (this.opt('weekends') === false) {
10817
- hiddenDays.push(0, 6); // 0=sunday, 6=saturday
10818
- }
10819
-
10820
- for (i = 0; i < 7; i++) {
10821
- if (
10822
- !(isHiddenDayHash[i] = $.inArray(i, hiddenDays) !== -1)
10823
- ) {
10824
- dayCnt++;
10825
- }
10826
- }
10827
-
10828
- if (!dayCnt) {
10829
- throw 'invalid hiddenDays'; // all days were hidden? bad.
10830
- }
10831
-
10832
- this.isHiddenDayHash = isHiddenDayHash;
10833
- },
10834
-
10835
-
10836
- // Is the current day hidden?
10837
- // `day` is a day-of-week index (0-6), or a Moment
10838
- isHiddenDay: function(day) {
10839
- if (moment.isMoment(day)) {
10840
- day = day.day();
10841
- }
10842
- return this.isHiddenDayHash[day];
10843
- },
10844
-
10845
-
10846
- // Incrementing the current day until it is no longer a hidden day, returning a copy.
10847
- // DOES NOT CONSIDER validRange!
10848
- // If the initial value of `date` is not a hidden day, don't do anything.
10849
- // Pass `isExclusive` as `true` if you are dealing with an end date.
10850
- // `inc` defaults to `1` (increment one day forward each time)
10851
- skipHiddenDays: function(date, inc, isExclusive) {
10852
- var out = date.clone();
10853
- inc = inc || 1;
10854
- while (
10855
- this.isHiddenDayHash[(out.day() + (isExclusive ? inc : 0) + 7) % 7]
10856
- ) {
10857
- out.add(inc, 'days');
10858
- }
10859
- return out;
10860
- }
10861
-
10862
- });
10863
-
10864
- ;;
10865
-
10866
- /*
10867
- Embodies a div that has potential scrollbars
10868
- */
10869
- var Scroller = FC.Scroller = Class.extend({
10870
-
10871
- el: null, // the guaranteed outer element
10872
- scrollEl: null, // the element with the scrollbars
10873
- overflowX: null,
10874
- overflowY: null,
10875
-
10876
-
10877
- constructor: function(options) {
10878
- options = options || {};
10879
- this.overflowX = options.overflowX || options.overflow || 'auto';
10880
- this.overflowY = options.overflowY || options.overflow || 'auto';
10881
- },
10882
-
10883
-
10884
- render: function() {
10885
- this.el = this.renderEl();
10886
- this.applyOverflow();
10887
- },
10888
-
10889
-
10890
- renderEl: function() {
10891
- return (this.scrollEl = $('<div class="fc-scroller"></div>'));
10892
- },
10893
-
10894
-
10895
- // sets to natural height, unlocks overflow
10896
- clear: function() {
10897
- this.setHeight('auto');
10898
- this.applyOverflow();
10899
- },
10900
-
10901
-
10902
- destroy: function() {
10903
- this.el.remove();
10904
- },
10905
-
10906
-
10907
- // Overflow
10908
- // -----------------------------------------------------------------------------------------------------------------
10909
-
10910
-
10911
- applyOverflow: function() {
10912
- this.scrollEl.css({
10913
- 'overflow-x': this.overflowX,
10914
- 'overflow-y': this.overflowY
10915
- });
10916
- },
10917
-
10918
-
10919
- // Causes any 'auto' overflow values to resolves to 'scroll' or 'hidden'.
10920
- // Useful for preserving scrollbar widths regardless of future resizes.
10921
- // Can pass in scrollbarWidths for optimization.
10922
- lockOverflow: function(scrollbarWidths) {
10923
- var overflowX = this.overflowX;
10924
- var overflowY = this.overflowY;
10925
-
10926
- scrollbarWidths = scrollbarWidths || this.getScrollbarWidths();
10927
-
10928
- if (overflowX === 'auto') {
10929
- overflowX = (
10930
- scrollbarWidths.top || scrollbarWidths.bottom || // horizontal scrollbars?
10931
- // OR scrolling pane with massless scrollbars?
10932
- this.scrollEl[0].scrollWidth - 1 > this.scrollEl[0].clientWidth
10933
- // subtract 1 because of IE off-by-one issue
10934
- ) ? 'scroll' : 'hidden';
10935
- }
10936
-
10937
- if (overflowY === 'auto') {
10938
- overflowY = (
10939
- scrollbarWidths.left || scrollbarWidths.right || // vertical scrollbars?
10940
- // OR scrolling pane with massless scrollbars?
10941
- this.scrollEl[0].scrollHeight - 1 > this.scrollEl[0].clientHeight
10942
- // subtract 1 because of IE off-by-one issue
10943
- ) ? 'scroll' : 'hidden';
10944
- }
10945
-
10946
- this.scrollEl.css({ 'overflow-x': overflowX, 'overflow-y': overflowY });
10947
- },
10948
-
10949
-
10950
- // Getters / Setters
10951
- // -----------------------------------------------------------------------------------------------------------------
10952
-
10953
-
10954
- setHeight: function(height) {
10955
- this.scrollEl.height(height);
10956
- },
10957
-
10958
-
10959
- getScrollTop: function() {
10960
- return this.scrollEl.scrollTop();
10961
- },
10962
-
10963
-
10964
- setScrollTop: function(top) {
10965
- this.scrollEl.scrollTop(top);
10966
- },
10967
-
10968
-
10969
- getClientWidth: function() {
10970
- return this.scrollEl[0].clientWidth;
10971
- },
10972
-
10973
-
10974
- getClientHeight: function() {
10975
- return this.scrollEl[0].clientHeight;
10976
- },
10977
-
10978
-
10979
- getScrollbarWidths: function() {
10980
- return getScrollbarWidths(this.scrollEl);
10981
- }
10982
-
10983
- });
10984
-
10985
- ;;
10986
- function Iterator(items) {
10987
- this.items = items || [];
10988
- }
10989
-
10990
-
10991
- /* Calls a method on every item passing the arguments through */
10992
- Iterator.prototype.proxyCall = function(methodName) {
10993
- var args = Array.prototype.slice.call(arguments, 1);
10994
- var results = [];
10995
-
10996
- this.items.forEach(function(item) {
10997
- results.push(item[methodName].apply(item, args));
10998
- });
10999
-
11000
- return results;
11001
- };
11002
-
11003
- ;;
11004
-
11005
- /* Toolbar with buttons and title
11006
- ----------------------------------------------------------------------------------------------------------------------*/
11007
-
11008
- function Toolbar(calendar, toolbarOptions) {
11009
- var t = this;
11010
-
11011
- // exports
11012
- t.setToolbarOptions = setToolbarOptions;
11013
- t.render = render;
11014
- t.removeElement = removeElement;
11015
- t.updateTitle = updateTitle;
11016
- t.activateButton = activateButton;
11017
- t.deactivateButton = deactivateButton;
11018
- t.disableButton = disableButton;
11019
- t.enableButton = enableButton;
11020
- t.getViewsWithButtons = getViewsWithButtons;
11021
- t.el = null; // mirrors local `el`
11022
-
11023
- // locals
11024
- var el;
11025
- var viewsWithButtons = [];
11026
- var tm;
11027
-
11028
- // method to update toolbar-specific options, not calendar-wide options
11029
- function setToolbarOptions(newToolbarOptions) {
11030
- toolbarOptions = newToolbarOptions;
11031
- }
11032
-
11033
- // can be called repeatedly and will rerender
11034
- function render() {
11035
- var sections = toolbarOptions.layout;
11036
-
11037
- tm = calendar.opt('theme') ? 'ui' : 'fc';
11038
-
11039
- if (sections) {
11040
- if (!el) {
11041
- el = this.el = $("<div class='fc-toolbar "+ toolbarOptions.extraClasses + "'/>");
11042
- }
11043
- else {
11044
- el.empty();
11045
- }
11046
- el.append(renderSection('left'))
11047
- .append(renderSection('right'))
11048
- .append(renderSection('center'))
11049
- .append('<div class="fc-clear"/>');
11050
- }
11051
- else {
11052
- removeElement();
11053
- }
11054
- }
11055
-
11056
-
11057
- function removeElement() {
11058
- if (el) {
11059
- el.remove();
11060
- el = t.el = null;
11061
- }
11062
- }
11063
-
11064
-
11065
- function renderSection(position) {
11066
- var sectionEl = $('<div class="fc-' + position + '"/>');
11067
- var buttonStr = toolbarOptions.layout[position];
11068
- var calendarCustomButtons = calendar.opt('customButtons') || {};
11069
- var calendarButtonText = calendar.opt('buttonText') || {};
11070
-
11071
- if (buttonStr) {
11072
- $.each(buttonStr.split(' '), function(i) {
11073
- var groupChildren = $();
11074
- var isOnlyButtons = true;
11075
- var groupEl;
11076
-
11077
- $.each(this.split(','), function(j, buttonName) {
11078
- var customButtonProps;
11079
- var viewSpec;
11080
- var buttonClick;
11081
- var overrideText; // text explicitly set by calendar's constructor options. overcomes icons
11082
- var defaultText;
11083
- var themeIcon;
11084
- var normalIcon;
11085
- var innerHtml;
11086
- var classes;
11087
- var button; // the element
11088
-
11089
- if (buttonName == 'title') {
11090
- groupChildren = groupChildren.add($('<h2>&nbsp;</h2>')); // we always want it to take up height
11091
- isOnlyButtons = false;
11092
- }
11093
- else {
11094
- if ((customButtonProps = calendarCustomButtons[buttonName])) {
11095
- buttonClick = function(ev) {
11096
- if (customButtonProps.click) {
11097
- customButtonProps.click.call(button[0], ev);
11098
- }
11099
- };
11100
- overrideText = ''; // icons will override text
11101
- defaultText = customButtonProps.text;
11102
- }
11103
- else if ((viewSpec = calendar.getViewSpec(buttonName))) {
11104
- buttonClick = function() {
11105
- calendar.changeView(buttonName);
11106
- };
11107
- viewsWithButtons.push(buttonName);
11108
- overrideText = viewSpec.buttonTextOverride;
11109
- defaultText = viewSpec.buttonTextDefault;
11110
- }
11111
- else if (calendar[buttonName]) { // a calendar method
11112
- buttonClick = function() {
11113
- calendar[buttonName]();
11114
- };
11115
- overrideText = (calendar.overrides.buttonText || {})[buttonName];
11116
- defaultText = calendarButtonText[buttonName]; // everything else is considered default
11117
- }
11118
-
11119
- if (buttonClick) {
11120
-
11121
- themeIcon =
11122
- customButtonProps ?
11123
- customButtonProps.themeIcon :
11124
- calendar.opt('themeButtonIcons')[buttonName];
11125
-
11126
- normalIcon =
11127
- customButtonProps ?
11128
- customButtonProps.icon :
11129
- calendar.opt('buttonIcons')[buttonName];
11130
-
11131
- if (overrideText) {
11132
- innerHtml = htmlEscape(overrideText);
11133
- }
11134
- else if (themeIcon && calendar.opt('theme')) {
11135
- innerHtml = "<span class='ui-icon ui-icon-" + themeIcon + "'></span>";
11136
- }
11137
- else if (normalIcon && !calendar.opt('theme')) {
11138
- innerHtml = "<span class='fc-icon fc-icon-" + normalIcon + "'></span>";
11139
- }
11140
- else {
11141
- innerHtml = htmlEscape(defaultText);
11142
- }
11143
-
11144
- classes = [
11145
- 'fc-' + buttonName + '-button',
11146
- tm + '-button',
11147
- tm + '-state-default'
11148
- ];
11149
-
11150
- button = $( // type="button" so that it doesn't submit a form
11151
- '<button type="button" class="' + classes.join(' ') + '">' +
11152
- innerHtml +
11153
- '</button>'
11154
- )
11155
- .click(function(ev) {
11156
- // don't process clicks for disabled buttons
11157
- if (!button.hasClass(tm + '-state-disabled')) {
11158
-
11159
- buttonClick(ev);
11160
-
11161
- // after the click action, if the button becomes the "active" tab, or disabled,
11162
- // it should never have a hover class, so remove it now.
11163
- if (
11164
- button.hasClass(tm + '-state-active') ||
11165
- button.hasClass(tm + '-state-disabled')
11166
- ) {
11167
- button.removeClass(tm + '-state-hover');
11168
- }
11169
- }
11170
- })
11171
- .mousedown(function() {
11172
- // the *down* effect (mouse pressed in).
11173
- // only on buttons that are not the "active" tab, or disabled
11174
- button
11175
- .not('.' + tm + '-state-active')
11176
- .not('.' + tm + '-state-disabled')
11177
- .addClass(tm + '-state-down');
11178
- })
11179
- .mouseup(function() {
11180
- // undo the *down* effect
11181
- button.removeClass(tm + '-state-down');
11182
- })
11183
- .hover(
11184
- function() {
11185
- // the *hover* effect.
11186
- // only on buttons that are not the "active" tab, or disabled
11187
- button
11188
- .not('.' + tm + '-state-active')
11189
- .not('.' + tm + '-state-disabled')
11190
- .addClass(tm + '-state-hover');
11191
- },
11192
- function() {
11193
- // undo the *hover* effect
11194
- button
11195
- .removeClass(tm + '-state-hover')
11196
- .removeClass(tm + '-state-down'); // if mouseleave happens before mouseup
11197
- }
11198
- );
11199
-
11200
- groupChildren = groupChildren.add(button);
11201
- }
11202
- }
11203
- });
11204
-
11205
- if (isOnlyButtons) {
11206
- groupChildren
11207
- .first().addClass(tm + '-corner-left').end()
11208
- .last().addClass(tm + '-corner-right').end();
11209
- }
11210
-
11211
- if (groupChildren.length > 1) {
11212
- groupEl = $('<div/>');
11213
- if (isOnlyButtons) {
11214
- groupEl.addClass('fc-button-group');
11215
- }
11216
- groupEl.append(groupChildren);
11217
- sectionEl.append(groupEl);
11218
- }
11219
- else {
11220
- sectionEl.append(groupChildren); // 1 or 0 children
11221
- }
11222
- });
11223
- }
11224
-
11225
- return sectionEl;
11226
- }
11227
-
11228
-
11229
- function updateTitle(text) {
11230
- if (el) {
11231
- el.find('h2').text(text);
11232
- }
11233
- }
11234
-
11235
-
11236
- function activateButton(buttonName) {
11237
- if (el) {
11238
- el.find('.fc-' + buttonName + '-button')
11239
- .addClass(tm + '-state-active');
11240
- }
11241
- }
11242
-
11243
-
11244
- function deactivateButton(buttonName) {
11245
- if (el) {
11246
- el.find('.fc-' + buttonName + '-button')
11247
- .removeClass(tm + '-state-active');
11248
- }
11249
- }
11250
-
11251
-
11252
- function disableButton(buttonName) {
11253
- if (el) {
11254
- el.find('.fc-' + buttonName + '-button')
11255
- .prop('disabled', true)
11256
- .addClass(tm + '-state-disabled');
11257
- }
11258
- }
11259
-
11260
-
11261
- function enableButton(buttonName) {
11262
- if (el) {
11263
- el.find('.fc-' + buttonName + '-button')
11264
- .prop('disabled', false)
11265
- .removeClass(tm + '-state-disabled');
11266
- }
11267
- }
11268
-
11269
-
11270
- function getViewsWithButtons() {
11271
- return viewsWithButtons;
11272
- }
11273
-
11274
- }
11275
-
11276
- ;;
11277
-
11278
- var Calendar = FC.Calendar = Class.extend(EmitterMixin, {
11279
-
11280
- view: null, // current View object
11281
- viewsByType: null, // holds all instantiated view instances, current or not
11282
- currentDate: null, // unzoned moment. private (public API should use getDate instead)
11283
- loadingLevel: 0, // number of simultaneous loading tasks
11284
-
11285
-
11286
- constructor: function(el, overrides) {
11287
-
11288
- // declare the current calendar instance relies on GlobalEmitter. needed for garbage collection.
11289
- // unneeded() is called in destroy.
11290
- GlobalEmitter.needed();
11291
-
11292
- this.el = el;
11293
- this.viewsByType = {};
11294
- this.viewSpecCache = {};
11295
-
11296
- this.initOptionsInternals(overrides);
11297
- this.initMomentInternals(); // needs to happen after options hash initialized
11298
- this.initCurrentDate();
11299
-
11300
- EventManager.call(this); // needs options immediately
11301
- this.initialize();
11302
- },
11303
-
11304
-
11305
- // Subclasses can override this for initialization logic after the constructor has been called
11306
- initialize: function() {
11307
- },
11308
-
11309
-
11310
- // Public API
11311
- // -----------------------------------------------------------------------------------------------------------------
11312
-
11313
-
11314
- getCalendar: function() {
11315
- return this;
11316
- },
11317
-
11318
-
11319
- getView: function() {
11320
- return this.view;
11321
- },
11322
-
11323
-
11324
- publiclyTrigger: function(name, thisObj) {
11325
- var args = Array.prototype.slice.call(arguments, 2);
11326
- var optHandler = this.opt(name);
11327
-
11328
- thisObj = thisObj || this.el[0];
11329
- this.triggerWith(name, thisObj, args); // Emitter's method
11330
-
11331
- if (optHandler) {
11332
- return optHandler.apply(thisObj, args);
11333
- }
11334
- },
11335
-
11336
-
11337
- // View
11338
- // -----------------------------------------------------------------------------------------------------------------
11339
-
11340
-
11341
- // Given a view name for a custom view or a standard view, creates a ready-to-go View object
11342
- instantiateView: function(viewType) {
11343
- var spec = this.getViewSpec(viewType);
11344
-
11345
- return new spec['class'](this, spec);
11346
- },
11347
-
11348
-
11349
- // Returns a boolean about whether the view is okay to instantiate at some point
11350
- isValidViewType: function(viewType) {
11351
- return Boolean(this.getViewSpec(viewType));
11352
- },
11353
-
11354
-
11355
- changeView: function(viewName, dateOrRange) {
11356
-
11357
- if (dateOrRange) {
11358
-
11359
- if (dateOrRange.start && dateOrRange.end) { // a range
11360
- this.recordOptionOverrides({ // will not rerender
11361
- visibleRange: dateOrRange
11362
- });
11363
- }
11364
- else { // a date
11365
- this.currentDate = this.moment(dateOrRange).stripZone(); // just like gotoDate
11366
- }
11367
- }
11368
-
11369
- this.renderView(viewName);
11370
- },
11371
-
11372
-
11373
- // Forces navigation to a view for the given date.
11374
- // `viewType` can be a specific view name or a generic one like "week" or "day".
11375
- zoomTo: function(newDate, viewType) {
11376
- var spec;
11377
-
11378
- viewType = viewType || 'day'; // day is default zoom
11379
- spec = this.getViewSpec(viewType) || this.getUnitViewSpec(viewType);
11380
-
11381
- this.currentDate = newDate.clone();
11382
- this.renderView(spec ? spec.type : null);
11383
- },
11384
-
11385
-
11386
- // Current Date
11387
- // -----------------------------------------------------------------------------------------------------------------
11388
-
11389
-
11390
- initCurrentDate: function() {
11391
- var defaultDateInput = this.opt('defaultDate');
11392
-
11393
- // compute the initial ambig-timezone date
11394
- if (defaultDateInput != null) {
11395
- this.currentDate = this.moment(defaultDateInput).stripZone();
11396
- }
11397
- else {
11398
- this.currentDate = this.getNow(); // getNow already returns unzoned
11399
- }
11400
- },
11401
-
11402
-
11403
- prev: function() {
11404
- var prevInfo = this.view.buildPrevDateProfile(this.currentDate);
11405
-
11406
- if (prevInfo.isValid) {
11407
- this.currentDate = prevInfo.date;
11408
- this.renderView();
11409
- }
11410
- },
11411
-
11412
-
11413
- next: function() {
11414
- var nextInfo = this.view.buildNextDateProfile(this.currentDate);
11415
-
11416
- if (nextInfo.isValid) {
11417
- this.currentDate = nextInfo.date;
11418
- this.renderView();
11419
- }
11420
- },
11421
-
11422
-
11423
- prevYear: function() {
11424
- this.currentDate.add(-1, 'years');
11425
- this.renderView();
11426
- },
11427
-
11428
-
11429
- nextYear: function() {
11430
- this.currentDate.add(1, 'years');
11431
- this.renderView();
11432
- },
11433
-
11434
-
11435
- today: function() {
11436
- this.currentDate = this.getNow(); // should deny like prev/next?
11437
- this.renderView();
11438
- },
11439
-
11440
-
11441
- gotoDate: function(zonedDateInput) {
11442
- this.currentDate = this.moment(zonedDateInput).stripZone();
11443
- this.renderView();
11444
- },
11445
-
11446
-
11447
- incrementDate: function(delta) {
11448
- this.currentDate.add(moment.duration(delta));
11449
- this.renderView();
11450
- },
11451
-
11452
-
11453
- // for external API
11454
- getDate: function() {
11455
- return this.applyTimezone(this.currentDate); // infuse the calendar's timezone
11456
- },
11457
-
11458
-
11459
- // Loading Triggering
11460
- // -----------------------------------------------------------------------------------------------------------------
11461
-
11462
-
11463
- // Should be called when any type of async data fetching begins
11464
- pushLoading: function() {
11465
- if (!(this.loadingLevel++)) {
11466
- this.publiclyTrigger('loading', null, true, this.view);
11467
- }
11468
- },
11469
-
11470
-
11471
- // Should be called when any type of async data fetching completes
11472
- popLoading: function() {
11473
- if (!(--this.loadingLevel)) {
11474
- this.publiclyTrigger('loading', null, false, this.view);
11475
- }
11476
- },
11477
-
11478
-
11479
- // Selection
11480
- // -----------------------------------------------------------------------------------------------------------------
11481
-
11482
-
11483
- // this public method receives start/end dates in any format, with any timezone
11484
- select: function(zonedStartInput, zonedEndInput) {
11485
- this.view.select(
11486
- this.buildSelectSpan.apply(this, arguments)
11487
- );
11488
- },
11489
-
11490
-
11491
- unselect: function() { // safe to be called before renderView
11492
- if (this.view) {
11493
- this.view.unselect();
11494
- }
11495
- },
11496
-
11497
-
11498
- // Given arguments to the select method in the API, returns a span (unzoned start/end and other info)
11499
- buildSelectSpan: function(zonedStartInput, zonedEndInput) {
11500
- var start = this.moment(zonedStartInput).stripZone();
11501
- var end;
11502
-
11503
- if (zonedEndInput) {
11504
- end = this.moment(zonedEndInput).stripZone();
11505
- }
11506
- else if (start.hasTime()) {
11507
- end = start.clone().add(this.defaultTimedEventDuration);
11508
- }
11509
- else {
11510
- end = start.clone().add(this.defaultAllDayEventDuration);
11511
- }
11512
-
11513
- return { start: start, end: end };
11514
- },
11515
-
11516
-
11517
- // Misc
11518
- // -----------------------------------------------------------------------------------------------------------------
11519
-
11520
-
11521
- // will return `null` if invalid range
11522
- parseRange: function(rangeInput) {
11523
- var start = null;
11524
- var end = null;
11525
-
11526
- if (rangeInput.start) {
11527
- start = this.moment(rangeInput.start).stripZone();
11528
- }
11529
-
11530
- if (rangeInput.end) {
11531
- end = this.moment(rangeInput.end).stripZone();
11532
- }
11533
-
11534
- if (!start && !end) {
11535
- return null;
11536
- }
11537
-
11538
- if (start && end && end.isBefore(start)) {
11539
- return null;
11540
- }
11541
-
11542
- return { start: start, end: end };
11543
- },
11544
-
11545
-
11546
- rerenderEvents: function() { // API method. destroys old events if previously rendered.
11547
- if (this.elementVisible()) {
11548
- this.reportEventChange(); // will re-trasmit events to the view, causing a rerender
11549
- }
11550
- }
11551
-
11552
- });
11553
-
11554
- ;;
11555
- /*
11556
- Options binding/triggering system.
11557
- */
11558
- Calendar.mixin({
11559
-
11560
- dirDefaults: null, // option defaults related to LTR or RTL
11561
- localeDefaults: null, // option defaults related to current locale
11562
- overrides: null, // option overrides given to the fullCalendar constructor
11563
- dynamicOverrides: null, // options set with dynamic setter method. higher precedence than view overrides.
11564
- optionsModel: null, // all defaults combined with overrides
11565
-
11566
-
11567
- initOptionsInternals: function(overrides) {
11568
- this.overrides = $.extend({}, overrides); // make a copy
11569
- this.dynamicOverrides = {};
11570
- this.optionsModel = new Model();
11571
-
11572
- this.populateOptionsHash();
11573
- },
11574
-
11575
-
11576
- // public getter/setter
11577
- option: function(name, value) {
11578
- var newOptionHash;
11579
-
11580
- if (typeof name === 'string') {
11581
- if (value === undefined) { // getter
11582
- return this.optionsModel.get(name);
11583
- }
11584
- else { // setter for individual option
11585
- newOptionHash = {};
11586
- newOptionHash[name] = value;
11587
- this.setOptions(newOptionHash);
11588
- }
11589
- }
11590
- else if (typeof name === 'object') { // compound setter with object input
11591
- this.setOptions(name);
11592
- }
11593
- },
11594
-
11595
-
11596
- // private getter
11597
- opt: function(name) {
11598
- return this.optionsModel.get(name);
11599
- },
11600
-
11601
-
11602
- setOptions: function(newOptionHash) {
11603
- var optionCnt = 0;
11604
- var optionName;
11605
-
11606
- this.recordOptionOverrides(newOptionHash);
11607
-
11608
- for (optionName in newOptionHash) {
11609
- optionCnt++;
11610
- }
11611
-
11612
- // special-case handling of single option change.
11613
- // if only one option change, `optionName` will be its name.
11614
- if (optionCnt === 1) {
11615
- if (optionName === 'height' || optionName === 'contentHeight' || optionName === 'aspectRatio') {
11616
- this.updateSize(true); // true = allow recalculation of height
11617
- return;
11618
- }
11619
- else if (optionName === 'defaultDate') {
11620
- return; // can't change date this way. use gotoDate instead
11621
- }
11622
- else if (optionName === 'businessHours') {
11623
- if (this.view) {
11624
- this.view.unrenderBusinessHours();
11625
- this.view.renderBusinessHours();
11626
- }
11627
- return;
11628
- }
11629
- else if (optionName === 'timezone') {
11630
- this.rezoneArrayEventSources();
11631
- this.refetchEvents();
11632
- return;
11633
- }
11634
- }
11635
-
11636
- // catch-all. rerender the header and footer and rebuild/rerender the current view
11637
- this.renderHeader();
11638
- this.renderFooter();
11639
-
11640
- // even non-current views will be affected by this option change. do before rerender
11641
- // TODO: detangle
11642
- this.viewsByType = {};
11643
-
11644
- this.reinitView();
11645
- },
11646
-
11647
-
11648
- // Computes the flattened options hash for the calendar and assigns to `this.options`.
11649
- // Assumes this.overrides and this.dynamicOverrides have already been initialized.
11650
- populateOptionsHash: function() {
11651
- var locale, localeDefaults;
11652
- var isRTL, dirDefaults;
11653
- var rawOptions;
11654
-
11655
- locale = firstDefined( // explicit locale option given?
11656
- this.dynamicOverrides.locale,
11657
- this.overrides.locale
11658
- );
11659
- localeDefaults = localeOptionHash[locale];
11660
- if (!localeDefaults) { // explicit locale option not given or invalid?
11661
- locale = Calendar.defaults.locale;
11662
- localeDefaults = localeOptionHash[locale] || {};
11663
- }
11664
-
11665
- isRTL = firstDefined( // based on options computed so far, is direction RTL?
11666
- this.dynamicOverrides.isRTL,
11667
- this.overrides.isRTL,
11668
- localeDefaults.isRTL,
11669
- Calendar.defaults.isRTL
11670
- );
11671
- dirDefaults = isRTL ? Calendar.rtlDefaults : {};
11672
-
11673
- this.dirDefaults = dirDefaults;
11674
- this.localeDefaults = localeDefaults;
11675
-
11676
- rawOptions = mergeOptions([ // merge defaults and overrides. lowest to highest precedence
11677
- Calendar.defaults, // global defaults
11678
- dirDefaults,
11679
- localeDefaults,
11680
- this.overrides,
11681
- this.dynamicOverrides
11682
- ]);
11683
- populateInstanceComputableOptions(rawOptions); // fill in gaps with computed options
11684
-
11685
- this.optionsModel.reset(rawOptions);
11686
- },
11687
-
11688
-
11689
- // stores the new options internally, but does not rerender anything.
11690
- recordOptionOverrides: function(newOptionHash) {
11691
- var optionName;
11692
-
11693
- for (optionName in newOptionHash) {
11694
- this.dynamicOverrides[optionName] = newOptionHash[optionName];
11695
- }
11696
-
11697
- this.viewSpecCache = {}; // the dynamic override invalidates the options in this cache, so just clear it
11698
- this.populateOptionsHash(); // this.options needs to be recomputed after the dynamic override
11699
- }
11700
-
11701
- });
11702
-
11703
- ;;
11704
-
11705
- Calendar.mixin({
11706
-
11707
- defaultAllDayEventDuration: null,
11708
- defaultTimedEventDuration: null,
11709
- localeData: null,
11710
-
11711
-
11712
- initMomentInternals: function() {
11713
- var _this = this;
11714
-
11715
- this.defaultAllDayEventDuration = moment.duration(this.opt('defaultAllDayEventDuration'));
11716
- this.defaultTimedEventDuration = moment.duration(this.opt('defaultTimedEventDuration'));
11717
-
11718
- // Called immediately, and when any of the options change.
11719
- // Happens before any internal objects rebuild or rerender, because this is very core.
11720
- this.optionsModel.watch('buildingMomentLocale', [
11721
- '?locale', '?monthNames', '?monthNamesShort', '?dayNames', '?dayNamesShort',
11722
- '?firstDay', '?weekNumberCalculation'
11723
- ], function(opts) {
11724
- var weekNumberCalculation = opts.weekNumberCalculation;
11725
- var firstDay = opts.firstDay;
11726
- var _week;
11727
-
11728
- // normalize
11729
- if (weekNumberCalculation === 'iso') {
11730
- weekNumberCalculation = 'ISO'; // normalize
11731
- }
11732
-
11733
- var localeData = createObject( // make a cheap copy
11734
- getMomentLocaleData(opts.locale) // will fall back to en
11735
- );
11736
-
11737
- if (opts.monthNames) {
11738
- localeData._months = opts.monthNames;
11739
- }
11740
- if (opts.monthNamesShort) {
11741
- localeData._monthsShort = opts.monthNamesShort;
11742
- }
11743
- if (opts.dayNames) {
11744
- localeData._weekdays = opts.dayNames;
11745
- }
11746
- if (opts.dayNamesShort) {
11747
- localeData._weekdaysShort = opts.dayNamesShort;
11748
- }
11749
-
11750
- if (firstDay == null && weekNumberCalculation === 'ISO') {
11751
- firstDay = 1;
11752
- }
11753
- if (firstDay != null) {
11754
- _week = createObject(localeData._week); // _week: { dow: # }
11755
- _week.dow = firstDay;
11756
- localeData._week = _week;
11757
- }
11758
-
11759
- if ( // whitelist certain kinds of input
11760
- weekNumberCalculation === 'ISO' ||
11761
- weekNumberCalculation === 'local' ||
11762
- typeof weekNumberCalculation === 'function'
11763
- ) {
11764
- localeData._fullCalendar_weekCalc = weekNumberCalculation; // moment-ext will know what to do with it
11765
- }
11766
-
11767
- _this.localeData = localeData;
11768
-
11769
- // If the internal current date object already exists, move to new locale.
11770
- // We do NOT need to do this technique for event dates, because this happens when converting to "segments".
11771
- if (_this.currentDate) {
11772
- _this.localizeMoment(_this.currentDate); // sets to localeData
11773
- }
11774
- });
11775
- },
11776
-
11777
-
11778
- // Builds a moment using the settings of the current calendar: timezone and locale.
11779
- // Accepts anything the vanilla moment() constructor accepts.
11780
- moment: function() {
11781
- var mom;
11782
-
11783
- if (this.opt('timezone') === 'local') {
11784
- mom = FC.moment.apply(null, arguments);
11785
-
11786
- // Force the moment to be local, because FC.moment doesn't guarantee it.
11787
- if (mom.hasTime()) { // don't give ambiguously-timed moments a local zone
11788
- mom.local();
11789
- }
11790
- }
11791
- else if (this.opt('timezone') === 'UTC') {
11792
- mom = FC.moment.utc.apply(null, arguments); // process as UTC
11793
- }
11794
- else {
11795
- mom = FC.moment.parseZone.apply(null, arguments); // let the input decide the zone
11796
- }
11797
-
11798
- this.localizeMoment(mom); // TODO
11799
-
11800
- return mom;
11801
- },
11802
-
11803
-
11804
- // Updates the given moment's locale settings to the current calendar locale settings.
11805
- localizeMoment: function(mom) {
11806
- mom._locale = this.localeData;
11807
- },
11808
-
11809
-
11810
- // Returns a boolean about whether or not the calendar knows how to calculate
11811
- // the timezone offset of arbitrary dates in the current timezone.
11812
- getIsAmbigTimezone: function() {
11813
- return this.opt('timezone') !== 'local' && this.opt('timezone') !== 'UTC';
11814
- },
11815
-
11816
-
11817
- // Returns a copy of the given date in the current timezone. Has no effect on dates without times.
11818
- applyTimezone: function(date) {
11819
- if (!date.hasTime()) {
11820
- return date.clone();
11821
- }
11822
-
11823
- var zonedDate = this.moment(date.toArray());
11824
- var timeAdjust = date.time() - zonedDate.time();
11825
- var adjustedZonedDate;
11826
-
11827
- // Safari sometimes has problems with this coersion when near DST. Adjust if necessary. (bug #2396)
11828
- if (timeAdjust) { // is the time result different than expected?
11829
- adjustedZonedDate = zonedDate.clone().add(timeAdjust); // add milliseconds
11830
- if (date.time() - adjustedZonedDate.time() === 0) { // does it match perfectly now?
11831
- zonedDate = adjustedZonedDate;
11832
- }
11833
- }
11834
-
11835
- return zonedDate;
11836
- },
11837
-
11838
-
11839
- // Returns a moment for the current date, as defined by the client's computer or from the `now` option.
11840
- // Will return an moment with an ambiguous timezone.
11841
- getNow: function() {
11842
- var now = this.opt('now');
11843
- if (typeof now === 'function') {
11844
- now = now();
11845
- }
11846
- return this.moment(now).stripZone();
11847
- },
11848
-
11849
-
11850
- // Produces a human-readable string for the given duration.
11851
- // Side-effect: changes the locale of the given duration.
11852
- humanizeDuration: function(duration) {
11853
- return duration.locale(this.opt('locale')).humanize();
11854
- },
11855
-
11856
-
11857
-
11858
- // Event-Specific Date Utilities. TODO: move
11859
- // -----------------------------------------------------------------------------------------------------------------
11860
-
11861
-
11862
- // Get an event's normalized end date. If not present, calculate it from the defaults.
11863
- getEventEnd: function(event) {
11864
- if (event.end) {
11865
- return event.end.clone();
11866
- }
11867
- else {
11868
- return this.getDefaultEventEnd(event.allDay, event.start);
11869
- }
11870
- },
11871
-
11872
-
11873
- // Given an event's allDay status and start date, return what its fallback end date should be.
11874
- // TODO: rename to computeDefaultEventEnd
11875
- getDefaultEventEnd: function(allDay, zonedStart) {
11876
- var end = zonedStart.clone();
11877
-
11878
- if (allDay) {
11879
- end.stripTime().add(this.defaultAllDayEventDuration);
11880
- }
11881
- else {
11882
- end.add(this.defaultTimedEventDuration);
11883
- }
11884
-
11885
- if (this.getIsAmbigTimezone()) {
11886
- end.stripZone(); // we don't know what the tzo should be
11887
- }
11888
-
11889
- return end;
11890
- }
11891
-
11892
- });
11893
-
11894
- ;;
11895
-
11896
- Calendar.mixin({
11897
-
11898
- viewSpecCache: null, // cache of view definitions (initialized in Calendar.js)
11899
-
11900
-
11901
- // Gets information about how to create a view. Will use a cache.
11902
- getViewSpec: function(viewType) {
11903
- var cache = this.viewSpecCache;
11904
-
11905
- return cache[viewType] || (cache[viewType] = this.buildViewSpec(viewType));
11906
- },
11907
-
11908
-
11909
- // Given a duration singular unit, like "week" or "day", finds a matching view spec.
11910
- // Preference is given to views that have corresponding buttons.
11911
- getUnitViewSpec: function(unit) {
11912
- var viewTypes;
11913
- var i;
11914
- var spec;
11915
-
11916
- if ($.inArray(unit, unitsDesc) != -1) {
11917
-
11918
- // put views that have buttons first. there will be duplicates, but oh well
11919
- viewTypes = this.header.getViewsWithButtons(); // TODO: include footer as well?
11920
- $.each(FC.views, function(viewType) { // all views
11921
- viewTypes.push(viewType);
11922
- });
11923
-
11924
- for (i = 0; i < viewTypes.length; i++) {
11925
- spec = this.getViewSpec(viewTypes[i]);
11926
- if (spec) {
11927
- if (spec.singleUnit == unit) {
11928
- return spec;
11929
- }
11930
- }
11931
- }
11932
- }
11933
- },
11934
-
11935
-
11936
- // Builds an object with information on how to create a given view
11937
- buildViewSpec: function(requestedViewType) {
11938
- var viewOverrides = this.overrides.views || {};
11939
- var specChain = []; // for the view. lowest to highest priority
11940
- var defaultsChain = []; // for the view. lowest to highest priority
11941
- var overridesChain = []; // for the view. lowest to highest priority
11942
- var viewType = requestedViewType;
11943
- var spec; // for the view
11944
- var overrides; // for the view
11945
- var durationInput;
11946
- var duration;
11947
- var unit;
11948
-
11949
- // iterate from the specific view definition to a more general one until we hit an actual View class
11950
- while (viewType) {
11951
- spec = fcViews[viewType];
11952
- overrides = viewOverrides[viewType];
11953
- viewType = null; // clear. might repopulate for another iteration
11954
-
11955
- if (typeof spec === 'function') { // TODO: deprecate
11956
- spec = { 'class': spec };
11957
- }
11958
-
11959
- if (spec) {
11960
- specChain.unshift(spec);
11961
- defaultsChain.unshift(spec.defaults || {});
11962
- durationInput = durationInput || spec.duration;
11963
- viewType = viewType || spec.type;
11964
- }
11965
-
11966
- if (overrides) {
11967
- overridesChain.unshift(overrides); // view-specific option hashes have options at zero-level
11968
- durationInput = durationInput || overrides.duration;
11969
- viewType = viewType || overrides.type;
11970
- }
11971
- }
11972
-
11973
- spec = mergeProps(specChain);
11974
- spec.type = requestedViewType;
11975
- if (!spec['class']) {
11976
- return false;
11977
- }
11978
-
11979
- // fall back to top-level `duration` option
11980
- durationInput = durationInput ||
11981
- this.dynamicOverrides.duration ||
11982
- this.overrides.duration;
11983
-
11984
- if (durationInput) {
11985
- duration = moment.duration(durationInput);
11986
-
11987
- if (duration.valueOf()) { // valid?
11988
-
11989
- unit = computeDurationGreatestUnit(duration, durationInput);
11990
-
11991
- spec.duration = duration;
11992
- spec.durationUnit = unit;
11993
-
11994
- // view is a single-unit duration, like "week" or "day"
11995
- // incorporate options for this. lowest priority
11996
- if (duration.as(unit) === 1) {
11997
- spec.singleUnit = unit;
11998
- overridesChain.unshift(viewOverrides[unit] || {});
11999
- }
12000
- }
12001
- }
12002
-
12003
- spec.defaults = mergeOptions(defaultsChain);
12004
- spec.overrides = mergeOptions(overridesChain);
12005
-
12006
- this.buildViewSpecOptions(spec);
12007
- this.buildViewSpecButtonText(spec, requestedViewType);
12008
-
12009
- return spec;
12010
- },
12011
-
12012
-
12013
- // Builds and assigns a view spec's options object from its already-assigned defaults and overrides
12014
- buildViewSpecOptions: function(spec) {
12015
- spec.options = mergeOptions([ // lowest to highest priority
12016
- Calendar.defaults, // global defaults
12017
- spec.defaults, // view's defaults (from ViewSubclass.defaults)
12018
- this.dirDefaults,
12019
- this.localeDefaults, // locale and dir take precedence over view's defaults!
12020
- this.overrides, // calendar's overrides (options given to constructor)
12021
- spec.overrides, // view's overrides (view-specific options)
12022
- this.dynamicOverrides // dynamically set via setter. highest precedence
12023
- ]);
12024
- populateInstanceComputableOptions(spec.options);
12025
- },
12026
-
12027
-
12028
- // Computes and assigns a view spec's buttonText-related options
12029
- buildViewSpecButtonText: function(spec, requestedViewType) {
12030
-
12031
- // given an options object with a possible `buttonText` hash, lookup the buttonText for the
12032
- // requested view, falling back to a generic unit entry like "week" or "day"
12033
- function queryButtonText(options) {
12034
- var buttonText = options.buttonText || {};
12035
- return buttonText[requestedViewType] ||
12036
- // view can decide to look up a certain key
12037
- (spec.buttonTextKey ? buttonText[spec.buttonTextKey] : null) ||
12038
- // a key like "month"
12039
- (spec.singleUnit ? buttonText[spec.singleUnit] : null);
12040
- }
12041
-
12042
- // highest to lowest priority
12043
- spec.buttonTextOverride =
12044
- queryButtonText(this.dynamicOverrides) ||
12045
- queryButtonText(this.overrides) || // constructor-specified buttonText lookup hash takes precedence
12046
- spec.overrides.buttonText; // `buttonText` for view-specific options is a string
12047
-
12048
- // highest to lowest priority. mirrors buildViewSpecOptions
12049
- spec.buttonTextDefault =
12050
- queryButtonText(this.localeDefaults) ||
12051
- queryButtonText(this.dirDefaults) ||
12052
- spec.defaults.buttonText || // a single string. from ViewSubclass.defaults
12053
- queryButtonText(Calendar.defaults) ||
12054
- (spec.duration ? this.humanizeDuration(spec.duration) : null) || // like "3 days"
12055
- requestedViewType; // fall back to given view name
12056
- }
12057
-
12058
- });
12059
-
12060
- ;;
12061
-
12062
- Calendar.mixin({
12063
-
12064
- el: null,
12065
- contentEl: null,
12066
- suggestedViewHeight: null,
12067
- windowResizeProxy: null,
12068
- ignoreWindowResize: 0,
12069
-
12070
-
12071
- render: function() {
12072
- if (!this.contentEl) {
12073
- this.initialRender();
12074
- }
12075
- else if (this.elementVisible()) {
12076
- // mainly for the public API
12077
- this.calcSize();
12078
- this.renderView();
12079
- }
12080
- },
12081
-
12082
-
12083
- initialRender: function() {
12084
- var _this = this;
12085
- var el = this.el;
12086
-
12087
- el.addClass('fc');
12088
-
12089
- // event delegation for nav links
12090
- el.on('click.fc', 'a[data-goto]', function(ev) {
12091
- var anchorEl = $(this);
12092
- var gotoOptions = anchorEl.data('goto'); // will automatically parse JSON
12093
- var date = _this.moment(gotoOptions.date);
12094
- var viewType = gotoOptions.type;
12095
-
12096
- // property like "navLinkDayClick". might be a string or a function
12097
- var customAction = _this.view.opt('navLink' + capitaliseFirstLetter(viewType) + 'Click');
12098
-
12099
- if (typeof customAction === 'function') {
12100
- customAction(date, ev);
12101
- }
12102
- else {
12103
- if (typeof customAction === 'string') {
12104
- viewType = customAction;
12105
- }
12106
- _this.zoomTo(date, viewType);
12107
- }
12108
- });
12109
-
12110
- // called immediately, and upon option change
12111
- this.optionsModel.watch('applyingThemeClasses', [ '?theme' ], function(opts) {
12112
- el.toggleClass('ui-widget', opts.theme);
12113
- el.toggleClass('fc-unthemed', !opts.theme);
12114
- });
12115
-
12116
- // called immediately, and upon option change.
12117
- // HACK: locale often affects isRTL, so we explicitly listen to that too.
12118
- this.optionsModel.watch('applyingDirClasses', [ '?isRTL', '?locale' ], function(opts) {
12119
- el.toggleClass('fc-ltr', !opts.isRTL);
12120
- el.toggleClass('fc-rtl', opts.isRTL);
12121
- });
12122
-
12123
- this.contentEl = $("<div class='fc-view-container'/>").prependTo(el);
12124
-
12125
- this.initToolbars();
12126
- this.renderHeader();
12127
- this.renderFooter();
12128
- this.renderView(this.opt('defaultView'));
12129
-
12130
- if (this.opt('handleWindowResize')) {
12131
- $(window).resize(
12132
- this.windowResizeProxy = debounce( // prevents rapid calls
12133
- this.windowResize.bind(this),
12134
- this.opt('windowResizeDelay')
12135
- )
12136
- );
12137
- }
12138
- },
12139
-
12140
-
12141
- destroy: function() {
12142
-
12143
- if (this.view) {
12144
- this.view.removeElement();
12145
-
12146
- // NOTE: don't null-out this.view in case API methods are called after destroy.
12147
- // It is still the "current" view, just not rendered.
12148
- }
12149
-
12150
- this.toolbarsManager.proxyCall('removeElement');
12151
- this.contentEl.remove();
12152
- this.el.removeClass('fc fc-ltr fc-rtl fc-unthemed ui-widget');
12153
-
12154
- this.el.off('.fc'); // unbind nav link handlers
12155
-
12156
- if (this.windowResizeProxy) {
12157
- $(window).unbind('resize', this.windowResizeProxy);
12158
- this.windowResizeProxy = null;
12159
- }
12160
-
12161
- GlobalEmitter.unneeded();
12162
- },
12163
-
12164
-
12165
- elementVisible: function() {
12166
- return this.el.is(':visible');
12167
- },
12168
-
12169
-
12170
-
12171
- // View Rendering
12172
- // -----------------------------------------------------------------------------------
12173
-
12174
-
12175
- // Renders a view because of a date change, view-type change, or for the first time.
12176
- // If not given a viewType, keep the current view but render different dates.
12177
- // Accepts an optional scroll state to restore to.
12178
- renderView: function(viewType, forcedScroll) {
12179
-
12180
- this.ignoreWindowResize++;
12181
-
12182
- var needsClearView = this.view && viewType && this.view.type !== viewType;
12183
-
12184
- // if viewType is changing, remove the old view's rendering
12185
- if (needsClearView) {
12186
- this.freezeContentHeight(); // prevent a scroll jump when view element is removed
12187
- this.clearView();
12188
- }
12189
-
12190
- // if viewType changed, or the view was never created, create a fresh view
12191
- if (!this.view && viewType) {
12192
- this.view =
12193
- this.viewsByType[viewType] ||
12194
- (this.viewsByType[viewType] = this.instantiateView(viewType));
12195
-
12196
- this.view.setElement(
12197
- $("<div class='fc-view fc-" + viewType + "-view' />").appendTo(this.contentEl)
12198
- );
12199
- this.toolbarsManager.proxyCall('activateButton', viewType);
12200
- }
12201
-
12202
- if (this.view) {
12203
-
12204
- if (forcedScroll) {
12205
- this.view.addForcedScroll(forcedScroll);
12206
- }
12207
-
12208
- if (this.elementVisible()) {
12209
- this.currentDate = this.view.setDate(this.currentDate);
12210
- }
12211
- }
12212
-
12213
- if (needsClearView) {
12214
- this.thawContentHeight();
12215
- }
12216
-
12217
- this.ignoreWindowResize--;
12218
- },
12219
-
12220
-
12221
- // Unrenders the current view and reflects this change in the Header.
12222
- // Unregsiters the `view`, but does not remove from viewByType hash.
12223
- clearView: function() {
12224
- this.toolbarsManager.proxyCall('deactivateButton', this.view.type);
12225
- this.view.removeElement();
12226
- this.view = null;
12227
- },
12228
-
12229
-
12230
- // Destroys the view, including the view object. Then, re-instantiates it and renders it.
12231
- // Maintains the same scroll state.
12232
- // TODO: maintain any other user-manipulated state.
12233
- reinitView: function() {
12234
- this.ignoreWindowResize++;
12235
- this.freezeContentHeight();
12236
-
12237
- var viewType = this.view.type;
12238
- var scrollState = this.view.queryScroll();
12239
- this.clearView();
12240
- this.calcSize();
12241
- this.renderView(viewType, scrollState);
12242
-
12243
- this.thawContentHeight();
12244
- this.ignoreWindowResize--;
12245
- },
12246
-
12247
-
12248
- // Resizing
12249
- // -----------------------------------------------------------------------------------
12250
-
12251
-
12252
- getSuggestedViewHeight: function() {
12253
- if (this.suggestedViewHeight === null) {
12254
- this.calcSize();
12255
- }
12256
- return this.suggestedViewHeight;
12257
- },
12258
-
12259
-
12260
- isHeightAuto: function() {
12261
- return this.opt('contentHeight') === 'auto' || this.opt('height') === 'auto';
12262
- },
12263
-
12264
-
12265
- updateSize: function(shouldRecalc) {
12266
- if (this.elementVisible()) {
12267
-
12268
- if (shouldRecalc) {
12269
- this._calcSize();
12270
- }
12271
-
12272
- this.ignoreWindowResize++;
12273
- this.view.updateSize(true); // isResize=true. will poll getSuggestedViewHeight() and isHeightAuto()
12274
- this.ignoreWindowResize--;
12275
-
12276
- return true; // signal success
12277
- }
12278
- },
12279
-
12280
-
12281
- calcSize: function() {
12282
- if (this.elementVisible()) {
12283
- this._calcSize();
12284
- }
12285
- },
12286
-
12287
-
12288
- _calcSize: function() { // assumes elementVisible
12289
- var contentHeightInput = this.opt('contentHeight');
12290
- var heightInput = this.opt('height');
12291
-
12292
- if (typeof contentHeightInput === 'number') { // exists and not 'auto'
12293
- this.suggestedViewHeight = contentHeightInput;
12294
- }
12295
- else if (typeof contentHeightInput === 'function') { // exists and is a function
12296
- this.suggestedViewHeight = contentHeightInput();
12297
- }
12298
- else if (typeof heightInput === 'number')