Plugin Directory

Changeset 2935728


Ignore:
Timestamp:
07/07/2023 08:44:12 PM (3 years ago)
Author:
megabase
Message:

v1.2.9 Release

Location:
megabase-calendar
Files:
2243 added
7 edited

Legend:

Unmodified
Added
Removed
  • megabase-calendar/trunk/README.md

    r2932767 r2935728  
    286286- Make sure you've checked out `main`, and you don't have any commits that have not been pushed
    287287- Run `npm run build` to build assets for Production
    288 - Update the version number in `class-megabase-calendar.php`, `readme.txt`, and `gulpfile.js`
    289288- Review commit log and add a user-friendly list of changes in the Changelog section of `readme.txt`. Most recent versions should be at the top of the Changelog.
    290289- Commit & push your version & readme changes
     
    323322- Confirm no issues with update via WP Plugin screen
    324323- Confirm no issues with new installation from WP Plugin screen
     324- Update the version number in `class-megabase-calendar.php`, `readme.txt`, and `gulpfile.js`
    325325
    326326<!-- ### Other Notes ### -->
  • megabase-calendar/trunk/assets/build/js/admin.min.js

    r2932767 r2935728  
    1818/*! Select2 4.1.0-rc.0 | https://github.com/select2/select2/blob/master/LICENSE.md */
    1919!function(n){"function"==typeof define&&define.amd?define(["jquery"],n):"object"==typeof module&&module.exports?module.exports=function(e,t){return void 0===t&&(t="undefined"!=typeof window?require("jquery"):require("jquery")(e)),n(t),t}:n(jQuery)}(function(t){var e,n,s,p,r,o,h,f,g,m,y,v,i,a,_,s=(t&&t.fn&&t.fn.select2&&t.fn.select2.amd&&(u=t.fn.select2.amd),u&&u.requirejs||(u?n=u:u={},g={},m={},y={},v={},i=Object.prototype.hasOwnProperty,a=[].slice,_=/\.js$/,h=function(e,t){var n,s,i=c(e),r=i[0],t=t[1];return e=i[1],r&&(n=x(r=l(r,t))),r?e=n&&n.normalize?n.normalize(e,(s=t,function(e){return l(e,s)})):l(e,t):(r=(i=c(e=l(e,t)))[0],e=i[1],r&&(n=x(r))),{f:r?r+"!"+e:e,n:e,pr:r,p:n}},f={require:function(e){return w(e)},exports:function(e){var t=g[e];return void 0!==t?t:g[e]={}},module:function(e){return{id:e,uri:"",exports:g[e],config:(t=e,function(){return y&&y.config&&y.config[t]||{}})};var t}},r=function(e,t,n,s){var i,r,o,a,l,c=[],u=typeof n,d=A(s=s||e);if("undefined"==u||"function"==u){for(t=!t.length&&n.length?["require","exports","module"]:t,a=0;a<t.length;a+=1)if("require"===(r=(o=h(t[a],d)).f))c[a]=f.require(e);else if("exports"===r)c[a]=f.exports(e),l=!0;else if("module"===r)i=c[a]=f.module(e);else if(b(g,r)||b(m,r)||b(v,r))c[a]=x(r);else{if(!o.p)throw new Error(e+" missing "+r);o.p.load(o.n,w(s,!0),function(t){return function(e){g[t]=e}}(r),{}),c[a]=g[r]}u=n?n.apply(g[e],c):void 0,e&&(i&&i.exports!==p&&i.exports!==g[e]?g[e]=i.exports:u===p&&l||(g[e]=u))}else e&&(g[e]=n)},e=n=o=function(e,t,n,s,i){if("string"==typeof e)return f[e]?f[e](t):x(h(e,A(t)).f);if(!e.splice){if((y=e).deps&&o(y.deps,y.callback),!t)return;t.splice?(e=t,t=n,n=null):e=p}return t=t||function(){},"function"==typeof n&&(n=s,s=i),s?r(p,e,t,n):setTimeout(function(){r(p,e,t,n)},4),o},o.config=function(e){return o(e)},e._defined=g,(s=function(e,t,n){if("string"!=typeof e)throw new Error("See almond README: incorrect module build, no module name");t.splice||(n=t,t=[]),b(g,e)||b(m,e)||(m[e]=[e,t,n])}).amd={jQuery:!0},u.requirejs=e,u.require=n,u.define=s),u.define("almond",function(){}),u.define("jquery",[],function(){var e=t||$;return null==e&&console&&console.error&&console.error("Select2: An instance of jQuery or a jQuery-compatible library was not found. Make sure that you are including jQuery before Select2 on your web page."),e}),u.define("select2/utils",["jquery"],function(r){var s={};function c(e){var t,n=e.prototype,s=[];for(t in n)"function"==typeof n[t]&&"constructor"!==t&&s.push(t);return s}s.Extend=function(e,t){var n,s={}.hasOwnProperty;function i(){this.constructor=e}for(n in t)s.call(t,n)&&(e[n]=t[n]);return i.prototype=t.prototype,e.prototype=new i,e.__super__=t.prototype,e},s.Decorate=function(s,i){var e=c(i),t=c(s);function r(){var e=Array.prototype.unshift,t=i.prototype.constructor.length,n=s.prototype.constructor;0<t&&(e.call(arguments,s.prototype.constructor),n=i.prototype.constructor),n.apply(this,arguments)}i.displayName=s.displayName,r.prototype=new function(){this.constructor=r};for(var n=0;n<t.length;n++){var o=t[n];r.prototype[o]=s.prototype[o]}for(var a=0;a<e.length;a++){var l=e[a];r.prototype[l]=function(e){var t=function(){};e in r.prototype&&(t=r.prototype[e]);var n=i.prototype[e];return function(){return Array.prototype.unshift.call(arguments,t),n.apply(this,arguments)}}(l)}return r};function e(){this.listeners={}}e.prototype.on=function(e,t){this.listeners=this.listeners||{},e in this.listeners?this.listeners[e].push(t):this.listeners[e]=[t]},e.prototype.trigger=function(e){var t=Array.prototype.slice,n=t.call(arguments,1);this.listeners=this.listeners||{},null==n&&(n=[]),0===n.length&&n.push({}),(n[0]._type=e)in this.listeners&&this.invoke(this.listeners[e],t.call(arguments,1)),"*"in this.listeners&&this.invoke(this.listeners["*"],arguments)},e.prototype.invoke=function(e,t){for(var n=0,s=e.length;n<s;n++)e[n].apply(this,t)},s.Observable=e,s.generateChars=function(e){for(var t="",n=0;n<e;n++)t+=Math.floor(36*Math.random()).toString(36);return t},s.bind=function(e,t){return function(){e.apply(t,arguments)}},s._convertData=function(e){for(var t in e){var n=t.split("-"),s=e;if(1!==n.length){for(var i=0;i<n.length;i++){var r=n[i];(r=r.substring(0,1).toLowerCase()+r.substring(1))in s||(s[r]={}),i==n.length-1&&(s[r]=e[t]),s=s[r]}delete e[t]}}return e},s.hasScroll=function(e,t){var n=r(t),s=t.style.overflowX,i=t.style.overflowY;return(s!==i||"hidden"!==i&&"visible"!==i)&&("scroll"===s||"scroll"===i||(n.innerHeight()<t.scrollHeight||n.innerWidth()<t.scrollWidth))},s.escapeMarkup=function(e){var t={"\\":"&#92;","&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#47;"};return"string"!=typeof e?e:String(e).replace(/[&<>"'\/\\]/g,function(e){return t[e]})},s.__cache={};var n=0;return s.GetUniqueElementId=function(e){var t=e.getAttribute("data-select2-id");return null!=t||(t=e.id?"select2-data-"+e.id:"select2-data-"+(++n).toString()+"-"+s.generateChars(4),e.setAttribute("data-select2-id",t)),t},s.StoreData=function(e,t,n){e=s.GetUniqueElementId(e);s.__cache[e]||(s.__cache[e]={}),s.__cache[e][t]=n},s.GetData=function(e,t){var n=s.GetUniqueElementId(e);return t?s.__cache[n]&&null!=s.__cache[n][t]?s.__cache[n][t]:r(e).data(t):s.__cache[n]},s.RemoveData=function(e){var t=s.GetUniqueElementId(e);null!=s.__cache[t]&&delete s.__cache[t],e.removeAttribute("data-select2-id")},s.copyNonInternalCssClasses=function(e,t){var n=(n=e.getAttribute("class").trim().split(/\s+/)).filter(function(e){return 0===e.indexOf("select2-")}),t=(t=t.getAttribute("class").trim().split(/\s+/)).filter(function(e){return 0!==e.indexOf("select2-")}),t=n.concat(t);e.setAttribute("class",t.join(" "))},s}),u.define("select2/results",["jquery","./utils"],function(d,p){function s(e,t,n){this.$element=e,this.data=n,this.options=t,s.__super__.constructor.call(this)}return p.Extend(s,p.Observable),s.prototype.render=function(){var e=d('<ul class="select2-results__options" role="listbox"></ul>');return this.options.get("multiple")&&e.attr("aria-multiselectable","true"),this.$results=e},s.prototype.clear=function(){this.$results.empty()},s.prototype.displayMessage=function(e){var t=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var n=d('<li role="alert" aria-live="assertive" class="select2-results__option"></li>'),s=this.options.get("translations").get(e.message);n.append(t(s(e.args))),n[0].className+=" select2-results__message",this.$results.append(n)},s.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()},s.prototype.append=function(e){this.hideLoading();var t=[];if(null!=e.results&&0!==e.results.length){e.results=this.sort(e.results);for(var n=0;n<e.results.length;n++){var s=e.results[n],s=this.option(s);t.push(s)}this.$results.append(t)}else 0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"})},s.prototype.position=function(e,t){t.find(".select2-results").append(e)},s.prototype.sort=function(e){return this.options.get("sorter")(e)},s.prototype.highlightFirstItem=function(){var e=this.$results.find(".select2-results__option--selectable"),t=e.filter(".select2-results__option--selected");(0<t.length?t:e).first().trigger("mouseenter"),this.ensureHighlightVisible()},s.prototype.setClasses=function(){var t=this;this.data.current(function(e){var s=e.map(function(e){return e.id.toString()});t.$results.find(".select2-results__option--selectable").each(function(){var e=d(this),t=p.GetData(this,"data"),n=""+t.id;null!=t.element&&t.element.selected||null==t.element&&-1<s.indexOf(n)?(this.classList.add("select2-results__option--selected"),e.attr("aria-selected","true")):(this.classList.remove("select2-results__option--selected"),e.attr("aria-selected","false"))})})},s.prototype.showLoading=function(e){this.hideLoading();e={disabled:!0,loading:!0,text:this.options.get("translations").get("searching")(e)},e=this.option(e);e.className+=" loading-results",this.$results.prepend(e)},s.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},s.prototype.option=function(e){var t=document.createElement("li");t.classList.add("select2-results__option"),t.classList.add("select2-results__option--selectable");var n,s={role:"option"},i=window.Element.prototype.matches||window.Element.prototype.msMatchesSelector||window.Element.prototype.webkitMatchesSelector;for(n in(null!=e.element&&i.call(e.element,":disabled")||null==e.element&&e.disabled)&&(s["aria-disabled"]="true",t.classList.remove("select2-results__option--selectable"),t.classList.add("select2-results__option--disabled")),null==e.id&&t.classList.remove("select2-results__option--selectable"),null!=e._resultId&&(t.id=e._resultId),e.title&&(t.title=e.title),e.children&&(s.role="group",s["aria-label"]=e.text,t.classList.remove("select2-results__option--selectable"),t.classList.add("select2-results__option--group")),s){var r=s[n];t.setAttribute(n,r)}if(e.children){var o=d(t),a=document.createElement("strong");a.className="select2-results__group",this.template(e,a);for(var l=[],c=0;c<e.children.length;c++){var u=e.children[c],u=this.option(u);l.push(u)}i=d("<ul></ul>",{class:"select2-results__options select2-results__options--nested",role:"none"});i.append(l),o.append(a),o.append(i)}else this.template(e,t);return p.StoreData(t,"data",e),t},s.prototype.bind=function(t,e){var i=this,n=t.id+"-results";this.$results.attr("id",n),t.on("results:all",function(e){i.clear(),i.append(e.data),t.isOpen()&&(i.setClasses(),i.highlightFirstItem())}),t.on("results:append",function(e){i.append(e.data),t.isOpen()&&i.setClasses()}),t.on("query",function(e){i.hideMessages(),i.showLoading(e)}),t.on("select",function(){t.isOpen()&&(i.setClasses(),i.options.get("scrollAfterSelect")&&i.highlightFirstItem())}),t.on("unselect",function(){t.isOpen()&&(i.setClasses(),i.options.get("scrollAfterSelect")&&i.highlightFirstItem())}),t.on("open",function(){i.$results.attr("aria-expanded","true"),i.$results.attr("aria-hidden","false"),i.setClasses(),i.ensureHighlightVisible()}),t.on("close",function(){i.$results.attr("aria-expanded","false"),i.$results.attr("aria-hidden","true"),i.$results.removeAttr("aria-activedescendant")}),t.on("results:toggle",function(){var e=i.getHighlightedResults();0!==e.length&&e.trigger("mouseup")}),t.on("results:select",function(){var e,t=i.getHighlightedResults();0!==t.length&&(e=p.GetData(t[0],"data"),t.hasClass("select2-results__option--selected")?i.trigger("close",{}):i.trigger("select",{data:e}))}),t.on("results:previous",function(){var e,t=i.getHighlightedResults(),n=i.$results.find(".select2-results__option--selectable"),s=n.index(t);s<=0||(e=s-1,0===t.length&&(e=0),(s=n.eq(e)).trigger("mouseenter"),t=i.$results.offset().top,n=s.offset().top,s=i.$results.scrollTop()+(n-t),0===e?i.$results.scrollTop(0):n-t<0&&i.$results.scrollTop(s))}),t.on("results:next",function(){var e,t=i.getHighlightedResults(),n=i.$results.find(".select2-results__option--selectable"),s=n.index(t)+1;s>=n.length||((e=n.eq(s)).trigger("mouseenter"),t=i.$results.offset().top+i.$results.outerHeight(!1),n=e.offset().top+e.outerHeight(!1),e=i.$results.scrollTop()+n-t,0===s?i.$results.scrollTop(0):t<n&&i.$results.scrollTop(e))}),t.on("results:focus",function(e){e.element[0].classList.add("select2-results__option--highlighted"),e.element[0].setAttribute("aria-selected","true")}),t.on("results:message",function(e){i.displayMessage(e)}),d.fn.mousewheel&&this.$results.on("mousewheel",function(e){var t=i.$results.scrollTop(),n=i.$results.get(0).scrollHeight-t+e.deltaY,t=0<e.deltaY&&t-e.deltaY<=0,n=e.deltaY<0&&n<=i.$results.height();t?(i.$results.scrollTop(0),e.preventDefault(),e.stopPropagation()):n&&(i.$results.scrollTop(i.$results.get(0).scrollHeight-i.$results.height()),e.preventDefault(),e.stopPropagation())}),this.$results.on("mouseup",".select2-results__option--selectable",function(e){var t=d(this),n=p.GetData(this,"data");t.hasClass("select2-results__option--selected")?i.options.get("multiple")?i.trigger("unselect",{originalEvent:e,data:n}):i.trigger("close",{}):i.trigger("select",{originalEvent:e,data:n})}),this.$results.on("mouseenter",".select2-results__option--selectable",function(e){var t=p.GetData(this,"data");i.getHighlightedResults().removeClass("select2-results__option--highlighted").attr("aria-selected","false"),i.trigger("results:focus",{data:t,element:d(this)})})},s.prototype.getHighlightedResults=function(){return this.$results.find(".select2-results__option--highlighted")},s.prototype.destroy=function(){this.$results.remove()},s.prototype.ensureHighlightVisible=function(){var e,t,n,s,i=this.getHighlightedResults();0!==i.length&&(e=this.$results.find(".select2-results__option--selectable").index(i),s=this.$results.offset().top,t=i.offset().top,n=this.$results.scrollTop()+(t-s),s=t-s,n-=2*i.outerHeight(!1),e<=2?this.$results.scrollTop(0):(s>this.$results.outerHeight()||s<0)&&this.$results.scrollTop(n))},s.prototype.template=function(e,t){var n=this.options.get("templateResult"),s=this.options.get("escapeMarkup"),e=n(e,t);null==e?t.style.display="none":"string"==typeof e?t.innerHTML=s(e):d(t).append(e)},s}),u.define("select2/keys",[],function(){return{BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46}}),u.define("select2/selection/base",["jquery","../utils","../keys"],function(n,s,i){function r(e,t){this.$element=e,this.options=t,r.__super__.constructor.call(this)}return s.Extend(r,s.Observable),r.prototype.render=function(){var e=n('<span class="select2-selection" role="combobox"  aria-haspopup="true" aria-expanded="false"></span>');return this._tabindex=0,null!=s.GetData(this.$element[0],"old-tabindex")?this._tabindex=s.GetData(this.$element[0],"old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),e.attr("title",this.$element.attr("title")),e.attr("tabindex",this._tabindex),e.attr("aria-disabled","false"),this.$selection=e},r.prototype.bind=function(e,t){var n=this,s=e.id+"-results";this.container=e,this.$selection.on("focus",function(e){n.trigger("focus",e)}),this.$selection.on("blur",function(e){n._handleBlur(e)}),this.$selection.on("keydown",function(e){n.trigger("keypress",e),e.which===i.SPACE&&e.preventDefault()}),e.on("results:focus",function(e){n.$selection.attr("aria-activedescendant",e.data._resultId)}),e.on("selection:update",function(e){n.update(e.data)}),e.on("open",function(){n.$selection.attr("aria-expanded","true"),n.$selection.attr("aria-owns",s),n._attachCloseHandler(e)}),e.on("close",function(){n.$selection.attr("aria-expanded","false"),n.$selection.removeAttr("aria-activedescendant"),n.$selection.removeAttr("aria-owns"),n.$selection.trigger("focus"),n._detachCloseHandler(e)}),e.on("enable",function(){n.$selection.attr("tabindex",n._tabindex),n.$selection.attr("aria-disabled","false")}),e.on("disable",function(){n.$selection.attr("tabindex","-1"),n.$selection.attr("aria-disabled","true")})},r.prototype._handleBlur=function(e){var t=this;window.setTimeout(function(){document.activeElement==t.$selection[0]||n.contains(t.$selection[0],document.activeElement)||t.trigger("blur",e)},1)},r.prototype._attachCloseHandler=function(e){n(document.body).on("mousedown.select2."+e.id,function(e){var t=n(e.target).closest(".select2");n(".select2.select2-container--open").each(function(){this!=t[0]&&s.GetData(this,"element").select2("close")})})},r.prototype._detachCloseHandler=function(e){n(document.body).off("mousedown.select2."+e.id)},r.prototype.position=function(e,t){t.find(".selection").append(e)},r.prototype.destroy=function(){this._detachCloseHandler(this.container)},r.prototype.update=function(e){throw new Error("The `update` method must be defined in child classes.")},r.prototype.isEnabled=function(){return!this.isDisabled()},r.prototype.isDisabled=function(){return this.options.get("disabled")},r}),u.define("select2/selection/single",["jquery","./base","../utils","../keys"],function(e,t,n,s){function i(){i.__super__.constructor.apply(this,arguments)}return n.Extend(i,t),i.prototype.render=function(){var e=i.__super__.render.call(this);return e[0].classList.add("select2-selection--single"),e.html('<span class="select2-selection__rendered"></span><span class="select2-selection__arrow" role="presentation"><b role="presentation"></b></span>'),e},i.prototype.bind=function(t,e){var n=this;i.__super__.bind.apply(this,arguments);var s=t.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",s).attr("role","textbox").attr("aria-readonly","true"),this.$selection.attr("aria-labelledby",s),this.$selection.attr("aria-controls",s),this.$selection.on("mousedown",function(e){1===e.which&&n.trigger("toggle",{originalEvent:e})}),this.$selection.on("focus",function(e){}),this.$selection.on("blur",function(e){}),t.on("focus",function(e){t.isOpen()||n.$selection.trigger("focus")})},i.prototype.clear=function(){var e=this.$selection.find(".select2-selection__rendered");e.empty(),e.removeAttr("title")},i.prototype.display=function(e,t){var n=this.options.get("templateSelection");return this.options.get("escapeMarkup")(n(e,t))},i.prototype.selectionContainer=function(){return e("<span></span>")},i.prototype.update=function(e){var t,n;0!==e.length?(n=e[0],t=this.$selection.find(".select2-selection__rendered"),e=this.display(n,t),t.empty().append(e),(n=n.title||n.text)?t.attr("title",n):t.removeAttr("title")):this.clear()},i}),u.define("select2/selection/multiple",["jquery","./base","../utils"],function(i,e,c){function r(e,t){r.__super__.constructor.apply(this,arguments)}return c.Extend(r,e),r.prototype.render=function(){var e=r.__super__.render.call(this);return e[0].classList.add("select2-selection--multiple"),e.html('<ul class="select2-selection__rendered"></ul>'),e},r.prototype.bind=function(e,t){var n=this;r.__super__.bind.apply(this,arguments);var s=e.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",s),this.$selection.on("click",function(e){n.trigger("toggle",{originalEvent:e})}),this.$selection.on("click",".select2-selection__choice__remove",function(e){var t;n.isDisabled()||(t=i(this).parent(),t=c.GetData(t[0],"data"),n.trigger("unselect",{originalEvent:e,data:t}))}),this.$selection.on("keydown",".select2-selection__choice__remove",function(e){n.isDisabled()||e.stopPropagation()})},r.prototype.clear=function(){var e=this.$selection.find(".select2-selection__rendered");e.empty(),e.removeAttr("title")},r.prototype.display=function(e,t){var n=this.options.get("templateSelection");return this.options.get("escapeMarkup")(n(e,t))},r.prototype.selectionContainer=function(){return i('<li class="select2-selection__choice"><button type="button" class="select2-selection__choice__remove" tabindex="-1"><span aria-hidden="true">&times;</span></button><span class="select2-selection__choice__display"></span></li>')},r.prototype.update=function(e){if(this.clear(),0!==e.length){for(var t=[],n=this.$selection.find(".select2-selection__rendered").attr("id")+"-choice-",s=0;s<e.length;s++){var i=e[s],r=this.selectionContainer(),o=this.display(i,r),a=n+c.generateChars(4)+"-";i.id?a+=i.id:a+=c.generateChars(4),r.find(".select2-selection__choice__display").append(o).attr("id",a);var l=i.title||i.text;l&&r.attr("title",l);o=this.options.get("translations").get("removeItem"),l=r.find(".select2-selection__choice__remove");l.attr("title",o()),l.attr("aria-label",o()),l.attr("aria-describedby",a),c.StoreData(r[0],"data",i),t.push(r)}this.$selection.find(".select2-selection__rendered").append(t)}},r}),u.define("select2/selection/placeholder",[],function(){function e(e,t,n){this.placeholder=this.normalizePlaceholder(n.get("placeholder")),e.call(this,t,n)}return e.prototype.normalizePlaceholder=function(e,t){return"string"==typeof t&&(t={id:"",text:t}),t},e.prototype.createPlaceholder=function(e,t){var n=this.selectionContainer();n.html(this.display(t)),n[0].classList.add("select2-selection__placeholder"),n[0].classList.remove("select2-selection__choice");t=t.title||t.text||n.text();return this.$selection.find(".select2-selection__rendered").attr("title",t),n},e.prototype.update=function(e,t){var n=1==t.length&&t[0].id!=this.placeholder.id;if(1<t.length||n)return e.call(this,t);this.clear();t=this.createPlaceholder(this.placeholder);this.$selection.find(".select2-selection__rendered").append(t)},e}),u.define("select2/selection/allowClear",["jquery","../keys","../utils"],function(i,s,a){function e(){}return e.prototype.bind=function(e,t,n){var s=this;e.call(this,t,n),null==this.placeholder&&this.options.get("debug")&&window.console&&console.error&&console.error("Select2: The `allowClear` option should be used in combination with the `placeholder` option."),this.$selection.on("mousedown",".select2-selection__clear",function(e){s._handleClear(e)}),t.on("keypress",function(e){s._handleKeyboardClear(e,t)})},e.prototype._handleClear=function(e,t){if(!this.isDisabled()){var n=this.$selection.find(".select2-selection__clear");if(0!==n.length){t.stopPropagation();var s=a.GetData(n[0],"data"),i=this.$element.val();this.$element.val(this.placeholder.id);var r={data:s};if(this.trigger("clear",r),r.prevented)this.$element.val(i);else{for(var o=0;o<s.length;o++)if(r={data:s[o]},this.trigger("unselect",r),r.prevented)return void this.$element.val(i);this.$element.trigger("input").trigger("change"),this.trigger("toggle",{})}}}},e.prototype._handleKeyboardClear=function(e,t,n){n.isOpen()||t.which!=s.DELETE&&t.which!=s.BACKSPACE||this._handleClear(t)},e.prototype.update=function(e,t){var n,s;e.call(this,t),this.$selection.find(".select2-selection__clear").remove(),this.$selection[0].classList.remove("select2-selection--clearable"),0<this.$selection.find(".select2-selection__placeholder").length||0===t.length||(n=this.$selection.find(".select2-selection__rendered").attr("id"),s=this.options.get("translations").get("removeAllItems"),(e=i('<button type="button" class="select2-selection__clear" tabindex="-1"><span aria-hidden="true">&times;</span></button>')).attr("title",s()),e.attr("aria-label",s()),e.attr("aria-describedby",n),a.StoreData(e[0],"data",t),this.$selection.prepend(e),this.$selection[0].classList.add("select2-selection--clearable"))},e}),u.define("select2/selection/search",["jquery","../utils","../keys"],function(s,a,l){function e(e,t,n){e.call(this,t,n)}return e.prototype.render=function(e){var t=this.options.get("translations").get("search"),n=s('<span class="select2-search select2-search--inline"><textarea class="select2-search__field" type="search" tabindex="-1" autocorrect="off" autocapitalize="none" spellcheck="false" role="searchbox" aria-autocomplete="list" ></textarea></span>');this.$searchContainer=n,this.$search=n.find("textarea"),this.$search.prop("autocomplete",this.options.get("autocomplete")),this.$search.attr("aria-label",t());e=e.call(this);return this._transferTabIndex(),e.append(this.$searchContainer),e},e.prototype.bind=function(e,t,n){var s=this,i=t.id+"-results",r=t.id+"-container";e.call(this,t,n),s.$search.attr("aria-describedby",r),t.on("open",function(){s.$search.attr("aria-controls",i),s.$search.trigger("focus")}),t.on("close",function(){s.$search.val(""),s.resizeSearch(),s.$search.removeAttr("aria-controls"),s.$search.removeAttr("aria-activedescendant"),s.$search.trigger("focus")}),t.on("enable",function(){s.$search.prop("disabled",!1),s._transferTabIndex()}),t.on("disable",function(){s.$search.prop("disabled",!0)}),t.on("focus",function(e){s.$search.trigger("focus")}),t.on("results:focus",function(e){e.data._resultId?s.$search.attr("aria-activedescendant",e.data._resultId):s.$search.removeAttr("aria-activedescendant")}),this.$selection.on("focusin",".select2-search--inline",function(e){s.trigger("focus",e)}),this.$selection.on("focusout",".select2-search--inline",function(e){s._handleBlur(e)}),this.$selection.on("keydown",".select2-search--inline",function(e){var t;e.stopPropagation(),s.trigger("keypress",e),s._keyUpPrevented=e.isDefaultPrevented(),e.which!==l.BACKSPACE||""!==s.$search.val()||0<(t=s.$selection.find(".select2-selection__choice").last()).length&&(t=a.GetData(t[0],"data"),s.searchRemoveChoice(t),e.preventDefault())}),this.$selection.on("click",".select2-search--inline",function(e){s.$search.val()&&e.stopPropagation()});var t=document.documentMode,o=t&&t<=11;this.$selection.on("input.searchcheck",".select2-search--inline",function(e){o?s.$selection.off("input.search input.searchcheck"):s.$selection.off("keyup.search")}),this.$selection.on("keyup.search input.search",".select2-search--inline",function(e){var t;o&&"input"===e.type?s.$selection.off("input.search input.searchcheck"):(t=e.which)!=l.SHIFT&&t!=l.CTRL&&t!=l.ALT&&t!=l.TAB&&s.handleSearch(e)})},e.prototype._transferTabIndex=function(e){this.$search.attr("tabindex",this.$selection.attr("tabindex")),this.$selection.attr("tabindex","-1")},e.prototype.createPlaceholder=function(e,t){this.$search.attr("placeholder",t.text)},e.prototype.update=function(e,t){var n=this.$search[0]==document.activeElement;this.$search.attr("placeholder",""),e.call(this,t),this.resizeSearch(),n&&this.$search.trigger("focus")},e.prototype.handleSearch=function(){var e;this.resizeSearch(),this._keyUpPrevented||(e=this.$search.val(),this.trigger("query",{term:e})),this._keyUpPrevented=!1},e.prototype.searchRemoveChoice=function(e,t){this.trigger("unselect",{data:t}),this.$search.val(t.text),this.handleSearch()},e.prototype.resizeSearch=function(){this.$search.css("width","25px");var e="100%";""===this.$search.attr("placeholder")&&(e=.75*(this.$search.val().length+1)+"em"),this.$search.css("width",e)},e}),u.define("select2/selection/selectionCss",["../utils"],function(n){function e(){}return e.prototype.render=function(e){var t=e.call(this),e=this.options.get("selectionCssClass")||"";return-1!==e.indexOf(":all:")&&(e=e.replace(":all:",""),n.copyNonInternalCssClasses(t[0],this.$element[0])),t.addClass(e),t},e}),u.define("select2/selection/eventRelay",["jquery"],function(o){function e(){}return e.prototype.bind=function(e,t,n){var s=this,i=["open","opening","close","closing","select","selecting","unselect","unselecting","clear","clearing"],r=["opening","closing","selecting","unselecting","clearing"];e.call(this,t,n),t.on("*",function(e,t){var n;-1!==i.indexOf(e)&&(t=t||{},n=o.Event("select2:"+e,{params:t}),s.$element.trigger(n),-1!==r.indexOf(e)&&(t.prevented=n.isDefaultPrevented()))})},e}),u.define("select2/translation",["jquery","require"],function(t,n){function s(e){this.dict=e||{}}return s.prototype.all=function(){return this.dict},s.prototype.get=function(e){return this.dict[e]},s.prototype.extend=function(e){this.dict=t.extend({},e.all(),this.dict)},s._cache={},s.loadPath=function(e){var t;return e in s._cache||(t=n(e),s._cache[e]=t),new s(s._cache[e])},s}),u.define("select2/diacritics",[],function(){return{"Ⓐ":"A","A":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","B":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","C":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","D":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","DZ":"DZ","DŽ":"DZ","Dz":"Dz","Dž":"Dz","Ⓔ":"E","E":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","F":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","G":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","I":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","J":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","L":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","Ⓜ":"M","M":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","N":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","NJ":"NJ","Nj":"Nj","Ⓞ":"O","O":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Œ":"OE","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","P":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","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"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Z":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","a":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","c":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","d":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","dz":"dz","dž":"dz","ⓔ":"e","e":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","f":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","g":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","h":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","l":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","lj":"lj","ⓜ":"m","m":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","n":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ʼn":"n","ꞑ":"n","ꞥ":"n","nj":"nj","ⓞ":"o","o":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","œ":"oe","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","p":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","q":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","r":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","s":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","t":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","v":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","w":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","x":"x","ẋ":"x","ẍ":"x","ⓨ":"y","y":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ώ":"ω","ς":"σ","’":"'"}}),u.define("select2/data/base",["../utils"],function(n){function s(e,t){s.__super__.constructor.call(this)}return n.Extend(s,n.Observable),s.prototype.current=function(e){throw new Error("The `current` method must be defined in child classes.")},s.prototype.query=function(e,t){throw new Error("The `query` method must be defined in child classes.")},s.prototype.bind=function(e,t){},s.prototype.destroy=function(){},s.prototype.generateResultId=function(e,t){e=e.id+"-result-";return e+=n.generateChars(4),null!=t.id?e+="-"+t.id.toString():e+="-"+n.generateChars(4),e},s}),u.define("select2/data/select",["./base","../utils","jquery"],function(e,a,l){function n(e,t){this.$element=e,this.options=t,n.__super__.constructor.call(this)}return a.Extend(n,e),n.prototype.current=function(e){var t=this;e(Array.prototype.map.call(this.$element[0].querySelectorAll(":checked"),function(e){return t.item(l(e))}))},n.prototype.select=function(i){var e,r=this;if(i.selected=!0,null!=i.element&&"option"===i.element.tagName.toLowerCase())return i.element.selected=!0,void this.$element.trigger("input").trigger("change");this.$element.prop("multiple")?this.current(function(e){var t=[];(i=[i]).push.apply(i,e);for(var n=0;n<i.length;n++){var s=i[n].id;-1===t.indexOf(s)&&t.push(s)}r.$element.val(t),r.$element.trigger("input").trigger("change")}):(e=i.id,this.$element.val(e),this.$element.trigger("input").trigger("change"))},n.prototype.unselect=function(i){var r=this;if(this.$element.prop("multiple")){if(i.selected=!1,null!=i.element&&"option"===i.element.tagName.toLowerCase())return i.element.selected=!1,void this.$element.trigger("input").trigger("change");this.current(function(e){for(var t=[],n=0;n<e.length;n++){var s=e[n].id;s!==i.id&&-1===t.indexOf(s)&&t.push(s)}r.$element.val(t),r.$element.trigger("input").trigger("change")})}},n.prototype.bind=function(e,t){var n=this;(this.container=e).on("select",function(e){n.select(e.data)}),e.on("unselect",function(e){n.unselect(e.data)})},n.prototype.destroy=function(){this.$element.find("*").each(function(){a.RemoveData(this)})},n.prototype.query=function(t,e){var n=[],s=this;this.$element.children().each(function(){var e;"option"!==this.tagName.toLowerCase()&&"optgroup"!==this.tagName.toLowerCase()||(e=l(this),e=s.item(e),null!==(e=s.matches(t,e))&&n.push(e))}),e({results:n})},n.prototype.addOptions=function(e){this.$element.append(e)},n.prototype.option=function(e){var t;e.children?(t=document.createElement("optgroup")).label=e.text:void 0!==(t=document.createElement("option")).textContent?t.textContent=e.text:t.innerText=e.text,void 0!==e.id&&(t.value=e.id),e.disabled&&(t.disabled=!0),e.selected&&(t.selected=!0),e.title&&(t.title=e.title);e=this._normalizeItem(e);return e.element=t,a.StoreData(t,"data",e),l(t)},n.prototype.item=function(e){var t={};if(null!=(t=a.GetData(e[0],"data")))return t;var n=e[0];if("option"===n.tagName.toLowerCase())t={id:e.val(),text:e.text(),disabled:e.prop("disabled"),selected:e.prop("selected"),title:e.prop("title")};else if("optgroup"===n.tagName.toLowerCase()){t={text:e.prop("label"),children:[],title:e.prop("title")};for(var s=e.children("option"),i=[],r=0;r<s.length;r++){var o=l(s[r]),o=this.item(o);i.push(o)}t.children=i}return(t=this._normalizeItem(t)).element=e[0],a.StoreData(e[0],"data",t),t},n.prototype._normalizeItem=function(e){e!==Object(e)&&(e={id:e,text:e});return null!=(e=l.extend({},{text:""},e)).id&&(e.id=e.id.toString()),null!=e.text&&(e.text=e.text.toString()),null==e._resultId&&e.id&&null!=this.container&&(e._resultId=this.generateResultId(this.container,e)),l.extend({},{selected:!1,disabled:!1},e)},n.prototype.matches=function(e,t){return this.options.get("matcher")(e,t)},n}),u.define("select2/data/array",["./select","../utils","jquery"],function(e,t,c){function s(e,t){this._dataToConvert=t.get("data")||[],s.__super__.constructor.call(this,e,t)}return t.Extend(s,e),s.prototype.bind=function(e,t){s.__super__.bind.call(this,e,t),this.addOptions(this.convertToOptions(this._dataToConvert))},s.prototype.select=function(n){var e=this.$element.find("option").filter(function(e,t){return t.value==n.id.toString()});0===e.length&&(e=this.option(n),this.addOptions(e)),s.__super__.select.call(this,n)},s.prototype.convertToOptions=function(e){var t=this,n=this.$element.find("option"),s=n.map(function(){return t.item(c(this)).id}).get(),i=[];for(var r=0;r<e.length;r++){var o,a,l=this._normalizeItem(e[r]);0<=s.indexOf(l.id)?(o=n.filter(function(e){return function(){return c(this).val()==e.id}}(l)),a=this.item(o),a=c.extend(!0,{},l,a),a=this.option(a),o.replaceWith(a)):(a=this.option(l),l.children&&(l=this.convertToOptions(l.children),a.append(l)),i.push(a))}return i},s}),u.define("select2/data/ajax",["./array","../utils","jquery"],function(e,t,r){function n(e,t){this.ajaxOptions=this._applyDefaults(t.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),n.__super__.constructor.call(this,e,t)}return t.Extend(n,e),n.prototype._applyDefaults=function(e){var t={data:function(e){return r.extend({},e,{q:e.term})},transport:function(e,t,n){e=r.ajax(e);return e.then(t),e.fail(n),e}};return r.extend({},t,e,!0)},n.prototype.processResults=function(e){return e},n.prototype.query=function(t,n){var s=this;null!=this._request&&("function"==typeof this._request.abort&&this._request.abort(),this._request=null);var i=r.extend({type:"GET"},this.ajaxOptions);function e(){var e=i.transport(i,function(e){e=s.processResults(e,t);s.options.get("debug")&&window.console&&console.error&&(e&&e.results&&Array.isArray(e.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),n(e)},function(){"status"in e&&(0===e.status||"0"===e.status)||s.trigger("results:message",{message:"errorLoading"})});s._request=e}"function"==typeof i.url&&(i.url=i.url.call(this.$element,t)),"function"==typeof i.data&&(i.data=i.data.call(this.$element,t)),this.ajaxOptions.delay&&null!=t.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(e,this.ajaxOptions.delay)):e()},n}),u.define("select2/data/tags",["jquery"],function(t){function e(e,t,n){var s=n.get("tags"),i=n.get("createTag");void 0!==i&&(this.createTag=i);i=n.get("insertTag");if(void 0!==i&&(this.insertTag=i),e.call(this,t,n),Array.isArray(s))for(var r=0;r<s.length;r++){var o=s[r],o=this._normalizeItem(o),o=this.option(o);this.$element.append(o)}}return e.prototype.query=function(e,c,u){var d=this;this._removeOldTags(),null!=c.term&&null==c.page?e.call(this,c,function e(t,n){for(var s=t.results,i=0;i<s.length;i++){var r=s[i],o=null!=r.children&&!e({results:r.children},!0);if((r.text||"").toUpperCase()===(c.term||"").toUpperCase()||o)return!n&&(t.data=s,void u(t))}if(n)return!0;var a,l=d.createTag(c);null!=l&&((a=d.option(l)).attr("data-select2-tag","true"),d.addOptions([a]),d.insertTag(s,l)),t.results=s,u(t)}):e.call(this,c,u)},e.prototype.createTag=function(e,t){if(null==t.term)return null;t=t.term.trim();return""===t?null:{id:t,text:t}},e.prototype.insertTag=function(e,t,n){t.unshift(n)},e.prototype._removeOldTags=function(e){this.$element.find("option[data-select2-tag]").each(function(){this.selected||t(this).remove()})},e}),u.define("select2/data/tokenizer",["jquery"],function(c){function e(e,t,n){var s=n.get("tokenizer");void 0!==s&&(this.tokenizer=s),e.call(this,t,n)}return e.prototype.bind=function(e,t,n){e.call(this,t,n),this.$search=t.dropdown.$search||t.selection.$search||n.find(".select2-search__field")},e.prototype.query=function(e,t,n){var s=this;t.term=t.term||"";var i=this.tokenizer(t,this.options,function(e){var t,n=s._normalizeItem(e);s.$element.find("option").filter(function(){return c(this).val()===n.id}).length||((t=s.option(n)).attr("data-select2-tag",!0),s._removeOldTags(),s.addOptions([t])),t=n,s.trigger("select",{data:t})});i.term!==t.term&&(this.$search.length&&(this.$search.val(i.term),this.$search.trigger("focus")),t.term=i.term),e.call(this,t,n)},e.prototype.tokenizer=function(e,t,n,s){for(var i=n.get("tokenSeparators")||[],r=t.term,o=0,a=this.createTag||function(e){return{id:e.term,text:e.term}};o<r.length;){var l=r[o];-1!==i.indexOf(l)?(l=r.substr(0,o),null!=(l=a(c.extend({},t,{term:l})))?(s(l),r=r.substr(o+1)||"",o=0):o++):o++}return{term:r}},e}),u.define("select2/data/minimumInputLength",[],function(){function e(e,t,n){this.minimumInputLength=n.get("minimumInputLength"),e.call(this,t,n)}return e.prototype.query=function(e,t,n){t.term=t.term||"",t.term.length<this.minimumInputLength?this.trigger("results:message",{message:"inputTooShort",args:{minimum:this.minimumInputLength,input:t.term,params:t}}):e.call(this,t,n)},e}),u.define("select2/data/maximumInputLength",[],function(){function e(e,t,n){this.maximumInputLength=n.get("maximumInputLength"),e.call(this,t,n)}return e.prototype.query=function(e,t,n){t.term=t.term||"",0<this.maximumInputLength&&t.term.length>this.maximumInputLength?this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:t.term,params:t}}):e.call(this,t,n)},e}),u.define("select2/data/maximumSelectionLength",[],function(){function e(e,t,n){this.maximumSelectionLength=n.get("maximumSelectionLength"),e.call(this,t,n)}return e.prototype.bind=function(e,t,n){var s=this;e.call(this,t,n),t.on("select",function(){s._checkIfMaximumSelected()})},e.prototype.query=function(e,t,n){var s=this;this._checkIfMaximumSelected(function(){e.call(s,t,n)})},e.prototype._checkIfMaximumSelected=function(e,t){var n=this;this.current(function(e){e=null!=e?e.length:0;0<n.maximumSelectionLength&&e>=n.maximumSelectionLength?n.trigger("results:message",{message:"maximumSelected",args:{maximum:n.maximumSelectionLength}}):t&&t()})},e}),u.define("select2/dropdown",["jquery","./utils"],function(t,e){function n(e,t){this.$element=e,this.options=t,n.__super__.constructor.call(this)}return e.Extend(n,e.Observable),n.prototype.render=function(){var e=t('<span class="select2-dropdown"><span class="select2-results"></span></span>');return e.attr("dir",this.options.get("dir")),this.$dropdown=e},n.prototype.bind=function(){},n.prototype.position=function(e,t){},n.prototype.destroy=function(){this.$dropdown.remove()},n}),u.define("select2/dropdown/search",["jquery"],function(r){function e(){}return e.prototype.render=function(e){var t=e.call(this),n=this.options.get("translations").get("search"),e=r('<span class="select2-search select2-search--dropdown"><input class="select2-search__field" type="search" tabindex="-1" autocorrect="off" autocapitalize="none" spellcheck="false" role="searchbox" aria-autocomplete="list" /></span>');return this.$searchContainer=e,this.$search=e.find("input"),this.$search.prop("autocomplete",this.options.get("autocomplete")),this.$search.attr("aria-label",n()),t.prepend(e),t},e.prototype.bind=function(e,t,n){var s=this,i=t.id+"-results";e.call(this,t,n),this.$search.on("keydown",function(e){s.trigger("keypress",e),s._keyUpPrevented=e.isDefaultPrevented()}),this.$search.on("input",function(e){r(this).off("keyup")}),this.$search.on("keyup input",function(e){s.handleSearch(e)}),t.on("open",function(){s.$search.attr("tabindex",0),s.$search.attr("aria-controls",i),s.$search.trigger("focus"),window.setTimeout(function(){s.$search.trigger("focus")},0)}),t.on("close",function(){s.$search.attr("tabindex",-1),s.$search.removeAttr("aria-controls"),s.$search.removeAttr("aria-activedescendant"),s.$search.val(""),s.$search.trigger("blur")}),t.on("focus",function(){t.isOpen()||s.$search.trigger("focus")}),t.on("results:all",function(e){null!=e.query.term&&""!==e.query.term||(s.showSearch(e)?s.$searchContainer[0].classList.remove("select2-search--hide"):s.$searchContainer[0].classList.add("select2-search--hide"))}),t.on("results:focus",function(e){e.data._resultId?s.$search.attr("aria-activedescendant",e.data._resultId):s.$search.removeAttr("aria-activedescendant")})},e.prototype.handleSearch=function(e){var t;this._keyUpPrevented||(t=this.$search.val(),this.trigger("query",{term:t})),this._keyUpPrevented=!1},e.prototype.showSearch=function(e,t){return!0},e}),u.define("select2/dropdown/hidePlaceholder",[],function(){function e(e,t,n,s){this.placeholder=this.normalizePlaceholder(n.get("placeholder")),e.call(this,t,n,s)}return e.prototype.append=function(e,t){t.results=this.removePlaceholder(t.results),e.call(this,t)},e.prototype.normalizePlaceholder=function(e,t){return"string"==typeof t&&(t={id:"",text:t}),t},e.prototype.removePlaceholder=function(e,t){for(var n=t.slice(0),s=t.length-1;0<=s;s--){var i=t[s];this.placeholder.id===i.id&&n.splice(s,1)}return n},e}),u.define("select2/dropdown/infiniteScroll",["jquery"],function(n){function e(e,t,n,s){this.lastParams={},e.call(this,t,n,s),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return e.prototype.append=function(e,t){this.$loadingMore.remove(),this.loading=!1,e.call(this,t),this.showLoadingMore(t)&&(this.$results.append(this.$loadingMore),this.loadMoreIfNeeded())},e.prototype.bind=function(e,t,n){var s=this;e.call(this,t,n),t.on("query",function(e){s.lastParams=e,s.loading=!0}),t.on("query:append",function(e){s.lastParams=e,s.loading=!0}),this.$results.on("scroll",this.loadMoreIfNeeded.bind(this))},e.prototype.loadMoreIfNeeded=function(){var e=n.contains(document.documentElement,this.$loadingMore[0]);!this.loading&&e&&(e=this.$results.offset().top+this.$results.outerHeight(!1),this.$loadingMore.offset().top+this.$loadingMore.outerHeight(!1)<=e+50&&this.loadMore())},e.prototype.loadMore=function(){this.loading=!0;var e=n.extend({},{page:1},this.lastParams);e.page++,this.trigger("query:append",e)},e.prototype.showLoadingMore=function(e,t){return t.pagination&&t.pagination.more},e.prototype.createLoadingMore=function(){var e=n('<li class="select2-results__option select2-results__option--load-more"role="option" aria-disabled="true"></li>'),t=this.options.get("translations").get("loadingMore");return e.html(t(this.lastParams)),e},e}),u.define("select2/dropdown/attachBody",["jquery","../utils"],function(u,o){function e(e,t,n){this.$dropdownParent=u(n.get("dropdownParent")||document.body),e.call(this,t,n)}return e.prototype.bind=function(e,t,n){var s=this;e.call(this,t,n),t.on("open",function(){s._showDropdown(),s._attachPositioningHandler(t),s._bindContainerResultHandlers(t)}),t.on("close",function(){s._hideDropdown(),s._detachPositioningHandler(t)}),this.$dropdownContainer.on("mousedown",function(e){e.stopPropagation()})},e.prototype.destroy=function(e){e.call(this),this.$dropdownContainer.remove()},e.prototype.position=function(e,t,n){t.attr("class",n.attr("class")),t[0].classList.remove("select2"),t[0].classList.add("select2-container--open"),t.css({position:"absolute",top:-999999}),this.$container=n},e.prototype.render=function(e){var t=u("<span></span>"),e=e.call(this);return t.append(e),this.$dropdownContainer=t},e.prototype._hideDropdown=function(e){this.$dropdownContainer.detach()},e.prototype._bindContainerResultHandlers=function(e,t){var n;this._containerResultsHandlersBound||(n=this,t.on("results:all",function(){n._positionDropdown(),n._resizeDropdown()}),t.on("results:append",function(){n._positionDropdown(),n._resizeDropdown()}),t.on("results:message",function(){n._positionDropdown(),n._resizeDropdown()}),t.on("select",function(){n._positionDropdown(),n._resizeDropdown()}),t.on("unselect",function(){n._positionDropdown(),n._resizeDropdown()}),this._containerResultsHandlersBound=!0)},e.prototype._attachPositioningHandler=function(e,t){var n=this,s="scroll.select2."+t.id,i="resize.select2."+t.id,r="orientationchange.select2."+t.id,t=this.$container.parents().filter(o.hasScroll);t.each(function(){o.StoreData(this,"select2-scroll-position",{x:u(this).scrollLeft(),y:u(this).scrollTop()})}),t.on(s,function(e){var t=o.GetData(this,"select2-scroll-position");u(this).scrollTop(t.y)}),u(window).on(s+" "+i+" "+r,function(e){n._positionDropdown(),n._resizeDropdown()})},e.prototype._detachPositioningHandler=function(e,t){var n="scroll.select2."+t.id,s="resize.select2."+t.id,t="orientationchange.select2."+t.id;this.$container.parents().filter(o.hasScroll).off(n),u(window).off(n+" "+s+" "+t)},e.prototype._positionDropdown=function(){var e=u(window),t=this.$dropdown[0].classList.contains("select2-dropdown--above"),n=this.$dropdown[0].classList.contains("select2-dropdown--below"),s=null,i=this.$container.offset();i.bottom=i.top+this.$container.outerHeight(!1);var r={height:this.$container.outerHeight(!1)};r.top=i.top,r.bottom=i.top+r.height;var o=this.$dropdown.outerHeight(!1),a=e.scrollTop(),l=e.scrollTop()+e.height(),c=a<i.top-o,e=l>i.bottom+o,a={left:i.left,top:r.bottom},l=this.$dropdownParent;"static"===l.css("position")&&(l=l.offsetParent());i={top:0,left:0};(u.contains(document.body,l[0])||l[0].isConnected)&&(i=l.offset()),a.top-=i.top,a.left-=i.left,t||n||(s="below"),e||!c||t?!c&&e&&t&&(s="below"):s="above",("above"==s||t&&"below"!==s)&&(a.top=r.top-i.top-o),null!=s&&(this.$dropdown[0].classList.remove("select2-dropdown--below"),this.$dropdown[0].classList.remove("select2-dropdown--above"),this.$dropdown[0].classList.add("select2-dropdown--"+s),this.$container[0].classList.remove("select2-container--below"),this.$container[0].classList.remove("select2-container--above"),this.$container[0].classList.add("select2-container--"+s)),this.$dropdownContainer.css(a)},e.prototype._resizeDropdown=function(){var e={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(e.minWidth=e.width,e.position="relative",e.width="auto"),this.$dropdown.css(e)},e.prototype._showDropdown=function(e){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},e}),u.define("select2/dropdown/minimumResultsForSearch",[],function(){function e(e,t,n,s){this.minimumResultsForSearch=n.get("minimumResultsForSearch"),this.minimumResultsForSearch<0&&(this.minimumResultsForSearch=1/0),e.call(this,t,n,s)}return e.prototype.showSearch=function(e,t){return!(function e(t){for(var n=0,s=0;s<t.length;s++){var i=t[s];i.children?n+=e(i.children):n++}return n}(t.data.results)<this.minimumResultsForSearch)&&e.call(this,t)},e}),u.define("select2/dropdown/selectOnClose",["../utils"],function(s){function e(){}return e.prototype.bind=function(e,t,n){var s=this;e.call(this,t,n),t.on("close",function(e){s._handleSelectOnClose(e)})},e.prototype._handleSelectOnClose=function(e,t){if(t&&null!=t.originalSelect2Event){var n=t.originalSelect2Event;if("select"===n._type||"unselect"===n._type)return}n=this.getHighlightedResults();n.length<1||(null!=(n=s.GetData(n[0],"data")).element&&n.element.selected||null==n.element&&n.selected||this.trigger("select",{data:n}))},e}),u.define("select2/dropdown/closeOnSelect",[],function(){function e(){}return e.prototype.bind=function(e,t,n){var s=this;e.call(this,t,n),t.on("select",function(e){s._selectTriggered(e)}),t.on("unselect",function(e){s._selectTriggered(e)})},e.prototype._selectTriggered=function(e,t){var n=t.originalEvent;n&&(n.ctrlKey||n.metaKey)||this.trigger("close",{originalEvent:n,originalSelect2Event:t})},e}),u.define("select2/dropdown/dropdownCss",["../utils"],function(n){function e(){}return e.prototype.render=function(e){var t=e.call(this),e=this.options.get("dropdownCssClass")||"";return-1!==e.indexOf(":all:")&&(e=e.replace(":all:",""),n.copyNonInternalCssClasses(t[0],this.$element[0])),t.addClass(e),t},e}),u.define("select2/dropdown/tagsSearchHighlight",["../utils"],function(s){function e(){}return e.prototype.highlightFirstItem=function(e){var t=this.$results.find(".select2-results__option--selectable:not(.select2-results__option--selected)");if(0<t.length){var n=t.first(),t=s.GetData(n[0],"data").element;if(t&&t.getAttribute&&"true"===t.getAttribute("data-select2-tag"))return void n.trigger("mouseenter")}e.call(this)},e}),u.define("select2/i18n/en",[],function(){return{errorLoading:function(){return"The results could not be loaded."},inputTooLong:function(e){var t=e.input.length-e.maximum,e="Please delete "+t+" character";return 1!=t&&(e+="s"),e},inputTooShort:function(e){return"Please enter "+(e.minimum-e.input.length)+" or more characters"},loadingMore:function(){return"Loading more results…"},maximumSelected:function(e){var t="You can only select "+e.maximum+" item";return 1!=e.maximum&&(t+="s"),t},noResults:function(){return"No results found"},searching:function(){return"Searching…"},removeAllItems:function(){return"Remove all items"},removeItem:function(){return"Remove item"},search:function(){return"Search"}}}),u.define("select2/defaults",["jquery","./results","./selection/single","./selection/multiple","./selection/placeholder","./selection/allowClear","./selection/search","./selection/selectionCss","./selection/eventRelay","./utils","./translation","./diacritics","./data/select","./data/array","./data/ajax","./data/tags","./data/tokenizer","./data/minimumInputLength","./data/maximumInputLength","./data/maximumSelectionLength","./dropdown","./dropdown/search","./dropdown/hidePlaceholder","./dropdown/infiniteScroll","./dropdown/attachBody","./dropdown/minimumResultsForSearch","./dropdown/selectOnClose","./dropdown/closeOnSelect","./dropdown/dropdownCss","./dropdown/tagsSearchHighlight","./i18n/en"],function(l,r,o,a,c,u,d,p,h,f,g,t,m,y,v,_,b,$,w,x,A,D,S,E,O,C,L,T,q,I,e){function n(){this.reset()}return n.prototype.apply=function(e){var t;null==(e=l.extend(!0,{},this.defaults,e)).dataAdapter&&(null!=e.ajax?e.dataAdapter=v:null!=e.data?e.dataAdapter=y:e.dataAdapter=m,0<e.minimumInputLength&&(e.dataAdapter=f.Decorate(e.dataAdapter,$)),0<e.maximumInputLength&&(e.dataAdapter=f.Decorate(e.dataAdapter,w)),0<e.maximumSelectionLength&&(e.dataAdapter=f.Decorate(e.dataAdapter,x)),e.tags&&(e.dataAdapter=f.Decorate(e.dataAdapter,_)),null==e.tokenSeparators&&null==e.tokenizer||(e.dataAdapter=f.Decorate(e.dataAdapter,b))),null==e.resultsAdapter&&(e.resultsAdapter=r,null!=e.ajax&&(e.resultsAdapter=f.Decorate(e.resultsAdapter,E)),null!=e.placeholder&&(e.resultsAdapter=f.Decorate(e.resultsAdapter,S)),e.selectOnClose&&(e.resultsAdapter=f.Decorate(e.resultsAdapter,L)),e.tags&&(e.resultsAdapter=f.Decorate(e.resultsAdapter,I))),null==e.dropdownAdapter&&(e.multiple?e.dropdownAdapter=A:(t=f.Decorate(A,D),e.dropdownAdapter=t),0!==e.minimumResultsForSearch&&(e.dropdownAdapter=f.Decorate(e.dropdownAdapter,C)),e.closeOnSelect&&(e.dropdownAdapter=f.Decorate(e.dropdownAdapter,T)),null!=e.dropdownCssClass&&(e.dropdownAdapter=f.Decorate(e.dropdownAdapter,q)),e.dropdownAdapter=f.Decorate(e.dropdownAdapter,O)),null==e.selectionAdapter&&(e.multiple?e.selectionAdapter=a:e.selectionAdapter=o,null!=e.placeholder&&(e.selectionAdapter=f.Decorate(e.selectionAdapter,c)),e.allowClear&&(e.selectionAdapter=f.Decorate(e.selectionAdapter,u)),e.multiple&&(e.selectionAdapter=f.Decorate(e.selectionAdapter,d)),null!=e.selectionCssClass&&(e.selectionAdapter=f.Decorate(e.selectionAdapter,p)),e.selectionAdapter=f.Decorate(e.selectionAdapter,h)),e.language=this._resolveLanguage(e.language),e.language.push("en");for(var n=[],s=0;s<e.language.length;s++){var i=e.language[s];-1===n.indexOf(i)&&n.push(i)}return e.language=n,e.translations=this._processTranslations(e.language,e.debug),e},n.prototype.reset=function(){function a(e){return e.replace(/[^\u0000-\u007E]/g,function(e){return t[e]||e})}this.defaults={amdLanguageBase:"./i18n/",autocomplete:"off",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:f.escapeMarkup,language:{},matcher:function e(t,n){if(null==t.term||""===t.term.trim())return n;if(n.children&&0<n.children.length){for(var s=l.extend(!0,{},n),i=n.children.length-1;0<=i;i--)null==e(t,n.children[i])&&s.children.splice(i,1);return 0<s.children.length?s:e(t,s)}var r=a(n.text).toUpperCase(),o=a(t.term).toUpperCase();return-1<r.indexOf(o)?n:null},minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,scrollAfterSelect:!1,sorter:function(e){return e},templateResult:function(e){return e.text},templateSelection:function(e){return e.text},theme:"default",width:"resolve"}},n.prototype.applyFromElement=function(e,t){var n=e.language,s=this.defaults.language,i=t.prop("lang"),t=t.closest("[lang]").prop("lang"),t=Array.prototype.concat.call(this._resolveLanguage(i),this._resolveLanguage(n),this._resolveLanguage(s),this._resolveLanguage(t));return e.language=t,e},n.prototype._resolveLanguage=function(e){if(!e)return[];if(l.isEmptyObject(e))return[];if(l.isPlainObject(e))return[e];for(var t,n=Array.isArray(e)?e:[e],s=[],i=0;i<n.length;i++)s.push(n[i]),"string"==typeof n[i]&&0<n[i].indexOf("-")&&(t=n[i].split("-")[0],s.push(t));return s},n.prototype._processTranslations=function(e,t){for(var n=new g,s=0;s<e.length;s++){var i=new g,r=e[s];if("string"==typeof r)try{i=g.loadPath(r)}catch(e){try{r=this.defaults.amdLanguageBase+r,i=g.loadPath(r)}catch(e){t&&window.console&&console.warn&&console.warn('Select2: The language file for "'+r+'" could not be automatically loaded. A fallback will be used instead.')}}else i=l.isPlainObject(r)?new g(r):r;n.extend(i)}return n},n.prototype.set=function(e,t){var n={};n[l.camelCase(e)]=t;n=f._convertData(n);l.extend(!0,this.defaults,n)},new n}),u.define("select2/options",["jquery","./defaults","./utils"],function(c,n,u){function e(e,t){this.options=e,null!=t&&this.fromElement(t),null!=t&&(this.options=n.applyFromElement(this.options,t)),this.options=n.apply(this.options)}return e.prototype.fromElement=function(e){var t=["select2"];null==this.options.multiple&&(this.options.multiple=e.prop("multiple")),null==this.options.disabled&&(this.options.disabled=e.prop("disabled")),null==this.options.autocomplete&&e.prop("autocomplete")&&(this.options.autocomplete=e.prop("autocomplete")),null==this.options.dir&&(e.prop("dir")?this.options.dir=e.prop("dir"):e.closest("[dir]").prop("dir")?this.options.dir=e.closest("[dir]").prop("dir"):this.options.dir="ltr"),e.prop("disabled",this.options.disabled),e.prop("multiple",this.options.multiple),u.GetData(e[0],"select2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),u.StoreData(e[0],"data",u.GetData(e[0],"select2Tags")),u.StoreData(e[0],"tags",!0)),u.GetData(e[0],"ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."),e.attr("ajax--url",u.GetData(e[0],"ajaxUrl")),u.StoreData(e[0],"ajax-Url",u.GetData(e[0],"ajaxUrl")));var n={};function s(e,t){return t.toUpperCase()}for(var i=0;i<e[0].attributes.length;i++){var r=e[0].attributes[i].name,o="data-";r.substr(0,o.length)==o&&(r=r.substring(o.length),o=u.GetData(e[0],r),n[r.replace(/-([a-z])/g,s)]=o)}c.fn.jquery&&"1."==c.fn.jquery.substr(0,2)&&e[0].dataset&&(n=c.extend(!0,{},e[0].dataset,n));var a,l=c.extend(!0,{},u.GetData(e[0]),n);for(a in l=u._convertData(l))-1<t.indexOf(a)||(c.isPlainObject(this.options[a])?c.extend(this.options[a],l[a]):this.options[a]=l[a]);return this},e.prototype.get=function(e){return this.options[e]},e.prototype.set=function(e,t){this.options[e]=t},e}),u.define("select2/core",["jquery","./options","./utils","./keys"],function(t,i,r,s){var o=function(e,t){null!=r.GetData(e[0],"select2")&&r.GetData(e[0],"select2").destroy(),this.$element=e,this.id=this._generateId(e),t=t||{},this.options=new i(t,e),o.__super__.constructor.call(this);var n=e.attr("tabindex")||0;r.StoreData(e[0],"old-tabindex",n),e.attr("tabindex","-1");t=this.options.get("dataAdapter");this.dataAdapter=new t(e,this.options);n=this.render();this._placeContainer(n);t=this.options.get("selectionAdapter");this.selection=new t(e,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,n);t=this.options.get("dropdownAdapter");this.dropdown=new t(e,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,n);n=this.options.get("resultsAdapter");this.results=new n(e,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var s=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current(function(e){s.trigger("selection:update",{data:e})}),e[0].classList.add("select2-hidden-accessible"),e.attr("aria-hidden","true"),this._syncAttributes(),r.StoreData(e[0],"select2",this),e.data("select2",this)};return r.Extend(o,r.Observable),o.prototype._generateId=function(e){return"select2-"+(null!=e.attr("id")?e.attr("id"):null!=e.attr("name")?e.attr("name")+"-"+r.generateChars(2):r.generateChars(4)).replace(/(:|\.|\[|\]|,)/g,"")},o.prototype._placeContainer=function(e){e.insertAfter(this.$element);var t=this._resolveWidth(this.$element,this.options.get("width"));null!=t&&e.css("width",t)},o.prototype._resolveWidth=function(e,t){var n=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==t){var s=this._resolveWidth(e,"style");return null!=s?s:this._resolveWidth(e,"element")}if("element"==t){s=e.outerWidth(!1);return s<=0?"auto":s+"px"}if("style"!=t)return"computedstyle"!=t?t:window.getComputedStyle(e[0]).width;e=e.attr("style");if("string"!=typeof e)return null;for(var i=e.split(";"),r=0,o=i.length;r<o;r+=1){var a=i[r].replace(/\s/g,"").match(n);if(null!==a&&1<=a.length)return a[1]}return null},o.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},o.prototype._registerDomEvents=function(){var t=this;this.$element.on("change.select2",function(){t.dataAdapter.current(function(e){t.trigger("selection:update",{data:e})})}),this.$element.on("focus.select2",function(e){t.trigger("focus",e)}),this._syncA=r.bind(this._syncAttributes,this),this._syncS=r.bind(this._syncSubtree,this),this._observer=new window.MutationObserver(function(e){t._syncA(),t._syncS(e)}),this._observer.observe(this.$element[0],{attributes:!0,childList:!0,subtree:!1})},o.prototype._registerDataEvents=function(){var n=this;this.dataAdapter.on("*",function(e,t){n.trigger(e,t)})},o.prototype._registerSelectionEvents=function(){var n=this,s=["toggle","focus"];this.selection.on("toggle",function(){n.toggleDropdown()}),this.selection.on("focus",function(e){n.focus(e)}),this.selection.on("*",function(e,t){-1===s.indexOf(e)&&n.trigger(e,t)})},o.prototype._registerDropdownEvents=function(){var n=this;this.dropdown.on("*",function(e,t){n.trigger(e,t)})},o.prototype._registerResultsEvents=function(){var n=this;this.results.on("*",function(e,t){n.trigger(e,t)})},o.prototype._registerEvents=function(){var n=this;this.on("open",function(){n.$container[0].classList.add("select2-container--open")}),this.on("close",function(){n.$container[0].classList.remove("select2-container--open")}),this.on("enable",function(){n.$container[0].classList.remove("select2-container--disabled")}),this.on("disable",function(){n.$container[0].classList.add("select2-container--disabled")}),this.on("blur",function(){n.$container[0].classList.remove("select2-container--focus")}),this.on("query",function(t){n.isOpen()||n.trigger("open",{}),this.dataAdapter.query(t,function(e){n.trigger("results:all",{data:e,query:t})})}),this.on("query:append",function(t){this.dataAdapter.query(t,function(e){n.trigger("results:append",{data:e,query:t})})}),this.on("keypress",function(e){var t=e.which;n.isOpen()?t===s.ESC||t===s.UP&&e.altKey?(n.close(e),e.preventDefault()):t===s.ENTER||t===s.TAB?(n.trigger("results:select",{}),e.preventDefault()):t===s.SPACE&&e.ctrlKey?(n.trigger("results:toggle",{}),e.preventDefault()):t===s.UP?(n.trigger("results:previous",{}),e.preventDefault()):t===s.DOWN&&(n.trigger("results:next",{}),e.preventDefault()):(t===s.ENTER||t===s.SPACE||t===s.DOWN&&e.altKey)&&(n.open(),e.preventDefault())})},o.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.isDisabled()?(this.isOpen()&&this.close(),this.trigger("disable",{})):this.trigger("enable",{})},o.prototype._isChangeMutation=function(e){var t=this;if(e.addedNodes&&0<e.addedNodes.length){for(var n=0;n<e.addedNodes.length;n++)if(e.addedNodes[n].selected)return!0}else{if(e.removedNodes&&0<e.removedNodes.length)return!0;if(Array.isArray(e))return e.some(function(e){return t._isChangeMutation(e)})}return!1},o.prototype._syncSubtree=function(e){var e=this._isChangeMutation(e),t=this;e&&this.dataAdapter.current(function(e){t.trigger("selection:update",{data:e})})},o.prototype.trigger=function(e,t){var n=o.__super__.trigger,s={open:"opening",close:"closing",select:"selecting",unselect:"unselecting",clear:"clearing"};if(void 0===t&&(t={}),e in s){var i=s[e],s={prevented:!1,name:e,args:t};if(n.call(this,i,s),s.prevented)return void(t.prevented=!0)}n.call(this,e,t)},o.prototype.toggleDropdown=function(){this.isDisabled()||(this.isOpen()?this.close():this.open())},o.prototype.open=function(){this.isOpen()||this.isDisabled()||this.trigger("query",{})},o.prototype.close=function(e){this.isOpen()&&this.trigger("close",{originalEvent:e})},o.prototype.isEnabled=function(){return!this.isDisabled()},o.prototype.isDisabled=function(){return this.options.get("disabled")},o.prototype.isOpen=function(){return this.$container[0].classList.contains("select2-container--open")},o.prototype.hasFocus=function(){return this.$container[0].classList.contains("select2-container--focus")},o.prototype.focus=function(e){this.hasFocus()||(this.$container[0].classList.add("select2-container--focus"),this.trigger("focus",{}))},o.prototype.enable=function(e){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.'),null!=e&&0!==e.length||(e=[!0]);e=!e[0];this.$element.prop("disabled",e)},o.prototype.data=function(){this.options.get("debug")&&0<arguments.length&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.');var t=[];return this.dataAdapter.current(function(e){t=e}),t},o.prototype.val=function(e){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==e||0===e.length)return this.$element.val();e=e[0];Array.isArray(e)&&(e=e.map(function(e){return e.toString()})),this.$element.val(e).trigger("input").trigger("change")},o.prototype.destroy=function(){r.RemoveData(this.$container[0]),this.$container.remove(),this._observer.disconnect(),this._observer=null,this._syncA=null,this._syncS=null,this.$element.off(".select2"),this.$element.attr("tabindex",r.GetData(this.$element[0],"old-tabindex")),this.$element[0].classList.remove("select2-hidden-accessible"),this.$element.attr("aria-hidden","false"),r.RemoveData(this.$element[0]),this.$element.removeData("select2"),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null},o.prototype.render=function(){var e=t('<span class="select2 select2-container"><span class="selection"></span><span class="dropdown-wrapper" aria-hidden="true"></span></span>');return e.attr("dir",this.options.get("dir")),this.$container=e,this.$container[0].classList.add("select2-container--"+this.options.get("theme")),r.StoreData(e[0],"element",this.$element),e},o}),u.define("jquery-mousewheel",["jquery"],function(e){return e}),u.define("jquery.select2",["jquery","jquery-mousewheel","./select2/core","./select2/defaults","./select2/utils"],function(i,e,r,t,o){var a;return null==i.fn.select2&&(a=["open","close","destroy"],i.fn.select2=function(t){if("object"==typeof(t=t||{}))return this.each(function(){var e=i.extend(!0,{},t);new r(i(this),e)}),this;if("string"!=typeof t)throw new Error("Invalid arguments for Select2: "+t);var n,s=Array.prototype.slice.call(arguments,1);return this.each(function(){var e=o.GetData(this,"select2");null==e&&window.console&&console.error&&console.error("The select2('"+t+"') method was called on an element that is not using Select2."),n=e[t].apply(e,s)}),-1<a.indexOf(t)?this:n}),null==i.fn.select2.defaults&&(i.fn.select2.defaults=t),r}),{define:u.define,require:u.require});function b(e,t){return i.call(e,t)}function l(e,t){var n,s,i,r,o,a,l,c,u,d,p=t&&t.split("/"),h=y.map,f=h&&h["*"]||{};if(e){for(t=(e=e.split("/")).length-1,y.nodeIdCompat&&_.test(e[t])&&(e[t]=e[t].replace(_,"")),"."===e[0].charAt(0)&&p&&(e=p.slice(0,p.length-1).concat(e)),c=0;c<e.length;c++)"."===(d=e[c])?(e.splice(c,1),--c):".."===d&&(0===c||1===c&&".."===e[2]||".."===e[c-1]||0<c&&(e.splice(c-1,2),c-=2));e=e.join("/")}if((p||f)&&h){for(c=(n=e.split("/")).length;0<c;--c){if(s=n.slice(0,c).join("/"),p)for(u=p.length;0<u;--u)if(i=h[p.slice(0,u).join("/")],i=i&&i[s]){r=i,o=c;break}if(r)break;!a&&f&&f[s]&&(a=f[s],l=c)}!r&&a&&(r=a,o=l),r&&(n.splice(0,o,r),e=n.join("/"))}return e}function w(t,n){return function(){var e=a.call(arguments,0);return"string"!=typeof e[0]&&1===e.length&&e.push(null),o.apply(p,e.concat([t,n]))}}function x(e){var t;if(b(m,e)&&(t=m[e],delete m[e],v[e]=!0,r.apply(p,t)),!b(g,e)&&!b(v,e))throw new Error("No "+e);return g[e]}function c(e){var t,n=e?e.indexOf("!"):-1;return-1<n&&(t=e.substring(0,n),e=e.substring(n+1,e.length)),[t,e]}function A(e){return e?c(e):[]}var u=s.require("jquery.select2");return t.fn.select2.amd=s,u});
    20 "use strict";function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}!function(e){var t='Please <a href="#" class="page-refresh-btn">refresh</a> the page. If you see this message again, please contact [email protected].',n=e(document);function a(t){var n=e(t).find("ul.tabs");n.length<=0||n.hasClass("tabs-init")||(n.addClass("tabs-init"),n.each(function(){var t,n,a=e(this).find("a");(t=e(a.filter('[href="'+location.hash+'"]')[0]||a[0])).addClass("current"),n=e(t[0].hash),a.not(t).each(function(){e(this.hash).hide()}),e(this).on("click","a",function(a){t.removeClass("current"),n.hide(),t=e(this),n=e(this.hash),t.addClass("current"),n.show(),a.preventDefault()})}))}function c(t){if("object"!=_typeof(t))return!1;if(void 0===t.event_type)return console.error("event_type is required by megacalShortcodeFieldUpdate"),!1;if(void 0===t.field_selector)return console.error("field_selector is required by megacalShortcodeFieldUpdate"),!1;if(void 0===t.shortcode_att)return console.error("shortcode_att is required by megacalShortcodeFieldUpdate"),!1;if(void 0===t.output_selector)return console.error("output_selector is required by megacalShortcodeFieldUpdate"),!1;t={event_type:t.event_type,field_selector:t.field_selector,shortcode_att:t.shortcode_att,output_selector:t.output_selector,handler:void 0===t.handler?"val":t.handler,callback:void 0===t.callback?null:t.callback};n.on(t.event_type,t.field_selector,function(n){var a=e(t.output_selector),c=a.val(),r=c;"function"==typeof t.handler?r=t.handler(t.shortcode_att,c,e(this)):"string"==typeof t.handler&&(r=function(e,t,n,a){return"val"!=e&&"checked"!=e?n:("val"==e?c=a.val():"checked"==e&&(c=a.prop("checked")),o(t,c,n));var c}(t.handler,t.shortcode_att,c,e(this))),"function"==typeof t.callback&&t.callback(r),a.val(r)})}function o(e,t,n){var a=n.length,c=a-1,o=new RegExp("\\s"+e+'="[^"]*"',"g");return n.indexOf(" "+e)>0&&""!=t?n.replace(o," "+e+'="'+t+'"'):""!=t?n.substring(0,c)+" "+e+'="'+t+'"'+n.substring(a-1):n.replace(o,"")}function r(t,n){var a=t.find(".required"),c=!0;a.each(function(){var t=e(this);t.val()?t.hasClass("select2-hidden-accessible")?t.next(".select2-container").removeClass("invalid"):t.removeClass("invalid"):(t.hasClass("select2-hidden-accessible")?(t.next(".select2-container").removeClass("valid"),t.next(".select2-container").addClass("invalid")):(t.removeClass("valid"),t.addClass("invalid")),c=!1)}),c?n.prop("disabled",!1):n.prop("disabled",!0)}n.ready(function(){var i=e("#megacal-register-form"),s=e("#megacal-register-handle"),l=e("#megacal-check-handle-button"),d=e(".megacal-register-button");n.on("click",".page-refresh-btn",function(e){e.preventDefault(),window.location.href=window.location.href}),a(document),n.on("click","#megacal-events-settings-sc .copyToClipboard",function(t){t.preventDefault(),e(".shortcode").select();try{document.execCommand("copy")?e(".copySuccess").fadeIn().delay(200).fadeOut():e(".copyFail").fadeIn().delay(200).fadeOut()}catch(t){console.log(t),e(".copyFail").fadeIn().delay(200).fadeOut()}}),e("#megacal-show-tokens").on("click",function(t){t.preventDefault(),e("#megacal_access_token").attr("type","text").closest("tr.hidden").addClass("megacal-row").removeClass("hidden"),e("#megacal_refresh_token").attr("type","text").closest("tr.hidden").addClass("megacal-row").removeClass("hidden")}),e("#megacal-reset-account").on("click",function(t){if(t.preventDefault(),!window.confirm("Do you really want to unlink your MegaCalendar account from this site? (You will lose your existing Events)"))return!1;var n=e("#_megacal_unlink_account_nonce").val();window.location=megacal_admin_script_opts.settings_url+"&unlink=true&nonce="+n}),s.on("keyup",function(){e(this).val()?l.prop("disabled",!1):l.prop("disabled",!0)}),l.on("click",function(t){t.preventDefault();var n={action:"megacal_check_handle",handle:s.val(),_nonce:e("#_megacal_check_handle_nonce").val()};e.post(megacal_admin_script_opts.ajax_url,n,function(e){if(0==e.success)return S(),void I(e.data.message,"error");1==e.data.unique?(s.removeClass("invalid"),s.addClass("valid")):(s.removeClass("valid"),s.addClass("invalid"))}).fail(function(){S(),I("Something isn't right...","error")})}),e("#megacal-register-form input").on("keyup",function(){r(i,d)}),i.on("submit",function(n){n.preventDefault();var a=e(this)[0],c=new FormData(a);if(c.get("firstname"))if(c.get("lastname"))if(c.get("handle"))if(c.get("email"))if(c.get("calendarName")){var o=c.get("firstname"),r=c.get("lastname"),i=c.get("handle"),s=c.get("email"),l=c.get("calendarName"),d=c.get("phone"),u={action:"megacal_register",_nonce:c.get("_megacal_register_nonce"),firstname:o,lastname:r,handle:i,email:s,calendarName:l,phone:d};e.post(megacal_admin_script_opts.ajax_url,u,function(e){if(0==e.success)return S(),void I(e.data.message,"error");window.location=megacal_admin_script_opts.upgrade_url}).fail(function(){S(),I(t,"error")})}else alert("calendarName cannot be empty");else alert("email cannot be empty");else alert("handle cannot be empty");else alert("lastname cannot be empty");else alert("firstname cannot be empty")});var u=e("#megacal-manage-events");if(u.length>0){var v=function(n,a){var c=a.closest(".approval-notice"),o=c.data("event-id"),r=c.data("user-id"),i={action:"megacal_set_event_approval",_nonce:e("#_megacal_set_event_approval_nonce").val(),approvalAction:n};switch(n){case"approve":case"deny":i.userId=r,i.eventId=o;break;case"always":case"approve_pending":case"deny_pending":i.userId=r}e.post(megacal_admin_script_opts.ajax_url,i,function(t){if(0==t.success)return S(),void I(t.data.message,"error");console.log(t),c.fadeOut(200,function(){e(this).remove(),k()}),D.eventCalendar("refresh")}).fail(function(){S(),I(t,"error")})},m=function(t,n,a){var c={action:"megacal_get_event_upsert",_nonce:e("#_megacal_get_event_upsert_nonce").val()};null!==(t=t||null)&&(c.eventId=t),e.post(megacal_admin_script_opts.ajax_url,c,n).fail(a)},g=function(n){var a=e("#megacal-event-form"),c=e(".megacal-button-save-event"),o=e(".megacal-button-delete-event"),i=e("#megacal-all-day"),s=e("#megacal-event-start-time"),l=e("#megacal-event-end-time"),d=e("#megacal-event-date"),u=e("#megacal-upload-event-img"),v=e("#megacal-remove-event-img"),m=e("#megacal-event-img"),g=e("#megacal-img-preview"),y=e("#megacal-event-venue-name"),C=e("#megacal-event-venue-id"),b=e("#megacal-event-category-name"),k=e("#megacal-event-category-id"),R=e("#megacal-event-venue-location"),O=e(".megacal-button-cancel-edit-event"),M=e(".megacal-button-cancel-save-delete"),x=!!n&&new Date(n),T=e(".timepicker"),U=e("#megacal-event-recurrence-details").val(),Y=null;""!==U.trim()&&(Y=JSON.parse(U)),x&&(fmtDate=new Intl.DateTimeFormat("en-US",{month:"2-digit",day:"2-digit",year:"numeric"}).format(x),d.val(fmtDate)),O.on("click",function(e){w.fadeOut(500)}),M.on("click",function(e){f()}),o.on("click",function(n){if(!E&&!window.confirm("Are you sure you want to permanently delete this event?"))return;if(!Y||E){var c={action:"megacal_delete_event",_nonce:e("#submitdiv").find("#_megacal_delete_event_nonce").val(),eventId:a.find("#megacal-event-id").val(),eventChangeType:new FormData(a[0]).get("eventChangeType")};e.post(megacal_admin_script_opts.ajax_url,c,function(e){if(0==e.success)return S(),void I(e.data.message,"error");console.log(e),w.fadeOut(500,function(){D.eventCalendar("refresh")})}).fail(function(){S(),I(t,"error")}).done(function(){f()})}else p("delete")}),d.datepicker({format:"mm/dd/yyyy",todayHighlight:!0,autoclose:!0}).datepicker("update"),d.on("change",function(){r(a,c),_()}),T.each(function(){var t=e(this).val();e(this).wickedpicker({now:t||"12:00",minutesInterval:5,clearable:!0}),t||e(this).val("")}),y.select2({placeholder:"Tag or Add a Venue",tags:!0,allowClear:!0,createTag:function(t){var n=!1;if(y.find("option").each(function(){e.trim(t.term).toUpperCase()===e.trim(e(this).text()).toUpperCase()&&(n=!0)}),!n)return e.isNumeric(t.term)?{}:{id:t.term,text:t.term+" (new)",isNew:!0}},language:{noResults:function(e){return"Type to add a venue."}}}),y.on("change",function(){var t=e(this).val(),n=e(this).find('option[value="'+t+'"]').data("location");e.isNumeric(t)?(C.val(t),R.val(n).prop("disabled",!0)):(C.val(""),R.val("").prop("disabled",!1)),r(a,c)}),b.select2({placeholder:"Tag or Add an Event Category",tags:!0,createTag:function(t){var n=!1;if(b.find("option").each(function(){e.trim(t.term).toUpperCase()===e.trim(e(this).text()).toUpperCase()&&(n=!0)}),!n)return e.isNumeric(t.term)?{}:{id:t.term,text:t.term+" (new)",isNew:!0}},language:{noResults:function(e){return"No Existing Categories Found"}}}),b.on("change",function(){var t=e(this).val();e.isNumeric(t)?k.val(t):k.val(""),r(a,c)}),e("#megacal-event-form input").on("keyup",function(){r(a,c)}),i.prop("checked")&&(s.hide().removeClass("required"),l.hide().removeClass("required")),i.on("change",function(){e(this).prop("checked")?(s.hide().removeClass("required"),l.hide().removeClass("required")):(s.show().addClass("required"),l.show().addClass("required")),r(a,c)}),a.find("input").on("blur, focus",function(){r(a,c)}),a.on("submit",function(t){t.preventDefault(),tinyMCE&&tinyMCE.triggerSave();var n=e(this)[0],a=new FormData(n);Y&&!E?p("update"):h(a)}),u.on("click",function(e){e.preventDefault(),r(a,c),customUploader=wp.media({title:"Upload Event Image",library:{type:"image"},button:{text:"Use this image"},multiple:!1}).on("select",function(){var e=customUploader.state().get("selection").first().toJSON();u.hide(),g.attr("src",e.url).show(),v.show(),m.val(e.url)}).open()}),v.on("click",function(e){e.preventDefault(),r(a,c),g.hide(),v.hide(),u.show(),m.val("")}),_(Y)},p=function(t){var n=e("#megacal-change-type-modal");n.show(),e("#megacal-admin-mask").show(),"update"===t?(e("#megacal-change-type-this").prop("checked",!0),e("#megacal-change-type-options").show(),n.find(".megacal-button-delete-event").hide(),n.find(".megacal-button-save-event").show(),n.find("#megacal-change-type-this").focus()):"delete"===t&&(e("#megacal-delete-type-this").prop("checked",!0),e("#megacal-delete-type-options").show(),n.find(".megacal-button-delete-event").show(),n.find(".megacal-button-save-event").hide(),n.find("#megacal-delete-type-this").focus()),E=!0},f=function(){e("#megacal-change-type-modal").hide(),e("#megacal-admin-mask").hide(),e("#megacal-change-type-options").hide(),e("#megacal-delete-type-options").hide(),e(".megacal-button-save-event").focus(),E=!1},h=function(n){var a=n.get("_megacal_event_upsert_nonce"),c=n.get("eventId"),o=n.get("eventTitle"),r=n.get("eventDate"),i=n.get("eventAllDay"),s=n.get("eventStartTime"),l=n.get("eventEndTime"),d=n.get("eventImg"),u=n.get("eventVenueId"),v=n.get("eventVenueName"),m=n.get("eventVenueLocation"),g=n.get("eventCatId"),p=n.get("eventCatName"),h=n.get("megacal-event-organizer"),_=n.get("eventFacebookUrl"),y=n.get("eventTicketUrl"),C=n.get("eventPrice"),b=n.getAll("eventTaggedUsers"),k=n.get("eventTaggedUsersExtra"),R=n.get("megacal-event-description"),O=n.get("megacal-event-private-notes"),M=n.get("publishEvent"),x=n.get("eventRecurrence"),T=n.get("eventRecurrenceRepetition"),U=n.get("eventRecurrenceCustomType"),Y=n.get("eventRecurrenceCustomMonthlyFreq"),F=n.getAll("eventRecurrenceWeeklyDays"),N=n.get("eventRecurrenceEnd"),q=n.get("eventRecurrenceEndDate"),j=n.get("eventRecurrenceEndOccurrence"),W=n.get("eventRecurrenceDayOfWeek"),L=n.get("eventRecurrenceWeekOfMonth"),A=n.get("eventRecurrenceLastDayOfWeek"),V=n.get("eventRecurrenceDayOfMonth"),P=n.get("eventRecurrenceMonth"),H=n.get("eventChangeType"),B={action:"megacal_save_event",_nonce:a,eventId:c,eventTitle:o,eventDate:r,eventAllDay:i,eventStartTime:s,eventEndTime:l,eventImg:d,eventVenueId:u,eventVenueName:v,eventVenueLocation:m,eventCatId:g,eventCatName:p,eventOrganizer:h,eventFacebookUrl:_,eventTicketUrl:y,eventPrice:C,eventTaggedUsers:b,eventTaggedUsersExtra:k,megacalEventDescription:R,megacalEventPrivateNotes:O,published:M,eventRecurrence:x,eventRecurrenceRepetition:T,eventRecurrenceCustomType:U,eventRecurrenceCustomMonthlyFreq:Y,eventRecurrenceWeeklyDays:F,eventRecurrenceEnd:N,eventRecurrenceEndDate:q,eventRecurrenceEndOccurrence:j,eventRecurrenceDayOfWeek:W,eventRecurrenceWeekOfMonth:L,eventRecurrenceLastDayOfWeek:A,eventRecurrenceDayOfMonth:V,eventRecurrenceMonth:P,eventChangeType:H};e.post(megacal_admin_script_opts.ajax_url,B,function(t){if(0==t.success)return S(),I(t.data.message,"error"),void console.log(t);if(w.fadeOut(500),D.eventCalendar("refresh"),""==u){var n={action:"megacal_get_event_upsert",_nonce:e("#_megacal_get_event_upsert_nonce").val(),eventId:t.data.eventId};e.post(megacal_admin_script_opts.ajax_url,n,function(e){if(0==e.success)return S(),I(e.data.message,"error"),void console.log(e)})}}).fail(function(){S(),I(t,"error"),E=!1}).done(function(){f()})},_=function n(a){var c=e(".megacal-event-recurrence-container"),o=c.find("#eventRecurrenceSelect"),i=!!o&&o.val(),s=c.find(".eventRecurrenceEnd:checked"),l=!!s&&s.val(),d=e("#eventRecurrenceCustomType"),u=!!d&&d.val(),v=e("#megacal-event-date").val(),m=e("#megacal-event-id").val().trim()?parseInt(e("#megacal-event-id").val().trim()):0,g=e(".megacal-ends-details-container"),p=g.length>0&&!g.hasClass("collapsed"),f=!0;!a&&m>0&&(f=!1),a&&(i=a.type,"CUSTOM"===a.type&&(u=a.custom.type||u,l=a.custom.end_condition||l));var h=e("#_megacal_event_recurrence_nonce").val();e.post(megacal_admin_script_opts.ajax_url,{action:"megacal_get_event_recurrence",_nonce:h,date:v||null,showRecurrence:f},function(t){if(0==t.success)return S(),void I(t.data.message,"error");c.html(t.data.content);var o=t.data.recurrence_details;if(o){var r=e("#eventRecurrenceRepetition"),s=e("#eventRecurrenceEndDate"),d=e("#eventRecurrenceEndOccurrence"),v=e("#eventRecurrenceCustomType"),m=e("#eventRecurrenceCustomMonthlyFreq"),g=e("#eventRecurrenceWeeklyDays"),f=c.find("#eventRecurrenceSelect"),h=c.find(".megacal-custom-recurrence-details");i&&(f.val(i),"CUSTOM"===i&&h.show()),l&&c.find('.eventRecurrenceEnd[value="'+l+'"]').prop("checked",!0),u&&v.val(u),"CUSTOM"===f.val()&&e(".megacal-custom-recurrence-details").removeClass("hidden");var _=v.val().toLowerCase(),y=o.custom,C=y[_+"_custom"],b=moment(C.end_condition.on,"YYYY-MM-DD").format("MM/DD/YYYY"),k=C.end_condition.after_occurrence,w=y.repetition;if(a&&a.custom){var D=a.custom[_+"_custom"];if(w=a.custom.repetition||w,D.repeat_on&&(e(".eventRecurrenceWeeklyDays").prop("checked",!1),e(".eventRecurrenceWeeklyDays").each(function(){var t=e(this);D.repeat_on.indexOf(t.val())>-1&&e(this).prop("checked",!0)})),D.day_of_week){var R=D.week_of_month;e("#eventRecurrenceCustomMonthlyFreq").val("week_of_month-"+R)}a.custom.end_condition&&(a.custom.end_condition.on?(b=moment(a.custom.end_condition.on,"YYYY-MM-DD").format("MM/DD/YYYY"),p=!0,c.find("#eventRecurrenceEndDateOp").prop("checked",!0)):a.custom.end_condition.after_occurrence>0&&(k=a.custom.end_condition.after_occurrence,p=!0,c.find("#eventRecurrenceEndOccurrenceOp").prop("checked",!0)))}if(r.val(w),s.val(b),d.val(k),p){var E=c.find(".megacal-ends-details-container");c.find(".collapsable-toggle").find(".icon-chevron-right").removeClass("icon-chevron-right").addClass("icon-chevron-down"),E.removeClass("collapsed")}f.on("change",function(){"CUSTOM"===e(this).val()?h.slideDown():h.slideUp()}),"WEEKLY"===v.val()?g.removeClass("hidden"):"MONTHLY"===v.val()&&m.removeClass("hidden"),v.on("change",function(){n()}),c.find("#eventRecurrenceEndDate").datepicker({format:"mm/dd/yyyy",todayHighlight:!0,autoclose:!0}).datepicker("update"),e("#eventRecurrenceEndOccurrence").on("click",function(){e("#eventRecurrenceEndOccurrenceOp").prop("checked",!0)}),e("#eventRecurrenceEndDate").on("click",function(){e("#eventRecurrenceEndDateOp").prop("checked",!0)}),e(".eventRecurrenceWeeklyDays").on("click",function(){var t,n=e(".eventRecurrenceWeeklyDays"),a=y.weekly_custom.selected_day_of_week,c=!0;n.each(function(){!0===e(this).prop("checked")&&(c=!1),e(this).val()===a&&(t=e(this))}),c&&t.prop("checked",!0)})}}).fail(function(){S(),I(t,"error")}).done(function(){r(e("#megacal-event-form"),e(".megacal-button-save-event"))})},y=function(){if(tinyMCE){var t=e("#megacal-event-form"),n=e(".megacal-button-save-event");w.find(".wp-editor-area").each(function(){var a=e(this).attr("id");tinyMCEPreInit.mceInit[a].setup=function(e){e.on("keyup",function(){r(t,n)})},tinyMCE.init(tinyMCEPreInit.mceInit[a]),tinyMCE.execCommand("mceRemoveEditor",!1,a),tinyMCE.execCommand("mceAddEditor",!1,a),quicktags({id:a})})}},C=function(){w.fadeIn(500,function(){e("#megacal-event-title").focus()})},b=function(t,n){var a=moment(n).hours(0).minutes(0).seconds(0).milliseconds(0),c=a.clone().startOf("month").startOf("week").format("YYYY-MM-DD"),o=a.clone().endOf("month").endOf("week").format("YYYY-MM-DD"),r=e("#_megacal_fetch_events_nonce").val(),i=e("#megacal-manage-filter-form"),s=new FormData(i[0]).getAll("megacalFilterCategories");t.eventCalendar("showLoader");var l={action:"megacal_fetch_calendar_events",_nonce:r,startDate:c,endDate:o,eventCategories:s};e.post(megacal_admin_script_opts.ajax_url,l,function(e){if(0==e.success)return S(),void I(e.data.message,"error");t.eventCalendar("option","events",{events:e.data.events})}).fail(function(){}).done(function(){t.eventCalendar("hideLoader")})},k=function(){var n={action:"megacal_get_approval_list",_nonce:e("#megacal_get_approval_list_nonce").val()};e.post(megacal_admin_script_opts.ajax_url,n,function(t){if(0==t.success)return S(),void I(t.data.message,"error");O.html(t.data.content),e(".button-approval-action").on("click",function(t){t.preventDefault(),v(e(this).data("action"),e(this))})}).fail(function(){S(),I(t,"error")})},w=e("#save-event-wrap"),D=e("#megacal-manage-calendar"),R=new Date,E=!1,O=e("#megacal-approval-list");e(".megacal-filter-cat-btn").on("change",function(){D.eventCalendar("refresh")}),D.eventCalendar({showImage:!1,showLegends:!0,showOwners:!0,timeFormat:megacal_admin_script_opts.time_fmt_setting,dateFormat:{calendar:"D",calendarFirst:"MMM D"},showSlider:!1,loaderImageUrl:megacal_admin_script_opts.base_url+"/assets/img/loading.svg",defaultEventImageUrl:megacal_admin_script_opts.default_image_path,calendarCreate:function(e,t){}}).on("eventcalendar.calendaraddevent",function(e,n){var a=u.find(".preloader"),c=w.find("#megacal-event-form");a.removeClass("hidden"),c.html(""),C(),m(null,function(e){if(0==e.success)return S(),void I(e.data.message,"error");a.addClass("hidden"),w.html(e.data.content);w.find("#megacal-event-form"),w.find(".megacal-button-save-event");g(n.date),y()},function(){S(),I(t,"error")})}).on("eventcalendar.calendarviewchange",function(e,t){R=t.date,b(D,t.date)}).on("eventcalendar.eventclick",function(e,n){if(n.createdByMe){var a=n.eventId,c=u.find(".preloader"),o=w.find("#megacal-event-form");c.removeClass("hidden"),o.html(""),C(),m(a,function(e){var t=u.find(".preloader");if(0==e.success)return S(),void I(e.data.message,"error");t.addClass("hidden"),w.html(e.data.content);w.find("#megacal-event-form"),w.find(".megacal-button-save-event");g(),y()},function(){S(),I(t,"error")})}}),b(D,R),k()}if(e(".megacal-manage-relationships-page").length>0){var M=!1;e(window).on("load",function(){window.addEventListener("beforeunload",function(e){if(M){return(e||window.event).returnValue="Changes you made on this page may not be saved","Changes you made on this page may not be saved"}})}),e(".megacal-relationship-edit-btn").on("click",function(t){t.preventDefault(),M=!0;var n,a=e(this),c=a.closest(".megacal-manage-relationship-form");c.find("input, textarea").each(function(){e(this).prop("readonly",!1),e(this).prop("disabled",!1),"name"==e(this).attr("name")&&(n=e(this))}),n&&n.focus(),c.find(".megacal-relationship-save-btn").prop("disabled",!1),a.prop("disabled",!0)}),e(".megacal-manage-relationship-form").on("submit",function(n){n.preventDefault();var a=e(this),c=e("#megacal_update_relationships_nonce").val(),o=a[0],r=new FormData(o),i=r.get("type"),s=a.find("input, textarea");a.find(".megacal-relationship-save-btn").prop("disabled",!0);var l={name:r.get("name"),published:r.get("published"),_nonce:c,action:"megacal_update_"+i+"_details"};l[i+"_id"]=r.get("id"),"venue"===i&&(l.location=r.get("location")),e.post(megacal_admin_script_opts.ajax_url,l,function(t){S(),a.find(".megacal-relationship-save-btn").prop("disabled",!0),a.find(".megacal-relationship-edit-btn").prop("disabled",!1),0!=t.success?(M=!1,s.each(function(){"checkbox"===e(this).attr("type")?e(this).prop("disabled",!0):e(this).prop("readonly",!0)})):I(t.data.message,"error")}).fail(function(){S(),I(t,"error"),a.find(".megacal-relationship-save-btn").prop("disabled",!1)})})}var x=e("#alert-notice"),T="";function I(t,n){T=n+"-notice",x.addClass(T),x.find(".alert-notice-inner").html("<p>"+t+"</p>"),x.removeClass("hidden"),e("html, body").animate({scrollTop:0})}function S(){x.addClass("hidden"),x.removeClass(T),x.find(".alert-notice-inner").html("")}x.find(".alert-notice-close").on("click",function(e){e.preventDefault(),S()}),c({event_type:"change",field_selector:"#megacal-events-settings-sc #themeSelect",shortcode_att:"theme",output_selector:"#megacal-events-settings-sc .shortcode",handler:"val"}),c({event_type:"change",field_selector:"#megacal-events-settings-sc #buttonPositions",shortcode_att:"buttons",output_selector:"#megacal-events-settings-sc .shortcode",handler:"val"}),c({event_type:"change",field_selector:"#megacal-events-settings-sc #showDesc",shortcode_att:"descrip",output_selector:"#megacal-events-settings-sc .shortcode",handler:"checked"}),c({event_type:"change",field_selector:"#megacal-events-settings-sc #displyImgs",shortcode_att:"display",output_selector:"#megacal-events-settings-sc .shortcode",handler:function(e,t,n){return o(e,n.prop("checked")?"img":"text",t)}}),c({event_type:"change",field_selector:"#megacal-events-settings-sc #defaultView",shortcode_att:"view",output_selector:"#megacal-events-settings-sc .shortcode",handler:"val"}),c({event_type:"change",field_selector:"#megacal-events-settings-sc #hideView",shortcode_att:"hideview",output_selector:"#megacal-events-settings-sc .shortcode",handler:"checked"}),c({event_type:"change",field_selector:"#megacal-events-settings-sc #listStyleSelect",shortcode_att:"style",output_selector:"#megacal-events-settings-sc .shortcode",handler:"val"}),c({event_type:"change",field_selector:"#megacal-events-settings-sc #filterCal",shortcode_att:"eventOwner",output_selector:"#megacal-events-settings-sc .shortcode",handler:function(e,t,n){var a;return o(e,0==(a=n.val())?"":a,t)}}),c({event_type:"change",field_selector:"#megacal-events-settings-sc #filterCat",shortcode_att:"category",output_selector:"#megacal-events-settings-sc .shortcode",handler:function(e,t,n){var a;return o(e,0==(a=n.val())?"":a,t)}}),c({event_type:"change",field_selector:"#megacal-events-settings-sc #imgHeight",shortcode_att:"imgHeight",output_selector:"#megacal-events-settings-sc .shortcode",handler:"val"}),c({event_type:"change",field_selector:"#megacal-events-settings-sc #showFilters",shortcode_att:"showfilters",output_selector:"#megacal-events-settings-sc .shortcode",handler:"checked"});var U=e("#megacal-insert-shortcode");if(U.length>0){U.on("click",function(e){e.preventDefault(),tb_show("MegaCal Shortcode Options",ajax_shortcode_options.url)}),n.on("click","#megacal-events-settings-sc .insertShortcode",function(t){t.preventDefault();var n=e(this).data("target-class");if(void 0!==n)if(""!=n){var a=e(n="."+n);if(a.length>0){var c=a.val();wp.media.editor.insert(c),tb_remove()}}else console.error("target cannot be empty");else console.error("no target shortcode field supplied")});var Y=e("#megacal-events-settings").length>0;new MutationObserver(function(t){var n=e("#megacal-events-settings");n.length<=0&&Y?Y=!1:n.length>0&&(Y||(a("#megacal-events-settings"),e("#TB_ajaxContent").css({width:"100%",height:"100%",padding:0}),e("#TB_window").css({overflow:"auto"})),Y=!0)}).observe(document.body,{childList:!0})}e(document).on("click",".mega-collapsable-toggle",function(){var t=e(this),n=t.next(".mega-collapsable");n.hasClass("collapsed")?(t.find(".icon-chevron-right").removeClass("icon-chevron-right").addClass("icon-chevron-down"),t.attr("aria-pressed",!0),n.slideDown(300,function(){n.removeClass("collapsed")})):(t.find(".icon-chevron-down").removeClass("icon-chevron-down").addClass("icon-chevron-right"),t.attr("aria-pressed",!1),n.slideUp(300,function(){n.addClass("collapsed")}))})}),e(document).on("keyup",".mega-collapsable-toggle",function(t){"Enter"===t.key&&e(this).trigger("click")})}(jQuery);
     20"use strict";function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}!function(e){var t='Please <a href="#" class="page-refresh-btn">refresh</a> the page. If you see this message again, please contact [email protected].',n=e(document);function a(t){var n=e(t).find("ul.tabs");n.length<=0||n.hasClass("tabs-init")||(n.addClass("tabs-init"),n.each(function(){var t,n,a=e(this).find("a");(t=e(a.filter('[href="'+location.hash+'"]')[0]||a[0])).addClass("current"),n=e(t[0].hash),a.not(t).each(function(){e(this.hash).hide()}),e(this).on("click","a",function(a){t.removeClass("current"),n.hide(),t=e(this),n=e(this.hash),t.addClass("current"),n.show(),a.preventDefault()})}))}function c(t){if("object"!=_typeof(t))return!1;if(void 0===t.event_type)return console.error("event_type is required by megacalShortcodeFieldUpdate"),!1;if(void 0===t.field_selector)return console.error("field_selector is required by megacalShortcodeFieldUpdate"),!1;if(void 0===t.shortcode_att)return console.error("shortcode_att is required by megacalShortcodeFieldUpdate"),!1;if(void 0===t.output_selector)return console.error("output_selector is required by megacalShortcodeFieldUpdate"),!1;t={event_type:t.event_type,field_selector:t.field_selector,shortcode_att:t.shortcode_att,output_selector:t.output_selector,handler:void 0===t.handler?"val":t.handler,callback:void 0===t.callback?null:t.callback};n.on(t.event_type,t.field_selector,function(n){var a=e(t.output_selector),c=a.val(),r=c;"function"==typeof t.handler?r=t.handler(t.shortcode_att,c,e(this)):"string"==typeof t.handler&&(r=function(e,t,n,a){return"val"!=e&&"checked"!=e?n:("val"==e?c=a.val():"checked"==e&&(c=a.prop("checked")),o(t,c,n));var c}(t.handler,t.shortcode_att,c,e(this))),"function"==typeof t.callback&&t.callback(r),a.val(r)})}function o(e,t,n){var a=n.length,c=a-1,o=new RegExp("\\s"+e+'="[^"]*"',"g");return n.indexOf(" "+e)>0&&""!=t?n.replace(o," "+e+'="'+t+'"'):""!=t?n.substring(0,c)+" "+e+'="'+t+'"'+n.substring(a-1):n.replace(o,"")}function r(t,n){var a=t.find(".required"),c=!0;a.each(function(){var t=e(this);t.val()?t.hasClass("select2-hidden-accessible")?t.next(".select2-container").removeClass("invalid"):t.removeClass("invalid"):(t.hasClass("select2-hidden-accessible")?(t.next(".select2-container").removeClass("valid"),t.next(".select2-container").addClass("invalid")):(t.removeClass("valid"),t.addClass("invalid")),c=!1)}),c?n.prop("disabled",!1):n.prop("disabled",!0)}n.ready(function(){var i=e("#megacal-register-form"),s=e("#megacal-register-handle"),l=e("#megacal-check-handle-button"),d=e(".megacal-register-button");n.on("click",".page-refresh-btn",function(e){e.preventDefault(),window.location.href=window.location.href}),a(document),n.on("click","#megacal-events-settings-sc .copyToClipboard",function(t){t.preventDefault(),e(".shortcode").select();try{document.execCommand("copy")?e(".copySuccess").fadeIn().delay(200).fadeOut():e(".copyFail").fadeIn().delay(200).fadeOut()}catch(t){console.error(t),e(".copyFail").fadeIn().delay(200).fadeOut()}}),e("#megacal-show-tokens").on("click",function(t){t.preventDefault(),e("#megacal_access_token").attr("type","text").closest("tr.hidden").addClass("megacal-row").removeClass("hidden"),e("#megacal_refresh_token").attr("type","text").closest("tr.hidden").addClass("megacal-row").removeClass("hidden")}),e("#megacal-reset-account").on("click",function(t){if(t.preventDefault(),!window.confirm("Do you really want to unlink your MegaCalendar account from this site? (You will lose your existing Events)"))return!1;var n=e("#_megacal_unlink_account_nonce").val();window.location=megacal_admin_script_opts.settings_url+"&unlink=true&nonce="+n}),s.on("keyup",function(){e(this).val()?l.prop("disabled",!1):l.prop("disabled",!0)}),l.on("click",function(t){t.preventDefault();var n={action:"megacal_check_handle",handle:s.val(),_nonce:e("#_megacal_check_handle_nonce").val()};e.post(megacal_admin_script_opts.ajax_url,n,function(e){if(0==e.success)return S(),void I(e.data.message,"error");1==e.data.unique?(s.removeClass("invalid"),s.addClass("valid")):(s.removeClass("valid"),s.addClass("invalid"))}).fail(function(){S(),I("Something isn't right...","error")})}),e("#megacal-register-form input").on("keyup",function(){r(i,d)}),i.on("submit",function(n){n.preventDefault();var a=e(this)[0],c=new FormData(a);if(c.get("firstname"))if(c.get("lastname"))if(c.get("handle"))if(c.get("email"))if(c.get("calendarName")){var o=c.get("firstname"),r=c.get("lastname"),i=c.get("handle"),s=c.get("email"),l=c.get("calendarName"),d=c.get("phone"),u={action:"megacal_register",_nonce:c.get("_megacal_register_nonce"),firstname:o,lastname:r,handle:i,email:s,calendarName:l,phone:d};e.post(megacal_admin_script_opts.ajax_url,u,function(e){if(0==e.success)return S(),void I(e.data.message,"error");window.location=megacal_admin_script_opts.upgrade_url}).fail(function(){S(),I(t,"error")})}else alert("calendarName cannot be empty");else alert("email cannot be empty");else alert("handle cannot be empty");else alert("lastname cannot be empty");else alert("firstname cannot be empty")});var u=e("#megacal-manage-events");if(u.length>0){var v=function(n,a){var c=a.closest(".approval-notice"),o=c.data("event-id"),r=c.data("user-id"),i={action:"megacal_set_event_approval",_nonce:e("#_megacal_set_event_approval_nonce").val(),approvalAction:n};switch(n){case"approve":case"deny":i.userId=r,i.eventId=o;break;case"always":case"approve_pending":case"deny_pending":i.userId=r}e.post(megacal_admin_script_opts.ajax_url,i,function(t){if(0==t.success)return S(),void I(t.data.message,"error");c.fadeOut(200,function(){e(this).remove(),k()}),D.eventCalendar("refresh")}).fail(function(){S(),I(t,"error")})},m=function(t,n,a){var c={action:"megacal_get_event_upsert",_nonce:e("#_megacal_get_event_upsert_nonce").val()};null!==(t=t||null)&&(c.eventId=t),e.post(megacal_admin_script_opts.ajax_url,c,n).fail(a)},g=function(n){var a=e("#megacal-event-form"),c=e(".megacal-button-save-event"),o=e(".megacal-button-delete-event"),i=e("#megacal-all-day"),s=e("#megacal-event-start-time"),l=e("#megacal-event-end-time"),d=e("#megacal-event-date"),u=e("#megacal-upload-event-img"),v=e("#megacal-remove-event-img"),m=e("#megacal-event-img"),g=e("#megacal-img-preview"),y=e("#megacal-event-venue-name"),C=e("#megacal-event-venue-id"),b=e("#megacal-event-category-name"),k=e("#megacal-event-category-id"),R=e("#megacal-event-venue-location"),O=e(".megacal-button-cancel-edit-event"),M=e(".megacal-button-cancel-save-delete"),x=!!n&&new Date(n),T=e(".timepicker"),U=e("#megacal-event-recurrence-details").val(),Y=null;""!==U.trim()&&(Y=JSON.parse(U)),x&&(fmtDate=new Intl.DateTimeFormat("en-US",{month:"2-digit",day:"2-digit",year:"numeric"}).format(x),d.val(fmtDate)),O.on("click",function(e){w.fadeOut(500)}),M.on("click",function(e){f()}),o.on("click",function(n){if(!E&&!window.confirm("Are you sure you want to permanently delete this event?"))return;if(!Y||E){var c={action:"megacal_delete_event",_nonce:e("#submitdiv").find("#_megacal_delete_event_nonce").val(),eventId:a.find("#megacal-event-id").val(),eventChangeType:new FormData(a[0]).get("eventChangeType")};e.post(megacal_admin_script_opts.ajax_url,c,function(e){if(0==e.success)return S(),void I(e.data.message,"error");w.fadeOut(500,function(){D.eventCalendar("refresh")})}).fail(function(){S(),I(t,"error")}).done(function(){f()})}else p("delete")}),d.datepicker({format:"mm/dd/yyyy",todayHighlight:!0,autoclose:!0}).datepicker("update"),d.on("change",function(){r(a,c),_()}),T.each(function(){var t=e(this).val();e(this).wickedpicker({now:t||"12:00",minutesInterval:5,clearable:!0}),t||e(this).val("")}),y.select2({placeholder:"Tag or Add a Venue",tags:!0,allowClear:!0,createTag:function(t){var n=!1;if(y.find("option").each(function(){e.trim(t.term).toUpperCase()===e.trim(e(this).text()).toUpperCase()&&(n=!0)}),!n)return e.isNumeric(t.term)?{}:{id:t.term,text:t.term+" (new)",isNew:!0}},language:{noResults:function(e){return"Type to add a venue."}}}),y.on("change",function(){var t=e(this).val(),n=e(this).find('option[value="'+t+'"]').data("location");e.isNumeric(t)?(C.val(t),R.val(n).prop("disabled",!0)):(C.val(""),R.val("").prop("disabled",!1)),r(a,c)}),b.select2({placeholder:"Tag or Add an Event Category",tags:!0,createTag:function(t){var n=!1;if(b.find("option").each(function(){e.trim(t.term).toUpperCase()===e.trim(e(this).text()).toUpperCase()&&(n=!0)}),!n)return e.isNumeric(t.term)?{}:{id:t.term,text:t.term+" (new)",isNew:!0}},language:{noResults:function(e){return"No Existing Categories Found"}}}),b.on("change",function(){var t=e(this).val();e.isNumeric(t)?k.val(t):k.val(""),r(a,c)}),e("#megacal-event-form input").on("keyup",function(){r(a,c)}),i.prop("checked")&&(s.hide().removeClass("required"),l.hide().removeClass("required")),i.on("change",function(){e(this).prop("checked")?(s.hide().removeClass("required"),l.hide().removeClass("required")):(s.show().addClass("required"),l.show().addClass("required")),r(a,c)}),a.find("input").on("blur, focus",function(){r(a,c)}),a.on("submit",function(t){t.preventDefault(),tinyMCE&&tinyMCE.triggerSave();var n=e(this)[0],a=new FormData(n);Y&&!E?p("update"):h(a)}),u.on("click",function(e){e.preventDefault(),r(a,c),customUploader=wp.media({title:"Upload Event Image",library:{type:"image"},button:{text:"Use this image"},multiple:!1}).on("select",function(){var e=customUploader.state().get("selection").first().toJSON();u.hide(),g.attr("src",e.url).show(),v.show(),m.val(e.url)}).open()}),v.on("click",function(e){e.preventDefault(),r(a,c),g.hide(),v.hide(),u.show(),m.val("")}),_(Y)},p=function(t){var n=e("#megacal-change-type-modal");n.show(),e("#megacal-admin-mask").show(),"update"===t?(e("#megacal-change-type-this").prop("checked",!0),e("#megacal-change-type-options").show(),n.find(".megacal-button-delete-event").hide(),n.find(".megacal-button-save-event").show(),n.find("#megacal-change-type-this").focus()):"delete"===t&&(e("#megacal-delete-type-this").prop("checked",!0),e("#megacal-delete-type-options").show(),n.find(".megacal-button-delete-event").show(),n.find(".megacal-button-save-event").hide(),n.find("#megacal-delete-type-this").focus()),E=!0},f=function(){e("#megacal-change-type-modal").hide(),e("#megacal-admin-mask").hide(),e("#megacal-change-type-options").hide(),e("#megacal-delete-type-options").hide(),e(".megacal-button-save-event").focus(),E=!1},h=function(n){var a=n.get("_megacal_event_upsert_nonce"),c=n.get("eventId"),o=n.get("eventTitle"),r=n.get("eventDate"),i=n.get("eventAllDay"),s=n.get("eventStartTime"),l=n.get("eventEndTime"),d=n.get("eventImg"),u=n.get("eventVenueId"),v=n.get("eventVenueName"),m=n.get("eventVenueLocation"),g=n.get("eventCatId"),p=n.get("eventCatName"),h=n.get("megacal-event-organizer"),_=n.get("eventFacebookUrl"),y=n.get("eventTicketUrl"),C=n.get("eventPrice"),b=n.getAll("eventTaggedUsers"),k=n.get("eventTaggedUsersExtra"),R=n.get("megacal-event-description"),O=n.get("megacal-event-private-notes"),M=n.get("publishEvent"),x=n.get("eventRecurrence"),T=n.get("eventRecurrenceRepetition"),U=n.get("eventRecurrenceCustomType"),Y=n.get("eventRecurrenceCustomMonthlyFreq"),F=n.getAll("eventRecurrenceWeeklyDays"),N=n.get("eventRecurrenceEnd"),q=n.get("eventRecurrenceEndDate"),j=n.get("eventRecurrenceEndOccurrence"),W=n.get("eventRecurrenceDayOfWeek"),L=n.get("eventRecurrenceWeekOfMonth"),A=n.get("eventRecurrenceLastDayOfWeek"),V=n.get("eventRecurrenceDayOfMonth"),P=n.get("eventRecurrenceMonth"),H=n.get("eventChangeType"),B={action:"megacal_save_event",_nonce:a,eventId:c,eventTitle:o,eventDate:r,eventAllDay:i,eventStartTime:s,eventEndTime:l,eventImg:d,eventVenueId:u,eventVenueName:v,eventVenueLocation:m,eventCatId:g,eventCatName:p,eventOrganizer:h,eventFacebookUrl:_,eventTicketUrl:y,eventPrice:C,eventTaggedUsers:b,eventTaggedUsersExtra:k,megacalEventDescription:R,megacalEventPrivateNotes:O,published:M,eventRecurrence:x,eventRecurrenceRepetition:T,eventRecurrenceCustomType:U,eventRecurrenceCustomMonthlyFreq:Y,eventRecurrenceWeeklyDays:F,eventRecurrenceEnd:N,eventRecurrenceEndDate:q,eventRecurrenceEndOccurrence:j,eventRecurrenceDayOfWeek:W,eventRecurrenceWeekOfMonth:L,eventRecurrenceLastDayOfWeek:A,eventRecurrenceDayOfMonth:V,eventRecurrenceMonth:P,eventChangeType:H};e.post(megacal_admin_script_opts.ajax_url,B,function(t){if(0==t.success)return S(),void I(t.data.message,"error");if(w.fadeOut(500),D.eventCalendar("refresh"),""==u){var n={action:"megacal_get_event_upsert",_nonce:e("#_megacal_get_event_upsert_nonce").val(),eventId:t.data.eventId};e.post(megacal_admin_script_opts.ajax_url,n,function(e){if(0==e.success)return S(),void I(e.data.message,"error")})}}).fail(function(){S(),I(t,"error"),E=!1}).done(function(){f()})},_=function n(a){var c=e(".megacal-event-recurrence-container"),o=c.find("#eventRecurrenceSelect"),i=!!o&&o.val(),s=c.find(".eventRecurrenceEnd:checked"),l=!!s&&s.val(),d=e("#eventRecurrenceCustomType"),u=!!d&&d.val(),v=e("#megacal-event-date").val(),m=e("#megacal-event-id").val().trim()?parseInt(e("#megacal-event-id").val().trim()):0,g=e(".megacal-ends-details-container"),p=g.length>0&&!g.hasClass("collapsed"),f=!0;!a&&m>0&&(f=!1),a&&(i=a.type,"CUSTOM"===a.type&&(u=a.custom.type||u,l=a.custom.end_condition||l));var h=e("#_megacal_event_recurrence_nonce").val();e.post(megacal_admin_script_opts.ajax_url,{action:"megacal_get_event_recurrence",_nonce:h,date:v||null,showRecurrence:f},function(t){if(0==t.success)return S(),void I(t.data.message,"error");c.html(t.data.content);var o=t.data.recurrence_details;if(o){var r=e("#eventRecurrenceRepetition"),s=e("#eventRecurrenceEndDate"),d=e("#eventRecurrenceEndOccurrence"),v=e("#eventRecurrenceCustomType"),m=e("#eventRecurrenceCustomMonthlyFreq"),g=e("#eventRecurrenceWeeklyDays"),f=c.find("#eventRecurrenceSelect"),h=c.find(".megacal-custom-recurrence-details");if(i&&(f.val(i),"CUSTOM"===i&&h.show()),l&&c.find('.eventRecurrenceEnd[value="'+l+'"]').prop("checked",!0),u&&v.val(u),"CUSTOM"===f.val()&&e(".megacal-custom-recurrence-details").removeClass("hidden"),v.length<1)return;var _=v.val().toLowerCase(),y=o.custom,C=y[_+"_custom"],b=moment(C.end_condition.on,"YYYY-MM-DD").format("MM/DD/YYYY"),k=C.end_condition.after_occurrence,w=y.repetition;if(a&&a.custom){var D=a.custom[_+"_custom"]||a.custom;if(w=a.custom.repetition||w,D.repeat_on&&(e(".eventRecurrenceWeeklyDays").prop("checked",!1),e(".eventRecurrenceWeeklyDays").each(function(){var t=e(this);D.repeat_on.indexOf(t.val())>-1&&e(this).prop("checked",!0)})),D.day_of_week){var R=D.week_of_month;e("#eventRecurrenceCustomMonthlyFreq").val("week_of_month-"+R)}a.custom.end_condition&&(a.custom.end_condition.on?(b=moment(a.custom.end_condition.on,"YYYY-MM-DD").format("MM/DD/YYYY"),p=!0,c.find("#eventRecurrenceEndDateOp").prop("checked",!0)):a.custom.end_condition.after_occurrence>0&&(k=a.custom.end_condition.after_occurrence,p=!0,c.find("#eventRecurrenceEndOccurrenceOp").prop("checked",!0)))}if(r.val(w),s.val(b),d.val(k),p){var E=c.find(".megacal-ends-details-container");c.find(".collapsable-toggle").find(".icon-chevron-right").removeClass("icon-chevron-right").addClass("icon-chevron-down"),E.removeClass("collapsed")}f.on("change",function(){"CUSTOM"===e(this).val()?h.slideDown():h.slideUp()}),"WEEKLY"===v.val()?g.removeClass("hidden"):"MONTHLY"===v.val()&&m.removeClass("hidden"),v.on("change",function(){n()}),c.find("#eventRecurrenceEndDate").datepicker({format:"mm/dd/yyyy",todayHighlight:!0,autoclose:!0}).datepicker("update"),e("#eventRecurrenceEndOccurrence").on("click",function(){e("#eventRecurrenceEndOccurrenceOp").prop("checked",!0)}),e("#eventRecurrenceEndDate").on("click",function(){e("#eventRecurrenceEndDateOp").prop("checked",!0)}),e(".eventRecurrenceWeeklyDays").on("click",function(){var t,n=e(".eventRecurrenceWeeklyDays"),a=y.weekly_custom.selected_day_of_week,c=!0;n.each(function(){!0===e(this).prop("checked")&&(c=!1),e(this).val()===a&&(t=e(this))}),c&&t.prop("checked",!0)})}}).fail(function(){S(),I(t,"error")}).done(function(){r(e("#megacal-event-form"),e(".megacal-button-save-event"))})},y=function(){if(tinyMCE){var t=e("#megacal-event-form"),n=e(".megacal-button-save-event");w.find(".wp-editor-area").each(function(){var a=e(this).attr("id");tinyMCEPreInit.mceInit[a].setup=function(e){e.on("keyup",function(){r(t,n)})},tinyMCE.init(tinyMCEPreInit.mceInit[a]),tinyMCE.execCommand("mceRemoveEditor",!1,a),tinyMCE.execCommand("mceAddEditor",!1,a),quicktags({id:a})})}},C=function(){w.fadeIn(500,function(){e("#megacal-event-title").focus()})},b=function(t,n){var a=moment(n).hours(0).minutes(0).seconds(0).milliseconds(0),c=a.clone().startOf("month").startOf("week").format("YYYY-MM-DD"),o=a.clone().endOf("month").endOf("week").format("YYYY-MM-DD"),r=e("#_megacal_fetch_events_nonce").val(),i=e("#megacal-manage-filter-form"),s=new FormData(i[0]).getAll("megacalFilterCategories");t.eventCalendar("showLoader");var l={action:"megacal_fetch_calendar_events",_nonce:r,startDate:c,endDate:o,eventCategories:s};e.post(megacal_admin_script_opts.ajax_url,l,function(e){if(0==e.success)return S(),void I(e.data.message,"error");t.eventCalendar("option","events",{events:e.data.events})}).fail(function(){}).done(function(){t.eventCalendar("hideLoader")})},k=function(){var n={action:"megacal_get_approval_list",_nonce:e("#megacal_get_approval_list_nonce").val()};e.post(megacal_admin_script_opts.ajax_url,n,function(t){if(0==t.success)return S(),void I(t.data.message,"error");O.html(t.data.content),e(".button-approval-action").on("click",function(t){t.preventDefault(),v(e(this).data("action"),e(this))})}).fail(function(){S(),I(t,"error")})},w=e("#save-event-wrap"),D=e("#megacal-manage-calendar"),R=new Date,E=!1,O=e("#megacal-approval-list");e(".megacal-filter-cat-btn").on("change",function(){D.eventCalendar("refresh")}),D.eventCalendar({showImage:!1,showLegends:!0,showOwners:!0,timeFormat:megacal_admin_script_opts.time_fmt_setting,dateFormat:{calendar:"D",calendarFirst:"MMM D"},showSlider:!1,loaderImageUrl:megacal_admin_script_opts.base_url+"/assets/img/loading.svg",defaultEventImageUrl:megacal_admin_script_opts.default_image_path,calendarCreate:function(e,t){}}).on("eventcalendar.calendaraddevent",function(e,n){var a=u.find(".preloader"),c=w.find("#megacal-event-form");a.removeClass("hidden"),c.html(""),C(),m(null,function(e){if(0==e.success)return S(),void I(e.data.message,"error");a.addClass("hidden"),w.html(e.data.content);w.find("#megacal-event-form"),w.find(".megacal-button-save-event");g(n.date),y()},function(){S(),I(t,"error")})}).on("eventcalendar.calendarviewchange",function(e,t){R=t.date,b(D,t.date)}).on("eventcalendar.eventclick",function(e,n){if(n.createdByMe){var a=n.eventId,c=u.find(".preloader"),o=w.find("#megacal-event-form");c.removeClass("hidden"),o.html(""),C(),m(a,function(e){var t=u.find(".preloader");if(0==e.success)return S(),void I(e.data.message,"error");t.addClass("hidden"),w.html(e.data.content);w.find("#megacal-event-form"),w.find(".megacal-button-save-event");g(),y()},function(){S(),I(t,"error")})}}),b(D,R),k()}if(e(".megacal-manage-relationships-page").length>0){var M=!1;e(window).on("load",function(){window.addEventListener("beforeunload",function(e){if(M){return(e||window.event).returnValue="Changes you made on this page may not be saved","Changes you made on this page may not be saved"}})}),e(".megacal-relationship-edit-btn").on("click",function(t){t.preventDefault(),M=!0;var n,a=e(this),c=a.closest(".megacal-manage-relationship-form");c.find("input, textarea").each(function(){e(this).prop("readonly",!1),e(this).prop("disabled",!1),"name"==e(this).attr("name")&&(n=e(this))}),n&&n.focus(),c.find(".megacal-relationship-save-btn").prop("disabled",!1),a.prop("disabled",!0)}),e(".megacal-manage-relationship-form").on("submit",function(n){n.preventDefault();var a=e(this),c=e("#megacal_update_relationships_nonce").val(),o=a[0],r=new FormData(o),i=r.get("type"),s=a.find("input, textarea");a.find(".megacal-relationship-save-btn").prop("disabled",!0);var l={name:r.get("name"),published:r.get("published"),_nonce:c,action:"megacal_update_"+i+"_details"};l[i+"_id"]=r.get("id"),"venue"===i&&(l.location=r.get("location")),e.post(megacal_admin_script_opts.ajax_url,l,function(t){S(),a.find(".megacal-relationship-save-btn").prop("disabled",!0),a.find(".megacal-relationship-edit-btn").prop("disabled",!1),0!=t.success?(M=!1,s.each(function(){"checkbox"===e(this).attr("type")?e(this).prop("disabled",!0):e(this).prop("readonly",!0)})):I(t.data.message,"error")}).fail(function(){S(),I(t,"error"),a.find(".megacal-relationship-save-btn").prop("disabled",!1)})})}var x=e("#alert-notice"),T="";function I(t,n){T=n+"-notice",x.addClass(T),x.find(".alert-notice-inner").html("<p>"+t+"</p>"),x.removeClass("hidden"),e("html, body").animate({scrollTop:0})}function S(){x.addClass("hidden"),x.removeClass(T),x.find(".alert-notice-inner").html("")}x.find(".alert-notice-close").on("click",function(e){e.preventDefault(),S()}),c({event_type:"change",field_selector:"#megacal-events-settings-sc #themeSelect",shortcode_att:"theme",output_selector:"#megacal-events-settings-sc .shortcode",handler:"val"}),c({event_type:"change",field_selector:"#megacal-events-settings-sc #buttonPositions",shortcode_att:"buttons",output_selector:"#megacal-events-settings-sc .shortcode",handler:"val"}),c({event_type:"change",field_selector:"#megacal-events-settings-sc #showDesc",shortcode_att:"descrip",output_selector:"#megacal-events-settings-sc .shortcode",handler:"checked"}),c({event_type:"change",field_selector:"#megacal-events-settings-sc #displyImgs",shortcode_att:"display",output_selector:"#megacal-events-settings-sc .shortcode",handler:function(e,t,n){return o(e,n.prop("checked")?"img":"text",t)}}),c({event_type:"change",field_selector:"#megacal-events-settings-sc #defaultView",shortcode_att:"view",output_selector:"#megacal-events-settings-sc .shortcode",handler:"val"}),c({event_type:"change",field_selector:"#megacal-events-settings-sc #hideView",shortcode_att:"hideview",output_selector:"#megacal-events-settings-sc .shortcode",handler:"checked"}),c({event_type:"change",field_selector:"#megacal-events-settings-sc #listStyleSelect",shortcode_att:"style",output_selector:"#megacal-events-settings-sc .shortcode",handler:"val"}),c({event_type:"change",field_selector:"#megacal-events-settings-sc #filterCal",shortcode_att:"eventOwner",output_selector:"#megacal-events-settings-sc .shortcode",handler:function(e,t,n){var a;return o(e,0==(a=n.val())?"":a,t)}}),c({event_type:"change",field_selector:"#megacal-events-settings-sc #filterCat",shortcode_att:"category",output_selector:"#megacal-events-settings-sc .shortcode",handler:function(e,t,n){var a;return o(e,0==(a=n.val())?"":a,t)}}),c({event_type:"change",field_selector:"#megacal-events-settings-sc #imgHeight",shortcode_att:"imgHeight",output_selector:"#megacal-events-settings-sc .shortcode",handler:"val"}),c({event_type:"change",field_selector:"#megacal-events-settings-sc #showFilters",shortcode_att:"showfilters",output_selector:"#megacal-events-settings-sc .shortcode",handler:"checked"});var U=e("#megacal-insert-shortcode");if(U.length>0){U.on("click",function(e){e.preventDefault(),tb_show("MegaCal Shortcode Options",ajax_shortcode_options.url)}),n.on("click","#megacal-events-settings-sc .insertShortcode",function(t){t.preventDefault();var n=e(this).data("target-class");if(void 0!==n)if(""!=n){var a=e(n="."+n);if(a.length>0){var c=a.val();wp.media.editor.insert(c),tb_remove()}}else console.error("target cannot be empty");else console.error("no target shortcode field supplied")});var Y=e("#megacal-events-settings").length>0;new MutationObserver(function(t){var n=e("#megacal-events-settings");n.length<=0&&Y?Y=!1:n.length>0&&(Y||(a("#megacal-events-settings"),e("#TB_ajaxContent").css({width:"100%",height:"100%",padding:0}),e("#TB_window").css({overflow:"auto"})),Y=!0)}).observe(document.body,{childList:!0})}e(document).on("click",".mega-collapsable-toggle",function(){var t=e(this),n=t.next(".mega-collapsable");n.hasClass("collapsed")?(t.find(".icon-chevron-right").removeClass("icon-chevron-right").addClass("icon-chevron-down"),t.attr("aria-pressed",!0),n.slideDown(300,function(){n.removeClass("collapsed")})):(t.find(".icon-chevron-down").removeClass("icon-chevron-down").addClass("icon-chevron-right"),t.attr("aria-pressed",!1),n.slideUp(300,function(){n.addClass("collapsed")}))})}),e(document).on("keyup",".mega-collapsable-toggle",function(t){"Enter"===t.key&&e(this).trigger("click")})}(jQuery);
  • megabase-calendar/trunk/assets/build/maps/admin.min.js.map

    r2927202 r2935728  
    1 {"version":3,"sources":["popper.min.js","rangeslider.min.js","bootstrap-datepicker.min.js","event-calendar.min.js","wickedpicker.min.js","select2.min.js","admin-scripts.js"],"names":["_typeof","obj","Symbol","iterator","constructor","prototype","$","GENERIC_ERROR_MSG","$document","document","setupAdminTabs","selector","tabs","find","length","hasClass","addClass","each","$active","$content","$links","this","filter","location","hash","not","hide","on","e","removeClass","show","preventDefault","megacalShortcodeFieldUpdate","opts","event_type","console","error","field_selector","shortcode_att","output_selector","handler","callback","$shortcode_field","shortcode","val","out","type","att","$element","prop","megacalReplaceShortcodeAtt","default_handler","shortcode_len","insert_index","regex","RegExp","indexOf","replace","substring","checkRequiredFields","$form","$submitBtn","required","allValid","$this","next","ready","$registerForm","$registerHandleField","$checkHandleBtn","$registerBtn","window","href","select","execCommand","fadeIn","delay","fadeOut","err","log","attr","closest","confirm","nonce","megacal_admin_script_opts","settings_url","check_handle_data","action","handle","_nonce","post","ajax_url","response","success","clearAlertNotification","showAlertNotification","data","message","unique","fail","form","formData","FormData","get","firstname","lastname","email","calendarName","phone","registerData","upgrade_url","alert","$manageEvents","setEventApproval","approvalAction","btn","approvalNotice","eventId","userId","putApprovalData","remove","loadApprovalList","$calendar","eventCalendar","loadEventForm","successCallback","failureCallback","eventUpsertData","registerEventFormActions","date","$eventForm","$eventSubmitBtn","$eventDeleteBtn","$allDayCheckbox","$startTimeField","$endTimeField","$dateField","$eventImgBtn","$eventRemoveBtn","$eventImgField","$imgPreview","$venueField","$venueIdField","$categoryField","$categoryIdField","$venueLocationField","$cancelBtn","$modalCancelBtn","startDate","Date","$timepicker","recurrence","recurrenceDetails","trim","JSON","parse","fmtDate","Intl","DateTimeFormat","month","day","year","format","$saveEventWrap","hideChangeTypeModal","changeTypeSelected","deleteEventData","eventChangeType","done","showChangeTypeModal","datepicker","todayHighlight","autoclose","fetchEventRecurrenceDetails","wickedpicker","now","minutesInterval","clearable","select2","placeholder","tags","allowClear","createTag","tag","found","term","toUpperCase","text","isNumeric","id","isNew","language","noResults","params","tinyMCE","triggerSave","saveEvent","customUploader","wp","media","title","library","button","multiple","attachment","state","first","toJSON","url","open","$modal","focus","eventTitle","eventDate","eventAllDay","eventStartTime","eventEndTime","eventImg","eventVenueId","eventVenueName","eventVenueLocation","eventCatId","eventCatName","eventOrganizer","eventFacebookUrl","eventTicketUrl","eventPrice","eventTaggedUsers","getAll","eventTaggedUsersExtra","megacalEventDescription","megacalEventPrivateNotes","published","eventRecurrence","eventRecurrenceRepetition","eventRecurrenceCustomType","eventRecurrenceCustomMonthlyFreq","eventRecurrenceWeeklyDays","eventRecurrenceEnd","eventRecurrenceEndDate","eventRecurrenceEndOccurrence","eventRecurrenceDayOfWeek","eventRecurrenceWeekOfMonth","eventRecurrenceLastDayOfWeek","eventRecurrenceDayOfMonth","eventRecurrenceMonth","saveEventData","$eventRecurrenceContainer","$select","selectVal","$radio","radioVal","$customRecurrenceTypeSelectOr","customRecurrenceTypeVal","parseInt","$endsDetailsContainer","endsExpanded","showRecurrence","custom","end_condition","html","content","recurrence_details","$eventRecurrenceRepetition","$eventRecurrenceEndDate","$eventRecurrenceEndOccurrence","$customRecurrenceTypeSelect","$customRecurrenceMonthlyFreq","$customRecurrenceWeeklyDays","$eventRecurrenceSelect","$customRecurrenceDetailsSection","customRecurrenceType","toLowerCase","customDetail","detailVals","fmtEndDate","moment","afterOccurrence","after_occurrence","repetition","repeat_on","day_of_week","weekOfMonth","week_of_month","$newEndsDetailsContainer","slideDown","slideUp","$selectedDayCB","$weeklyDaysCBs","defaultDay","weekly_custom","selected_day_of_week","allEmpty","initWYSIWYGFields","tinyMCEPreInit","mceInit","setup","ed","init","quicktags","showAddEventForm","loadCalendarView","$eventCalendar","aMoment","hours","minutes","seconds","milliseconds","clone","startOf","endDate","endOf","$filterForm","eventCategories","fetchEventsData","events","getApprovalListData","$approvalList","currDate","showImage","showLegends","showOwners","timeFormat","time_fmt_setting","dateFormat","calendar","calendarFirst","showSlider","loaderImageUrl","base_url","defaultEventImageUrl","default_image_path","calendarCreate","event","$preloader","createdByMe","isDirty","addEventListener","returnValue","$nameInput","$inputs","putRelationshipData","name","$alertNotice","alertState","msg","animate","scrollTop","ownerId","catId","$shortcode_btn","tb_show","ajax_shortcode_options","target","copyTextarea","editor","insert","tb_remove","in_dom","MutationObserver","mutations","$loaded_content","css","width","height","padding","overflow","observe","body","childList","$toggle","$collapsable","key","trigger","jQuery"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;ACLA;AACA;ACDA;AACA;AACA;A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BAA4B,SAAUC,GAC9C,UAAVA,EAAEwV,KACJ9W,EAAEe,MAAMgW,QAAQ,WAhyCtB,CAs6CGC","file":"../vendor/admin.min.js","sourcesContent":["/*\n Copyright (C) Federico Zivolo 2020\n Distributed under the MIT License (license terms are at http://opensource.org/licenses/MIT).\n */(function(e,t){'object'==typeof exports&&'undefined'!=typeof module?module.exports=t():'function'==typeof define&&define.amd?define(t):e.Popper=t()})(this,function(){'use strict';function e(e){return e&&'[object Function]'==={}.toString.call(e)}function t(e,t){if(1!==e.nodeType)return[];var o=e.ownerDocument.defaultView,n=o.getComputedStyle(e,null);return t?n[t]:n}function o(e){return'HTML'===e.nodeName?e:e.parentNode||e.host}function n(e){if(!e)return document.body;switch(e.nodeName){case'HTML':case'BODY':return e.ownerDocument.body;case'#document':return e.body;}var i=t(e),r=i.overflow,p=i.overflowX,s=i.overflowY;return /(auto|scroll|overlay)/.test(r+s+p)?e:n(o(e))}function i(e){return e&&e.referenceNode?e.referenceNode:e}function r(e){return 11===e?re:10===e?pe:re||pe}function p(e){if(!e)return document.documentElement;for(var o=r(10)?document.body:null,n=e.offsetParent||null;n===o&&e.nextElementSibling;)n=(e=e.nextElementSibling).offsetParent;var i=n&&n.nodeName;return i&&'BODY'!==i&&'HTML'!==i?-1!==['TH','TD','TABLE'].indexOf(n.nodeName)&&'static'===t(n,'position')?p(n):n:e?e.ownerDocument.documentElement:document.documentElement}function s(e){var t=e.nodeName;return'BODY'!==t&&('HTML'===t||p(e.firstElementChild)===e)}function d(e){return null===e.parentNode?e:d(e.parentNode)}function a(e,t){if(!e||!e.nodeType||!t||!t.nodeType)return document.documentElement;var o=e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING,n=o?e:t,i=o?t:e,r=document.createRange();r.setStart(n,0),r.setEnd(i,0);var l=r.commonAncestorContainer;if(e!==l&&t!==l||n.contains(i))return s(l)?l:p(l);var f=d(e);return f.host?a(f.host,t):a(e,d(t).host)}function l(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:'top',o='top'===t?'scrollTop':'scrollLeft',n=e.nodeName;if('BODY'===n||'HTML'===n){var i=e.ownerDocument.documentElement,r=e.ownerDocument.scrollingElement||i;return r[o]}return e[o]}function f(e,t){var o=2<arguments.length&&void 0!==arguments[2]&&arguments[2],n=l(t,'top'),i=l(t,'left'),r=o?-1:1;return e.top+=n*r,e.bottom+=n*r,e.left+=i*r,e.right+=i*r,e}function m(e,t){var o='x'===t?'Left':'Top',n='Left'==o?'Right':'Bottom';return parseFloat(e['border'+o+'Width'])+parseFloat(e['border'+n+'Width'])}function h(e,t,o,n){return ee(t['offset'+e],t['scroll'+e],o['client'+e],o['offset'+e],o['scroll'+e],r(10)?parseInt(o['offset'+e])+parseInt(n['margin'+('Height'===e?'Top':'Left')])+parseInt(n['margin'+('Height'===e?'Bottom':'Right')]):0)}function c(e){var t=e.body,o=e.documentElement,n=r(10)&&getComputedStyle(o);return{height:h('Height',t,o,n),width:h('Width',t,o,n)}}function g(e){return le({},e,{right:e.left+e.width,bottom:e.top+e.height})}function u(e){var o={};try{if(r(10)){o=e.getBoundingClientRect();var n=l(e,'top'),i=l(e,'left');o.top+=n,o.left+=i,o.bottom+=n,o.right+=i}else o=e.getBoundingClientRect()}catch(t){}var p={left:o.left,top:o.top,width:o.right-o.left,height:o.bottom-o.top},s='HTML'===e.nodeName?c(e.ownerDocument):{},d=s.width||e.clientWidth||p.width,a=s.height||e.clientHeight||p.height,f=e.offsetWidth-d,h=e.offsetHeight-a;if(f||h){var u=t(e);f-=m(u,'x'),h-=m(u,'y'),p.width-=f,p.height-=h}return g(p)}function b(e,o){var i=2<arguments.length&&void 0!==arguments[2]&&arguments[2],p=r(10),s='HTML'===o.nodeName,d=u(e),a=u(o),l=n(e),m=t(o),h=parseFloat(m.borderTopWidth),c=parseFloat(m.borderLeftWidth);i&&s&&(a.top=ee(a.top,0),a.left=ee(a.left,0));var b=g({top:d.top-a.top-h,left:d.left-a.left-c,width:d.width,height:d.height});if(b.marginTop=0,b.marginLeft=0,!p&&s){var w=parseFloat(m.marginTop),y=parseFloat(m.marginLeft);b.top-=h-w,b.bottom-=h-w,b.left-=c-y,b.right-=c-y,b.marginTop=w,b.marginLeft=y}return(p&&!i?o.contains(l):o===l&&'BODY'!==l.nodeName)&&(b=f(b,o)),b}function w(e){var t=1<arguments.length&&void 0!==arguments[1]&&arguments[1],o=e.ownerDocument.documentElement,n=b(e,o),i=ee(o.clientWidth,window.innerWidth||0),r=ee(o.clientHeight,window.innerHeight||0),p=t?0:l(o),s=t?0:l(o,'left'),d={top:p-n.top+n.marginTop,left:s-n.left+n.marginLeft,width:i,height:r};return g(d)}function y(e){var n=e.nodeName;if('BODY'===n||'HTML'===n)return!1;if('fixed'===t(e,'position'))return!0;var i=o(e);return!!i&&y(i)}function E(e){if(!e||!e.parentElement||r())return document.documentElement;for(var o=e.parentElement;o&&'none'===t(o,'transform');)o=o.parentElement;return o||document.documentElement}function v(e,t,r,p){var s=4<arguments.length&&void 0!==arguments[4]&&arguments[4],d={top:0,left:0},l=s?E(e):a(e,i(t));if('viewport'===p)d=w(l,s);else{var f;'scrollParent'===p?(f=n(o(t)),'BODY'===f.nodeName&&(f=e.ownerDocument.documentElement)):'window'===p?f=e.ownerDocument.documentElement:f=p;var m=b(f,l,s);if('HTML'===f.nodeName&&!y(l)){var h=c(e.ownerDocument),g=h.height,u=h.width;d.top+=m.top-m.marginTop,d.bottom=g+m.top,d.left+=m.left-m.marginLeft,d.right=u+m.left}else d=m}r=r||0;var v='number'==typeof r;return d.left+=v?r:r.left||0,d.top+=v?r:r.top||0,d.right-=v?r:r.right||0,d.bottom-=v?r:r.bottom||0,d}function x(e){var t=e.width,o=e.height;return t*o}function O(e,t,o,n,i){var r=5<arguments.length&&void 0!==arguments[5]?arguments[5]:0;if(-1===e.indexOf('auto'))return e;var p=v(o,n,r,i),s={top:{width:p.width,height:t.top-p.top},right:{width:p.right-t.right,height:p.height},bottom:{width:p.width,height:p.bottom-t.bottom},left:{width:t.left-p.left,height:p.height}},d=Object.keys(s).map(function(e){return le({key:e},s[e],{area:x(s[e])})}).sort(function(e,t){return t.area-e.area}),a=d.filter(function(e){var t=e.width,n=e.height;return t>=o.clientWidth&&n>=o.clientHeight}),l=0<a.length?a[0].key:d[0].key,f=e.split('-')[1];return l+(f?'-'+f:'')}function L(e,t,o){var n=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null,r=n?E(t):a(t,i(o));return b(o,r,n)}function S(e){var t=e.ownerDocument.defaultView,o=t.getComputedStyle(e),n=parseFloat(o.marginTop||0)+parseFloat(o.marginBottom||0),i=parseFloat(o.marginLeft||0)+parseFloat(o.marginRight||0),r={width:e.offsetWidth+i,height:e.offsetHeight+n};return r}function T(e){var t={left:'right',right:'left',bottom:'top',top:'bottom'};return e.replace(/left|right|bottom|top/g,function(e){return t[e]})}function C(e,t,o){o=o.split('-')[0];var n=S(e),i={width:n.width,height:n.height},r=-1!==['right','left'].indexOf(o),p=r?'top':'left',s=r?'left':'top',d=r?'height':'width',a=r?'width':'height';return i[p]=t[p]+t[d]/2-n[d]/2,i[s]=o===s?t[s]-n[a]:t[T(s)],i}function D(e,t){return Array.prototype.find?e.find(t):e.filter(t)[0]}function N(e,t,o){if(Array.prototype.findIndex)return e.findIndex(function(e){return e[t]===o});var n=D(e,function(e){return e[t]===o});return e.indexOf(n)}function P(t,o,n){var i=void 0===n?t:t.slice(0,N(t,'name',n));return i.forEach(function(t){t['function']&&console.warn('`modifier.function` is deprecated, use `modifier.fn`!');var n=t['function']||t.fn;t.enabled&&e(n)&&(o.offsets.popper=g(o.offsets.popper),o.offsets.reference=g(o.offsets.reference),o=n(o,t))}),o}function k(){if(!this.state.isDestroyed){var e={instance:this,styles:{},arrowStyles:{},attributes:{},flipped:!1,offsets:{}};e.offsets.reference=L(this.state,this.popper,this.reference,this.options.positionFixed),e.placement=O(this.options.placement,e.offsets.reference,this.popper,this.reference,this.options.modifiers.flip.boundariesElement,this.options.modifiers.flip.padding),e.originalPlacement=e.placement,e.positionFixed=this.options.positionFixed,e.offsets.popper=C(this.popper,e.offsets.reference,e.placement),e.offsets.popper.position=this.options.positionFixed?'fixed':'absolute',e=P(this.modifiers,e),this.state.isCreated?this.options.onUpdate(e):(this.state.isCreated=!0,this.options.onCreate(e))}}function W(e,t){return e.some(function(e){var o=e.name,n=e.enabled;return n&&o===t})}function B(e){for(var t=[!1,'ms','Webkit','Moz','O'],o=e.charAt(0).toUpperCase()+e.slice(1),n=0;n<t.length;n++){var i=t[n],r=i?''+i+o:e;if('undefined'!=typeof document.body.style[r])return r}return null}function H(){return this.state.isDestroyed=!0,W(this.modifiers,'applyStyle')&&(this.popper.removeAttribute('x-placement'),this.popper.style.position='',this.popper.style.top='',this.popper.style.left='',this.popper.style.right='',this.popper.style.bottom='',this.popper.style.willChange='',this.popper.style[B('transform')]=''),this.disableEventListeners(),this.options.removeOnDestroy&&this.popper.parentNode.removeChild(this.popper),this}function A(e){var t=e.ownerDocument;return t?t.defaultView:window}function M(e,t,o,i){var r='BODY'===e.nodeName,p=r?e.ownerDocument.defaultView:e;p.addEventListener(t,o,{passive:!0}),r||M(n(p.parentNode),t,o,i),i.push(p)}function F(e,t,o,i){o.updateBound=i,A(e).addEventListener('resize',o.updateBound,{passive:!0});var r=n(e);return M(r,'scroll',o.updateBound,o.scrollParents),o.scrollElement=r,o.eventsEnabled=!0,o}function I(){this.state.eventsEnabled||(this.state=F(this.reference,this.options,this.state,this.scheduleUpdate))}function R(e,t){return A(e).removeEventListener('resize',t.updateBound),t.scrollParents.forEach(function(e){e.removeEventListener('scroll',t.updateBound)}),t.updateBound=null,t.scrollParents=[],t.scrollElement=null,t.eventsEnabled=!1,t}function U(){this.state.eventsEnabled&&(cancelAnimationFrame(this.scheduleUpdate),this.state=R(this.reference,this.state))}function Y(e){return''!==e&&!isNaN(parseFloat(e))&&isFinite(e)}function V(e,t){Object.keys(t).forEach(function(o){var n='';-1!==['width','height','top','right','bottom','left'].indexOf(o)&&Y(t[o])&&(n='px'),e.style[o]=t[o]+n})}function j(e,t){Object.keys(t).forEach(function(o){var n=t[o];!1===n?e.removeAttribute(o):e.setAttribute(o,t[o])})}function q(e,t){var o=e.offsets,n=o.popper,i=o.reference,r=$,p=function(e){return e},s=r(i.width),d=r(n.width),a=-1!==['left','right'].indexOf(e.placement),l=-1!==e.placement.indexOf('-'),f=t?a||l||s%2==d%2?r:Z:p,m=t?r:p;return{left:f(1==s%2&&1==d%2&&!l&&t?n.left-1:n.left),top:m(n.top),bottom:m(n.bottom),right:f(n.right)}}function K(e,t,o){var n=D(e,function(e){var o=e.name;return o===t}),i=!!n&&e.some(function(e){return e.name===o&&e.enabled&&e.order<n.order});if(!i){var r='`'+t+'`';console.warn('`'+o+'`'+' modifier is required by '+r+' modifier in order to work, be sure to include it before '+r+'!')}return i}function z(e){return'end'===e?'start':'start'===e?'end':e}function G(e){var t=1<arguments.length&&void 0!==arguments[1]&&arguments[1],o=he.indexOf(e),n=he.slice(o+1).concat(he.slice(0,o));return t?n.reverse():n}function _(e,t,o,n){var i=e.match(/((?:\\-|\\+)?\\d*\\.?\\d*)(.*)/),r=+i[1],p=i[2];if(!r)return e;if(0===p.indexOf('%')){var s;switch(p){case'%p':s=o;break;case'%':case'%r':default:s=n;}var d=g(s);return d[t]/100*r}if('vh'===p||'vw'===p){var a;return a='vh'===p?ee(document.documentElement.clientHeight,window.innerHeight||0):ee(document.documentElement.clientWidth,window.innerWidth||0),a/100*r}return r}function X(e,t,o,n){var i=[0,0],r=-1!==['right','left'].indexOf(n),p=e.split(/(\\+|\\-)/).map(function(e){return e.trim()}),s=p.indexOf(D(p,function(e){return-1!==e.search(/,|\\s/)}));p[s]&&-1===p[s].indexOf(',')&&console.warn('Offsets separated by white space(s) are deprecated, use a comma (,) instead.');var d=/\\s*,\\s*|\\s+/,a=-1===s?[p]:[p.slice(0,s).concat([p[s].split(d)[0]]),[p[s].split(d)[1]].concat(p.slice(s+1))];return a=a.map(function(e,n){var i=(1===n?!r:r)?'height':'width',p=!1;return e.reduce(function(e,t){return''===e[e.length-1]&&-1!==['+','-'].indexOf(t)?(e[e.length-1]=t,p=!0,e):p?(e[e.length-1]+=t,p=!1,e):e.concat(t)},[]).map(function(e){return _(e,i,t,o)})}),a.forEach(function(e,t){e.forEach(function(o,n){Y(o)&&(i[t]+=o*('-'===e[n-1]?-1:1))})}),i}function J(e,t){var o,n=t.offset,i=e.placement,r=e.offsets,p=r.popper,s=r.reference,d=i.split('-')[0];return o=Y(+n)?[+n,0]:X(n,p,s,d),'left'===d?(p.top+=o[0],p.left-=o[1]):'right'===d?(p.top+=o[0],p.left+=o[1]):'top'===d?(p.left+=o[0],p.top-=o[1]):'bottom'===d&&(p.left+=o[0],p.top+=o[1]),e.popper=p,e}var Q=Math.min,Z=Math.floor,$=Math.round,ee=Math.max,te='undefined'!=typeof window&&'undefined'!=typeof document&&'undefined'!=typeof navigator,oe=function(){for(var e=['Edge','Trident','Firefox'],t=0;t<e.length;t+=1)if(te&&0<=navigator.userAgent.indexOf(e[t]))return 1;return 0}(),ne=te&&window.Promise,ie=ne?function(e){var t=!1;return function(){t||(t=!0,window.Promise.resolve().then(function(){t=!1,e()}))}}:function(e){var t=!1;return function(){t||(t=!0,setTimeout(function(){t=!1,e()},oe))}},re=te&&!!(window.MSInputMethodContext&&document.documentMode),pe=te&&/MSIE 10/.test(navigator.userAgent),se=function(e,t){if(!(e instanceof t))throw new TypeError('Cannot call a class as a function')},de=function(){function e(e,t){for(var o,n=0;n<t.length;n++)o=t[n],o.enumerable=o.enumerable||!1,o.configurable=!0,'value'in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}return function(t,o,n){return o&&e(t.prototype,o),n&&e(t,n),t}}(),ae=function(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e},le=Object.assign||function(e){for(var t,o=1;o<arguments.length;o++)for(var n in t=arguments[o],t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},fe=te&&/Firefox/i.test(navigator.userAgent),me=['auto-start','auto','auto-end','top-start','top','top-end','right-start','right','right-end','bottom-end','bottom','bottom-start','left-end','left','left-start'],he=me.slice(3),ce={FLIP:'flip',CLOCKWISE:'clockwise',COUNTERCLOCKWISE:'counterclockwise'},ge=function(){function t(o,n){var i=this,r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{};se(this,t),this.scheduleUpdate=function(){return requestAnimationFrame(i.update)},this.update=ie(this.update.bind(this)),this.options=le({},t.Defaults,r),this.state={isDestroyed:!1,isCreated:!1,scrollParents:[]},this.reference=o&&o.jquery?o[0]:o,this.popper=n&&n.jquery?n[0]:n,this.options.modifiers={},Object.keys(le({},t.Defaults.modifiers,r.modifiers)).forEach(function(e){i.options.modifiers[e]=le({},t.Defaults.modifiers[e]||{},r.modifiers?r.modifiers[e]:{})}),this.modifiers=Object.keys(this.options.modifiers).map(function(e){return le({name:e},i.options.modifiers[e])}).sort(function(e,t){return e.order-t.order}),this.modifiers.forEach(function(t){t.enabled&&e(t.onLoad)&&t.onLoad(i.reference,i.popper,i.options,t,i.state)}),this.update();var p=this.options.eventsEnabled;p&&this.enableEventListeners(),this.state.eventsEnabled=p}return de(t,[{key:'update',value:function(){return k.call(this)}},{key:'destroy',value:function(){return H.call(this)}},{key:'enableEventListeners',value:function(){return I.call(this)}},{key:'disableEventListeners',value:function(){return U.call(this)}}]),t}();return ge.Utils=('undefined'==typeof window?global:window).PopperUtils,ge.placements=me,ge.Defaults={placement:'bottom',positionFixed:!1,eventsEnabled:!0,removeOnDestroy:!1,onCreate:function(){},onUpdate:function(){},modifiers:{shift:{order:100,enabled:!0,fn:function(e){var t=e.placement,o=t.split('-')[0],n=t.split('-')[1];if(n){var i=e.offsets,r=i.reference,p=i.popper,s=-1!==['bottom','top'].indexOf(o),d=s?'left':'top',a=s?'width':'height',l={start:ae({},d,r[d]),end:ae({},d,r[d]+r[a]-p[a])};e.offsets.popper=le({},p,l[n])}return e}},offset:{order:200,enabled:!0,fn:J,offset:0},preventOverflow:{order:300,enabled:!0,fn:function(e,t){var o=t.boundariesElement||p(e.instance.popper);e.instance.reference===o&&(o=p(o));var n=B('transform'),i=e.instance.popper.style,r=i.top,s=i.left,d=i[n];i.top='',i.left='',i[n]='';var a=v(e.instance.popper,e.instance.reference,t.padding,o,e.positionFixed);i.top=r,i.left=s,i[n]=d,t.boundaries=a;var l=t.priority,f=e.offsets.popper,m={primary:function(e){var o=f[e];return f[e]<a[e]&&!t.escapeWithReference&&(o=ee(f[e],a[e])),ae({},e,o)},secondary:function(e){var o='right'===e?'left':'top',n=f[o];return f[e]>a[e]&&!t.escapeWithReference&&(n=Q(f[o],a[e]-('right'===e?f.width:f.height))),ae({},o,n)}};return l.forEach(function(e){var t=-1===['left','top'].indexOf(e)?'secondary':'primary';f=le({},f,m[t](e))}),e.offsets.popper=f,e},priority:['left','right','top','bottom'],padding:5,boundariesElement:'scrollParent'},keepTogether:{order:400,enabled:!0,fn:function(e){var t=e.offsets,o=t.popper,n=t.reference,i=e.placement.split('-')[0],r=Z,p=-1!==['top','bottom'].indexOf(i),s=p?'right':'bottom',d=p?'left':'top',a=p?'width':'height';return o[s]<r(n[d])&&(e.offsets.popper[d]=r(n[d])-o[a]),o[d]>r(n[s])&&(e.offsets.popper[d]=r(n[s])),e}},arrow:{order:500,enabled:!0,fn:function(e,o){var n;if(!K(e.instance.modifiers,'arrow','keepTogether'))return e;var i=o.element;if('string'==typeof i){if(i=e.instance.popper.querySelector(i),!i)return e;}else if(!e.instance.popper.contains(i))return console.warn('WARNING: `arrow.element` must be child of its popper element!'),e;var r=e.placement.split('-')[0],p=e.offsets,s=p.popper,d=p.reference,a=-1!==['left','right'].indexOf(r),l=a?'height':'width',f=a?'Top':'Left',m=f.toLowerCase(),h=a?'left':'top',c=a?'bottom':'right',u=S(i)[l];d[c]-u<s[m]&&(e.offsets.popper[m]-=s[m]-(d[c]-u)),d[m]+u>s[c]&&(e.offsets.popper[m]+=d[m]+u-s[c]),e.offsets.popper=g(e.offsets.popper);var b=d[m]+d[l]/2-u/2,w=t(e.instance.popper),y=parseFloat(w['margin'+f]),E=parseFloat(w['border'+f+'Width']),v=b-e.offsets.popper[m]-y-E;return v=ee(Q(s[l]-u,v),0),e.arrowElement=i,e.offsets.arrow=(n={},ae(n,m,$(v)),ae(n,h,''),n),e},element:'[x-arrow]'},flip:{order:600,enabled:!0,fn:function(e,t){if(W(e.instance.modifiers,'inner'))return e;if(e.flipped&&e.placement===e.originalPlacement)return e;var o=v(e.instance.popper,e.instance.reference,t.padding,t.boundariesElement,e.positionFixed),n=e.placement.split('-')[0],i=T(n),r=e.placement.split('-')[1]||'',p=[];switch(t.behavior){case ce.FLIP:p=[n,i];break;case ce.CLOCKWISE:p=G(n);break;case ce.COUNTERCLOCKWISE:p=G(n,!0);break;default:p=t.behavior;}return p.forEach(function(s,d){if(n!==s||p.length===d+1)return e;n=e.placement.split('-')[0],i=T(n);var a=e.offsets.popper,l=e.offsets.reference,f=Z,m='left'===n&&f(a.right)>f(l.left)||'right'===n&&f(a.left)<f(l.right)||'top'===n&&f(a.bottom)>f(l.top)||'bottom'===n&&f(a.top)<f(l.bottom),h=f(a.left)<f(o.left),c=f(a.right)>f(o.right),g=f(a.top)<f(o.top),u=f(a.bottom)>f(o.bottom),b='left'===n&&h||'right'===n&&c||'top'===n&&g||'bottom'===n&&u,w=-1!==['top','bottom'].indexOf(n),y=!!t.flipVariations&&(w&&'start'===r&&h||w&&'end'===r&&c||!w&&'start'===r&&g||!w&&'end'===r&&u),E=!!t.flipVariationsByContent&&(w&&'start'===r&&c||w&&'end'===r&&h||!w&&'start'===r&&u||!w&&'end'===r&&g),v=y||E;(m||b||v)&&(e.flipped=!0,(m||b)&&(n=p[d+1]),v&&(r=z(r)),e.placement=n+(r?'-'+r:''),e.offsets.popper=le({},e.offsets.popper,C(e.instance.popper,e.offsets.reference,e.placement)),e=P(e.instance.modifiers,e,'flip'))}),e},behavior:'flip',padding:5,boundariesElement:'viewport',flipVariations:!1,flipVariationsByContent:!1},inner:{order:700,enabled:!1,fn:function(e){var t=e.placement,o=t.split('-')[0],n=e.offsets,i=n.popper,r=n.reference,p=-1!==['left','right'].indexOf(o),s=-1===['top','left'].indexOf(o);return i[p?'left':'top']=r[o]-(s?i[p?'width':'height']:0),e.placement=T(t),e.offsets.popper=g(i),e}},hide:{order:800,enabled:!0,fn:function(e){if(!K(e.instance.modifiers,'hide','preventOverflow'))return e;var t=e.offsets.reference,o=D(e.instance.modifiers,function(e){return'preventOverflow'===e.name}).boundaries;if(t.bottom<o.top||t.left>o.right||t.top>o.bottom||t.right<o.left){if(!0===e.hide)return e;e.hide=!0,e.attributes['x-out-of-boundaries']=''}else{if(!1===e.hide)return e;e.hide=!1,e.attributes['x-out-of-boundaries']=!1}return e}},computeStyle:{order:850,enabled:!0,fn:function(e,t){var o=t.x,n=t.y,i=e.offsets.popper,r=D(e.instance.modifiers,function(e){return'applyStyle'===e.name}).gpuAcceleration;void 0!==r&&console.warn('WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!');var s,d,a=void 0===r?t.gpuAcceleration:r,l=p(e.instance.popper),f=u(l),m={position:i.position},h=q(e,2>window.devicePixelRatio||!fe),c='bottom'===o?'top':'bottom',g='right'===n?'left':'right',b=B('transform');if(d='bottom'==c?'HTML'===l.nodeName?-l.clientHeight+h.bottom:-f.height+h.bottom:h.top,s='right'==g?'HTML'===l.nodeName?-l.clientWidth+h.right:-f.width+h.right:h.left,a&&b)m[b]='translate3d('+s+'px, '+d+'px, 0)',m[c]=0,m[g]=0,m.willChange='transform';else{var w='bottom'==c?-1:1,y='right'==g?-1:1;m[c]=d*w,m[g]=s*y,m.willChange=c+', '+g}var E={\"x-placement\":e.placement};return e.attributes=le({},E,e.attributes),e.styles=le({},m,e.styles),e.arrowStyles=le({},e.offsets.arrow,e.arrowStyles),e},gpuAcceleration:!0,x:'bottom',y:'right'},applyStyle:{order:900,enabled:!0,fn:function(e){return V(e.instance.popper,e.styles),j(e.instance.popper,e.attributes),e.arrowElement&&Object.keys(e.arrowStyles).length&&V(e.arrowElement,e.arrowStyles),e},onLoad:function(e,t,o,n,i){var r=L(i,t,e,o.positionFixed),p=O(o.placement,r,t,e,o.modifiers.flip.boundariesElement,o.modifiers.flip.padding);return t.setAttribute('x-placement',p),V(t,{position:o.positionFixed?'fixed':'absolute'}),o},gpuAcceleration:void 0}}},ge});\n//# sourceMappingURL=popper.min.js.map\n","/*! rangeslider.js - v2.3.2 | (c) 2018 @andreruffert | MIT license | https://github.com/andreruffert/rangeslider.js */\n!function(a){\"use strict\";\"function\"==typeof define&&define.amd?define([\"jquery\"],a):\"object\"==typeof exports?module.exports=a(require(\"jquery\")):a(jQuery)}(function(a){\"use strict\";function b(){var a=document.createElement(\"input\");return a.setAttribute(\"type\",\"range\"),\"text\"!==a.type}function c(a,b){var c=Array.prototype.slice.call(arguments,2);return setTimeout(function(){return a.apply(null,c)},b)}function d(a,b){return b=b||100,function(){if(!a.debouncing){var c=Array.prototype.slice.apply(arguments);a.lastReturnVal=a.apply(window,c),a.debouncing=!0}return clearTimeout(a.debounceTimeout),a.debounceTimeout=setTimeout(function(){a.debouncing=!1},b),a.lastReturnVal}}function e(a){return a&&(0===a.offsetWidth||0===a.offsetHeight||!1===a.open)}function f(a){for(var b=[],c=a.parentNode;e(c);)b.push(c),c=c.parentNode;return b}function g(a,b){function c(a){void 0!==a.open&&(a.open=!a.open)}var d=f(a),e=d.length,g=[],h=a[b];if(e){for(var i=0;i<e;i++)g[i]=d[i].style.cssText,d[i].style.setProperty?d[i].style.setProperty(\"display\",\"block\",\"important\"):d[i].style.cssText+=\";display: block !important\",d[i].style.height=\"0\",d[i].style.overflow=\"hidden\",d[i].style.visibility=\"hidden\",c(d[i]);h=a[b];for(var j=0;j<e;j++)d[j].style.cssText=g[j],c(d[j])}return h}function h(a,b){var c=parseFloat(a);return Number.isNaN(c)?b:c}function i(a){return a.charAt(0).toUpperCase()+a.substr(1)}function j(b,e){if(this.$window=a(window),this.$document=a(document),this.$element=a(b),this.options=a.extend({},n,e),this.polyfill=this.options.polyfill,this.orientation=this.$element[0].getAttribute(\"data-orientation\")||this.options.orientation,this.onInit=this.options.onInit,this.onSlide=this.options.onSlide,this.onSlideEnd=this.options.onSlideEnd,this.DIMENSION=o.orientation[this.orientation].dimension,this.DIRECTION=o.orientation[this.orientation].direction,this.DIRECTION_STYLE=o.orientation[this.orientation].directionStyle,this.COORDINATE=o.orientation[this.orientation].coordinate,this.polyfill&&m)return!1;this.identifier=\"js-\"+k+\"-\"+l++,this.startEvent=this.options.startEvent.join(\".\"+this.identifier+\" \")+\".\"+this.identifier,this.moveEvent=this.options.moveEvent.join(\".\"+this.identifier+\" \")+\".\"+this.identifier,this.endEvent=this.options.endEvent.join(\".\"+this.identifier+\" \")+\".\"+this.identifier,this.toFixed=(this.step+\"\").replace(\".\",\"\").length-1,this.$fill=a('<div class=\"'+this.options.fillClass+'\" />'),this.$handle=a('<div class=\"'+this.options.handleClass+'\" />'),this.$range=a('<div class=\"'+this.options.rangeClass+\" \"+this.options[this.orientation+\"Class\"]+'\" id=\"'+this.identifier+'\" />').insertAfter(this.$element).prepend(this.$fill,this.$handle),this.$element.css({position:\"absolute\",width:\"1px\",height:\"1px\",overflow:\"hidden\",opacity:\"0\"}),this.handleDown=a.proxy(this.handleDown,this),this.handleMove=a.proxy(this.handleMove,this),this.handleEnd=a.proxy(this.handleEnd,this),this.init();var f=this;this.$window.on(\"resize.\"+this.identifier,d(function(){c(function(){f.update(!1,!1)},300)},20)),this.$document.on(this.startEvent,\"#\"+this.identifier+\":not(.\"+this.options.disabledClass+\")\",this.handleDown),this.$element.on(\"change.\"+this.identifier,function(a,b){if(!b||b.origin!==f.identifier){var c=a.target.value,d=f.getPositionFromValue(c);f.setPosition(d)}})}Number.isNaN=Number.isNaN||function(a){return\"number\"==typeof a&&a!==a};var k=\"rangeslider\",l=0,m=b(),n={polyfill:!0,orientation:\"horizontal\",rangeClass:\"rangeslider\",disabledClass:\"rangeslider--disabled\",activeClass:\"rangeslider--active\",horizontalClass:\"rangeslider--horizontal\",verticalClass:\"rangeslider--vertical\",fillClass:\"rangeslider__fill\",handleClass:\"rangeslider__handle\",startEvent:[\"mousedown\",\"touchstart\",\"pointerdown\"],moveEvent:[\"mousemove\",\"touchmove\",\"pointermove\"],endEvent:[\"mouseup\",\"touchend\",\"pointerup\"]},o={orientation:{horizontal:{dimension:\"width\",direction:\"left\",directionStyle:\"left\",coordinate:\"x\"},vertical:{dimension:\"height\",direction:\"top\",directionStyle:\"bottom\",coordinate:\"y\"}}};return j.prototype.init=function(){this.update(!0,!1),this.onInit&&\"function\"==typeof this.onInit&&this.onInit()},j.prototype.update=function(a,b){a=a||!1,a&&(this.min=h(this.$element[0].getAttribute(\"min\"),0),this.max=h(this.$element[0].getAttribute(\"max\"),100),this.value=h(this.$element[0].value,Math.round(this.min+(this.max-this.min)/2)),this.step=h(this.$element[0].getAttribute(\"step\"),1)),this.handleDimension=g(this.$handle[0],\"offset\"+i(this.DIMENSION)),this.rangeDimension=g(this.$range[0],\"offset\"+i(this.DIMENSION)),this.maxHandlePos=this.rangeDimension-this.handleDimension,this.grabPos=this.handleDimension/2,this.position=this.getPositionFromValue(this.value),this.$element[0].disabled?this.$range.addClass(this.options.disabledClass):this.$range.removeClass(this.options.disabledClass),this.setPosition(this.position,b)},j.prototype.handleDown=function(a){if(a.preventDefault(),!(a.button&&0!==a.button||(this.$document.on(this.moveEvent,this.handleMove),this.$document.on(this.endEvent,this.handleEnd),this.$range.addClass(this.options.activeClass),(\" \"+a.target.className+\" \").replace(/[\\n\\t]/g,\" \").indexOf(this.options.handleClass)>-1))){var b=this.getRelativePosition(a),c=this.$range[0].getBoundingClientRect()[this.DIRECTION],d=this.getPositionFromNode(this.$handle[0])-c,e=\"vertical\"===this.orientation?this.maxHandlePos-(b-this.grabPos):b-this.grabPos;this.setPosition(e),b>=d&&b<d+this.handleDimension&&(this.grabPos=b-d)}},j.prototype.handleMove=function(a){a.preventDefault();var b=this.getRelativePosition(a),c=\"vertical\"===this.orientation?this.maxHandlePos-(b-this.grabPos):b-this.grabPos;this.setPosition(c)},j.prototype.handleEnd=function(a){a.preventDefault(),this.$document.off(this.moveEvent,this.handleMove),this.$document.off(this.endEvent,this.handleEnd),this.$range.removeClass(this.options.activeClass),this.$element.trigger(\"change\",{origin:this.identifier}),this.onSlideEnd&&\"function\"==typeof this.onSlideEnd&&this.onSlideEnd(this.position,this.value)},j.prototype.cap=function(a,b,c){return a<b?b:a>c?c:a},j.prototype.setPosition=function(a,b){var c,d;void 0===b&&(b=!0),c=this.getValueFromPosition(this.cap(a,0,this.maxHandlePos)),d=this.getPositionFromValue(c),this.$fill[0].style[this.DIMENSION]=d+this.grabPos+\"px\",this.$handle[0].style[this.DIRECTION_STYLE]=d+\"px\",this.setValue(c),this.position=d,this.value=c,b&&this.onSlide&&\"function\"==typeof this.onSlide&&this.onSlide(d,c)},j.prototype.getPositionFromNode=function(a){for(var b=0;null!==a;)b+=a.offsetLeft,a=a.offsetParent;return b},j.prototype.getRelativePosition=function(a){var b=i(this.COORDINATE),c=this.$range[0].getBoundingClientRect()[this.DIRECTION],d=0;return void 0!==a.originalEvent[\"client\"+b]?d=a.originalEvent[\"client\"+b]:a.originalEvent.touches&&a.originalEvent.touches[0]&&void 0!==a.originalEvent.touches[0][\"client\"+b]?d=a.originalEvent.touches[0][\"client\"+b]:a.currentPoint&&void 0!==a.currentPoint[this.COORDINATE]&&(d=a.currentPoint[this.COORDINATE]),d-c},j.prototype.getPositionFromValue=function(a){var b;return b=(a-this.min)/(this.max-this.min),Number.isNaN(b)?0:b*this.maxHandlePos},j.prototype.getValueFromPosition=function(a){var b,c;return b=a/(this.maxHandlePos||1),c=this.step*Math.round(b*(this.max-this.min)/this.step)+this.min,Number(c.toFixed(this.toFixed))},j.prototype.setValue=function(a){a===this.value&&\"\"!==this.$element[0].value||this.$element.val(a).trigger(\"input\",{origin:this.identifier})},j.prototype.destroy=function(){this.$document.off(\".\"+this.identifier),this.$window.off(\".\"+this.identifier),this.$element.off(\".\"+this.identifier).removeAttr(\"style\").removeData(\"plugin_\"+k),this.$range&&this.$range.length&&this.$range[0].parentNode.removeChild(this.$range[0])},a.fn[k]=function(b){var c=Array.prototype.slice.call(arguments,1);return this.each(function(){var d=a(this),e=d.data(\"plugin_\"+k);e||d.data(\"plugin_\"+k,e=new j(this,b)),\"string\"==typeof b&&e[b].apply(e,c)})},\"rangeslider.js is available in jQuery context e.g $(selector).rangeslider(options);\"});","/*!\n * Datepicker for Bootstrap v1.9.0 (https://github.com/uxsolutions/bootstrap-datepicker)\n *\n * Licensed under the Apache License v2.0 (http://www.apache.org/licenses/LICENSE-2.0)\n */\n\n!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(\"\")},\nheadTemplate:'<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\"]'))})});","!function(t){let e=function(t,e){return e=e||null,moment(t,e).locale(\"en\")};t.widget(\"mdb.eventCalendar\",{options:{showAdd:!0,showImage:!1,showLegends:!0,showTooltipActions:!0,showOwners:!1,sliderWidth:\"200px\",showSlider:!0,eventClass:\"height-36\",eventImageSize:\"square\",slider:{id:\"mega-toolbar-slider\",min:18,max:90,value:18,step:18},classes:{megaCalendarWrap:\"megaCalendarWrap\",\"mega-content\":\"mega-content\",\"mega-toolbar\":\"mega-toolbar\",\"mega-toolbar-add-event\":\"mega-toolbar-add-event\",\"mega-toolbar-select-month\":\"mega-toolbar-select-month\",\"mega-toolbar-prev\":\"mega-toolbar-prev\",\"mega-toolbar-next\":\"mega-toolbar-next\",\"mega-toolbar-month\":\"mega-toolbar-month\",\"mega-toolbar-slider\":\"mega-toolbar-slider\",\"mega-view\":\"mega-view\",\"mega-view-header\":\"mega-view-header\",\"mega-view-header-weekday\":\"mega-view-header-weekday\",\"mega-view-body\":\"mega-view-body\",\"mega-view-week\":\"mega-view-week\",\"mega-view-day\":\"mega-view-day\",\"mega-view-day-header\":\"mega-view-day-header\",\"mega-view-day-content\":\"mega-view-day-content\",\"mega-view-day-content-event\":\"mega-view-day-content-event\",\"mega-view-day-content-event-text\":\"mega-view-day-content-event-text\",\"mega-view-day-content-event-image\":\"mega-view-day-content-event-image\",\"mega-loading-animation\":\"mega-loading-animation\",\"mega-legend\":\"mega-legend\",\"mega-legend-header\":\"mega-legend-header\",\"mega-legend-body\":\"mega-legend-body\",\"mega-legend-items\":\"mega-legend-items\",\"mega-legend-item\":\"mega-legend-item\",\"mega-tooltip\":\"mega-tooltip\"},dateFormat:{toolbar:\"MMMM YYYY\",calendar:\"DD\",calendarFirst:\"MMM DD\",eventDate:\"MM-DD-YYYY\"},timeFormat:\"HH:mm\",shortWeekdaysName:!0,loaderImageUrl:null,defaultEventImageUrl:null,calendarCreate:null,calendarAddEvent:null,calendarViewChange:null},showLoader:function(){this._removeClass(this.calendarLoader,\"mega-loading-animation\",\"hidden\")._addClass(this.calendarLoader,\"mega-loading-animation\",\"visible\")},hideLoader:function(){this.eventLoaderInterval&&clearInterval(this.eventLoaderInterval),void 0!==this.eventProcessingDone?this.eventLoaderInterval=setInterval(function(){!0===this.eventProcessingDone&&(clearInterval(this.eventLoaderInterval),this._hideLoader())}.bind(this),100):this._hideLoader()},showPopup:function(e){const a=this.events.filter((function(t){return t.attr(\"id\")===`event-${e}`}))[0];this._hideTooltip();const n=t(\"div.arrow-zone\",this.tooltip);n.hasClass(\"top\")&&this._removeClass(n,\"top\")._addClass(n,\"bottom\"),this.tooltip.show();const s=this.tooltip.find(\"div.megaToolContent\");this._removeClass(s,\"megaToolContent\",\"visible\")._addClass(s,\"megaToolContent\",\"hidden\");const o=this.tooltip.find(\"div.animation\");this._removeClass(o,\"animation\",\"hidden\")._addClass(o,\"animation\",\"visible\");const i=t=>{this._removeClass(n,\"top bottom\"),t.originalPlacement!==t.placement?this._addClass(n,t.placement):this._addClass(n,t.originalPlacement)},d={placement:\"bottom\",modifiers:{preventOverflow:{boundariesElement:this.content.get(0)},arrow:{element:\".arrow\"}},eventsEnabled:!0,onCreate:i,onUpdate:i};this.popper=new Popper(a,this.tooltip,d)},setEvent:function(t){const e=this.tooltip.find(\"div.animation\");this._removeClass(e,\"animation\",\"visible\")._addClass(e,\"animation\",\"hidden\"),this._createTooltipContent(t)},clear:function(){this.calendarBody.remove(),this.toolbarMonth.html(this.startOfMonth.format(this.options.dateFormat.toolbar)),this._processCalendarBody()},refresh:function(){this._refresh()},refreshTooltip:function(){this.popper.update()},showImage:function(t){this.options.showImage=t},_create:function(){this.widgetEventPrefix=\"eventcalendar.\",this.now=e(),this.startOfMonth=this._getStartOfMonth(this.now),this.endOfMonth=this._getEndOfMonth(this.now),this._addClass(this.element,\"megaCalendarWrap postbox\"),this.content=t(\"<div/>\"),this.content.appendTo(this.element),this._addClass(this.content,\"mega-content\"),this._processToolbar(),this._processCalendarView(),this._processCalendarLoader(),this.options.showLegends&&this._processLegend(),this._processTooltip(),this._trigger(\"calendarCreate\",null,{widget:this})},_setOption:function(e,a){\"events\"===e&&a.events&&(this.eventsData=a.events.reverse(),this.eventProcessingInterval&&clearInterval(this.eventProcessingInterval),this.events=[],this.eventProcessingDone=!1,this.options.showSlider?this.eventCurrentClass=`height-${t(this.toolbarSlider).val()}`:this.eventCurrentClass=this.options.eventClass,this.eventProcessingInterval=setInterval(function(){this.eventsData&&0==this.eventsData.length&&(clearInterval(this.eventProcessingInterval),this.eventProcessingDone=!0);const t=[];let e=0;for(;10!==e&&0!=this.eventsData.length;){const a=this.eventsData.pop();e++,t.push(a)}this._processEvents(t)}.bind(this),300))},_processToolbar:function(){this.toolbar=t(\"<div/>\"),this._addClass(this.toolbar,\"mega-toolbar\"),this.toolbar.appendTo(this.content),this._processToolbarButtons(),this._processToolbarMonth(),this._processToolbarSlider()},_processToolbarButtons:function(){!0===this.options.showAdd&&this._processAddEventButton(),this._processSelectMonthButton(),this._processPrevButton(),this._processNextButton()},_processAddEventButton:function(){this.addEvent=t('\\n\\t\\t\\t\\t\\t<button>\\n\\t\\t\\t\\t\\t\\t<i class=\"fui-plus\" aria-hidden=\"true\"></i>\\n\\t\\t\\t\\t\\t\\tAdd Event\\n\\t\\t\\t\\t\\t</button>\\n\\t\\t\\t\\t'),this._addClass(this.addEvent,\"mega-toolbar-add-event\",\"button\",\"mega-toolbar-button\",\"page-title-action\"),this.addEvent.appendTo(this.toolbar),this.addEvent.attr(\"title\",\"Add an Event, or click on any date directly\"),this.addEvent.on(\"click\",function(t){this._trigger(\"calendarAddEvent\",t,{date:new Date})}.bind(this))},_processSelectMonthButton:function(){let a=this;this.selectMonth=t('\\n\\t\\t\\t\\t\\t<div>\\n\\t\\t\\t\\t\\t\\t<div class=\"input-group-addon\">\\n\\t\\t\\t\\t\\t\\t\\t<i class=\"fui-calendar-solid\" aria-hidden=\"true\"></i>\\n\\t\\t\\t\\t\\t\\t\\tMonth\\n\\t\\t\\t\\t\\t\\t</div>\\n\\t\\t\\t\\t\\t</div>\\n\\t\\t\\t\\t'),this._addClass(this.selectMonth,\"mega-toolbar-select-month\",\"mega-toolbar-button input-group date\"),this.selectMonth.appendTo(this.toolbar),this.selectMonth.attr(\"title\",\"Select a month to view in the calendar\"),this.selectMonth.attr(\"tabindex\",0),this.selectMonth.datepicker({startView:\"months\",minViewMode:\"months\",todayBtn:\"linked\",autoclose:!0}),this.selectMonth.datepicker(\"setDate\",this.startOfMonth.toDate()),this.selectMonth.datepicker().on(\"changeDate\",function(t){const a=t.date,n=e(a);this.startOfMonth=this._getStartOfMonth(n),this.endOfMonth=this._getEndOfMonth(n),this._refresh(t)}.bind(this)),this.selectMonth.datepicker().on(\"show\",(function(e){const a=t(\"div.datepicker\"),n=a.offset();a.offset({top:n.top+30,left:n.left+20})})),this.selectMonth.on(\"keyup\",(function(t){\"Enter\"==t.key&&a.selectMonth.datepicker(\"show\")}))},_processPrevButton:function(){this.prev=t('\\n\\t\\t\\t\\t\\t<button>\\n\\t\\t\\t\\t\\t\\t<i class=\"fui-arrow-left\" aria-hidden=\"true\"></i>\\n\\t\\t\\t\\t\\t</button>\\n\\t\\t\\t\\t'),this._addClass(this.prev,\"mega-toolbar-prev\",\"mega-toolbar-button mega-toolbar-nav\"),this.prev.appendTo(this.toolbar),this.prev.attr(\"title\",\"Move to previous month\"),this.prev.attr(\"tabindex\",0),this.prev.on(\"click\",function(t){this.endOfMonth=this.startOfMonth.subtract(1,\"day\"),this.startOfMonth=this._getStartOfMonth(this.endOfMonth),this._refresh(t)}.bind(this))},_processNextButton:function(){this.next=t('\\n\\t\\t\\t\\t\\t<button>\\n\\t\\t\\t\\t\\t\\t<i class=\"fui-arrow-right\" aria-hidden=\"true\"></i>\\n\\t\\t\\t\\t\\t</button>\\n\\t\\t\\t\\t'),this._addClass(this.next,\"mega-toolbar-next\",\"mega-toolbar-button mega-toolbar-nav\"),this.next.appendTo(this.toolbar),this.next.attr(\"title\",\"Move to next month\"),this.next.attr(\"tabindex\",0),this.next.on(\"click\",function(t){this.startOfMonth=this.endOfMonth.add(1,\"day\"),this.endOfMonth=this._getEndOfMonth(this.startOfMonth),this._refresh(t)}.bind(this))},_processToolbarMonth:function(){this.toolbarMonth=t(\"<div/>\"),this._addClass(this.toolbarMonth,\"mega-toolbar-month\"),this.toolbarMonth.attr(\"tabindex\",0),this.toolbarMonth.appendTo(this.toolbar),this.toolbarMonth.html(this.startOfMonth.format(this.options.dateFormat.toolbar))},_processToolbarSlider:function(){if(this.options.showSlider){const a=t(\"<div />\");a.appendTo(this.toolbar),this._addClass(a,\"mega-toolbar-slider\"),a.css(\"width\",this.options.sliderWidth);var e=t('<label class=\"sr-only\" for=\"mega-toolbar-slider\">Event Height</label>');this.toolbarSlider=t('<input type=\"range\"/>'),this.toolbarSlider.attr({...this.options.slider}),this.toolbarSlider.appendTo(a),e.appendTo(a);const n=this;t(this.toolbarSlider).rangeslider({polyfill:!1,onSlideEnd:function(t,e){const a=`height-${e}`;n.events.forEach((function(t){n._removeClass(t,\"mega-view-day-content-event\",n.eventCurrentClass)._addClass(t,\"mega-view-day-content-event\",a)})),n.eventCurrentClass=a}})}},_processCalendarView:function(){this.view=t(\"<div/>\"),this._addClass(this.view,\"mega-view\"),this.view.appendTo(this.content),this._processCalendarHeader(),this._processCalendarBody()},_processCalendarHeader:function(){this.calendarHeader=t(\"<div/>\"),this._addClass(this.calendarHeader,\"mega-view-header\"),this.calendarHeader.appendTo(this.view);const e=this.options.shortWeekdaysName?moment.weekdaysShort():moment.weekdays();this.weekdays=e.map(function(e,a){const n=t(\"<div/>\");return this._addClass(n,\"mega-view-header-weekday\"),n.appendTo(this.calendarHeader),n.html(e),n}.bind(this))},_processCalendarBody:function(){this.calendarBody=t(\"<div/>\"),this._addClass(this.calendarBody,\"mega-view-body\"),this.calendarBody.appendTo(this.view);const e=this._getCalendarDates();this.days=[];let a=[];for(let t=0;t<e.length;t++){const n=e[t];a.push(n),(t+1)%7==0&&(this._processWeek(a),a=[])}},_processWeek:function(e){const a=t(\"<div/>\");this._addClass(a,\"mega-view-week\"),a.appendTo(this.calendarBody);const n=e.map(function(e,n){const s=t(\"<div/>\");this.now.isSame(e,\"day\")?this._addClass(s,\"mega-view-day\",\"today\"):this._addClass(s,\"mega-view-day\"),s.appendTo(a),s.data(\"date\",e.toDate());const o=t(\"<div/>\");this._addClass(o,\"mega-view-day-header\"),o.appendTo(s);const i=1===e.date()?this.options.dateFormat.calendarFirst:this.options.dateFormat.calendar;o.html(e.format(i));const d=t(\"<div />\");return this._addClass(d,\"mega-view-day-content\"),this.options.showAdd?(this._addClass(d,\"mega-view-day-content\",\"current-month show-add\"),d.attr(\"title\",\"Add event for \"+e.format(\"MMMM Do\"))):(this._addClass(d,\"mega-view-day-content\",\"current-month\"),d.attr(\"title\",e.format(\"MMMM Do\"))),d.attr(\"tabindex\",0),d.on(\"keyup\",(function(e){\"Enter\"===e.key&&t(this).trigger(\"click\")})),d.appendTo(s),!0===this.options.showAdd&&(o.on(\"click\",function(t){this._trigger(\"calendarAddEvent\",t,{date:e.toDate()})}.bind(this)),d.on(\"click\",function(t){this._trigger(\"calendarAddEvent\",t,{date:e.toDate()})}.bind(this))),s}.bind(this));this.days.push(...n)},_processCalendarLoader:function(){if(this.calendarLoader=t(\"<div/>\"),this._addClass(this.calendarLoader,\"mega-loading-animation\",\"hidden\"),this.calendarLoader.appendTo(this.content),this.options.loaderImageUrl){t(`<img src=\"${this.options.loaderImageUrl}\" alt=\"Loading Spinner\" />`).appendTo(this.calendarLoader)}},_processLegend:function(){this.legend=t(\"<div/>\"),this._addClass(this.legend,\"mega-legend\"),this.legend.appendTo(this.content),this.legendHeader=t(\"<div/>\"),this.legendHeader.html(\"Legend\"),this._addClass(this.legendHeader,\"mega-legend-header\"),this.legendHeader.appendTo(this.legend),this.legendBody=t(\"<div/>\"),this._addClass(this.legendBody,\"mega-legend-body\"),this.legendBody.appendTo(this.legend),this._processLegendItem(\"icon-bullhorn\",\"Event is Published\")},_processLegendItem:function(e,a){const n=t(\"<div/>\");this._addClass(n,\"mega-legend-items\"),n.appendTo(this.legendBody);const s=t(\"<div/>\");this._addClass(s,\"mega-legend-item\"),s.appendTo(n);const o=t(\"<i/>\");this._addClass(o,e),o.appendTo(s);const i=t(\"<div/>\");this._addClass(i,\"mega-legend-item\"),i.appendTo(n);const d=t(\"<span/>\");d.html(\"=\"),d.appendTo(i);const r=t(\"<div/>\");this._addClass(r,\"mega-legend-item\"),r.appendTo(n);const h=t(\"<span/>\");h.html(a),h.appendTo(r)},_processEvents:function(a){this.days.forEach(function(n){const s=e(n.data(\"date\")).format(this.options.dateFormat.eventDate),o=t(\"div.mega-view-day-content\",n);a.forEach(function(a){const{eventDate:n,id:i,title:d,published:r,createdByMe:h,owner:l}=a;if(e(n).format(this.options.dateFormat.eventDate)===s){const n=t(\"<button />\");n.attr({id:`event-${i}`}),n.data(\"eventData\",a),n.appendTo(o),n.attr(\"tabindex\",0);const s=a.category?\"event-category-\"+a.category.id:\"\";if(this._addClass(n,`megaEvent mega-view-day-content-event ${s}`,this.eventCurrentClass),this.events.push(n),this.options.showImage){const e=t(\"<div/>\");this._addClass(e,\"megaDayImage mega-view-day-content-event-image\"),e.appendTo(n);const s=t(\"<div/>\");this._addClass(s,\"image-zone\"),s.appendTo(e),this._processEventImage(a,e)}else this._addClass(n,\"noImageEvent\");const c=t(\"<div/>\");if(c.appendTo(n),this.options.showImage?this._addClass(c,\"megaEventText mega-view-day-content-event-text\",\"has-image-sibling\"):this._addClass(c,\"megaEventText mega-view-day-content-event-text\",\"full-height\"),r?this._addClass(c,\"mega-published-event\"):this._addClass(c,\"mega-unpublished-event\"),h?this._addClass(c,\"mega-my-event\"):this._addClass(c,\"mega-shared-event\"),a.startTime){let n=e(a.startTime,\"HH:mm\").format(this.options.timeFormat);const s=t(\"<span/>\");s.html(n),this._addClass(s,\"megaTime time\"),s.appendTo(c)}if(d&&\"-\"!==t.trim(d)){const e=t(\"<div/>\"),a=t(\"<span/>\");if(a.html(t.trim(d)),a.addClass(\"megaTitlePara\"),a.appendTo(e),this._addClass(e,\"megaTitle title\"),!h&&this.options.showOwners){const t=`Owned by ${l.calendarName} (${l.handle})`;e.attr(\"title\",t)}e.appendTo(c)}if(this.options.showLegends){const e=t(\"<div/>\");if(this._addClass(e,\"megaIcons\"),e.appendTo(c),r){const a=t(\"<i/>\");this._addClass(a,\"icon-bullhorn\"),a.attr(\"aria-hidden\",!0),a.appendTo(e);const n=t(\"<span />\");this._addClass(n,\"sr-only\"),n.html(\"Published Event\"),n.appendTo(c)}}n.on(\"click\",function(t){this._trigger(\"eventClick\",t,{eventId:i,createdByMe:h}),t.stopPropagation()}.bind(this)),n.on(\"contextmenu\",function(t){this._preventEventPropagation(t),this._trigger(\"eventContextMenu\",t,{eventId:i})}.bind(this)),n.on(\"mouseover focus\",function(t){this._preventEventPropagation(t),this._trigger(\"eventHover\",t,{eventId:i})}.bind(this))}}.bind(this))}.bind(this))},_processEventImage:function(t,e){const{imageUrl:a,imageUrlSquare:n,imageUrlDetail:s,iamgeUrlBanner:o}=t;let i=a;switch(this.options.eventImageSize){case\"square\":i=n||a;break;case\"detail\":i=s||a;break;case\"banner\":i=o||a;break;case\"full\":default:i=a}i?this._createPanelImageHolder(e,\"one-image\",i):(this._addClass(e,\"noImage\"),this._addClass(e.parent(),\"noImageEvent\"),this.options.defaultEventImageUrl&&this._processPanelDefaultImage(e,this.options.defaultEventImageUrl))},_hideLoader:function(){this._removeClass(this.calendarLoader,\"mega-loading-animation\",\"visible\")._addClass(this.calendarLoader,\"mega-loading-animation\",\"hidden\")},_processTooltip:function(){this.tooltip=t(\"<div/>\"),this._addClass(this.tooltip,\"mega-tooltip\"),this.tooltip.appendTo(this.content),this.tooltip.hide();const e=t(\"<div/>\");this._addClass(e,\"arrow-zone bottom\"),e.appendTo(this.tooltip);const a=t(\"<div/>\");this._addClass(a,\"arrow\"),a.appendTo(e);const n=t(\"<div/>\");this._addClass(n,\"view\"),n.appendTo(this.tooltip);const s=t(\"<div/>\");this._addClass(s,\"megaToolContent\",\"hidden\"),s.appendTo(n);const o=t(\"<div/>\");if(this._addClass(o,\"animation\",\"hidden\"),o.appendTo(n),this.options.loaderImageUrl){t(`<img src=\"${this.options.loaderImageUrl}\" alt=\"Loading Spinner\" />`).appendTo(o)}t(\"body\").on(\"click mouseover\",function(e){!1===t(e.target).is(this.tooltip)&&!1===t.contains(this.tooltip.get(0),e.target)&&this._hideTooltip()}.bind(this)),parent.document&&t(parent.document).on(\"click mouseover\",function(t){this._hideTooltip()}.bind(this))},_createTooltipContent:function(t){const e=this.tooltip.find(\"div.megaToolContent\");e.empty(),e.html(t),this._removeClass(e,\"megaToolContent\",\"hidden\")._addClass(e,\"megaToolContent\",\"visible\")},_createTooltipPanels:function(t,e){},_processPanelDefaultImage:function(t,e){this._createPanelImageHolder(t,\"one-image\",e)},_createPanelImageHolder:function(e,a,n){const s=e.find(\"div.image-zone\"),o=t(\"<div/>\");this._addClass(o,a),o.appendTo(s);const i=t(\"<img/>\");i.attr(\"src\",n),i.attr(\"alt\",\"An image representing the event\"),i.appendTo(o)},_hideTooltip:function(){this.popper&&this.popper.destroy(),this.tooltip.hide()},_refresh:function(t){this.calendarBody.remove(),this.toolbarMonth.html(this.startOfMonth.format(this.options.dateFormat.toolbar)),this._processCalendarBody(),this._trigger(\"calendarViewChange\",t,{date:this.startOfMonth.toDate()})},_getCalendarDates:function(){let t=this._getStartOfCalendar(this.startOfMonth),e=this._getEndOfCalendar(this.endOfMonth);const a=[];for(;!t.isAfter(e,\"day\");)a.push(t.clone()),t=t.add(1,\"day\");return a},_getStartOfMonth:function(t){return this._resetTime(t.clone().startOf(\"month\"))},_getEndOfMonth:function(t){return this._resetTime(t.clone().endOf(\"month\"))},_getStartOfCalendar:function(t){return this._resetTime(t.clone().startOf(\"week\"))},_getEndOfCalendar:function(t){return this._resetTime(t.clone().endOf(\"week\"))},_resetTime:function(t){return t.hours(0).minutes(0).seconds(0).milliseconds(0)},_preventEventPropagation:function(t){t&&(t.preventDefault(),t.stopPropagation())},_getImageAtSize:function(t,e){return t.replace(/\\.([^\\.]*)$/,\"-\"+e+\".$1\")}})}(jQuery);","!function($,window,document){\"use strict\";function Wickedpicker(e,t){this.element=$(e),this.options=$.extend({},defaults,t),this.element.addClass(\"hasWickedpicker\"),this.element.attr(\"onkeypress\",\"return false;\"),this.element.attr(\"aria-showingpicker\",\"false\"),this.createPicker(),this.timepicker=$(\".wickedpicker\"),this.up=$(\".\"+this.options.upArrow.split(/\\s+/).join(\".\")),this.down=$(\".\"+this.options.downArrow.split(/\\s+/).join(\".\")),this.separator=$(\".wickedpicker__controls__control--separator\"),this.hoursElem=$(\".wickedpicker__controls__control--hours\"),this.minutesElem=$(\".wickedpicker__controls__control--minutes\"),this.secondsElem=$(\".wickedpicker__controls__control--seconds\"),this.meridiemElem=$(\".wickedpicker__controls__control--meridiem\"),this.close=$(\".\"+this.options.close.split(/\\s+/).join(\".\"));var i=this.timeArrayFromString(this.options.now);this.options.now=new Date(today.getFullYear(),today.getMonth(),today.getDate(),i[0],i[1],i[2]),this.selectedHour=this.parseHours(this.options.now.getHours()),this.selectedMin=this.parseSecMin(this.options.now.getMinutes()),this.selectedSec=this.parseSecMin(this.options.now.getSeconds()),this.selectedMeridiem=this.parseMeridiem(this.options.now.getHours()),this.setHoverState(),this.attach(e),this.setText(e)}\"function\"!=typeof String.prototype.endsWith&&(String.prototype.endsWith=function(e){return e.length>0&&this.substring(this.length-e.length,this.length)===e});var isMobile=function(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)},today=new Date,pluginName=\"wickedpicker\",defaults={now:today.getHours()+\":\"+today.getMinutes(),twentyFour:!1,upArrow:\"wickedpicker__controls__control-up\",downArrow:\"wickedpicker__controls__control-down\",close:\"wickedpicker__close\",hoverState:\"hover-state\",title:\"Timepicker\",showSeconds:!1,timeSeparator:\" : \",secondsInterval:1,minutesInterval:1,beforeShow:null,afterShow:null,show:null,clearable:!1,closeOnClickOutside:!0,onClickOutside:function(){}};$.extend(Wickedpicker.prototype,{showPicker:function(e){\"function\"==typeof this.options.beforeShow&&this.options.beforeShow(e,this.timepicker);var t=$(e).offset();if($(e).attr({\"aria-showingpicker\":\"true\",tabindex:-1}),this.setText(e),this.showHideMeridiemControl(),this.getText(e)!==this.getTime()){var i=this.getText(e),s=/\\s[ap]m$/i,o=s.test(i)?i.substr(-2,2):null,n=i.replace(s,\"\").split(this.options.timeSeparator),r={};r.hours=n[0],r.minutes=n[1],r.meridiem=o,this.options.showSeconds&&(r.seconds=n[2]),this.setTime(r)}this.timepicker.css({\"z-index\":this.element.css(\"z-index\")+1,position:\"absolute\",left:t.left,top:t.top+$(e)[0].offsetHeight}).show(),\"function\"==typeof this.options.show&&this.options.show(e,this.timepicker),this.handleTimeAdjustments(e)},hideTimepicker:function(e){this.timepicker.hide(),\"function\"==typeof this.options.afterShow&&this.options.afterShow(e,this.timepicker),{start:function(){var e=$.Deferred();return $('[aria-showingpicker=\"true\"]').attr(\"aria-showingpicker\",\"false\"),e.promise()}}.start().then(function(e){setTimeout(function(){$('[aria-showingpicker=\"false\"]').attr(\"tabindex\",e)},400)}(0))},createPicker:function(){if(0===$(\".wickedpicker\").length){var e='<div class=\"wickedpicker\"><p class=\"wickedpicker__title\">'+this.options.title+'<span class=\"wickedpicker__close\"></span></p><ul class=\"wickedpicker__controls\"><li class=\"wickedpicker__controls__control\"><span class=\"'+this.options.upArrow+'\"></span><span class=\"wickedpicker__controls__control--hours\" tabindex=\"-1\">00</span><span class=\"'+this.options.downArrow+'\"></span></li><li class=\"wickedpicker__controls__control--separator\"><span class=\"wickedpicker__controls__control--separator-inner\">:</span></li><li class=\"wickedpicker__controls__control\"><span class=\"'+this.options.upArrow+'\"></span><span class=\"wickedpicker__controls__control--minutes\" tabindex=\"-1\">00</span><span class=\"'+this.options.downArrow+'\"></span></li>';this.options.showSeconds&&(e+='<li class=\"wickedpicker__controls__control--separator\"><span class=\"wickedpicker__controls__control--separator-inner\">:</span></li><li class=\"wickedpicker__controls__control\"><span class=\"'+this.options.upArrow+'\"></span><span class=\"wickedpicker__controls__control--seconds\" tabindex=\"-1\">00</span><span class=\"'+this.options.downArrow+'\"></span> </li>'),e+='<li class=\"wickedpicker__controls__control\"><span class=\"'+this.options.upArrow+'\"></span><span class=\"wickedpicker__controls__control--meridiem\" tabindex=\"-1\">AM</span><span class=\"'+this.options.downArrow+'\"></span></li></ul></div>',$(\"body\").append(e),this.attachKeyboardEvents()}},showHideMeridiemControl:function(){!1===this.options.twentyFour?$(this.meridiemElem).parent().show():$(this.meridiemElem).parent().hide()},showHideSecondsControl:function(){this.options.showSeconds?$(this.secondsElem).parent().show():$(this.secondsElem).parent().hide()},attach:function(e){var t=this;this.options.clearable&&t.makePickerInputClearable(e),$(e).attr(\"tabindex\",0),$(e).on(\"click focus\",function(e){$(t.timepicker).is(\":hidden\")&&(t.showPicker($(this)),window.lastTimePickerControl=$(this),$(t.hoursElem).focus())});var i=function(e){if($(t.timepicker).is(\":visible\")){if($(e.target).is(t.close))t.hideTimepicker(window.lastTimePickerControl);else if($(e.target).closest(t.timepicker).length||$(e.target).closest($(\".hasWickedpicker\")).length)e.stopPropagation();else{if(\"function\"==typeof t.options.onClickOutside?t.options.onClickOutside():console.warn(\"Type of onClickOutside must be a function\"),!t.options.closeOnClickOutside)return;t.hideTimepicker(window.lastTimePickerControl)}window.lastTimePickerControl=null}};$(document).off(\"click\",i).on(\"click\",i)},attachKeyboardEvents:function(){$(document).on(\"keydown\",$.proxy(function(e){switch(e.keyCode){case 9:\"hasWickedpicker\"!==e.target.className&&$(this.close).trigger(\"click\");break;case 27:$(this.close).trigger(\"click\");break;case 37:e.target.className!==this.hoursElem[0].className?$(e.target).parent().prevAll(\"li\").not(this.separator.selector).first().children()[1].focus():$(e.target).parent().siblings(\":last\").children()[1].focus();break;case 39:e.target.className!==this.meridiemElem[0].className?$(e.target).parent().nextAll(\"li\").not(this.separator.selector).first().children()[1].focus():$(e.target).parent().siblings(\":first\").children()[1].focus();break;case 38:$(\":focus\").prev().trigger(\"click\");break;case 40:$(\":focus\").next().trigger(\"click\")}},this))},setTime:function(e){this.setHours(e.hours),this.setMinutes(e.minutes),this.setMeridiem(e.meridiem),this.options.showSeconds&&this.setSeconds(e.seconds)},getTime:function(){return[this.formatTime(this.getHours(),this.getMinutes(),this.getMeridiem(),this.getSeconds())]},setHours:function(e){var t=new Date;t.setHours(e);var i=this.parseHours(t.getHours());this.hoursElem.text(i),this.selectedHour=i},getHours:function(){var e=new Date;return e.setHours(this.hoursElem.text()),e.getHours()},parseHours:function(e){return!1===this.options.twentyFour?(e+11)%12+1:e<10?\"0\"+e:e},setMinutes:function(e){var t=new Date;t.setMinutes(e);var i=t.getMinutes(),s=this.parseSecMin(i);this.minutesElem.text(s),this.selectedMin=s},getMinutes:function(){var e=new Date;return e.setMinutes(this.minutesElem.text()),e.getMinutes()},parseSecMin:function(e){return(e<10?\"0\":\"\")+e},setMeridiem:function(e){var t=\"\";t=void 0===e?\"PM\"===this.getMeridiem()?\"AM\":\"PM\":e,this.meridiemElem.text(t),this.selectedMeridiem=t},getMeridiem:function(){return this.meridiemElem.text()},setSeconds:function(e){var t=new Date;t.setSeconds(e);var i=t.getSeconds(),s=this.parseSecMin(i);this.secondsElem.text(s),this.selectedSec=s},getSeconds:function(){var e=new Date;return e.setSeconds(this.secondsElem.text()),e.getSeconds()},parseMeridiem:function(e){return e>11?\"PM\":\"AM\"},handleTimeAdjustments:function(e){var t=0;$(this.up).add(this.down).off(\"mousedown click touchstart\").on(\"mousedown click\",{Wickedpicker:this,input:e},function(e){if(1!=e.which)return!1;var i=this.className.indexOf(\"up\")>-1?\"+\":\"-\",s=e.data;\"mousedown\"==e.type?t=setInterval($.proxy(function(e){e.Wickedpicker.changeValue(i,e.input,this)},this,{Wickedpicker:s.Wickedpicker,input:s.input}),200):s.Wickedpicker.changeValue(i,s.input,this)}).bind(\"mouseup touchend\",function(){clearInterval(t)})},changeValue:function(operator,input,clicked){var target=\"+\"===operator?clicked.nextSibling:clicked.previousSibling,targetClass=$(target).attr(\"class\");targetClass.endsWith(\"hours\")?this.setHours(eval(this.getHours()+operator+1)):targetClass.endsWith(\"minutes\")?this.setMinutes(eval(this.getMinutes()+operator+this.options.minutesInterval)):targetClass.endsWith(\"seconds\")?this.setSeconds(eval(this.getSeconds()+operator+this.options.secondsInterval)):this.setMeridiem(),this.setText(input)},setText:function(e){$(e).val(this.formatTime(this.selectedHour,this.selectedMin,this.selectedMeridiem,this.selectedSec)).change()},getText:function(e){return $(e).val()},formatTime:function(e,t,i,s){var o=e+this.options.timeSeparator+t;return this.options.showSeconds&&(o+=this.options.timeSeparator+s),!1===this.options.twentyFour&&(o+=\" \"+i),o},setHoverState:function(){var e=this;isMobile()||$(this.up).add(this.down).add(this.close).hover(function(){$(this).toggleClass(e.options.hoverState)})},makePickerInputClearable:function(e){$(e).wrap('<div class=\"clearable-picker\"></div>').after(\"<span data-clear-picker>&times;</span>\"),$(\"[data-clear-picker]\").on(\"click\",function(e){$(this).siblings(\".hasWickedpicker\").val(\"\")})},timeArrayFromString:function(e){if(e.length){var t=e.split(\":\");return t[2]=t.length<3?\"00\":t[2],t}return!1},_time:function(){var e=$(this.element).val();return\"\"===e?this.formatTime(this.selectedHour,this.selectedMin,this.selectedMeridiem,this.selectedSec):e},_hide:function(){this.hideTimepicker(this.element)}}),$.fn[pluginName]=function(e,t){return $.isFunction(Wickedpicker.prototype[\"_\"+e])?$(this).hasClass(\"hasWickedpicker\")?void 0!==t?$.data($(this)[t],\"plugin_\"+pluginName)[\"_\"+e]():$.data($(this)[0],\"plugin_\"+pluginName)[\"_\"+e]():void 0:this.each(function(){$.data(this,\"plugin_\"+pluginName)||$.data(this,\"plugin_\"+pluginName,new Wickedpicker(this,e))})}}(jQuery,window,document);","/*! Select2 4.1.0-rc.0 | https://github.com/select2/select2/blob/master/LICENSE.md */\n!function(n){\"function\"==typeof define&&define.amd?define([\"jquery\"],n):\"object\"==typeof module&&module.exports?module.exports=function(e,t){return void 0===t&&(t=\"undefined\"!=typeof window?require(\"jquery\"):require(\"jquery\")(e)),n(t),t}:n(jQuery)}(function(t){var e,n,s,p,r,o,h,f,g,m,y,v,i,a,_,s=(t&&t.fn&&t.fn.select2&&t.fn.select2.amd&&(u=t.fn.select2.amd),u&&u.requirejs||(u?n=u:u={},g={},m={},y={},v={},i=Object.prototype.hasOwnProperty,a=[].slice,_=/\\.js$/,h=function(e,t){var n,s,i=c(e),r=i[0],t=t[1];return e=i[1],r&&(n=x(r=l(r,t))),r?e=n&&n.normalize?n.normalize(e,(s=t,function(e){return l(e,s)})):l(e,t):(r=(i=c(e=l(e,t)))[0],e=i[1],r&&(n=x(r))),{f:r?r+\"!\"+e:e,n:e,pr:r,p:n}},f={require:function(e){return w(e)},exports:function(e){var t=g[e];return void 0!==t?t:g[e]={}},module:function(e){return{id:e,uri:\"\",exports:g[e],config:(t=e,function(){return y&&y.config&&y.config[t]||{}})};var t}},r=function(e,t,n,s){var i,r,o,a,l,c=[],u=typeof n,d=A(s=s||e);if(\"undefined\"==u||\"function\"==u){for(t=!t.length&&n.length?[\"require\",\"exports\",\"module\"]:t,a=0;a<t.length;a+=1)if(\"require\"===(r=(o=h(t[a],d)).f))c[a]=f.require(e);else if(\"exports\"===r)c[a]=f.exports(e),l=!0;else if(\"module\"===r)i=c[a]=f.module(e);else if(b(g,r)||b(m,r)||b(v,r))c[a]=x(r);else{if(!o.p)throw new Error(e+\" missing \"+r);o.p.load(o.n,w(s,!0),function(t){return function(e){g[t]=e}}(r),{}),c[a]=g[r]}u=n?n.apply(g[e],c):void 0,e&&(i&&i.exports!==p&&i.exports!==g[e]?g[e]=i.exports:u===p&&l||(g[e]=u))}else e&&(g[e]=n)},e=n=o=function(e,t,n,s,i){if(\"string\"==typeof e)return f[e]?f[e](t):x(h(e,A(t)).f);if(!e.splice){if((y=e).deps&&o(y.deps,y.callback),!t)return;t.splice?(e=t,t=n,n=null):e=p}return t=t||function(){},\"function\"==typeof n&&(n=s,s=i),s?r(p,e,t,n):setTimeout(function(){r(p,e,t,n)},4),o},o.config=function(e){return o(e)},e._defined=g,(s=function(e,t,n){if(\"string\"!=typeof e)throw new Error(\"See almond README: incorrect module build, no module name\");t.splice||(n=t,t=[]),b(g,e)||b(m,e)||(m[e]=[e,t,n])}).amd={jQuery:!0},u.requirejs=e,u.require=n,u.define=s),u.define(\"almond\",function(){}),u.define(\"jquery\",[],function(){var e=t||$;return null==e&&console&&console.error&&console.error(\"Select2: An instance of jQuery or a jQuery-compatible library was not found. Make sure that you are including jQuery before Select2 on your web page.\"),e}),u.define(\"select2/utils\",[\"jquery\"],function(r){var s={};function c(e){var t,n=e.prototype,s=[];for(t in n)\"function\"==typeof n[t]&&\"constructor\"!==t&&s.push(t);return s}s.Extend=function(e,t){var n,s={}.hasOwnProperty;function i(){this.constructor=e}for(n in t)s.call(t,n)&&(e[n]=t[n]);return i.prototype=t.prototype,e.prototype=new i,e.__super__=t.prototype,e},s.Decorate=function(s,i){var e=c(i),t=c(s);function r(){var e=Array.prototype.unshift,t=i.prototype.constructor.length,n=s.prototype.constructor;0<t&&(e.call(arguments,s.prototype.constructor),n=i.prototype.constructor),n.apply(this,arguments)}i.displayName=s.displayName,r.prototype=new function(){this.constructor=r};for(var n=0;n<t.length;n++){var o=t[n];r.prototype[o]=s.prototype[o]}for(var a=0;a<e.length;a++){var l=e[a];r.prototype[l]=function(e){var t=function(){};e in r.prototype&&(t=r.prototype[e]);var n=i.prototype[e];return function(){return Array.prototype.unshift.call(arguments,t),n.apply(this,arguments)}}(l)}return r};function e(){this.listeners={}}e.prototype.on=function(e,t){this.listeners=this.listeners||{},e in this.listeners?this.listeners[e].push(t):this.listeners[e]=[t]},e.prototype.trigger=function(e){var t=Array.prototype.slice,n=t.call(arguments,1);this.listeners=this.listeners||{},null==n&&(n=[]),0===n.length&&n.push({}),(n[0]._type=e)in this.listeners&&this.invoke(this.listeners[e],t.call(arguments,1)),\"*\"in this.listeners&&this.invoke(this.listeners[\"*\"],arguments)},e.prototype.invoke=function(e,t){for(var n=0,s=e.length;n<s;n++)e[n].apply(this,t)},s.Observable=e,s.generateChars=function(e){for(var t=\"\",n=0;n<e;n++)t+=Math.floor(36*Math.random()).toString(36);return t},s.bind=function(e,t){return function(){e.apply(t,arguments)}},s._convertData=function(e){for(var t in e){var n=t.split(\"-\"),s=e;if(1!==n.length){for(var i=0;i<n.length;i++){var r=n[i];(r=r.substring(0,1).toLowerCase()+r.substring(1))in s||(s[r]={}),i==n.length-1&&(s[r]=e[t]),s=s[r]}delete e[t]}}return e},s.hasScroll=function(e,t){var n=r(t),s=t.style.overflowX,i=t.style.overflowY;return(s!==i||\"hidden\"!==i&&\"visible\"!==i)&&(\"scroll\"===s||\"scroll\"===i||(n.innerHeight()<t.scrollHeight||n.innerWidth()<t.scrollWidth))},s.escapeMarkup=function(e){var t={\"\\\\\":\"&#92;\",\"&\":\"&amp;\",\"<\":\"&lt;\",\">\":\"&gt;\",'\"':\"&quot;\",\"'\":\"&#39;\",\"/\":\"&#47;\"};return\"string\"!=typeof e?e:String(e).replace(/[&<>\"'\\/\\\\]/g,function(e){return t[e]})},s.__cache={};var n=0;return s.GetUniqueElementId=function(e){var t=e.getAttribute(\"data-select2-id\");return null!=t||(t=e.id?\"select2-data-\"+e.id:\"select2-data-\"+(++n).toString()+\"-\"+s.generateChars(4),e.setAttribute(\"data-select2-id\",t)),t},s.StoreData=function(e,t,n){e=s.GetUniqueElementId(e);s.__cache[e]||(s.__cache[e]={}),s.__cache[e][t]=n},s.GetData=function(e,t){var n=s.GetUniqueElementId(e);return t?s.__cache[n]&&null!=s.__cache[n][t]?s.__cache[n][t]:r(e).data(t):s.__cache[n]},s.RemoveData=function(e){var t=s.GetUniqueElementId(e);null!=s.__cache[t]&&delete s.__cache[t],e.removeAttribute(\"data-select2-id\")},s.copyNonInternalCssClasses=function(e,t){var n=(n=e.getAttribute(\"class\").trim().split(/\\s+/)).filter(function(e){return 0===e.indexOf(\"select2-\")}),t=(t=t.getAttribute(\"class\").trim().split(/\\s+/)).filter(function(e){return 0!==e.indexOf(\"select2-\")}),t=n.concat(t);e.setAttribute(\"class\",t.join(\" \"))},s}),u.define(\"select2/results\",[\"jquery\",\"./utils\"],function(d,p){function s(e,t,n){this.$element=e,this.data=n,this.options=t,s.__super__.constructor.call(this)}return p.Extend(s,p.Observable),s.prototype.render=function(){var e=d('<ul class=\"select2-results__options\" role=\"listbox\"></ul>');return this.options.get(\"multiple\")&&e.attr(\"aria-multiselectable\",\"true\"),this.$results=e},s.prototype.clear=function(){this.$results.empty()},s.prototype.displayMessage=function(e){var t=this.options.get(\"escapeMarkup\");this.clear(),this.hideLoading();var n=d('<li role=\"alert\" aria-live=\"assertive\" class=\"select2-results__option\"></li>'),s=this.options.get(\"translations\").get(e.message);n.append(t(s(e.args))),n[0].className+=\" select2-results__message\",this.$results.append(n)},s.prototype.hideMessages=function(){this.$results.find(\".select2-results__message\").remove()},s.prototype.append=function(e){this.hideLoading();var t=[];if(null!=e.results&&0!==e.results.length){e.results=this.sort(e.results);for(var n=0;n<e.results.length;n++){var s=e.results[n],s=this.option(s);t.push(s)}this.$results.append(t)}else 0===this.$results.children().length&&this.trigger(\"results:message\",{message:\"noResults\"})},s.prototype.position=function(e,t){t.find(\".select2-results\").append(e)},s.prototype.sort=function(e){return this.options.get(\"sorter\")(e)},s.prototype.highlightFirstItem=function(){var e=this.$results.find(\".select2-results__option--selectable\"),t=e.filter(\".select2-results__option--selected\");(0<t.length?t:e).first().trigger(\"mouseenter\"),this.ensureHighlightVisible()},s.prototype.setClasses=function(){var t=this;this.data.current(function(e){var s=e.map(function(e){return e.id.toString()});t.$results.find(\".select2-results__option--selectable\").each(function(){var e=d(this),t=p.GetData(this,\"data\"),n=\"\"+t.id;null!=t.element&&t.element.selected||null==t.element&&-1<s.indexOf(n)?(this.classList.add(\"select2-results__option--selected\"),e.attr(\"aria-selected\",\"true\")):(this.classList.remove(\"select2-results__option--selected\"),e.attr(\"aria-selected\",\"false\"))})})},s.prototype.showLoading=function(e){this.hideLoading();e={disabled:!0,loading:!0,text:this.options.get(\"translations\").get(\"searching\")(e)},e=this.option(e);e.className+=\" loading-results\",this.$results.prepend(e)},s.prototype.hideLoading=function(){this.$results.find(\".loading-results\").remove()},s.prototype.option=function(e){var t=document.createElement(\"li\");t.classList.add(\"select2-results__option\"),t.classList.add(\"select2-results__option--selectable\");var n,s={role:\"option\"},i=window.Element.prototype.matches||window.Element.prototype.msMatchesSelector||window.Element.prototype.webkitMatchesSelector;for(n in(null!=e.element&&i.call(e.element,\":disabled\")||null==e.element&&e.disabled)&&(s[\"aria-disabled\"]=\"true\",t.classList.remove(\"select2-results__option--selectable\"),t.classList.add(\"select2-results__option--disabled\")),null==e.id&&t.classList.remove(\"select2-results__option--selectable\"),null!=e._resultId&&(t.id=e._resultId),e.title&&(t.title=e.title),e.children&&(s.role=\"group\",s[\"aria-label\"]=e.text,t.classList.remove(\"select2-results__option--selectable\"),t.classList.add(\"select2-results__option--group\")),s){var r=s[n];t.setAttribute(n,r)}if(e.children){var o=d(t),a=document.createElement(\"strong\");a.className=\"select2-results__group\",this.template(e,a);for(var l=[],c=0;c<e.children.length;c++){var u=e.children[c],u=this.option(u);l.push(u)}i=d(\"<ul></ul>\",{class:\"select2-results__options select2-results__options--nested\",role:\"none\"});i.append(l),o.append(a),o.append(i)}else this.template(e,t);return p.StoreData(t,\"data\",e),t},s.prototype.bind=function(t,e){var i=this,n=t.id+\"-results\";this.$results.attr(\"id\",n),t.on(\"results:all\",function(e){i.clear(),i.append(e.data),t.isOpen()&&(i.setClasses(),i.highlightFirstItem())}),t.on(\"results:append\",function(e){i.append(e.data),t.isOpen()&&i.setClasses()}),t.on(\"query\",function(e){i.hideMessages(),i.showLoading(e)}),t.on(\"select\",function(){t.isOpen()&&(i.setClasses(),i.options.get(\"scrollAfterSelect\")&&i.highlightFirstItem())}),t.on(\"unselect\",function(){t.isOpen()&&(i.setClasses(),i.options.get(\"scrollAfterSelect\")&&i.highlightFirstItem())}),t.on(\"open\",function(){i.$results.attr(\"aria-expanded\",\"true\"),i.$results.attr(\"aria-hidden\",\"false\"),i.setClasses(),i.ensureHighlightVisible()}),t.on(\"close\",function(){i.$results.attr(\"aria-expanded\",\"false\"),i.$results.attr(\"aria-hidden\",\"true\"),i.$results.removeAttr(\"aria-activedescendant\")}),t.on(\"results:toggle\",function(){var e=i.getHighlightedResults();0!==e.length&&e.trigger(\"mouseup\")}),t.on(\"results:select\",function(){var e,t=i.getHighlightedResults();0!==t.length&&(e=p.GetData(t[0],\"data\"),t.hasClass(\"select2-results__option--selected\")?i.trigger(\"close\",{}):i.trigger(\"select\",{data:e}))}),t.on(\"results:previous\",function(){var e,t=i.getHighlightedResults(),n=i.$results.find(\".select2-results__option--selectable\"),s=n.index(t);s<=0||(e=s-1,0===t.length&&(e=0),(s=n.eq(e)).trigger(\"mouseenter\"),t=i.$results.offset().top,n=s.offset().top,s=i.$results.scrollTop()+(n-t),0===e?i.$results.scrollTop(0):n-t<0&&i.$results.scrollTop(s))}),t.on(\"results:next\",function(){var e,t=i.getHighlightedResults(),n=i.$results.find(\".select2-results__option--selectable\"),s=n.index(t)+1;s>=n.length||((e=n.eq(s)).trigger(\"mouseenter\"),t=i.$results.offset().top+i.$results.outerHeight(!1),n=e.offset().top+e.outerHeight(!1),e=i.$results.scrollTop()+n-t,0===s?i.$results.scrollTop(0):t<n&&i.$results.scrollTop(e))}),t.on(\"results:focus\",function(e){e.element[0].classList.add(\"select2-results__option--highlighted\"),e.element[0].setAttribute(\"aria-selected\",\"true\")}),t.on(\"results:message\",function(e){i.displayMessage(e)}),d.fn.mousewheel&&this.$results.on(\"mousewheel\",function(e){var t=i.$results.scrollTop(),n=i.$results.get(0).scrollHeight-t+e.deltaY,t=0<e.deltaY&&t-e.deltaY<=0,n=e.deltaY<0&&n<=i.$results.height();t?(i.$results.scrollTop(0),e.preventDefault(),e.stopPropagation()):n&&(i.$results.scrollTop(i.$results.get(0).scrollHeight-i.$results.height()),e.preventDefault(),e.stopPropagation())}),this.$results.on(\"mouseup\",\".select2-results__option--selectable\",function(e){var t=d(this),n=p.GetData(this,\"data\");t.hasClass(\"select2-results__option--selected\")?i.options.get(\"multiple\")?i.trigger(\"unselect\",{originalEvent:e,data:n}):i.trigger(\"close\",{}):i.trigger(\"select\",{originalEvent:e,data:n})}),this.$results.on(\"mouseenter\",\".select2-results__option--selectable\",function(e){var t=p.GetData(this,\"data\");i.getHighlightedResults().removeClass(\"select2-results__option--highlighted\").attr(\"aria-selected\",\"false\"),i.trigger(\"results:focus\",{data:t,element:d(this)})})},s.prototype.getHighlightedResults=function(){return this.$results.find(\".select2-results__option--highlighted\")},s.prototype.destroy=function(){this.$results.remove()},s.prototype.ensureHighlightVisible=function(){var e,t,n,s,i=this.getHighlightedResults();0!==i.length&&(e=this.$results.find(\".select2-results__option--selectable\").index(i),s=this.$results.offset().top,t=i.offset().top,n=this.$results.scrollTop()+(t-s),s=t-s,n-=2*i.outerHeight(!1),e<=2?this.$results.scrollTop(0):(s>this.$results.outerHeight()||s<0)&&this.$results.scrollTop(n))},s.prototype.template=function(e,t){var n=this.options.get(\"templateResult\"),s=this.options.get(\"escapeMarkup\"),e=n(e,t);null==e?t.style.display=\"none\":\"string\"==typeof e?t.innerHTML=s(e):d(t).append(e)},s}),u.define(\"select2/keys\",[],function(){return{BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46}}),u.define(\"select2/selection/base\",[\"jquery\",\"../utils\",\"../keys\"],function(n,s,i){function r(e,t){this.$element=e,this.options=t,r.__super__.constructor.call(this)}return s.Extend(r,s.Observable),r.prototype.render=function(){var e=n('<span class=\"select2-selection\" role=\"combobox\"  aria-haspopup=\"true\" aria-expanded=\"false\"></span>');return this._tabindex=0,null!=s.GetData(this.$element[0],\"old-tabindex\")?this._tabindex=s.GetData(this.$element[0],\"old-tabindex\"):null!=this.$element.attr(\"tabindex\")&&(this._tabindex=this.$element.attr(\"tabindex\")),e.attr(\"title\",this.$element.attr(\"title\")),e.attr(\"tabindex\",this._tabindex),e.attr(\"aria-disabled\",\"false\"),this.$selection=e},r.prototype.bind=function(e,t){var n=this,s=e.id+\"-results\";this.container=e,this.$selection.on(\"focus\",function(e){n.trigger(\"focus\",e)}),this.$selection.on(\"blur\",function(e){n._handleBlur(e)}),this.$selection.on(\"keydown\",function(e){n.trigger(\"keypress\",e),e.which===i.SPACE&&e.preventDefault()}),e.on(\"results:focus\",function(e){n.$selection.attr(\"aria-activedescendant\",e.data._resultId)}),e.on(\"selection:update\",function(e){n.update(e.data)}),e.on(\"open\",function(){n.$selection.attr(\"aria-expanded\",\"true\"),n.$selection.attr(\"aria-owns\",s),n._attachCloseHandler(e)}),e.on(\"close\",function(){n.$selection.attr(\"aria-expanded\",\"false\"),n.$selection.removeAttr(\"aria-activedescendant\"),n.$selection.removeAttr(\"aria-owns\"),n.$selection.trigger(\"focus\"),n._detachCloseHandler(e)}),e.on(\"enable\",function(){n.$selection.attr(\"tabindex\",n._tabindex),n.$selection.attr(\"aria-disabled\",\"false\")}),e.on(\"disable\",function(){n.$selection.attr(\"tabindex\",\"-1\"),n.$selection.attr(\"aria-disabled\",\"true\")})},r.prototype._handleBlur=function(e){var t=this;window.setTimeout(function(){document.activeElement==t.$selection[0]||n.contains(t.$selection[0],document.activeElement)||t.trigger(\"blur\",e)},1)},r.prototype._attachCloseHandler=function(e){n(document.body).on(\"mousedown.select2.\"+e.id,function(e){var t=n(e.target).closest(\".select2\");n(\".select2.select2-container--open\").each(function(){this!=t[0]&&s.GetData(this,\"element\").select2(\"close\")})})},r.prototype._detachCloseHandler=function(e){n(document.body).off(\"mousedown.select2.\"+e.id)},r.prototype.position=function(e,t){t.find(\".selection\").append(e)},r.prototype.destroy=function(){this._detachCloseHandler(this.container)},r.prototype.update=function(e){throw new Error(\"The `update` method must be defined in child classes.\")},r.prototype.isEnabled=function(){return!this.isDisabled()},r.prototype.isDisabled=function(){return this.options.get(\"disabled\")},r}),u.define(\"select2/selection/single\",[\"jquery\",\"./base\",\"../utils\",\"../keys\"],function(e,t,n,s){function i(){i.__super__.constructor.apply(this,arguments)}return n.Extend(i,t),i.prototype.render=function(){var e=i.__super__.render.call(this);return e[0].classList.add(\"select2-selection--single\"),e.html('<span class=\"select2-selection__rendered\"></span><span class=\"select2-selection__arrow\" role=\"presentation\"><b role=\"presentation\"></b></span>'),e},i.prototype.bind=function(t,e){var n=this;i.__super__.bind.apply(this,arguments);var s=t.id+\"-container\";this.$selection.find(\".select2-selection__rendered\").attr(\"id\",s).attr(\"role\",\"textbox\").attr(\"aria-readonly\",\"true\"),this.$selection.attr(\"aria-labelledby\",s),this.$selection.attr(\"aria-controls\",s),this.$selection.on(\"mousedown\",function(e){1===e.which&&n.trigger(\"toggle\",{originalEvent:e})}),this.$selection.on(\"focus\",function(e){}),this.$selection.on(\"blur\",function(e){}),t.on(\"focus\",function(e){t.isOpen()||n.$selection.trigger(\"focus\")})},i.prototype.clear=function(){var e=this.$selection.find(\".select2-selection__rendered\");e.empty(),e.removeAttr(\"title\")},i.prototype.display=function(e,t){var n=this.options.get(\"templateSelection\");return this.options.get(\"escapeMarkup\")(n(e,t))},i.prototype.selectionContainer=function(){return e(\"<span></span>\")},i.prototype.update=function(e){var t,n;0!==e.length?(n=e[0],t=this.$selection.find(\".select2-selection__rendered\"),e=this.display(n,t),t.empty().append(e),(n=n.title||n.text)?t.attr(\"title\",n):t.removeAttr(\"title\")):this.clear()},i}),u.define(\"select2/selection/multiple\",[\"jquery\",\"./base\",\"../utils\"],function(i,e,c){function r(e,t){r.__super__.constructor.apply(this,arguments)}return c.Extend(r,e),r.prototype.render=function(){var e=r.__super__.render.call(this);return e[0].classList.add(\"select2-selection--multiple\"),e.html('<ul class=\"select2-selection__rendered\"></ul>'),e},r.prototype.bind=function(e,t){var n=this;r.__super__.bind.apply(this,arguments);var s=e.id+\"-container\";this.$selection.find(\".select2-selection__rendered\").attr(\"id\",s),this.$selection.on(\"click\",function(e){n.trigger(\"toggle\",{originalEvent:e})}),this.$selection.on(\"click\",\".select2-selection__choice__remove\",function(e){var t;n.isDisabled()||(t=i(this).parent(),t=c.GetData(t[0],\"data\"),n.trigger(\"unselect\",{originalEvent:e,data:t}))}),this.$selection.on(\"keydown\",\".select2-selection__choice__remove\",function(e){n.isDisabled()||e.stopPropagation()})},r.prototype.clear=function(){var e=this.$selection.find(\".select2-selection__rendered\");e.empty(),e.removeAttr(\"title\")},r.prototype.display=function(e,t){var n=this.options.get(\"templateSelection\");return this.options.get(\"escapeMarkup\")(n(e,t))},r.prototype.selectionContainer=function(){return i('<li class=\"select2-selection__choice\"><button type=\"button\" class=\"select2-selection__choice__remove\" tabindex=\"-1\"><span aria-hidden=\"true\">&times;</span></button><span class=\"select2-selection__choice__display\"></span></li>')},r.prototype.update=function(e){if(this.clear(),0!==e.length){for(var t=[],n=this.$selection.find(\".select2-selection__rendered\").attr(\"id\")+\"-choice-\",s=0;s<e.length;s++){var i=e[s],r=this.selectionContainer(),o=this.display(i,r),a=n+c.generateChars(4)+\"-\";i.id?a+=i.id:a+=c.generateChars(4),r.find(\".select2-selection__choice__display\").append(o).attr(\"id\",a);var l=i.title||i.text;l&&r.attr(\"title\",l);o=this.options.get(\"translations\").get(\"removeItem\"),l=r.find(\".select2-selection__choice__remove\");l.attr(\"title\",o()),l.attr(\"aria-label\",o()),l.attr(\"aria-describedby\",a),c.StoreData(r[0],\"data\",i),t.push(r)}this.$selection.find(\".select2-selection__rendered\").append(t)}},r}),u.define(\"select2/selection/placeholder\",[],function(){function e(e,t,n){this.placeholder=this.normalizePlaceholder(n.get(\"placeholder\")),e.call(this,t,n)}return e.prototype.normalizePlaceholder=function(e,t){return\"string\"==typeof t&&(t={id:\"\",text:t}),t},e.prototype.createPlaceholder=function(e,t){var n=this.selectionContainer();n.html(this.display(t)),n[0].classList.add(\"select2-selection__placeholder\"),n[0].classList.remove(\"select2-selection__choice\");t=t.title||t.text||n.text();return this.$selection.find(\".select2-selection__rendered\").attr(\"title\",t),n},e.prototype.update=function(e,t){var n=1==t.length&&t[0].id!=this.placeholder.id;if(1<t.length||n)return e.call(this,t);this.clear();t=this.createPlaceholder(this.placeholder);this.$selection.find(\".select2-selection__rendered\").append(t)},e}),u.define(\"select2/selection/allowClear\",[\"jquery\",\"../keys\",\"../utils\"],function(i,s,a){function e(){}return e.prototype.bind=function(e,t,n){var s=this;e.call(this,t,n),null==this.placeholder&&this.options.get(\"debug\")&&window.console&&console.error&&console.error(\"Select2: The `allowClear` option should be used in combination with the `placeholder` option.\"),this.$selection.on(\"mousedown\",\".select2-selection__clear\",function(e){s._handleClear(e)}),t.on(\"keypress\",function(e){s._handleKeyboardClear(e,t)})},e.prototype._handleClear=function(e,t){if(!this.isDisabled()){var n=this.$selection.find(\".select2-selection__clear\");if(0!==n.length){t.stopPropagation();var s=a.GetData(n[0],\"data\"),i=this.$element.val();this.$element.val(this.placeholder.id);var r={data:s};if(this.trigger(\"clear\",r),r.prevented)this.$element.val(i);else{for(var o=0;o<s.length;o++)if(r={data:s[o]},this.trigger(\"unselect\",r),r.prevented)return void this.$element.val(i);this.$element.trigger(\"input\").trigger(\"change\"),this.trigger(\"toggle\",{})}}}},e.prototype._handleKeyboardClear=function(e,t,n){n.isOpen()||t.which!=s.DELETE&&t.which!=s.BACKSPACE||this._handleClear(t)},e.prototype.update=function(e,t){var n,s;e.call(this,t),this.$selection.find(\".select2-selection__clear\").remove(),this.$selection[0].classList.remove(\"select2-selection--clearable\"),0<this.$selection.find(\".select2-selection__placeholder\").length||0===t.length||(n=this.$selection.find(\".select2-selection__rendered\").attr(\"id\"),s=this.options.get(\"translations\").get(\"removeAllItems\"),(e=i('<button type=\"button\" class=\"select2-selection__clear\" tabindex=\"-1\"><span aria-hidden=\"true\">&times;</span></button>')).attr(\"title\",s()),e.attr(\"aria-label\",s()),e.attr(\"aria-describedby\",n),a.StoreData(e[0],\"data\",t),this.$selection.prepend(e),this.$selection[0].classList.add(\"select2-selection--clearable\"))},e}),u.define(\"select2/selection/search\",[\"jquery\",\"../utils\",\"../keys\"],function(s,a,l){function e(e,t,n){e.call(this,t,n)}return e.prototype.render=function(e){var t=this.options.get(\"translations\").get(\"search\"),n=s('<span class=\"select2-search select2-search--inline\"><textarea class=\"select2-search__field\" type=\"search\" tabindex=\"-1\" autocorrect=\"off\" autocapitalize=\"none\" spellcheck=\"false\" role=\"searchbox\" aria-autocomplete=\"list\" ></textarea></span>');this.$searchContainer=n,this.$search=n.find(\"textarea\"),this.$search.prop(\"autocomplete\",this.options.get(\"autocomplete\")),this.$search.attr(\"aria-label\",t());e=e.call(this);return this._transferTabIndex(),e.append(this.$searchContainer),e},e.prototype.bind=function(e,t,n){var s=this,i=t.id+\"-results\",r=t.id+\"-container\";e.call(this,t,n),s.$search.attr(\"aria-describedby\",r),t.on(\"open\",function(){s.$search.attr(\"aria-controls\",i),s.$search.trigger(\"focus\")}),t.on(\"close\",function(){s.$search.val(\"\"),s.resizeSearch(),s.$search.removeAttr(\"aria-controls\"),s.$search.removeAttr(\"aria-activedescendant\"),s.$search.trigger(\"focus\")}),t.on(\"enable\",function(){s.$search.prop(\"disabled\",!1),s._transferTabIndex()}),t.on(\"disable\",function(){s.$search.prop(\"disabled\",!0)}),t.on(\"focus\",function(e){s.$search.trigger(\"focus\")}),t.on(\"results:focus\",function(e){e.data._resultId?s.$search.attr(\"aria-activedescendant\",e.data._resultId):s.$search.removeAttr(\"aria-activedescendant\")}),this.$selection.on(\"focusin\",\".select2-search--inline\",function(e){s.trigger(\"focus\",e)}),this.$selection.on(\"focusout\",\".select2-search--inline\",function(e){s._handleBlur(e)}),this.$selection.on(\"keydown\",\".select2-search--inline\",function(e){var t;e.stopPropagation(),s.trigger(\"keypress\",e),s._keyUpPrevented=e.isDefaultPrevented(),e.which!==l.BACKSPACE||\"\"!==s.$search.val()||0<(t=s.$selection.find(\".select2-selection__choice\").last()).length&&(t=a.GetData(t[0],\"data\"),s.searchRemoveChoice(t),e.preventDefault())}),this.$selection.on(\"click\",\".select2-search--inline\",function(e){s.$search.val()&&e.stopPropagation()});var t=document.documentMode,o=t&&t<=11;this.$selection.on(\"input.searchcheck\",\".select2-search--inline\",function(e){o?s.$selection.off(\"input.search input.searchcheck\"):s.$selection.off(\"keyup.search\")}),this.$selection.on(\"keyup.search input.search\",\".select2-search--inline\",function(e){var t;o&&\"input\"===e.type?s.$selection.off(\"input.search input.searchcheck\"):(t=e.which)!=l.SHIFT&&t!=l.CTRL&&t!=l.ALT&&t!=l.TAB&&s.handleSearch(e)})},e.prototype._transferTabIndex=function(e){this.$search.attr(\"tabindex\",this.$selection.attr(\"tabindex\")),this.$selection.attr(\"tabindex\",\"-1\")},e.prototype.createPlaceholder=function(e,t){this.$search.attr(\"placeholder\",t.text)},e.prototype.update=function(e,t){var n=this.$search[0]==document.activeElement;this.$search.attr(\"placeholder\",\"\"),e.call(this,t),this.resizeSearch(),n&&this.$search.trigger(\"focus\")},e.prototype.handleSearch=function(){var e;this.resizeSearch(),this._keyUpPrevented||(e=this.$search.val(),this.trigger(\"query\",{term:e})),this._keyUpPrevented=!1},e.prototype.searchRemoveChoice=function(e,t){this.trigger(\"unselect\",{data:t}),this.$search.val(t.text),this.handleSearch()},e.prototype.resizeSearch=function(){this.$search.css(\"width\",\"25px\");var e=\"100%\";\"\"===this.$search.attr(\"placeholder\")&&(e=.75*(this.$search.val().length+1)+\"em\"),this.$search.css(\"width\",e)},e}),u.define(\"select2/selection/selectionCss\",[\"../utils\"],function(n){function e(){}return e.prototype.render=function(e){var t=e.call(this),e=this.options.get(\"selectionCssClass\")||\"\";return-1!==e.indexOf(\":all:\")&&(e=e.replace(\":all:\",\"\"),n.copyNonInternalCssClasses(t[0],this.$element[0])),t.addClass(e),t},e}),u.define(\"select2/selection/eventRelay\",[\"jquery\"],function(o){function e(){}return e.prototype.bind=function(e,t,n){var s=this,i=[\"open\",\"opening\",\"close\",\"closing\",\"select\",\"selecting\",\"unselect\",\"unselecting\",\"clear\",\"clearing\"],r=[\"opening\",\"closing\",\"selecting\",\"unselecting\",\"clearing\"];e.call(this,t,n),t.on(\"*\",function(e,t){var n;-1!==i.indexOf(e)&&(t=t||{},n=o.Event(\"select2:\"+e,{params:t}),s.$element.trigger(n),-1!==r.indexOf(e)&&(t.prevented=n.isDefaultPrevented()))})},e}),u.define(\"select2/translation\",[\"jquery\",\"require\"],function(t,n){function s(e){this.dict=e||{}}return s.prototype.all=function(){return this.dict},s.prototype.get=function(e){return this.dict[e]},s.prototype.extend=function(e){this.dict=t.extend({},e.all(),this.dict)},s._cache={},s.loadPath=function(e){var t;return e in s._cache||(t=n(e),s._cache[e]=t),new s(s._cache[e])},s}),u.define(\"select2/diacritics\",[],function(){return{\"Ⓐ\":\"A\",\"A\":\"A\",\"À\":\"A\",\"Á\":\"A\",\"Â\":\"A\",\"Ầ\":\"A\",\"Ấ\":\"A\",\"Ẫ\":\"A\",\"Ẩ\":\"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\":\"x\",\"ⓨ\":\"y\",\"y\":\"y\",\"ỳ\":\"y\",\"ý\":\"y\",\"ŷ\":\"y\",\"ỹ\":\"y\",\"ȳ\":\"y\",\"ẏ\":\"y\",\"ÿ\":\"y\",\"ỷ\":\"y\",\"ẙ\":\"y\",\"ỵ\":\"y\",\"ƴ\":\"y\",\"ɏ\":\"y\",\"ỿ\":\"y\",\"ⓩ\":\"z\",\"z\":\"z\",\"ź\":\"z\",\"ẑ\":\"z\",\"ż\":\"z\",\"ž\":\"z\",\"ẓ\":\"z\",\"ẕ\":\"z\",\"ƶ\":\"z\",\"ȥ\":\"z\",\"ɀ\":\"z\",\"ⱬ\":\"z\",\"ꝣ\":\"z\",\"Ά\":\"Α\",\"Έ\":\"Ε\",\"Ή\":\"Η\",\"Ί\":\"Ι\",\"Ϊ\":\"Ι\",\"Ό\":\"Ο\",\"Ύ\":\"Υ\",\"Ϋ\":\"Υ\",\"Ώ\":\"Ω\",\"ά\":\"α\",\"έ\":\"ε\",\"ή\":\"η\",\"ί\":\"ι\",\"ϊ\":\"ι\",\"ΐ\":\"ι\",\"ό\":\"ο\",\"ύ\":\"υ\",\"ϋ\":\"υ\",\"ΰ\":\"υ\",\"ώ\":\"ω\",\"ς\":\"σ\",\"’\":\"'\"}}),u.define(\"select2/data/base\",[\"../utils\"],function(n){function s(e,t){s.__super__.constructor.call(this)}return n.Extend(s,n.Observable),s.prototype.current=function(e){throw new Error(\"The `current` method must be defined in child classes.\")},s.prototype.query=function(e,t){throw new Error(\"The `query` method must be defined in child classes.\")},s.prototype.bind=function(e,t){},s.prototype.destroy=function(){},s.prototype.generateResultId=function(e,t){e=e.id+\"-result-\";return e+=n.generateChars(4),null!=t.id?e+=\"-\"+t.id.toString():e+=\"-\"+n.generateChars(4),e},s}),u.define(\"select2/data/select\",[\"./base\",\"../utils\",\"jquery\"],function(e,a,l){function n(e,t){this.$element=e,this.options=t,n.__super__.constructor.call(this)}return a.Extend(n,e),n.prototype.current=function(e){var t=this;e(Array.prototype.map.call(this.$element[0].querySelectorAll(\":checked\"),function(e){return t.item(l(e))}))},n.prototype.select=function(i){var e,r=this;if(i.selected=!0,null!=i.element&&\"option\"===i.element.tagName.toLowerCase())return i.element.selected=!0,void this.$element.trigger(\"input\").trigger(\"change\");this.$element.prop(\"multiple\")?this.current(function(e){var t=[];(i=[i]).push.apply(i,e);for(var n=0;n<i.length;n++){var s=i[n].id;-1===t.indexOf(s)&&t.push(s)}r.$element.val(t),r.$element.trigger(\"input\").trigger(\"change\")}):(e=i.id,this.$element.val(e),this.$element.trigger(\"input\").trigger(\"change\"))},n.prototype.unselect=function(i){var r=this;if(this.$element.prop(\"multiple\")){if(i.selected=!1,null!=i.element&&\"option\"===i.element.tagName.toLowerCase())return i.element.selected=!1,void this.$element.trigger(\"input\").trigger(\"change\");this.current(function(e){for(var t=[],n=0;n<e.length;n++){var s=e[n].id;s!==i.id&&-1===t.indexOf(s)&&t.push(s)}r.$element.val(t),r.$element.trigger(\"input\").trigger(\"change\")})}},n.prototype.bind=function(e,t){var n=this;(this.container=e).on(\"select\",function(e){n.select(e.data)}),e.on(\"unselect\",function(e){n.unselect(e.data)})},n.prototype.destroy=function(){this.$element.find(\"*\").each(function(){a.RemoveData(this)})},n.prototype.query=function(t,e){var n=[],s=this;this.$element.children().each(function(){var e;\"option\"!==this.tagName.toLowerCase()&&\"optgroup\"!==this.tagName.toLowerCase()||(e=l(this),e=s.item(e),null!==(e=s.matches(t,e))&&n.push(e))}),e({results:n})},n.prototype.addOptions=function(e){this.$element.append(e)},n.prototype.option=function(e){var t;e.children?(t=document.createElement(\"optgroup\")).label=e.text:void 0!==(t=document.createElement(\"option\")).textContent?t.textContent=e.text:t.innerText=e.text,void 0!==e.id&&(t.value=e.id),e.disabled&&(t.disabled=!0),e.selected&&(t.selected=!0),e.title&&(t.title=e.title);e=this._normalizeItem(e);return e.element=t,a.StoreData(t,\"data\",e),l(t)},n.prototype.item=function(e){var t={};if(null!=(t=a.GetData(e[0],\"data\")))return t;var n=e[0];if(\"option\"===n.tagName.toLowerCase())t={id:e.val(),text:e.text(),disabled:e.prop(\"disabled\"),selected:e.prop(\"selected\"),title:e.prop(\"title\")};else if(\"optgroup\"===n.tagName.toLowerCase()){t={text:e.prop(\"label\"),children:[],title:e.prop(\"title\")};for(var s=e.children(\"option\"),i=[],r=0;r<s.length;r++){var o=l(s[r]),o=this.item(o);i.push(o)}t.children=i}return(t=this._normalizeItem(t)).element=e[0],a.StoreData(e[0],\"data\",t),t},n.prototype._normalizeItem=function(e){e!==Object(e)&&(e={id:e,text:e});return null!=(e=l.extend({},{text:\"\"},e)).id&&(e.id=e.id.toString()),null!=e.text&&(e.text=e.text.toString()),null==e._resultId&&e.id&&null!=this.container&&(e._resultId=this.generateResultId(this.container,e)),l.extend({},{selected:!1,disabled:!1},e)},n.prototype.matches=function(e,t){return this.options.get(\"matcher\")(e,t)},n}),u.define(\"select2/data/array\",[\"./select\",\"../utils\",\"jquery\"],function(e,t,c){function s(e,t){this._dataToConvert=t.get(\"data\")||[],s.__super__.constructor.call(this,e,t)}return t.Extend(s,e),s.prototype.bind=function(e,t){s.__super__.bind.call(this,e,t),this.addOptions(this.convertToOptions(this._dataToConvert))},s.prototype.select=function(n){var e=this.$element.find(\"option\").filter(function(e,t){return t.value==n.id.toString()});0===e.length&&(e=this.option(n),this.addOptions(e)),s.__super__.select.call(this,n)},s.prototype.convertToOptions=function(e){var t=this,n=this.$element.find(\"option\"),s=n.map(function(){return t.item(c(this)).id}).get(),i=[];for(var r=0;r<e.length;r++){var o,a,l=this._normalizeItem(e[r]);0<=s.indexOf(l.id)?(o=n.filter(function(e){return function(){return c(this).val()==e.id}}(l)),a=this.item(o),a=c.extend(!0,{},l,a),a=this.option(a),o.replaceWith(a)):(a=this.option(l),l.children&&(l=this.convertToOptions(l.children),a.append(l)),i.push(a))}return i},s}),u.define(\"select2/data/ajax\",[\"./array\",\"../utils\",\"jquery\"],function(e,t,r){function n(e,t){this.ajaxOptions=this._applyDefaults(t.get(\"ajax\")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),n.__super__.constructor.call(this,e,t)}return t.Extend(n,e),n.prototype._applyDefaults=function(e){var t={data:function(e){return r.extend({},e,{q:e.term})},transport:function(e,t,n){e=r.ajax(e);return e.then(t),e.fail(n),e}};return r.extend({},t,e,!0)},n.prototype.processResults=function(e){return e},n.prototype.query=function(t,n){var s=this;null!=this._request&&(\"function\"==typeof this._request.abort&&this._request.abort(),this._request=null);var i=r.extend({type:\"GET\"},this.ajaxOptions);function e(){var e=i.transport(i,function(e){e=s.processResults(e,t);s.options.get(\"debug\")&&window.console&&console.error&&(e&&e.results&&Array.isArray(e.results)||console.error(\"Select2: The AJAX results did not return an array in the `results` key of the response.\")),n(e)},function(){\"status\"in e&&(0===e.status||\"0\"===e.status)||s.trigger(\"results:message\",{message:\"errorLoading\"})});s._request=e}\"function\"==typeof i.url&&(i.url=i.url.call(this.$element,t)),\"function\"==typeof i.data&&(i.data=i.data.call(this.$element,t)),this.ajaxOptions.delay&&null!=t.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(e,this.ajaxOptions.delay)):e()},n}),u.define(\"select2/data/tags\",[\"jquery\"],function(t){function e(e,t,n){var s=n.get(\"tags\"),i=n.get(\"createTag\");void 0!==i&&(this.createTag=i);i=n.get(\"insertTag\");if(void 0!==i&&(this.insertTag=i),e.call(this,t,n),Array.isArray(s))for(var r=0;r<s.length;r++){var o=s[r],o=this._normalizeItem(o),o=this.option(o);this.$element.append(o)}}return e.prototype.query=function(e,c,u){var d=this;this._removeOldTags(),null!=c.term&&null==c.page?e.call(this,c,function e(t,n){for(var s=t.results,i=0;i<s.length;i++){var r=s[i],o=null!=r.children&&!e({results:r.children},!0);if((r.text||\"\").toUpperCase()===(c.term||\"\").toUpperCase()||o)return!n&&(t.data=s,void u(t))}if(n)return!0;var a,l=d.createTag(c);null!=l&&((a=d.option(l)).attr(\"data-select2-tag\",\"true\"),d.addOptions([a]),d.insertTag(s,l)),t.results=s,u(t)}):e.call(this,c,u)},e.prototype.createTag=function(e,t){if(null==t.term)return null;t=t.term.trim();return\"\"===t?null:{id:t,text:t}},e.prototype.insertTag=function(e,t,n){t.unshift(n)},e.prototype._removeOldTags=function(e){this.$element.find(\"option[data-select2-tag]\").each(function(){this.selected||t(this).remove()})},e}),u.define(\"select2/data/tokenizer\",[\"jquery\"],function(c){function e(e,t,n){var s=n.get(\"tokenizer\");void 0!==s&&(this.tokenizer=s),e.call(this,t,n)}return e.prototype.bind=function(e,t,n){e.call(this,t,n),this.$search=t.dropdown.$search||t.selection.$search||n.find(\".select2-search__field\")},e.prototype.query=function(e,t,n){var s=this;t.term=t.term||\"\";var i=this.tokenizer(t,this.options,function(e){var t,n=s._normalizeItem(e);s.$element.find(\"option\").filter(function(){return c(this).val()===n.id}).length||((t=s.option(n)).attr(\"data-select2-tag\",!0),s._removeOldTags(),s.addOptions([t])),t=n,s.trigger(\"select\",{data:t})});i.term!==t.term&&(this.$search.length&&(this.$search.val(i.term),this.$search.trigger(\"focus\")),t.term=i.term),e.call(this,t,n)},e.prototype.tokenizer=function(e,t,n,s){for(var i=n.get(\"tokenSeparators\")||[],r=t.term,o=0,a=this.createTag||function(e){return{id:e.term,text:e.term}};o<r.length;){var l=r[o];-1!==i.indexOf(l)?(l=r.substr(0,o),null!=(l=a(c.extend({},t,{term:l})))?(s(l),r=r.substr(o+1)||\"\",o=0):o++):o++}return{term:r}},e}),u.define(\"select2/data/minimumInputLength\",[],function(){function e(e,t,n){this.minimumInputLength=n.get(\"minimumInputLength\"),e.call(this,t,n)}return e.prototype.query=function(e,t,n){t.term=t.term||\"\",t.term.length<this.minimumInputLength?this.trigger(\"results:message\",{message:\"inputTooShort\",args:{minimum:this.minimumInputLength,input:t.term,params:t}}):e.call(this,t,n)},e}),u.define(\"select2/data/maximumInputLength\",[],function(){function e(e,t,n){this.maximumInputLength=n.get(\"maximumInputLength\"),e.call(this,t,n)}return e.prototype.query=function(e,t,n){t.term=t.term||\"\",0<this.maximumInputLength&&t.term.length>this.maximumInputLength?this.trigger(\"results:message\",{message:\"inputTooLong\",args:{maximum:this.maximumInputLength,input:t.term,params:t}}):e.call(this,t,n)},e}),u.define(\"select2/data/maximumSelectionLength\",[],function(){function e(e,t,n){this.maximumSelectionLength=n.get(\"maximumSelectionLength\"),e.call(this,t,n)}return e.prototype.bind=function(e,t,n){var s=this;e.call(this,t,n),t.on(\"select\",function(){s._checkIfMaximumSelected()})},e.prototype.query=function(e,t,n){var s=this;this._checkIfMaximumSelected(function(){e.call(s,t,n)})},e.prototype._checkIfMaximumSelected=function(e,t){var n=this;this.current(function(e){e=null!=e?e.length:0;0<n.maximumSelectionLength&&e>=n.maximumSelectionLength?n.trigger(\"results:message\",{message:\"maximumSelected\",args:{maximum:n.maximumSelectionLength}}):t&&t()})},e}),u.define(\"select2/dropdown\",[\"jquery\",\"./utils\"],function(t,e){function n(e,t){this.$element=e,this.options=t,n.__super__.constructor.call(this)}return e.Extend(n,e.Observable),n.prototype.render=function(){var e=t('<span class=\"select2-dropdown\"><span class=\"select2-results\"></span></span>');return e.attr(\"dir\",this.options.get(\"dir\")),this.$dropdown=e},n.prototype.bind=function(){},n.prototype.position=function(e,t){},n.prototype.destroy=function(){this.$dropdown.remove()},n}),u.define(\"select2/dropdown/search\",[\"jquery\"],function(r){function e(){}return e.prototype.render=function(e){var t=e.call(this),n=this.options.get(\"translations\").get(\"search\"),e=r('<span class=\"select2-search select2-search--dropdown\"><input class=\"select2-search__field\" type=\"search\" tabindex=\"-1\" autocorrect=\"off\" autocapitalize=\"none\" spellcheck=\"false\" role=\"searchbox\" aria-autocomplete=\"list\" /></span>');return this.$searchContainer=e,this.$search=e.find(\"input\"),this.$search.prop(\"autocomplete\",this.options.get(\"autocomplete\")),this.$search.attr(\"aria-label\",n()),t.prepend(e),t},e.prototype.bind=function(e,t,n){var s=this,i=t.id+\"-results\";e.call(this,t,n),this.$search.on(\"keydown\",function(e){s.trigger(\"keypress\",e),s._keyUpPrevented=e.isDefaultPrevented()}),this.$search.on(\"input\",function(e){r(this).off(\"keyup\")}),this.$search.on(\"keyup input\",function(e){s.handleSearch(e)}),t.on(\"open\",function(){s.$search.attr(\"tabindex\",0),s.$search.attr(\"aria-controls\",i),s.$search.trigger(\"focus\"),window.setTimeout(function(){s.$search.trigger(\"focus\")},0)}),t.on(\"close\",function(){s.$search.attr(\"tabindex\",-1),s.$search.removeAttr(\"aria-controls\"),s.$search.removeAttr(\"aria-activedescendant\"),s.$search.val(\"\"),s.$search.trigger(\"blur\")}),t.on(\"focus\",function(){t.isOpen()||s.$search.trigger(\"focus\")}),t.on(\"results:all\",function(e){null!=e.query.term&&\"\"!==e.query.term||(s.showSearch(e)?s.$searchContainer[0].classList.remove(\"select2-search--hide\"):s.$searchContainer[0].classList.add(\"select2-search--hide\"))}),t.on(\"results:focus\",function(e){e.data._resultId?s.$search.attr(\"aria-activedescendant\",e.data._resultId):s.$search.removeAttr(\"aria-activedescendant\")})},e.prototype.handleSearch=function(e){var t;this._keyUpPrevented||(t=this.$search.val(),this.trigger(\"query\",{term:t})),this._keyUpPrevented=!1},e.prototype.showSearch=function(e,t){return!0},e}),u.define(\"select2/dropdown/hidePlaceholder\",[],function(){function e(e,t,n,s){this.placeholder=this.normalizePlaceholder(n.get(\"placeholder\")),e.call(this,t,n,s)}return e.prototype.append=function(e,t){t.results=this.removePlaceholder(t.results),e.call(this,t)},e.prototype.normalizePlaceholder=function(e,t){return\"string\"==typeof t&&(t={id:\"\",text:t}),t},e.prototype.removePlaceholder=function(e,t){for(var n=t.slice(0),s=t.length-1;0<=s;s--){var i=t[s];this.placeholder.id===i.id&&n.splice(s,1)}return n},e}),u.define(\"select2/dropdown/infiniteScroll\",[\"jquery\"],function(n){function e(e,t,n,s){this.lastParams={},e.call(this,t,n,s),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return e.prototype.append=function(e,t){this.$loadingMore.remove(),this.loading=!1,e.call(this,t),this.showLoadingMore(t)&&(this.$results.append(this.$loadingMore),this.loadMoreIfNeeded())},e.prototype.bind=function(e,t,n){var s=this;e.call(this,t,n),t.on(\"query\",function(e){s.lastParams=e,s.loading=!0}),t.on(\"query:append\",function(e){s.lastParams=e,s.loading=!0}),this.$results.on(\"scroll\",this.loadMoreIfNeeded.bind(this))},e.prototype.loadMoreIfNeeded=function(){var e=n.contains(document.documentElement,this.$loadingMore[0]);!this.loading&&e&&(e=this.$results.offset().top+this.$results.outerHeight(!1),this.$loadingMore.offset().top+this.$loadingMore.outerHeight(!1)<=e+50&&this.loadMore())},e.prototype.loadMore=function(){this.loading=!0;var e=n.extend({},{page:1},this.lastParams);e.page++,this.trigger(\"query:append\",e)},e.prototype.showLoadingMore=function(e,t){return t.pagination&&t.pagination.more},e.prototype.createLoadingMore=function(){var e=n('<li class=\"select2-results__option select2-results__option--load-more\"role=\"option\" aria-disabled=\"true\"></li>'),t=this.options.get(\"translations\").get(\"loadingMore\");return e.html(t(this.lastParams)),e},e}),u.define(\"select2/dropdown/attachBody\",[\"jquery\",\"../utils\"],function(u,o){function e(e,t,n){this.$dropdownParent=u(n.get(\"dropdownParent\")||document.body),e.call(this,t,n)}return e.prototype.bind=function(e,t,n){var s=this;e.call(this,t,n),t.on(\"open\",function(){s._showDropdown(),s._attachPositioningHandler(t),s._bindContainerResultHandlers(t)}),t.on(\"close\",function(){s._hideDropdown(),s._detachPositioningHandler(t)}),this.$dropdownContainer.on(\"mousedown\",function(e){e.stopPropagation()})},e.prototype.destroy=function(e){e.call(this),this.$dropdownContainer.remove()},e.prototype.position=function(e,t,n){t.attr(\"class\",n.attr(\"class\")),t[0].classList.remove(\"select2\"),t[0].classList.add(\"select2-container--open\"),t.css({position:\"absolute\",top:-999999}),this.$container=n},e.prototype.render=function(e){var t=u(\"<span></span>\"),e=e.call(this);return t.append(e),this.$dropdownContainer=t},e.prototype._hideDropdown=function(e){this.$dropdownContainer.detach()},e.prototype._bindContainerResultHandlers=function(e,t){var n;this._containerResultsHandlersBound||(n=this,t.on(\"results:all\",function(){n._positionDropdown(),n._resizeDropdown()}),t.on(\"results:append\",function(){n._positionDropdown(),n._resizeDropdown()}),t.on(\"results:message\",function(){n._positionDropdown(),n._resizeDropdown()}),t.on(\"select\",function(){n._positionDropdown(),n._resizeDropdown()}),t.on(\"unselect\",function(){n._positionDropdown(),n._resizeDropdown()}),this._containerResultsHandlersBound=!0)},e.prototype._attachPositioningHandler=function(e,t){var n=this,s=\"scroll.select2.\"+t.id,i=\"resize.select2.\"+t.id,r=\"orientationchange.select2.\"+t.id,t=this.$container.parents().filter(o.hasScroll);t.each(function(){o.StoreData(this,\"select2-scroll-position\",{x:u(this).scrollLeft(),y:u(this).scrollTop()})}),t.on(s,function(e){var t=o.GetData(this,\"select2-scroll-position\");u(this).scrollTop(t.y)}),u(window).on(s+\" \"+i+\" \"+r,function(e){n._positionDropdown(),n._resizeDropdown()})},e.prototype._detachPositioningHandler=function(e,t){var n=\"scroll.select2.\"+t.id,s=\"resize.select2.\"+t.id,t=\"orientationchange.select2.\"+t.id;this.$container.parents().filter(o.hasScroll).off(n),u(window).off(n+\" \"+s+\" \"+t)},e.prototype._positionDropdown=function(){var e=u(window),t=this.$dropdown[0].classList.contains(\"select2-dropdown--above\"),n=this.$dropdown[0].classList.contains(\"select2-dropdown--below\"),s=null,i=this.$container.offset();i.bottom=i.top+this.$container.outerHeight(!1);var r={height:this.$container.outerHeight(!1)};r.top=i.top,r.bottom=i.top+r.height;var o=this.$dropdown.outerHeight(!1),a=e.scrollTop(),l=e.scrollTop()+e.height(),c=a<i.top-o,e=l>i.bottom+o,a={left:i.left,top:r.bottom},l=this.$dropdownParent;\"static\"===l.css(\"position\")&&(l=l.offsetParent());i={top:0,left:0};(u.contains(document.body,l[0])||l[0].isConnected)&&(i=l.offset()),a.top-=i.top,a.left-=i.left,t||n||(s=\"below\"),e||!c||t?!c&&e&&t&&(s=\"below\"):s=\"above\",(\"above\"==s||t&&\"below\"!==s)&&(a.top=r.top-i.top-o),null!=s&&(this.$dropdown[0].classList.remove(\"select2-dropdown--below\"),this.$dropdown[0].classList.remove(\"select2-dropdown--above\"),this.$dropdown[0].classList.add(\"select2-dropdown--\"+s),this.$container[0].classList.remove(\"select2-container--below\"),this.$container[0].classList.remove(\"select2-container--above\"),this.$container[0].classList.add(\"select2-container--\"+s)),this.$dropdownContainer.css(a)},e.prototype._resizeDropdown=function(){var e={width:this.$container.outerWidth(!1)+\"px\"};this.options.get(\"dropdownAutoWidth\")&&(e.minWidth=e.width,e.position=\"relative\",e.width=\"auto\"),this.$dropdown.css(e)},e.prototype._showDropdown=function(e){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},e}),u.define(\"select2/dropdown/minimumResultsForSearch\",[],function(){function e(e,t,n,s){this.minimumResultsForSearch=n.get(\"minimumResultsForSearch\"),this.minimumResultsForSearch<0&&(this.minimumResultsForSearch=1/0),e.call(this,t,n,s)}return e.prototype.showSearch=function(e,t){return!(function e(t){for(var n=0,s=0;s<t.length;s++){var i=t[s];i.children?n+=e(i.children):n++}return n}(t.data.results)<this.minimumResultsForSearch)&&e.call(this,t)},e}),u.define(\"select2/dropdown/selectOnClose\",[\"../utils\"],function(s){function e(){}return e.prototype.bind=function(e,t,n){var s=this;e.call(this,t,n),t.on(\"close\",function(e){s._handleSelectOnClose(e)})},e.prototype._handleSelectOnClose=function(e,t){if(t&&null!=t.originalSelect2Event){var n=t.originalSelect2Event;if(\"select\"===n._type||\"unselect\"===n._type)return}n=this.getHighlightedResults();n.length<1||(null!=(n=s.GetData(n[0],\"data\")).element&&n.element.selected||null==n.element&&n.selected||this.trigger(\"select\",{data:n}))},e}),u.define(\"select2/dropdown/closeOnSelect\",[],function(){function e(){}return e.prototype.bind=function(e,t,n){var s=this;e.call(this,t,n),t.on(\"select\",function(e){s._selectTriggered(e)}),t.on(\"unselect\",function(e){s._selectTriggered(e)})},e.prototype._selectTriggered=function(e,t){var n=t.originalEvent;n&&(n.ctrlKey||n.metaKey)||this.trigger(\"close\",{originalEvent:n,originalSelect2Event:t})},e}),u.define(\"select2/dropdown/dropdownCss\",[\"../utils\"],function(n){function e(){}return e.prototype.render=function(e){var t=e.call(this),e=this.options.get(\"dropdownCssClass\")||\"\";return-1!==e.indexOf(\":all:\")&&(e=e.replace(\":all:\",\"\"),n.copyNonInternalCssClasses(t[0],this.$element[0])),t.addClass(e),t},e}),u.define(\"select2/dropdown/tagsSearchHighlight\",[\"../utils\"],function(s){function e(){}return e.prototype.highlightFirstItem=function(e){var t=this.$results.find(\".select2-results__option--selectable:not(.select2-results__option--selected)\");if(0<t.length){var n=t.first(),t=s.GetData(n[0],\"data\").element;if(t&&t.getAttribute&&\"true\"===t.getAttribute(\"data-select2-tag\"))return void n.trigger(\"mouseenter\")}e.call(this)},e}),u.define(\"select2/i18n/en\",[],function(){return{errorLoading:function(){return\"The results could not be loaded.\"},inputTooLong:function(e){var t=e.input.length-e.maximum,e=\"Please delete \"+t+\" character\";return 1!=t&&(e+=\"s\"),e},inputTooShort:function(e){return\"Please enter \"+(e.minimum-e.input.length)+\" or more characters\"},loadingMore:function(){return\"Loading more results…\"},maximumSelected:function(e){var t=\"You can only select \"+e.maximum+\" item\";return 1!=e.maximum&&(t+=\"s\"),t},noResults:function(){return\"No results found\"},searching:function(){return\"Searching…\"},removeAllItems:function(){return\"Remove all items\"},removeItem:function(){return\"Remove item\"},search:function(){return\"Search\"}}}),u.define(\"select2/defaults\",[\"jquery\",\"./results\",\"./selection/single\",\"./selection/multiple\",\"./selection/placeholder\",\"./selection/allowClear\",\"./selection/search\",\"./selection/selectionCss\",\"./selection/eventRelay\",\"./utils\",\"./translation\",\"./diacritics\",\"./data/select\",\"./data/array\",\"./data/ajax\",\"./data/tags\",\"./data/tokenizer\",\"./data/minimumInputLength\",\"./data/maximumInputLength\",\"./data/maximumSelectionLength\",\"./dropdown\",\"./dropdown/search\",\"./dropdown/hidePlaceholder\",\"./dropdown/infiniteScroll\",\"./dropdown/attachBody\",\"./dropdown/minimumResultsForSearch\",\"./dropdown/selectOnClose\",\"./dropdown/closeOnSelect\",\"./dropdown/dropdownCss\",\"./dropdown/tagsSearchHighlight\",\"./i18n/en\"],function(l,r,o,a,c,u,d,p,h,f,g,t,m,y,v,_,b,$,w,x,A,D,S,E,O,C,L,T,q,I,e){function n(){this.reset()}return n.prototype.apply=function(e){var t;null==(e=l.extend(!0,{},this.defaults,e)).dataAdapter&&(null!=e.ajax?e.dataAdapter=v:null!=e.data?e.dataAdapter=y:e.dataAdapter=m,0<e.minimumInputLength&&(e.dataAdapter=f.Decorate(e.dataAdapter,$)),0<e.maximumInputLength&&(e.dataAdapter=f.Decorate(e.dataAdapter,w)),0<e.maximumSelectionLength&&(e.dataAdapter=f.Decorate(e.dataAdapter,x)),e.tags&&(e.dataAdapter=f.Decorate(e.dataAdapter,_)),null==e.tokenSeparators&&null==e.tokenizer||(e.dataAdapter=f.Decorate(e.dataAdapter,b))),null==e.resultsAdapter&&(e.resultsAdapter=r,null!=e.ajax&&(e.resultsAdapter=f.Decorate(e.resultsAdapter,E)),null!=e.placeholder&&(e.resultsAdapter=f.Decorate(e.resultsAdapter,S)),e.selectOnClose&&(e.resultsAdapter=f.Decorate(e.resultsAdapter,L)),e.tags&&(e.resultsAdapter=f.Decorate(e.resultsAdapter,I))),null==e.dropdownAdapter&&(e.multiple?e.dropdownAdapter=A:(t=f.Decorate(A,D),e.dropdownAdapter=t),0!==e.minimumResultsForSearch&&(e.dropdownAdapter=f.Decorate(e.dropdownAdapter,C)),e.closeOnSelect&&(e.dropdownAdapter=f.Decorate(e.dropdownAdapter,T)),null!=e.dropdownCssClass&&(e.dropdownAdapter=f.Decorate(e.dropdownAdapter,q)),e.dropdownAdapter=f.Decorate(e.dropdownAdapter,O)),null==e.selectionAdapter&&(e.multiple?e.selectionAdapter=a:e.selectionAdapter=o,null!=e.placeholder&&(e.selectionAdapter=f.Decorate(e.selectionAdapter,c)),e.allowClear&&(e.selectionAdapter=f.Decorate(e.selectionAdapter,u)),e.multiple&&(e.selectionAdapter=f.Decorate(e.selectionAdapter,d)),null!=e.selectionCssClass&&(e.selectionAdapter=f.Decorate(e.selectionAdapter,p)),e.selectionAdapter=f.Decorate(e.selectionAdapter,h)),e.language=this._resolveLanguage(e.language),e.language.push(\"en\");for(var n=[],s=0;s<e.language.length;s++){var i=e.language[s];-1===n.indexOf(i)&&n.push(i)}return e.language=n,e.translations=this._processTranslations(e.language,e.debug),e},n.prototype.reset=function(){function a(e){return e.replace(/[^\\u0000-\\u007E]/g,function(e){return t[e]||e})}this.defaults={amdLanguageBase:\"./i18n/\",autocomplete:\"off\",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:f.escapeMarkup,language:{},matcher:function e(t,n){if(null==t.term||\"\"===t.term.trim())return n;if(n.children&&0<n.children.length){for(var s=l.extend(!0,{},n),i=n.children.length-1;0<=i;i--)null==e(t,n.children[i])&&s.children.splice(i,1);return 0<s.children.length?s:e(t,s)}var r=a(n.text).toUpperCase(),o=a(t.term).toUpperCase();return-1<r.indexOf(o)?n:null},minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,scrollAfterSelect:!1,sorter:function(e){return e},templateResult:function(e){return e.text},templateSelection:function(e){return e.text},theme:\"default\",width:\"resolve\"}},n.prototype.applyFromElement=function(e,t){var n=e.language,s=this.defaults.language,i=t.prop(\"lang\"),t=t.closest(\"[lang]\").prop(\"lang\"),t=Array.prototype.concat.call(this._resolveLanguage(i),this._resolveLanguage(n),this._resolveLanguage(s),this._resolveLanguage(t));return e.language=t,e},n.prototype._resolveLanguage=function(e){if(!e)return[];if(l.isEmptyObject(e))return[];if(l.isPlainObject(e))return[e];for(var t,n=Array.isArray(e)?e:[e],s=[],i=0;i<n.length;i++)s.push(n[i]),\"string\"==typeof n[i]&&0<n[i].indexOf(\"-\")&&(t=n[i].split(\"-\")[0],s.push(t));return s},n.prototype._processTranslations=function(e,t){for(var n=new g,s=0;s<e.length;s++){var i=new g,r=e[s];if(\"string\"==typeof r)try{i=g.loadPath(r)}catch(e){try{r=this.defaults.amdLanguageBase+r,i=g.loadPath(r)}catch(e){t&&window.console&&console.warn&&console.warn('Select2: The language file for \"'+r+'\" could not be automatically loaded. A fallback will be used instead.')}}else i=l.isPlainObject(r)?new g(r):r;n.extend(i)}return n},n.prototype.set=function(e,t){var n={};n[l.camelCase(e)]=t;n=f._convertData(n);l.extend(!0,this.defaults,n)},new n}),u.define(\"select2/options\",[\"jquery\",\"./defaults\",\"./utils\"],function(c,n,u){function e(e,t){this.options=e,null!=t&&this.fromElement(t),null!=t&&(this.options=n.applyFromElement(this.options,t)),this.options=n.apply(this.options)}return e.prototype.fromElement=function(e){var t=[\"select2\"];null==this.options.multiple&&(this.options.multiple=e.prop(\"multiple\")),null==this.options.disabled&&(this.options.disabled=e.prop(\"disabled\")),null==this.options.autocomplete&&e.prop(\"autocomplete\")&&(this.options.autocomplete=e.prop(\"autocomplete\")),null==this.options.dir&&(e.prop(\"dir\")?this.options.dir=e.prop(\"dir\"):e.closest(\"[dir]\").prop(\"dir\")?this.options.dir=e.closest(\"[dir]\").prop(\"dir\"):this.options.dir=\"ltr\"),e.prop(\"disabled\",this.options.disabled),e.prop(\"multiple\",this.options.multiple),u.GetData(e[0],\"select2Tags\")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags=\"true\"` attributes and will be removed in future versions of Select2.'),u.StoreData(e[0],\"data\",u.GetData(e[0],\"select2Tags\")),u.StoreData(e[0],\"tags\",!0)),u.GetData(e[0],\"ajaxUrl\")&&(this.options.debug&&window.console&&console.warn&&console.warn(\"Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2.\"),e.attr(\"ajax--url\",u.GetData(e[0],\"ajaxUrl\")),u.StoreData(e[0],\"ajax-Url\",u.GetData(e[0],\"ajaxUrl\")));var n={};function s(e,t){return t.toUpperCase()}for(var i=0;i<e[0].attributes.length;i++){var r=e[0].attributes[i].name,o=\"data-\";r.substr(0,o.length)==o&&(r=r.substring(o.length),o=u.GetData(e[0],r),n[r.replace(/-([a-z])/g,s)]=o)}c.fn.jquery&&\"1.\"==c.fn.jquery.substr(0,2)&&e[0].dataset&&(n=c.extend(!0,{},e[0].dataset,n));var a,l=c.extend(!0,{},u.GetData(e[0]),n);for(a in l=u._convertData(l))-1<t.indexOf(a)||(c.isPlainObject(this.options[a])?c.extend(this.options[a],l[a]):this.options[a]=l[a]);return this},e.prototype.get=function(e){return this.options[e]},e.prototype.set=function(e,t){this.options[e]=t},e}),u.define(\"select2/core\",[\"jquery\",\"./options\",\"./utils\",\"./keys\"],function(t,i,r,s){var o=function(e,t){null!=r.GetData(e[0],\"select2\")&&r.GetData(e[0],\"select2\").destroy(),this.$element=e,this.id=this._generateId(e),t=t||{},this.options=new i(t,e),o.__super__.constructor.call(this);var n=e.attr(\"tabindex\")||0;r.StoreData(e[0],\"old-tabindex\",n),e.attr(\"tabindex\",\"-1\");t=this.options.get(\"dataAdapter\");this.dataAdapter=new t(e,this.options);n=this.render();this._placeContainer(n);t=this.options.get(\"selectionAdapter\");this.selection=new t(e,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,n);t=this.options.get(\"dropdownAdapter\");this.dropdown=new t(e,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,n);n=this.options.get(\"resultsAdapter\");this.results=new n(e,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var s=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current(function(e){s.trigger(\"selection:update\",{data:e})}),e[0].classList.add(\"select2-hidden-accessible\"),e.attr(\"aria-hidden\",\"true\"),this._syncAttributes(),r.StoreData(e[0],\"select2\",this),e.data(\"select2\",this)};return r.Extend(o,r.Observable),o.prototype._generateId=function(e){return\"select2-\"+(null!=e.attr(\"id\")?e.attr(\"id\"):null!=e.attr(\"name\")?e.attr(\"name\")+\"-\"+r.generateChars(2):r.generateChars(4)).replace(/(:|\\.|\\[|\\]|,)/g,\"\")},o.prototype._placeContainer=function(e){e.insertAfter(this.$element);var t=this._resolveWidth(this.$element,this.options.get(\"width\"));null!=t&&e.css(\"width\",t)},o.prototype._resolveWidth=function(e,t){var n=/^width:(([-+]?([0-9]*\\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if(\"resolve\"==t){var s=this._resolveWidth(e,\"style\");return null!=s?s:this._resolveWidth(e,\"element\")}if(\"element\"==t){s=e.outerWidth(!1);return s<=0?\"auto\":s+\"px\"}if(\"style\"!=t)return\"computedstyle\"!=t?t:window.getComputedStyle(e[0]).width;e=e.attr(\"style\");if(\"string\"!=typeof e)return null;for(var i=e.split(\";\"),r=0,o=i.length;r<o;r+=1){var a=i[r].replace(/\\s/g,\"\").match(n);if(null!==a&&1<=a.length)return a[1]}return null},o.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},o.prototype._registerDomEvents=function(){var t=this;this.$element.on(\"change.select2\",function(){t.dataAdapter.current(function(e){t.trigger(\"selection:update\",{data:e})})}),this.$element.on(\"focus.select2\",function(e){t.trigger(\"focus\",e)}),this._syncA=r.bind(this._syncAttributes,this),this._syncS=r.bind(this._syncSubtree,this),this._observer=new window.MutationObserver(function(e){t._syncA(),t._syncS(e)}),this._observer.observe(this.$element[0],{attributes:!0,childList:!0,subtree:!1})},o.prototype._registerDataEvents=function(){var n=this;this.dataAdapter.on(\"*\",function(e,t){n.trigger(e,t)})},o.prototype._registerSelectionEvents=function(){var n=this,s=[\"toggle\",\"focus\"];this.selection.on(\"toggle\",function(){n.toggleDropdown()}),this.selection.on(\"focus\",function(e){n.focus(e)}),this.selection.on(\"*\",function(e,t){-1===s.indexOf(e)&&n.trigger(e,t)})},o.prototype._registerDropdownEvents=function(){var n=this;this.dropdown.on(\"*\",function(e,t){n.trigger(e,t)})},o.prototype._registerResultsEvents=function(){var n=this;this.results.on(\"*\",function(e,t){n.trigger(e,t)})},o.prototype._registerEvents=function(){var n=this;this.on(\"open\",function(){n.$container[0].classList.add(\"select2-container--open\")}),this.on(\"close\",function(){n.$container[0].classList.remove(\"select2-container--open\")}),this.on(\"enable\",function(){n.$container[0].classList.remove(\"select2-container--disabled\")}),this.on(\"disable\",function(){n.$container[0].classList.add(\"select2-container--disabled\")}),this.on(\"blur\",function(){n.$container[0].classList.remove(\"select2-container--focus\")}),this.on(\"query\",function(t){n.isOpen()||n.trigger(\"open\",{}),this.dataAdapter.query(t,function(e){n.trigger(\"results:all\",{data:e,query:t})})}),this.on(\"query:append\",function(t){this.dataAdapter.query(t,function(e){n.trigger(\"results:append\",{data:e,query:t})})}),this.on(\"keypress\",function(e){var t=e.which;n.isOpen()?t===s.ESC||t===s.UP&&e.altKey?(n.close(e),e.preventDefault()):t===s.ENTER||t===s.TAB?(n.trigger(\"results:select\",{}),e.preventDefault()):t===s.SPACE&&e.ctrlKey?(n.trigger(\"results:toggle\",{}),e.preventDefault()):t===s.UP?(n.trigger(\"results:previous\",{}),e.preventDefault()):t===s.DOWN&&(n.trigger(\"results:next\",{}),e.preventDefault()):(t===s.ENTER||t===s.SPACE||t===s.DOWN&&e.altKey)&&(n.open(),e.preventDefault())})},o.prototype._syncAttributes=function(){this.options.set(\"disabled\",this.$element.prop(\"disabled\")),this.isDisabled()?(this.isOpen()&&this.close(),this.trigger(\"disable\",{})):this.trigger(\"enable\",{})},o.prototype._isChangeMutation=function(e){var t=this;if(e.addedNodes&&0<e.addedNodes.length){for(var n=0;n<e.addedNodes.length;n++)if(e.addedNodes[n].selected)return!0}else{if(e.removedNodes&&0<e.removedNodes.length)return!0;if(Array.isArray(e))return e.some(function(e){return t._isChangeMutation(e)})}return!1},o.prototype._syncSubtree=function(e){var e=this._isChangeMutation(e),t=this;e&&this.dataAdapter.current(function(e){t.trigger(\"selection:update\",{data:e})})},o.prototype.trigger=function(e,t){var n=o.__super__.trigger,s={open:\"opening\",close:\"closing\",select:\"selecting\",unselect:\"unselecting\",clear:\"clearing\"};if(void 0===t&&(t={}),e in s){var i=s[e],s={prevented:!1,name:e,args:t};if(n.call(this,i,s),s.prevented)return void(t.prevented=!0)}n.call(this,e,t)},o.prototype.toggleDropdown=function(){this.isDisabled()||(this.isOpen()?this.close():this.open())},o.prototype.open=function(){this.isOpen()||this.isDisabled()||this.trigger(\"query\",{})},o.prototype.close=function(e){this.isOpen()&&this.trigger(\"close\",{originalEvent:e})},o.prototype.isEnabled=function(){return!this.isDisabled()},o.prototype.isDisabled=function(){return this.options.get(\"disabled\")},o.prototype.isOpen=function(){return this.$container[0].classList.contains(\"select2-container--open\")},o.prototype.hasFocus=function(){return this.$container[0].classList.contains(\"select2-container--focus\")},o.prototype.focus=function(e){this.hasFocus()||(this.$container[0].classList.add(\"select2-container--focus\"),this.trigger(\"focus\",{}))},o.prototype.enable=function(e){this.options.get(\"debug\")&&window.console&&console.warn&&console.warn('Select2: The `select2(\"enable\")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop(\"disabled\") instead.'),null!=e&&0!==e.length||(e=[!0]);e=!e[0];this.$element.prop(\"disabled\",e)},o.prototype.data=function(){this.options.get(\"debug\")&&0<arguments.length&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2(\"data\")`. You should consider setting the value instead using `$element.val()`.');var t=[];return this.dataAdapter.current(function(e){t=e}),t},o.prototype.val=function(e){if(this.options.get(\"debug\")&&window.console&&console.warn&&console.warn('Select2: The `select2(\"val\")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==e||0===e.length)return this.$element.val();e=e[0];Array.isArray(e)&&(e=e.map(function(e){return e.toString()})),this.$element.val(e).trigger(\"input\").trigger(\"change\")},o.prototype.destroy=function(){r.RemoveData(this.$container[0]),this.$container.remove(),this._observer.disconnect(),this._observer=null,this._syncA=null,this._syncS=null,this.$element.off(\".select2\"),this.$element.attr(\"tabindex\",r.GetData(this.$element[0],\"old-tabindex\")),this.$element[0].classList.remove(\"select2-hidden-accessible\"),this.$element.attr(\"aria-hidden\",\"false\"),r.RemoveData(this.$element[0]),this.$element.removeData(\"select2\"),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null},o.prototype.render=function(){var e=t('<span class=\"select2 select2-container\"><span class=\"selection\"></span><span class=\"dropdown-wrapper\" aria-hidden=\"true\"></span></span>');return e.attr(\"dir\",this.options.get(\"dir\")),this.$container=e,this.$container[0].classList.add(\"select2-container--\"+this.options.get(\"theme\")),r.StoreData(e[0],\"element\",this.$element),e},o}),u.define(\"jquery-mousewheel\",[\"jquery\"],function(e){return e}),u.define(\"jquery.select2\",[\"jquery\",\"jquery-mousewheel\",\"./select2/core\",\"./select2/defaults\",\"./select2/utils\"],function(i,e,r,t,o){var a;return null==i.fn.select2&&(a=[\"open\",\"close\",\"destroy\"],i.fn.select2=function(t){if(\"object\"==typeof(t=t||{}))return this.each(function(){var e=i.extend(!0,{},t);new r(i(this),e)}),this;if(\"string\"!=typeof t)throw new Error(\"Invalid arguments for Select2: \"+t);var n,s=Array.prototype.slice.call(arguments,1);return this.each(function(){var e=o.GetData(this,\"select2\");null==e&&window.console&&console.error&&console.error(\"The select2('\"+t+\"') method was called on an element that is not using Select2.\"),n=e[t].apply(e,s)}),-1<a.indexOf(t)?this:n}),null==i.fn.select2.defaults&&(i.fn.select2.defaults=t),r}),{define:u.define,require:u.require});function b(e,t){return i.call(e,t)}function l(e,t){var n,s,i,r,o,a,l,c,u,d,p=t&&t.split(\"/\"),h=y.map,f=h&&h[\"*\"]||{};if(e){for(t=(e=e.split(\"/\")).length-1,y.nodeIdCompat&&_.test(e[t])&&(e[t]=e[t].replace(_,\"\")),\".\"===e[0].charAt(0)&&p&&(e=p.slice(0,p.length-1).concat(e)),c=0;c<e.length;c++)\".\"===(d=e[c])?(e.splice(c,1),--c):\"..\"===d&&(0===c||1===c&&\"..\"===e[2]||\"..\"===e[c-1]||0<c&&(e.splice(c-1,2),c-=2));e=e.join(\"/\")}if((p||f)&&h){for(c=(n=e.split(\"/\")).length;0<c;--c){if(s=n.slice(0,c).join(\"/\"),p)for(u=p.length;0<u;--u)if(i=h[p.slice(0,u).join(\"/\")],i=i&&i[s]){r=i,o=c;break}if(r)break;!a&&f&&f[s]&&(a=f[s],l=c)}!r&&a&&(r=a,o=l),r&&(n.splice(0,o,r),e=n.join(\"/\"))}return e}function w(t,n){return function(){var e=a.call(arguments,0);return\"string\"!=typeof e[0]&&1===e.length&&e.push(null),o.apply(p,e.concat([t,n]))}}function x(e){var t;if(b(m,e)&&(t=m[e],delete m[e],v[e]=!0,r.apply(p,t)),!b(g,e)&&!b(v,e))throw new Error(\"No \"+e);return g[e]}function c(e){var t,n=e?e.indexOf(\"!\"):-1;return-1<n&&(t=e.substring(0,n),e=e.substring(n+1,e.length)),[t,e]}function A(e){return e?c(e):[]}var u=s.require(\"jquery.select2\");return t.fn.select2.amd=s,u});"," (function($) {\r\n    \r\n    const GENERIC_ERROR_MSG = 'Please <a href=\"#\" class=\"page-refresh-btn\">refresh</a> the page. If you see this message again, please contact [email protected].';\r\n    var $document = $(document);\r\n\r\n    $document.ready(function() {\r\n\r\n        var $registerForm = $( '#megacal-register-form' );\r\n        var $registerHandleField = $( '#megacal-register-handle' );\r\n        var $checkHandleBtn = $( '#megacal-check-handle-button' );\r\n        var $registerBtn = $( '.megacal-register-button' );\r\n\r\n        $document.on( 'click', '.page-refresh-btn', function( e ) {\r\n            e.preventDefault();\r\n            window.location.href = window.location.href;\r\n        } );\r\n\r\n        setupAdminTabs( document );\r\n\r\n       //Copy to clipboard button\r\n        $document.on('click', '#megacal-events-settings-sc .copyToClipboard', function(e) {\r\n\r\n            e.preventDefault();\r\n\r\n            var copyTextarea = $('.shortcode'); \r\n            copyTextarea.select();\r\n\r\n            try {\r\n\r\n                var successful = document.execCommand('copy');\r\n\r\n                if( successful )\r\n                    $('.copySuccess').fadeIn().delay(200).fadeOut();\r\n                else\r\n                    $('.copyFail').fadeIn().delay(200).fadeOut();\r\n\r\n            } catch (err) {\r\n\r\n                console.log(err);\r\n                $('.copyFail').fadeIn().delay(200).fadeOut();\r\n            \r\n            }\r\n        \r\n        });\r\n\r\n        $( '#megacal-show-tokens' ).on( 'click', function( e ) {\r\n\r\n            e.preventDefault();\r\n            $( '#megacal_access_token' ).attr( 'type', 'text' ).closest( 'tr.hidden' ).addClass( 'megacal-row' ).removeClass( 'hidden' );\r\n            $( '#megacal_refresh_token' ).attr( 'type', 'text' ).closest( 'tr.hidden' ).addClass( 'megacal-row' ).removeClass( 'hidden' );\r\n\r\n        });\r\n\r\n        $( '#megacal-reset-account' ).on( 'click', function( e ) {\r\n\r\n            e.preventDefault();\r\n            var confirm = window.confirm( 'Do you really want to unlink your MegaCalendar account from this site? (You will lose your existing Events)' );\r\n\r\n            if( !confirm ) {\r\n                return false;\r\n            }\r\n\r\n            var nonce = $( '#_megacal_unlink_account_nonce' ).val();\r\n            window.location = megacal_admin_script_opts.settings_url + \"&unlink=true&nonce=\" + nonce;\r\n\r\n        } );\r\n\r\n        // Turn on/off check handle button\r\n        $registerHandleField.on( 'keyup', function() {\r\n\r\n            var $this = $( this );\r\n\r\n            if( $this.val() ) {\r\n                $checkHandleBtn.prop( 'disabled', false );\r\n            } else {\r\n                $checkHandleBtn.prop( 'disabled', true );\r\n            }\r\n\r\n        } );\r\n\r\n        // Check Handles\r\n        $checkHandleBtn.on( 'click', function( e ) {\r\n\r\n            e.preventDefault(); \r\n\r\n            var handle = $registerHandleField.val();\r\n            var _nonce = $( '#_megacal_check_handle_nonce' ).val();\r\n\r\n            var check_handle_data = {\r\n                action: 'megacal_check_handle',\r\n                handle,\r\n                _nonce,\r\n            };\r\n    \r\n            $.post(\r\n\r\n                megacal_admin_script_opts.ajax_url,\r\n                check_handle_data,\r\n                function( response ) {\r\n                    \r\n                    if( false == response.success ) {\r\n                        \r\n                        clearAlertNotification();\r\n                        showAlertNotification( response.data.message, 'error' );\r\n\r\n                        return;\r\n                    }\r\n\r\n                    var unique = response.data.unique;\r\n                    \r\n                    if( true == unique ) {\r\n                        $registerHandleField.removeClass( 'invalid' );\r\n                        $registerHandleField.addClass( 'valid' );\r\n                    } else {\r\n                        $registerHandleField.removeClass( 'valid' );\r\n                        $registerHandleField.addClass( 'invalid' );\r\n                    }\r\n\r\n                }\r\n\r\n            )\r\n            .fail( function() {\r\n\r\n                clearAlertNotification();\r\n                showAlertNotification( 'Something isn\\'t right...', 'error' );\r\n            \r\n            }); \r\n\r\n        });\r\n\r\n        // Registration form validation\r\n        $( '#megacal-register-form input' ).on( 'keyup', function() {\r\n\r\n            checkRequiredFields( $registerForm, $registerBtn );\r\n\r\n        });\r\n\r\n        // Register\r\n        $registerForm.on( 'submit', function( e ) {\r\n\r\n            e.preventDefault();\r\n            \r\n            var form = $( this )[0];\r\n            var formData = new FormData( form );\r\n            \r\n            if( !formData.get( 'firstname' ) ) {\r\n                alert( 'firstname cannot be empty' );\r\n                return;\r\n            }\r\n\r\n            if( !formData.get( 'lastname' ) ) {\r\n                alert( 'lastname cannot be empty' );\r\n                return;\r\n            }\r\n\r\n            if( !formData.get( 'handle' ) ) {\r\n                alert( 'handle cannot be empty' );\r\n                return;\r\n            }\r\n\r\n            if( !formData.get( 'email' ) ) {\r\n                alert( 'email cannot be empty' );\r\n                return;\r\n            }\r\n\r\n            if( !formData.get( 'calendarName' ) ) {\r\n                alert( 'calendarName cannot be empty' );\r\n                return;\r\n            }\r\n\r\n            var firstname = formData.get( 'firstname' );\r\n            var lastname = formData.get( 'lastname' );\r\n            var handle = formData.get( 'handle' );\r\n            var email = formData.get( 'email' );\r\n            var calendarName = formData.get( 'calendarName' );\r\n            var phone = formData.get( 'phone' );\r\n            var _nonce = formData.get( '_megacal_register_nonce' );\r\n\r\n            var registerData = {\r\n                action: 'megacal_register',\r\n                _nonce,\r\n                firstname,\r\n                lastname,\r\n                handle,\r\n                email,\r\n                calendarName,\r\n                phone,\r\n            }; \r\n\r\n            $.post(\r\n\r\n                megacal_admin_script_opts.ajax_url,\r\n                registerData,\r\n                function( response ) {\r\n                    \r\n                    if( false == response.success ) {\r\n                        clearAlertNotification();\r\n                        showAlertNotification( response.data.message, 'error' );\r\n                        return;\r\n                    }\r\n                    \r\n                    window.location = megacal_admin_script_opts.upgrade_url;\r\n\r\n                }\r\n\r\n            )\r\n            .fail( function() {\r\n\r\n                clearAlertNotification();\r\n                showAlertNotification( GENERIC_ERROR_MSG, 'error' );\r\n            \r\n            }); \r\n\r\n        });\r\n\r\n        var $manageEvents = $( '#megacal-manage-events' );\r\n        \r\n        if( $manageEvents.length > 0 ) {\r\n\r\n            var $saveEventWrap = $( '#save-event-wrap' );\r\n            var $calendar = $( '#megacal-manage-calendar' );\r\n            var currDate = new Date();\r\n            var changeTypeSelected = false;\r\n            var $approvalList = $( '#megacal-approval-list' );\r\n\r\n            $( '.megacal-filter-cat-btn' ).on( 'change', function() {\r\n                $calendar.eventCalendar( 'refresh' );\r\n            } );\r\n\r\n            $calendar.eventCalendar({\r\n\r\n                showImage: false,\r\n                showLegends: true,\r\n                showOwners: true,\r\n                timeFormat: megacal_admin_script_opts.time_fmt_setting,\r\n                dateFormat: {\r\n                    calendar: 'D',\r\n                    calendarFirst: 'MMM D',\r\n                },\r\n                showSlider: false,\r\n                loaderImageUrl: megacal_admin_script_opts.base_url + '/assets/img/loading.svg',\r\n                defaultEventImageUrl: megacal_admin_script_opts.default_image_path,\r\n                calendarCreate: (event, data) => {\r\n\r\n                }\r\n\r\n            }).on( 'eventcalendar.calendaraddevent', ( event, data ) => {\r\n                \r\n                var $preloader = $manageEvents.find( '.preloader' );\r\n                var $eventForm = $saveEventWrap.find( '#megacal-event-form' );\r\n\r\n                $preloader.removeClass( 'hidden' );\r\n                $eventForm.html( '' );\r\n                showAddEventForm();\r\n\r\n                loadEventForm( \r\n                    null, \r\n                    function( response ) {\r\n                            \r\n                        if( false == response.success ) {\r\n                            clearAlertNotification();\r\n                            showAlertNotification( response.data.message, 'error' );\r\n                            return;\r\n                        }\r\n                        \r\n                        $preloader.addClass( 'hidden' );\r\n                        $saveEventWrap.html( response.data.content );\r\n                        \r\n                        var $eventForm = $saveEventWrap.find( '#megacal-event-form' );\r\n                        var $eventSubmitBtn = $saveEventWrap.find( '.megacal-button-save-event' );\r\n                        \r\n                        registerEventFormActions( data.date );\r\n                        initWYSIWYGFields();\r\n\r\n                    }, \r\n                    function() {\r\n\r\n                        clearAlertNotification();\r\n                        showAlertNotification( GENERIC_ERROR_MSG, 'error' );\r\n\r\n                    }\r\n                );\r\n\r\n            }).on('eventcalendar.calendarviewchange', ( event, data ) => {\r\n                \r\n                currDate = data.date;\r\n                loadCalendarView( $calendar, data.date );\r\n\r\n            }).on('eventcalendar.eventclick', ( event, data ) => {\r\n                \r\n                if( !data.createdByMe ) {\r\n                    return;\r\n                }\r\n\r\n                var eventId = data.eventId;\r\n                var $preloader = $manageEvents.find( '.preloader' );\r\n                var $eventForm = $saveEventWrap.find( '#megacal-event-form' );\r\n                \r\n                $preloader.removeClass( 'hidden' );\r\n                $eventForm.html( '' );\r\n                showAddEventForm();\r\n\r\n                loadEventForm( \r\n                    eventId, \r\n                    function( response ) {\r\n                        \r\n                        var $preloader = $manageEvents.find( '.preloader' );\r\n\r\n                        if( false == response.success ) {\r\n                            clearAlertNotification();\r\n                            showAlertNotification( response.data.message, 'error' );\r\n                            return;\r\n                        }\r\n                        \r\n                        $preloader.addClass( 'hidden' );\r\n                        $saveEventWrap.html( response.data.content );\r\n                        \r\n                        var $eventForm = $saveEventWrap.find( '#megacal-event-form' );\r\n                        var $eventSubmitBtn = $saveEventWrap.find( '.megacal-button-save-event' );\r\n                        \r\n                        registerEventFormActions();\r\n                        initWYSIWYGFields();\r\n\r\n                    }, \r\n                    function() {\r\n\r\n                        clearAlertNotification();\r\n                        showAlertNotification( GENERIC_ERROR_MSG, 'error' );\r\n\r\n                    }\r\n                );\r\n\r\n            });\r\n\r\n            loadCalendarView( $calendar, currDate );\r\n            loadApprovalList();\r\n\r\n            function setEventApproval( approvalAction, btn ) {\r\n\r\n                var approvalNotice = btn.closest( '.approval-notice' );\r\n                var eventId = approvalNotice.data( 'event-id' );\r\n                var userId = approvalNotice.data( 'user-id' );\r\n                var _nonce = $( '#_megacal_set_event_approval_nonce' ).val();\r\n\r\n                var putApprovalData = {\r\n                    action: 'megacal_set_event_approval',\r\n                    _nonce,\r\n                    approvalAction,\r\n                };\r\n\r\n                switch( approvalAction ) {\r\n                    case 'approve':\r\n                    case 'deny':\r\n                        putApprovalData.userId = userId;\r\n                        putApprovalData.eventId = eventId;\r\n                        break;\r\n\r\n                    case 'always':\r\n                    case 'approve_pending':\r\n                    case 'deny_pending': \r\n                        putApprovalData.userId = userId;\r\n                        break;\r\n                }\r\n\r\n                $.post(\r\n\r\n                    megacal_admin_script_opts.ajax_url,\r\n                    putApprovalData,\r\n                    function( response ) {\r\n                        \r\n                        if( false == response.success ) {\r\n                            clearAlertNotification();\r\n                            showAlertNotification( response.data.message, 'error' )\r\n                            return;\r\n                        }\r\n\r\n                        console.log( response );\r\n    \r\n                        approvalNotice.fadeOut( 200, function() {\r\n                            $( this ).remove();\r\n                            loadApprovalList();\r\n                        });\r\n\r\n                        $calendar.eventCalendar( 'refresh' );\r\n\r\n                    }\r\n    \r\n                )\r\n                .fail( function() {\r\n    \r\n                    clearAlertNotification();\r\n                    showAlertNotification( GENERIC_ERROR_MSG, 'error' )\r\n                    \r\n                });\r\n\r\n            }\r\n            \r\n            /**\r\n             * Reload the event form via AJAX\r\n             * \r\n             * @param {int|null} eventId The event Id to prepopulate the fields - null value will generate an empty form\r\n             * @param {function} successCallback The callback to run on success\r\n             * @param {function} failureCallback The callback to run on failure\r\n             */\r\n            function loadEventForm( eventId, successCallback, failureCallback ) {\r\n\r\n                var _nonce = $( '#_megacal_get_event_upsert_nonce' ).val();\r\n                var eventId = eventId || null;\r\n\r\n                var eventUpsertData = {\r\n                    action: 'megacal_get_event_upsert',\r\n                    _nonce,\r\n                };\r\n\r\n                if( eventId !== null ) {\r\n                    eventUpsertData.eventId = eventId;\r\n                }\r\n\r\n                $.post(\r\n\r\n                    megacal_admin_script_opts.ajax_url,\r\n                    eventUpsertData,\r\n                    successCallback\r\n    \r\n                )\r\n                .fail( failureCallback ); \r\n\r\n            }\r\n\r\n            function registerEventFormActions( date ) {\r\n\r\n                var $eventForm = $( '#megacal-event-form' );\r\n                var $eventSubmitBtn = $( '.megacal-button-save-event' );\r\n                var $eventDeleteBtn = $( '.megacal-button-delete-event' );\r\n                var $allDayCheckbox = $( '#megacal-all-day' );\r\n                var $startTimeField = $( '#megacal-event-start-time' );\r\n                var $endTimeField = $( '#megacal-event-end-time' );\r\n                var $dateField = $( '#megacal-event-date' );\r\n                var $eventImgBtn = $( '#megacal-upload-event-img' );\r\n                var $eventRemoveBtn = $( '#megacal-remove-event-img' );\r\n                var $eventImgField = $( '#megacal-event-img' );\r\n                var $imgPreview = $( '#megacal-img-preview' );\r\n                var $venueField = $( '#megacal-event-venue-name' );\r\n                var $venueIdField = $( '#megacal-event-venue-id' );\r\n                var $categoryField = $( '#megacal-event-category-name' );\r\n                var $categoryIdField = $( '#megacal-event-category-id' );\r\n                var $venueLocationField = $( '#megacal-event-venue-location' ); \r\n                var $cancelBtn = $( '.megacal-button-cancel-edit-event' );\r\n                var $modalCancelBtn = $( '.megacal-button-cancel-save-delete');\r\n                var startDate = date ? new Date( date ) : false;\r\n                var $timepicker = $( '.timepicker' );\r\n                var recurrence = $( '#megacal-event-recurrence-details' ).val();\r\n                var recurrenceDetails = null;\r\n\r\n                if( '' !== recurrence.trim() ) {\r\n                    recurrenceDetails = JSON.parse( recurrence );\r\n                }\r\n\r\n                if( startDate ) {\r\n                    \r\n                    fmtDate = new Intl.DateTimeFormat( 'en-US', { \r\n                        month: '2-digit', \r\n                        day: '2-digit', \r\n                        year: 'numeric' \r\n                    } ).format( startDate );\r\n\r\n                    $dateField.val( fmtDate );\r\n\r\n                }\r\n\r\n                $cancelBtn.on( 'click', function( e ) {\r\n                    $saveEventWrap.fadeOut( 500 );\r\n                });\r\n\r\n                $modalCancelBtn.on( 'click', function( e ) {\r\n                    hideChangeTypeModal();\r\n                });\r\n\r\n                $eventDeleteBtn.on( 'click', function( e ) {\r\n\r\n                    if( !changeTypeSelected ) {\r\n                        var confirm = window.confirm( 'Are you sure you want to permanently delete this event?' );\r\n                        if( !confirm ) {\r\n                            return;\r\n                        }\r\n                    }\r\n\r\n                    if( recurrenceDetails && !changeTypeSelected ) {\r\n                        showChangeTypeModal( 'delete' );\r\n                        return;\r\n                    }\r\n\r\n                    var publishOptions = $( '#submitdiv' );\r\n                    var _nonce = publishOptions.find( '#_megacal_delete_event_nonce' ).val();\r\n                    var eventId = $eventForm.find( '#megacal-event-id' ).val();\r\n                    var formData = new FormData( $eventForm[0] );\r\n                    var eventChangeType = formData.get( 'eventChangeType' );\r\n\r\n                    var deleteEventData = {\r\n                        action: 'megacal_delete_event',\r\n                        _nonce,\r\n                        eventId,\r\n                        eventChangeType,\r\n                    };\r\n\r\n                    $.post(\r\n\r\n                        megacal_admin_script_opts.ajax_url,\r\n                        deleteEventData,\r\n                        function( response ) {\r\n                            \r\n                            if( false == response.success ) {\r\n                                clearAlertNotification();\r\n                                showAlertNotification( response.data.message, 'error' );\r\n                                return;\r\n                            }\r\n\r\n                            console.log( response );\r\n                            \r\n                            $saveEventWrap.fadeOut( 500, function() {\r\n                                $calendar.eventCalendar( 'refresh' );\r\n                            } );\r\n\r\n                        }\r\n        \r\n                    )\r\n                    .fail( function() {\r\n        \r\n                        clearAlertNotification();\r\n                        showAlertNotification( GENERIC_ERROR_MSG, 'error' );\r\n                        \r\n                    })\r\n                    .done( function() {\r\n                        hideChangeTypeModal();\r\n                    } );\r\n\r\n                } );\r\n\r\n                $dateField.datepicker({\r\n                    format: 'mm/dd/yyyy',\r\n                    todayHighlight: true,\r\n                    autoclose: true,\r\n                }).datepicker( 'update' );\r\n\r\n                $dateField.on( 'change', function() {\r\n                    \r\n                    checkRequiredFields( $eventForm, $eventSubmitBtn );\r\n                    fetchEventRecurrenceDetails();\r\n\r\n                });\r\n\r\n                $timepicker.each( function() {\r\n                \r\n                    var val = $( this ).val();\r\n\r\n                    $( this ).wickedpicker({\r\n                        now: val || '12:00',\r\n                        minutesInterval: 5,\r\n                        clearable: true,\r\n                    });\r\n\r\n                    if( !val ) {\r\n                        $( this ).val( '' ); // Default state - no value\r\n                    }\r\n\r\n                });\r\n\r\n                $venueField.select2({\r\n                    placeholder: 'Tag or Add a Venue',\r\n                    tags: true,\r\n                    allowClear: true,\r\n                    createTag: function( tag ) {\r\n\r\n                        // Case-insensitive tagging\r\n                        var found = false;\r\n\r\n                        $venueField.find( 'option' ).each( function() {\r\n                            \r\n                            if( $.trim( tag.term ).toUpperCase() === $.trim( $( this ).text() ).toUpperCase() ) {\r\n                                found = true;\r\n                            }\r\n\r\n                        });\r\n                \r\n                        if( !found ) {\r\n                            \r\n                            // Also don't allow purely numeric venue names\r\n                            if( $.isNumeric( tag.term ) ) {\r\n                                return {};\r\n                            }\r\n\r\n                            return {\r\n                                id: tag.term,\r\n                                text: tag.term + \" (new)\",\r\n                                isNew: true\r\n                            };\r\n\r\n                        }\r\n\r\n                    },\r\n                    language: {\r\n                        noResults: function( params ){\r\n                            return \"Type to add a venue.\";\r\n                        }\r\n                    },\r\n                });\r\n\r\n                $venueField.on( 'change', function() {\r\n\r\n                    var val = $( this ).val();\r\n                    var location = $( this ).find( 'option[value=\"' + val + '\"]' ).data( 'location' );\r\n\r\n                    if( $.isNumeric( val ) ) {\r\n                        \r\n                        $venueIdField.val( val );\r\n                        $venueLocationField.val( location ).prop( 'disabled', true );\r\n\r\n                    } else {\r\n\r\n                        $venueIdField.val( '' );\r\n                        $venueLocationField.val( '' ).prop( 'disabled', false );\r\n\r\n                    }\r\n\r\n                    checkRequiredFields( $eventForm, $eventSubmitBtn );\r\n\r\n                });\r\n\r\n                $categoryField.select2({\r\n                    placeholder: 'Tag or Add an Event Category',\r\n                    tags: true,\r\n                    createTag: function( tag ) {\r\n\r\n                        // Case-insensitive tagging\r\n                        var found = false;\r\n\r\n                        $categoryField.find( 'option' ).each( function() {\r\n                            \r\n                            if( $.trim( tag.term ).toUpperCase() === $.trim( $( this ).text() ).toUpperCase() ) {\r\n                                found = true;\r\n                            }\r\n\r\n                        });\r\n                \r\n                        if( !found ) {\r\n                            \r\n                            // Also don't allow purely numeric venue names\r\n                            if( $.isNumeric( tag.term ) ) {\r\n                                return {};\r\n                            }\r\n\r\n                            return {\r\n                                id: tag.term,\r\n                                text: tag.term + \" (new)\",\r\n                                isNew: true\r\n                            };\r\n\r\n                        }\r\n\r\n                    },\r\n                    language: {\r\n                        noResults: function( params ){\r\n                            return \"No Existing Categories Found\";\r\n                        }\r\n                    },\r\n                });\r\n\r\n                $categoryField.on( 'change', function() {\r\n\r\n                    var val = $( this ).val();\r\n\r\n                    if( $.isNumeric( val ) ) {\r\n                        $categoryIdField.val( val );\r\n                    } else {\r\n                        $categoryIdField.val( '' );\r\n                    }\r\n\r\n                    checkRequiredFields( $eventForm, $eventSubmitBtn );\r\n\r\n                });\r\n    \r\n                $( '#megacal-event-form input' ).on( 'keyup', function() {\r\n                    checkRequiredFields( $eventForm, $eventSubmitBtn );\r\n                });\r\n\r\n                if( $allDayCheckbox.prop( 'checked' ) ) {\r\n                    \r\n                    $startTimeField.hide().removeClass( 'required' );\r\n                    $endTimeField.hide().removeClass( 'required' );\r\n\r\n                }\r\n\r\n                $allDayCheckbox.on( 'change', function() {\r\n    \r\n                    var checked = $( this ).prop( 'checked' );\r\n    \r\n                    if( checked ) {\r\n    \r\n                        $startTimeField.hide().removeClass( 'required' );\r\n                        $endTimeField.hide().removeClass( 'required' );\r\n                        \r\n                    } else {\r\n    \r\n                        $startTimeField.show().addClass( 'required' );\r\n                        $endTimeField.show().addClass( 'required' );\r\n    \r\n                    }\r\n    \r\n                    checkRequiredFields( $eventForm, $eventSubmitBtn );\r\n    \r\n                });\r\n\r\n                $eventForm.find( 'input' ).on( 'blur, focus', function() { checkRequiredFields( $eventForm, $eventSubmitBtn ); } );\r\n    \r\n                // Form Submission\r\n                $eventForm.on( 'submit', function( e ) {\r\n    \r\n                    e.preventDefault();\r\n\r\n                    if( tinyMCE ) {\r\n                        tinyMCE.triggerSave();\r\n                    }\r\n                    \r\n                    var form = $( this )[0];\r\n                    var formData = new FormData( form );\r\n\r\n                    if( recurrenceDetails && !changeTypeSelected ) {\r\n                        showChangeTypeModal( 'update' );\r\n                    } else {\r\n                        saveEvent( formData );\r\n                    }\r\n    \r\n                });\r\n    \r\n                // Image Uploads\r\n                $eventImgBtn.on( 'click', function( e ) {\r\n    \r\n                    e.preventDefault();\r\n    \r\n                    checkRequiredFields( $eventForm, $eventSubmitBtn );\r\n\r\n                    customUploader = wp.media({\r\n    \r\n                        title: 'Upload Event Image',\r\n                        library : {\r\n                            type : 'image'\r\n                        },\r\n                        button: {\r\n                            text: 'Use this image' // button label text\r\n                        },\r\n                        multiple: false\r\n    \r\n                    }).on('select', function() { // it also has \"open\" and \"close\" events\r\n    \r\n                        var attachment = customUploader.state().get( 'selection' ).first().toJSON();\r\n                        $eventImgBtn.hide();\r\n                        $imgPreview.attr( 'src', attachment.url ).show();\r\n                        $eventRemoveBtn.show();\r\n                        $eventImgField.val( attachment.url );\r\n    \r\n                    }).open();\r\n    \r\n                });\r\n    \r\n                $eventRemoveBtn.on( 'click', function( e ) {\r\n    \r\n                    e.preventDefault();\r\n\r\n                    checkRequiredFields( $eventForm, $eventSubmitBtn );\r\n    \r\n                    $imgPreview.hide();\r\n                    $eventRemoveBtn.hide();\r\n                    $eventImgBtn.show();\r\n                    $eventImgField.val( '' );\r\n    \r\n                });\r\n\r\n                fetchEventRecurrenceDetails( recurrenceDetails );\r\n\r\n            }\r\n\r\n            function showChangeTypeModal( action ) {\r\n                var $modal = $( '#megacal-change-type-modal' );\r\n\r\n                $modal.show();\r\n                $( '#megacal-admin-mask' ).show();\r\n\r\n                if( action === 'update' ) {\r\n                    $( '#megacal-change-type-this' ).prop( 'checked', true );\r\n                    $( '#megacal-change-type-options' ).show();\r\n                    $modal.find( '.megacal-button-delete-event' ).hide();\r\n                    $modal.find( '.megacal-button-save-event' ).show();\r\n                    $modal.find( '#megacal-change-type-this' ).focus();\r\n                } else if( action === 'delete' ) {\r\n                    $( '#megacal-delete-type-this' ).prop( 'checked', true );\r\n                    $( '#megacal-delete-type-options' ).show();\r\n                    $modal.find( '.megacal-button-delete-event' ).show();\r\n                    $modal.find( '.megacal-button-save-event' ).hide();\r\n                    $modal.find( '#megacal-delete-type-this' ).focus();\r\n                }\r\n\r\n                changeTypeSelected = true;\r\n            }\r\n\r\n            function hideChangeTypeModal() {\r\n                $( '#megacal-change-type-modal' ).hide();\r\n                $( '#megacal-admin-mask' ).hide();\r\n                $( '#megacal-change-type-options' ).hide();\r\n                $( '#megacal-delete-type-options' ).hide();\r\n                $( '.megacal-button-save-event' ).focus();\r\n                \r\n                changeTypeSelected = false;\r\n            }\r\n\r\n            function saveEvent( formData ) {\r\n\r\n                var _nonce = formData.get( '_megacal_event_upsert_nonce' );\r\n                var eventId = formData.get( 'eventId' );\r\n                var eventTitle = formData.get( 'eventTitle' );\r\n                var eventDate = formData.get( 'eventDate' );\r\n                var eventAllDay = formData.get( 'eventAllDay' );\r\n                var eventStartTime = formData.get( 'eventStartTime' );\r\n                var eventEndTime = formData.get( 'eventEndTime' );\r\n                var eventImg = formData.get( 'eventImg' );\r\n                var eventVenueId = formData.get( 'eventVenueId' );\r\n                var eventVenueName = formData.get( 'eventVenueName' );\r\n                var eventVenueLocation = formData.get( 'eventVenueLocation' );\r\n                var eventCatId = formData.get( 'eventCatId' );\r\n                var eventCatName = formData.get( 'eventCatName' );\r\n                var eventOrganizer = formData.get( 'megacal-event-organizer' );\r\n                var eventFacebookUrl = formData.get( 'eventFacebookUrl' );\r\n                var eventTicketUrl = formData.get( 'eventTicketUrl' );\r\n                var eventPrice = formData.get( 'eventPrice' );\r\n                var eventTaggedUsers = formData.getAll( 'eventTaggedUsers' );\r\n                var eventTaggedUsersExtra = formData.get( 'eventTaggedUsersExtra' );\r\n                var megacalEventDescription = formData.get( 'megacal-event-description' );\r\n                var megacalEventPrivateNotes = formData.get( 'megacal-event-private-notes' );\r\n                var published = formData.get( 'publishEvent' );\r\n                var eventRecurrence = formData.get( 'eventRecurrence' );\r\n                var eventRecurrenceRepetition = formData.get( 'eventRecurrenceRepetition' );\r\n                var eventRecurrenceCustomType = formData.get( 'eventRecurrenceCustomType' );\r\n                var eventRecurrenceCustomMonthlyFreq = formData.get( 'eventRecurrenceCustomMonthlyFreq' );\r\n                var eventRecurrenceWeeklyDays = formData.getAll( 'eventRecurrenceWeeklyDays' );\r\n                var eventRecurrenceEnd = formData.get( 'eventRecurrenceEnd' );\r\n                var eventRecurrenceEndDate = formData.get( 'eventRecurrenceEndDate' );\r\n                var eventRecurrenceEndOccurrence = formData.get( 'eventRecurrenceEndOccurrence' );\r\n                var eventRecurrenceDayOfWeek = formData.get( 'eventRecurrenceDayOfWeek' );\r\n                var eventRecurrenceWeekOfMonth = formData.get( 'eventRecurrenceWeekOfMonth' );\r\n                var eventRecurrenceLastDayOfWeek = formData.get( 'eventRecurrenceLastDayOfWeek' );\r\n                var eventRecurrenceDayOfMonth = formData.get( 'eventRecurrenceDayOfMonth' );\r\n                var eventRecurrenceMonth = formData.get( 'eventRecurrenceMonth' );\r\n                var eventChangeType = formData.get( 'eventChangeType' );\r\n\r\n                var saveEventData = {\r\n                    action: 'megacal_save_event',\r\n                    _nonce,\r\n                    eventId,\r\n                    eventTitle,\r\n                    eventDate,\r\n                    eventAllDay,\r\n                    eventStartTime,\r\n                    eventEndTime,\r\n                    eventImg,\r\n                    eventVenueId,\r\n                    eventVenueName,\r\n                    eventVenueLocation,\r\n                    eventCatId,\r\n                    eventCatName,\r\n                    eventOrganizer,\r\n                    eventFacebookUrl,\r\n                    eventTicketUrl,\r\n                    eventPrice,\r\n                    eventTaggedUsers,\r\n                    eventTaggedUsersExtra,\r\n                    megacalEventDescription,\r\n                    megacalEventPrivateNotes,\r\n                    published,\r\n                    eventRecurrence,\r\n                    eventRecurrenceRepetition,\r\n                    eventRecurrenceCustomType,\r\n                    eventRecurrenceCustomMonthlyFreq,\r\n                    eventRecurrenceWeeklyDays,\r\n                    eventRecurrenceEnd,\r\n                    eventRecurrenceEndDate,\r\n                    eventRecurrenceEndOccurrence,\r\n                    eventRecurrenceDayOfWeek,\r\n                    eventRecurrenceWeekOfMonth,\r\n                    eventRecurrenceLastDayOfWeek,\r\n                    eventRecurrenceDayOfMonth,\r\n                    eventRecurrenceMonth,\r\n                    eventChangeType,\r\n                };\r\n                \r\n                $.post(\r\n\r\n                    megacal_admin_script_opts.ajax_url,\r\n                    saveEventData,\r\n                    function( response ) {\r\n\r\n                        if( false == response.success ) {\r\n                            clearAlertNotification();\r\n                            showAlertNotification( response.data.message, 'error' );\r\n\r\n                            console.log( response );\r\n                            return;\r\n                        }\r\n                        \r\n                        $saveEventWrap.fadeOut( 500 );\r\n                        $calendar.eventCalendar( 'refresh' );\r\n\r\n                        // Refresh cached venues if a new one was added \r\n                        if( '' == eventVenueId ) {\r\n\r\n                            var _nonce = $( '#_megacal_get_event_upsert_nonce' ).val();\r\n                            var eventId = response.data.eventId;\r\n\r\n                            var eventUpsertData = {\r\n                                action: 'megacal_get_event_upsert',\r\n                                _nonce,\r\n                                eventId: eventId,\r\n                            };\r\n            \r\n                            $.post(\r\n            \r\n                                megacal_admin_script_opts.ajax_url,\r\n                                eventUpsertData,\r\n                                function( response ) {\r\n                                    \r\n                                    if( false == response.success ) {\r\n                                        clearAlertNotification();\r\n                                        showAlertNotification( response.data.message, 'error' );\r\n\r\n                                        console.log( response );\r\n                                        return;\r\n                                    }\r\n\r\n                                }\r\n                                \r\n                            );\r\n\r\n                        }\r\n    \r\n                    }\r\n    \r\n                )\r\n                .fail( function() {\r\n    \r\n                    clearAlertNotification();\r\n                    showAlertNotification( GENERIC_ERROR_MSG, 'error' );\r\n                    changeTypeSelected = false;\r\n\r\n                })\r\n                .done( function() {\r\n                    hideChangeTypeModal(); \r\n                } );\r\n\r\n            }\r\n\r\n            function fetchEventRecurrenceDetails( recurrence ) {\r\n\r\n                var $eventRecurrenceContainer = $( '.megacal-event-recurrence-container' );\r\n                \r\n                var $select = $eventRecurrenceContainer.find( '#eventRecurrenceSelect' );\r\n                var selectVal = $select ? $select.val() : false;\r\n\r\n                var $radio = $eventRecurrenceContainer.find( '.eventRecurrenceEnd:checked' );\r\n                var radioVal = $radio ? $radio.val() : false;\r\n\r\n                var $customRecurrenceTypeSelectOr = $( '#eventRecurrenceCustomType' );\r\n                var customRecurrenceTypeVal = $customRecurrenceTypeSelectOr ? $customRecurrenceTypeSelectOr.val() : false;\r\n\r\n                var $dateField = $( '#megacal-event-date' );\r\n                var date = $dateField.val();\r\n                var eventId = $( '#megacal-event-id' ).val().trim() ? parseInt( $( '#megacal-event-id' ).val().trim() ) : 0;\r\n\r\n                var $endsDetailsContainer = $( '.megacal-ends-details-container' );\r\n                var endsExpanded = $endsDetailsContainer.length > 0 ? !$endsDetailsContainer.hasClass( 'collapsed' ) : false;\r\n                var showRecurrence = true;\r\n\r\n                if( !recurrence && eventId > 0 ) {\r\n                    showRecurrence = false;\r\n                }\r\n\r\n                if( recurrence ) {\r\n                    selectVal = recurrence.type;\r\n\r\n                    if( 'CUSTOM' === recurrence.type ) {\r\n                        customRecurrenceTypeVal = recurrence.custom.type||customRecurrenceTypeVal;\r\n                        radioVal = recurrence.custom.end_condition||radioVal;\r\n                    }\r\n                }\r\n\r\n                // Remove content\r\n                var _nonce = $( '#_megacal_event_recurrence_nonce' ).val();\r\n\r\n                $.post(\r\n\r\n                    megacal_admin_script_opts.ajax_url,\r\n                    { \r\n                        action: 'megacal_get_event_recurrence',\r\n                        _nonce,\r\n                        date: date || null,\r\n                        showRecurrence,\r\n                    },\r\n                    function( response ) {\r\n\r\n                        if( false == response.success ) {\r\n                            clearAlertNotification();\r\n                            showAlertNotification( response.data.message, 'error' );\r\n                            return;\r\n                        }\r\n\r\n                        $eventRecurrenceContainer.html( response.data.content );\r\n\r\n                        var recurrence_details = response.data.recurrence_details;\r\n                        if( recurrence_details ) {\r\n\r\n                            var $eventRecurrenceRepetition = $( '#eventRecurrenceRepetition' );\r\n                            var $eventRecurrenceEndDate = $( '#eventRecurrenceEndDate' );\r\n                            var $eventRecurrenceEndOccurrence = $( '#eventRecurrenceEndOccurrence' );\r\n                            var $customRecurrenceTypeSelect = $( '#eventRecurrenceCustomType' );\r\n                            var $customRecurrenceMonthlyFreq = $( '#eventRecurrenceCustomMonthlyFreq' );\r\n                            var $customRecurrenceWeeklyDays = $( '#eventRecurrenceWeeklyDays' );\r\n                            var $eventRecurrenceSelect = $eventRecurrenceContainer.find( '#eventRecurrenceSelect' );\r\n                            var $customRecurrenceDetailsSection = $eventRecurrenceContainer.find( '.megacal-custom-recurrence-details' );\r\n\r\n                            // Reselect options after date change\r\n                            if( selectVal ) {\r\n                                \r\n                                $eventRecurrenceSelect.val( selectVal );\r\n\r\n                                if( 'CUSTOM' === selectVal ) {\r\n                                    $customRecurrenceDetailsSection.show();\r\n                                }\r\n\r\n                            }\r\n\r\n                            if( radioVal ) {\r\n                                $eventRecurrenceContainer.find( '.eventRecurrenceEnd[value=\"' + radioVal + '\"]' ).prop( 'checked', true );\r\n                            }\r\n\r\n                            if( customRecurrenceTypeVal ) {\r\n                                $customRecurrenceTypeSelect.val( customRecurrenceTypeVal );\r\n                            }\r\n\r\n                            if( $eventRecurrenceSelect.val() === 'CUSTOM' ) {\r\n                                $( '.megacal-custom-recurrence-details' ).removeClass( 'hidden' );\r\n                            }\r\n\r\n                            var customRecurrenceType = $customRecurrenceTypeSelect.val().toLowerCase();\r\n                            var customDetail = recurrence_details.custom;\r\n                            var detailVals = customDetail[customRecurrenceType + '_custom'];\r\n                            var fmtEndDate = moment( detailVals.end_condition.on, 'YYYY-MM-DD' ).format( 'MM/DD/YYYY' );\r\n                            var afterOccurrence = detailVals.end_condition.after_occurrence;\r\n                            var repetition = customDetail.repetition;\r\n\r\n                            if( recurrence ) {\r\n\r\n                                if( recurrence.custom ) {\r\n                                    var recurrenceDetails = recurrence.custom[customRecurrenceType + '_custom'];\r\n                                    repetition = recurrence.custom.repetition||repetition;\r\n\r\n                                    if( recurrenceDetails.repeat_on ) {\r\n                                        $( '.eventRecurrenceWeeklyDays' ).prop( 'checked', false );\r\n                                        $( '.eventRecurrenceWeeklyDays' ).each( function() {\r\n                                            var $this = $( this );\r\n\r\n                                            if( recurrenceDetails.repeat_on.indexOf( $this.val() ) > -1 ) {\r\n                                                $( this ).prop( 'checked', true );\r\n                                            }\r\n                                        });\r\n                                    }\r\n\r\n                                    if( recurrenceDetails.day_of_week ) {\r\n                                        var weekOfMonth = recurrenceDetails.week_of_month;\r\n                                        $( '#eventRecurrenceCustomMonthlyFreq' ).val( 'week_of_month-' + weekOfMonth );\r\n                                    }\r\n\r\n                                    if( recurrence.custom.end_condition ) {\r\n                                        if( recurrence.custom.end_condition.on ) {\r\n                                            fmtEndDate = moment( recurrence.custom.end_condition.on, 'YYYY-MM-DD' ).format( 'MM/DD/YYYY' );\r\n                                            endsExpanded = true;\r\n                                            $eventRecurrenceContainer.find( '#eventRecurrenceEndDateOp' ).prop( 'checked', true );\r\n                                        } else if( recurrence.custom.end_condition.after_occurrence > 0 ) {\r\n                                            afterOccurrence = recurrence.custom.end_condition.after_occurrence;\r\n                                            endsExpanded = true;\r\n                                            $eventRecurrenceContainer.find( '#eventRecurrenceEndOccurrenceOp' ).prop( 'checked', true );\r\n                                        }\r\n                                    }\r\n                                }\r\n                                \r\n                            }\r\n\r\n                            $eventRecurrenceRepetition.val( repetition );\r\n                            $eventRecurrenceEndDate.val( fmtEndDate );\r\n                            $eventRecurrenceEndOccurrence.val( afterOccurrence );\r\n\r\n                            // expand/collapse ends details\r\n                            if( endsExpanded ) {\r\n                                var $newEndsDetailsContainer = $eventRecurrenceContainer.find( '.megacal-ends-details-container' );\r\n                                var $toggle = $eventRecurrenceContainer.find( '.collapsable-toggle' );\r\n                                $toggle.find( '.icon-chevron-right' ).removeClass( 'icon-chevron-right' ).addClass( 'icon-chevron-down' );\r\n                                $newEndsDetailsContainer.removeClass( 'collapsed' );\r\n                            }\r\n\r\n                            // re-register event listeners\r\n                            $eventRecurrenceSelect.on( 'change', function() {\r\n\r\n                                if( 'CUSTOM' === $( this ).val() ) {\r\n                                    $customRecurrenceDetailsSection.slideDown();\r\n                                } else {\r\n                                    $customRecurrenceDetailsSection.slideUp();\r\n                                }\r\n\r\n                            } );\r\n\r\n                            if( 'WEEKLY' === $customRecurrenceTypeSelect.val() ) {    \r\n                                $customRecurrenceWeeklyDays.removeClass( 'hidden' );\r\n                            } else if( 'MONTHLY' === $customRecurrenceTypeSelect.val() ) {\r\n                                $customRecurrenceMonthlyFreq.removeClass( 'hidden' );\r\n                            }\r\n\r\n                            $customRecurrenceTypeSelect.on( 'change', function() {\r\n                                fetchEventRecurrenceDetails();\r\n                            } );\r\n\r\n                            // Register datepicker\r\n                            $eventRecurrenceContainer.find( '#eventRecurrenceEndDate' ).datepicker({\r\n                                format: 'mm/dd/yyyy',\r\n                                todayHighlight: true,\r\n                                autoclose: true,\r\n                            }).datepicker( 'update' );\r\n\r\n                            $( '#eventRecurrenceEndOccurrence' ).on( 'click', function() {\r\n                                $('#eventRecurrenceEndOccurrenceOp' ).prop( 'checked', true );\r\n                            } );\r\n                            \r\n                            $( '#eventRecurrenceEndDate' ).on( 'click', function() {\r\n                                $('#eventRecurrenceEndDateOp' ).prop( 'checked', true );\r\n                            } );\r\n\r\n                            $( '.eventRecurrenceWeeklyDays' ).on( 'click', function() {\r\n                                \r\n                                var $weeklyDaysCBs = $( '.eventRecurrenceWeeklyDays' );\r\n                                var $selectedDayCB;\r\n                                var defaultDay = customDetail.weekly_custom.selected_day_of_week;\r\n                                var allEmpty = true;\r\n\r\n                                $weeklyDaysCBs.each( function() {\r\n\r\n                                    if( $( this ).prop( 'checked' ) === true ) {\r\n                                        allEmpty = false;\r\n                                    }\r\n\r\n                                    if( $( this ).val() !== defaultDay )\r\n                                        return;\r\n\r\n                                    $selectedDayCB = $( this );\r\n\r\n                                } );\r\n\r\n                                if( allEmpty ) {\r\n                                    $selectedDayCB.prop( 'checked', true );\r\n                                }\r\n\r\n                            } );\r\n\r\n                        }\r\n\r\n                    }\r\n    \r\n                )\r\n                .fail( function() {\r\n                    clearAlertNotification();\r\n                    showAlertNotification( GENERIC_ERROR_MSG, 'error' );\r\n                    return;\r\n                } )\r\n                .done( function() {\r\n\r\n                    var $eventForm = $( '#megacal-event-form' );\r\n                    var $eventSubmitBtn = $( '.megacal-button-save-event' );\r\n\r\n                    checkRequiredFields( $eventForm, $eventSubmitBtn );\r\n\r\n                } );\r\n                \r\n            }\r\n\r\n            function initWYSIWYGFields() {\r\n\r\n                if( !tinyMCE )\r\n                    return; // Safeguard, should never happen\r\n                    \r\n                var $eventForm = $( '#megacal-event-form' );\r\n                var $eventSubmitBtn = $( '.megacal-button-save-event' );\r\n\r\n                $saveEventWrap.find( '.wp-editor-area' ).each( function() {\r\n                    \r\n                    var id = $( this ).attr( 'id' );\r\n\r\n                    // xxx: Need to jump through some hoops to properly render WYSIWYG editors after AJAX\r\n                    \r\n                    tinyMCEPreInit.mceInit[id].setup = function( ed ) {\r\n\r\n                        ed.on( 'keyup', function() {\r\n                            checkRequiredFields( $eventForm, $eventSubmitBtn );\r\n                        });\r\n\r\n                    };\r\n\r\n                    tinyMCE.init( tinyMCEPreInit.mceInit[id] ); // don't change the settings\r\n                    \r\n                    // Render the editor\r\n                    tinyMCE.execCommand( 'mceRemoveEditor', false, id ); \r\n                    tinyMCE.execCommand( 'mceAddEditor', false, id ); \r\n\r\n                    quicktags( { id } ); // Text view quicktag buttons\r\n\r\n                });\r\n\r\n            }\r\n\r\n            function showAddEventForm() {\r\n            \r\n                $saveEventWrap.fadeIn( 500, function() {\r\n                    $( '#megacal-event-title' ).focus();\r\n                } );\r\n\r\n            }\r\n\r\n            function loadCalendarView( $eventCalendar, date ) {\r\n\r\n                const format = 'YYYY-MM-DD';\r\n                const aMoment = moment( date ).hours(0)\r\n                    .minutes(0)\r\n                    .seconds(0)\r\n                    .milliseconds(0);\r\n\r\n                const startDate = aMoment.clone().startOf( 'month' ).startOf( 'week' ).format( format );\r\n                const endDate = aMoment.clone().endOf( 'month' ).endOf( 'week' ).format( format );\r\n    \r\n                var _nonce = $( '#_megacal_fetch_events_nonce' ).val();\r\n                var $filterForm = $( '#megacal-manage-filter-form' );\r\n                var formData = new FormData( $filterForm[0] );\r\n\r\n                var eventCategories = formData.getAll( 'megacalFilterCategories' );\r\n\r\n                $eventCalendar.eventCalendar( 'showLoader' );\r\n\r\n                var fetchEventsData = {\r\n                    action: 'megacal_fetch_calendar_events',\r\n                    _nonce,\r\n                    startDate,\r\n                    endDate,\r\n                    eventCategories,\r\n                };\r\n\r\n                $.post(\r\n\r\n                    megacal_admin_script_opts.ajax_url,\r\n                    fetchEventsData,\r\n                    function( response ) {\r\n                        \r\n                        if( false == response.success ) {\r\n                            clearAlertNotification();\r\n                            showAlertNotification( response.data.message, 'error' );\r\n                            return;\r\n                        }\r\n                        \r\n                        $eventCalendar.eventCalendar( \r\n                            'option', \r\n                            'events', \r\n                            { \r\n                                'events': response.data.events \r\n                            } \r\n                        );\r\n\r\n                    }\r\n\r\n                )\r\n                .fail( function() {\r\n                    \r\n                })\r\n                .done( function() {\r\n                    $eventCalendar.eventCalendar( 'hideLoader' );\r\n                });\r\n            };\r\n\r\n            function loadApprovalList() {\r\n\r\n                var _nonce = $( '#megacal_get_approval_list_nonce' ).val();\r\n                var getApprovalListData = {\r\n                    action: 'megacal_get_approval_list',\r\n                    _nonce\r\n                };\r\n\r\n                $.post(\r\n                    megacal_admin_script_opts.ajax_url,\r\n                    getApprovalListData,\r\n                    function( response ) {\r\n                        \r\n                        if( false == response.success ) {\r\n                            clearAlertNotification();\r\n                            showAlertNotification( response.data.message, 'error' );\r\n                            return;\r\n                        }\r\n\r\n                        $approvalList.html( response.data.content );\r\n\r\n                        var $approvalActionBtn = $( '.button-approval-action' );\r\n                        $approvalActionBtn.on( 'click', function( e ) {\r\n            \r\n                            e.preventDefault();\r\n                            setEventApproval( $( this ).data( 'action' ), $( this ) );\r\n            \r\n                        });\r\n\r\n                    }\r\n                ).fail( function() {\r\n                    clearAlertNotification();\r\n                    showAlertNotification( GENERIC_ERROR_MSG, 'error' );\r\n                });\r\n\r\n            }\r\n            \r\n        }\r\n\r\n        var $manageRelationships = $( '.megacal-manage-relationships-page' );\r\n\r\n        if( $manageRelationships.length > 0 ) {\r\n\r\n            var isDirty = false;\r\n\r\n            $( window ).on( 'load', function() {\r\n                window.addEventListener(\"beforeunload\", function (e) {\r\n\r\n                    if( !isDirty ) {\r\n                        return undefined;\r\n                    }\r\n                    \r\n                    var confirmationMessage = 'Changes you made on this page may not be saved';\r\n            \r\n                    (e || window.event).returnValue = confirmationMessage; //Gecko + IE\r\n                    return confirmationMessage; //Gecko + Webkit, Safari, Chrome etc.\r\n\r\n                });\r\n            } );\r\n\r\n            // Edit button functionality\r\n            $( '.megacal-relationship-edit-btn' ).on( 'click', function( e ) {\r\n\r\n                e.preventDefault();\r\n                isDirty = true;\r\n\r\n                var $this = $( this );\r\n                var $form = $this.closest( '.megacal-manage-relationship-form' );\r\n\r\n                var $inputs = $form.find( 'input, textarea' );\r\n                var $nameInput;\r\n                $inputs.each( function() {\r\n                    $( this ).prop( 'readonly', false );\r\n                    $( this ).prop( 'disabled', false );\r\n\r\n                    if( $( this ).attr( 'name' ) == 'name' ) {\r\n                        $nameInput = $( this );\r\n                    }\r\n                });\r\n\r\n                if( $nameInput ) {\r\n                    $nameInput.focus();\r\n                }\r\n\r\n                $form.find( '.megacal-relationship-save-btn' ).prop( 'disabled', false );\r\n                $this.prop( 'disabled', true );\r\n\r\n            } );\r\n\r\n            $( '.megacal-manage-relationship-form' ).on( 'submit', function( e ) {\r\n\r\n                e.preventDefault();\r\n\r\n                var $form = $( this );\r\n                var _nonce = $( '#megacal_update_relationships_nonce' ).val();\r\n                var form = $form[0];\r\n                var formData = new FormData( form );\r\n                var type = formData.get( 'type' );\r\n                var $inputs = $form.find( 'input, textarea' );\r\n\r\n                $form.find( '.megacal-relationship-save-btn' ).prop( 'disabled', true );\r\n                \r\n                var putRelationshipData = {\r\n                    name: formData.get( 'name' ),\r\n                    published: formData.get( 'published' ),\r\n                    _nonce,\r\n                    action: 'megacal_update_' + type + '_details',\r\n                };\r\n\r\n                putRelationshipData[type + '_id'] = formData.get( 'id' );\r\n\r\n                if( 'venue' === type ) {\r\n                    putRelationshipData.location = formData.get( 'location' );\r\n                }\r\n\r\n                $.post(\r\n\r\n                    megacal_admin_script_opts.ajax_url,\r\n                    putRelationshipData,\r\n                    function( response ) {\r\n                        \r\n                        clearAlertNotification();\r\n                        $form.find( '.megacal-relationship-save-btn' ).prop( 'disabled', true );\r\n                        $form.find( '.megacal-relationship-edit-btn' ).prop( 'disabled', false );\r\n\r\n                        if( false == response.success ) {\r\n                            showAlertNotification( response.data.message, 'error' );\r\n                            return;\r\n                        }\r\n\r\n                        isDirty = false;\r\n\r\n                        $inputs.each( function() {\r\n                            var $this = $( this );\r\n\r\n                            if( $this.attr( 'type' ) === 'checkbox' ) {\r\n                                $( this ).prop( 'disabled', true );\r\n                            } else {\r\n                                $( this ).prop( 'readonly', true );\r\n                            }\r\n                        });\r\n\r\n                    }\r\n    \r\n                )\r\n                .fail( function() {\r\n    \r\n                    clearAlertNotification();\r\n                    showAlertNotification( GENERIC_ERROR_MSG, 'error' );\r\n                    $form.find( '.megacal-relationship-save-btn' ).prop( 'disabled', false );\r\n                    \r\n                });\r\n\r\n            } );\r\n        }\r\n\r\n        var $alertNotice = $( '#alert-notice' );\r\n        var alertState = '';\r\n\r\n        $alertNotice.find( '.alert-notice-close' ).on( 'click', function( e ) {\r\n            e.preventDefault();\r\n            clearAlertNotification();\r\n        } );\r\n\r\n        /**\r\n         * Displays an alert notice\r\n         * \r\n         * @param string msg The message to add to the notice \r\n         * @param string type The type of notice to show - One of 'success', 'error', 'info'. Custom strings can be used and will result in a 'mystring-notice' class. \r\n         */\r\n        function showAlertNotification( msg, type ) {\r\n\r\n            alertState = type + '-notice';\r\n\r\n            $alertNotice.addClass( alertState );\r\n            $alertNotice.find( '.alert-notice-inner' ).html( '<p>' + msg + '</p>' );\r\n            $alertNotice.removeClass( 'hidden' );\r\n\r\n            $( 'html, body' ).animate({ scrollTop: 0 });\r\n\r\n        }\r\n\r\n        function clearAlertNotification() {\r\n\r\n            $alertNotice.addClass( 'hidden' );\r\n            $alertNotice.removeClass( alertState );\r\n            $alertNotice.find( '.alert-notice-inner' ).html( '' );\r\n\r\n        }\r\n\r\n        // Shortcode Fields\r\n        megacalShortcodeFieldUpdate({ \r\n            event_type: 'change', \r\n            field_selector: '#megacal-events-settings-sc #themeSelect', \r\n            shortcode_att: 'theme', \r\n            output_selector: '#megacal-events-settings-sc .shortcode',\r\n            handler: 'val'\r\n        });\r\n\r\n        megacalShortcodeFieldUpdate({\r\n            event_type: 'change', \r\n            field_selector: '#megacal-events-settings-sc #buttonPositions', \r\n            shortcode_att: 'buttons', \r\n            output_selector: '#megacal-events-settings-sc .shortcode',\r\n            handler: 'val'\r\n        });\r\n\r\n        megacalShortcodeFieldUpdate({ \r\n            event_type: 'change', \r\n            field_selector: '#megacal-events-settings-sc #showDesc', \r\n            shortcode_att: 'descrip', \r\n            output_selector: '#megacal-events-settings-sc .shortcode',\r\n            handler: 'checked'\r\n        });\r\n\r\n        megacalShortcodeFieldUpdate({ \r\n            event_type: 'change', \r\n            field_selector: '#megacal-events-settings-sc #displyImgs', \r\n            shortcode_att: 'display', \r\n            output_selector: '#megacal-events-settings-sc .shortcode',\r\n            handler: function( att, shortcode, $element ) {\r\n\r\n                var display = ($element.prop('checked')) ? 'img' : 'text';\r\n                return megacalReplaceShortcodeAtt( att, display, shortcode );\r\n                \r\n            }\r\n        });\r\n\r\n        megacalShortcodeFieldUpdate({ \r\n            event_type: 'change', \r\n            field_selector: '#megacal-events-settings-sc #defaultView', \r\n            shortcode_att: 'view', \r\n            output_selector: '#megacal-events-settings-sc .shortcode',\r\n            handler: 'val'\r\n        });\r\n\r\n        megacalShortcodeFieldUpdate({ \r\n            event_type: 'change', \r\n            field_selector: '#megacal-events-settings-sc #hideView', \r\n            shortcode_att: 'hideview', \r\n            output_selector: '#megacal-events-settings-sc .shortcode',\r\n            handler: 'checked'\r\n        });\r\n\r\n        megacalShortcodeFieldUpdate({  \r\n            event_type: 'change', \r\n            field_selector: '#megacal-events-settings-sc #listStyleSelect', \r\n            shortcode_att: 'style', \r\n            output_selector: '#megacal-events-settings-sc .shortcode',\r\n            handler: 'val',\r\n        });\r\n\r\n        megacalShortcodeFieldUpdate({ \r\n            event_type: 'change', \r\n            field_selector: '#megacal-events-settings-sc #filterCal', \r\n            shortcode_att: 'eventOwner', \r\n            output_selector: '#megacal-events-settings-sc .shortcode',\r\n            handler: function( att, shortcode, $element ) {\r\n\r\n                var id = '';\r\n                var ownerId = 0;\r\n\r\n                ownerId = $element.val();\r\n                id = ( 0 == ownerId ) ? '' : ownerId;\r\n\r\n                return megacalReplaceShortcodeAtt( att, id, shortcode );\r\n\r\n            }\r\n        });\r\n\r\n        megacalShortcodeFieldUpdate({ \r\n            event_type: 'change', \r\n            field_selector: '#megacal-events-settings-sc #filterCat', \r\n            shortcode_att: 'category', \r\n            output_selector: '#megacal-events-settings-sc .shortcode',\r\n            handler: function( att, shortcode, $element ) {\r\n\r\n                var id = '';\r\n                var catId = 0;\r\n\r\n                catId = $element.val();\r\n                id = ( 0 == catId ) ? '' : catId;\r\n\r\n                return megacalReplaceShortcodeAtt( att, id, shortcode );\r\n\r\n            }\r\n        });\r\n\r\n        megacalShortcodeFieldUpdate({  \r\n            event_type: 'change', \r\n            field_selector: '#megacal-events-settings-sc #imgHeight', \r\n            shortcode_att: 'imgHeight', \r\n            output_selector: '#megacal-events-settings-sc .shortcode',\r\n            handler: 'val',\r\n        });\r\n\r\n        megacalShortcodeFieldUpdate({ \r\n            event_type: 'change', \r\n            field_selector: '#megacal-events-settings-sc #showFilters', \r\n            shortcode_att: 'showfilters', \r\n            output_selector: '#megacal-events-settings-sc .shortcode',\r\n            handler: 'checked'\r\n        });\r\n\r\n        var $shortcode_btn = $( '#megacal-insert-shortcode' );\r\n        if( $shortcode_btn.length > 0 ) {\r\n\r\n            $shortcode_btn.on( 'click', function( e ) {\r\n\r\n                e.preventDefault();\r\n\r\n                tb_show( \r\n                    'MegaCal Shortcode Options', \r\n                    ajax_shortcode_options.url\r\n                );\r\n\r\n            });\r\n\r\n            $document.on('click', '#megacal-events-settings-sc .insertShortcode', function(e) {\r\n            \r\n                e.preventDefault();\r\n\r\n                var target = $(this).data('target-class');\r\n\r\n                if( 'undefined' == typeof target ) {\r\n                    console.error( 'no target shortcode field supplied' );\r\n                    return;\r\n                }\r\n\r\n                if( '' == target ) {\r\n                    console.error( 'target cannot be empty' );\r\n                    return;\r\n                }\r\n\r\n                target = '.' + target;\r\n                var copyTextarea = $(target);\r\n\r\n                if( copyTextarea.length > 0 ) {\r\n                 \r\n                    var val = copyTextarea.val();\r\n\r\n                    wp.media.editor.insert( val );\r\n                    tb_remove();\r\n                \r\n                }\r\n\r\n            });\r\n\r\n            // Ehhhhh.....\r\n            // Depending on a mutation observer\r\n            // is undesirable and expensive, but\r\n            // there is no callback after ajax \r\n            // loads in thickbox\r\n            var in_dom = $( '#megacal-events-settings' ).length > 0;\r\n            var observer = new MutationObserver(function( mutations ) {\r\n\r\n                var $loaded_content = $( '#megacal-events-settings' );\r\n\r\n                // Make sure tabs get set up\r\n                // after ajax content loads\r\n                if( $loaded_content.length <= 0 && in_dom ) {\r\n                    \r\n                    in_dom = false;\r\n                    return;\r\n\r\n                } else if( $loaded_content.length > 0 ) {\r\n                \r\n                    if(!in_dom) {\r\n\r\n                        setupAdminTabs( '#megacal-events-settings' );\r\n                        \r\n                        // override thickbox styles...\r\n                        // thickbox doesn't let us dynamically\r\n                        // size content, so this is as good as\r\n                        // this is going to get\r\n                        $('#TB_ajaxContent').css({ \r\n                            width: '100%',\r\n                            height: '100%',\r\n                            padding: 0\r\n                        });\r\n\r\n                        $('#TB_window').css({\r\n                            overflow: 'auto'\r\n                        });\r\n\r\n                    }\r\n\r\n                    in_dom = true;\r\n\r\n                } \r\n             \r\n            });\r\n\r\n            observer.observe( document.body, { childList: true } );\r\n\r\n        }\r\n\r\n        // collapsable sections\r\n        $( document ).on( 'click', '.mega-collapsable-toggle', function() {\r\n\r\n            var $toggle = $( this );\r\n            var $collapsable = $toggle.next( '.mega-collapsable' );\r\n            var slideSpeed = 300;\r\n\r\n            if( $collapsable.hasClass( 'collapsed' ) ) {\r\n                \r\n                $toggle.find( '.icon-chevron-right' ).removeClass( 'icon-chevron-right' ).addClass( 'icon-chevron-down' );\r\n                $toggle.attr( 'aria-pressed', true );\r\n\r\n                $collapsable.slideDown( slideSpeed, function() { \r\n                    $collapsable.removeClass( 'collapsed' );\r\n                } );\r\n\r\n            } else {\r\n\r\n                $toggle.find( '.icon-chevron-down' ).removeClass( 'icon-chevron-down' ).addClass( 'icon-chevron-right' );\r\n                $toggle.attr( 'aria-pressed', false );\r\n\r\n                $collapsable.slideUp( slideSpeed, function() { \r\n                    $collapsable.addClass( 'collapsed' );\r\n                } );\r\n                \r\n            }\r\n\r\n        } );\r\n\r\n    });\r\n\r\n    $( document ).on( 'keyup', '.mega-collapsable-toggle', function( e ) {\r\n\r\n        if( e.key === 'Enter' ) {\r\n            $( this ).trigger( 'click' );\r\n        }\r\n\r\n    } );\r\n\r\n    function setupAdminTabs( selector ) {\r\n\r\n        var tabs = $(selector).find('ul.tabs');\r\n\r\n        if( tabs.length <= 0 || tabs.hasClass('tabs-init') )\r\n            return;\r\n\r\n        tabs.addClass('tabs-init');\r\n        \r\n        tabs.each(function() {\r\n            // For each set of tabs, we want to keep track of\r\n            // which tab is active and its associated content\r\n            var $active, $content, $links = $(this).find('a');\r\n\r\n            // If the location.hash matches one of the links, use that as the active tab.\r\n            // If no match is found, use the first link as the initial active tab.\r\n            $active = $($links.filter('[href=\"'+location.hash+'\"]')[0] || $links[0]);\r\n            $active.addClass('current');\r\n\r\n            $content = $($active[0].hash);\r\n            // Hide the remaining content\r\n            $links.not($active).each(function () {\r\n                $(this.hash).hide();\r\n            });\r\n\r\n            // Bind the click event handler\r\n            $(this).on('click', 'a', function(e){\r\n                // Make the old tab inactive.\r\n                $active.removeClass('current');\r\n                $content.hide();\r\n\r\n                // Update the variables with the new link and content\r\n                $active = $(this);\r\n                $content = $(this.hash);\r\n                // Make the tab active.\r\n                $active.addClass('current');\r\n                $content.show();\r\n\r\n                // Prevent the anchor's default click action\r\n                e.preventDefault();\r\n            });\r\n        });\r\n\r\n    }\r\n\r\n    // Delegate shortcode options event handlers\r\n    function megacalShortcodeFieldUpdate( opts ) {\r\n        \r\n        if( 'object' != typeof opts )\r\n            return false;\r\n\r\n        if( 'undefined' == typeof opts.event_type ) {\r\n            console.error( 'event_type is required by megacalShortcodeFieldUpdate' );\r\n            return false;\r\n        }\r\n\r\n        if( 'undefined' == typeof opts.field_selector ) {\r\n            console.error( 'field_selector is required by megacalShortcodeFieldUpdate' );\r\n            return false;\r\n        }\r\n\r\n        if( 'undefined' == typeof opts.shortcode_att ) {\r\n            console.error( 'shortcode_att is required by megacalShortcodeFieldUpdate');\r\n            return false;\r\n        }\r\n\r\n        if( 'undefined' == typeof opts.output_selector ) {\r\n            console.error( 'output_selector is required by megacalShortcodeFieldUpdate' );\r\n            return false;\r\n        }\r\n\r\n        var opts = {\r\n            event_type: opts.event_type, \r\n            field_selector: opts.field_selector,\r\n            shortcode_att: opts.shortcode_att,\r\n            output_selector: opts.output_selector,\r\n            handler: ( 'undefined' == typeof opts.handler) ? 'val' : opts.handler,\r\n            callback: ( 'undefined' == typeof opts.callback) ? null : opts.callback\r\n        };\r\n\r\n        $document.on( opts.event_type, opts.field_selector, function(e) {\r\n\r\n            var $shortcode_field = $(opts.output_selector)\r\n            var shortcode = $shortcode_field.val();\r\n            var out = shortcode;\r\n\r\n            var default_handler = function( type, att, shortcode, $element ) {\r\n\r\n                if( 'val' != type && 'checked' != type )\r\n                    return shortcode;\r\n\r\n                var val;\r\n\r\n                if( 'val' == type ) {\r\n                    val = $element.val();\r\n                } else if( 'checked' == type ) {\r\n                    val = $element.prop('checked');\r\n                }\r\n    \r\n                return megacalReplaceShortcodeAtt( att, val, shortcode );\r\n\r\n            };\r\n\r\n            if( 'function' == typeof opts.handler )\r\n                out = opts.handler( opts.shortcode_att, shortcode, $(this) );\r\n            else if( 'string' == typeof opts.handler )\r\n                out = default_handler( opts.handler, opts.shortcode_att, shortcode, $(this) );\r\n\r\n            if( 'function' == typeof opts.callback )\r\n                opts.callback( out );\r\n\r\n            $shortcode_field.val( out );\r\n        });\r\n\r\n    }\r\n\r\n    function megacalReplaceShortcodeAtt( att, val, shortcode ) {\r\n\r\n        var shortcode_len = shortcode.length;\r\n        var insert_index = shortcode_len - 1;\r\n        var regex = new RegExp( \"\\\\s\" + att + '=\"[^\"]*\"', 'g' );\r\n\r\n        if( shortcode.indexOf( ' ' + att ) > 0 && '' != val )\r\n            return shortcode.replace( regex, ' ' + att + '=\"' + val + '\"' );\r\n        else if( '' != val )\r\n            return shortcode.substring( 0, insert_index ) + ' ' + att + '=\"' + val + '\"' + shortcode.substring( shortcode_len - 1 );\r\n        else\r\n            return shortcode.replace( regex, '' );\r\n\r\n    }\r\n\r\n    function checkRequiredFields( $form, $submitBtn ) {\r\n      \r\n        var required = $form.find('.required');\r\n        var allValid = true;\r\n    \r\n        required.each(function () {\r\n    \r\n            var $this = $( this );\r\n\r\n            if( !$this.val() ) {\r\n\r\n                if( $this.hasClass( 'select2-hidden-accessible' ) ) {\r\n                    \r\n                    $this.next( '.select2-container' ).removeClass('valid'); \r\n                    $this.next( '.select2-container' ).addClass('invalid');\r\n\r\n                } else {\r\n\r\n                    $this.removeClass('valid'); \r\n                    $this.addClass('invalid');\r\n                \r\n                }\r\n\r\n                allValid = false;\r\n\r\n            } else {\r\n                \r\n                if( $this.hasClass( 'select2-hidden-accessible' ) ) {\r\n                    $this.next( '.select2-container' ).removeClass('invalid');\r\n                } else {\r\n                    $this.removeClass('invalid');\r\n                }\r\n            \r\n            }\r\n    \r\n        });\r\n    \r\n        if (allValid) {\r\n            $submitBtn.prop('disabled', false);\r\n        } else {\r\n            $submitBtn.prop('disabled', true);\r\n        }\r\n\r\n    }\r\n\r\n})(jQuery);\r\n\r\n"]}
     1{"version":3,"sources":["popper.min.js","rangeslider.min.js","bootstrap-datepicker.min.js","event-calendar.min.js","wickedpicker.min.js","select2.min.js","admin-scripts.js"],"names":["_typeof","obj","Symbol","iterator","constructor","prototype","$","GENERIC_ERROR_MSG","$document","document","setupAdminTabs","selector","tabs","find","length","hasClass","addClass","each","$active","$content","$links","this","filter","location","hash","not","hide","on","e","removeClass","show","preventDefault","megacalShortcodeFieldUpdate","opts","event_type","console","error","field_selector","shortcode_att","output_selector","handler","callback","$shortcode_field","shortcode","val","out","type","att","$element","prop","megacalReplaceShortcodeAtt","default_handler","shortcode_len","insert_index","regex","RegExp","indexOf","replace","substring","checkRequiredFields","$form","$submitBtn","required","allValid","$this","next","ready","$registerForm","$registerHandleField","$checkHandleBtn","$registerBtn","window","href","select","execCommand","fadeIn","delay","fadeOut","err","attr","closest","confirm","nonce","megacal_admin_script_opts","settings_url","check_handle_data","action","handle","_nonce","post","ajax_url","response","success","clearAlertNotification","showAlertNotification","data","message","unique","fail","form","formData","FormData","get","firstname","lastname","email","calendarName","phone","registerData","upgrade_url","alert","$manageEvents","setEventApproval","approvalAction","btn","approvalNotice","eventId","userId","putApprovalData","remove","loadApprovalList","$calendar","eventCalendar","loadEventForm","successCallback","failureCallback","eventUpsertData","registerEventFormActions","date","$eventForm","$eventSubmitBtn","$eventDeleteBtn","$allDayCheckbox","$startTimeField","$endTimeField","$dateField","$eventImgBtn","$eventRemoveBtn","$eventImgField","$imgPreview","$venueField","$venueIdField","$categoryField","$categoryIdField","$venueLocationField","$cancelBtn","$modalCancelBtn","startDate","Date","$timepicker","recurrence","recurrenceDetails","trim","JSON","parse","fmtDate","Intl","DateTimeFormat","month","day","year","format","$saveEventWrap","hideChangeTypeModal","changeTypeSelected","deleteEventData","eventChangeType","done","showChangeTypeModal","datepicker","todayHighlight","autoclose","fetchEventRecurrenceDetails","wickedpicker","now","minutesInterval","clearable","select2","placeholder","tags","allowClear","createTag","tag","found","term","toUpperCase","text","isNumeric","id","isNew","language","noResults","params","tinyMCE","triggerSave","saveEvent","customUploader","wp","media","title","library","button","multiple","attachment","state","first","toJSON","url","open","$modal","focus","eventTitle","eventDate","eventAllDay","eventStartTime","eventEndTime","eventImg","eventVenueId","eventVenueName","eventVenueLocation","eventCatId","eventCatName","eventOrganizer","eventFacebookUrl","eventTicketUrl","eventPrice","eventTaggedUsers","getAll","eventTaggedUsersExtra","megacalEventDescription","megacalEventPrivateNotes","published","eventRecurrence","eventRecurrenceRepetition","eventRecurrenceCustomType","eventRecurrenceCustomMonthlyFreq","eventRecurrenceWeeklyDays","eventRecurrenceEnd","eventRecurrenceEndDate","eventRecurrenceEndOccurrence","eventRecurrenceDayOfWeek","eventRecurrenceWeekOfMonth","eventRecurrenceLastDayOfWeek","eventRecurrenceDayOfMonth","eventRecurrenceMonth","saveEventData","$eventRecurrenceContainer","$select","selectVal","$radio","radioVal","$customRecurrenceTypeSelectOr","customRecurrenceTypeVal","parseInt","$endsDetailsContainer","endsExpanded","showRecurrence","custom","end_condition","html","content","recurrence_details","$eventRecurrenceRepetition","$eventRecurrenceEndDate","$eventRecurrenceEndOccurrence","$customRecurrenceTypeSelect","$customRecurrenceMonthlyFreq","$customRecurrenceWeeklyDays","$eventRecurrenceSelect","$customRecurrenceDetailsSection","customRecurrenceType","toLowerCase","customDetail","detailVals","fmtEndDate","moment","afterOccurrence","after_occurrence","repetition","repeat_on","day_of_week","weekOfMonth","week_of_month","$newEndsDetailsContainer","slideDown","slideUp","$selectedDayCB","$weeklyDaysCBs","defaultDay","weekly_custom","selected_day_of_week","allEmpty","initWYSIWYGFields","tinyMCEPreInit","mceInit","setup","ed","init","quicktags","showAddEventForm","loadCalendarView","$eventCalendar","aMoment","hours","minutes","seconds","milliseconds","clone","startOf","endDate","endOf","$filterForm","eventCategories","fetchEventsData","events","getApprovalListData","$approvalList","currDate","showImage","showLegends","showOwners","timeFormat","time_fmt_setting","dateFormat","calendar","calendarFirst","showSlider","loaderImageUrl","base_url","defaultEventImageUrl","default_image_path","calendarCreate","event","$preloader","createdByMe","isDirty","addEventListener","returnValue","$nameInput","$inputs","putRelationshipData","name","$alertNotice","alertState","msg","animate","scrollTop","ownerId","catId","$shortcode_btn","tb_show","ajax_shortcode_options","target","copyTextarea","editor","insert","tb_remove","in_dom","MutationObserver","mutations","$loaded_content","css","width","height","padding","overflow","observe","body","childList","$toggle","$collapsable","key","trigger","jQuery"],"mappings":"AAAA;AACA;AACA;AACA;AACA;ACJA;AACA;ACDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACPA;ACAA;ACAA;AACA;ACDA,aAEA,SAASA,QAAQC,GAAmV,OAAtOD,QAArD,mBAAXE,QAAoD,iBAApBA,OAAOC,SAAmC,SAAiBF,GAAO,cAAcA,GAA2B,SAAiBA,GAAO,OAAOA,GAAyB,mBAAXC,QAAyBD,EAAIG,cAAgBF,QAAUD,IAAQC,OAAOG,UAAY,gBAAkBJ,IAAyBA,IAEnX,SAAWK,GACT,IAAIC,EAAoB,uIACpBC,EAAYF,EAAEG,UAkyClB,SAASC,EAAeC,GACtB,IAAIC,EAAON,EAAEK,GAAUE,KAAK,WACxBD,EAAKE,QAAU,GAAKF,EAAKG,SAAS,eACtCH,EAAKI,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C5C,IAAIC,EAAkBlW,EAAE,4BAGpBkW,EAAgB1V,QAAU,GAAKuV,EACjCA,GAAS,EAEAG,EAAgB1V,OAAS,IAC7BuV,IACH3V,EAAe,4BAKfJ,EAAE,mBAAmBmW,IAAI,CACvBC,MAAO,OACPC,OAAQ,OACRC,QAAS,IAEXtW,EAAE,cAAcmW,IAAI,CAClBI,SAAU,UAIdR,GAAS,KAGJS,QAAQrW,SAASsW,KAAM,CAC9BC,WAAW,IAKf1W,EAAEG,UAAUkB,GAAG,QAAS,2BAA4B,WAClD,IAAIsV,EAAU3W,EAAEe,MACZ6V,EAAeD,EAAQhT,KAAK,qBAG5BiT,EAAanW,SAAS,cACxBkW,EAAQpW,KAAK,uBAAuBgB,YAAY,sBAAsBb,SAAS,qBAC/EiW,EAAQlS,KAAK,gBAAgB,GAC7BmS,EAAatF,UALE,IAKoB,WACjCsF,EAAarV,YAAY,iBAG3BoV,EAAQpW,KAAK,sBAAsBgB,YAAY,qBAAqBb,SAAS,sBAC7EiW,EAAQlS,KAAK,gBAAgB,GAC7BmS,EAAarF,QAXE,IAWkB,WAC/BqF,EAAalW,SAAS,oBAK9BV,EAAEG,UAAUkB,GAAG,QAAS,2BAA4B,SAAUC,GAC9C,UAAVA,EAAEuV,KACJ7W,EAAEe,MAAM+V,QAAQ,WAhyCtB,CAs6CGC","file":"../vendor/admin.min.js","sourcesContent":["/*\n Copyright (C) Federico Zivolo 2020\n Distributed under the MIT License (license terms are at http://opensource.org/licenses/MIT).\n */(function(e,t){'object'==typeof exports&&'undefined'!=typeof module?module.exports=t():'function'==typeof define&&define.amd?define(t):e.Popper=t()})(this,function(){'use strict';function e(e){return e&&'[object Function]'==={}.toString.call(e)}function t(e,t){if(1!==e.nodeType)return[];var o=e.ownerDocument.defaultView,n=o.getComputedStyle(e,null);return t?n[t]:n}function o(e){return'HTML'===e.nodeName?e:e.parentNode||e.host}function n(e){if(!e)return document.body;switch(e.nodeName){case'HTML':case'BODY':return e.ownerDocument.body;case'#document':return e.body;}var i=t(e),r=i.overflow,p=i.overflowX,s=i.overflowY;return /(auto|scroll|overlay)/.test(r+s+p)?e:n(o(e))}function i(e){return e&&e.referenceNode?e.referenceNode:e}function r(e){return 11===e?re:10===e?pe:re||pe}function p(e){if(!e)return document.documentElement;for(var o=r(10)?document.body:null,n=e.offsetParent||null;n===o&&e.nextElementSibling;)n=(e=e.nextElementSibling).offsetParent;var i=n&&n.nodeName;return i&&'BODY'!==i&&'HTML'!==i?-1!==['TH','TD','TABLE'].indexOf(n.nodeName)&&'static'===t(n,'position')?p(n):n:e?e.ownerDocument.documentElement:document.documentElement}function s(e){var t=e.nodeName;return'BODY'!==t&&('HTML'===t||p(e.firstElementChild)===e)}function d(e){return null===e.parentNode?e:d(e.parentNode)}function a(e,t){if(!e||!e.nodeType||!t||!t.nodeType)return document.documentElement;var o=e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING,n=o?e:t,i=o?t:e,r=document.createRange();r.setStart(n,0),r.setEnd(i,0);var l=r.commonAncestorContainer;if(e!==l&&t!==l||n.contains(i))return s(l)?l:p(l);var f=d(e);return f.host?a(f.host,t):a(e,d(t).host)}function l(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:'top',o='top'===t?'scrollTop':'scrollLeft',n=e.nodeName;if('BODY'===n||'HTML'===n){var i=e.ownerDocument.documentElement,r=e.ownerDocument.scrollingElement||i;return r[o]}return e[o]}function f(e,t){var o=2<arguments.length&&void 0!==arguments[2]&&arguments[2],n=l(t,'top'),i=l(t,'left'),r=o?-1:1;return e.top+=n*r,e.bottom+=n*r,e.left+=i*r,e.right+=i*r,e}function m(e,t){var o='x'===t?'Left':'Top',n='Left'==o?'Right':'Bottom';return parseFloat(e['border'+o+'Width'])+parseFloat(e['border'+n+'Width'])}function h(e,t,o,n){return ee(t['offset'+e],t['scroll'+e],o['client'+e],o['offset'+e],o['scroll'+e],r(10)?parseInt(o['offset'+e])+parseInt(n['margin'+('Height'===e?'Top':'Left')])+parseInt(n['margin'+('Height'===e?'Bottom':'Right')]):0)}function c(e){var t=e.body,o=e.documentElement,n=r(10)&&getComputedStyle(o);return{height:h('Height',t,o,n),width:h('Width',t,o,n)}}function g(e){return le({},e,{right:e.left+e.width,bottom:e.top+e.height})}function u(e){var o={};try{if(r(10)){o=e.getBoundingClientRect();var n=l(e,'top'),i=l(e,'left');o.top+=n,o.left+=i,o.bottom+=n,o.right+=i}else o=e.getBoundingClientRect()}catch(t){}var p={left:o.left,top:o.top,width:o.right-o.left,height:o.bottom-o.top},s='HTML'===e.nodeName?c(e.ownerDocument):{},d=s.width||e.clientWidth||p.width,a=s.height||e.clientHeight||p.height,f=e.offsetWidth-d,h=e.offsetHeight-a;if(f||h){var u=t(e);f-=m(u,'x'),h-=m(u,'y'),p.width-=f,p.height-=h}return g(p)}function b(e,o){var i=2<arguments.length&&void 0!==arguments[2]&&arguments[2],p=r(10),s='HTML'===o.nodeName,d=u(e),a=u(o),l=n(e),m=t(o),h=parseFloat(m.borderTopWidth),c=parseFloat(m.borderLeftWidth);i&&s&&(a.top=ee(a.top,0),a.left=ee(a.left,0));var b=g({top:d.top-a.top-h,left:d.left-a.left-c,width:d.width,height:d.height});if(b.marginTop=0,b.marginLeft=0,!p&&s){var w=parseFloat(m.marginTop),y=parseFloat(m.marginLeft);b.top-=h-w,b.bottom-=h-w,b.left-=c-y,b.right-=c-y,b.marginTop=w,b.marginLeft=y}return(p&&!i?o.contains(l):o===l&&'BODY'!==l.nodeName)&&(b=f(b,o)),b}function w(e){var t=1<arguments.length&&void 0!==arguments[1]&&arguments[1],o=e.ownerDocument.documentElement,n=b(e,o),i=ee(o.clientWidth,window.innerWidth||0),r=ee(o.clientHeight,window.innerHeight||0),p=t?0:l(o),s=t?0:l(o,'left'),d={top:p-n.top+n.marginTop,left:s-n.left+n.marginLeft,width:i,height:r};return g(d)}function y(e){var n=e.nodeName;if('BODY'===n||'HTML'===n)return!1;if('fixed'===t(e,'position'))return!0;var i=o(e);return!!i&&y(i)}function E(e){if(!e||!e.parentElement||r())return document.documentElement;for(var o=e.parentElement;o&&'none'===t(o,'transform');)o=o.parentElement;return o||document.documentElement}function v(e,t,r,p){var s=4<arguments.length&&void 0!==arguments[4]&&arguments[4],d={top:0,left:0},l=s?E(e):a(e,i(t));if('viewport'===p)d=w(l,s);else{var f;'scrollParent'===p?(f=n(o(t)),'BODY'===f.nodeName&&(f=e.ownerDocument.documentElement)):'window'===p?f=e.ownerDocument.documentElement:f=p;var m=b(f,l,s);if('HTML'===f.nodeName&&!y(l)){var h=c(e.ownerDocument),g=h.height,u=h.width;d.top+=m.top-m.marginTop,d.bottom=g+m.top,d.left+=m.left-m.marginLeft,d.right=u+m.left}else d=m}r=r||0;var v='number'==typeof r;return d.left+=v?r:r.left||0,d.top+=v?r:r.top||0,d.right-=v?r:r.right||0,d.bottom-=v?r:r.bottom||0,d}function x(e){var t=e.width,o=e.height;return t*o}function O(e,t,o,n,i){var r=5<arguments.length&&void 0!==arguments[5]?arguments[5]:0;if(-1===e.indexOf('auto'))return e;var p=v(o,n,r,i),s={top:{width:p.width,height:t.top-p.top},right:{width:p.right-t.right,height:p.height},bottom:{width:p.width,height:p.bottom-t.bottom},left:{width:t.left-p.left,height:p.height}},d=Object.keys(s).map(function(e){return le({key:e},s[e],{area:x(s[e])})}).sort(function(e,t){return t.area-e.area}),a=d.filter(function(e){var t=e.width,n=e.height;return t>=o.clientWidth&&n>=o.clientHeight}),l=0<a.length?a[0].key:d[0].key,f=e.split('-')[1];return l+(f?'-'+f:'')}function L(e,t,o){var n=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null,r=n?E(t):a(t,i(o));return b(o,r,n)}function S(e){var t=e.ownerDocument.defaultView,o=t.getComputedStyle(e),n=parseFloat(o.marginTop||0)+parseFloat(o.marginBottom||0),i=parseFloat(o.marginLeft||0)+parseFloat(o.marginRight||0),r={width:e.offsetWidth+i,height:e.offsetHeight+n};return r}function T(e){var t={left:'right',right:'left',bottom:'top',top:'bottom'};return e.replace(/left|right|bottom|top/g,function(e){return t[e]})}function C(e,t,o){o=o.split('-')[0];var n=S(e),i={width:n.width,height:n.height},r=-1!==['right','left'].indexOf(o),p=r?'top':'left',s=r?'left':'top',d=r?'height':'width',a=r?'width':'height';return i[p]=t[p]+t[d]/2-n[d]/2,i[s]=o===s?t[s]-n[a]:t[T(s)],i}function D(e,t){return Array.prototype.find?e.find(t):e.filter(t)[0]}function N(e,t,o){if(Array.prototype.findIndex)return e.findIndex(function(e){return e[t]===o});var n=D(e,function(e){return e[t]===o});return e.indexOf(n)}function P(t,o,n){var i=void 0===n?t:t.slice(0,N(t,'name',n));return i.forEach(function(t){t['function']&&console.warn('`modifier.function` is deprecated, use `modifier.fn`!');var n=t['function']||t.fn;t.enabled&&e(n)&&(o.offsets.popper=g(o.offsets.popper),o.offsets.reference=g(o.offsets.reference),o=n(o,t))}),o}function k(){if(!this.state.isDestroyed){var e={instance:this,styles:{},arrowStyles:{},attributes:{},flipped:!1,offsets:{}};e.offsets.reference=L(this.state,this.popper,this.reference,this.options.positionFixed),e.placement=O(this.options.placement,e.offsets.reference,this.popper,this.reference,this.options.modifiers.flip.boundariesElement,this.options.modifiers.flip.padding),e.originalPlacement=e.placement,e.positionFixed=this.options.positionFixed,e.offsets.popper=C(this.popper,e.offsets.reference,e.placement),e.offsets.popper.position=this.options.positionFixed?'fixed':'absolute',e=P(this.modifiers,e),this.state.isCreated?this.options.onUpdate(e):(this.state.isCreated=!0,this.options.onCreate(e))}}function W(e,t){return e.some(function(e){var o=e.name,n=e.enabled;return n&&o===t})}function B(e){for(var t=[!1,'ms','Webkit','Moz','O'],o=e.charAt(0).toUpperCase()+e.slice(1),n=0;n<t.length;n++){var i=t[n],r=i?''+i+o:e;if('undefined'!=typeof document.body.style[r])return r}return null}function H(){return this.state.isDestroyed=!0,W(this.modifiers,'applyStyle')&&(this.popper.removeAttribute('x-placement'),this.popper.style.position='',this.popper.style.top='',this.popper.style.left='',this.popper.style.right='',this.popper.style.bottom='',this.popper.style.willChange='',this.popper.style[B('transform')]=''),this.disableEventListeners(),this.options.removeOnDestroy&&this.popper.parentNode.removeChild(this.popper),this}function A(e){var t=e.ownerDocument;return t?t.defaultView:window}function M(e,t,o,i){var r='BODY'===e.nodeName,p=r?e.ownerDocument.defaultView:e;p.addEventListener(t,o,{passive:!0}),r||M(n(p.parentNode),t,o,i),i.push(p)}function F(e,t,o,i){o.updateBound=i,A(e).addEventListener('resize',o.updateBound,{passive:!0});var r=n(e);return M(r,'scroll',o.updateBound,o.scrollParents),o.scrollElement=r,o.eventsEnabled=!0,o}function I(){this.state.eventsEnabled||(this.state=F(this.reference,this.options,this.state,this.scheduleUpdate))}function R(e,t){return A(e).removeEventListener('resize',t.updateBound),t.scrollParents.forEach(function(e){e.removeEventListener('scroll',t.updateBound)}),t.updateBound=null,t.scrollParents=[],t.scrollElement=null,t.eventsEnabled=!1,t}function U(){this.state.eventsEnabled&&(cancelAnimationFrame(this.scheduleUpdate),this.state=R(this.reference,this.state))}function Y(e){return''!==e&&!isNaN(parseFloat(e))&&isFinite(e)}function V(e,t){Object.keys(t).forEach(function(o){var n='';-1!==['width','height','top','right','bottom','left'].indexOf(o)&&Y(t[o])&&(n='px'),e.style[o]=t[o]+n})}function j(e,t){Object.keys(t).forEach(function(o){var n=t[o];!1===n?e.removeAttribute(o):e.setAttribute(o,t[o])})}function q(e,t){var o=e.offsets,n=o.popper,i=o.reference,r=$,p=function(e){return e},s=r(i.width),d=r(n.width),a=-1!==['left','right'].indexOf(e.placement),l=-1!==e.placement.indexOf('-'),f=t?a||l||s%2==d%2?r:Z:p,m=t?r:p;return{left:f(1==s%2&&1==d%2&&!l&&t?n.left-1:n.left),top:m(n.top),bottom:m(n.bottom),right:f(n.right)}}function K(e,t,o){var n=D(e,function(e){var o=e.name;return o===t}),i=!!n&&e.some(function(e){return e.name===o&&e.enabled&&e.order<n.order});if(!i){var r='`'+t+'`';console.warn('`'+o+'`'+' modifier is required by '+r+' modifier in order to work, be sure to include it before '+r+'!')}return i}function z(e){return'end'===e?'start':'start'===e?'end':e}function G(e){var t=1<arguments.length&&void 0!==arguments[1]&&arguments[1],o=he.indexOf(e),n=he.slice(o+1).concat(he.slice(0,o));return t?n.reverse():n}function _(e,t,o,n){var i=e.match(/((?:\\-|\\+)?\\d*\\.?\\d*)(.*)/),r=+i[1],p=i[2];if(!r)return e;if(0===p.indexOf('%')){var s;switch(p){case'%p':s=o;break;case'%':case'%r':default:s=n;}var d=g(s);return d[t]/100*r}if('vh'===p||'vw'===p){var a;return a='vh'===p?ee(document.documentElement.clientHeight,window.innerHeight||0):ee(document.documentElement.clientWidth,window.innerWidth||0),a/100*r}return r}function X(e,t,o,n){var i=[0,0],r=-1!==['right','left'].indexOf(n),p=e.split(/(\\+|\\-)/).map(function(e){return e.trim()}),s=p.indexOf(D(p,function(e){return-1!==e.search(/,|\\s/)}));p[s]&&-1===p[s].indexOf(',')&&console.warn('Offsets separated by white space(s) are deprecated, use a comma (,) instead.');var d=/\\s*,\\s*|\\s+/,a=-1===s?[p]:[p.slice(0,s).concat([p[s].split(d)[0]]),[p[s].split(d)[1]].concat(p.slice(s+1))];return a=a.map(function(e,n){var i=(1===n?!r:r)?'height':'width',p=!1;return e.reduce(function(e,t){return''===e[e.length-1]&&-1!==['+','-'].indexOf(t)?(e[e.length-1]=t,p=!0,e):p?(e[e.length-1]+=t,p=!1,e):e.concat(t)},[]).map(function(e){return _(e,i,t,o)})}),a.forEach(function(e,t){e.forEach(function(o,n){Y(o)&&(i[t]+=o*('-'===e[n-1]?-1:1))})}),i}function J(e,t){var o,n=t.offset,i=e.placement,r=e.offsets,p=r.popper,s=r.reference,d=i.split('-')[0];return o=Y(+n)?[+n,0]:X(n,p,s,d),'left'===d?(p.top+=o[0],p.left-=o[1]):'right'===d?(p.top+=o[0],p.left+=o[1]):'top'===d?(p.left+=o[0],p.top-=o[1]):'bottom'===d&&(p.left+=o[0],p.top+=o[1]),e.popper=p,e}var Q=Math.min,Z=Math.floor,$=Math.round,ee=Math.max,te='undefined'!=typeof window&&'undefined'!=typeof document&&'undefined'!=typeof navigator,oe=function(){for(var e=['Edge','Trident','Firefox'],t=0;t<e.length;t+=1)if(te&&0<=navigator.userAgent.indexOf(e[t]))return 1;return 0}(),ne=te&&window.Promise,ie=ne?function(e){var t=!1;return function(){t||(t=!0,window.Promise.resolve().then(function(){t=!1,e()}))}}:function(e){var t=!1;return function(){t||(t=!0,setTimeout(function(){t=!1,e()},oe))}},re=te&&!!(window.MSInputMethodContext&&document.documentMode),pe=te&&/MSIE 10/.test(navigator.userAgent),se=function(e,t){if(!(e instanceof t))throw new TypeError('Cannot call a class as a function')},de=function(){function e(e,t){for(var o,n=0;n<t.length;n++)o=t[n],o.enumerable=o.enumerable||!1,o.configurable=!0,'value'in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}return function(t,o,n){return o&&e(t.prototype,o),n&&e(t,n),t}}(),ae=function(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e},le=Object.assign||function(e){for(var t,o=1;o<arguments.length;o++)for(var n in t=arguments[o],t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},fe=te&&/Firefox/i.test(navigator.userAgent),me=['auto-start','auto','auto-end','top-start','top','top-end','right-start','right','right-end','bottom-end','bottom','bottom-start','left-end','left','left-start'],he=me.slice(3),ce={FLIP:'flip',CLOCKWISE:'clockwise',COUNTERCLOCKWISE:'counterclockwise'},ge=function(){function t(o,n){var i=this,r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{};se(this,t),this.scheduleUpdate=function(){return requestAnimationFrame(i.update)},this.update=ie(this.update.bind(this)),this.options=le({},t.Defaults,r),this.state={isDestroyed:!1,isCreated:!1,scrollParents:[]},this.reference=o&&o.jquery?o[0]:o,this.popper=n&&n.jquery?n[0]:n,this.options.modifiers={},Object.keys(le({},t.Defaults.modifiers,r.modifiers)).forEach(function(e){i.options.modifiers[e]=le({},t.Defaults.modifiers[e]||{},r.modifiers?r.modifiers[e]:{})}),this.modifiers=Object.keys(this.options.modifiers).map(function(e){return le({name:e},i.options.modifiers[e])}).sort(function(e,t){return e.order-t.order}),this.modifiers.forEach(function(t){t.enabled&&e(t.onLoad)&&t.onLoad(i.reference,i.popper,i.options,t,i.state)}),this.update();var p=this.options.eventsEnabled;p&&this.enableEventListeners(),this.state.eventsEnabled=p}return de(t,[{key:'update',value:function(){return k.call(this)}},{key:'destroy',value:function(){return H.call(this)}},{key:'enableEventListeners',value:function(){return I.call(this)}},{key:'disableEventListeners',value:function(){return U.call(this)}}]),t}();return ge.Utils=('undefined'==typeof window?global:window).PopperUtils,ge.placements=me,ge.Defaults={placement:'bottom',positionFixed:!1,eventsEnabled:!0,removeOnDestroy:!1,onCreate:function(){},onUpdate:function(){},modifiers:{shift:{order:100,enabled:!0,fn:function(e){var t=e.placement,o=t.split('-')[0],n=t.split('-')[1];if(n){var i=e.offsets,r=i.reference,p=i.popper,s=-1!==['bottom','top'].indexOf(o),d=s?'left':'top',a=s?'width':'height',l={start:ae({},d,r[d]),end:ae({},d,r[d]+r[a]-p[a])};e.offsets.popper=le({},p,l[n])}return e}},offset:{order:200,enabled:!0,fn:J,offset:0},preventOverflow:{order:300,enabled:!0,fn:function(e,t){var o=t.boundariesElement||p(e.instance.popper);e.instance.reference===o&&(o=p(o));var n=B('transform'),i=e.instance.popper.style,r=i.top,s=i.left,d=i[n];i.top='',i.left='',i[n]='';var a=v(e.instance.popper,e.instance.reference,t.padding,o,e.positionFixed);i.top=r,i.left=s,i[n]=d,t.boundaries=a;var l=t.priority,f=e.offsets.popper,m={primary:function(e){var o=f[e];return f[e]<a[e]&&!t.escapeWithReference&&(o=ee(f[e],a[e])),ae({},e,o)},secondary:function(e){var o='right'===e?'left':'top',n=f[o];return f[e]>a[e]&&!t.escapeWithReference&&(n=Q(f[o],a[e]-('right'===e?f.width:f.height))),ae({},o,n)}};return l.forEach(function(e){var t=-1===['left','top'].indexOf(e)?'secondary':'primary';f=le({},f,m[t](e))}),e.offsets.popper=f,e},priority:['left','right','top','bottom'],padding:5,boundariesElement:'scrollParent'},keepTogether:{order:400,enabled:!0,fn:function(e){var t=e.offsets,o=t.popper,n=t.reference,i=e.placement.split('-')[0],r=Z,p=-1!==['top','bottom'].indexOf(i),s=p?'right':'bottom',d=p?'left':'top',a=p?'width':'height';return o[s]<r(n[d])&&(e.offsets.popper[d]=r(n[d])-o[a]),o[d]>r(n[s])&&(e.offsets.popper[d]=r(n[s])),e}},arrow:{order:500,enabled:!0,fn:function(e,o){var n;if(!K(e.instance.modifiers,'arrow','keepTogether'))return e;var i=o.element;if('string'==typeof i){if(i=e.instance.popper.querySelector(i),!i)return e;}else if(!e.instance.popper.contains(i))return console.warn('WARNING: `arrow.element` must be child of its popper element!'),e;var r=e.placement.split('-')[0],p=e.offsets,s=p.popper,d=p.reference,a=-1!==['left','right'].indexOf(r),l=a?'height':'width',f=a?'Top':'Left',m=f.toLowerCase(),h=a?'left':'top',c=a?'bottom':'right',u=S(i)[l];d[c]-u<s[m]&&(e.offsets.popper[m]-=s[m]-(d[c]-u)),d[m]+u>s[c]&&(e.offsets.popper[m]+=d[m]+u-s[c]),e.offsets.popper=g(e.offsets.popper);var b=d[m]+d[l]/2-u/2,w=t(e.instance.popper),y=parseFloat(w['margin'+f]),E=parseFloat(w['border'+f+'Width']),v=b-e.offsets.popper[m]-y-E;return v=ee(Q(s[l]-u,v),0),e.arrowElement=i,e.offsets.arrow=(n={},ae(n,m,$(v)),ae(n,h,''),n),e},element:'[x-arrow]'},flip:{order:600,enabled:!0,fn:function(e,t){if(W(e.instance.modifiers,'inner'))return e;if(e.flipped&&e.placement===e.originalPlacement)return e;var o=v(e.instance.popper,e.instance.reference,t.padding,t.boundariesElement,e.positionFixed),n=e.placement.split('-')[0],i=T(n),r=e.placement.split('-')[1]||'',p=[];switch(t.behavior){case ce.FLIP:p=[n,i];break;case ce.CLOCKWISE:p=G(n);break;case ce.COUNTERCLOCKWISE:p=G(n,!0);break;default:p=t.behavior;}return p.forEach(function(s,d){if(n!==s||p.length===d+1)return e;n=e.placement.split('-')[0],i=T(n);var a=e.offsets.popper,l=e.offsets.reference,f=Z,m='left'===n&&f(a.right)>f(l.left)||'right'===n&&f(a.left)<f(l.right)||'top'===n&&f(a.bottom)>f(l.top)||'bottom'===n&&f(a.top)<f(l.bottom),h=f(a.left)<f(o.left),c=f(a.right)>f(o.right),g=f(a.top)<f(o.top),u=f(a.bottom)>f(o.bottom),b='left'===n&&h||'right'===n&&c||'top'===n&&g||'bottom'===n&&u,w=-1!==['top','bottom'].indexOf(n),y=!!t.flipVariations&&(w&&'start'===r&&h||w&&'end'===r&&c||!w&&'start'===r&&g||!w&&'end'===r&&u),E=!!t.flipVariationsByContent&&(w&&'start'===r&&c||w&&'end'===r&&h||!w&&'start'===r&&u||!w&&'end'===r&&g),v=y||E;(m||b||v)&&(e.flipped=!0,(m||b)&&(n=p[d+1]),v&&(r=z(r)),e.placement=n+(r?'-'+r:''),e.offsets.popper=le({},e.offsets.popper,C(e.instance.popper,e.offsets.reference,e.placement)),e=P(e.instance.modifiers,e,'flip'))}),e},behavior:'flip',padding:5,boundariesElement:'viewport',flipVariations:!1,flipVariationsByContent:!1},inner:{order:700,enabled:!1,fn:function(e){var t=e.placement,o=t.split('-')[0],n=e.offsets,i=n.popper,r=n.reference,p=-1!==['left','right'].indexOf(o),s=-1===['top','left'].indexOf(o);return i[p?'left':'top']=r[o]-(s?i[p?'width':'height']:0),e.placement=T(t),e.offsets.popper=g(i),e}},hide:{order:800,enabled:!0,fn:function(e){if(!K(e.instance.modifiers,'hide','preventOverflow'))return e;var t=e.offsets.reference,o=D(e.instance.modifiers,function(e){return'preventOverflow'===e.name}).boundaries;if(t.bottom<o.top||t.left>o.right||t.top>o.bottom||t.right<o.left){if(!0===e.hide)return e;e.hide=!0,e.attributes['x-out-of-boundaries']=''}else{if(!1===e.hide)return e;e.hide=!1,e.attributes['x-out-of-boundaries']=!1}return e}},computeStyle:{order:850,enabled:!0,fn:function(e,t){var o=t.x,n=t.y,i=e.offsets.popper,r=D(e.instance.modifiers,function(e){return'applyStyle'===e.name}).gpuAcceleration;void 0!==r&&console.warn('WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!');var s,d,a=void 0===r?t.gpuAcceleration:r,l=p(e.instance.popper),f=u(l),m={position:i.position},h=q(e,2>window.devicePixelRatio||!fe),c='bottom'===o?'top':'bottom',g='right'===n?'left':'right',b=B('transform');if(d='bottom'==c?'HTML'===l.nodeName?-l.clientHeight+h.bottom:-f.height+h.bottom:h.top,s='right'==g?'HTML'===l.nodeName?-l.clientWidth+h.right:-f.width+h.right:h.left,a&&b)m[b]='translate3d('+s+'px, '+d+'px, 0)',m[c]=0,m[g]=0,m.willChange='transform';else{var w='bottom'==c?-1:1,y='right'==g?-1:1;m[c]=d*w,m[g]=s*y,m.willChange=c+', '+g}var E={\"x-placement\":e.placement};return e.attributes=le({},E,e.attributes),e.styles=le({},m,e.styles),e.arrowStyles=le({},e.offsets.arrow,e.arrowStyles),e},gpuAcceleration:!0,x:'bottom',y:'right'},applyStyle:{order:900,enabled:!0,fn:function(e){return V(e.instance.popper,e.styles),j(e.instance.popper,e.attributes),e.arrowElement&&Object.keys(e.arrowStyles).length&&V(e.arrowElement,e.arrowStyles),e},onLoad:function(e,t,o,n,i){var r=L(i,t,e,o.positionFixed),p=O(o.placement,r,t,e,o.modifiers.flip.boundariesElement,o.modifiers.flip.padding);return t.setAttribute('x-placement',p),V(t,{position:o.positionFixed?'fixed':'absolute'}),o},gpuAcceleration:void 0}}},ge});\n","/*! rangeslider.js - v2.3.2 | (c) 2018 @andreruffert | MIT license | https://github.com/andreruffert/rangeslider.js */\n!function(a){\"use strict\";\"function\"==typeof define&&define.amd?define([\"jquery\"],a):\"object\"==typeof exports?module.exports=a(require(\"jquery\")):a(jQuery)}(function(a){\"use strict\";function b(){var a=document.createElement(\"input\");return a.setAttribute(\"type\",\"range\"),\"text\"!==a.type}function c(a,b){var c=Array.prototype.slice.call(arguments,2);return setTimeout(function(){return a.apply(null,c)},b)}function d(a,b){return b=b||100,function(){if(!a.debouncing){var c=Array.prototype.slice.apply(arguments);a.lastReturnVal=a.apply(window,c),a.debouncing=!0}return clearTimeout(a.debounceTimeout),a.debounceTimeout=setTimeout(function(){a.debouncing=!1},b),a.lastReturnVal}}function e(a){return a&&(0===a.offsetWidth||0===a.offsetHeight||!1===a.open)}function f(a){for(var b=[],c=a.parentNode;e(c);)b.push(c),c=c.parentNode;return b}function g(a,b){function c(a){void 0!==a.open&&(a.open=!a.open)}var d=f(a),e=d.length,g=[],h=a[b];if(e){for(var i=0;i<e;i++)g[i]=d[i].style.cssText,d[i].style.setProperty?d[i].style.setProperty(\"display\",\"block\",\"important\"):d[i].style.cssText+=\";display: block !important\",d[i].style.height=\"0\",d[i].style.overflow=\"hidden\",d[i].style.visibility=\"hidden\",c(d[i]);h=a[b];for(var j=0;j<e;j++)d[j].style.cssText=g[j],c(d[j])}return h}function h(a,b){var c=parseFloat(a);return Number.isNaN(c)?b:c}function i(a){return a.charAt(0).toUpperCase()+a.substr(1)}function j(b,e){if(this.$window=a(window),this.$document=a(document),this.$element=a(b),this.options=a.extend({},n,e),this.polyfill=this.options.polyfill,this.orientation=this.$element[0].getAttribute(\"data-orientation\")||this.options.orientation,this.onInit=this.options.onInit,this.onSlide=this.options.onSlide,this.onSlideEnd=this.options.onSlideEnd,this.DIMENSION=o.orientation[this.orientation].dimension,this.DIRECTION=o.orientation[this.orientation].direction,this.DIRECTION_STYLE=o.orientation[this.orientation].directionStyle,this.COORDINATE=o.orientation[this.orientation].coordinate,this.polyfill&&m)return!1;this.identifier=\"js-\"+k+\"-\"+l++,this.startEvent=this.options.startEvent.join(\".\"+this.identifier+\" \")+\".\"+this.identifier,this.moveEvent=this.options.moveEvent.join(\".\"+this.identifier+\" \")+\".\"+this.identifier,this.endEvent=this.options.endEvent.join(\".\"+this.identifier+\" \")+\".\"+this.identifier,this.toFixed=(this.step+\"\").replace(\".\",\"\").length-1,this.$fill=a('<div class=\"'+this.options.fillClass+'\" />'),this.$handle=a('<div class=\"'+this.options.handleClass+'\" />'),this.$range=a('<div class=\"'+this.options.rangeClass+\" \"+this.options[this.orientation+\"Class\"]+'\" id=\"'+this.identifier+'\" />').insertAfter(this.$element).prepend(this.$fill,this.$handle),this.$element.css({position:\"absolute\",width:\"1px\",height:\"1px\",overflow:\"hidden\",opacity:\"0\"}),this.handleDown=a.proxy(this.handleDown,this),this.handleMove=a.proxy(this.handleMove,this),this.handleEnd=a.proxy(this.handleEnd,this),this.init();var f=this;this.$window.on(\"resize.\"+this.identifier,d(function(){c(function(){f.update(!1,!1)},300)},20)),this.$document.on(this.startEvent,\"#\"+this.identifier+\":not(.\"+this.options.disabledClass+\")\",this.handleDown),this.$element.on(\"change.\"+this.identifier,function(a,b){if(!b||b.origin!==f.identifier){var c=a.target.value,d=f.getPositionFromValue(c);f.setPosition(d)}})}Number.isNaN=Number.isNaN||function(a){return\"number\"==typeof a&&a!==a};var k=\"rangeslider\",l=0,m=b(),n={polyfill:!0,orientation:\"horizontal\",rangeClass:\"rangeslider\",disabledClass:\"rangeslider--disabled\",activeClass:\"rangeslider--active\",horizontalClass:\"rangeslider--horizontal\",verticalClass:\"rangeslider--vertical\",fillClass:\"rangeslider__fill\",handleClass:\"rangeslider__handle\",startEvent:[\"mousedown\",\"touchstart\",\"pointerdown\"],moveEvent:[\"mousemove\",\"touchmove\",\"pointermove\"],endEvent:[\"mouseup\",\"touchend\",\"pointerup\"]},o={orientation:{horizontal:{dimension:\"width\",direction:\"left\",directionStyle:\"left\",coordinate:\"x\"},vertical:{dimension:\"height\",direction:\"top\",directionStyle:\"bottom\",coordinate:\"y\"}}};return j.prototype.init=function(){this.update(!0,!1),this.onInit&&\"function\"==typeof this.onInit&&this.onInit()},j.prototype.update=function(a,b){a=a||!1,a&&(this.min=h(this.$element[0].getAttribute(\"min\"),0),this.max=h(this.$element[0].getAttribute(\"max\"),100),this.value=h(this.$element[0].value,Math.round(this.min+(this.max-this.min)/2)),this.step=h(this.$element[0].getAttribute(\"step\"),1)),this.handleDimension=g(this.$handle[0],\"offset\"+i(this.DIMENSION)),this.rangeDimension=g(this.$range[0],\"offset\"+i(this.DIMENSION)),this.maxHandlePos=this.rangeDimension-this.handleDimension,this.grabPos=this.handleDimension/2,this.position=this.getPositionFromValue(this.value),this.$element[0].disabled?this.$range.addClass(this.options.disabledClass):this.$range.removeClass(this.options.disabledClass),this.setPosition(this.position,b)},j.prototype.handleDown=function(a){if(a.preventDefault(),!(a.button&&0!==a.button||(this.$document.on(this.moveEvent,this.handleMove),this.$document.on(this.endEvent,this.handleEnd),this.$range.addClass(this.options.activeClass),(\" \"+a.target.className+\" \").replace(/[\\n\\t]/g,\" \").indexOf(this.options.handleClass)>-1))){var b=this.getRelativePosition(a),c=this.$range[0].getBoundingClientRect()[this.DIRECTION],d=this.getPositionFromNode(this.$handle[0])-c,e=\"vertical\"===this.orientation?this.maxHandlePos-(b-this.grabPos):b-this.grabPos;this.setPosition(e),b>=d&&b<d+this.handleDimension&&(this.grabPos=b-d)}},j.prototype.handleMove=function(a){a.preventDefault();var b=this.getRelativePosition(a),c=\"vertical\"===this.orientation?this.maxHandlePos-(b-this.grabPos):b-this.grabPos;this.setPosition(c)},j.prototype.handleEnd=function(a){a.preventDefault(),this.$document.off(this.moveEvent,this.handleMove),this.$document.off(this.endEvent,this.handleEnd),this.$range.removeClass(this.options.activeClass),this.$element.trigger(\"change\",{origin:this.identifier}),this.onSlideEnd&&\"function\"==typeof this.onSlideEnd&&this.onSlideEnd(this.position,this.value)},j.prototype.cap=function(a,b,c){return a<b?b:a>c?c:a},j.prototype.setPosition=function(a,b){var c,d;void 0===b&&(b=!0),c=this.getValueFromPosition(this.cap(a,0,this.maxHandlePos)),d=this.getPositionFromValue(c),this.$fill[0].style[this.DIMENSION]=d+this.grabPos+\"px\",this.$handle[0].style[this.DIRECTION_STYLE]=d+\"px\",this.setValue(c),this.position=d,this.value=c,b&&this.onSlide&&\"function\"==typeof this.onSlide&&this.onSlide(d,c)},j.prototype.getPositionFromNode=function(a){for(var b=0;null!==a;)b+=a.offsetLeft,a=a.offsetParent;return b},j.prototype.getRelativePosition=function(a){var b=i(this.COORDINATE),c=this.$range[0].getBoundingClientRect()[this.DIRECTION],d=0;return void 0!==a.originalEvent[\"client\"+b]?d=a.originalEvent[\"client\"+b]:a.originalEvent.touches&&a.originalEvent.touches[0]&&void 0!==a.originalEvent.touches[0][\"client\"+b]?d=a.originalEvent.touches[0][\"client\"+b]:a.currentPoint&&void 0!==a.currentPoint[this.COORDINATE]&&(d=a.currentPoint[this.COORDINATE]),d-c},j.prototype.getPositionFromValue=function(a){var b;return b=(a-this.min)/(this.max-this.min),Number.isNaN(b)?0:b*this.maxHandlePos},j.prototype.getValueFromPosition=function(a){var b,c;return b=a/(this.maxHandlePos||1),c=this.step*Math.round(b*(this.max-this.min)/this.step)+this.min,Number(c.toFixed(this.toFixed))},j.prototype.setValue=function(a){a===this.value&&\"\"!==this.$element[0].value||this.$element.val(a).trigger(\"input\",{origin:this.identifier})},j.prototype.destroy=function(){this.$document.off(\".\"+this.identifier),this.$window.off(\".\"+this.identifier),this.$element.off(\".\"+this.identifier).removeAttr(\"style\").removeData(\"plugin_\"+k),this.$range&&this.$range.length&&this.$range[0].parentNode.removeChild(this.$range[0])},a.fn[k]=function(b){var c=Array.prototype.slice.call(arguments,1);return this.each(function(){var d=a(this),e=d.data(\"plugin_\"+k);e||d.data(\"plugin_\"+k,e=new j(this,b)),\"string\"==typeof b&&e[b].apply(e,c)})},\"rangeslider.js is available in jQuery context e.g $(selector).rangeslider(options);\"});","/*!\n * Datepicker for Bootstrap v1.9.0 (https://github.com/uxsolutions/bootstrap-datepicker)\n *\n * Licensed under the Apache License v2.0 (http://www.apache.org/licenses/LICENSE-2.0)\n */\n\n!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(\"\")},\nheadTemplate:'<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\"]'))})});","!function(t){let e=function(t,e){return e=e||null,moment(t,e).locale(\"en\")};t.widget(\"mdb.eventCalendar\",{options:{showAdd:!0,showImage:!1,showLegends:!0,showTooltipActions:!0,showOwners:!1,sliderWidth:\"200px\",showSlider:!0,eventClass:\"height-36\",eventImageSize:\"square\",slider:{id:\"mega-toolbar-slider\",min:18,max:90,value:18,step:18},classes:{megaCalendarWrap:\"megaCalendarWrap\",\"mega-content\":\"mega-content\",\"mega-toolbar\":\"mega-toolbar\",\"mega-toolbar-add-event\":\"mega-toolbar-add-event\",\"mega-toolbar-select-month\":\"mega-toolbar-select-month\",\"mega-toolbar-prev\":\"mega-toolbar-prev\",\"mega-toolbar-next\":\"mega-toolbar-next\",\"mega-toolbar-month\":\"mega-toolbar-month\",\"mega-toolbar-slider\":\"mega-toolbar-slider\",\"mega-view\":\"mega-view\",\"mega-view-header\":\"mega-view-header\",\"mega-view-header-weekday\":\"mega-view-header-weekday\",\"mega-view-body\":\"mega-view-body\",\"mega-view-week\":\"mega-view-week\",\"mega-view-day\":\"mega-view-day\",\"mega-view-day-header\":\"mega-view-day-header\",\"mega-view-day-content\":\"mega-view-day-content\",\"mega-view-day-content-event\":\"mega-view-day-content-event\",\"mega-view-day-content-event-text\":\"mega-view-day-content-event-text\",\"mega-view-day-content-event-image\":\"mega-view-day-content-event-image\",\"mega-loading-animation\":\"mega-loading-animation\",\"mega-legend\":\"mega-legend\",\"mega-legend-header\":\"mega-legend-header\",\"mega-legend-body\":\"mega-legend-body\",\"mega-legend-items\":\"mega-legend-items\",\"mega-legend-item\":\"mega-legend-item\",\"mega-tooltip\":\"mega-tooltip\"},dateFormat:{toolbar:\"MMMM YYYY\",calendar:\"DD\",calendarFirst:\"MMM DD\",eventDate:\"MM-DD-YYYY\"},timeFormat:\"HH:mm\",shortWeekdaysName:!0,loaderImageUrl:null,defaultEventImageUrl:null,calendarCreate:null,calendarAddEvent:null,calendarViewChange:null},showLoader:function(){this._removeClass(this.calendarLoader,\"mega-loading-animation\",\"hidden\")._addClass(this.calendarLoader,\"mega-loading-animation\",\"visible\")},hideLoader:function(){this.eventLoaderInterval&&clearInterval(this.eventLoaderInterval),void 0!==this.eventProcessingDone?this.eventLoaderInterval=setInterval(function(){!0===this.eventProcessingDone&&(clearInterval(this.eventLoaderInterval),this._hideLoader())}.bind(this),100):this._hideLoader()},showPopup:function(e){const a=this.events.filter((function(t){return t.attr(\"id\")===`event-${e}`}))[0];this._hideTooltip();const n=t(\"div.arrow-zone\",this.tooltip);n.hasClass(\"top\")&&this._removeClass(n,\"top\")._addClass(n,\"bottom\"),this.tooltip.show();const s=this.tooltip.find(\"div.megaToolContent\");this._removeClass(s,\"megaToolContent\",\"visible\")._addClass(s,\"megaToolContent\",\"hidden\");const o=this.tooltip.find(\"div.animation\");this._removeClass(o,\"animation\",\"hidden\")._addClass(o,\"animation\",\"visible\");const i=t=>{this._removeClass(n,\"top bottom\"),t.originalPlacement!==t.placement?this._addClass(n,t.placement):this._addClass(n,t.originalPlacement)},d={placement:\"bottom\",modifiers:{preventOverflow:{boundariesElement:this.content.get(0)},arrow:{element:\".arrow\"}},eventsEnabled:!0,onCreate:i,onUpdate:i};this.popper=new Popper(a,this.tooltip,d)},setEvent:function(t){const e=this.tooltip.find(\"div.animation\");this._removeClass(e,\"animation\",\"visible\")._addClass(e,\"animation\",\"hidden\"),this._createTooltipContent(t)},clear:function(){this.calendarBody.remove(),this.toolbarMonth.html(this.startOfMonth.format(this.options.dateFormat.toolbar)),this._processCalendarBody()},refresh:function(){this._refresh()},refreshTooltip:function(){this.popper.update()},showImage:function(t){this.options.showImage=t},_create:function(){this.widgetEventPrefix=\"eventcalendar.\",this.now=e(),this.startOfMonth=this._getStartOfMonth(this.now),this.endOfMonth=this._getEndOfMonth(this.now),this._addClass(this.element,\"megaCalendarWrap postbox\"),this.content=t(\"<div/>\"),this.content.appendTo(this.element),this._addClass(this.content,\"mega-content\"),this._processToolbar(),this._processCalendarView(),this._processCalendarLoader(),this.options.showLegends&&this._processLegend(),this._processTooltip(),this._trigger(\"calendarCreate\",null,{widget:this})},_setOption:function(e,a){\"events\"===e&&a.events&&(this.eventsData=a.events.reverse(),this.eventProcessingInterval&&clearInterval(this.eventProcessingInterval),this.events=[],this.eventProcessingDone=!1,this.options.showSlider?this.eventCurrentClass=`height-${t(this.toolbarSlider).val()}`:this.eventCurrentClass=this.options.eventClass,this.eventProcessingInterval=setInterval(function(){this.eventsData&&0==this.eventsData.length&&(clearInterval(this.eventProcessingInterval),this.eventProcessingDone=!0);const t=[];let e=0;for(;10!==e&&0!=this.eventsData.length;){const a=this.eventsData.pop();e++,t.push(a)}this._processEvents(t)}.bind(this),300))},_processToolbar:function(){this.toolbar=t(\"<div/>\"),this._addClass(this.toolbar,\"mega-toolbar\"),this.toolbar.appendTo(this.content),this._processToolbarButtons(),this._processToolbarMonth(),this._processToolbarSlider()},_processToolbarButtons:function(){!0===this.options.showAdd&&this._processAddEventButton(),this._processSelectMonthButton(),this._processPrevButton(),this._processNextButton()},_processAddEventButton:function(){this.addEvent=t('\\n\\t\\t\\t\\t\\t<button>\\n\\t\\t\\t\\t\\t\\t<i class=\"fui-plus\" aria-hidden=\"true\"></i>\\n\\t\\t\\t\\t\\t\\tAdd Event\\n\\t\\t\\t\\t\\t</button>\\n\\t\\t\\t\\t'),this._addClass(this.addEvent,\"mega-toolbar-add-event\",\"button\",\"mega-toolbar-button\",\"page-title-action\"),this.addEvent.appendTo(this.toolbar),this.addEvent.attr(\"title\",\"Add an Event, or click on any date directly\"),this.addEvent.on(\"click\",function(t){this._trigger(\"calendarAddEvent\",t,{date:new Date})}.bind(this))},_processSelectMonthButton:function(){let a=this;this.selectMonth=t('\\n\\t\\t\\t\\t\\t<div>\\n\\t\\t\\t\\t\\t\\t<div class=\"input-group-addon\">\\n\\t\\t\\t\\t\\t\\t\\t<i class=\"fui-calendar-solid\" aria-hidden=\"true\"></i>\\n\\t\\t\\t\\t\\t\\t\\tMonth\\n\\t\\t\\t\\t\\t\\t</div>\\n\\t\\t\\t\\t\\t</div>\\n\\t\\t\\t\\t'),this._addClass(this.selectMonth,\"mega-toolbar-select-month\",\"mega-toolbar-button input-group date\"),this.selectMonth.appendTo(this.toolbar),this.selectMonth.attr(\"title\",\"Select a month to view in the calendar\"),this.selectMonth.attr(\"tabindex\",0),this.selectMonth.datepicker({startView:\"months\",minViewMode:\"months\",todayBtn:\"linked\",autoclose:!0}),this.selectMonth.datepicker(\"setDate\",this.startOfMonth.toDate()),this.selectMonth.datepicker().on(\"changeDate\",function(t){const a=t.date,n=e(a);this.startOfMonth=this._getStartOfMonth(n),this.endOfMonth=this._getEndOfMonth(n),this._refresh(t)}.bind(this)),this.selectMonth.datepicker().on(\"show\",(function(e){const a=t(\"div.datepicker\"),n=a.offset();a.offset({top:n.top+30,left:n.left+20})})),this.selectMonth.on(\"keyup\",(function(t){\"Enter\"==t.key&&a.selectMonth.datepicker(\"show\")}))},_processPrevButton:function(){this.prev=t('\\n\\t\\t\\t\\t\\t<button>\\n\\t\\t\\t\\t\\t\\t<i class=\"fui-arrow-left\" aria-hidden=\"true\"></i>\\n\\t\\t\\t\\t\\t</button>\\n\\t\\t\\t\\t'),this._addClass(this.prev,\"mega-toolbar-prev\",\"mega-toolbar-button mega-toolbar-nav\"),this.prev.appendTo(this.toolbar),this.prev.attr(\"title\",\"Move to previous month\"),this.prev.attr(\"tabindex\",0),this.prev.on(\"click\",function(t){this.endOfMonth=this.startOfMonth.subtract(1,\"day\"),this.startOfMonth=this._getStartOfMonth(this.endOfMonth),this._refresh(t)}.bind(this))},_processNextButton:function(){this.next=t('\\n\\t\\t\\t\\t\\t<button>\\n\\t\\t\\t\\t\\t\\t<i class=\"fui-arrow-right\" aria-hidden=\"true\"></i>\\n\\t\\t\\t\\t\\t</button>\\n\\t\\t\\t\\t'),this._addClass(this.next,\"mega-toolbar-next\",\"mega-toolbar-button mega-toolbar-nav\"),this.next.appendTo(this.toolbar),this.next.attr(\"title\",\"Move to next month\"),this.next.attr(\"tabindex\",0),this.next.on(\"click\",function(t){this.startOfMonth=this.endOfMonth.add(1,\"day\"),this.endOfMonth=this._getEndOfMonth(this.startOfMonth),this._refresh(t)}.bind(this))},_processToolbarMonth:function(){this.toolbarMonth=t(\"<div/>\"),this._addClass(this.toolbarMonth,\"mega-toolbar-month\"),this.toolbarMonth.attr(\"tabindex\",0),this.toolbarMonth.appendTo(this.toolbar),this.toolbarMonth.html(this.startOfMonth.format(this.options.dateFormat.toolbar))},_processToolbarSlider:function(){if(this.options.showSlider){const a=t(\"<div />\");a.appendTo(this.toolbar),this._addClass(a,\"mega-toolbar-slider\"),a.css(\"width\",this.options.sliderWidth);var e=t('<label class=\"sr-only\" for=\"mega-toolbar-slider\">Event Height</label>');this.toolbarSlider=t('<input type=\"range\"/>'),this.toolbarSlider.attr({...this.options.slider}),this.toolbarSlider.appendTo(a),e.appendTo(a);const n=this;t(this.toolbarSlider).rangeslider({polyfill:!1,onSlideEnd:function(t,e){const a=`height-${e}`;n.events.forEach((function(t){n._removeClass(t,\"mega-view-day-content-event\",n.eventCurrentClass)._addClass(t,\"mega-view-day-content-event\",a)})),n.eventCurrentClass=a}})}},_processCalendarView:function(){this.view=t(\"<div/>\"),this._addClass(this.view,\"mega-view\"),this.view.appendTo(this.content),this._processCalendarHeader(),this._processCalendarBody()},_processCalendarHeader:function(){this.calendarHeader=t(\"<div/>\"),this._addClass(this.calendarHeader,\"mega-view-header\"),this.calendarHeader.appendTo(this.view);const e=this.options.shortWeekdaysName?moment.weekdaysShort():moment.weekdays();this.weekdays=e.map(function(e,a){const n=t(\"<div/>\");return this._addClass(n,\"mega-view-header-weekday\"),n.appendTo(this.calendarHeader),n.html(e),n}.bind(this))},_processCalendarBody:function(){this.calendarBody=t(\"<div/>\"),this._addClass(this.calendarBody,\"mega-view-body\"),this.calendarBody.appendTo(this.view);const e=this._getCalendarDates();this.days=[];let a=[];for(let t=0;t<e.length;t++){const n=e[t];a.push(n),(t+1)%7==0&&(this._processWeek(a),a=[])}},_processWeek:function(e){const a=t(\"<div/>\");this._addClass(a,\"mega-view-week\"),a.appendTo(this.calendarBody);const n=e.map(function(e,n){const s=t(\"<div/>\");this.now.isSame(e,\"day\")?this._addClass(s,\"mega-view-day\",\"today\"):this._addClass(s,\"mega-view-day\"),s.appendTo(a),s.data(\"date\",e.toDate());const o=t(\"<div/>\");this._addClass(o,\"mega-view-day-header\"),o.appendTo(s);const i=1===e.date()?this.options.dateFormat.calendarFirst:this.options.dateFormat.calendar;o.html(e.format(i));const d=t(\"<div />\");return this._addClass(d,\"mega-view-day-content\"),this.options.showAdd?(this._addClass(d,\"mega-view-day-content\",\"current-month show-add\"),d.attr(\"title\",\"Add event for \"+e.format(\"MMMM Do\"))):(this._addClass(d,\"mega-view-day-content\",\"current-month\"),d.attr(\"title\",e.format(\"MMMM Do\"))),d.attr(\"tabindex\",0),d.on(\"keyup\",(function(e){\"Enter\"===e.key&&t(this).trigger(\"click\")})),d.appendTo(s),!0===this.options.showAdd&&(o.on(\"click\",function(t){this._trigger(\"calendarAddEvent\",t,{date:e.toDate()})}.bind(this)),d.on(\"click\",function(t){this._trigger(\"calendarAddEvent\",t,{date:e.toDate()})}.bind(this))),s}.bind(this));this.days.push(...n)},_processCalendarLoader:function(){if(this.calendarLoader=t(\"<div/>\"),this._addClass(this.calendarLoader,\"mega-loading-animation\",\"hidden\"),this.calendarLoader.appendTo(this.content),this.options.loaderImageUrl){t(`<img src=\"${this.options.loaderImageUrl}\" alt=\"Loading Spinner\" />`).appendTo(this.calendarLoader)}},_processLegend:function(){this.legend=t(\"<div/>\"),this._addClass(this.legend,\"mega-legend\"),this.legend.appendTo(this.content),this.legendHeader=t(\"<div/>\"),this.legendHeader.html(\"Legend\"),this._addClass(this.legendHeader,\"mega-legend-header\"),this.legendHeader.appendTo(this.legend),this.legendBody=t(\"<div/>\"),this._addClass(this.legendBody,\"mega-legend-body\"),this.legendBody.appendTo(this.legend),this._processLegendItem(\"icon-bullhorn\",\"Event is Published\")},_processLegendItem:function(e,a){const n=t(\"<div/>\");this._addClass(n,\"mega-legend-items\"),n.appendTo(this.legendBody);const s=t(\"<div/>\");this._addClass(s,\"mega-legend-item\"),s.appendTo(n);const o=t(\"<i/>\");this._addClass(o,e),o.appendTo(s);const i=t(\"<div/>\");this._addClass(i,\"mega-legend-item\"),i.appendTo(n);const d=t(\"<span/>\");d.html(\"=\"),d.appendTo(i);const r=t(\"<div/>\");this._addClass(r,\"mega-legend-item\"),r.appendTo(n);const h=t(\"<span/>\");h.html(a),h.appendTo(r)},_processEvents:function(a){this.days.forEach(function(n){const s=e(n.data(\"date\")).format(this.options.dateFormat.eventDate),o=t(\"div.mega-view-day-content\",n);a.forEach(function(a){const{eventDate:n,id:i,title:d,published:r,createdByMe:h,owner:l}=a;if(e(n).format(this.options.dateFormat.eventDate)===s){const n=t(\"<button />\");n.attr({id:`event-${i}`}),n.data(\"eventData\",a),n.appendTo(o),n.attr(\"tabindex\",0);const s=a.category?\"event-category-\"+a.category.id:\"\";if(this._addClass(n,`megaEvent mega-view-day-content-event ${s}`,this.eventCurrentClass),this.events.push(n),this.options.showImage){const e=t(\"<div/>\");this._addClass(e,\"megaDayImage mega-view-day-content-event-image\"),e.appendTo(n);const s=t(\"<div/>\");this._addClass(s,\"image-zone\"),s.appendTo(e),this._processEventImage(a,e)}else this._addClass(n,\"noImageEvent\");const c=t(\"<div/>\");if(c.appendTo(n),this.options.showImage?this._addClass(c,\"megaEventText mega-view-day-content-event-text\",\"has-image-sibling\"):this._addClass(c,\"megaEventText mega-view-day-content-event-text\",\"full-height\"),r?this._addClass(c,\"mega-published-event\"):this._addClass(c,\"mega-unpublished-event\"),h?this._addClass(c,\"mega-my-event\"):this._addClass(c,\"mega-shared-event\"),a.startTime){let n=e(a.startTime,\"HH:mm\").format(this.options.timeFormat);const s=t(\"<span/>\");s.html(n),this._addClass(s,\"megaTime time\"),s.appendTo(c)}if(d&&\"-\"!==t.trim(d)){const e=t(\"<div/>\"),a=t(\"<span/>\");if(a.html(t.trim(d)),a.addClass(\"megaTitlePara\"),a.appendTo(e),this._addClass(e,\"megaTitle title\"),!h&&this.options.showOwners){const t=`Owned by ${l.calendarName} (${l.handle})`;e.attr(\"title\",t)}e.appendTo(c)}if(this.options.showLegends){const e=t(\"<div/>\");if(this._addClass(e,\"megaIcons\"),e.appendTo(c),r){const a=t(\"<i/>\");this._addClass(a,\"icon-bullhorn\"),a.attr(\"aria-hidden\",!0),a.appendTo(e);const n=t(\"<span />\");this._addClass(n,\"sr-only\"),n.html(\"Published Event\"),n.appendTo(c)}}n.on(\"click\",function(t){this._trigger(\"eventClick\",t,{eventId:i,createdByMe:h}),t.stopPropagation()}.bind(this)),n.on(\"contextmenu\",function(t){this._preventEventPropagation(t),this._trigger(\"eventContextMenu\",t,{eventId:i})}.bind(this)),n.on(\"mouseover focus\",function(t){this._preventEventPropagation(t),this._trigger(\"eventHover\",t,{eventId:i})}.bind(this))}}.bind(this))}.bind(this))},_processEventImage:function(t,e){const{imageUrl:a,imageUrlSquare:n,imageUrlDetail:s,iamgeUrlBanner:o}=t;let i=a;switch(this.options.eventImageSize){case\"square\":i=n||a;break;case\"detail\":i=s||a;break;case\"banner\":i=o||a;break;case\"full\":default:i=a}i?this._createPanelImageHolder(e,\"one-image\",i):(this._addClass(e,\"noImage\"),this._addClass(e.parent(),\"noImageEvent\"),this.options.defaultEventImageUrl&&this._processPanelDefaultImage(e,this.options.defaultEventImageUrl))},_hideLoader:function(){this._removeClass(this.calendarLoader,\"mega-loading-animation\",\"visible\")._addClass(this.calendarLoader,\"mega-loading-animation\",\"hidden\")},_processTooltip:function(){this.tooltip=t(\"<div/>\"),this._addClass(this.tooltip,\"mega-tooltip\"),this.tooltip.appendTo(this.content),this.tooltip.hide();const e=t(\"<div/>\");this._addClass(e,\"arrow-zone bottom\"),e.appendTo(this.tooltip);const a=t(\"<div/>\");this._addClass(a,\"arrow\"),a.appendTo(e);const n=t(\"<div/>\");this._addClass(n,\"view\"),n.appendTo(this.tooltip);const s=t(\"<div/>\");this._addClass(s,\"megaToolContent\",\"hidden\"),s.appendTo(n);const o=t(\"<div/>\");if(this._addClass(o,\"animation\",\"hidden\"),o.appendTo(n),this.options.loaderImageUrl){t(`<img src=\"${this.options.loaderImageUrl}\" alt=\"Loading Spinner\" />`).appendTo(o)}t(\"body\").on(\"click mouseover\",function(e){!1===t(e.target).is(this.tooltip)&&!1===t.contains(this.tooltip.get(0),e.target)&&this._hideTooltip()}.bind(this)),parent.document&&t(parent.document).on(\"click mouseover\",function(t){this._hideTooltip()}.bind(this))},_createTooltipContent:function(t){const e=this.tooltip.find(\"div.megaToolContent\");e.empty(),e.html(t),this._removeClass(e,\"megaToolContent\",\"hidden\")._addClass(e,\"megaToolContent\",\"visible\")},_createTooltipPanels:function(t,e){},_processPanelDefaultImage:function(t,e){this._createPanelImageHolder(t,\"one-image\",e)},_createPanelImageHolder:function(e,a,n){const s=e.find(\"div.image-zone\"),o=t(\"<div/>\");this._addClass(o,a),o.appendTo(s);const i=t(\"<img/>\");i.attr(\"src\",n),i.attr(\"alt\",\"An image representing the event\"),i.appendTo(o)},_hideTooltip:function(){this.popper&&this.popper.destroy(),this.tooltip.hide()},_refresh:function(t){this.calendarBody.remove(),this.toolbarMonth.html(this.startOfMonth.format(this.options.dateFormat.toolbar)),this._processCalendarBody(),this._trigger(\"calendarViewChange\",t,{date:this.startOfMonth.toDate()})},_getCalendarDates:function(){let t=this._getStartOfCalendar(this.startOfMonth),e=this._getEndOfCalendar(this.endOfMonth);const a=[];for(;!t.isAfter(e,\"day\");)a.push(t.clone()),t=t.add(1,\"day\");return a},_getStartOfMonth:function(t){return this._resetTime(t.clone().startOf(\"month\"))},_getEndOfMonth:function(t){return this._resetTime(t.clone().endOf(\"month\"))},_getStartOfCalendar:function(t){return this._resetTime(t.clone().startOf(\"week\"))},_getEndOfCalendar:function(t){return this._resetTime(t.clone().endOf(\"week\"))},_resetTime:function(t){return t.hours(0).minutes(0).seconds(0).milliseconds(0)},_preventEventPropagation:function(t){t&&(t.preventDefault(),t.stopPropagation())},_getImageAtSize:function(t,e){return t.replace(/\\.([^\\.]*)$/,\"-\"+e+\".$1\")}})}(jQuery);","!function($,window,document){\"use strict\";function Wickedpicker(e,t){this.element=$(e),this.options=$.extend({},defaults,t),this.element.addClass(\"hasWickedpicker\"),this.element.attr(\"onkeypress\",\"return false;\"),this.element.attr(\"aria-showingpicker\",\"false\"),this.createPicker(),this.timepicker=$(\".wickedpicker\"),this.up=$(\".\"+this.options.upArrow.split(/\\s+/).join(\".\")),this.down=$(\".\"+this.options.downArrow.split(/\\s+/).join(\".\")),this.separator=$(\".wickedpicker__controls__control--separator\"),this.hoursElem=$(\".wickedpicker__controls__control--hours\"),this.minutesElem=$(\".wickedpicker__controls__control--minutes\"),this.secondsElem=$(\".wickedpicker__controls__control--seconds\"),this.meridiemElem=$(\".wickedpicker__controls__control--meridiem\"),this.close=$(\".\"+this.options.close.split(/\\s+/).join(\".\"));var i=this.timeArrayFromString(this.options.now);this.options.now=new Date(today.getFullYear(),today.getMonth(),today.getDate(),i[0],i[1],i[2]),this.selectedHour=this.parseHours(this.options.now.getHours()),this.selectedMin=this.parseSecMin(this.options.now.getMinutes()),this.selectedSec=this.parseSecMin(this.options.now.getSeconds()),this.selectedMeridiem=this.parseMeridiem(this.options.now.getHours()),this.setHoverState(),this.attach(e),this.setText(e)}\"function\"!=typeof String.prototype.endsWith&&(String.prototype.endsWith=function(e){return e.length>0&&this.substring(this.length-e.length,this.length)===e});var isMobile=function(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)},today=new Date,pluginName=\"wickedpicker\",defaults={now:today.getHours()+\":\"+today.getMinutes(),twentyFour:!1,upArrow:\"wickedpicker__controls__control-up\",downArrow:\"wickedpicker__controls__control-down\",close:\"wickedpicker__close\",hoverState:\"hover-state\",title:\"Timepicker\",showSeconds:!1,timeSeparator:\" : \",secondsInterval:1,minutesInterval:1,beforeShow:null,afterShow:null,show:null,clearable:!1,closeOnClickOutside:!0,onClickOutside:function(){}};$.extend(Wickedpicker.prototype,{showPicker:function(e){\"function\"==typeof this.options.beforeShow&&this.options.beforeShow(e,this.timepicker);var t=$(e).offset();if($(e).attr({\"aria-showingpicker\":\"true\",tabindex:-1}),this.setText(e),this.showHideMeridiemControl(),this.getText(e)!==this.getTime()){var i=this.getText(e),s=/\\s[ap]m$/i,o=s.test(i)?i.substr(-2,2):null,n=i.replace(s,\"\").split(this.options.timeSeparator),r={};r.hours=n[0],r.minutes=n[1],r.meridiem=o,this.options.showSeconds&&(r.seconds=n[2]),this.setTime(r)}this.timepicker.css({\"z-index\":this.element.css(\"z-index\")+1,position:\"absolute\",left:t.left,top:t.top+$(e)[0].offsetHeight}).show(),\"function\"==typeof this.options.show&&this.options.show(e,this.timepicker),this.handleTimeAdjustments(e)},hideTimepicker:function(e){this.timepicker.hide(),\"function\"==typeof this.options.afterShow&&this.options.afterShow(e,this.timepicker),{start:function(){var e=$.Deferred();return $('[aria-showingpicker=\"true\"]').attr(\"aria-showingpicker\",\"false\"),e.promise()}}.start().then(function(e){setTimeout(function(){$('[aria-showingpicker=\"false\"]').attr(\"tabindex\",e)},400)}(0))},createPicker:function(){if(0===$(\".wickedpicker\").length){var e='<div class=\"wickedpicker\"><p class=\"wickedpicker__title\">'+this.options.title+'<span class=\"wickedpicker__close\"></span></p><ul class=\"wickedpicker__controls\"><li class=\"wickedpicker__controls__control\"><span class=\"'+this.options.upArrow+'\"></span><span class=\"wickedpicker__controls__control--hours\" tabindex=\"-1\">00</span><span class=\"'+this.options.downArrow+'\"></span></li><li class=\"wickedpicker__controls__control--separator\"><span class=\"wickedpicker__controls__control--separator-inner\">:</span></li><li class=\"wickedpicker__controls__control\"><span class=\"'+this.options.upArrow+'\"></span><span class=\"wickedpicker__controls__control--minutes\" tabindex=\"-1\">00</span><span class=\"'+this.options.downArrow+'\"></span></li>';this.options.showSeconds&&(e+='<li class=\"wickedpicker__controls__control--separator\"><span class=\"wickedpicker__controls__control--separator-inner\">:</span></li><li class=\"wickedpicker__controls__control\"><span class=\"'+this.options.upArrow+'\"></span><span class=\"wickedpicker__controls__control--seconds\" tabindex=\"-1\">00</span><span class=\"'+this.options.downArrow+'\"></span> </li>'),e+='<li class=\"wickedpicker__controls__control\"><span class=\"'+this.options.upArrow+'\"></span><span class=\"wickedpicker__controls__control--meridiem\" tabindex=\"-1\">AM</span><span class=\"'+this.options.downArrow+'\"></span></li></ul></div>',$(\"body\").append(e),this.attachKeyboardEvents()}},showHideMeridiemControl:function(){!1===this.options.twentyFour?$(this.meridiemElem).parent().show():$(this.meridiemElem).parent().hide()},showHideSecondsControl:function(){this.options.showSeconds?$(this.secondsElem).parent().show():$(this.secondsElem).parent().hide()},attach:function(e){var t=this;this.options.clearable&&t.makePickerInputClearable(e),$(e).attr(\"tabindex\",0),$(e).on(\"click focus\",function(e){$(t.timepicker).is(\":hidden\")&&(t.showPicker($(this)),window.lastTimePickerControl=$(this),$(t.hoursElem).focus())});var i=function(e){if($(t.timepicker).is(\":visible\")){if($(e.target).is(t.close))t.hideTimepicker(window.lastTimePickerControl);else if($(e.target).closest(t.timepicker).length||$(e.target).closest($(\".hasWickedpicker\")).length)e.stopPropagation();else{if(\"function\"==typeof t.options.onClickOutside?t.options.onClickOutside():console.warn(\"Type of onClickOutside must be a function\"),!t.options.closeOnClickOutside)return;t.hideTimepicker(window.lastTimePickerControl)}window.lastTimePickerControl=null}};$(document).off(\"click\",i).on(\"click\",i)},attachKeyboardEvents:function(){$(document).on(\"keydown\",$.proxy(function(e){switch(e.keyCode){case 9:\"hasWickedpicker\"!==e.target.className&&$(this.close).trigger(\"click\");break;case 27:$(this.close).trigger(\"click\");break;case 37:e.target.className!==this.hoursElem[0].className?$(e.target).parent().prevAll(\"li\").not(this.separator.selector).first().children()[1].focus():$(e.target).parent().siblings(\":last\").children()[1].focus();break;case 39:e.target.className!==this.meridiemElem[0].className?$(e.target).parent().nextAll(\"li\").not(this.separator.selector).first().children()[1].focus():$(e.target).parent().siblings(\":first\").children()[1].focus();break;case 38:$(\":focus\").prev().trigger(\"click\");break;case 40:$(\":focus\").next().trigger(\"click\")}},this))},setTime:function(e){this.setHours(e.hours),this.setMinutes(e.minutes),this.setMeridiem(e.meridiem),this.options.showSeconds&&this.setSeconds(e.seconds)},getTime:function(){return[this.formatTime(this.getHours(),this.getMinutes(),this.getMeridiem(),this.getSeconds())]},setHours:function(e){var t=new Date;t.setHours(e);var i=this.parseHours(t.getHours());this.hoursElem.text(i),this.selectedHour=i},getHours:function(){var e=new Date;return e.setHours(this.hoursElem.text()),e.getHours()},parseHours:function(e){return!1===this.options.twentyFour?(e+11)%12+1:e<10?\"0\"+e:e},setMinutes:function(e){var t=new Date;t.setMinutes(e);var i=t.getMinutes(),s=this.parseSecMin(i);this.minutesElem.text(s),this.selectedMin=s},getMinutes:function(){var e=new Date;return e.setMinutes(this.minutesElem.text()),e.getMinutes()},parseSecMin:function(e){return(e<10?\"0\":\"\")+e},setMeridiem:function(e){var t=\"\";t=void 0===e?\"PM\"===this.getMeridiem()?\"AM\":\"PM\":e,this.meridiemElem.text(t),this.selectedMeridiem=t},getMeridiem:function(){return this.meridiemElem.text()},setSeconds:function(e){var t=new Date;t.setSeconds(e);var i=t.getSeconds(),s=this.parseSecMin(i);this.secondsElem.text(s),this.selectedSec=s},getSeconds:function(){var e=new Date;return e.setSeconds(this.secondsElem.text()),e.getSeconds()},parseMeridiem:function(e){return e>11?\"PM\":\"AM\"},handleTimeAdjustments:function(e){var t=0;$(this.up).add(this.down).off(\"mousedown click touchstart\").on(\"mousedown click\",{Wickedpicker:this,input:e},function(e){if(1!=e.which)return!1;var i=this.className.indexOf(\"up\")>-1?\"+\":\"-\",s=e.data;\"mousedown\"==e.type?t=setInterval($.proxy(function(e){e.Wickedpicker.changeValue(i,e.input,this)},this,{Wickedpicker:s.Wickedpicker,input:s.input}),200):s.Wickedpicker.changeValue(i,s.input,this)}).bind(\"mouseup touchend\",function(){clearInterval(t)})},changeValue:function(operator,input,clicked){var target=\"+\"===operator?clicked.nextSibling:clicked.previousSibling,targetClass=$(target).attr(\"class\");targetClass.endsWith(\"hours\")?this.setHours(eval(this.getHours()+operator+1)):targetClass.endsWith(\"minutes\")?this.setMinutes(eval(this.getMinutes()+operator+this.options.minutesInterval)):targetClass.endsWith(\"seconds\")?this.setSeconds(eval(this.getSeconds()+operator+this.options.secondsInterval)):this.setMeridiem(),this.setText(input)},setText:function(e){$(e).val(this.formatTime(this.selectedHour,this.selectedMin,this.selectedMeridiem,this.selectedSec)).change()},getText:function(e){return $(e).val()},formatTime:function(e,t,i,s){var o=e+this.options.timeSeparator+t;return this.options.showSeconds&&(o+=this.options.timeSeparator+s),!1===this.options.twentyFour&&(o+=\" \"+i),o},setHoverState:function(){var e=this;isMobile()||$(this.up).add(this.down).add(this.close).hover(function(){$(this).toggleClass(e.options.hoverState)})},makePickerInputClearable:function(e){$(e).wrap('<div class=\"clearable-picker\"></div>').after(\"<span data-clear-picker>&times;</span>\"),$(\"[data-clear-picker]\").on(\"click\",function(e){$(this).siblings(\".hasWickedpicker\").val(\"\")})},timeArrayFromString:function(e){if(e.length){var t=e.split(\":\");return t[2]=t.length<3?\"00\":t[2],t}return!1},_time:function(){var e=$(this.element).val();return\"\"===e?this.formatTime(this.selectedHour,this.selectedMin,this.selectedMeridiem,this.selectedSec):e},_hide:function(){this.hideTimepicker(this.element)}}),$.fn[pluginName]=function(e,t){return $.isFunction(Wickedpicker.prototype[\"_\"+e])?$(this).hasClass(\"hasWickedpicker\")?void 0!==t?$.data($(this)[t],\"plugin_\"+pluginName)[\"_\"+e]():$.data($(this)[0],\"plugin_\"+pluginName)[\"_\"+e]():void 0:this.each(function(){$.data(this,\"plugin_\"+pluginName)||$.data(this,\"plugin_\"+pluginName,new Wickedpicker(this,e))})}}(jQuery,window,document);","/*! Select2 4.1.0-rc.0 | https://github.com/select2/select2/blob/master/LICENSE.md */\n!function(n){\"function\"==typeof define&&define.amd?define([\"jquery\"],n):\"object\"==typeof module&&module.exports?module.exports=function(e,t){return void 0===t&&(t=\"undefined\"!=typeof window?require(\"jquery\"):require(\"jquery\")(e)),n(t),t}:n(jQuery)}(function(t){var e,n,s,p,r,o,h,f,g,m,y,v,i,a,_,s=(t&&t.fn&&t.fn.select2&&t.fn.select2.amd&&(u=t.fn.select2.amd),u&&u.requirejs||(u?n=u:u={},g={},m={},y={},v={},i=Object.prototype.hasOwnProperty,a=[].slice,_=/\\.js$/,h=function(e,t){var n,s,i=c(e),r=i[0],t=t[1];return e=i[1],r&&(n=x(r=l(r,t))),r?e=n&&n.normalize?n.normalize(e,(s=t,function(e){return l(e,s)})):l(e,t):(r=(i=c(e=l(e,t)))[0],e=i[1],r&&(n=x(r))),{f:r?r+\"!\"+e:e,n:e,pr:r,p:n}},f={require:function(e){return w(e)},exports:function(e){var t=g[e];return void 0!==t?t:g[e]={}},module:function(e){return{id:e,uri:\"\",exports:g[e],config:(t=e,function(){return y&&y.config&&y.config[t]||{}})};var t}},r=function(e,t,n,s){var i,r,o,a,l,c=[],u=typeof n,d=A(s=s||e);if(\"undefined\"==u||\"function\"==u){for(t=!t.length&&n.length?[\"require\",\"exports\",\"module\"]:t,a=0;a<t.length;a+=1)if(\"require\"===(r=(o=h(t[a],d)).f))c[a]=f.require(e);else if(\"exports\"===r)c[a]=f.exports(e),l=!0;else if(\"module\"===r)i=c[a]=f.module(e);else if(b(g,r)||b(m,r)||b(v,r))c[a]=x(r);else{if(!o.p)throw new Error(e+\" missing \"+r);o.p.load(o.n,w(s,!0),function(t){return function(e){g[t]=e}}(r),{}),c[a]=g[r]}u=n?n.apply(g[e],c):void 0,e&&(i&&i.exports!==p&&i.exports!==g[e]?g[e]=i.exports:u===p&&l||(g[e]=u))}else e&&(g[e]=n)},e=n=o=function(e,t,n,s,i){if(\"string\"==typeof e)return f[e]?f[e](t):x(h(e,A(t)).f);if(!e.splice){if((y=e).deps&&o(y.deps,y.callback),!t)return;t.splice?(e=t,t=n,n=null):e=p}return t=t||function(){},\"function\"==typeof n&&(n=s,s=i),s?r(p,e,t,n):setTimeout(function(){r(p,e,t,n)},4),o},o.config=function(e){return o(e)},e._defined=g,(s=function(e,t,n){if(\"string\"!=typeof e)throw new Error(\"See almond README: incorrect module build, no module name\");t.splice||(n=t,t=[]),b(g,e)||b(m,e)||(m[e]=[e,t,n])}).amd={jQuery:!0},u.requirejs=e,u.require=n,u.define=s),u.define(\"almond\",function(){}),u.define(\"jquery\",[],function(){var e=t||$;return null==e&&console&&console.error&&console.error(\"Select2: An instance of jQuery or a jQuery-compatible library was not found. Make sure that you are including jQuery before Select2 on your web page.\"),e}),u.define(\"select2/utils\",[\"jquery\"],function(r){var s={};function c(e){var t,n=e.prototype,s=[];for(t in n)\"function\"==typeof n[t]&&\"constructor\"!==t&&s.push(t);return s}s.Extend=function(e,t){var n,s={}.hasOwnProperty;function i(){this.constructor=e}for(n in t)s.call(t,n)&&(e[n]=t[n]);return i.prototype=t.prototype,e.prototype=new i,e.__super__=t.prototype,e},s.Decorate=function(s,i){var e=c(i),t=c(s);function r(){var e=Array.prototype.unshift,t=i.prototype.constructor.length,n=s.prototype.constructor;0<t&&(e.call(arguments,s.prototype.constructor),n=i.prototype.constructor),n.apply(this,arguments)}i.displayName=s.displayName,r.prototype=new function(){this.constructor=r};for(var n=0;n<t.length;n++){var o=t[n];r.prototype[o]=s.prototype[o]}for(var a=0;a<e.length;a++){var l=e[a];r.prototype[l]=function(e){var t=function(){};e in r.prototype&&(t=r.prototype[e]);var n=i.prototype[e];return function(){return Array.prototype.unshift.call(arguments,t),n.apply(this,arguments)}}(l)}return r};function e(){this.listeners={}}e.prototype.on=function(e,t){this.listeners=this.listeners||{},e in this.listeners?this.listeners[e].push(t):this.listeners[e]=[t]},e.prototype.trigger=function(e){var t=Array.prototype.slice,n=t.call(arguments,1);this.listeners=this.listeners||{},null==n&&(n=[]),0===n.length&&n.push({}),(n[0]._type=e)in this.listeners&&this.invoke(this.listeners[e],t.call(arguments,1)),\"*\"in this.listeners&&this.invoke(this.listeners[\"*\"],arguments)},e.prototype.invoke=function(e,t){for(var n=0,s=e.length;n<s;n++)e[n].apply(this,t)},s.Observable=e,s.generateChars=function(e){for(var t=\"\",n=0;n<e;n++)t+=Math.floor(36*Math.random()).toString(36);return t},s.bind=function(e,t){return function(){e.apply(t,arguments)}},s._convertData=function(e){for(var t in e){var n=t.split(\"-\"),s=e;if(1!==n.length){for(var i=0;i<n.length;i++){var r=n[i];(r=r.substring(0,1).toLowerCase()+r.substring(1))in s||(s[r]={}),i==n.length-1&&(s[r]=e[t]),s=s[r]}delete e[t]}}return e},s.hasScroll=function(e,t){var n=r(t),s=t.style.overflowX,i=t.style.overflowY;return(s!==i||\"hidden\"!==i&&\"visible\"!==i)&&(\"scroll\"===s||\"scroll\"===i||(n.innerHeight()<t.scrollHeight||n.innerWidth()<t.scrollWidth))},s.escapeMarkup=function(e){var t={\"\\\\\":\"&#92;\",\"&\":\"&amp;\",\"<\":\"&lt;\",\">\":\"&gt;\",'\"':\"&quot;\",\"'\":\"&#39;\",\"/\":\"&#47;\"};return\"string\"!=typeof e?e:String(e).replace(/[&<>\"'\\/\\\\]/g,function(e){return t[e]})},s.__cache={};var n=0;return s.GetUniqueElementId=function(e){var t=e.getAttribute(\"data-select2-id\");return null!=t||(t=e.id?\"select2-data-\"+e.id:\"select2-data-\"+(++n).toString()+\"-\"+s.generateChars(4),e.setAttribute(\"data-select2-id\",t)),t},s.StoreData=function(e,t,n){e=s.GetUniqueElementId(e);s.__cache[e]||(s.__cache[e]={}),s.__cache[e][t]=n},s.GetData=function(e,t){var n=s.GetUniqueElementId(e);return t?s.__cache[n]&&null!=s.__cache[n][t]?s.__cache[n][t]:r(e).data(t):s.__cache[n]},s.RemoveData=function(e){var t=s.GetUniqueElementId(e);null!=s.__cache[t]&&delete s.__cache[t],e.removeAttribute(\"data-select2-id\")},s.copyNonInternalCssClasses=function(e,t){var n=(n=e.getAttribute(\"class\").trim().split(/\\s+/)).filter(function(e){return 0===e.indexOf(\"select2-\")}),t=(t=t.getAttribute(\"class\").trim().split(/\\s+/)).filter(function(e){return 0!==e.indexOf(\"select2-\")}),t=n.concat(t);e.setAttribute(\"class\",t.join(\" \"))},s}),u.define(\"select2/results\",[\"jquery\",\"./utils\"],function(d,p){function s(e,t,n){this.$element=e,this.data=n,this.options=t,s.__super__.constructor.call(this)}return p.Extend(s,p.Observable),s.prototype.render=function(){var e=d('<ul class=\"select2-results__options\" role=\"listbox\"></ul>');return this.options.get(\"multiple\")&&e.attr(\"aria-multiselectable\",\"true\"),this.$results=e},s.prototype.clear=function(){this.$results.empty()},s.prototype.displayMessage=function(e){var t=this.options.get(\"escapeMarkup\");this.clear(),this.hideLoading();var n=d('<li role=\"alert\" aria-live=\"assertive\" class=\"select2-results__option\"></li>'),s=this.options.get(\"translations\").get(e.message);n.append(t(s(e.args))),n[0].className+=\" select2-results__message\",this.$results.append(n)},s.prototype.hideMessages=function(){this.$results.find(\".select2-results__message\").remove()},s.prototype.append=function(e){this.hideLoading();var t=[];if(null!=e.results&&0!==e.results.length){e.results=this.sort(e.results);for(var n=0;n<e.results.length;n++){var s=e.results[n],s=this.option(s);t.push(s)}this.$results.append(t)}else 0===this.$results.children().length&&this.trigger(\"results:message\",{message:\"noResults\"})},s.prototype.position=function(e,t){t.find(\".select2-results\").append(e)},s.prototype.sort=function(e){return this.options.get(\"sorter\")(e)},s.prototype.highlightFirstItem=function(){var e=this.$results.find(\".select2-results__option--selectable\"),t=e.filter(\".select2-results__option--selected\");(0<t.length?t:e).first().trigger(\"mouseenter\"),this.ensureHighlightVisible()},s.prototype.setClasses=function(){var t=this;this.data.current(function(e){var s=e.map(function(e){return e.id.toString()});t.$results.find(\".select2-results__option--selectable\").each(function(){var e=d(this),t=p.GetData(this,\"data\"),n=\"\"+t.id;null!=t.element&&t.element.selected||null==t.element&&-1<s.indexOf(n)?(this.classList.add(\"select2-results__option--selected\"),e.attr(\"aria-selected\",\"true\")):(this.classList.remove(\"select2-results__option--selected\"),e.attr(\"aria-selected\",\"false\"))})})},s.prototype.showLoading=function(e){this.hideLoading();e={disabled:!0,loading:!0,text:this.options.get(\"translations\").get(\"searching\")(e)},e=this.option(e);e.className+=\" loading-results\",this.$results.prepend(e)},s.prototype.hideLoading=function(){this.$results.find(\".loading-results\").remove()},s.prototype.option=function(e){var t=document.createElement(\"li\");t.classList.add(\"select2-results__option\"),t.classList.add(\"select2-results__option--selectable\");var n,s={role:\"option\"},i=window.Element.prototype.matches||window.Element.prototype.msMatchesSelector||window.Element.prototype.webkitMatchesSelector;for(n in(null!=e.element&&i.call(e.element,\":disabled\")||null==e.element&&e.disabled)&&(s[\"aria-disabled\"]=\"true\",t.classList.remove(\"select2-results__option--selectable\"),t.classList.add(\"select2-results__option--disabled\")),null==e.id&&t.classList.remove(\"select2-results__option--selectable\"),null!=e._resultId&&(t.id=e._resultId),e.title&&(t.title=e.title),e.children&&(s.role=\"group\",s[\"aria-label\"]=e.text,t.classList.remove(\"select2-results__option--selectable\"),t.classList.add(\"select2-results__option--group\")),s){var r=s[n];t.setAttribute(n,r)}if(e.children){var o=d(t),a=document.createElement(\"strong\");a.className=\"select2-results__group\",this.template(e,a);for(var l=[],c=0;c<e.children.length;c++){var u=e.children[c],u=this.option(u);l.push(u)}i=d(\"<ul></ul>\",{class:\"select2-results__options select2-results__options--nested\",role:\"none\"});i.append(l),o.append(a),o.append(i)}else this.template(e,t);return p.StoreData(t,\"data\",e),t},s.prototype.bind=function(t,e){var i=this,n=t.id+\"-results\";this.$results.attr(\"id\",n),t.on(\"results:all\",function(e){i.clear(),i.append(e.data),t.isOpen()&&(i.setClasses(),i.highlightFirstItem())}),t.on(\"results:append\",function(e){i.append(e.data),t.isOpen()&&i.setClasses()}),t.on(\"query\",function(e){i.hideMessages(),i.showLoading(e)}),t.on(\"select\",function(){t.isOpen()&&(i.setClasses(),i.options.get(\"scrollAfterSelect\")&&i.highlightFirstItem())}),t.on(\"unselect\",function(){t.isOpen()&&(i.setClasses(),i.options.get(\"scrollAfterSelect\")&&i.highlightFirstItem())}),t.on(\"open\",function(){i.$results.attr(\"aria-expanded\",\"true\"),i.$results.attr(\"aria-hidden\",\"false\"),i.setClasses(),i.ensureHighlightVisible()}),t.on(\"close\",function(){i.$results.attr(\"aria-expanded\",\"false\"),i.$results.attr(\"aria-hidden\",\"true\"),i.$results.removeAttr(\"aria-activedescendant\")}),t.on(\"results:toggle\",function(){var e=i.getHighlightedResults();0!==e.length&&e.trigger(\"mouseup\")}),t.on(\"results:select\",function(){var e,t=i.getHighlightedResults();0!==t.length&&(e=p.GetData(t[0],\"data\"),t.hasClass(\"select2-results__option--selected\")?i.trigger(\"close\",{}):i.trigger(\"select\",{data:e}))}),t.on(\"results:previous\",function(){var e,t=i.getHighlightedResults(),n=i.$results.find(\".select2-results__option--selectable\"),s=n.index(t);s<=0||(e=s-1,0===t.length&&(e=0),(s=n.eq(e)).trigger(\"mouseenter\"),t=i.$results.offset().top,n=s.offset().top,s=i.$results.scrollTop()+(n-t),0===e?i.$results.scrollTop(0):n-t<0&&i.$results.scrollTop(s))}),t.on(\"results:next\",function(){var e,t=i.getHighlightedResults(),n=i.$results.find(\".select2-results__option--selectable\"),s=n.index(t)+1;s>=n.length||((e=n.eq(s)).trigger(\"mouseenter\"),t=i.$results.offset().top+i.$results.outerHeight(!1),n=e.offset().top+e.outerHeight(!1),e=i.$results.scrollTop()+n-t,0===s?i.$results.scrollTop(0):t<n&&i.$results.scrollTop(e))}),t.on(\"results:focus\",function(e){e.element[0].classList.add(\"select2-results__option--highlighted\"),e.element[0].setAttribute(\"aria-selected\",\"true\")}),t.on(\"results:message\",function(e){i.displayMessage(e)}),d.fn.mousewheel&&this.$results.on(\"mousewheel\",function(e){var t=i.$results.scrollTop(),n=i.$results.get(0).scrollHeight-t+e.deltaY,t=0<e.deltaY&&t-e.deltaY<=0,n=e.deltaY<0&&n<=i.$results.height();t?(i.$results.scrollTop(0),e.preventDefault(),e.stopPropagation()):n&&(i.$results.scrollTop(i.$results.get(0).scrollHeight-i.$results.height()),e.preventDefault(),e.stopPropagation())}),this.$results.on(\"mouseup\",\".select2-results__option--selectable\",function(e){var t=d(this),n=p.GetData(this,\"data\");t.hasClass(\"select2-results__option--selected\")?i.options.get(\"multiple\")?i.trigger(\"unselect\",{originalEvent:e,data:n}):i.trigger(\"close\",{}):i.trigger(\"select\",{originalEvent:e,data:n})}),this.$results.on(\"mouseenter\",\".select2-results__option--selectable\",function(e){var t=p.GetData(this,\"data\");i.getHighlightedResults().removeClass(\"select2-results__option--highlighted\").attr(\"aria-selected\",\"false\"),i.trigger(\"results:focus\",{data:t,element:d(this)})})},s.prototype.getHighlightedResults=function(){return this.$results.find(\".select2-results__option--highlighted\")},s.prototype.destroy=function(){this.$results.remove()},s.prototype.ensureHighlightVisible=function(){var e,t,n,s,i=this.getHighlightedResults();0!==i.length&&(e=this.$results.find(\".select2-results__option--selectable\").index(i),s=this.$results.offset().top,t=i.offset().top,n=this.$results.scrollTop()+(t-s),s=t-s,n-=2*i.outerHeight(!1),e<=2?this.$results.scrollTop(0):(s>this.$results.outerHeight()||s<0)&&this.$results.scrollTop(n))},s.prototype.template=function(e,t){var n=this.options.get(\"templateResult\"),s=this.options.get(\"escapeMarkup\"),e=n(e,t);null==e?t.style.display=\"none\":\"string\"==typeof e?t.innerHTML=s(e):d(t).append(e)},s}),u.define(\"select2/keys\",[],function(){return{BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46}}),u.define(\"select2/selection/base\",[\"jquery\",\"../utils\",\"../keys\"],function(n,s,i){function r(e,t){this.$element=e,this.options=t,r.__super__.constructor.call(this)}return s.Extend(r,s.Observable),r.prototype.render=function(){var e=n('<span class=\"select2-selection\" role=\"combobox\"  aria-haspopup=\"true\" aria-expanded=\"false\"></span>');return this._tabindex=0,null!=s.GetData(this.$element[0],\"old-tabindex\")?this._tabindex=s.GetData(this.$element[0],\"old-tabindex\"):null!=this.$element.attr(\"tabindex\")&&(this._tabindex=this.$element.attr(\"tabindex\")),e.attr(\"title\",this.$element.attr(\"title\")),e.attr(\"tabindex\",this._tabindex),e.attr(\"aria-disabled\",\"false\"),this.$selection=e},r.prototype.bind=function(e,t){var n=this,s=e.id+\"-results\";this.container=e,this.$selection.on(\"focus\",function(e){n.trigger(\"focus\",e)}),this.$selection.on(\"blur\",function(e){n._handleBlur(e)}),this.$selection.on(\"keydown\",function(e){n.trigger(\"keypress\",e),e.which===i.SPACE&&e.preventDefault()}),e.on(\"results:focus\",function(e){n.$selection.attr(\"aria-activedescendant\",e.data._resultId)}),e.on(\"selection:update\",function(e){n.update(e.data)}),e.on(\"open\",function(){n.$selection.attr(\"aria-expanded\",\"true\"),n.$selection.attr(\"aria-owns\",s),n._attachCloseHandler(e)}),e.on(\"close\",function(){n.$selection.attr(\"aria-expanded\",\"false\"),n.$selection.removeAttr(\"aria-activedescendant\"),n.$selection.removeAttr(\"aria-owns\"),n.$selection.trigger(\"focus\"),n._detachCloseHandler(e)}),e.on(\"enable\",function(){n.$selection.attr(\"tabindex\",n._tabindex),n.$selection.attr(\"aria-disabled\",\"false\")}),e.on(\"disable\",function(){n.$selection.attr(\"tabindex\",\"-1\"),n.$selection.attr(\"aria-disabled\",\"true\")})},r.prototype._handleBlur=function(e){var t=this;window.setTimeout(function(){document.activeElement==t.$selection[0]||n.contains(t.$selection[0],document.activeElement)||t.trigger(\"blur\",e)},1)},r.prototype._attachCloseHandler=function(e){n(document.body).on(\"mousedown.select2.\"+e.id,function(e){var t=n(e.target).closest(\".select2\");n(\".select2.select2-container--open\").each(function(){this!=t[0]&&s.GetData(this,\"element\").select2(\"close\")})})},r.prototype._detachCloseHandler=function(e){n(document.body).off(\"mousedown.select2.\"+e.id)},r.prototype.position=function(e,t){t.find(\".selection\").append(e)},r.prototype.destroy=function(){this._detachCloseHandler(this.container)},r.prototype.update=function(e){throw new Error(\"The `update` method must be defined in child classes.\")},r.prototype.isEnabled=function(){return!this.isDisabled()},r.prototype.isDisabled=function(){return this.options.get(\"disabled\")},r}),u.define(\"select2/selection/single\",[\"jquery\",\"./base\",\"../utils\",\"../keys\"],function(e,t,n,s){function i(){i.__super__.constructor.apply(this,arguments)}return n.Extend(i,t),i.prototype.render=function(){var e=i.__super__.render.call(this);return e[0].classList.add(\"select2-selection--single\"),e.html('<span class=\"select2-selection__rendered\"></span><span class=\"select2-selection__arrow\" role=\"presentation\"><b role=\"presentation\"></b></span>'),e},i.prototype.bind=function(t,e){var n=this;i.__super__.bind.apply(this,arguments);var s=t.id+\"-container\";this.$selection.find(\".select2-selection__rendered\").attr(\"id\",s).attr(\"role\",\"textbox\").attr(\"aria-readonly\",\"true\"),this.$selection.attr(\"aria-labelledby\",s),this.$selection.attr(\"aria-controls\",s),this.$selection.on(\"mousedown\",function(e){1===e.which&&n.trigger(\"toggle\",{originalEvent:e})}),this.$selection.on(\"focus\",function(e){}),this.$selection.on(\"blur\",function(e){}),t.on(\"focus\",function(e){t.isOpen()||n.$selection.trigger(\"focus\")})},i.prototype.clear=function(){var e=this.$selection.find(\".select2-selection__rendered\");e.empty(),e.removeAttr(\"title\")},i.prototype.display=function(e,t){var n=this.options.get(\"templateSelection\");return this.options.get(\"escapeMarkup\")(n(e,t))},i.prototype.selectionContainer=function(){return e(\"<span></span>\")},i.prototype.update=function(e){var t,n;0!==e.length?(n=e[0],t=this.$selection.find(\".select2-selection__rendered\"),e=this.display(n,t),t.empty().append(e),(n=n.title||n.text)?t.attr(\"title\",n):t.removeAttr(\"title\")):this.clear()},i}),u.define(\"select2/selection/multiple\",[\"jquery\",\"./base\",\"../utils\"],function(i,e,c){function r(e,t){r.__super__.constructor.apply(this,arguments)}return c.Extend(r,e),r.prototype.render=function(){var e=r.__super__.render.call(this);return e[0].classList.add(\"select2-selection--multiple\"),e.html('<ul class=\"select2-selection__rendered\"></ul>'),e},r.prototype.bind=function(e,t){var n=this;r.__super__.bind.apply(this,arguments);var s=e.id+\"-container\";this.$selection.find(\".select2-selection__rendered\").attr(\"id\",s),this.$selection.on(\"click\",function(e){n.trigger(\"toggle\",{originalEvent:e})}),this.$selection.on(\"click\",\".select2-selection__choice__remove\",function(e){var t;n.isDisabled()||(t=i(this).parent(),t=c.GetData(t[0],\"data\"),n.trigger(\"unselect\",{originalEvent:e,data:t}))}),this.$selection.on(\"keydown\",\".select2-selection__choice__remove\",function(e){n.isDisabled()||e.stopPropagation()})},r.prototype.clear=function(){var e=this.$selection.find(\".select2-selection__rendered\");e.empty(),e.removeAttr(\"title\")},r.prototype.display=function(e,t){var n=this.options.get(\"templateSelection\");return this.options.get(\"escapeMarkup\")(n(e,t))},r.prototype.selectionContainer=function(){return i('<li class=\"select2-selection__choice\"><button type=\"button\" class=\"select2-selection__choice__remove\" tabindex=\"-1\"><span aria-hidden=\"true\">&times;</span></button><span class=\"select2-selection__choice__display\"></span></li>')},r.prototype.update=function(e){if(this.clear(),0!==e.length){for(var t=[],n=this.$selection.find(\".select2-selection__rendered\").attr(\"id\")+\"-choice-\",s=0;s<e.length;s++){var i=e[s],r=this.selectionContainer(),o=this.display(i,r),a=n+c.generateChars(4)+\"-\";i.id?a+=i.id:a+=c.generateChars(4),r.find(\".select2-selection__choice__display\").append(o).attr(\"id\",a);var l=i.title||i.text;l&&r.attr(\"title\",l);o=this.options.get(\"translations\").get(\"removeItem\"),l=r.find(\".select2-selection__choice__remove\");l.attr(\"title\",o()),l.attr(\"aria-label\",o()),l.attr(\"aria-describedby\",a),c.StoreData(r[0],\"data\",i),t.push(r)}this.$selection.find(\".select2-selection__rendered\").append(t)}},r}),u.define(\"select2/selection/placeholder\",[],function(){function e(e,t,n){this.placeholder=this.normalizePlaceholder(n.get(\"placeholder\")),e.call(this,t,n)}return e.prototype.normalizePlaceholder=function(e,t){return\"string\"==typeof t&&(t={id:\"\",text:t}),t},e.prototype.createPlaceholder=function(e,t){var n=this.selectionContainer();n.html(this.display(t)),n[0].classList.add(\"select2-selection__placeholder\"),n[0].classList.remove(\"select2-selection__choice\");t=t.title||t.text||n.text();return this.$selection.find(\".select2-selection__rendered\").attr(\"title\",t),n},e.prototype.update=function(e,t){var n=1==t.length&&t[0].id!=this.placeholder.id;if(1<t.length||n)return e.call(this,t);this.clear();t=this.createPlaceholder(this.placeholder);this.$selection.find(\".select2-selection__rendered\").append(t)},e}),u.define(\"select2/selection/allowClear\",[\"jquery\",\"../keys\",\"../utils\"],function(i,s,a){function e(){}return e.prototype.bind=function(e,t,n){var s=this;e.call(this,t,n),null==this.placeholder&&this.options.get(\"debug\")&&window.console&&console.error&&console.error(\"Select2: The `allowClear` option should be used in combination with the `placeholder` option.\"),this.$selection.on(\"mousedown\",\".select2-selection__clear\",function(e){s._handleClear(e)}),t.on(\"keypress\",function(e){s._handleKeyboardClear(e,t)})},e.prototype._handleClear=function(e,t){if(!this.isDisabled()){var n=this.$selection.find(\".select2-selection__clear\");if(0!==n.length){t.stopPropagation();var s=a.GetData(n[0],\"data\"),i=this.$element.val();this.$element.val(this.placeholder.id);var r={data:s};if(this.trigger(\"clear\",r),r.prevented)this.$element.val(i);else{for(var o=0;o<s.length;o++)if(r={data:s[o]},this.trigger(\"unselect\",r),r.prevented)return void this.$element.val(i);this.$element.trigger(\"input\").trigger(\"change\"),this.trigger(\"toggle\",{})}}}},e.prototype._handleKeyboardClear=function(e,t,n){n.isOpen()||t.which!=s.DELETE&&t.which!=s.BACKSPACE||this._handleClear(t)},e.prototype.update=function(e,t){var n,s;e.call(this,t),this.$selection.find(\".select2-selection__clear\").remove(),this.$selection[0].classList.remove(\"select2-selection--clearable\"),0<this.$selection.find(\".select2-selection__placeholder\").length||0===t.length||(n=this.$selection.find(\".select2-selection__rendered\").attr(\"id\"),s=this.options.get(\"translations\").get(\"removeAllItems\"),(e=i('<button type=\"button\" class=\"select2-selection__clear\" tabindex=\"-1\"><span aria-hidden=\"true\">&times;</span></button>')).attr(\"title\",s()),e.attr(\"aria-label\",s()),e.attr(\"aria-describedby\",n),a.StoreData(e[0],\"data\",t),this.$selection.prepend(e),this.$selection[0].classList.add(\"select2-selection--clearable\"))},e}),u.define(\"select2/selection/search\",[\"jquery\",\"../utils\",\"../keys\"],function(s,a,l){function e(e,t,n){e.call(this,t,n)}return e.prototype.render=function(e){var t=this.options.get(\"translations\").get(\"search\"),n=s('<span class=\"select2-search select2-search--inline\"><textarea class=\"select2-search__field\" type=\"search\" tabindex=\"-1\" autocorrect=\"off\" autocapitalize=\"none\" spellcheck=\"false\" role=\"searchbox\" aria-autocomplete=\"list\" ></textarea></span>');this.$searchContainer=n,this.$search=n.find(\"textarea\"),this.$search.prop(\"autocomplete\",this.options.get(\"autocomplete\")),this.$search.attr(\"aria-label\",t());e=e.call(this);return this._transferTabIndex(),e.append(this.$searchContainer),e},e.prototype.bind=function(e,t,n){var s=this,i=t.id+\"-results\",r=t.id+\"-container\";e.call(this,t,n),s.$search.attr(\"aria-describedby\",r),t.on(\"open\",function(){s.$search.attr(\"aria-controls\",i),s.$search.trigger(\"focus\")}),t.on(\"close\",function(){s.$search.val(\"\"),s.resizeSearch(),s.$search.removeAttr(\"aria-controls\"),s.$search.removeAttr(\"aria-activedescendant\"),s.$search.trigger(\"focus\")}),t.on(\"enable\",function(){s.$search.prop(\"disabled\",!1),s._transferTabIndex()}),t.on(\"disable\",function(){s.$search.prop(\"disabled\",!0)}),t.on(\"focus\",function(e){s.$search.trigger(\"focus\")}),t.on(\"results:focus\",function(e){e.data._resultId?s.$search.attr(\"aria-activedescendant\",e.data._resultId):s.$search.removeAttr(\"aria-activedescendant\")}),this.$selection.on(\"focusin\",\".select2-search--inline\",function(e){s.trigger(\"focus\",e)}),this.$selection.on(\"focusout\",\".select2-search--inline\",function(e){s._handleBlur(e)}),this.$selection.on(\"keydown\",\".select2-search--inline\",function(e){var t;e.stopPropagation(),s.trigger(\"keypress\",e),s._keyUpPrevented=e.isDefaultPrevented(),e.which!==l.BACKSPACE||\"\"!==s.$search.val()||0<(t=s.$selection.find(\".select2-selection__choice\").last()).length&&(t=a.GetData(t[0],\"data\"),s.searchRemoveChoice(t),e.preventDefault())}),this.$selection.on(\"click\",\".select2-search--inline\",function(e){s.$search.val()&&e.stopPropagation()});var t=document.documentMode,o=t&&t<=11;this.$selection.on(\"input.searchcheck\",\".select2-search--inline\",function(e){o?s.$selection.off(\"input.search input.searchcheck\"):s.$selection.off(\"keyup.search\")}),this.$selection.on(\"keyup.search input.search\",\".select2-search--inline\",function(e){var t;o&&\"input\"===e.type?s.$selection.off(\"input.search input.searchcheck\"):(t=e.which)!=l.SHIFT&&t!=l.CTRL&&t!=l.ALT&&t!=l.TAB&&s.handleSearch(e)})},e.prototype._transferTabIndex=function(e){this.$search.attr(\"tabindex\",this.$selection.attr(\"tabindex\")),this.$selection.attr(\"tabindex\",\"-1\")},e.prototype.createPlaceholder=function(e,t){this.$search.attr(\"placeholder\",t.text)},e.prototype.update=function(e,t){var n=this.$search[0]==document.activeElement;this.$search.attr(\"placeholder\",\"\"),e.call(this,t),this.resizeSearch(),n&&this.$search.trigger(\"focus\")},e.prototype.handleSearch=function(){var e;this.resizeSearch(),this._keyUpPrevented||(e=this.$search.val(),this.trigger(\"query\",{term:e})),this._keyUpPrevented=!1},e.prototype.searchRemoveChoice=function(e,t){this.trigger(\"unselect\",{data:t}),this.$search.val(t.text),this.handleSearch()},e.prototype.resizeSearch=function(){this.$search.css(\"width\",\"25px\");var e=\"100%\";\"\"===this.$search.attr(\"placeholder\")&&(e=.75*(this.$search.val().length+1)+\"em\"),this.$search.css(\"width\",e)},e}),u.define(\"select2/selection/selectionCss\",[\"../utils\"],function(n){function e(){}return e.prototype.render=function(e){var t=e.call(this),e=this.options.get(\"selectionCssClass\")||\"\";return-1!==e.indexOf(\":all:\")&&(e=e.replace(\":all:\",\"\"),n.copyNonInternalCssClasses(t[0],this.$element[0])),t.addClass(e),t},e}),u.define(\"select2/selection/eventRelay\",[\"jquery\"],function(o){function e(){}return e.prototype.bind=function(e,t,n){var s=this,i=[\"open\",\"opening\",\"close\",\"closing\",\"select\",\"selecting\",\"unselect\",\"unselecting\",\"clear\",\"clearing\"],r=[\"opening\",\"closing\",\"selecting\",\"unselecting\",\"clearing\"];e.call(this,t,n),t.on(\"*\",function(e,t){var n;-1!==i.indexOf(e)&&(t=t||{},n=o.Event(\"select2:\"+e,{params:t}),s.$element.trigger(n),-1!==r.indexOf(e)&&(t.prevented=n.isDefaultPrevented()))})},e}),u.define(\"select2/translation\",[\"jquery\",\"require\"],function(t,n){function s(e){this.dict=e||{}}return s.prototype.all=function(){return this.dict},s.prototype.get=function(e){return this.dict[e]},s.prototype.extend=function(e){this.dict=t.extend({},e.all(),this.dict)},s._cache={},s.loadPath=function(e){var t;return e in s._cache||(t=n(e),s._cache[e]=t),new s(s._cache[e])},s}),u.define(\"select2/diacritics\",[],function(){return{\"Ⓐ\":\"A\",\"A\":\"A\",\"À\":\"A\",\"Á\":\"A\",\"Â\":\"A\",\"Ầ\":\"A\",\"Ấ\":\"A\",\"Ẫ\":\"A\",\"Ẩ\":\"A\",\"Ã\":\"A\",\"Ā\":\"A\",\"Ă\":\"A\",\"Ằ\":\"A\",\"Ắ\":\"A\",\"Ẵ\":\"A\",\"Ẳ\":\"A\",\"Ȧ\":\"A\",\"Ǡ\":\"A\",\"Ä\":\"A\",\"Ǟ\":\"A\",\"Ả\":\"A\",\"Å\":\"A\",\"Ǻ\":\"A\",\"Ǎ\":\"A\",\"Ȁ\":\"A\",\"Ȃ\":\"A\",\"Ạ\":\"A\",\"Ậ\":\"A\",\"Ặ\":\"A\",\"Ḁ\":\"A\",\"Ą\":\"A\",\"Ⱥ\":\"A\",\"Ɐ\":\"A\",\"Ꜳ\":\"AA\",\"Æ\":\"AE\",\"Ǽ\":\"AE\",\"Ǣ\":\"AE\",\"Ꜵ\":\"AO\",\"Ꜷ\":\"AU\",\"Ꜹ\":\"AV\",\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ι\",\"Ό\":\"Ο\",\"Ύ\":\"Υ\",\"Ϋ\":\"Υ\",\"Ώ\":\"Ω\",\"ά\":\"α\",\"έ\":\"ε\",\"ή\":\"η\",\"ί\":\"ι\",\"ϊ\":\"ι\",\"ΐ\":\"ι\",\"ό\":\"ο\",\"ύ\":\"υ\",\"ϋ\":\"υ\",\"ΰ\":\"υ\",\"ώ\":\"ω\",\"ς\":\"σ\",\"’\":\"'\"}}),u.define(\"select2/data/base\",[\"../utils\"],function(n){function s(e,t){s.__super__.constructor.call(this)}return n.Extend(s,n.Observable),s.prototype.current=function(e){throw new Error(\"The `current` method must be defined in child classes.\")},s.prototype.query=function(e,t){throw new Error(\"The `query` method must be defined in child classes.\")},s.prototype.bind=function(e,t){},s.prototype.destroy=function(){},s.prototype.generateResultId=function(e,t){e=e.id+\"-result-\";return e+=n.generateChars(4),null!=t.id?e+=\"-\"+t.id.toString():e+=\"-\"+n.generateChars(4),e},s}),u.define(\"select2/data/select\",[\"./base\",\"../utils\",\"jquery\"],function(e,a,l){function n(e,t){this.$element=e,this.options=t,n.__super__.constructor.call(this)}return a.Extend(n,e),n.prototype.current=function(e){var t=this;e(Array.prototype.map.call(this.$element[0].querySelectorAll(\":checked\"),function(e){return t.item(l(e))}))},n.prototype.select=function(i){var e,r=this;if(i.selected=!0,null!=i.element&&\"option\"===i.element.tagName.toLowerCase())return i.element.selected=!0,void this.$element.trigger(\"input\").trigger(\"change\");this.$element.prop(\"multiple\")?this.current(function(e){var t=[];(i=[i]).push.apply(i,e);for(var n=0;n<i.length;n++){var s=i[n].id;-1===t.indexOf(s)&&t.push(s)}r.$element.val(t),r.$element.trigger(\"input\").trigger(\"change\")}):(e=i.id,this.$element.val(e),this.$element.trigger(\"input\").trigger(\"change\"))},n.prototype.unselect=function(i){var r=this;if(this.$element.prop(\"multiple\")){if(i.selected=!1,null!=i.element&&\"option\"===i.element.tagName.toLowerCase())return i.element.selected=!1,void this.$element.trigger(\"input\").trigger(\"change\");this.current(function(e){for(var t=[],n=0;n<e.length;n++){var s=e[n].id;s!==i.id&&-1===t.indexOf(s)&&t.push(s)}r.$element.val(t),r.$element.trigger(\"input\").trigger(\"change\")})}},n.prototype.bind=function(e,t){var n=this;(this.container=e).on(\"select\",function(e){n.select(e.data)}),e.on(\"unselect\",function(e){n.unselect(e.data)})},n.prototype.destroy=function(){this.$element.find(\"*\").each(function(){a.RemoveData(this)})},n.prototype.query=function(t,e){var n=[],s=this;this.$element.children().each(function(){var e;\"option\"!==this.tagName.toLowerCase()&&\"optgroup\"!==this.tagName.toLowerCase()||(e=l(this),e=s.item(e),null!==(e=s.matches(t,e))&&n.push(e))}),e({results:n})},n.prototype.addOptions=function(e){this.$element.append(e)},n.prototype.option=function(e){var t;e.children?(t=document.createElement(\"optgroup\")).label=e.text:void 0!==(t=document.createElement(\"option\")).textContent?t.textContent=e.text:t.innerText=e.text,void 0!==e.id&&(t.value=e.id),e.disabled&&(t.disabled=!0),e.selected&&(t.selected=!0),e.title&&(t.title=e.title);e=this._normalizeItem(e);return e.element=t,a.StoreData(t,\"data\",e),l(t)},n.prototype.item=function(e){var t={};if(null!=(t=a.GetData(e[0],\"data\")))return t;var n=e[0];if(\"option\"===n.tagName.toLowerCase())t={id:e.val(),text:e.text(),disabled:e.prop(\"disabled\"),selected:e.prop(\"selected\"),title:e.prop(\"title\")};else if(\"optgroup\"===n.tagName.toLowerCase()){t={text:e.prop(\"label\"),children:[],title:e.prop(\"title\")};for(var s=e.children(\"option\"),i=[],r=0;r<s.length;r++){var o=l(s[r]),o=this.item(o);i.push(o)}t.children=i}return(t=this._normalizeItem(t)).element=e[0],a.StoreData(e[0],\"data\",t),t},n.prototype._normalizeItem=function(e){e!==Object(e)&&(e={id:e,text:e});return null!=(e=l.extend({},{text:\"\"},e)).id&&(e.id=e.id.toString()),null!=e.text&&(e.text=e.text.toString()),null==e._resultId&&e.id&&null!=this.container&&(e._resultId=this.generateResultId(this.container,e)),l.extend({},{selected:!1,disabled:!1},e)},n.prototype.matches=function(e,t){return this.options.get(\"matcher\")(e,t)},n}),u.define(\"select2/data/array\",[\"./select\",\"../utils\",\"jquery\"],function(e,t,c){function s(e,t){this._dataToConvert=t.get(\"data\")||[],s.__super__.constructor.call(this,e,t)}return t.Extend(s,e),s.prototype.bind=function(e,t){s.__super__.bind.call(this,e,t),this.addOptions(this.convertToOptions(this._dataToConvert))},s.prototype.select=function(n){var e=this.$element.find(\"option\").filter(function(e,t){return t.value==n.id.toString()});0===e.length&&(e=this.option(n),this.addOptions(e)),s.__super__.select.call(this,n)},s.prototype.convertToOptions=function(e){var t=this,n=this.$element.find(\"option\"),s=n.map(function(){return t.item(c(this)).id}).get(),i=[];for(var r=0;r<e.length;r++){var o,a,l=this._normalizeItem(e[r]);0<=s.indexOf(l.id)?(o=n.filter(function(e){return function(){return c(this).val()==e.id}}(l)),a=this.item(o),a=c.extend(!0,{},l,a),a=this.option(a),o.replaceWith(a)):(a=this.option(l),l.children&&(l=this.convertToOptions(l.children),a.append(l)),i.push(a))}return i},s}),u.define(\"select2/data/ajax\",[\"./array\",\"../utils\",\"jquery\"],function(e,t,r){function n(e,t){this.ajaxOptions=this._applyDefaults(t.get(\"ajax\")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),n.__super__.constructor.call(this,e,t)}return t.Extend(n,e),n.prototype._applyDefaults=function(e){var t={data:function(e){return r.extend({},e,{q:e.term})},transport:function(e,t,n){e=r.ajax(e);return e.then(t),e.fail(n),e}};return r.extend({},t,e,!0)},n.prototype.processResults=function(e){return e},n.prototype.query=function(t,n){var s=this;null!=this._request&&(\"function\"==typeof this._request.abort&&this._request.abort(),this._request=null);var i=r.extend({type:\"GET\"},this.ajaxOptions);function e(){var e=i.transport(i,function(e){e=s.processResults(e,t);s.options.get(\"debug\")&&window.console&&console.error&&(e&&e.results&&Array.isArray(e.results)||console.error(\"Select2: The AJAX results did not return an array in the `results` key of the response.\")),n(e)},function(){\"status\"in e&&(0===e.status||\"0\"===e.status)||s.trigger(\"results:message\",{message:\"errorLoading\"})});s._request=e}\"function\"==typeof i.url&&(i.url=i.url.call(this.$element,t)),\"function\"==typeof i.data&&(i.data=i.data.call(this.$element,t)),this.ajaxOptions.delay&&null!=t.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(e,this.ajaxOptions.delay)):e()},n}),u.define(\"select2/data/tags\",[\"jquery\"],function(t){function e(e,t,n){var s=n.get(\"tags\"),i=n.get(\"createTag\");void 0!==i&&(this.createTag=i);i=n.get(\"insertTag\");if(void 0!==i&&(this.insertTag=i),e.call(this,t,n),Array.isArray(s))for(var r=0;r<s.length;r++){var o=s[r],o=this._normalizeItem(o),o=this.option(o);this.$element.append(o)}}return e.prototype.query=function(e,c,u){var d=this;this._removeOldTags(),null!=c.term&&null==c.page?e.call(this,c,function e(t,n){for(var s=t.results,i=0;i<s.length;i++){var r=s[i],o=null!=r.children&&!e({results:r.children},!0);if((r.text||\"\").toUpperCase()===(c.term||\"\").toUpperCase()||o)return!n&&(t.data=s,void u(t))}if(n)return!0;var a,l=d.createTag(c);null!=l&&((a=d.option(l)).attr(\"data-select2-tag\",\"true\"),d.addOptions([a]),d.insertTag(s,l)),t.results=s,u(t)}):e.call(this,c,u)},e.prototype.createTag=function(e,t){if(null==t.term)return null;t=t.term.trim();return\"\"===t?null:{id:t,text:t}},e.prototype.insertTag=function(e,t,n){t.unshift(n)},e.prototype._removeOldTags=function(e){this.$element.find(\"option[data-select2-tag]\").each(function(){this.selected||t(this).remove()})},e}),u.define(\"select2/data/tokenizer\",[\"jquery\"],function(c){function e(e,t,n){var s=n.get(\"tokenizer\");void 0!==s&&(this.tokenizer=s),e.call(this,t,n)}return e.prototype.bind=function(e,t,n){e.call(this,t,n),this.$search=t.dropdown.$search||t.selection.$search||n.find(\".select2-search__field\")},e.prototype.query=function(e,t,n){var s=this;t.term=t.term||\"\";var i=this.tokenizer(t,this.options,function(e){var t,n=s._normalizeItem(e);s.$element.find(\"option\").filter(function(){return c(this).val()===n.id}).length||((t=s.option(n)).attr(\"data-select2-tag\",!0),s._removeOldTags(),s.addOptions([t])),t=n,s.trigger(\"select\",{data:t})});i.term!==t.term&&(this.$search.length&&(this.$search.val(i.term),this.$search.trigger(\"focus\")),t.term=i.term),e.call(this,t,n)},e.prototype.tokenizer=function(e,t,n,s){for(var i=n.get(\"tokenSeparators\")||[],r=t.term,o=0,a=this.createTag||function(e){return{id:e.term,text:e.term}};o<r.length;){var l=r[o];-1!==i.indexOf(l)?(l=r.substr(0,o),null!=(l=a(c.extend({},t,{term:l})))?(s(l),r=r.substr(o+1)||\"\",o=0):o++):o++}return{term:r}},e}),u.define(\"select2/data/minimumInputLength\",[],function(){function e(e,t,n){this.minimumInputLength=n.get(\"minimumInputLength\"),e.call(this,t,n)}return e.prototype.query=function(e,t,n){t.term=t.term||\"\",t.term.length<this.minimumInputLength?this.trigger(\"results:message\",{message:\"inputTooShort\",args:{minimum:this.minimumInputLength,input:t.term,params:t}}):e.call(this,t,n)},e}),u.define(\"select2/data/maximumInputLength\",[],function(){function e(e,t,n){this.maximumInputLength=n.get(\"maximumInputLength\"),e.call(this,t,n)}return e.prototype.query=function(e,t,n){t.term=t.term||\"\",0<this.maximumInputLength&&t.term.length>this.maximumInputLength?this.trigger(\"results:message\",{message:\"inputTooLong\",args:{maximum:this.maximumInputLength,input:t.term,params:t}}):e.call(this,t,n)},e}),u.define(\"select2/data/maximumSelectionLength\",[],function(){function e(e,t,n){this.maximumSelectionLength=n.get(\"maximumSelectionLength\"),e.call(this,t,n)}return e.prototype.bind=function(e,t,n){var s=this;e.call(this,t,n),t.on(\"select\",function(){s._checkIfMaximumSelected()})},e.prototype.query=function(e,t,n){var s=this;this._checkIfMaximumSelected(function(){e.call(s,t,n)})},e.prototype._checkIfMaximumSelected=function(e,t){var n=this;this.current(function(e){e=null!=e?e.length:0;0<n.maximumSelectionLength&&e>=n.maximumSelectionLength?n.trigger(\"results:message\",{message:\"maximumSelected\",args:{maximum:n.maximumSelectionLength}}):t&&t()})},e}),u.define(\"select2/dropdown\",[\"jquery\",\"./utils\"],function(t,e){function n(e,t){this.$element=e,this.options=t,n.__super__.constructor.call(this)}return e.Extend(n,e.Observable),n.prototype.render=function(){var e=t('<span class=\"select2-dropdown\"><span class=\"select2-results\"></span></span>');return e.attr(\"dir\",this.options.get(\"dir\")),this.$dropdown=e},n.prototype.bind=function(){},n.prototype.position=function(e,t){},n.prototype.destroy=function(){this.$dropdown.remove()},n}),u.define(\"select2/dropdown/search\",[\"jquery\"],function(r){function e(){}return e.prototype.render=function(e){var t=e.call(this),n=this.options.get(\"translations\").get(\"search\"),e=r('<span class=\"select2-search select2-search--dropdown\"><input class=\"select2-search__field\" type=\"search\" tabindex=\"-1\" autocorrect=\"off\" autocapitalize=\"none\" spellcheck=\"false\" role=\"searchbox\" aria-autocomplete=\"list\" /></span>');return this.$searchContainer=e,this.$search=e.find(\"input\"),this.$search.prop(\"autocomplete\",this.options.get(\"autocomplete\")),this.$search.attr(\"aria-label\",n()),t.prepend(e),t},e.prototype.bind=function(e,t,n){var s=this,i=t.id+\"-results\";e.call(this,t,n),this.$search.on(\"keydown\",function(e){s.trigger(\"keypress\",e),s._keyUpPrevented=e.isDefaultPrevented()}),this.$search.on(\"input\",function(e){r(this).off(\"keyup\")}),this.$search.on(\"keyup input\",function(e){s.handleSearch(e)}),t.on(\"open\",function(){s.$search.attr(\"tabindex\",0),s.$search.attr(\"aria-controls\",i),s.$search.trigger(\"focus\"),window.setTimeout(function(){s.$search.trigger(\"focus\")},0)}),t.on(\"close\",function(){s.$search.attr(\"tabindex\",-1),s.$search.removeAttr(\"aria-controls\"),s.$search.removeAttr(\"aria-activedescendant\"),s.$search.val(\"\"),s.$search.trigger(\"blur\")}),t.on(\"focus\",function(){t.isOpen()||s.$search.trigger(\"focus\")}),t.on(\"results:all\",function(e){null!=e.query.term&&\"\"!==e.query.term||(s.showSearch(e)?s.$searchContainer[0].classList.remove(\"select2-search--hide\"):s.$searchContainer[0].classList.add(\"select2-search--hide\"))}),t.on(\"results:focus\",function(e){e.data._resultId?s.$search.attr(\"aria-activedescendant\",e.data._resultId):s.$search.removeAttr(\"aria-activedescendant\")})},e.prototype.handleSearch=function(e){var t;this._keyUpPrevented||(t=this.$search.val(),this.trigger(\"query\",{term:t})),this._keyUpPrevented=!1},e.prototype.showSearch=function(e,t){return!0},e}),u.define(\"select2/dropdown/hidePlaceholder\",[],function(){function e(e,t,n,s){this.placeholder=this.normalizePlaceholder(n.get(\"placeholder\")),e.call(this,t,n,s)}return e.prototype.append=function(e,t){t.results=this.removePlaceholder(t.results),e.call(this,t)},e.prototype.normalizePlaceholder=function(e,t){return\"string\"==typeof t&&(t={id:\"\",text:t}),t},e.prototype.removePlaceholder=function(e,t){for(var n=t.slice(0),s=t.length-1;0<=s;s--){var i=t[s];this.placeholder.id===i.id&&n.splice(s,1)}return n},e}),u.define(\"select2/dropdown/infiniteScroll\",[\"jquery\"],function(n){function e(e,t,n,s){this.lastParams={},e.call(this,t,n,s),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return e.prototype.append=function(e,t){this.$loadingMore.remove(),this.loading=!1,e.call(this,t),this.showLoadingMore(t)&&(this.$results.append(this.$loadingMore),this.loadMoreIfNeeded())},e.prototype.bind=function(e,t,n){var s=this;e.call(this,t,n),t.on(\"query\",function(e){s.lastParams=e,s.loading=!0}),t.on(\"query:append\",function(e){s.lastParams=e,s.loading=!0}),this.$results.on(\"scroll\",this.loadMoreIfNeeded.bind(this))},e.prototype.loadMoreIfNeeded=function(){var e=n.contains(document.documentElement,this.$loadingMore[0]);!this.loading&&e&&(e=this.$results.offset().top+this.$results.outerHeight(!1),this.$loadingMore.offset().top+this.$loadingMore.outerHeight(!1)<=e+50&&this.loadMore())},e.prototype.loadMore=function(){this.loading=!0;var e=n.extend({},{page:1},this.lastParams);e.page++,this.trigger(\"query:append\",e)},e.prototype.showLoadingMore=function(e,t){return t.pagination&&t.pagination.more},e.prototype.createLoadingMore=function(){var e=n('<li class=\"select2-results__option select2-results__option--load-more\"role=\"option\" aria-disabled=\"true\"></li>'),t=this.options.get(\"translations\").get(\"loadingMore\");return e.html(t(this.lastParams)),e},e}),u.define(\"select2/dropdown/attachBody\",[\"jquery\",\"../utils\"],function(u,o){function e(e,t,n){this.$dropdownParent=u(n.get(\"dropdownParent\")||document.body),e.call(this,t,n)}return e.prototype.bind=function(e,t,n){var s=this;e.call(this,t,n),t.on(\"open\",function(){s._showDropdown(),s._attachPositioningHandler(t),s._bindContainerResultHandlers(t)}),t.on(\"close\",function(){s._hideDropdown(),s._detachPositioningHandler(t)}),this.$dropdownContainer.on(\"mousedown\",function(e){e.stopPropagation()})},e.prototype.destroy=function(e){e.call(this),this.$dropdownContainer.remove()},e.prototype.position=function(e,t,n){t.attr(\"class\",n.attr(\"class\")),t[0].classList.remove(\"select2\"),t[0].classList.add(\"select2-container--open\"),t.css({position:\"absolute\",top:-999999}),this.$container=n},e.prototype.render=function(e){var t=u(\"<span></span>\"),e=e.call(this);return t.append(e),this.$dropdownContainer=t},e.prototype._hideDropdown=function(e){this.$dropdownContainer.detach()},e.prototype._bindContainerResultHandlers=function(e,t){var n;this._containerResultsHandlersBound||(n=this,t.on(\"results:all\",function(){n._positionDropdown(),n._resizeDropdown()}),t.on(\"results:append\",function(){n._positionDropdown(),n._resizeDropdown()}),t.on(\"results:message\",function(){n._positionDropdown(),n._resizeDropdown()}),t.on(\"select\",function(){n._positionDropdown(),n._resizeDropdown()}),t.on(\"unselect\",function(){n._positionDropdown(),n._resizeDropdown()}),this._containerResultsHandlersBound=!0)},e.prototype._attachPositioningHandler=function(e,t){var n=this,s=\"scroll.select2.\"+t.id,i=\"resize.select2.\"+t.id,r=\"orientationchange.select2.\"+t.id,t=this.$container.parents().filter(o.hasScroll);t.each(function(){o.StoreData(this,\"select2-scroll-position\",{x:u(this).scrollLeft(),y:u(this).scrollTop()})}),t.on(s,function(e){var t=o.GetData(this,\"select2-scroll-position\");u(this).scrollTop(t.y)}),u(window).on(s+\" \"+i+\" \"+r,function(e){n._positionDropdown(),n._resizeDropdown()})},e.prototype._detachPositioningHandler=function(e,t){var n=\"scroll.select2.\"+t.id,s=\"resize.select2.\"+t.id,t=\"orientationchange.select2.\"+t.id;this.$container.parents().filter(o.hasScroll).off(n),u(window).off(n+\" \"+s+\" \"+t)},e.prototype._positionDropdown=function(){var e=u(window),t=this.$dropdown[0].classList.contains(\"select2-dropdown--above\"),n=this.$dropdown[0].classList.contains(\"select2-dropdown--below\"),s=null,i=this.$container.offset();i.bottom=i.top+this.$container.outerHeight(!1);var r={height:this.$container.outerHeight(!1)};r.top=i.top,r.bottom=i.top+r.height;var o=this.$dropdown.outerHeight(!1),a=e.scrollTop(),l=e.scrollTop()+e.height(),c=a<i.top-o,e=l>i.bottom+o,a={left:i.left,top:r.bottom},l=this.$dropdownParent;\"static\"===l.css(\"position\")&&(l=l.offsetParent());i={top:0,left:0};(u.contains(document.body,l[0])||l[0].isConnected)&&(i=l.offset()),a.top-=i.top,a.left-=i.left,t||n||(s=\"below\"),e||!c||t?!c&&e&&t&&(s=\"below\"):s=\"above\",(\"above\"==s||t&&\"below\"!==s)&&(a.top=r.top-i.top-o),null!=s&&(this.$dropdown[0].classList.remove(\"select2-dropdown--below\"),this.$dropdown[0].classList.remove(\"select2-dropdown--above\"),this.$dropdown[0].classList.add(\"select2-dropdown--\"+s),this.$container[0].classList.remove(\"select2-container--below\"),this.$container[0].classList.remove(\"select2-container--above\"),this.$container[0].classList.add(\"select2-container--\"+s)),this.$dropdownContainer.css(a)},e.prototype._resizeDropdown=function(){var e={width:this.$container.outerWidth(!1)+\"px\"};this.options.get(\"dropdownAutoWidth\")&&(e.minWidth=e.width,e.position=\"relative\",e.width=\"auto\"),this.$dropdown.css(e)},e.prototype._showDropdown=function(e){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},e}),u.define(\"select2/dropdown/minimumResultsForSearch\",[],function(){function e(e,t,n,s){this.minimumResultsForSearch=n.get(\"minimumResultsForSearch\"),this.minimumResultsForSearch<0&&(this.minimumResultsForSearch=1/0),e.call(this,t,n,s)}return e.prototype.showSearch=function(e,t){return!(function e(t){for(var n=0,s=0;s<t.length;s++){var i=t[s];i.children?n+=e(i.children):n++}return n}(t.data.results)<this.minimumResultsForSearch)&&e.call(this,t)},e}),u.define(\"select2/dropdown/selectOnClose\",[\"../utils\"],function(s){function e(){}return e.prototype.bind=function(e,t,n){var s=this;e.call(this,t,n),t.on(\"close\",function(e){s._handleSelectOnClose(e)})},e.prototype._handleSelectOnClose=function(e,t){if(t&&null!=t.originalSelect2Event){var n=t.originalSelect2Event;if(\"select\"===n._type||\"unselect\"===n._type)return}n=this.getHighlightedResults();n.length<1||(null!=(n=s.GetData(n[0],\"data\")).element&&n.element.selected||null==n.element&&n.selected||this.trigger(\"select\",{data:n}))},e}),u.define(\"select2/dropdown/closeOnSelect\",[],function(){function e(){}return e.prototype.bind=function(e,t,n){var s=this;e.call(this,t,n),t.on(\"select\",function(e){s._selectTriggered(e)}),t.on(\"unselect\",function(e){s._selectTriggered(e)})},e.prototype._selectTriggered=function(e,t){var n=t.originalEvent;n&&(n.ctrlKey||n.metaKey)||this.trigger(\"close\",{originalEvent:n,originalSelect2Event:t})},e}),u.define(\"select2/dropdown/dropdownCss\",[\"../utils\"],function(n){function e(){}return e.prototype.render=function(e){var t=e.call(this),e=this.options.get(\"dropdownCssClass\")||\"\";return-1!==e.indexOf(\":all:\")&&(e=e.replace(\":all:\",\"\"),n.copyNonInternalCssClasses(t[0],this.$element[0])),t.addClass(e),t},e}),u.define(\"select2/dropdown/tagsSearchHighlight\",[\"../utils\"],function(s){function e(){}return e.prototype.highlightFirstItem=function(e){var t=this.$results.find(\".select2-results__option--selectable:not(.select2-results__option--selected)\");if(0<t.length){var n=t.first(),t=s.GetData(n[0],\"data\").element;if(t&&t.getAttribute&&\"true\"===t.getAttribute(\"data-select2-tag\"))return void n.trigger(\"mouseenter\")}e.call(this)},e}),u.define(\"select2/i18n/en\",[],function(){return{errorLoading:function(){return\"The results could not be loaded.\"},inputTooLong:function(e){var t=e.input.length-e.maximum,e=\"Please delete \"+t+\" character\";return 1!=t&&(e+=\"s\"),e},inputTooShort:function(e){return\"Please enter \"+(e.minimum-e.input.length)+\" or more characters\"},loadingMore:function(){return\"Loading more results…\"},maximumSelected:function(e){var t=\"You can only select \"+e.maximum+\" item\";return 1!=e.maximum&&(t+=\"s\"),t},noResults:function(){return\"No results found\"},searching:function(){return\"Searching…\"},removeAllItems:function(){return\"Remove all items\"},removeItem:function(){return\"Remove item\"},search:function(){return\"Search\"}}}),u.define(\"select2/defaults\",[\"jquery\",\"./results\",\"./selection/single\",\"./selection/multiple\",\"./selection/placeholder\",\"./selection/allowClear\",\"./selection/search\",\"./selection/selectionCss\",\"./selection/eventRelay\",\"./utils\",\"./translation\",\"./diacritics\",\"./data/select\",\"./data/array\",\"./data/ajax\",\"./data/tags\",\"./data/tokenizer\",\"./data/minimumInputLength\",\"./data/maximumInputLength\",\"./data/maximumSelectionLength\",\"./dropdown\",\"./dropdown/search\",\"./dropdown/hidePlaceholder\",\"./dropdown/infiniteScroll\",\"./dropdown/attachBody\",\"./dropdown/minimumResultsForSearch\",\"./dropdown/selectOnClose\",\"./dropdown/closeOnSelect\",\"./dropdown/dropdownCss\",\"./dropdown/tagsSearchHighlight\",\"./i18n/en\"],function(l,r,o,a,c,u,d,p,h,f,g,t,m,y,v,_,b,$,w,x,A,D,S,E,O,C,L,T,q,I,e){function n(){this.reset()}return n.prototype.apply=function(e){var t;null==(e=l.extend(!0,{},this.defaults,e)).dataAdapter&&(null!=e.ajax?e.dataAdapter=v:null!=e.data?e.dataAdapter=y:e.dataAdapter=m,0<e.minimumInputLength&&(e.dataAdapter=f.Decorate(e.dataAdapter,$)),0<e.maximumInputLength&&(e.dataAdapter=f.Decorate(e.dataAdapter,w)),0<e.maximumSelectionLength&&(e.dataAdapter=f.Decorate(e.dataAdapter,x)),e.tags&&(e.dataAdapter=f.Decorate(e.dataAdapter,_)),null==e.tokenSeparators&&null==e.tokenizer||(e.dataAdapter=f.Decorate(e.dataAdapter,b))),null==e.resultsAdapter&&(e.resultsAdapter=r,null!=e.ajax&&(e.resultsAdapter=f.Decorate(e.resultsAdapter,E)),null!=e.placeholder&&(e.resultsAdapter=f.Decorate(e.resultsAdapter,S)),e.selectOnClose&&(e.resultsAdapter=f.Decorate(e.resultsAdapter,L)),e.tags&&(e.resultsAdapter=f.Decorate(e.resultsAdapter,I))),null==e.dropdownAdapter&&(e.multiple?e.dropdownAdapter=A:(t=f.Decorate(A,D),e.dropdownAdapter=t),0!==e.minimumResultsForSearch&&(e.dropdownAdapter=f.Decorate(e.dropdownAdapter,C)),e.closeOnSelect&&(e.dropdownAdapter=f.Decorate(e.dropdownAdapter,T)),null!=e.dropdownCssClass&&(e.dropdownAdapter=f.Decorate(e.dropdownAdapter,q)),e.dropdownAdapter=f.Decorate(e.dropdownAdapter,O)),null==e.selectionAdapter&&(e.multiple?e.selectionAdapter=a:e.selectionAdapter=o,null!=e.placeholder&&(e.selectionAdapter=f.Decorate(e.selectionAdapter,c)),e.allowClear&&(e.selectionAdapter=f.Decorate(e.selectionAdapter,u)),e.multiple&&(e.selectionAdapter=f.Decorate(e.selectionAdapter,d)),null!=e.selectionCssClass&&(e.selectionAdapter=f.Decorate(e.selectionAdapter,p)),e.selectionAdapter=f.Decorate(e.selectionAdapter,h)),e.language=this._resolveLanguage(e.language),e.language.push(\"en\");for(var n=[],s=0;s<e.language.length;s++){var i=e.language[s];-1===n.indexOf(i)&&n.push(i)}return e.language=n,e.translations=this._processTranslations(e.language,e.debug),e},n.prototype.reset=function(){function a(e){return e.replace(/[^\\u0000-\\u007E]/g,function(e){return t[e]||e})}this.defaults={amdLanguageBase:\"./i18n/\",autocomplete:\"off\",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:f.escapeMarkup,language:{},matcher:function e(t,n){if(null==t.term||\"\"===t.term.trim())return n;if(n.children&&0<n.children.length){for(var s=l.extend(!0,{},n),i=n.children.length-1;0<=i;i--)null==e(t,n.children[i])&&s.children.splice(i,1);return 0<s.children.length?s:e(t,s)}var r=a(n.text).toUpperCase(),o=a(t.term).toUpperCase();return-1<r.indexOf(o)?n:null},minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,scrollAfterSelect:!1,sorter:function(e){return e},templateResult:function(e){return e.text},templateSelection:function(e){return e.text},theme:\"default\",width:\"resolve\"}},n.prototype.applyFromElement=function(e,t){var n=e.language,s=this.defaults.language,i=t.prop(\"lang\"),t=t.closest(\"[lang]\").prop(\"lang\"),t=Array.prototype.concat.call(this._resolveLanguage(i),this._resolveLanguage(n),this._resolveLanguage(s),this._resolveLanguage(t));return e.language=t,e},n.prototype._resolveLanguage=function(e){if(!e)return[];if(l.isEmptyObject(e))return[];if(l.isPlainObject(e))return[e];for(var t,n=Array.isArray(e)?e:[e],s=[],i=0;i<n.length;i++)s.push(n[i]),\"string\"==typeof n[i]&&0<n[i].indexOf(\"-\")&&(t=n[i].split(\"-\")[0],s.push(t));return s},n.prototype._processTranslations=function(e,t){for(var n=new g,s=0;s<e.length;s++){var i=new g,r=e[s];if(\"string\"==typeof r)try{i=g.loadPath(r)}catch(e){try{r=this.defaults.amdLanguageBase+r,i=g.loadPath(r)}catch(e){t&&window.console&&console.warn&&console.warn('Select2: The language file for \"'+r+'\" could not be automatically loaded. A fallback will be used instead.')}}else i=l.isPlainObject(r)?new g(r):r;n.extend(i)}return n},n.prototype.set=function(e,t){var n={};n[l.camelCase(e)]=t;n=f._convertData(n);l.extend(!0,this.defaults,n)},new n}),u.define(\"select2/options\",[\"jquery\",\"./defaults\",\"./utils\"],function(c,n,u){function e(e,t){this.options=e,null!=t&&this.fromElement(t),null!=t&&(this.options=n.applyFromElement(this.options,t)),this.options=n.apply(this.options)}return e.prototype.fromElement=function(e){var t=[\"select2\"];null==this.options.multiple&&(this.options.multiple=e.prop(\"multiple\")),null==this.options.disabled&&(this.options.disabled=e.prop(\"disabled\")),null==this.options.autocomplete&&e.prop(\"autocomplete\")&&(this.options.autocomplete=e.prop(\"autocomplete\")),null==this.options.dir&&(e.prop(\"dir\")?this.options.dir=e.prop(\"dir\"):e.closest(\"[dir]\").prop(\"dir\")?this.options.dir=e.closest(\"[dir]\").prop(\"dir\"):this.options.dir=\"ltr\"),e.prop(\"disabled\",this.options.disabled),e.prop(\"multiple\",this.options.multiple),u.GetData(e[0],\"select2Tags\")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags=\"true\"` attributes and will be removed in future versions of Select2.'),u.StoreData(e[0],\"data\",u.GetData(e[0],\"select2Tags\")),u.StoreData(e[0],\"tags\",!0)),u.GetData(e[0],\"ajaxUrl\")&&(this.options.debug&&window.console&&console.warn&&console.warn(\"Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2.\"),e.attr(\"ajax--url\",u.GetData(e[0],\"ajaxUrl\")),u.StoreData(e[0],\"ajax-Url\",u.GetData(e[0],\"ajaxUrl\")));var n={};function s(e,t){return t.toUpperCase()}for(var i=0;i<e[0].attributes.length;i++){var r=e[0].attributes[i].name,o=\"data-\";r.substr(0,o.length)==o&&(r=r.substring(o.length),o=u.GetData(e[0],r),n[r.replace(/-([a-z])/g,s)]=o)}c.fn.jquery&&\"1.\"==c.fn.jquery.substr(0,2)&&e[0].dataset&&(n=c.extend(!0,{},e[0].dataset,n));var a,l=c.extend(!0,{},u.GetData(e[0]),n);for(a in l=u._convertData(l))-1<t.indexOf(a)||(c.isPlainObject(this.options[a])?c.extend(this.options[a],l[a]):this.options[a]=l[a]);return this},e.prototype.get=function(e){return this.options[e]},e.prototype.set=function(e,t){this.options[e]=t},e}),u.define(\"select2/core\",[\"jquery\",\"./options\",\"./utils\",\"./keys\"],function(t,i,r,s){var o=function(e,t){null!=r.GetData(e[0],\"select2\")&&r.GetData(e[0],\"select2\").destroy(),this.$element=e,this.id=this._generateId(e),t=t||{},this.options=new i(t,e),o.__super__.constructor.call(this);var n=e.attr(\"tabindex\")||0;r.StoreData(e[0],\"old-tabindex\",n),e.attr(\"tabindex\",\"-1\");t=this.options.get(\"dataAdapter\");this.dataAdapter=new t(e,this.options);n=this.render();this._placeContainer(n);t=this.options.get(\"selectionAdapter\");this.selection=new t(e,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,n);t=this.options.get(\"dropdownAdapter\");this.dropdown=new t(e,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,n);n=this.options.get(\"resultsAdapter\");this.results=new n(e,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var s=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current(function(e){s.trigger(\"selection:update\",{data:e})}),e[0].classList.add(\"select2-hidden-accessible\"),e.attr(\"aria-hidden\",\"true\"),this._syncAttributes(),r.StoreData(e[0],\"select2\",this),e.data(\"select2\",this)};return r.Extend(o,r.Observable),o.prototype._generateId=function(e){return\"select2-\"+(null!=e.attr(\"id\")?e.attr(\"id\"):null!=e.attr(\"name\")?e.attr(\"name\")+\"-\"+r.generateChars(2):r.generateChars(4)).replace(/(:|\\.|\\[|\\]|,)/g,\"\")},o.prototype._placeContainer=function(e){e.insertAfter(this.$element);var t=this._resolveWidth(this.$element,this.options.get(\"width\"));null!=t&&e.css(\"width\",t)},o.prototype._resolveWidth=function(e,t){var n=/^width:(([-+]?([0-9]*\\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if(\"resolve\"==t){var s=this._resolveWidth(e,\"style\");return null!=s?s:this._resolveWidth(e,\"element\")}if(\"element\"==t){s=e.outerWidth(!1);return s<=0?\"auto\":s+\"px\"}if(\"style\"!=t)return\"computedstyle\"!=t?t:window.getComputedStyle(e[0]).width;e=e.attr(\"style\");if(\"string\"!=typeof e)return null;for(var i=e.split(\";\"),r=0,o=i.length;r<o;r+=1){var a=i[r].replace(/\\s/g,\"\").match(n);if(null!==a&&1<=a.length)return a[1]}return null},o.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},o.prototype._registerDomEvents=function(){var t=this;this.$element.on(\"change.select2\",function(){t.dataAdapter.current(function(e){t.trigger(\"selection:update\",{data:e})})}),this.$element.on(\"focus.select2\",function(e){t.trigger(\"focus\",e)}),this._syncA=r.bind(this._syncAttributes,this),this._syncS=r.bind(this._syncSubtree,this),this._observer=new window.MutationObserver(function(e){t._syncA(),t._syncS(e)}),this._observer.observe(this.$element[0],{attributes:!0,childList:!0,subtree:!1})},o.prototype._registerDataEvents=function(){var n=this;this.dataAdapter.on(\"*\",function(e,t){n.trigger(e,t)})},o.prototype._registerSelectionEvents=function(){var n=this,s=[\"toggle\",\"focus\"];this.selection.on(\"toggle\",function(){n.toggleDropdown()}),this.selection.on(\"focus\",function(e){n.focus(e)}),this.selection.on(\"*\",function(e,t){-1===s.indexOf(e)&&n.trigger(e,t)})},o.prototype._registerDropdownEvents=function(){var n=this;this.dropdown.on(\"*\",function(e,t){n.trigger(e,t)})},o.prototype._registerResultsEvents=function(){var n=this;this.results.on(\"*\",function(e,t){n.trigger(e,t)})},o.prototype._registerEvents=function(){var n=this;this.on(\"open\",function(){n.$container[0].classList.add(\"select2-container--open\")}),this.on(\"close\",function(){n.$container[0].classList.remove(\"select2-container--open\")}),this.on(\"enable\",function(){n.$container[0].classList.remove(\"select2-container--disabled\")}),this.on(\"disable\",function(){n.$container[0].classList.add(\"select2-container--disabled\")}),this.on(\"blur\",function(){n.$container[0].classList.remove(\"select2-container--focus\")}),this.on(\"query\",function(t){n.isOpen()||n.trigger(\"open\",{}),this.dataAdapter.query(t,function(e){n.trigger(\"results:all\",{data:e,query:t})})}),this.on(\"query:append\",function(t){this.dataAdapter.query(t,function(e){n.trigger(\"results:append\",{data:e,query:t})})}),this.on(\"keypress\",function(e){var t=e.which;n.isOpen()?t===s.ESC||t===s.UP&&e.altKey?(n.close(e),e.preventDefault()):t===s.ENTER||t===s.TAB?(n.trigger(\"results:select\",{}),e.preventDefault()):t===s.SPACE&&e.ctrlKey?(n.trigger(\"results:toggle\",{}),e.preventDefault()):t===s.UP?(n.trigger(\"results:previous\",{}),e.preventDefault()):t===s.DOWN&&(n.trigger(\"results:next\",{}),e.preventDefault()):(t===s.ENTER||t===s.SPACE||t===s.DOWN&&e.altKey)&&(n.open(),e.preventDefault())})},o.prototype._syncAttributes=function(){this.options.set(\"disabled\",this.$element.prop(\"disabled\")),this.isDisabled()?(this.isOpen()&&this.close(),this.trigger(\"disable\",{})):this.trigger(\"enable\",{})},o.prototype._isChangeMutation=function(e){var t=this;if(e.addedNodes&&0<e.addedNodes.length){for(var n=0;n<e.addedNodes.length;n++)if(e.addedNodes[n].selected)return!0}else{if(e.removedNodes&&0<e.removedNodes.length)return!0;if(Array.isArray(e))return e.some(function(e){return t._isChangeMutation(e)})}return!1},o.prototype._syncSubtree=function(e){var e=this._isChangeMutation(e),t=this;e&&this.dataAdapter.current(function(e){t.trigger(\"selection:update\",{data:e})})},o.prototype.trigger=function(e,t){var n=o.__super__.trigger,s={open:\"opening\",close:\"closing\",select:\"selecting\",unselect:\"unselecting\",clear:\"clearing\"};if(void 0===t&&(t={}),e in s){var i=s[e],s={prevented:!1,name:e,args:t};if(n.call(this,i,s),s.prevented)return void(t.prevented=!0)}n.call(this,e,t)},o.prototype.toggleDropdown=function(){this.isDisabled()||(this.isOpen()?this.close():this.open())},o.prototype.open=function(){this.isOpen()||this.isDisabled()||this.trigger(\"query\",{})},o.prototype.close=function(e){this.isOpen()&&this.trigger(\"close\",{originalEvent:e})},o.prototype.isEnabled=function(){return!this.isDisabled()},o.prototype.isDisabled=function(){return this.options.get(\"disabled\")},o.prototype.isOpen=function(){return this.$container[0].classList.contains(\"select2-container--open\")},o.prototype.hasFocus=function(){return this.$container[0].classList.contains(\"select2-container--focus\")},o.prototype.focus=function(e){this.hasFocus()||(this.$container[0].classList.add(\"select2-container--focus\"),this.trigger(\"focus\",{}))},o.prototype.enable=function(e){this.options.get(\"debug\")&&window.console&&console.warn&&console.warn('Select2: The `select2(\"enable\")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop(\"disabled\") instead.'),null!=e&&0!==e.length||(e=[!0]);e=!e[0];this.$element.prop(\"disabled\",e)},o.prototype.data=function(){this.options.get(\"debug\")&&0<arguments.length&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2(\"data\")`. You should consider setting the value instead using `$element.val()`.');var t=[];return this.dataAdapter.current(function(e){t=e}),t},o.prototype.val=function(e){if(this.options.get(\"debug\")&&window.console&&console.warn&&console.warn('Select2: The `select2(\"val\")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==e||0===e.length)return this.$element.val();e=e[0];Array.isArray(e)&&(e=e.map(function(e){return e.toString()})),this.$element.val(e).trigger(\"input\").trigger(\"change\")},o.prototype.destroy=function(){r.RemoveData(this.$container[0]),this.$container.remove(),this._observer.disconnect(),this._observer=null,this._syncA=null,this._syncS=null,this.$element.off(\".select2\"),this.$element.attr(\"tabindex\",r.GetData(this.$element[0],\"old-tabindex\")),this.$element[0].classList.remove(\"select2-hidden-accessible\"),this.$element.attr(\"aria-hidden\",\"false\"),r.RemoveData(this.$element[0]),this.$element.removeData(\"select2\"),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null},o.prototype.render=function(){var e=t('<span class=\"select2 select2-container\"><span class=\"selection\"></span><span class=\"dropdown-wrapper\" aria-hidden=\"true\"></span></span>');return e.attr(\"dir\",this.options.get(\"dir\")),this.$container=e,this.$container[0].classList.add(\"select2-container--\"+this.options.get(\"theme\")),r.StoreData(e[0],\"element\",this.$element),e},o}),u.define(\"jquery-mousewheel\",[\"jquery\"],function(e){return e}),u.define(\"jquery.select2\",[\"jquery\",\"jquery-mousewheel\",\"./select2/core\",\"./select2/defaults\",\"./select2/utils\"],function(i,e,r,t,o){var a;return null==i.fn.select2&&(a=[\"open\",\"close\",\"destroy\"],i.fn.select2=function(t){if(\"object\"==typeof(t=t||{}))return this.each(function(){var e=i.extend(!0,{},t);new r(i(this),e)}),this;if(\"string\"!=typeof t)throw new Error(\"Invalid arguments for Select2: \"+t);var n,s=Array.prototype.slice.call(arguments,1);return this.each(function(){var e=o.GetData(this,\"select2\");null==e&&window.console&&console.error&&console.error(\"The select2('\"+t+\"') method was called on an element that is not using Select2.\"),n=e[t].apply(e,s)}),-1<a.indexOf(t)?this:n}),null==i.fn.select2.defaults&&(i.fn.select2.defaults=t),r}),{define:u.define,require:u.require});function b(e,t){return i.call(e,t)}function l(e,t){var n,s,i,r,o,a,l,c,u,d,p=t&&t.split(\"/\"),h=y.map,f=h&&h[\"*\"]||{};if(e){for(t=(e=e.split(\"/\")).length-1,y.nodeIdCompat&&_.test(e[t])&&(e[t]=e[t].replace(_,\"\")),\".\"===e[0].charAt(0)&&p&&(e=p.slice(0,p.length-1).concat(e)),c=0;c<e.length;c++)\".\"===(d=e[c])?(e.splice(c,1),--c):\"..\"===d&&(0===c||1===c&&\"..\"===e[2]||\"..\"===e[c-1]||0<c&&(e.splice(c-1,2),c-=2));e=e.join(\"/\")}if((p||f)&&h){for(c=(n=e.split(\"/\")).length;0<c;--c){if(s=n.slice(0,c).join(\"/\"),p)for(u=p.length;0<u;--u)if(i=h[p.slice(0,u).join(\"/\")],i=i&&i[s]){r=i,o=c;break}if(r)break;!a&&f&&f[s]&&(a=f[s],l=c)}!r&&a&&(r=a,o=l),r&&(n.splice(0,o,r),e=n.join(\"/\"))}return e}function w(t,n){return function(){var e=a.call(arguments,0);return\"string\"!=typeof e[0]&&1===e.length&&e.push(null),o.apply(p,e.concat([t,n]))}}function x(e){var t;if(b(m,e)&&(t=m[e],delete m[e],v[e]=!0,r.apply(p,t)),!b(g,e)&&!b(v,e))throw new Error(\"No \"+e);return g[e]}function c(e){var t,n=e?e.indexOf(\"!\"):-1;return-1<n&&(t=e.substring(0,n),e=e.substring(n+1,e.length)),[t,e]}function A(e){return e?c(e):[]}var u=s.require(\"jquery.select2\");return t.fn.select2.amd=s,u});"," (function($) {\r\n    \r\n    const GENERIC_ERROR_MSG = 'Please <a href=\"#\" class=\"page-refresh-btn\">refresh</a> the page. If you see this message again, please contact [email protected].';\r\n    var $document = $(document);\r\n\r\n    $document.ready(function() {\r\n\r\n        var $registerForm = $( '#megacal-register-form' );\r\n        var $registerHandleField = $( '#megacal-register-handle' );\r\n        var $checkHandleBtn = $( '#megacal-check-handle-button' );\r\n        var $registerBtn = $( '.megacal-register-button' );\r\n\r\n        $document.on( 'click', '.page-refresh-btn', function( e ) {\r\n            e.preventDefault();\r\n            window.location.href = window.location.href;\r\n        } );\r\n\r\n        setupAdminTabs( document );\r\n\r\n       //Copy to clipboard button\r\n        $document.on('click', '#megacal-events-settings-sc .copyToClipboard', function(e) {\r\n\r\n            e.preventDefault();\r\n\r\n            var copyTextarea = $('.shortcode'); \r\n            copyTextarea.select();\r\n\r\n            try {\r\n\r\n                var successful = document.execCommand('copy');\r\n\r\n                if( successful )\r\n                    $('.copySuccess').fadeIn().delay(200).fadeOut();\r\n                else\r\n                    $('.copyFail').fadeIn().delay(200).fadeOut();\r\n\r\n            } catch (err) {\r\n\r\n                console.error( err );\r\n                $('.copyFail').fadeIn().delay(200).fadeOut();\r\n            \r\n            }\r\n        \r\n        });\r\n\r\n        $( '#megacal-show-tokens' ).on( 'click', function( e ) {\r\n\r\n            e.preventDefault();\r\n            $( '#megacal_access_token' ).attr( 'type', 'text' ).closest( 'tr.hidden' ).addClass( 'megacal-row' ).removeClass( 'hidden' );\r\n            $( '#megacal_refresh_token' ).attr( 'type', 'text' ).closest( 'tr.hidden' ).addClass( 'megacal-row' ).removeClass( 'hidden' );\r\n\r\n        });\r\n\r\n        $( '#megacal-reset-account' ).on( 'click', function( e ) {\r\n\r\n            e.preventDefault();\r\n            var confirm = window.confirm( 'Do you really want to unlink your MegaCalendar account from this site? (You will lose your existing Events)' );\r\n\r\n            if( !confirm ) {\r\n                return false;\r\n            }\r\n\r\n            var nonce = $( '#_megacal_unlink_account_nonce' ).val();\r\n            window.location = megacal_admin_script_opts.settings_url + \"&unlink=true&nonce=\" + nonce;\r\n\r\n        } );\r\n\r\n        // Turn on/off check handle button\r\n        $registerHandleField.on( 'keyup', function() {\r\n\r\n            var $this = $( this );\r\n\r\n            if( $this.val() ) {\r\n                $checkHandleBtn.prop( 'disabled', false );\r\n            } else {\r\n                $checkHandleBtn.prop( 'disabled', true );\r\n            }\r\n\r\n        } );\r\n\r\n        // Check Handles\r\n        $checkHandleBtn.on( 'click', function( e ) {\r\n\r\n            e.preventDefault(); \r\n\r\n            var handle = $registerHandleField.val();\r\n            var _nonce = $( '#_megacal_check_handle_nonce' ).val();\r\n\r\n            var check_handle_data = {\r\n                action: 'megacal_check_handle',\r\n                handle,\r\n                _nonce,\r\n            };\r\n    \r\n            $.post(\r\n\r\n                megacal_admin_script_opts.ajax_url,\r\n                check_handle_data,\r\n                function( response ) {\r\n                    \r\n                    if( false == response.success ) {\r\n                        \r\n                        clearAlertNotification();\r\n                        showAlertNotification( response.data.message, 'error' );\r\n\r\n                        return;\r\n                    }\r\n\r\n                    var unique = response.data.unique;\r\n                    \r\n                    if( true == unique ) {\r\n                        $registerHandleField.removeClass( 'invalid' );\r\n                        $registerHandleField.addClass( 'valid' );\r\n                    } else {\r\n                        $registerHandleField.removeClass( 'valid' );\r\n                        $registerHandleField.addClass( 'invalid' );\r\n                    }\r\n\r\n                }\r\n\r\n            )\r\n            .fail( function() {\r\n\r\n                clearAlertNotification();\r\n                showAlertNotification( 'Something isn\\'t right...', 'error' );\r\n            \r\n            }); \r\n\r\n        });\r\n\r\n        // Registration form validation\r\n        $( '#megacal-register-form input' ).on( 'keyup', function() {\r\n\r\n            checkRequiredFields( $registerForm, $registerBtn );\r\n\r\n        });\r\n\r\n        // Register\r\n        $registerForm.on( 'submit', function( e ) {\r\n\r\n            e.preventDefault();\r\n            \r\n            var form = $( this )[0];\r\n            var formData = new FormData( form );\r\n            \r\n            if( !formData.get( 'firstname' ) ) {\r\n                alert( 'firstname cannot be empty' );\r\n                return;\r\n            }\r\n\r\n            if( !formData.get( 'lastname' ) ) {\r\n                alert( 'lastname cannot be empty' );\r\n                return;\r\n            }\r\n\r\n            if( !formData.get( 'handle' ) ) {\r\n                alert( 'handle cannot be empty' );\r\n                return;\r\n            }\r\n\r\n            if( !formData.get( 'email' ) ) {\r\n                alert( 'email cannot be empty' );\r\n                return;\r\n            }\r\n\r\n            if( !formData.get( 'calendarName' ) ) {\r\n                alert( 'calendarName cannot be empty' );\r\n                return;\r\n            }\r\n\r\n            var firstname = formData.get( 'firstname' );\r\n            var lastname = formData.get( 'lastname' );\r\n            var handle = formData.get( 'handle' );\r\n            var email = formData.get( 'email' );\r\n            var calendarName = formData.get( 'calendarName' );\r\n            var phone = formData.get( 'phone' );\r\n            var _nonce = formData.get( '_megacal_register_nonce' );\r\n\r\n            var registerData = {\r\n                action: 'megacal_register',\r\n                _nonce,\r\n                firstname,\r\n                lastname,\r\n                handle,\r\n                email,\r\n                calendarName,\r\n                phone,\r\n            }; \r\n\r\n            $.post(\r\n\r\n                megacal_admin_script_opts.ajax_url,\r\n                registerData,\r\n                function( response ) {\r\n                    \r\n                    if( false == response.success ) {\r\n                        clearAlertNotification();\r\n                        showAlertNotification( response.data.message, 'error' );\r\n                        return;\r\n                    }\r\n                    \r\n                    window.location = megacal_admin_script_opts.upgrade_url;\r\n\r\n                }\r\n\r\n            )\r\n            .fail( function() {\r\n\r\n                clearAlertNotification();\r\n                showAlertNotification( GENERIC_ERROR_MSG, 'error' );\r\n            \r\n            }); \r\n\r\n        });\r\n\r\n        var $manageEvents = $( '#megacal-manage-events' );\r\n        \r\n        if( $manageEvents.length > 0 ) {\r\n\r\n            var $saveEventWrap = $( '#save-event-wrap' );\r\n            var $calendar = $( '#megacal-manage-calendar' );\r\n            var currDate = new Date();\r\n            var changeTypeSelected = false;\r\n            var $approvalList = $( '#megacal-approval-list' );\r\n\r\n            $( '.megacal-filter-cat-btn' ).on( 'change', function() {\r\n                $calendar.eventCalendar( 'refresh' );\r\n            } );\r\n\r\n            $calendar.eventCalendar({\r\n\r\n                showImage: false,\r\n                showLegends: true,\r\n                showOwners: true,\r\n                timeFormat: megacal_admin_script_opts.time_fmt_setting,\r\n                dateFormat: {\r\n                    calendar: 'D',\r\n                    calendarFirst: 'MMM D',\r\n                },\r\n                showSlider: false,\r\n                loaderImageUrl: megacal_admin_script_opts.base_url + '/assets/img/loading.svg',\r\n                defaultEventImageUrl: megacal_admin_script_opts.default_image_path,\r\n                calendarCreate: (event, data) => {\r\n\r\n                }\r\n\r\n            }).on( 'eventcalendar.calendaraddevent', ( event, data ) => {\r\n                \r\n                var $preloader = $manageEvents.find( '.preloader' );\r\n                var $eventForm = $saveEventWrap.find( '#megacal-event-form' );\r\n\r\n                $preloader.removeClass( 'hidden' );\r\n                $eventForm.html( '' );\r\n                showAddEventForm();\r\n\r\n                loadEventForm( \r\n                    null, \r\n                    function( response ) {\r\n                            \r\n                        if( false == response.success ) {\r\n                            clearAlertNotification();\r\n                            showAlertNotification( response.data.message, 'error' );\r\n                            return;\r\n                        }\r\n                        \r\n                        $preloader.addClass( 'hidden' );\r\n                        $saveEventWrap.html( response.data.content );\r\n                        \r\n                        var $eventForm = $saveEventWrap.find( '#megacal-event-form' );\r\n                        var $eventSubmitBtn = $saveEventWrap.find( '.megacal-button-save-event' );\r\n                        \r\n                        registerEventFormActions( data.date );\r\n                        initWYSIWYGFields();\r\n\r\n                    }, \r\n                    function() {\r\n\r\n                        clearAlertNotification();\r\n                        showAlertNotification( GENERIC_ERROR_MSG, 'error' );\r\n\r\n                    }\r\n                );\r\n\r\n            }).on('eventcalendar.calendarviewchange', ( event, data ) => {\r\n                \r\n                currDate = data.date;\r\n                loadCalendarView( $calendar, data.date );\r\n\r\n            }).on('eventcalendar.eventclick', ( event, data ) => {\r\n                \r\n                if( !data.createdByMe ) {\r\n                    return;\r\n                }\r\n\r\n                var eventId = data.eventId;\r\n                var $preloader = $manageEvents.find( '.preloader' );\r\n                var $eventForm = $saveEventWrap.find( '#megacal-event-form' );\r\n                \r\n                $preloader.removeClass( 'hidden' );\r\n                $eventForm.html( '' );\r\n                showAddEventForm();\r\n\r\n                loadEventForm( \r\n                    eventId, \r\n                    function( response ) {\r\n                        \r\n                        var $preloader = $manageEvents.find( '.preloader' );\r\n\r\n                        if( false == response.success ) {\r\n                            clearAlertNotification();\r\n                            showAlertNotification( response.data.message, 'error' );\r\n                            return;\r\n                        }\r\n                        \r\n                        $preloader.addClass( 'hidden' );\r\n                        $saveEventWrap.html( response.data.content );\r\n                        \r\n                        var $eventForm = $saveEventWrap.find( '#megacal-event-form' );\r\n                        var $eventSubmitBtn = $saveEventWrap.find( '.megacal-button-save-event' );\r\n                        \r\n                        registerEventFormActions();\r\n                        initWYSIWYGFields();\r\n\r\n                    }, \r\n                    function() {\r\n\r\n                        clearAlertNotification();\r\n                        showAlertNotification( GENERIC_ERROR_MSG, 'error' );\r\n\r\n                    }\r\n                );\r\n\r\n            });\r\n\r\n            loadCalendarView( $calendar, currDate );\r\n            loadApprovalList();\r\n\r\n            function setEventApproval( approvalAction, btn ) {\r\n\r\n                var approvalNotice = btn.closest( '.approval-notice' );\r\n                var eventId = approvalNotice.data( 'event-id' );\r\n                var userId = approvalNotice.data( 'user-id' );\r\n                var _nonce = $( '#_megacal_set_event_approval_nonce' ).val();\r\n\r\n                var putApprovalData = {\r\n                    action: 'megacal_set_event_approval',\r\n                    _nonce,\r\n                    approvalAction,\r\n                };\r\n\r\n                switch( approvalAction ) {\r\n                    case 'approve':\r\n                    case 'deny':\r\n                        putApprovalData.userId = userId;\r\n                        putApprovalData.eventId = eventId;\r\n                        break;\r\n\r\n                    case 'always':\r\n                    case 'approve_pending':\r\n                    case 'deny_pending': \r\n                        putApprovalData.userId = userId;\r\n                        break;\r\n                }\r\n\r\n                $.post(\r\n\r\n                    megacal_admin_script_opts.ajax_url,\r\n                    putApprovalData,\r\n                    function( response ) {\r\n                        \r\n                        if( false == response.success ) {\r\n                            clearAlertNotification();\r\n                            showAlertNotification( response.data.message, 'error' )\r\n                            return;\r\n                        }\r\n\r\n                        approvalNotice.fadeOut( 200, function() {\r\n                            $( this ).remove();\r\n                            loadApprovalList();\r\n                        });\r\n\r\n                        $calendar.eventCalendar( 'refresh' );\r\n\r\n                    }\r\n    \r\n                )\r\n                .fail( function() {\r\n    \r\n                    clearAlertNotification();\r\n                    showAlertNotification( GENERIC_ERROR_MSG, 'error' )\r\n                    \r\n                });\r\n\r\n            }\r\n            \r\n            /**\r\n             * Reload the event form via AJAX\r\n             * \r\n             * @param {int|null} eventId The event Id to prepopulate the fields - null value will generate an empty form\r\n             * @param {function} successCallback The callback to run on success\r\n             * @param {function} failureCallback The callback to run on failure\r\n             */\r\n            function loadEventForm( eventId, successCallback, failureCallback ) {\r\n\r\n                var _nonce = $( '#_megacal_get_event_upsert_nonce' ).val();\r\n                var eventId = eventId || null;\r\n\r\n                var eventUpsertData = {\r\n                    action: 'megacal_get_event_upsert',\r\n                    _nonce,\r\n                };\r\n\r\n                if( eventId !== null ) {\r\n                    eventUpsertData.eventId = eventId;\r\n                }\r\n\r\n                $.post(\r\n\r\n                    megacal_admin_script_opts.ajax_url,\r\n                    eventUpsertData,\r\n                    successCallback\r\n    \r\n                )\r\n                .fail( failureCallback ); \r\n\r\n            }\r\n\r\n            function registerEventFormActions( date ) {\r\n\r\n                var $eventForm = $( '#megacal-event-form' );\r\n                var $eventSubmitBtn = $( '.megacal-button-save-event' );\r\n                var $eventDeleteBtn = $( '.megacal-button-delete-event' );\r\n                var $allDayCheckbox = $( '#megacal-all-day' );\r\n                var $startTimeField = $( '#megacal-event-start-time' );\r\n                var $endTimeField = $( '#megacal-event-end-time' );\r\n                var $dateField = $( '#megacal-event-date' );\r\n                var $eventImgBtn = $( '#megacal-upload-event-img' );\r\n                var $eventRemoveBtn = $( '#megacal-remove-event-img' );\r\n                var $eventImgField = $( '#megacal-event-img' );\r\n                var $imgPreview = $( '#megacal-img-preview' );\r\n                var $venueField = $( '#megacal-event-venue-name' );\r\n                var $venueIdField = $( '#megacal-event-venue-id' );\r\n                var $categoryField = $( '#megacal-event-category-name' );\r\n                var $categoryIdField = $( '#megacal-event-category-id' );\r\n                var $venueLocationField = $( '#megacal-event-venue-location' ); \r\n                var $cancelBtn = $( '.megacal-button-cancel-edit-event' );\r\n                var $modalCancelBtn = $( '.megacal-button-cancel-save-delete');\r\n                var startDate = date ? new Date( date ) : false;\r\n                var $timepicker = $( '.timepicker' );\r\n                var recurrence = $( '#megacal-event-recurrence-details' ).val();\r\n                var recurrenceDetails = null;\r\n\r\n                if( '' !== recurrence.trim() ) {\r\n                    recurrenceDetails = JSON.parse( recurrence );\r\n                }\r\n\r\n                if( startDate ) {\r\n                    \r\n                    fmtDate = new Intl.DateTimeFormat( 'en-US', { \r\n                        month: '2-digit', \r\n                        day: '2-digit', \r\n                        year: 'numeric' \r\n                    } ).format( startDate );\r\n\r\n                    $dateField.val( fmtDate );\r\n\r\n                }\r\n\r\n                $cancelBtn.on( 'click', function( e ) {\r\n                    $saveEventWrap.fadeOut( 500 );\r\n                });\r\n\r\n                $modalCancelBtn.on( 'click', function( e ) {\r\n                    hideChangeTypeModal();\r\n                });\r\n\r\n                $eventDeleteBtn.on( 'click', function( e ) {\r\n\r\n                    if( !changeTypeSelected ) {\r\n                        var confirm = window.confirm( 'Are you sure you want to permanently delete this event?' );\r\n                        if( !confirm ) {\r\n                            return;\r\n                        }\r\n                    }\r\n\r\n                    if( recurrenceDetails && !changeTypeSelected ) {\r\n                        showChangeTypeModal( 'delete' );\r\n                        return;\r\n                    }\r\n\r\n                    var publishOptions = $( '#submitdiv' );\r\n                    var _nonce = publishOptions.find( '#_megacal_delete_event_nonce' ).val();\r\n                    var eventId = $eventForm.find( '#megacal-event-id' ).val();\r\n                    var formData = new FormData( $eventForm[0] );\r\n                    var eventChangeType = formData.get( 'eventChangeType' );\r\n\r\n                    var deleteEventData = {\r\n                        action: 'megacal_delete_event',\r\n                        _nonce,\r\n                        eventId,\r\n                        eventChangeType,\r\n                    };\r\n\r\n                    $.post(\r\n\r\n                        megacal_admin_script_opts.ajax_url,\r\n                        deleteEventData,\r\n                        function( response ) {\r\n                            \r\n                            if( false == response.success ) {\r\n                                clearAlertNotification();\r\n                                showAlertNotification( response.data.message, 'error' );\r\n                                return;\r\n                            }\r\n\r\n                            $saveEventWrap.fadeOut( 500, function() {\r\n                                $calendar.eventCalendar( 'refresh' );\r\n                            } );\r\n\r\n                        }\r\n        \r\n                    )\r\n                    .fail( function() {\r\n        \r\n                        clearAlertNotification();\r\n                        showAlertNotification( GENERIC_ERROR_MSG, 'error' );\r\n                        \r\n                    })\r\n                    .done( function() {\r\n                        hideChangeTypeModal();\r\n                    } );\r\n\r\n                } );\r\n\r\n                $dateField.datepicker({\r\n                    format: 'mm/dd/yyyy',\r\n                    todayHighlight: true,\r\n                    autoclose: true,\r\n                }).datepicker( 'update' );\r\n\r\n                $dateField.on( 'change', function() {\r\n                    \r\n                    checkRequiredFields( $eventForm, $eventSubmitBtn );\r\n                    fetchEventRecurrenceDetails();\r\n\r\n                });\r\n\r\n                $timepicker.each( function() {\r\n                \r\n                    var val = $( this ).val();\r\n\r\n                    $( this ).wickedpicker({\r\n                        now: val || '12:00',\r\n                        minutesInterval: 5,\r\n                        clearable: true,\r\n                    });\r\n\r\n                    if( !val ) {\r\n                        $( this ).val( '' ); // Default state - no value\r\n                    }\r\n\r\n                });\r\n\r\n                $venueField.select2({\r\n                    placeholder: 'Tag or Add a Venue',\r\n                    tags: true,\r\n                    allowClear: true,\r\n                    createTag: function( tag ) {\r\n\r\n                        // Case-insensitive tagging\r\n                        var found = false;\r\n\r\n                        $venueField.find( 'option' ).each( function() {\r\n                            \r\n                            if( $.trim( tag.term ).toUpperCase() === $.trim( $( this ).text() ).toUpperCase() ) {\r\n                                found = true;\r\n                            }\r\n\r\n                        });\r\n                \r\n                        if( !found ) {\r\n                            \r\n                            // Also don't allow purely numeric venue names\r\n                            if( $.isNumeric( tag.term ) ) {\r\n                                return {};\r\n                            }\r\n\r\n                            return {\r\n                                id: tag.term,\r\n                                text: tag.term + \" (new)\",\r\n                                isNew: true\r\n                            };\r\n\r\n                        }\r\n\r\n                    },\r\n                    language: {\r\n                        noResults: function( params ){\r\n                            return \"Type to add a venue.\";\r\n                        }\r\n                    },\r\n                });\r\n\r\n                $venueField.on( 'change', function() {\r\n\r\n                    var val = $( this ).val();\r\n                    var location = $( this ).find( 'option[value=\"' + val + '\"]' ).data( 'location' );\r\n\r\n                    if( $.isNumeric( val ) ) {\r\n                        \r\n                        $venueIdField.val( val );\r\n                        $venueLocationField.val( location ).prop( 'disabled', true );\r\n\r\n                    } else {\r\n\r\n                        $venueIdField.val( '' );\r\n                        $venueLocationField.val( '' ).prop( 'disabled', false );\r\n\r\n                    }\r\n\r\n                    checkRequiredFields( $eventForm, $eventSubmitBtn );\r\n\r\n                });\r\n\r\n                $categoryField.select2({\r\n                    placeholder: 'Tag or Add an Event Category',\r\n                    tags: true,\r\n                    createTag: function( tag ) {\r\n\r\n                        // Case-insensitive tagging\r\n                        var found = false;\r\n\r\n                        $categoryField.find( 'option' ).each( function() {\r\n                            \r\n                            if( $.trim( tag.term ).toUpperCase() === $.trim( $( this ).text() ).toUpperCase() ) {\r\n                                found = true;\r\n                            }\r\n\r\n                        });\r\n                \r\n                        if( !found ) {\r\n                            \r\n                            // Also don't allow purely numeric venue names\r\n                            if( $.isNumeric( tag.term ) ) {\r\n                                return {};\r\n                            }\r\n\r\n                            return {\r\n                                id: tag.term,\r\n                                text: tag.term + \" (new)\",\r\n                                isNew: true\r\n                            };\r\n\r\n                        }\r\n\r\n                    },\r\n                    language: {\r\n                        noResults: function( params ){\r\n                            return \"No Existing Categories Found\";\r\n                        }\r\n                    },\r\n                });\r\n\r\n                $categoryField.on( 'change', function() {\r\n\r\n                    var val = $( this ).val();\r\n\r\n                    if( $.isNumeric( val ) ) {\r\n                        $categoryIdField.val( val );\r\n                    } else {\r\n                        $categoryIdField.val( '' );\r\n                    }\r\n\r\n                    checkRequiredFields( $eventForm, $eventSubmitBtn );\r\n\r\n                });\r\n    \r\n                $( '#megacal-event-form input' ).on( 'keyup', function() {\r\n                    checkRequiredFields( $eventForm, $eventSubmitBtn );\r\n                });\r\n\r\n                if( $allDayCheckbox.prop( 'checked' ) ) {\r\n                    \r\n                    $startTimeField.hide().removeClass( 'required' );\r\n                    $endTimeField.hide().removeClass( 'required' );\r\n\r\n                }\r\n\r\n                $allDayCheckbox.on( 'change', function() {\r\n    \r\n                    var checked = $( this ).prop( 'checked' );\r\n    \r\n                    if( checked ) {\r\n    \r\n                        $startTimeField.hide().removeClass( 'required' );\r\n                        $endTimeField.hide().removeClass( 'required' );\r\n                        \r\n                    } else {\r\n    \r\n                        $startTimeField.show().addClass( 'required' );\r\n                        $endTimeField.show().addClass( 'required' );\r\n    \r\n                    }\r\n    \r\n                    checkRequiredFields( $eventForm, $eventSubmitBtn );\r\n    \r\n                });\r\n\r\n                $eventForm.find( 'input' ).on( 'blur, focus', function() { checkRequiredFields( $eventForm, $eventSubmitBtn ); } );\r\n    \r\n                // Form Submission\r\n                $eventForm.on( 'submit', function( e ) {\r\n    \r\n                    e.preventDefault();\r\n\r\n                    if( tinyMCE ) {\r\n                        tinyMCE.triggerSave();\r\n                    }\r\n                    \r\n                    var form = $( this )[0];\r\n                    var formData = new FormData( form );\r\n\r\n                    if( recurrenceDetails && !changeTypeSelected ) {\r\n                        showChangeTypeModal( 'update' );\r\n                    } else {\r\n                        saveEvent( formData );\r\n                    }\r\n    \r\n                });\r\n    \r\n                // Image Uploads\r\n                $eventImgBtn.on( 'click', function( e ) {\r\n    \r\n                    e.preventDefault();\r\n    \r\n                    checkRequiredFields( $eventForm, $eventSubmitBtn );\r\n\r\n                    customUploader = wp.media({\r\n    \r\n                        title: 'Upload Event Image',\r\n                        library : {\r\n                            type : 'image'\r\n                        },\r\n                        button: {\r\n                            text: 'Use this image' // button label text\r\n                        },\r\n                        multiple: false\r\n    \r\n                    }).on('select', function() { // it also has \"open\" and \"close\" events\r\n    \r\n                        var attachment = customUploader.state().get( 'selection' ).first().toJSON();\r\n                        $eventImgBtn.hide();\r\n                        $imgPreview.attr( 'src', attachment.url ).show();\r\n                        $eventRemoveBtn.show();\r\n                        $eventImgField.val( attachment.url );\r\n    \r\n                    }).open();\r\n    \r\n                });\r\n    \r\n                $eventRemoveBtn.on( 'click', function( e ) {\r\n    \r\n                    e.preventDefault();\r\n\r\n                    checkRequiredFields( $eventForm, $eventSubmitBtn );\r\n    \r\n                    $imgPreview.hide();\r\n                    $eventRemoveBtn.hide();\r\n                    $eventImgBtn.show();\r\n                    $eventImgField.val( '' );\r\n    \r\n                });\r\n\r\n                fetchEventRecurrenceDetails( recurrenceDetails );\r\n\r\n            }\r\n\r\n            function showChangeTypeModal( action ) {\r\n                var $modal = $( '#megacal-change-type-modal' );\r\n\r\n                $modal.show();\r\n                $( '#megacal-admin-mask' ).show();\r\n\r\n                if( action === 'update' ) {\r\n                    $( '#megacal-change-type-this' ).prop( 'checked', true );\r\n                    $( '#megacal-change-type-options' ).show();\r\n                    $modal.find( '.megacal-button-delete-event' ).hide();\r\n                    $modal.find( '.megacal-button-save-event' ).show();\r\n                    $modal.find( '#megacal-change-type-this' ).focus();\r\n                } else if( action === 'delete' ) {\r\n                    $( '#megacal-delete-type-this' ).prop( 'checked', true );\r\n                    $( '#megacal-delete-type-options' ).show();\r\n                    $modal.find( '.megacal-button-delete-event' ).show();\r\n                    $modal.find( '.megacal-button-save-event' ).hide();\r\n                    $modal.find( '#megacal-delete-type-this' ).focus();\r\n                }\r\n\r\n                changeTypeSelected = true;\r\n            }\r\n\r\n            function hideChangeTypeModal() {\r\n                $( '#megacal-change-type-modal' ).hide();\r\n                $( '#megacal-admin-mask' ).hide();\r\n                $( '#megacal-change-type-options' ).hide();\r\n                $( '#megacal-delete-type-options' ).hide();\r\n                $( '.megacal-button-save-event' ).focus();\r\n                \r\n                changeTypeSelected = false;\r\n            }\r\n\r\n            function saveEvent( formData ) {\r\n\r\n                var _nonce = formData.get( '_megacal_event_upsert_nonce' );\r\n                var eventId = formData.get( 'eventId' );\r\n                var eventTitle = formData.get( 'eventTitle' );\r\n                var eventDate = formData.get( 'eventDate' );\r\n                var eventAllDay = formData.get( 'eventAllDay' );\r\n                var eventStartTime = formData.get( 'eventStartTime' );\r\n                var eventEndTime = formData.get( 'eventEndTime' );\r\n                var eventImg = formData.get( 'eventImg' );\r\n                var eventVenueId = formData.get( 'eventVenueId' );\r\n                var eventVenueName = formData.get( 'eventVenueName' );\r\n                var eventVenueLocation = formData.get( 'eventVenueLocation' );\r\n                var eventCatId = formData.get( 'eventCatId' );\r\n                var eventCatName = formData.get( 'eventCatName' );\r\n                var eventOrganizer = formData.get( 'megacal-event-organizer' );\r\n                var eventFacebookUrl = formData.get( 'eventFacebookUrl' );\r\n                var eventTicketUrl = formData.get( 'eventTicketUrl' );\r\n                var eventPrice = formData.get( 'eventPrice' );\r\n                var eventTaggedUsers = formData.getAll( 'eventTaggedUsers' );\r\n                var eventTaggedUsersExtra = formData.get( 'eventTaggedUsersExtra' );\r\n                var megacalEventDescription = formData.get( 'megacal-event-description' );\r\n                var megacalEventPrivateNotes = formData.get( 'megacal-event-private-notes' );\r\n                var published = formData.get( 'publishEvent' );\r\n                var eventRecurrence = formData.get( 'eventRecurrence' );\r\n                var eventRecurrenceRepetition = formData.get( 'eventRecurrenceRepetition' );\r\n                var eventRecurrenceCustomType = formData.get( 'eventRecurrenceCustomType' );\r\n                var eventRecurrenceCustomMonthlyFreq = formData.get( 'eventRecurrenceCustomMonthlyFreq' );\r\n                var eventRecurrenceWeeklyDays = formData.getAll( 'eventRecurrenceWeeklyDays' );\r\n                var eventRecurrenceEnd = formData.get( 'eventRecurrenceEnd' );\r\n                var eventRecurrenceEndDate = formData.get( 'eventRecurrenceEndDate' );\r\n                var eventRecurrenceEndOccurrence = formData.get( 'eventRecurrenceEndOccurrence' );\r\n                var eventRecurrenceDayOfWeek = formData.get( 'eventRecurrenceDayOfWeek' );\r\n                var eventRecurrenceWeekOfMonth = formData.get( 'eventRecurrenceWeekOfMonth' );\r\n                var eventRecurrenceLastDayOfWeek = formData.get( 'eventRecurrenceLastDayOfWeek' );\r\n                var eventRecurrenceDayOfMonth = formData.get( 'eventRecurrenceDayOfMonth' );\r\n                var eventRecurrenceMonth = formData.get( 'eventRecurrenceMonth' );\r\n                var eventChangeType = formData.get( 'eventChangeType' );\r\n\r\n                var saveEventData = {\r\n                    action: 'megacal_save_event',\r\n                    _nonce,\r\n                    eventId,\r\n                    eventTitle,\r\n                    eventDate,\r\n                    eventAllDay,\r\n                    eventStartTime,\r\n                    eventEndTime,\r\n                    eventImg,\r\n                    eventVenueId,\r\n                    eventVenueName,\r\n                    eventVenueLocation,\r\n                    eventCatId,\r\n                    eventCatName,\r\n                    eventOrganizer,\r\n                    eventFacebookUrl,\r\n                    eventTicketUrl,\r\n                    eventPrice,\r\n                    eventTaggedUsers,\r\n                    eventTaggedUsersExtra,\r\n                    megacalEventDescription,\r\n                    megacalEventPrivateNotes,\r\n                    published,\r\n                    eventRecurrence,\r\n                    eventRecurrenceRepetition,\r\n                    eventRecurrenceCustomType,\r\n                    eventRecurrenceCustomMonthlyFreq,\r\n                    eventRecurrenceWeeklyDays,\r\n                    eventRecurrenceEnd,\r\n                    eventRecurrenceEndDate,\r\n                    eventRecurrenceEndOccurrence,\r\n                    eventRecurrenceDayOfWeek,\r\n                    eventRecurrenceWeekOfMonth,\r\n                    eventRecurrenceLastDayOfWeek,\r\n                    eventRecurrenceDayOfMonth,\r\n                    eventRecurrenceMonth,\r\n                    eventChangeType,\r\n                };\r\n                \r\n                $.post(\r\n\r\n                    megacal_admin_script_opts.ajax_url,\r\n                    saveEventData,\r\n                    function( response ) {\r\n\r\n                        if( false == response.success ) {\r\n                            clearAlertNotification();\r\n                            showAlertNotification( response.data.message, 'error' );\r\n\r\n                            return;\r\n                        }\r\n                        \r\n                        $saveEventWrap.fadeOut( 500 );\r\n                        $calendar.eventCalendar( 'refresh' );\r\n\r\n                        // Refresh cached venues if a new one was added \r\n                        if( '' == eventVenueId ) {\r\n\r\n                            var _nonce = $( '#_megacal_get_event_upsert_nonce' ).val();\r\n                            var eventId = response.data.eventId;\r\n\r\n                            var eventUpsertData = {\r\n                                action: 'megacal_get_event_upsert',\r\n                                _nonce,\r\n                                eventId: eventId,\r\n                            };\r\n            \r\n                            $.post(\r\n            \r\n                                megacal_admin_script_opts.ajax_url,\r\n                                eventUpsertData,\r\n                                function( response ) {\r\n                                    \r\n                                    if( false == response.success ) {\r\n                                        clearAlertNotification();\r\n                                        showAlertNotification( response.data.message, 'error' );\r\n\r\n                                        return;\r\n                                    }\r\n\r\n                                }\r\n                                \r\n                            );\r\n\r\n                        }\r\n    \r\n                    }\r\n    \r\n                )\r\n                .fail( function() {\r\n    \r\n                    clearAlertNotification();\r\n                    showAlertNotification( GENERIC_ERROR_MSG, 'error' );\r\n                    changeTypeSelected = false;\r\n\r\n                })\r\n                .done( function() {\r\n                    hideChangeTypeModal(); \r\n                } );\r\n\r\n            }\r\n\r\n            function fetchEventRecurrenceDetails( recurrence ) {\r\n\r\n                var $eventRecurrenceContainer = $( '.megacal-event-recurrence-container' );\r\n                \r\n                var $select = $eventRecurrenceContainer.find( '#eventRecurrenceSelect' );\r\n                var selectVal = $select ? $select.val() : false;\r\n\r\n                var $radio = $eventRecurrenceContainer.find( '.eventRecurrenceEnd:checked' );\r\n                var radioVal = $radio ? $radio.val() : false;\r\n\r\n                var $customRecurrenceTypeSelectOr = $( '#eventRecurrenceCustomType' );\r\n                var customRecurrenceTypeVal = $customRecurrenceTypeSelectOr ? $customRecurrenceTypeSelectOr.val() : false;\r\n\r\n                var $dateField = $( '#megacal-event-date' );\r\n                var date = $dateField.val();\r\n                var eventId = $( '#megacal-event-id' ).val().trim() ? parseInt( $( '#megacal-event-id' ).val().trim() ) : 0;\r\n\r\n                var $endsDetailsContainer = $( '.megacal-ends-details-container' );\r\n                var endsExpanded = $endsDetailsContainer.length > 0 ? !$endsDetailsContainer.hasClass( 'collapsed' ) : false;\r\n                var showRecurrence = true;\r\n\r\n                if( !recurrence && eventId > 0 ) {\r\n                    showRecurrence = false;\r\n                }\r\n\r\n                if( recurrence ) {\r\n                    selectVal = recurrence.type;\r\n\r\n                    if( 'CUSTOM' === recurrence.type ) {\r\n                        customRecurrenceTypeVal = recurrence.custom.type||customRecurrenceTypeVal;\r\n                        radioVal = recurrence.custom.end_condition||radioVal;\r\n                    }\r\n                }\r\n\r\n                // Remove content\r\n                var _nonce = $( '#_megacal_event_recurrence_nonce' ).val();\r\n\r\n                $.post(\r\n\r\n                    megacal_admin_script_opts.ajax_url,\r\n                    { \r\n                        action: 'megacal_get_event_recurrence',\r\n                        _nonce,\r\n                        date: date || null,\r\n                        showRecurrence,\r\n                    },\r\n                    function( response ) {\r\n\r\n                        if( false == response.success ) {\r\n                            clearAlertNotification();\r\n                            showAlertNotification( response.data.message, 'error' );\r\n                            return;\r\n                        }\r\n\r\n                        $eventRecurrenceContainer.html( response.data.content );\r\n\r\n                        var recurrence_details = response.data.recurrence_details;\r\n                        if( recurrence_details ) {\r\n\r\n                            var $eventRecurrenceRepetition = $( '#eventRecurrenceRepetition' );\r\n                            var $eventRecurrenceEndDate = $( '#eventRecurrenceEndDate' );\r\n                            var $eventRecurrenceEndOccurrence = $( '#eventRecurrenceEndOccurrence' );\r\n                            var $customRecurrenceTypeSelect = $( '#eventRecurrenceCustomType' );\r\n                            var $customRecurrenceMonthlyFreq = $( '#eventRecurrenceCustomMonthlyFreq' );\r\n                            var $customRecurrenceWeeklyDays = $( '#eventRecurrenceWeeklyDays' );\r\n                            var $eventRecurrenceSelect = $eventRecurrenceContainer.find( '#eventRecurrenceSelect' );\r\n                            var $customRecurrenceDetailsSection = $eventRecurrenceContainer.find( '.megacal-custom-recurrence-details' );\r\n\r\n                            // Reselect options after date change\r\n                            if( selectVal ) {\r\n                                \r\n                                $eventRecurrenceSelect.val( selectVal );\r\n\r\n                                if( 'CUSTOM' === selectVal ) {\r\n                                    $customRecurrenceDetailsSection.show();\r\n                                }\r\n\r\n                            }\r\n\r\n                            if( radioVal ) {\r\n                                $eventRecurrenceContainer.find( '.eventRecurrenceEnd[value=\"' + radioVal + '\"]' ).prop( 'checked', true );\r\n                            }\r\n\r\n                            if( customRecurrenceTypeVal ) {\r\n                                $customRecurrenceTypeSelect.val( customRecurrenceTypeVal );\r\n                            }\r\n\r\n                            if( $eventRecurrenceSelect.val() === 'CUSTOM' ) {\r\n                                $( '.megacal-custom-recurrence-details' ).removeClass( 'hidden' );\r\n                            }\r\n\r\n                            if( $customRecurrenceTypeSelect.length < 1 ) {\r\n                                return;\r\n                            }\r\n\r\n                            var customRecurrenceType = $customRecurrenceTypeSelect.val().toLowerCase();\r\n                            var customDetail = recurrence_details.custom;\r\n                            var detailVals = customDetail[customRecurrenceType + '_custom'];\r\n                            var fmtEndDate = moment( detailVals.end_condition.on, 'YYYY-MM-DD' ).format( 'MM/DD/YYYY' );\r\n                            var afterOccurrence = detailVals.end_condition.after_occurrence;\r\n                            var repetition = customDetail.repetition;\r\n                            \r\n                            if( recurrence ) {    \r\n                                \r\n                                if( recurrence.custom ) {\r\n                                    var recurrenceDetails = recurrence.custom[customRecurrenceType + '_custom'] || recurrence.custom;\r\n                                    repetition = recurrence.custom.repetition||repetition;\r\n\r\n                                    if( recurrenceDetails.repeat_on ) {\r\n                                        $( '.eventRecurrenceWeeklyDays' ).prop( 'checked', false );\r\n                                        $( '.eventRecurrenceWeeklyDays' ).each( function() {\r\n                                            var $this = $( this );\r\n\r\n                                            if( recurrenceDetails.repeat_on.indexOf( $this.val() ) > -1 ) {\r\n                                                $( this ).prop( 'checked', true );\r\n                                            }\r\n                                        });\r\n                                    }\r\n\r\n                                    if( recurrenceDetails.day_of_week ) {\r\n                                        var weekOfMonth = recurrenceDetails.week_of_month;\r\n                                        $( '#eventRecurrenceCustomMonthlyFreq' ).val( 'week_of_month-' + weekOfMonth );\r\n                                    }\r\n\r\n                                    if( recurrence.custom.end_condition ) {\r\n                                        if( recurrence.custom.end_condition.on ) {\r\n                                            fmtEndDate = moment( recurrence.custom.end_condition.on, 'YYYY-MM-DD' ).format( 'MM/DD/YYYY' );\r\n                                            endsExpanded = true;\r\n                                            $eventRecurrenceContainer.find( '#eventRecurrenceEndDateOp' ).prop( 'checked', true );\r\n                                        } else if( recurrence.custom.end_condition.after_occurrence > 0 ) {\r\n                                            afterOccurrence = recurrence.custom.end_condition.after_occurrence;\r\n                                            endsExpanded = true;\r\n                                            $eventRecurrenceContainer.find( '#eventRecurrenceEndOccurrenceOp' ).prop( 'checked', true );\r\n                                        }\r\n                                    }\r\n                                }\r\n                                \r\n                            }\r\n\r\n                            $eventRecurrenceRepetition.val( repetition );\r\n                            $eventRecurrenceEndDate.val( fmtEndDate );\r\n                            $eventRecurrenceEndOccurrence.val( afterOccurrence );\r\n\r\n                            // expand/collapse ends details\r\n                            if( endsExpanded ) {\r\n                                var $newEndsDetailsContainer = $eventRecurrenceContainer.find( '.megacal-ends-details-container' );\r\n                                var $toggle = $eventRecurrenceContainer.find( '.collapsable-toggle' );\r\n                                $toggle.find( '.icon-chevron-right' ).removeClass( 'icon-chevron-right' ).addClass( 'icon-chevron-down' );\r\n                                $newEndsDetailsContainer.removeClass( 'collapsed' );\r\n                            }\r\n\r\n                            // re-register event listeners\r\n                            $eventRecurrenceSelect.on( 'change', function() {\r\n\r\n                                if( 'CUSTOM' === $( this ).val() ) {\r\n                                    $customRecurrenceDetailsSection.slideDown();\r\n                                } else {\r\n                                    $customRecurrenceDetailsSection.slideUp();\r\n                                }\r\n\r\n                            } );\r\n\r\n                            if( 'WEEKLY' === $customRecurrenceTypeSelect.val() ) {    \r\n                                $customRecurrenceWeeklyDays.removeClass( 'hidden' );\r\n                            } else if( 'MONTHLY' === $customRecurrenceTypeSelect.val() ) {\r\n                                $customRecurrenceMonthlyFreq.removeClass( 'hidden' );\r\n                            }\r\n\r\n                            $customRecurrenceTypeSelect.on( 'change', function() {\r\n                                fetchEventRecurrenceDetails();\r\n                            } );\r\n\r\n                            // Register datepicker\r\n                            $eventRecurrenceContainer.find( '#eventRecurrenceEndDate' ).datepicker({\r\n                                format: 'mm/dd/yyyy',\r\n                                todayHighlight: true,\r\n                                autoclose: true,\r\n                            }).datepicker( 'update' );\r\n\r\n                            $( '#eventRecurrenceEndOccurrence' ).on( 'click', function() {\r\n                                $('#eventRecurrenceEndOccurrenceOp' ).prop( 'checked', true );\r\n                            } );\r\n                            \r\n                            $( '#eventRecurrenceEndDate' ).on( 'click', function() {\r\n                                $('#eventRecurrenceEndDateOp' ).prop( 'checked', true );\r\n                            } );\r\n\r\n                            $( '.eventRecurrenceWeeklyDays' ).on( 'click', function() {\r\n                                \r\n                                var $weeklyDaysCBs = $( '.eventRecurrenceWeeklyDays' );\r\n                                var $selectedDayCB;\r\n                                var defaultDay = customDetail.weekly_custom.selected_day_of_week;\r\n                                var allEmpty = true;\r\n\r\n                                $weeklyDaysCBs.each( function() {\r\n\r\n                                    if( $( this ).prop( 'checked' ) === true ) {\r\n                                        allEmpty = false;\r\n                                    }\r\n\r\n                                    if( $( this ).val() !== defaultDay )\r\n                                        return;\r\n\r\n                                    $selectedDayCB = $( this );\r\n\r\n                                } );\r\n\r\n                                if( allEmpty ) {\r\n                                    $selectedDayCB.prop( 'checked', true );\r\n                                }\r\n\r\n                            } );\r\n\r\n                        }\r\n\r\n                    }\r\n    \r\n                )\r\n                .fail( function() {\r\n                    clearAlertNotification();\r\n                    showAlertNotification( GENERIC_ERROR_MSG, 'error' );\r\n                    return;\r\n                } )\r\n                .done( function() {\r\n\r\n                    var $eventForm = $( '#megacal-event-form' );\r\n                    var $eventSubmitBtn = $( '.megacal-button-save-event' );\r\n\r\n                    checkRequiredFields( $eventForm, $eventSubmitBtn );\r\n\r\n                } );\r\n                \r\n            }\r\n\r\n            function initWYSIWYGFields() {\r\n\r\n                if( !tinyMCE )\r\n                    return; // Safeguard, should never happen\r\n                    \r\n                var $eventForm = $( '#megacal-event-form' );\r\n                var $eventSubmitBtn = $( '.megacal-button-save-event' );\r\n\r\n                $saveEventWrap.find( '.wp-editor-area' ).each( function() {\r\n                    \r\n                    var id = $( this ).attr( 'id' );\r\n\r\n                    // xxx: Need to jump through some hoops to properly render WYSIWYG editors after AJAX\r\n                    \r\n                    tinyMCEPreInit.mceInit[id].setup = function( ed ) {\r\n\r\n                        ed.on( 'keyup', function() {\r\n                            checkRequiredFields( $eventForm, $eventSubmitBtn );\r\n                        });\r\n\r\n                    };\r\n\r\n                    tinyMCE.init( tinyMCEPreInit.mceInit[id] ); // don't change the settings\r\n                    \r\n                    // Render the editor\r\n                    tinyMCE.execCommand( 'mceRemoveEditor', false, id ); \r\n                    tinyMCE.execCommand( 'mceAddEditor', false, id ); \r\n\r\n                    quicktags( { id } ); // Text view quicktag buttons\r\n\r\n                });\r\n\r\n            }\r\n\r\n            function showAddEventForm() {\r\n            \r\n                $saveEventWrap.fadeIn( 500, function() {\r\n                    $( '#megacal-event-title' ).focus();\r\n                } );\r\n\r\n            }\r\n\r\n            function loadCalendarView( $eventCalendar, date ) {\r\n\r\n                const format = 'YYYY-MM-DD';\r\n                const aMoment = moment( date ).hours(0)\r\n                    .minutes(0)\r\n                    .seconds(0)\r\n                    .milliseconds(0);\r\n\r\n                const startDate = aMoment.clone().startOf( 'month' ).startOf( 'week' ).format( format );\r\n                const endDate = aMoment.clone().endOf( 'month' ).endOf( 'week' ).format( format );\r\n    \r\n                var _nonce = $( '#_megacal_fetch_events_nonce' ).val();\r\n                var $filterForm = $( '#megacal-manage-filter-form' );\r\n                var formData = new FormData( $filterForm[0] );\r\n\r\n                var eventCategories = formData.getAll( 'megacalFilterCategories' );\r\n\r\n                $eventCalendar.eventCalendar( 'showLoader' );\r\n\r\n                var fetchEventsData = {\r\n                    action: 'megacal_fetch_calendar_events',\r\n                    _nonce,\r\n                    startDate,\r\n                    endDate,\r\n                    eventCategories,\r\n                };\r\n\r\n                $.post(\r\n\r\n                    megacal_admin_script_opts.ajax_url,\r\n                    fetchEventsData,\r\n                    function( response ) {\r\n                        \r\n                        if( false == response.success ) {\r\n                            clearAlertNotification();\r\n                            showAlertNotification( response.data.message, 'error' );\r\n                            return;\r\n                        }\r\n                        \r\n                        $eventCalendar.eventCalendar( \r\n                            'option', \r\n                            'events', \r\n                            { \r\n                                'events': response.data.events \r\n                            } \r\n                        );\r\n\r\n                    }\r\n\r\n                )\r\n                .fail( function() {\r\n                    \r\n                })\r\n                .done( function() {\r\n                    $eventCalendar.eventCalendar( 'hideLoader' );\r\n                });\r\n            };\r\n\r\n            function loadApprovalList() {\r\n\r\n                var _nonce = $( '#megacal_get_approval_list_nonce' ).val();\r\n                var getApprovalListData = {\r\n                    action: 'megacal_get_approval_list',\r\n                    _nonce\r\n                };\r\n\r\n                $.post(\r\n                    megacal_admin_script_opts.ajax_url,\r\n                    getApprovalListData,\r\n                    function( response ) {\r\n                        \r\n                        if( false == response.success ) {\r\n                            clearAlertNotification();\r\n                            showAlertNotification( response.data.message, 'error' );\r\n                            return;\r\n                        }\r\n\r\n                        $approvalList.html( response.data.content );\r\n\r\n                        var $approvalActionBtn = $( '.button-approval-action' );\r\n                        $approvalActionBtn.on( 'click', function( e ) {\r\n            \r\n                            e.preventDefault();\r\n                            setEventApproval( $( this ).data( 'action' ), $( this ) );\r\n            \r\n                        });\r\n\r\n                    }\r\n                ).fail( function() {\r\n                    clearAlertNotification();\r\n                    showAlertNotification( GENERIC_ERROR_MSG, 'error' );\r\n                });\r\n\r\n            }\r\n            \r\n        }\r\n\r\n        var $manageRelationships = $( '.megacal-manage-relationships-page' );\r\n\r\n        if( $manageRelationships.length > 0 ) {\r\n\r\n            var isDirty = false;\r\n\r\n            $( window ).on( 'load', function() {\r\n                window.addEventListener(\"beforeunload\", function (e) {\r\n\r\n                    if( !isDirty ) {\r\n                        return undefined;\r\n                    }\r\n                    \r\n                    var confirmationMessage = 'Changes you made on this page may not be saved';\r\n            \r\n                    (e || window.event).returnValue = confirmationMessage; //Gecko + IE\r\n                    return confirmationMessage; //Gecko + Webkit, Safari, Chrome etc.\r\n\r\n                });\r\n            } );\r\n\r\n            // Edit button functionality\r\n            $( '.megacal-relationship-edit-btn' ).on( 'click', function( e ) {\r\n\r\n                e.preventDefault();\r\n                isDirty = true;\r\n\r\n                var $this = $( this );\r\n                var $form = $this.closest( '.megacal-manage-relationship-form' );\r\n\r\n                var $inputs = $form.find( 'input, textarea' );\r\n                var $nameInput;\r\n                $inputs.each( function() {\r\n                    $( this ).prop( 'readonly', false );\r\n                    $( this ).prop( 'disabled', false );\r\n\r\n                    if( $( this ).attr( 'name' ) == 'name' ) {\r\n                        $nameInput = $( this );\r\n                    }\r\n                });\r\n\r\n                if( $nameInput ) {\r\n                    $nameInput.focus();\r\n                }\r\n\r\n                $form.find( '.megacal-relationship-save-btn' ).prop( 'disabled', false );\r\n                $this.prop( 'disabled', true );\r\n\r\n            } );\r\n\r\n            $( '.megacal-manage-relationship-form' ).on( 'submit', function( e ) {\r\n\r\n                e.preventDefault();\r\n\r\n                var $form = $( this );\r\n                var _nonce = $( '#megacal_update_relationships_nonce' ).val();\r\n                var form = $form[0];\r\n                var formData = new FormData( form );\r\n                var type = formData.get( 'type' );\r\n                var $inputs = $form.find( 'input, textarea' );\r\n\r\n                $form.find( '.megacal-relationship-save-btn' ).prop( 'disabled', true );\r\n                \r\n                var putRelationshipData = {\r\n                    name: formData.get( 'name' ),\r\n                    published: formData.get( 'published' ),\r\n                    _nonce,\r\n                    action: 'megacal_update_' + type + '_details',\r\n                };\r\n\r\n                putRelationshipData[type + '_id'] = formData.get( 'id' );\r\n\r\n                if( 'venue' === type ) {\r\n                    putRelationshipData.location = formData.get( 'location' );\r\n                }\r\n\r\n                $.post(\r\n\r\n                    megacal_admin_script_opts.ajax_url,\r\n                    putRelationshipData,\r\n                    function( response ) {\r\n                        \r\n                        clearAlertNotification();\r\n                        $form.find( '.megacal-relationship-save-btn' ).prop( 'disabled', true );\r\n                        $form.find( '.megacal-relationship-edit-btn' ).prop( 'disabled', false );\r\n\r\n                        if( false == response.success ) {\r\n                            showAlertNotification( response.data.message, 'error' );\r\n                            return;\r\n                        }\r\n\r\n                        isDirty = false;\r\n\r\n                        $inputs.each( function() {\r\n                            var $this = $( this );\r\n\r\n                            if( $this.attr( 'type' ) === 'checkbox' ) {\r\n                                $( this ).prop( 'disabled', true );\r\n                            } else {\r\n                                $( this ).prop( 'readonly', true );\r\n                            }\r\n                        });\r\n\r\n                    }\r\n    \r\n                )\r\n                .fail( function() {\r\n    \r\n                    clearAlertNotification();\r\n                    showAlertNotification( GENERIC_ERROR_MSG, 'error' );\r\n                    $form.find( '.megacal-relationship-save-btn' ).prop( 'disabled', false );\r\n                    \r\n                });\r\n\r\n            } );\r\n        }\r\n\r\n        var $alertNotice = $( '#alert-notice' );\r\n        var alertState = '';\r\n\r\n        $alertNotice.find( '.alert-notice-close' ).on( 'click', function( e ) {\r\n            e.preventDefault();\r\n            clearAlertNotification();\r\n        } );\r\n\r\n        /**\r\n         * Displays an alert notice\r\n         * \r\n         * @param string msg The message to add to the notice \r\n         * @param string type The type of notice to show - One of 'success', 'error', 'info'. Custom strings can be used and will result in a 'mystring-notice' class. \r\n         */\r\n        function showAlertNotification( msg, type ) {\r\n\r\n            alertState = type + '-notice';\r\n\r\n            $alertNotice.addClass( alertState );\r\n            $alertNotice.find( '.alert-notice-inner' ).html( '<p>' + msg + '</p>' );\r\n            $alertNotice.removeClass( 'hidden' );\r\n\r\n            $( 'html, body' ).animate({ scrollTop: 0 });\r\n\r\n        }\r\n\r\n        function clearAlertNotification() {\r\n\r\n            $alertNotice.addClass( 'hidden' );\r\n            $alertNotice.removeClass( alertState );\r\n            $alertNotice.find( '.alert-notice-inner' ).html( '' );\r\n\r\n        }\r\n\r\n        // Shortcode Fields\r\n        megacalShortcodeFieldUpdate({ \r\n            event_type: 'change', \r\n            field_selector: '#megacal-events-settings-sc #themeSelect', \r\n            shortcode_att: 'theme', \r\n            output_selector: '#megacal-events-settings-sc .shortcode',\r\n            handler: 'val'\r\n        });\r\n\r\n        megacalShortcodeFieldUpdate({\r\n            event_type: 'change', \r\n            field_selector: '#megacal-events-settings-sc #buttonPositions', \r\n            shortcode_att: 'buttons', \r\n            output_selector: '#megacal-events-settings-sc .shortcode',\r\n            handler: 'val'\r\n        });\r\n\r\n        megacalShortcodeFieldUpdate({ \r\n            event_type: 'change', \r\n            field_selector: '#megacal-events-settings-sc #showDesc', \r\n            shortcode_att: 'descrip', \r\n            output_selector: '#megacal-events-settings-sc .shortcode',\r\n            handler: 'checked'\r\n        });\r\n\r\n        megacalShortcodeFieldUpdate({ \r\n            event_type: 'change', \r\n            field_selector: '#megacal-events-settings-sc #displyImgs', \r\n            shortcode_att: 'display', \r\n            output_selector: '#megacal-events-settings-sc .shortcode',\r\n            handler: function( att, shortcode, $element ) {\r\n\r\n                var display = ($element.prop('checked')) ? 'img' : 'text';\r\n                return megacalReplaceShortcodeAtt( att, display, shortcode );\r\n                \r\n            }\r\n        });\r\n\r\n        megacalShortcodeFieldUpdate({ \r\n            event_type: 'change', \r\n            field_selector: '#megacal-events-settings-sc #defaultView', \r\n            shortcode_att: 'view', \r\n            output_selector: '#megacal-events-settings-sc .shortcode',\r\n            handler: 'val'\r\n        });\r\n\r\n        megacalShortcodeFieldUpdate({ \r\n            event_type: 'change', \r\n            field_selector: '#megacal-events-settings-sc #hideView', \r\n            shortcode_att: 'hideview', \r\n            output_selector: '#megacal-events-settings-sc .shortcode',\r\n            handler: 'checked'\r\n        });\r\n\r\n        megacalShortcodeFieldUpdate({  \r\n            event_type: 'change', \r\n            field_selector: '#megacal-events-settings-sc #listStyleSelect', \r\n            shortcode_att: 'style', \r\n            output_selector: '#megacal-events-settings-sc .shortcode',\r\n            handler: 'val',\r\n        });\r\n\r\n        megacalShortcodeFieldUpdate({ \r\n            event_type: 'change', \r\n            field_selector: '#megacal-events-settings-sc #filterCal', \r\n            shortcode_att: 'eventOwner', \r\n            output_selector: '#megacal-events-settings-sc .shortcode',\r\n            handler: function( att, shortcode, $element ) {\r\n\r\n                var id = '';\r\n                var ownerId = 0;\r\n\r\n                ownerId = $element.val();\r\n                id = ( 0 == ownerId ) ? '' : ownerId;\r\n\r\n                return megacalReplaceShortcodeAtt( att, id, shortcode );\r\n\r\n            }\r\n        });\r\n\r\n        megacalShortcodeFieldUpdate({ \r\n            event_type: 'change', \r\n            field_selector: '#megacal-events-settings-sc #filterCat', \r\n            shortcode_att: 'category', \r\n            output_selector: '#megacal-events-settings-sc .shortcode',\r\n            handler: function( att, shortcode, $element ) {\r\n\r\n                var id = '';\r\n                var catId = 0;\r\n\r\n                catId = $element.val();\r\n                id = ( 0 == catId ) ? '' : catId;\r\n\r\n                return megacalReplaceShortcodeAtt( att, id, shortcode );\r\n\r\n            }\r\n        });\r\n\r\n        megacalShortcodeFieldUpdate({  \r\n            event_type: 'change', \r\n            field_selector: '#megacal-events-settings-sc #imgHeight', \r\n            shortcode_att: 'imgHeight', \r\n            output_selector: '#megacal-events-settings-sc .shortcode',\r\n            handler: 'val',\r\n        });\r\n\r\n        megacalShortcodeFieldUpdate({ \r\n            event_type: 'change', \r\n            field_selector: '#megacal-events-settings-sc #showFilters', \r\n            shortcode_att: 'showfilters', \r\n            output_selector: '#megacal-events-settings-sc .shortcode',\r\n            handler: 'checked'\r\n        });\r\n\r\n        var $shortcode_btn = $( '#megacal-insert-shortcode' );\r\n        if( $shortcode_btn.length > 0 ) {\r\n\r\n            $shortcode_btn.on( 'click', function( e ) {\r\n\r\n                e.preventDefault();\r\n\r\n                tb_show( \r\n                    'MegaCal Shortcode Options', \r\n                    ajax_shortcode_options.url\r\n                );\r\n\r\n            });\r\n\r\n            $document.on('click', '#megacal-events-settings-sc .insertShortcode', function(e) {\r\n            \r\n                e.preventDefault();\r\n\r\n                var target = $(this).data('target-class');\r\n\r\n                if( 'undefined' == typeof target ) {\r\n                    console.error( 'no target shortcode field supplied' );\r\n                    return;\r\n                }\r\n\r\n                if( '' == target ) {\r\n                    console.error( 'target cannot be empty' );\r\n                    return;\r\n                }\r\n\r\n                target = '.' + target;\r\n                var copyTextarea = $(target);\r\n\r\n                if( copyTextarea.length > 0 ) {\r\n                 \r\n                    var val = copyTextarea.val();\r\n\r\n                    wp.media.editor.insert( val );\r\n                    tb_remove();\r\n                \r\n                }\r\n\r\n            });\r\n\r\n            // Ehhhhh.....\r\n            // Depending on a mutation observer\r\n            // is undesirable and expensive, but\r\n            // there is no callback after ajax \r\n            // loads in thickbox\r\n            var in_dom = $( '#megacal-events-settings' ).length > 0;\r\n            var observer = new MutationObserver(function( mutations ) {\r\n\r\n                var $loaded_content = $( '#megacal-events-settings' );\r\n\r\n                // Make sure tabs get set up\r\n                // after ajax content loads\r\n                if( $loaded_content.length <= 0 && in_dom ) {\r\n                    \r\n                    in_dom = false;\r\n                    return;\r\n\r\n                } else if( $loaded_content.length > 0 ) {\r\n                \r\n                    if(!in_dom) {\r\n\r\n                        setupAdminTabs( '#megacal-events-settings' );\r\n                        \r\n                        // override thickbox styles...\r\n                        // thickbox doesn't let us dynamically\r\n                        // size content, so this is as good as\r\n                        // this is going to get\r\n                        $('#TB_ajaxContent').css({ \r\n                            width: '100%',\r\n                            height: '100%',\r\n                            padding: 0\r\n                        });\r\n\r\n                        $('#TB_window').css({\r\n                            overflow: 'auto'\r\n                        });\r\n\r\n                    }\r\n\r\n                    in_dom = true;\r\n\r\n                } \r\n             \r\n            });\r\n\r\n            observer.observe( document.body, { childList: true } );\r\n\r\n        }\r\n\r\n        // collapsable sections\r\n        $( document ).on( 'click', '.mega-collapsable-toggle', function() {\r\n\r\n            var $toggle = $( this );\r\n            var $collapsable = $toggle.next( '.mega-collapsable' );\r\n            var slideSpeed = 300;\r\n\r\n            if( $collapsable.hasClass( 'collapsed' ) ) {\r\n                \r\n                $toggle.find( '.icon-chevron-right' ).removeClass( 'icon-chevron-right' ).addClass( 'icon-chevron-down' );\r\n                $toggle.attr( 'aria-pressed', true );\r\n\r\n                $collapsable.slideDown( slideSpeed, function() { \r\n                    $collapsable.removeClass( 'collapsed' );\r\n                } );\r\n\r\n            } else {\r\n\r\n                $toggle.find( '.icon-chevron-down' ).removeClass( 'icon-chevron-down' ).addClass( 'icon-chevron-right' );\r\n                $toggle.attr( 'aria-pressed', false );\r\n\r\n                $collapsable.slideUp( slideSpeed, function() { \r\n                    $collapsable.addClass( 'collapsed' );\r\n                } );\r\n                \r\n            }\r\n\r\n        } );\r\n\r\n    });\r\n\r\n    $( document ).on( 'keyup', '.mega-collapsable-toggle', function( e ) {\r\n\r\n        if( e.key === 'Enter' ) {\r\n            $( this ).trigger( 'click' );\r\n        }\r\n\r\n    } );\r\n\r\n    function setupAdminTabs( selector ) {\r\n\r\n        var tabs = $(selector).find('ul.tabs');\r\n\r\n        if( tabs.length <= 0 || tabs.hasClass('tabs-init') )\r\n            return;\r\n\r\n        tabs.addClass('tabs-init');\r\n        \r\n        tabs.each(function() {\r\n            // For each set of tabs, we want to keep track of\r\n            // which tab is active and its associated content\r\n            var $active, $content, $links = $(this).find('a');\r\n\r\n            // If the location.hash matches one of the links, use that as the active tab.\r\n            // If no match is found, use the first link as the initial active tab.\r\n            $active = $($links.filter('[href=\"'+location.hash+'\"]')[0] || $links[0]);\r\n            $active.addClass('current');\r\n\r\n            $content = $($active[0].hash);\r\n            // Hide the remaining content\r\n            $links.not($active).each(function () {\r\n                $(this.hash).hide();\r\n            });\r\n\r\n            // Bind the click event handler\r\n            $(this).on('click', 'a', function(e){\r\n                // Make the old tab inactive.\r\n                $active.removeClass('current');\r\n                $content.hide();\r\n\r\n                // Update the variables with the new link and content\r\n                $active = $(this);\r\n                $content = $(this.hash);\r\n                // Make the tab active.\r\n                $active.addClass('current');\r\n                $content.show();\r\n\r\n                // Prevent the anchor's default click action\r\n                e.preventDefault();\r\n            });\r\n        });\r\n\r\n    }\r\n\r\n    // Delegate shortcode options event handlers\r\n    function megacalShortcodeFieldUpdate( opts ) {\r\n        \r\n        if( 'object' != typeof opts )\r\n            return false;\r\n\r\n        if( 'undefined' == typeof opts.event_type ) {\r\n            console.error( 'event_type is required by megacalShortcodeFieldUpdate' );\r\n            return false;\r\n        }\r\n\r\n        if( 'undefined' == typeof opts.field_selector ) {\r\n            console.error( 'field_selector is required by megacalShortcodeFieldUpdate' );\r\n            return false;\r\n        }\r\n\r\n        if( 'undefined' == typeof opts.shortcode_att ) {\r\n            console.error( 'shortcode_att is required by megacalShortcodeFieldUpdate');\r\n            return false;\r\n        }\r\n\r\n        if( 'undefined' == typeof opts.output_selector ) {\r\n            console.error( 'output_selector is required by megacalShortcodeFieldUpdate' );\r\n            return false;\r\n        }\r\n\r\n        var opts = {\r\n            event_type: opts.event_type, \r\n            field_selector: opts.field_selector,\r\n            shortcode_att: opts.shortcode_att,\r\n            output_selector: opts.output_selector,\r\n            handler: ( 'undefined' == typeof opts.handler) ? 'val' : opts.handler,\r\n            callback: ( 'undefined' == typeof opts.callback) ? null : opts.callback\r\n        };\r\n\r\n        $document.on( opts.event_type, opts.field_selector, function(e) {\r\n\r\n            var $shortcode_field = $(opts.output_selector)\r\n            var shortcode = $shortcode_field.val();\r\n            var out = shortcode;\r\n\r\n            var default_handler = function( type, att, shortcode, $element ) {\r\n\r\n                if( 'val' != type && 'checked' != type )\r\n                    return shortcode;\r\n\r\n                var val;\r\n\r\n                if( 'val' == type ) {\r\n                    val = $element.val();\r\n                } else if( 'checked' == type ) {\r\n                    val = $element.prop('checked');\r\n                }\r\n    \r\n                return megacalReplaceShortcodeAtt( att, val, shortcode );\r\n\r\n            };\r\n\r\n            if( 'function' == typeof opts.handler )\r\n                out = opts.handler( opts.shortcode_att, shortcode, $(this) );\r\n            else if( 'string' == typeof opts.handler )\r\n                out = default_handler( opts.handler, opts.shortcode_att, shortcode, $(this) );\r\n\r\n            if( 'function' == typeof opts.callback )\r\n                opts.callback( out );\r\n\r\n            $shortcode_field.val( out );\r\n        });\r\n\r\n    }\r\n\r\n    function megacalReplaceShortcodeAtt( att, val, shortcode ) {\r\n\r\n        var shortcode_len = shortcode.length;\r\n        var insert_index = shortcode_len - 1;\r\n        var regex = new RegExp( \"\\\\s\" + att + '=\"[^\"]*\"', 'g' );\r\n\r\n        if( shortcode.indexOf( ' ' + att ) > 0 && '' != val )\r\n            return shortcode.replace( regex, ' ' + att + '=\"' + val + '\"' );\r\n        else if( '' != val )\r\n            return shortcode.substring( 0, insert_index ) + ' ' + att + '=\"' + val + '\"' + shortcode.substring( shortcode_len - 1 );\r\n        else\r\n            return shortcode.replace( regex, '' );\r\n\r\n    }\r\n\r\n    function checkRequiredFields( $form, $submitBtn ) {\r\n      \r\n        var required = $form.find('.required');\r\n        var allValid = true;\r\n    \r\n        required.each(function () {\r\n    \r\n            var $this = $( this );\r\n\r\n            if( !$this.val() ) {\r\n\r\n                if( $this.hasClass( 'select2-hidden-accessible' ) ) {\r\n                    \r\n                    $this.next( '.select2-container' ).removeClass('valid'); \r\n                    $this.next( '.select2-container' ).addClass('invalid');\r\n\r\n                } else {\r\n\r\n                    $this.removeClass('valid'); \r\n                    $this.addClass('invalid');\r\n                \r\n                }\r\n\r\n                allValid = false;\r\n\r\n            } else {\r\n                \r\n                if( $this.hasClass( 'select2-hidden-accessible' ) ) {\r\n                    $this.next( '.select2-container' ).removeClass('invalid');\r\n                } else {\r\n                    $this.removeClass('invalid');\r\n                }\r\n            \r\n            }\r\n    \r\n        });\r\n    \r\n        if (allValid) {\r\n            $submitBtn.prop('disabled', false);\r\n        } else {\r\n            $submitBtn.prop('disabled', true);\r\n        }\r\n\r\n    }\r\n\r\n})(jQuery);\r\n\r\n"]}
  • megabase-calendar/trunk/assets/build/maps/main.min.js.map

    r2914961 r2935728  
    1 {"version":3,"sources":["popper.min.js","rangeslider.min.js","bootstrap-datepicker.min.js","event-calendar.min.js","scripts.js"],"names":["$","GENERIC_ERROR_MSG","showReloadBtn","$container","html","document","ready","length","upcomingEvents","pastEvents","$calendar","date","Date","on","e","preventDefault","window","location","reload","loadEvents","container","listType","currentPage","pluginWrap","closest","eventList","find","preLoader","first","descrip","val","buttons","list_style","nextDateField","list_date","eventOwner","show","console","error","trim","_nonce","prevMonthLabel","last","prevMonth","text","lastEvent","event_list_data","action","post","megacal_script_opts","ajax_url","response","success","hide","append","data","content","$totalPages","parseInt","unbind","click","event","this","parents","toggleClass","stop","slideToggle","next_date","focus","fail","complete","loadCalendarView","$eventCalendar","currentFilter","eventCategories","aMoment","moment","hours","minutes","seconds","milliseconds","startDate","clone","startOf","format","endDate","endOf","eventCalendar","fetchEventsData","events","message","parent","done","each","hasClass","remove","$this","attr","$tab","id","navContainer","liElem","removeClass","addClass","children","$pluginWrap","imgHeight","sliderVal","isNumeric","showImage","showAdd","showLegends","timeFormat","time_fmt_setting","dateFormat","calendar","calendarFirst","slider","value","showSlider","loaderImageUrl","base_url","defaultEventImageUrl","default_image_path","eventId","getPopupData","displayPopupContent","permalink_structure","assign","event_url","url","open","$closestCal","load","view","undefined","jQuery"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;ACLA;AACA;ACDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACPA;ACAA,cAGA,SAAWA,GACT,IACIC,EAAoB,kHAwYxB,SAASC,EAAcC,GACrBA,EAAWC,KAAKH,GAxYlBD,EAAEK,UAAUC,MAAM,WAEhB,GAAIN,EAAE,+BAA+BO,OAAS,EAAG,CAC/C,IAAIC,EAAiBR,EAAE,0BACnBS,EAAaT,EAAE,sBACfU,EAAYV,EAAE,4BACdW,EAAO,IAAIC,KACfZ,EAAEK,UAAUQ,GAAG,QAAS,uBAAwB,SAAUC,GACxDA,EAAEC,iBACFC,OAAOC,SAASC,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IT License (license terms are at http://opensource.org/licenses/MIT).\n */(function(e,t){'object'==typeof exports&&'undefined'!=typeof module?module.exports=t():'function'==typeof define&&define.amd?define(t):e.Popper=t()})(this,function(){'use strict';function e(e){return e&&'[object Function]'==={}.toString.call(e)}function t(e,t){if(1!==e.nodeType)return[];var o=e.ownerDocument.defaultView,n=o.getComputedStyle(e,null);return t?n[t]:n}function o(e){return'HTML'===e.nodeName?e:e.parentNode||e.host}function n(e){if(!e)return document.body;switch(e.nodeName){case'HTML':case'BODY':return e.ownerDocument.body;case'#document':return e.body;}var i=t(e),r=i.overflow,p=i.overflowX,s=i.overflowY;return /(auto|scroll|overlay)/.test(r+s+p)?e:n(o(e))}function i(e){return e&&e.referenceNode?e.referenceNode:e}function r(e){return 11===e?re:10===e?pe:re||pe}function p(e){if(!e)return document.documentElement;for(var o=r(10)?document.body:null,n=e.offsetParent||null;n===o&&e.nextElementSibling;)n=(e=e.nextElementSibling).offsetParent;var i=n&&n.nodeName;return i&&'BODY'!==i&&'HTML'!==i?-1!==['TH','TD','TABLE'].indexOf(n.nodeName)&&'static'===t(n,'position')?p(n):n:e?e.ownerDocument.documentElement:document.documentElement}function s(e){var t=e.nodeName;return'BODY'!==t&&('HTML'===t||p(e.firstElementChild)===e)}function d(e){return null===e.parentNode?e:d(e.parentNode)}function a(e,t){if(!e||!e.nodeType||!t||!t.nodeType)return document.documentElement;var o=e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING,n=o?e:t,i=o?t:e,r=document.createRange();r.setStart(n,0),r.setEnd(i,0);var l=r.commonAncestorContainer;if(e!==l&&t!==l||n.contains(i))return s(l)?l:p(l);var f=d(e);return f.host?a(f.host,t):a(e,d(t).host)}function l(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:'top',o='top'===t?'scrollTop':'scrollLeft',n=e.nodeName;if('BODY'===n||'HTML'===n){var i=e.ownerDocument.documentElement,r=e.ownerDocument.scrollingElement||i;return r[o]}return e[o]}function f(e,t){var o=2<arguments.length&&void 0!==arguments[2]&&arguments[2],n=l(t,'top'),i=l(t,'left'),r=o?-1:1;return e.top+=n*r,e.bottom+=n*r,e.left+=i*r,e.right+=i*r,e}function m(e,t){var o='x'===t?'Left':'Top',n='Left'==o?'Right':'Bottom';return parseFloat(e['border'+o+'Width'])+parseFloat(e['border'+n+'Width'])}function h(e,t,o,n){return ee(t['offset'+e],t['scroll'+e],o['client'+e],o['offset'+e],o['scroll'+e],r(10)?parseInt(o['offset'+e])+parseInt(n['margin'+('Height'===e?'Top':'Left')])+parseInt(n['margin'+('Height'===e?'Bottom':'Right')]):0)}function c(e){var t=e.body,o=e.documentElement,n=r(10)&&getComputedStyle(o);return{height:h('Height',t,o,n),width:h('Width',t,o,n)}}function g(e){return le({},e,{right:e.left+e.width,bottom:e.top+e.height})}function u(e){var o={};try{if(r(10)){o=e.getBoundingClientRect();var n=l(e,'top'),i=l(e,'left');o.top+=n,o.left+=i,o.bottom+=n,o.right+=i}else o=e.getBoundingClientRect()}catch(t){}var p={left:o.left,top:o.top,width:o.right-o.left,height:o.bottom-o.top},s='HTML'===e.nodeName?c(e.ownerDocument):{},d=s.width||e.clientWidth||p.width,a=s.height||e.clientHeight||p.height,f=e.offsetWidth-d,h=e.offsetHeight-a;if(f||h){var u=t(e);f-=m(u,'x'),h-=m(u,'y'),p.width-=f,p.height-=h}return g(p)}function b(e,o){var i=2<arguments.length&&void 0!==arguments[2]&&arguments[2],p=r(10),s='HTML'===o.nodeName,d=u(e),a=u(o),l=n(e),m=t(o),h=parseFloat(m.borderTopWidth),c=parseFloat(m.borderLeftWidth);i&&s&&(a.top=ee(a.top,0),a.left=ee(a.left,0));var b=g({top:d.top-a.top-h,left:d.left-a.left-c,width:d.width,height:d.height});if(b.marginTop=0,b.marginLeft=0,!p&&s){var w=parseFloat(m.marginTop),y=parseFloat(m.marginLeft);b.top-=h-w,b.bottom-=h-w,b.left-=c-y,b.right-=c-y,b.marginTop=w,b.marginLeft=y}return(p&&!i?o.contains(l):o===l&&'BODY'!==l.nodeName)&&(b=f(b,o)),b}function w(e){var t=1<arguments.length&&void 0!==arguments[1]&&arguments[1],o=e.ownerDocument.documentElement,n=b(e,o),i=ee(o.clientWidth,window.innerWidth||0),r=ee(o.clientHeight,window.innerHeight||0),p=t?0:l(o),s=t?0:l(o,'left'),d={top:p-n.top+n.marginTop,left:s-n.left+n.marginLeft,width:i,height:r};return g(d)}function y(e){var n=e.nodeName;if('BODY'===n||'HTML'===n)return!1;if('fixed'===t(e,'position'))return!0;var i=o(e);return!!i&&y(i)}function E(e){if(!e||!e.parentElement||r())return document.documentElement;for(var o=e.parentElement;o&&'none'===t(o,'transform');)o=o.parentElement;return o||document.documentElement}function v(e,t,r,p){var s=4<arguments.length&&void 0!==arguments[4]&&arguments[4],d={top:0,left:0},l=s?E(e):a(e,i(t));if('viewport'===p)d=w(l,s);else{var f;'scrollParent'===p?(f=n(o(t)),'BODY'===f.nodeName&&(f=e.ownerDocument.documentElement)):'window'===p?f=e.ownerDocument.documentElement:f=p;var m=b(f,l,s);if('HTML'===f.nodeName&&!y(l)){var h=c(e.ownerDocument),g=h.height,u=h.width;d.top+=m.top-m.marginTop,d.bottom=g+m.top,d.left+=m.left-m.marginLeft,d.right=u+m.left}else d=m}r=r||0;var v='number'==typeof r;return d.left+=v?r:r.left||0,d.top+=v?r:r.top||0,d.right-=v?r:r.right||0,d.bottom-=v?r:r.bottom||0,d}function x(e){var t=e.width,o=e.height;return t*o}function O(e,t,o,n,i){var r=5<arguments.length&&void 0!==arguments[5]?arguments[5]:0;if(-1===e.indexOf('auto'))return e;var p=v(o,n,r,i),s={top:{width:p.width,height:t.top-p.top},right:{width:p.right-t.right,height:p.height},bottom:{width:p.width,height:p.bottom-t.bottom},left:{width:t.left-p.left,height:p.height}},d=Object.keys(s).map(function(e){return le({key:e},s[e],{area:x(s[e])})}).sort(function(e,t){return t.area-e.area}),a=d.filter(function(e){var t=e.width,n=e.height;return t>=o.clientWidth&&n>=o.clientHeight}),l=0<a.length?a[0].key:d[0].key,f=e.split('-')[1];return l+(f?'-'+f:'')}function L(e,t,o){var n=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null,r=n?E(t):a(t,i(o));return b(o,r,n)}function S(e){var t=e.ownerDocument.defaultView,o=t.getComputedStyle(e),n=parseFloat(o.marginTop||0)+parseFloat(o.marginBottom||0),i=parseFloat(o.marginLeft||0)+parseFloat(o.marginRight||0),r={width:e.offsetWidth+i,height:e.offsetHeight+n};return r}function T(e){var t={left:'right',right:'left',bottom:'top',top:'bottom'};return e.replace(/left|right|bottom|top/g,function(e){return t[e]})}function C(e,t,o){o=o.split('-')[0];var n=S(e),i={width:n.width,height:n.height},r=-1!==['right','left'].indexOf(o),p=r?'top':'left',s=r?'left':'top',d=r?'height':'width',a=r?'width':'height';return i[p]=t[p]+t[d]/2-n[d]/2,i[s]=o===s?t[s]-n[a]:t[T(s)],i}function D(e,t){return Array.prototype.find?e.find(t):e.filter(t)[0]}function N(e,t,o){if(Array.prototype.findIndex)return e.findIndex(function(e){return e[t]===o});var n=D(e,function(e){return e[t]===o});return e.indexOf(n)}function P(t,o,n){var i=void 0===n?t:t.slice(0,N(t,'name',n));return i.forEach(function(t){t['function']&&console.warn('`modifier.function` is deprecated, use `modifier.fn`!');var n=t['function']||t.fn;t.enabled&&e(n)&&(o.offsets.popper=g(o.offsets.popper),o.offsets.reference=g(o.offsets.reference),o=n(o,t))}),o}function k(){if(!this.state.isDestroyed){var e={instance:this,styles:{},arrowStyles:{},attributes:{},flipped:!1,offsets:{}};e.offsets.reference=L(this.state,this.popper,this.reference,this.options.positionFixed),e.placement=O(this.options.placement,e.offsets.reference,this.popper,this.reference,this.options.modifiers.flip.boundariesElement,this.options.modifiers.flip.padding),e.originalPlacement=e.placement,e.positionFixed=this.options.positionFixed,e.offsets.popper=C(this.popper,e.offsets.reference,e.placement),e.offsets.popper.position=this.options.positionFixed?'fixed':'absolute',e=P(this.modifiers,e),this.state.isCreated?this.options.onUpdate(e):(this.state.isCreated=!0,this.options.onCreate(e))}}function W(e,t){return e.some(function(e){var o=e.name,n=e.enabled;return n&&o===t})}function B(e){for(var t=[!1,'ms','Webkit','Moz','O'],o=e.charAt(0).toUpperCase()+e.slice(1),n=0;n<t.length;n++){var i=t[n],r=i?''+i+o:e;if('undefined'!=typeof document.body.style[r])return r}return null}function H(){return this.state.isDestroyed=!0,W(this.modifiers,'applyStyle')&&(this.popper.removeAttribute('x-placement'),this.popper.style.position='',this.popper.style.top='',this.popper.style.left='',this.popper.style.right='',this.popper.style.bottom='',this.popper.style.willChange='',this.popper.style[B('transform')]=''),this.disableEventListeners(),this.options.removeOnDestroy&&this.popper.parentNode.removeChild(this.popper),this}function A(e){var t=e.ownerDocument;return t?t.defaultView:window}function M(e,t,o,i){var r='BODY'===e.nodeName,p=r?e.ownerDocument.defaultView:e;p.addEventListener(t,o,{passive:!0}),r||M(n(p.parentNode),t,o,i),i.push(p)}function F(e,t,o,i){o.updateBound=i,A(e).addEventListener('resize',o.updateBound,{passive:!0});var r=n(e);return M(r,'scroll',o.updateBound,o.scrollParents),o.scrollElement=r,o.eventsEnabled=!0,o}function I(){this.state.eventsEnabled||(this.state=F(this.reference,this.options,this.state,this.scheduleUpdate))}function R(e,t){return A(e).removeEventListener('resize',t.updateBound),t.scrollParents.forEach(function(e){e.removeEventListener('scroll',t.updateBound)}),t.updateBound=null,t.scrollParents=[],t.scrollElement=null,t.eventsEnabled=!1,t}function U(){this.state.eventsEnabled&&(cancelAnimationFrame(this.scheduleUpdate),this.state=R(this.reference,this.state))}function Y(e){return''!==e&&!isNaN(parseFloat(e))&&isFinite(e)}function V(e,t){Object.keys(t).forEach(function(o){var n='';-1!==['width','height','top','right','bottom','left'].indexOf(o)&&Y(t[o])&&(n='px'),e.style[o]=t[o]+n})}function j(e,t){Object.keys(t).forEach(function(o){var n=t[o];!1===n?e.removeAttribute(o):e.setAttribute(o,t[o])})}function q(e,t){var o=e.offsets,n=o.popper,i=o.reference,r=$,p=function(e){return e},s=r(i.width),d=r(n.width),a=-1!==['left','right'].indexOf(e.placement),l=-1!==e.placement.indexOf('-'),f=t?a||l||s%2==d%2?r:Z:p,m=t?r:p;return{left:f(1==s%2&&1==d%2&&!l&&t?n.left-1:n.left),top:m(n.top),bottom:m(n.bottom),right:f(n.right)}}function K(e,t,o){var n=D(e,function(e){var o=e.name;return o===t}),i=!!n&&e.some(function(e){return e.name===o&&e.enabled&&e.order<n.order});if(!i){var r='`'+t+'`';console.warn('`'+o+'`'+' modifier is required by '+r+' modifier in order to work, be sure to include it before '+r+'!')}return i}function z(e){return'end'===e?'start':'start'===e?'end':e}function G(e){var t=1<arguments.length&&void 0!==arguments[1]&&arguments[1],o=he.indexOf(e),n=he.slice(o+1).concat(he.slice(0,o));return t?n.reverse():n}function _(e,t,o,n){var i=e.match(/((?:\\-|\\+)?\\d*\\.?\\d*)(.*)/),r=+i[1],p=i[2];if(!r)return e;if(0===p.indexOf('%')){var s;switch(p){case'%p':s=o;break;case'%':case'%r':default:s=n;}var d=g(s);return d[t]/100*r}if('vh'===p||'vw'===p){var a;return a='vh'===p?ee(document.documentElement.clientHeight,window.innerHeight||0):ee(document.documentElement.clientWidth,window.innerWidth||0),a/100*r}return r}function X(e,t,o,n){var i=[0,0],r=-1!==['right','left'].indexOf(n),p=e.split(/(\\+|\\-)/).map(function(e){return e.trim()}),s=p.indexOf(D(p,function(e){return-1!==e.search(/,|\\s/)}));p[s]&&-1===p[s].indexOf(',')&&console.warn('Offsets separated by white space(s) are deprecated, use a comma (,) instead.');var d=/\\s*,\\s*|\\s+/,a=-1===s?[p]:[p.slice(0,s).concat([p[s].split(d)[0]]),[p[s].split(d)[1]].concat(p.slice(s+1))];return a=a.map(function(e,n){var i=(1===n?!r:r)?'height':'width',p=!1;return e.reduce(function(e,t){return''===e[e.length-1]&&-1!==['+','-'].indexOf(t)?(e[e.length-1]=t,p=!0,e):p?(e[e.length-1]+=t,p=!1,e):e.concat(t)},[]).map(function(e){return _(e,i,t,o)})}),a.forEach(function(e,t){e.forEach(function(o,n){Y(o)&&(i[t]+=o*('-'===e[n-1]?-1:1))})}),i}function J(e,t){var o,n=t.offset,i=e.placement,r=e.offsets,p=r.popper,s=r.reference,d=i.split('-')[0];return o=Y(+n)?[+n,0]:X(n,p,s,d),'left'===d?(p.top+=o[0],p.left-=o[1]):'right'===d?(p.top+=o[0],p.left+=o[1]):'top'===d?(p.left+=o[0],p.top-=o[1]):'bottom'===d&&(p.left+=o[0],p.top+=o[1]),e.popper=p,e}var Q=Math.min,Z=Math.floor,$=Math.round,ee=Math.max,te='undefined'!=typeof window&&'undefined'!=typeof document&&'undefined'!=typeof navigator,oe=function(){for(var e=['Edge','Trident','Firefox'],t=0;t<e.length;t+=1)if(te&&0<=navigator.userAgent.indexOf(e[t]))return 1;return 0}(),ne=te&&window.Promise,ie=ne?function(e){var t=!1;return function(){t||(t=!0,window.Promise.resolve().then(function(){t=!1,e()}))}}:function(e){var t=!1;return function(){t||(t=!0,setTimeout(function(){t=!1,e()},oe))}},re=te&&!!(window.MSInputMethodContext&&document.documentMode),pe=te&&/MSIE 10/.test(navigator.userAgent),se=function(e,t){if(!(e instanceof t))throw new TypeError('Cannot call a class as a function')},de=function(){function e(e,t){for(var o,n=0;n<t.length;n++)o=t[n],o.enumerable=o.enumerable||!1,o.configurable=!0,'value'in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}return function(t,o,n){return o&&e(t.prototype,o),n&&e(t,n),t}}(),ae=function(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e},le=Object.assign||function(e){for(var t,o=1;o<arguments.length;o++)for(var n in t=arguments[o],t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},fe=te&&/Firefox/i.test(navigator.userAgent),me=['auto-start','auto','auto-end','top-start','top','top-end','right-start','right','right-end','bottom-end','bottom','bottom-start','left-end','left','left-start'],he=me.slice(3),ce={FLIP:'flip',CLOCKWISE:'clockwise',COUNTERCLOCKWISE:'counterclockwise'},ge=function(){function t(o,n){var i=this,r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{};se(this,t),this.scheduleUpdate=function(){return requestAnimationFrame(i.update)},this.update=ie(this.update.bind(this)),this.options=le({},t.Defaults,r),this.state={isDestroyed:!1,isCreated:!1,scrollParents:[]},this.reference=o&&o.jquery?o[0]:o,this.popper=n&&n.jquery?n[0]:n,this.options.modifiers={},Object.keys(le({},t.Defaults.modifiers,r.modifiers)).forEach(function(e){i.options.modifiers[e]=le({},t.Defaults.modifiers[e]||{},r.modifiers?r.modifiers[e]:{})}),this.modifiers=Object.keys(this.options.modifiers).map(function(e){return le({name:e},i.options.modifiers[e])}).sort(function(e,t){return e.order-t.order}),this.modifiers.forEach(function(t){t.enabled&&e(t.onLoad)&&t.onLoad(i.reference,i.popper,i.options,t,i.state)}),this.update();var p=this.options.eventsEnabled;p&&this.enableEventListeners(),this.state.eventsEnabled=p}return de(t,[{key:'update',value:function(){return k.call(this)}},{key:'destroy',value:function(){return H.call(this)}},{key:'enableEventListeners',value:function(){return I.call(this)}},{key:'disableEventListeners',value:function(){return U.call(this)}}]),t}();return ge.Utils=('undefined'==typeof window?global:window).PopperUtils,ge.placements=me,ge.Defaults={placement:'bottom',positionFixed:!1,eventsEnabled:!0,removeOnDestroy:!1,onCreate:function(){},onUpdate:function(){},modifiers:{shift:{order:100,enabled:!0,fn:function(e){var t=e.placement,o=t.split('-')[0],n=t.split('-')[1];if(n){var i=e.offsets,r=i.reference,p=i.popper,s=-1!==['bottom','top'].indexOf(o),d=s?'left':'top',a=s?'width':'height',l={start:ae({},d,r[d]),end:ae({},d,r[d]+r[a]-p[a])};e.offsets.popper=le({},p,l[n])}return e}},offset:{order:200,enabled:!0,fn:J,offset:0},preventOverflow:{order:300,enabled:!0,fn:function(e,t){var o=t.boundariesElement||p(e.instance.popper);e.instance.reference===o&&(o=p(o));var n=B('transform'),i=e.instance.popper.style,r=i.top,s=i.left,d=i[n];i.top='',i.left='',i[n]='';var a=v(e.instance.popper,e.instance.reference,t.padding,o,e.positionFixed);i.top=r,i.left=s,i[n]=d,t.boundaries=a;var l=t.priority,f=e.offsets.popper,m={primary:function(e){var o=f[e];return f[e]<a[e]&&!t.escapeWithReference&&(o=ee(f[e],a[e])),ae({},e,o)},secondary:function(e){var o='right'===e?'left':'top',n=f[o];return f[e]>a[e]&&!t.escapeWithReference&&(n=Q(f[o],a[e]-('right'===e?f.width:f.height))),ae({},o,n)}};return l.forEach(function(e){var t=-1===['left','top'].indexOf(e)?'secondary':'primary';f=le({},f,m[t](e))}),e.offsets.popper=f,e},priority:['left','right','top','bottom'],padding:5,boundariesElement:'scrollParent'},keepTogether:{order:400,enabled:!0,fn:function(e){var t=e.offsets,o=t.popper,n=t.reference,i=e.placement.split('-')[0],r=Z,p=-1!==['top','bottom'].indexOf(i),s=p?'right':'bottom',d=p?'left':'top',a=p?'width':'height';return o[s]<r(n[d])&&(e.offsets.popper[d]=r(n[d])-o[a]),o[d]>r(n[s])&&(e.offsets.popper[d]=r(n[s])),e}},arrow:{order:500,enabled:!0,fn:function(e,o){var n;if(!K(e.instance.modifiers,'arrow','keepTogether'))return e;var i=o.element;if('string'==typeof i){if(i=e.instance.popper.querySelector(i),!i)return e;}else if(!e.instance.popper.contains(i))return console.warn('WARNING: `arrow.element` must be child of its popper element!'),e;var r=e.placement.split('-')[0],p=e.offsets,s=p.popper,d=p.reference,a=-1!==['left','right'].indexOf(r),l=a?'height':'width',f=a?'Top':'Left',m=f.toLowerCase(),h=a?'left':'top',c=a?'bottom':'right',u=S(i)[l];d[c]-u<s[m]&&(e.offsets.popper[m]-=s[m]-(d[c]-u)),d[m]+u>s[c]&&(e.offsets.popper[m]+=d[m]+u-s[c]),e.offsets.popper=g(e.offsets.popper);var b=d[m]+d[l]/2-u/2,w=t(e.instance.popper),y=parseFloat(w['margin'+f]),E=parseFloat(w['border'+f+'Width']),v=b-e.offsets.popper[m]-y-E;return v=ee(Q(s[l]-u,v),0),e.arrowElement=i,e.offsets.arrow=(n={},ae(n,m,$(v)),ae(n,h,''),n),e},element:'[x-arrow]'},flip:{order:600,enabled:!0,fn:function(e,t){if(W(e.instance.modifiers,'inner'))return e;if(e.flipped&&e.placement===e.originalPlacement)return e;var o=v(e.instance.popper,e.instance.reference,t.padding,t.boundariesElement,e.positionFixed),n=e.placement.split('-')[0],i=T(n),r=e.placement.split('-')[1]||'',p=[];switch(t.behavior){case ce.FLIP:p=[n,i];break;case ce.CLOCKWISE:p=G(n);break;case ce.COUNTERCLOCKWISE:p=G(n,!0);break;default:p=t.behavior;}return p.forEach(function(s,d){if(n!==s||p.length===d+1)return e;n=e.placement.split('-')[0],i=T(n);var a=e.offsets.popper,l=e.offsets.reference,f=Z,m='left'===n&&f(a.right)>f(l.left)||'right'===n&&f(a.left)<f(l.right)||'top'===n&&f(a.bottom)>f(l.top)||'bottom'===n&&f(a.top)<f(l.bottom),h=f(a.left)<f(o.left),c=f(a.right)>f(o.right),g=f(a.top)<f(o.top),u=f(a.bottom)>f(o.bottom),b='left'===n&&h||'right'===n&&c||'top'===n&&g||'bottom'===n&&u,w=-1!==['top','bottom'].indexOf(n),y=!!t.flipVariations&&(w&&'start'===r&&h||w&&'end'===r&&c||!w&&'start'===r&&g||!w&&'end'===r&&u),E=!!t.flipVariationsByContent&&(w&&'start'===r&&c||w&&'end'===r&&h||!w&&'start'===r&&u||!w&&'end'===r&&g),v=y||E;(m||b||v)&&(e.flipped=!0,(m||b)&&(n=p[d+1]),v&&(r=z(r)),e.placement=n+(r?'-'+r:''),e.offsets.popper=le({},e.offsets.popper,C(e.instance.popper,e.offsets.reference,e.placement)),e=P(e.instance.modifiers,e,'flip'))}),e},behavior:'flip',padding:5,boundariesElement:'viewport',flipVariations:!1,flipVariationsByContent:!1},inner:{order:700,enabled:!1,fn:function(e){var t=e.placement,o=t.split('-')[0],n=e.offsets,i=n.popper,r=n.reference,p=-1!==['left','right'].indexOf(o),s=-1===['top','left'].indexOf(o);return i[p?'left':'top']=r[o]-(s?i[p?'width':'height']:0),e.placement=T(t),e.offsets.popper=g(i),e}},hide:{order:800,enabled:!0,fn:function(e){if(!K(e.instance.modifiers,'hide','preventOverflow'))return e;var t=e.offsets.reference,o=D(e.instance.modifiers,function(e){return'preventOverflow'===e.name}).boundaries;if(t.bottom<o.top||t.left>o.right||t.top>o.bottom||t.right<o.left){if(!0===e.hide)return e;e.hide=!0,e.attributes['x-out-of-boundaries']=''}else{if(!1===e.hide)return e;e.hide=!1,e.attributes['x-out-of-boundaries']=!1}return e}},computeStyle:{order:850,enabled:!0,fn:function(e,t){var o=t.x,n=t.y,i=e.offsets.popper,r=D(e.instance.modifiers,function(e){return'applyStyle'===e.name}).gpuAcceleration;void 0!==r&&console.warn('WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!');var s,d,a=void 0===r?t.gpuAcceleration:r,l=p(e.instance.popper),f=u(l),m={position:i.position},h=q(e,2>window.devicePixelRatio||!fe),c='bottom'===o?'top':'bottom',g='right'===n?'left':'right',b=B('transform');if(d='bottom'==c?'HTML'===l.nodeName?-l.clientHeight+h.bottom:-f.height+h.bottom:h.top,s='right'==g?'HTML'===l.nodeName?-l.clientWidth+h.right:-f.width+h.right:h.left,a&&b)m[b]='translate3d('+s+'px, '+d+'px, 0)',m[c]=0,m[g]=0,m.willChange='transform';else{var w='bottom'==c?-1:1,y='right'==g?-1:1;m[c]=d*w,m[g]=s*y,m.willChange=c+', '+g}var E={\"x-placement\":e.placement};return e.attributes=le({},E,e.attributes),e.styles=le({},m,e.styles),e.arrowStyles=le({},e.offsets.arrow,e.arrowStyles),e},gpuAcceleration:!0,x:'bottom',y:'right'},applyStyle:{order:900,enabled:!0,fn:function(e){return V(e.instance.popper,e.styles),j(e.instance.popper,e.attributes),e.arrowElement&&Object.keys(e.arrowStyles).length&&V(e.arrowElement,e.arrowStyles),e},onLoad:function(e,t,o,n,i){var r=L(i,t,e,o.positionFixed),p=O(o.placement,r,t,e,o.modifiers.flip.boundariesElement,o.modifiers.flip.padding);return t.setAttribute('x-placement',p),V(t,{position:o.positionFixed?'fixed':'absolute'}),o},gpuAcceleration:void 0}}},ge});\n//# sourceMappingURL=popper.min.js.map\n","/*! rangeslider.js - v2.3.2 | (c) 2018 @andreruffert | MIT license | https://github.com/andreruffert/rangeslider.js */\n!function(a){\"use strict\";\"function\"==typeof define&&define.amd?define([\"jquery\"],a):\"object\"==typeof exports?module.exports=a(require(\"jquery\")):a(jQuery)}(function(a){\"use strict\";function b(){var a=document.createElement(\"input\");return a.setAttribute(\"type\",\"range\"),\"text\"!==a.type}function c(a,b){var c=Array.prototype.slice.call(arguments,2);return setTimeout(function(){return a.apply(null,c)},b)}function d(a,b){return b=b||100,function(){if(!a.debouncing){var c=Array.prototype.slice.apply(arguments);a.lastReturnVal=a.apply(window,c),a.debouncing=!0}return clearTimeout(a.debounceTimeout),a.debounceTimeout=setTimeout(function(){a.debouncing=!1},b),a.lastReturnVal}}function e(a){return a&&(0===a.offsetWidth||0===a.offsetHeight||!1===a.open)}function f(a){for(var b=[],c=a.parentNode;e(c);)b.push(c),c=c.parentNode;return b}function g(a,b){function c(a){void 0!==a.open&&(a.open=!a.open)}var d=f(a),e=d.length,g=[],h=a[b];if(e){for(var i=0;i<e;i++)g[i]=d[i].style.cssText,d[i].style.setProperty?d[i].style.setProperty(\"display\",\"block\",\"important\"):d[i].style.cssText+=\";display: block !important\",d[i].style.height=\"0\",d[i].style.overflow=\"hidden\",d[i].style.visibility=\"hidden\",c(d[i]);h=a[b];for(var j=0;j<e;j++)d[j].style.cssText=g[j],c(d[j])}return h}function h(a,b){var c=parseFloat(a);return Number.isNaN(c)?b:c}function i(a){return a.charAt(0).toUpperCase()+a.substr(1)}function j(b,e){if(this.$window=a(window),this.$document=a(document),this.$element=a(b),this.options=a.extend({},n,e),this.polyfill=this.options.polyfill,this.orientation=this.$element[0].getAttribute(\"data-orientation\")||this.options.orientation,this.onInit=this.options.onInit,this.onSlide=this.options.onSlide,this.onSlideEnd=this.options.onSlideEnd,this.DIMENSION=o.orientation[this.orientation].dimension,this.DIRECTION=o.orientation[this.orientation].direction,this.DIRECTION_STYLE=o.orientation[this.orientation].directionStyle,this.COORDINATE=o.orientation[this.orientation].coordinate,this.polyfill&&m)return!1;this.identifier=\"js-\"+k+\"-\"+l++,this.startEvent=this.options.startEvent.join(\".\"+this.identifier+\" \")+\".\"+this.identifier,this.moveEvent=this.options.moveEvent.join(\".\"+this.identifier+\" \")+\".\"+this.identifier,this.endEvent=this.options.endEvent.join(\".\"+this.identifier+\" \")+\".\"+this.identifier,this.toFixed=(this.step+\"\").replace(\".\",\"\").length-1,this.$fill=a('<div class=\"'+this.options.fillClass+'\" />'),this.$handle=a('<div class=\"'+this.options.handleClass+'\" />'),this.$range=a('<div class=\"'+this.options.rangeClass+\" \"+this.options[this.orientation+\"Class\"]+'\" id=\"'+this.identifier+'\" />').insertAfter(this.$element).prepend(this.$fill,this.$handle),this.$element.css({position:\"absolute\",width:\"1px\",height:\"1px\",overflow:\"hidden\",opacity:\"0\"}),this.handleDown=a.proxy(this.handleDown,this),this.handleMove=a.proxy(this.handleMove,this),this.handleEnd=a.proxy(this.handleEnd,this),this.init();var f=this;this.$window.on(\"resize.\"+this.identifier,d(function(){c(function(){f.update(!1,!1)},300)},20)),this.$document.on(this.startEvent,\"#\"+this.identifier+\":not(.\"+this.options.disabledClass+\")\",this.handleDown),this.$element.on(\"change.\"+this.identifier,function(a,b){if(!b||b.origin!==f.identifier){var c=a.target.value,d=f.getPositionFromValue(c);f.setPosition(d)}})}Number.isNaN=Number.isNaN||function(a){return\"number\"==typeof a&&a!==a};var k=\"rangeslider\",l=0,m=b(),n={polyfill:!0,orientation:\"horizontal\",rangeClass:\"rangeslider\",disabledClass:\"rangeslider--disabled\",activeClass:\"rangeslider--active\",horizontalClass:\"rangeslider--horizontal\",verticalClass:\"rangeslider--vertical\",fillClass:\"rangeslider__fill\",handleClass:\"rangeslider__handle\",startEvent:[\"mousedown\",\"touchstart\",\"pointerdown\"],moveEvent:[\"mousemove\",\"touchmove\",\"pointermove\"],endEvent:[\"mouseup\",\"touchend\",\"pointerup\"]},o={orientation:{horizontal:{dimension:\"width\",direction:\"left\",directionStyle:\"left\",coordinate:\"x\"},vertical:{dimension:\"height\",direction:\"top\",directionStyle:\"bottom\",coordinate:\"y\"}}};return j.prototype.init=function(){this.update(!0,!1),this.onInit&&\"function\"==typeof this.onInit&&this.onInit()},j.prototype.update=function(a,b){a=a||!1,a&&(this.min=h(this.$element[0].getAttribute(\"min\"),0),this.max=h(this.$element[0].getAttribute(\"max\"),100),this.value=h(this.$element[0].value,Math.round(this.min+(this.max-this.min)/2)),this.step=h(this.$element[0].getAttribute(\"step\"),1)),this.handleDimension=g(this.$handle[0],\"offset\"+i(this.DIMENSION)),this.rangeDimension=g(this.$range[0],\"offset\"+i(this.DIMENSION)),this.maxHandlePos=this.rangeDimension-this.handleDimension,this.grabPos=this.handleDimension/2,this.position=this.getPositionFromValue(this.value),this.$element[0].disabled?this.$range.addClass(this.options.disabledClass):this.$range.removeClass(this.options.disabledClass),this.setPosition(this.position,b)},j.prototype.handleDown=function(a){if(a.preventDefault(),!(a.button&&0!==a.button||(this.$document.on(this.moveEvent,this.handleMove),this.$document.on(this.endEvent,this.handleEnd),this.$range.addClass(this.options.activeClass),(\" \"+a.target.className+\" \").replace(/[\\n\\t]/g,\" \").indexOf(this.options.handleClass)>-1))){var b=this.getRelativePosition(a),c=this.$range[0].getBoundingClientRect()[this.DIRECTION],d=this.getPositionFromNode(this.$handle[0])-c,e=\"vertical\"===this.orientation?this.maxHandlePos-(b-this.grabPos):b-this.grabPos;this.setPosition(e),b>=d&&b<d+this.handleDimension&&(this.grabPos=b-d)}},j.prototype.handleMove=function(a){a.preventDefault();var b=this.getRelativePosition(a),c=\"vertical\"===this.orientation?this.maxHandlePos-(b-this.grabPos):b-this.grabPos;this.setPosition(c)},j.prototype.handleEnd=function(a){a.preventDefault(),this.$document.off(this.moveEvent,this.handleMove),this.$document.off(this.endEvent,this.handleEnd),this.$range.removeClass(this.options.activeClass),this.$element.trigger(\"change\",{origin:this.identifier}),this.onSlideEnd&&\"function\"==typeof this.onSlideEnd&&this.onSlideEnd(this.position,this.value)},j.prototype.cap=function(a,b,c){return a<b?b:a>c?c:a},j.prototype.setPosition=function(a,b){var c,d;void 0===b&&(b=!0),c=this.getValueFromPosition(this.cap(a,0,this.maxHandlePos)),d=this.getPositionFromValue(c),this.$fill[0].style[this.DIMENSION]=d+this.grabPos+\"px\",this.$handle[0].style[this.DIRECTION_STYLE]=d+\"px\",this.setValue(c),this.position=d,this.value=c,b&&this.onSlide&&\"function\"==typeof this.onSlide&&this.onSlide(d,c)},j.prototype.getPositionFromNode=function(a){for(var b=0;null!==a;)b+=a.offsetLeft,a=a.offsetParent;return b},j.prototype.getRelativePosition=function(a){var b=i(this.COORDINATE),c=this.$range[0].getBoundingClientRect()[this.DIRECTION],d=0;return void 0!==a.originalEvent[\"client\"+b]?d=a.originalEvent[\"client\"+b]:a.originalEvent.touches&&a.originalEvent.touches[0]&&void 0!==a.originalEvent.touches[0][\"client\"+b]?d=a.originalEvent.touches[0][\"client\"+b]:a.currentPoint&&void 0!==a.currentPoint[this.COORDINATE]&&(d=a.currentPoint[this.COORDINATE]),d-c},j.prototype.getPositionFromValue=function(a){var b;return b=(a-this.min)/(this.max-this.min),Number.isNaN(b)?0:b*this.maxHandlePos},j.prototype.getValueFromPosition=function(a){var b,c;return b=a/(this.maxHandlePos||1),c=this.step*Math.round(b*(this.max-this.min)/this.step)+this.min,Number(c.toFixed(this.toFixed))},j.prototype.setValue=function(a){a===this.value&&\"\"!==this.$element[0].value||this.$element.val(a).trigger(\"input\",{origin:this.identifier})},j.prototype.destroy=function(){this.$document.off(\".\"+this.identifier),this.$window.off(\".\"+this.identifier),this.$element.off(\".\"+this.identifier).removeAttr(\"style\").removeData(\"plugin_\"+k),this.$range&&this.$range.length&&this.$range[0].parentNode.removeChild(this.$range[0])},a.fn[k]=function(b){var c=Array.prototype.slice.call(arguments,1);return this.each(function(){var d=a(this),e=d.data(\"plugin_\"+k);e||d.data(\"plugin_\"+k,e=new j(this,b)),\"string\"==typeof b&&e[b].apply(e,c)})},\"rangeslider.js is available in jQuery context e.g $(selector).rangeslider(options);\"});","/*!\n * Datepicker for Bootstrap v1.9.0 (https://github.com/uxsolutions/bootstrap-datepicker)\n *\n * Licensed under the Apache License v2.0 (http://www.apache.org/licenses/LICENSE-2.0)\n */\n\n!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(\"\")},\nheadTemplate:'<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\"]'))})});","!function(t){let e=function(t,e){return e=e||null,moment(t,e).locale(\"en\")};t.widget(\"mdb.eventCalendar\",{options:{showAdd:!0,showImage:!1,showLegends:!0,showTooltipActions:!0,showOwners:!1,sliderWidth:\"200px\",showSlider:!0,eventClass:\"height-36\",eventImageSize:\"square\",slider:{id:\"mega-toolbar-slider\",min:18,max:90,value:18,step:18},classes:{megaCalendarWrap:\"megaCalendarWrap\",\"mega-content\":\"mega-content\",\"mega-toolbar\":\"mega-toolbar\",\"mega-toolbar-add-event\":\"mega-toolbar-add-event\",\"mega-toolbar-select-month\":\"mega-toolbar-select-month\",\"mega-toolbar-prev\":\"mega-toolbar-prev\",\"mega-toolbar-next\":\"mega-toolbar-next\",\"mega-toolbar-month\":\"mega-toolbar-month\",\"mega-toolbar-slider\":\"mega-toolbar-slider\",\"mega-view\":\"mega-view\",\"mega-view-header\":\"mega-view-header\",\"mega-view-header-weekday\":\"mega-view-header-weekday\",\"mega-view-body\":\"mega-view-body\",\"mega-view-week\":\"mega-view-week\",\"mega-view-day\":\"mega-view-day\",\"mega-view-day-header\":\"mega-view-day-header\",\"mega-view-day-content\":\"mega-view-day-content\",\"mega-view-day-content-event\":\"mega-view-day-content-event\",\"mega-view-day-content-event-text\":\"mega-view-day-content-event-text\",\"mega-view-day-content-event-image\":\"mega-view-day-content-event-image\",\"mega-loading-animation\":\"mega-loading-animation\",\"mega-legend\":\"mega-legend\",\"mega-legend-header\":\"mega-legend-header\",\"mega-legend-body\":\"mega-legend-body\",\"mega-legend-items\":\"mega-legend-items\",\"mega-legend-item\":\"mega-legend-item\",\"mega-tooltip\":\"mega-tooltip\"},dateFormat:{toolbar:\"MMMM YYYY\",calendar:\"DD\",calendarFirst:\"MMM DD\",eventDate:\"MM-DD-YYYY\"},timeFormat:\"HH:mm\",shortWeekdaysName:!0,loaderImageUrl:null,defaultEventImageUrl:null,calendarCreate:null,calendarAddEvent:null,calendarViewChange:null},showLoader:function(){this._removeClass(this.calendarLoader,\"mega-loading-animation\",\"hidden\")._addClass(this.calendarLoader,\"mega-loading-animation\",\"visible\")},hideLoader:function(){this.eventLoaderInterval&&clearInterval(this.eventLoaderInterval),void 0!==this.eventProcessingDone?this.eventLoaderInterval=setInterval(function(){!0===this.eventProcessingDone&&(clearInterval(this.eventLoaderInterval),this._hideLoader())}.bind(this),100):this._hideLoader()},showPopup:function(e){const a=this.events.filter((function(t){return t.attr(\"id\")===`event-${e}`}))[0];this._hideTooltip();const n=t(\"div.arrow-zone\",this.tooltip);n.hasClass(\"top\")&&this._removeClass(n,\"top\")._addClass(n,\"bottom\"),this.tooltip.show();const s=this.tooltip.find(\"div.megaToolContent\");this._removeClass(s,\"megaToolContent\",\"visible\")._addClass(s,\"megaToolContent\",\"hidden\");const o=this.tooltip.find(\"div.animation\");this._removeClass(o,\"animation\",\"hidden\")._addClass(o,\"animation\",\"visible\");const i=t=>{this._removeClass(n,\"top bottom\"),t.originalPlacement!==t.placement?this._addClass(n,t.placement):this._addClass(n,t.originalPlacement)},d={placement:\"bottom\",modifiers:{preventOverflow:{boundariesElement:this.content.get(0)},arrow:{element:\".arrow\"}},eventsEnabled:!0,onCreate:i,onUpdate:i};this.popper=new Popper(a,this.tooltip,d)},setEvent:function(t){const e=this.tooltip.find(\"div.animation\");this._removeClass(e,\"animation\",\"visible\")._addClass(e,\"animation\",\"hidden\"),this._createTooltipContent(t)},clear:function(){this.calendarBody.remove(),this.toolbarMonth.html(this.startOfMonth.format(this.options.dateFormat.toolbar)),this._processCalendarBody()},refresh:function(){this._refresh()},refreshTooltip:function(){this.popper.update()},showImage:function(t){this.options.showImage=t},_create:function(){this.widgetEventPrefix=\"eventcalendar.\",this.now=e(),this.startOfMonth=this._getStartOfMonth(this.now),this.endOfMonth=this._getEndOfMonth(this.now),this._addClass(this.element,\"megaCalendarWrap postbox\"),this.content=t(\"<div/>\"),this.content.appendTo(this.element),this._addClass(this.content,\"mega-content\"),this._processToolbar(),this._processCalendarView(),this._processCalendarLoader(),this.options.showLegends&&this._processLegend(),this._processTooltip(),this._trigger(\"calendarCreate\",null,{widget:this})},_setOption:function(e,a){\"events\"===e&&a.events&&(this.eventsData=a.events.reverse(),this.eventProcessingInterval&&clearInterval(this.eventProcessingInterval),this.events=[],this.eventProcessingDone=!1,this.options.showSlider?this.eventCurrentClass=`height-${t(this.toolbarSlider).val()}`:this.eventCurrentClass=this.options.eventClass,this.eventProcessingInterval=setInterval(function(){this.eventsData&&0==this.eventsData.length&&(clearInterval(this.eventProcessingInterval),this.eventProcessingDone=!0);const t=[];let e=0;for(;10!==e&&0!=this.eventsData.length;){const a=this.eventsData.pop();e++,t.push(a)}this._processEvents(t)}.bind(this),300))},_processToolbar:function(){this.toolbar=t(\"<div/>\"),this._addClass(this.toolbar,\"mega-toolbar\"),this.toolbar.appendTo(this.content),this._processToolbarButtons(),this._processToolbarMonth(),this._processToolbarSlider()},_processToolbarButtons:function(){!0===this.options.showAdd&&this._processAddEventButton(),this._processSelectMonthButton(),this._processPrevButton(),this._processNextButton()},_processAddEventButton:function(){this.addEvent=t('\\n\\t\\t\\t\\t\\t<button>\\n\\t\\t\\t\\t\\t\\t<i class=\"fui-plus\" aria-hidden=\"true\"></i>\\n\\t\\t\\t\\t\\t\\tAdd Event\\n\\t\\t\\t\\t\\t</button>\\n\\t\\t\\t\\t'),this._addClass(this.addEvent,\"mega-toolbar-add-event\",\"button\",\"mega-toolbar-button\",\"page-title-action\"),this.addEvent.appendTo(this.toolbar),this.addEvent.attr(\"title\",\"Add an Event, or click on any date directly\"),this.addEvent.on(\"click\",function(t){this._trigger(\"calendarAddEvent\",t,{date:new Date})}.bind(this))},_processSelectMonthButton:function(){let a=this;this.selectMonth=t('\\n\\t\\t\\t\\t\\t<div>\\n\\t\\t\\t\\t\\t\\t<div class=\"input-group-addon\">\\n\\t\\t\\t\\t\\t\\t\\t<i class=\"fui-calendar-solid\" aria-hidden=\"true\"></i>\\n\\t\\t\\t\\t\\t\\t\\tMonth\\n\\t\\t\\t\\t\\t\\t</div>\\n\\t\\t\\t\\t\\t</div>\\n\\t\\t\\t\\t'),this._addClass(this.selectMonth,\"mega-toolbar-select-month\",\"mega-toolbar-button input-group date\"),this.selectMonth.appendTo(this.toolbar),this.selectMonth.attr(\"title\",\"Select a month to view in the calendar\"),this.selectMonth.attr(\"tabindex\",0),this.selectMonth.datepicker({startView:\"months\",minViewMode:\"months\",todayBtn:\"linked\",autoclose:!0}),this.selectMonth.datepicker(\"setDate\",this.startOfMonth.toDate()),this.selectMonth.datepicker().on(\"changeDate\",function(t){const a=t.date,n=e(a);this.startOfMonth=this._getStartOfMonth(n),this.endOfMonth=this._getEndOfMonth(n),this._refresh(t)}.bind(this)),this.selectMonth.datepicker().on(\"show\",(function(e){const a=t(\"div.datepicker\"),n=a.offset();a.offset({top:n.top+30,left:n.left+20})})),this.selectMonth.on(\"keyup\",(function(t){\"Enter\"==t.key&&a.selectMonth.datepicker(\"show\")}))},_processPrevButton:function(){this.prev=t('\\n\\t\\t\\t\\t\\t<button>\\n\\t\\t\\t\\t\\t\\t<i class=\"fui-arrow-left\" aria-hidden=\"true\"></i>\\n\\t\\t\\t\\t\\t</button>\\n\\t\\t\\t\\t'),this._addClass(this.prev,\"mega-toolbar-prev\",\"mega-toolbar-button mega-toolbar-nav\"),this.prev.appendTo(this.toolbar),this.prev.attr(\"title\",\"Move to previous month\"),this.prev.attr(\"tabindex\",0),this.prev.on(\"click\",function(t){this.endOfMonth=this.startOfMonth.subtract(1,\"day\"),this.startOfMonth=this._getStartOfMonth(this.endOfMonth),this._refresh(t)}.bind(this))},_processNextButton:function(){this.next=t('\\n\\t\\t\\t\\t\\t<button>\\n\\t\\t\\t\\t\\t\\t<i class=\"fui-arrow-right\" aria-hidden=\"true\"></i>\\n\\t\\t\\t\\t\\t</button>\\n\\t\\t\\t\\t'),this._addClass(this.next,\"mega-toolbar-next\",\"mega-toolbar-button mega-toolbar-nav\"),this.next.appendTo(this.toolbar),this.next.attr(\"title\",\"Move to next month\"),this.next.attr(\"tabindex\",0),this.next.on(\"click\",function(t){this.startOfMonth=this.endOfMonth.add(1,\"day\"),this.endOfMonth=this._getEndOfMonth(this.startOfMonth),this._refresh(t)}.bind(this))},_processToolbarMonth:function(){this.toolbarMonth=t(\"<div/>\"),this._addClass(this.toolbarMonth,\"mega-toolbar-month\"),this.toolbarMonth.attr(\"tabindex\",0),this.toolbarMonth.appendTo(this.toolbar),this.toolbarMonth.html(this.startOfMonth.format(this.options.dateFormat.toolbar))},_processToolbarSlider:function(){if(this.options.showSlider){const a=t(\"<div />\");a.appendTo(this.toolbar),this._addClass(a,\"mega-toolbar-slider\"),a.css(\"width\",this.options.sliderWidth);var e=t('<label class=\"sr-only\" for=\"mega-toolbar-slider\">Event Height</label>');this.toolbarSlider=t('<input type=\"range\"/>'),this.toolbarSlider.attr({...this.options.slider}),this.toolbarSlider.appendTo(a),e.appendTo(a);const n=this;t(this.toolbarSlider).rangeslider({polyfill:!1,onSlideEnd:function(t,e){const a=`height-${e}`;n.events.forEach((function(t){n._removeClass(t,\"mega-view-day-content-event\",n.eventCurrentClass)._addClass(t,\"mega-view-day-content-event\",a)})),n.eventCurrentClass=a}})}},_processCalendarView:function(){this.view=t(\"<div/>\"),this._addClass(this.view,\"mega-view\"),this.view.appendTo(this.content),this._processCalendarHeader(),this._processCalendarBody()},_processCalendarHeader:function(){this.calendarHeader=t(\"<div/>\"),this._addClass(this.calendarHeader,\"mega-view-header\"),this.calendarHeader.appendTo(this.view);const e=this.options.shortWeekdaysName?moment.weekdaysShort():moment.weekdays();this.weekdays=e.map(function(e,a){const n=t(\"<div/>\");return this._addClass(n,\"mega-view-header-weekday\"),n.appendTo(this.calendarHeader),n.html(e),n}.bind(this))},_processCalendarBody:function(){this.calendarBody=t(\"<div/>\"),this._addClass(this.calendarBody,\"mega-view-body\"),this.calendarBody.appendTo(this.view);const e=this._getCalendarDates();this.days=[];let a=[];for(let t=0;t<e.length;t++){const n=e[t];a.push(n),(t+1)%7==0&&(this._processWeek(a),a=[])}},_processWeek:function(e){const a=t(\"<div/>\");this._addClass(a,\"mega-view-week\"),a.appendTo(this.calendarBody);const n=e.map(function(e,n){const s=t(\"<div/>\");this.now.isSame(e,\"day\")?this._addClass(s,\"mega-view-day\",\"today\"):this._addClass(s,\"mega-view-day\"),s.appendTo(a),s.data(\"date\",e.toDate());const o=t(\"<div/>\");this._addClass(o,\"mega-view-day-header\"),o.appendTo(s);const i=1===e.date()?this.options.dateFormat.calendarFirst:this.options.dateFormat.calendar;o.html(e.format(i));const d=t(\"<div />\");return this._addClass(d,\"mega-view-day-content\"),this.options.showAdd?(this._addClass(d,\"mega-view-day-content\",\"current-month show-add\"),d.attr(\"title\",\"Add event for \"+e.format(\"MMMM Do\"))):(this._addClass(d,\"mega-view-day-content\",\"current-month\"),d.attr(\"title\",e.format(\"MMMM Do\"))),d.attr(\"tabindex\",0),d.on(\"keyup\",(function(e){\"Enter\"===e.key&&t(this).trigger(\"click\")})),d.appendTo(s),!0===this.options.showAdd&&(o.on(\"click\",function(t){this._trigger(\"calendarAddEvent\",t,{date:e.toDate()})}.bind(this)),d.on(\"click\",function(t){this._trigger(\"calendarAddEvent\",t,{date:e.toDate()})}.bind(this))),s}.bind(this));this.days.push(...n)},_processCalendarLoader:function(){if(this.calendarLoader=t(\"<div/>\"),this._addClass(this.calendarLoader,\"mega-loading-animation\",\"hidden\"),this.calendarLoader.appendTo(this.content),this.options.loaderImageUrl){t(`<img src=\"${this.options.loaderImageUrl}\" alt=\"Loading Spinner\" />`).appendTo(this.calendarLoader)}},_processLegend:function(){this.legend=t(\"<div/>\"),this._addClass(this.legend,\"mega-legend\"),this.legend.appendTo(this.content),this.legendHeader=t(\"<div/>\"),this.legendHeader.html(\"Legend\"),this._addClass(this.legendHeader,\"mega-legend-header\"),this.legendHeader.appendTo(this.legend),this.legendBody=t(\"<div/>\"),this._addClass(this.legendBody,\"mega-legend-body\"),this.legendBody.appendTo(this.legend),this._processLegendItem(\"icon-bullhorn\",\"Event is Published\")},_processLegendItem:function(e,a){const n=t(\"<div/>\");this._addClass(n,\"mega-legend-items\"),n.appendTo(this.legendBody);const s=t(\"<div/>\");this._addClass(s,\"mega-legend-item\"),s.appendTo(n);const o=t(\"<i/>\");this._addClass(o,e),o.appendTo(s);const i=t(\"<div/>\");this._addClass(i,\"mega-legend-item\"),i.appendTo(n);const d=t(\"<span/>\");d.html(\"=\"),d.appendTo(i);const r=t(\"<div/>\");this._addClass(r,\"mega-legend-item\"),r.appendTo(n);const h=t(\"<span/>\");h.html(a),h.appendTo(r)},_processEvents:function(a){this.days.forEach(function(n){const s=e(n.data(\"date\")).format(this.options.dateFormat.eventDate),o=t(\"div.mega-view-day-content\",n);a.forEach(function(a){const{eventDate:n,id:i,title:d,published:r,createdByMe:h,owner:l}=a;if(e(n).format(this.options.dateFormat.eventDate)===s){const n=t(\"<button />\");n.attr({id:`event-${i}`}),n.data(\"eventData\",a),n.appendTo(o),n.attr(\"tabindex\",0);const s=a.category?\"event-category-\"+a.category.id:\"\";if(this._addClass(n,`megaEvent mega-view-day-content-event ${s}`,this.eventCurrentClass),this.events.push(n),this.options.showImage){const e=t(\"<div/>\");this._addClass(e,\"megaDayImage mega-view-day-content-event-image\"),e.appendTo(n);const s=t(\"<div/>\");this._addClass(s,\"image-zone\"),s.appendTo(e),this._processEventImage(a,e)}else this._addClass(n,\"noImageEvent\");const c=t(\"<div/>\");if(c.appendTo(n),this.options.showImage?this._addClass(c,\"megaEventText mega-view-day-content-event-text\",\"has-image-sibling\"):this._addClass(c,\"megaEventText mega-view-day-content-event-text\",\"full-height\"),r?this._addClass(c,\"mega-published-event\"):this._addClass(c,\"mega-unpublished-event\"),h?this._addClass(c,\"mega-my-event\"):this._addClass(c,\"mega-shared-event\"),a.startTime){let n=e(a.startTime,\"HH:mm\").format(this.options.timeFormat);const s=t(\"<span/>\");s.html(n),this._addClass(s,\"megaTime time\"),s.appendTo(c)}if(d&&\"-\"!==t.trim(d)){const e=t(\"<div/>\"),a=t(\"<span/>\");if(a.html(t.trim(d)),a.addClass(\"megaTitlePara\"),a.appendTo(e),this._addClass(e,\"megaTitle title\"),!h&&this.options.showOwners){const t=`Owned by ${l.calendarName} (${l.handle})`;e.attr(\"title\",t)}e.appendTo(c)}if(this.options.showLegends){const e=t(\"<div/>\");if(this._addClass(e,\"megaIcons\"),e.appendTo(c),r){const a=t(\"<i/>\");this._addClass(a,\"icon-bullhorn\"),a.attr(\"aria-hidden\",!0),a.appendTo(e);const n=t(\"<span />\");this._addClass(n,\"sr-only\"),n.html(\"Published Event\"),n.appendTo(c)}}n.on(\"click\",function(t){this._trigger(\"eventClick\",t,{eventId:i,createdByMe:h}),t.stopPropagation()}.bind(this)),n.on(\"contextmenu\",function(t){this._preventEventPropagation(t),this._trigger(\"eventContextMenu\",t,{eventId:i})}.bind(this)),n.on(\"mouseover focus\",function(t){this._preventEventPropagation(t),this._trigger(\"eventHover\",t,{eventId:i})}.bind(this))}}.bind(this))}.bind(this))},_processEventImage:function(t,e){const{imageUrl:a,imageUrlSquare:n,imageUrlDetail:s,iamgeUrlBanner:o}=t;let i=a;switch(this.options.eventImageSize){case\"square\":i=n||a;break;case\"detail\":i=s||a;break;case\"banner\":i=o||a;break;case\"full\":default:i=a}i?this._createPanelImageHolder(e,\"one-image\",i):(this._addClass(e,\"noImage\"),this._addClass(e.parent(),\"noImageEvent\"),this.options.defaultEventImageUrl&&this._processPanelDefaultImage(e,this.options.defaultEventImageUrl))},_hideLoader:function(){this._removeClass(this.calendarLoader,\"mega-loading-animation\",\"visible\")._addClass(this.calendarLoader,\"mega-loading-animation\",\"hidden\")},_processTooltip:function(){this.tooltip=t(\"<div/>\"),this._addClass(this.tooltip,\"mega-tooltip\"),this.tooltip.appendTo(this.content),this.tooltip.hide();const e=t(\"<div/>\");this._addClass(e,\"arrow-zone bottom\"),e.appendTo(this.tooltip);const a=t(\"<div/>\");this._addClass(a,\"arrow\"),a.appendTo(e);const n=t(\"<div/>\");this._addClass(n,\"view\"),n.appendTo(this.tooltip);const s=t(\"<div/>\");this._addClass(s,\"megaToolContent\",\"hidden\"),s.appendTo(n);const o=t(\"<div/>\");if(this._addClass(o,\"animation\",\"hidden\"),o.appendTo(n),this.options.loaderImageUrl){t(`<img src=\"${this.options.loaderImageUrl}\" alt=\"Loading Spinner\" />`).appendTo(o)}t(\"body\").on(\"click mouseover\",function(e){!1===t(e.target).is(this.tooltip)&&!1===t.contains(this.tooltip.get(0),e.target)&&this._hideTooltip()}.bind(this)),parent.document&&t(parent.document).on(\"click mouseover\",function(t){this._hideTooltip()}.bind(this))},_createTooltipContent:function(t){const e=this.tooltip.find(\"div.megaToolContent\");e.empty(),e.html(t),this._removeClass(e,\"megaToolContent\",\"hidden\")._addClass(e,\"megaToolContent\",\"visible\")},_createTooltipPanels:function(t,e){},_processPanelDefaultImage:function(t,e){this._createPanelImageHolder(t,\"one-image\",e)},_createPanelImageHolder:function(e,a,n){const s=e.find(\"div.image-zone\"),o=t(\"<div/>\");this._addClass(o,a),o.appendTo(s);const i=t(\"<img/>\");i.attr(\"src\",n),i.attr(\"alt\",\"An image representing the event\"),i.appendTo(o)},_hideTooltip:function(){this.popper&&this.popper.destroy(),this.tooltip.hide()},_refresh:function(t){this.calendarBody.remove(),this.toolbarMonth.html(this.startOfMonth.format(this.options.dateFormat.toolbar)),this._processCalendarBody(),this._trigger(\"calendarViewChange\",t,{date:this.startOfMonth.toDate()})},_getCalendarDates:function(){let t=this._getStartOfCalendar(this.startOfMonth),e=this._getEndOfCalendar(this.endOfMonth);const a=[];for(;!t.isAfter(e,\"day\");)a.push(t.clone()),t=t.add(1,\"day\");return a},_getStartOfMonth:function(t){return this._resetTime(t.clone().startOf(\"month\"))},_getEndOfMonth:function(t){return this._resetTime(t.clone().endOf(\"month\"))},_getStartOfCalendar:function(t){return this._resetTime(t.clone().startOf(\"week\"))},_getEndOfCalendar:function(t){return this._resetTime(t.clone().endOf(\"week\"))},_resetTime:function(t){return t.hours(0).minutes(0).seconds(0).milliseconds(0)},_preventEventPropagation:function(t){t&&(t.preventDefault(),t.stopPropagation())},_getImageAtSize:function(t,e){return t.replace(/\\.([^\\.]*)$/,\"-\"+e+\".$1\")}})}(jQuery);","//Front end JS for MegaCal Integration Plugin \r\n(function( $ ) {\r\n\r\n\tvar RESULTS_PER_PAGE;\r\n\tconst GENERIC_ERROR_MSG = '<p class=\"megacal-err-msg\">Please <a href=\"#\" class=\"megacal-err-reload\">click to refresh</a> the calendar.</p>';\r\n\r\n\t$(document).ready(function() {\r\n\r\n\t\t/** Only run on pages where the plugin exists **/\r\n\t\tif( $( \".megacal-events-integration\" ).length > 0 ) {\r\n\t\t\t\r\n\t\t\tvar upcomingEvents = $( '.megacalUpcomingEvents' );\r\n\t\t\tvar pastEvents = $( '.megacalPastEvents' );\r\n\t\t\tvar $calendar = $( '.megacal-public-calendar' );\r\n\t\t\tvar date = new Date();\r\n\r\n\t\t\t$( document ).on( 'click', 'a.megacal-err-reload', function( e ) {\r\n\t\t\t\te.preventDefault();\r\n\t\t\t\twindow.location.reload();\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\t/** loadEvents function definition **/\r\n\t\t\tconst loadEvents = function( container, listType, currentPage ) {\r\n\r\n\t\t\t\tvar pluginWrap = container.closest( '.megacal-events-integration' );\r\n\t\t\t\tvar eventList = container.find('.eventsList');\r\n\t\t\t\t//var preLoader = container.find('.preLoader');\r\n\t\t\t\tvar preLoader = container.find('.preLoader').first();\r\n\t\t\t\t\r\n\t\t\t\tvar descrip = pluginWrap.find( '.descripParam' ).val();\r\n\t\t\t\tvar buttons = pluginWrap.find( '.buttonsParam' ).val();\r\n\t\t\t\tvar list_style = pluginWrap.find( '.listStyleParam' ).val();\r\n\t\t\t\tvar nextDateField = ( 'past' === listType ) ? pluginWrap.find( '.megacalPastListDate' ) : pluginWrap.find( '.megacalUpcomingListDate' );\r\n\t\t\t\tvar list_date = nextDateField.val();\r\n\t\t\t\tvar eventOwner = pluginWrap.find( '.eventOwnerParam' ).val();\r\n\r\n\t\t\t\tpreLoader.show();\r\n\r\n\t\t\t\t/** Validate POST params **/\r\n\r\n\t\t\t\t\tif( typeof listType !== 'string' ) {\r\n\t\t\t\t\t\tconsole.error(\"listType must be a string\");\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t} else if(listType.trim() != 'upcoming' && listType.trim() != 'past') {\r\n\t\t\t\t\t\tconsole.error(\"listType must be 'upcoming' or 'past'\");\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif( typeof descrip === 'undefined' ) {\r\n\t\t\t\t\t\tconsole.error(\"descrip must be 'true' or 'false'\");\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif( typeof buttons !== 'string' ) {\r\n\t\t\t\t\t\tconsole.error(\"buttons must be a string\");\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t} else if(buttons.trim() != 'left' && buttons.trim() != 'right' && buttons.trim() != 'center') {\r\n\t\t\t\t\t\tconsole.error(\"buttons must be 'left', 'right', or 'center'\");\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif( typeof list_style !== 'string' ) {\r\n\t\t\t\t\t\tconsole.error( 'list_style must be a string' );\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif( typeof currentPage !== 'number' ) {\r\n\t\t\t\t\t\tconsole.error( \"currentPage must be a number\" );\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t/** End Validation **/\r\n\r\n\t\t\t\tvar _nonce = pluginWrap.find( '#_megacal_fetch_public_events_nonce' ).val();\r\n\r\n\t\t\t\tvar prevMonthLabel = container.find( '.megacal-month-label' ).last();\r\n\t\t\t\tvar prevMonth = prevMonthLabel.length > 0 ? prevMonthLabel.text() : '';\r\n\t\t\t\tvar lastEvent = container.find( '.listItem' ).last();\r\n\t\t\t\t\r\n\t\t\t\tvar event_list_data = {\r\n\t\t\t\t\t'action' : 'megacal_load_events_list',\r\n\t\t\t\t\t_nonce,\r\n\t\t\t\t\tlistType,\r\n\t\t\t\t\tdescrip,\r\n\t\t\t\t\tbuttons,\r\n\t\t\t\t\tlist_style,\r\n\t\t\t\t\tlist_date,\r\n\t\t\t\t\teventOwner,\r\n\t\t\t\t\tcurrentPage,\r\n\t\t\t\t\tprevMonth,\r\n\t\t\t\t};\r\n\r\n\t\t\t\t$.post(\r\n\t\t\t\t\tmegacal_script_opts.ajax_url,\r\n\t\t\t\t\tevent_list_data,\r\n\t\t\t\t\tfunction( response ) {\r\n\r\n\t\t\t\t\t\tif( false === response.success ) {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tconsole.error( 'error loading events' );\r\n\t\t\t\t\t\t\tcontainer.find(\".loadMoreBtn\").hide();\r\n\t\t\t\t\t\t\treturn;\r\n\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\teventList.append( response.data.content );\r\n\r\n\t\t\t\t\t\tvar $totalPages = container.find( '.megacal-list-total-pages' );\r\n\t\t\t\t\t\tvar total = parseInt( $totalPages.val() ) - 1;\r\n\r\n\t\t\t\t\t\tif( total > currentPage )\r\n\t\t\t\t\t\t\tcontainer.find( '.loadMoreBtn' ).show();\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\tcontainer.find( '.loadMoreBtn' ).hide();\r\n\r\n\t\t\t\t\t\teventList.find('.summaryToggle').unbind('click').click( function(e) {\r\n\t\t\t\t\t\t\te.preventDefault();\r\n\r\n\t\t\t\t\t\t\tvar event = $(this).parents('.listEvent');\r\n\r\n\t\t\t\t\t\t\t$(this).toggleClass('expanded');\r\n\t\t\t\t\t\t\t$(this).toggleClass('collapsed');\r\n\r\n\t\t\t\t\t\t\tevent.find('.fullInfo').stop().slideToggle(200);\r\n\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\tif( 'past' === listType ) {\r\n\t\t\t\t\t\t\tnextDateField.val( response.data.next_date );\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif( currentPage > 0 ) {\r\n\t\t\t\t\t\t\tlastEvent.find( 'a' ).first().focus();\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t})\r\n\t\t\t\t.fail( function() {\r\n\r\n\t\t\t\t\tconsole.error( 'error loading events' );\r\n\t\t\t\t\tcontainer.find(\".loadMoreBtn\").hide();\r\n\t\t\t\t\tshowReloadBtn( container );\r\n\r\n\t\t\t\t})\r\n\t\t\t\t.complete( function() {\r\n\r\n\t\t\t\t\tpreLoader.hide();\r\n\r\n\t\t\t\t});\r\n\r\n\t\t\t};\r\n\r\n\t\t\tconst loadCalendarView = function( $eventCalendar, date ) {\r\n\r\n\t\t\t\tvar pluginWrap = $eventCalendar.closest( '.megacal-events-integration' );\r\n                \r\n\t\t\t\tconst format = 'YYYY-MM-DD';\r\n                const aMoment = moment( date ).hours(0)\r\n                    .minutes(0)\r\n                    .seconds(0)\r\n                    .milliseconds(0);\r\n\r\n                const startDate = aMoment.clone().startOf( 'month' ).startOf( 'week' ).format( format );\r\n                const endDate = aMoment.clone().endOf( 'month' ).endOf( 'week' ).format( format );\r\n    \r\n\t\t\t\tvar _nonce = pluginWrap.find( '#_megacal_fetch_public_events_nonce' ).val();\r\n\t\t\t\tvar eventOwner = pluginWrap.find( '.eventOwnerParam' ).val();\r\n\t\t\t\tvar currentFilter;\r\n\t\t\t\tvar eventCategories;\r\n\r\n\t\t\t\tcurrentFilter = $eventCalendar.data( 'category-filter' );\r\n\t\t\t\teventCategories = ( currentFilter !== '' ) ? [parseInt( currentFilter )] : null;\r\n\r\n                $eventCalendar.eventCalendar( 'showLoader' );\r\n\r\n                var fetchEventsData = {\r\n                    action: 'megacal_fetch_public_calendar_events',\r\n                    _nonce,\r\n                    startDate,\r\n                    endDate,\r\n\t\t\t\t\teventOwner,\r\n\t\t\t\t\teventCategories,\r\n                };\r\n\r\n                $.post(\r\n\r\n                    megacal_script_opts.ajax_url,\r\n                    fetchEventsData,\r\n                    function( response ) {\r\n                        \r\n                        if( false == response.success ) {\r\n                            console.error( response.data.message );\r\n                            return;\r\n                        }\r\n                        \r\n                        $eventCalendar.eventCalendar( \r\n                            'option', \r\n                            'events', \r\n                            { \r\n                                'events': response.data.events \r\n                            } \r\n                        );\r\n\r\n                    }\r\n\r\n                )\r\n                .fail( function() {\r\n                    \r\n\t\t\t\t\tshowReloadBtn( $eventCalendar.parent() );\r\n\r\n                })\r\n                .done( function() {\r\n\r\n                    $eventCalendar.eventCalendar( 'hideLoader' );\r\n\r\n                });\r\n            };\r\n\r\n\t\t\tconst displayPopupContent = function( $eventCalendar, data ) {\r\n\r\n\t\t\t\t$eventCalendar.eventCalendar( 'showPopup', data.eventId );\r\n\t\t\t\t\r\n\t\t\t\tvar $pluginWrap = $eventCalendar.closest( '.megacal-events-integration' );\r\n\t\t\t\tvar eventId = data.eventId;\r\n\t\t\t\tvar _nonce = $pluginWrap.find( '#_megacal_get_event_popup_nonce' ).val();\r\n\r\n\t\t\t\tvar getPopupData = {\r\n\t\t\t\t\taction: 'megacal_load_event_popup',\r\n\t\t\t\t\teventId,\r\n\t\t\t\t\t_nonce,\r\n\t\t\t\t};\r\n\r\n\t\t\t\t$.post(\r\n\r\n                    megacal_script_opts.ajax_url,\r\n                    getPopupData,\r\n                    function( response ) {\r\n                        \r\n                        if( false == response.success ) {\r\n                            console.error( response.data.message );\r\n                            return;\r\n                        }\r\n\r\n\t\t\t\t\t\t$eventCalendar.eventCalendar( 'setEvent', response.data.content );\r\n\t\t\t\t\t\t$eventCalendar.eventCalendar( 'refreshTooltip' );\r\n\r\n                    }\r\n\r\n                ).fail( function() {\r\n\t\t\t\t\t$eventCalendar.eventCalendar( 'setEvent', GENERIC_ERROR_MSG );\r\n\t\t\t\t\t$eventCalendar.eventCalendar( 'refreshTooltip' );\r\n\t\t\t\t});\r\n\r\n\t\t\t};\r\n\r\n\t\t\t/** LOAD EVENTS ON PAGE LOAD **/\r\n\t\t\tupcomingEvents.each(function() {\r\n\t\t\t\tloadEvents( $( this ), \"upcoming\", 0 );\r\n\t\t\t});\r\n\r\n\t\t\tpastEvents.each(function() {\r\n\t\t\t\tloadEvents( $( this ), \"past\", 0 );\r\n\t\t\t});\r\n\r\n\t\t\t//Click Load More \r\n\t\t\t$(\".loadMoreBtn\").click(function(e) {\r\n\r\n\t\t\t\te.preventDefault();\r\n\r\n\t\t\t\tvar container = $( this ).closest( '.megacal-tab' );\r\n\t\t\t\tvar preLoader = container.find( '.preLoader' );\r\n\t\t\t\tvar currentPage = parseInt( container.find( '.pageNum' ).val() );\r\n\t\t\t\tvar listType;\r\n\r\n\t\t\t\tif( container.hasClass( 'megacalUpcomingEvents' ) ) {\r\n\t\t\t\t\tlistType = 'upcoming';\r\n\t\t\t\t} else if( container.hasClass( 'megacalPastEvents' ) ) {\r\n\t\t\t\t\tlistType = 'past';\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$( this ).hide();\r\n\t\t\t\tpreLoader.show();\r\n\r\n\t\t\t\tcontainer.find( '.pageNum' ).val( currentPage + 1 );\r\n\t\t\t\tcontainer.find( '.megacal-list-total-pages' ).remove();\r\n\r\n\t\t\t\tloadEvents( container, listType, currentPage );\r\n\r\n\t\t\t});\r\n\r\n\t\t\t//Tabs\r\n\t\t\t$( '.megacal-tabNav' ).each( function() {\r\n\r\n\t\t\t\tvar $this = $( this );\r\n\t\t\t\t$this.attr( 'role', 'tablist' );\r\n\r\n\t\t\t\t$this.find( 'li > a' ).each( function() {\r\n\t\t\t\t\t\r\n\t\t\t\t\tvar $tab = $( this );\r\n\t\t\t\t\tvar id = $tab.attr( 'href' );\r\n\r\n\t\t\t\t\t$tab.attr( 'role', 'tab' );\r\n\t\t\t\t\t$tab.attr( 'aria-controls', id );\r\n\t\t\t\t\t$( id ).attr( 'role', 'tabpanel' );\r\n\t\t\t\t\t\r\n\t\t\t\t} );\r\n\r\n\t\t\t} );\r\n\r\n\t\t\t$('.megacal-tabNav a').click(function(e) {\r\n\t\t\t\te.preventDefault();\r\n\t\t\t\t\r\n\t\t\t\tvar id = $(this).attr('href');\r\n\t\t\t\tvar navContainer = $(this).closest('.megacal-tabNav');\r\n\t\t\t\tvar container = navContainer.closest('.megacal-tabs');\r\n\t\t\t\tvar liElem = $(this).parent();\r\n\r\n\t\t\t\tnavContainer.find('li').removeClass('current');\r\n\t\t\t\tliElem.addClass('current');\r\n\r\n\t\t\t\tnavContainer.find( 'a' ).attr( 'aria-selected', false );\r\n\t\t\t\t$( this ).attr( 'aria-selected', true );\r\n\r\n\t\t\t\tcontainer.children('.megacal-tab').removeClass('current');\r\n\t\t\t\t$(id).addClass('current');\r\n\t\t\t});\r\n\r\n\t\t\t\r\n\t\t\t$calendar.each( function() {\r\n\t\t\t\t\r\n\t\t\t\t$this = $( this );\r\n\t\t\t\tvar $pluginWrap = $this.closest( '.megacal-events-integration' );\r\n\t\t\t\tvar imgHeight = $pluginWrap.find( '.imgHeightParam' ).val();\r\n\r\n\t\t\t\tvar sliderVal = ( $.isNumeric( imgHeight ) ) ? parseInt( imgHeight ) : 20;\r\n\t\t\t\tvar showImage = ( 'img' == $pluginWrap.find( '.displayParam').val() );\r\n\t\t\t\t\r\n\t\t\t\t$this.eventCalendar({\r\n\r\n\t\t\t\t\tshowAdd: false,\r\n\t\t\t\t\tshowLegends: false,\r\n\t\t\t\t\tshowImage: showImage,\r\n\t\t\t\t\ttimeFormat: megacal_script_opts.time_fmt_setting,\r\n\t\t\t\t\tdateFormat: {\r\n\t\t\t\t\t\tcalendar: 'D',\r\n\t\t\t\t\t\tcalendarFirst: 'MMM D',\r\n\t\t\t\t\t},\r\n\t\t\t\t\tslider: {\r\n\t\t\t\t\t\tvalue: sliderVal, \r\n\t\t\t\t\t},\r\n\t\t\t\t\tshowSlider: false,\r\n\t\t\t\t\tloaderImageUrl: megacal_script_opts.base_url + '/assets/img/loading.svg',\r\n\t\t\t\t\tdefaultEventImageUrl: megacal_script_opts.default_image_path\r\n\r\n\t\t\t\t}).on('eventcalendar.calendarviewchange', ( event, data ) => {\r\n\t\t\t\t\t\r\n\t\t\t\t\tloadCalendarView( $this, data.date );\r\n\t\t\t\t\tdate = data.date;\r\n\r\n\t\t\t\t});\r\n\r\n\t\t\t\tloadCalendarView( $this, date );\r\n\t\t\t\r\n\t\t\t}).on('eventcalendar.eventhover', ( event, data ) => {\r\n    \r\n\t\t\t\tdisplayPopupContent( $this, data );\r\n\r\n            }).on( 'eventcalendar.eventclick', ( event, data ) => {\r\n\r\n\t\t\t\tif( megacal_script_opts.permalink_structure == '/' || megacal_script_opts.permalink_structure == '' ) {\r\n\t\t\t\t\twindow.location.assign( megacal_script_opts.event_url + '&event_id=' + data.eventId );\r\n\t\t\t\t} else {\r\n\t\t\t\t\twindow.location.assign( megacal_script_opts.event_url + data.eventId );\r\n\t\t\t\t}\r\n\r\n\t\t\t});\r\n\r\n\t\t\t$( '.megacal-subscribe-select' ).on( 'change', function() {\r\n\r\n\t\t\t\tvar url = $( this ).val();\r\n\t\t\t\tif( typeof url == 'undefined' || url.trim() == '' ) {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\twindow.open( url, '_blank' );\r\n\r\n\t\t\t});\r\n\r\n\t\t\t$( '.megacal-filter-cat-btn' ).on( 'click', function( e ) {\r\n\r\n\t\t\t\te.preventDefault();\r\n\t\t\t\tvar $this = $( this );\r\n\t\t\t\tvar $container = $this.closest( '.megacal-filter-section' );\r\n\t\t\t\tvar pluginWrap = $this.closest( '.megacal-events-integration' );\r\n\t\t\t\tvar $closestCal = pluginWrap.find( '.megacal-public-calendar' );\r\n\r\n\t\t\t\t$container.find( '.megacal-filter-cat-btn' ).removeClass( 'current' );\r\n\t\t\t\t$container.find( '.megacal-filter-cat-btn' ).attr( 'aria-pressed', false );\r\n\t\t\t\t$this.addClass( 'current' );\r\n\t\t\t\t$this.attr( 'aria-pressed', true );\r\n\r\n\t\t\t\t$closestCal.data( 'category-filter', $this.data( 'cat-id' ) );\r\n\t\t\t\t$closestCal.eventCalendar( 'refresh' );\r\n\t\t\t\r\n\t\t\t} );\r\n\r\n\t\t}\r\n\r\n\t});\r\n\r\n\t$(window).load(function() {\r\n\t\tif($(\".megacal-events-integration\").length > 0) {\r\n\t\t\tif($('#viewParam').length > 0) {\r\n\t\t\t\tvar view = $('#viewParam').val();\r\n\r\n\t\t\t\tif(view !== undefined && view.trim() !== '') {\r\n\t\t\t\t\tif(view == 'list')\r\n\t\t\t\t\t\t$('#listViewToggle').click();\r\n\t\t\t\t\telse if(view == 'cal')\r\n\t\t\t\t\t\t$('#calViewToggle').click();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n\r\n\t//Function Definitions\r\n\tfunction showEventPopupDetails( eventId ) {\r\n\t\tvar modalContainer = $('.eventDetailModal');\r\n\t\tvar mask = $('.megacal-integration-mask');\r\n\r\n\t\tif(megacal_script_opts !== undefined) {\t\t\r\n\t\t\tvar preLoader = modalContainer.find('.preLoader').first();\r\n\r\n\t\t\tvar list_style = $('#listStyleParam').val();\r\n\t\t\tvar show_venue = $('#showVenueParam').val();\r\n\t\t\t\r\n\t\t\tif( list_style !== undefined && typeof list_style !== 'string' ) {\r\n\t\t\t\tconsole.error( 'list_style must be a string' );\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\r\n\t\t\tif( show_venue === undefined ) {\r\n\t\t\t\tconsole.error( 'show_venue is required' );\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\r\n\t\t\tmask.fadeIn(200);\r\n\t\t\tmodalContainer.fadeIn(200);\r\n\r\n\t\t\t/** Validate POST params **/\r\n\t\t\t\tif(eventId === undefined || (eventId !== undefined && !$.isNumeric(eventId))) {\r\n\t\t\t\t\tconsole.log(\"eventId must be a number\");\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t/** End Validation **/\r\n\r\n\t\t\tvar event_detail_data = {\r\n\t\t\t\t'action' : 'load_event_details',\r\n\t\t\t\t'eventId' : eventId,\r\n\t\t\t\t'security' : megacal_script_opts.ajax_nonce,\r\n\t\t\t\t'list_style': list_style,\r\n\t\t\t\t'show_venue': show_venue\r\n\t\t\t};\r\n\r\n\t\t\t$.post(\r\n\t\t\t\tmegacal_script_opts.ajax_url,\r\n\t\t\t\tevent_detail_data,\r\n\t\t\t\tfunction(html) {\r\n\t\t\t\t\tmodalContainer.html(html);\r\n\r\n\t\t\t\t\t$('body').addClass('noScroll');\r\n\t\t\t\t\t$('html').css(\"overflow\", \"hidden\");\r\n\r\n\t\t\t\t\t//Set up the click listener on the close button\r\n\t\t\t\t\tmodalContainer.find('.modalClose').click(function(e) {\r\n\t\t\t\t\t\te.preventDefault();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tmodalContainer.fadeOut(200, function() {\r\n\t\t\t\t\t\t\tmodalContainer.html(preLoader);\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tmask.fadeOut(200);\r\n\t\t\t\t\t\t$('body').removeClass('noScroll');\r\n\t\t\t\t\t\t$('html').css(\"overflow\", \"auto\");\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\t$(\".megacal-integration-mask\").click(function(e) {\r\n\t\t\t\t\t\te.preventDefault();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tmodalContainer.fadeOut(200, function() {\r\n\t\t\t\t\t\t\tmodalContainer.html(preLoader);\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tmask.fadeOut(200);\r\n\t\t\t\t\t\t$('body').removeClass('noScroll');\r\n\t\t\t\t\t\t$('html').css(\"overflow\", \"auto\");\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\tloadMediaTabsMegaCal();\r\n\r\n\t\t\t\t}\r\n\t\t\t);\r\n\t\t}\r\n\t}\r\n\r\n\tfunction loadMediaTabsMegaCal() {\r\n\t\t$(\".mediaTabNav a\").click(function(e){\r\n\t\t\te.preventDefault();\r\n\r\n\t\t\tvar tabId = $(this).attr(\"href\").substring(1);\r\n\t\t\tvar navContainer = $(this).closest(\".mediaTabNav\");\r\n\t\t\tvar container = navContainer.closest(\".mediaHolder\");\r\n\t\t\tvar tabContainer = container.find(\".artistMediaTabs\");\r\n\t\t\tvar tab = tabContainer.find(\".\"+tabId);\r\n\r\n\t\t\tnavContainer.find('.current').removeClass('current');\r\n\t\t\t$(this).parent().addClass('current');\r\n\r\n\t\t\ttabContainer.find('.current').removeClass('current');\r\n\t\t\ttab.addClass('current');\r\n\t\t});\r\n\r\n\t\t$(\".artistMediaExpander\").click(function(e){\r\n\t\t\te.preventDefault();\r\n\r\n\t\t\tvar artistMediaSection = $(this).next(\".artistMediaSection\");\r\n\r\n\t\t\tif(artistMediaSection.hasClass('expanded')) {\r\n\t\t\t\tartistMediaSection.removeClass('expanded').stop().slideUp();\r\n\t\t\t} else {\r\n\t\t\t\tartistMediaSection.addClass('expanded').stop().slideDown();\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tfunction showReloadBtn( $container ) {\r\n\t\t$container.html( GENERIC_ERROR_MSG );\r\n\t}\r\n\r\n})( jQuery );"]}
     1{"version":3,"sources":["popper.min.js","rangeslider.min.js","bootstrap-datepicker.min.js","event-calendar.min.js","scripts.js"],"names":["$","GENERIC_ERROR_MSG","showReloadBtn","$container","html","document","ready","length","upcomingEvents","pastEvents","$calendar","date","Date","on","e","preventDefault","window","location","reload","loadEvents","container","listType","currentPage","pluginWrap","closest","eventList","find","preLoader","first","descrip","val","buttons","list_style","nextDateField","list_date","eventOwner","show","console","error","trim","_nonce","prevMonthLabel","last","prevMonth","text","lastEvent","event_list_data","action","post","megacal_script_opts","ajax_url","response","success","hide","append","data","content","$totalPages","parseInt","unbind","click","event","this","parents","toggleClass","stop","slideToggle","next_date","focus","fail","complete","loadCalendarView","$eventCalendar","currentFilter","eventCategories","aMoment","moment","hours","minutes","seconds","milliseconds","startDate","clone","startOf","format","endDate","endOf","eventCalendar","fetchEventsData","events","message","parent","done","each","hasClass","remove","$this","attr","$tab","id","navContainer","liElem","removeClass","addClass","children","$pluginWrap","imgHeight","sliderVal","isNumeric","showImage","showAdd","showLegends","timeFormat","time_fmt_setting","dateFormat","calendar","calendarFirst","slider","value","showSlider","loaderImageUrl","base_url","defaultEventImageUrl","default_image_path","eventId","getPopupData","displayPopupContent","permalink_structure","assign","event_url","url","open","$closestCal","load","view","undefined","jQuery"],"mappings":"AAAA;AACA;AACA;AACA;AACA;ACJA;AACA;ACDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACPA;ACAA,cAGA,SAAWA,GACT,IACIC,EAAoB,kHAwYxB,SAASC,EAAcC,GACrBA,EAAWC,KAAKH,GAxYlBD,EAAEK,UAAUC,MAAM,WAEhB,GAAIN,EAAE,+BAA+BO,OAAS,EAAG,CAC/C,IAAIC,EAAiBR,EAAE,0BACnBS,EAAaT,EAAE,sBACfU,EAAYV,EAAE,4BACdW,EAAO,IAAIC,KACfZ,EAAEK,UAAUQ,GAAG,QAAS,uBAAwB,SAAUC,GACxDA,EAAEC,iBACFC,OAAOC,SAASC,WAIlB,IAAIC,EAAa,SAAoBC,EAAWC,EAAUC,GACxD,IAAIC,EAAaH,EAAUI,QAAQ,+BAC/BC,EAAYL,EAAUM,KAAK,eAE3BC,EAAYP,EAAUM,KAAK,cAAcE,QACzCC,EAAUN,EAAWG,KAAK,iBAAiBI,MAC3CC,EA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A3CN,oBAAoB8E,qBAAyE,IAA3C9E,oBAAoB8E,oBACxE/G,OAAOC,SAAS+G,OAAO/E,oBAAoBgF,UAAY,aAAe1E,EAAKqE,SAE3E5G,OAAOC,SAAS+G,OAAO/E,oBAAoBgF,UAAY1E,EAAKqE,WAGhE5H,EAAE,6BAA6Ba,GAAG,SAAU,WAC1C,IAAIqH,EAAMlI,EAAE8D,MAAMhC,WAEA,IAAPoG,GAAoC,IAAdA,EAAI3F,QAIrCvB,OAAOmH,KAAKD,EAAK,YAEnBlI,EAAE,2BAA2Ba,GAAG,QAAS,SAAUC,GACjDA,EAAEC,iBACF,IAAIiF,EAAQhG,EAAE8D,MACV3D,EAAa6F,EAAMxE,QAAQ,2BAE3B4G,EADapC,EAAMxE,QAAQ,+BACFE,KAAK,4BAClCvB,EAAWuB,KAAK,2BAA2B4E,YAAY,WACvDnG,EAAWuB,KAAK,2BAA2BuE,KAAK,gBAAgB,GAChED,EAAMO,SAAS,WACfP,EAAMC,KAAK,gBAAgB,GAC3BmC,EAAY7E,KAAK,kBAAmByC,EAAMzC,KAAK,WAC/C6E,EAAY7C,cAAc,gBAIhCvF,EAAEgB,QAAQqH,KAAK,WACb,GAAIrI,EAAE,+BAA+BO,OAAS,GACxCP,EAAE,cAAcO,OAAS,EAAG,CAC9B,IAAI+H,EAAOtI,EAAE,cAAc8B,WAEdyG,IAATD,GAAsC,KAAhBA,EAAK/F,SACjB,QAAR+F,EAAgBtI,EAAE,mBAAmB4D,QAAyB,OAAR0E,GAAetI,EAAE,kBAAkB4D,YA1SvG,CA6YG4E","file":"../vendor/main.min.js","sourcesContent":["/*\n Copyright (C) Federico Zivolo 2020\n Distributed under the MIT License (license terms are at http://opensource.org/licenses/MIT).\n */(function(e,t){'object'==typeof exports&&'undefined'!=typeof module?module.exports=t():'function'==typeof define&&define.amd?define(t):e.Popper=t()})(this,function(){'use strict';function e(e){return e&&'[object Function]'==={}.toString.call(e)}function t(e,t){if(1!==e.nodeType)return[];var o=e.ownerDocument.defaultView,n=o.getComputedStyle(e,null);return t?n[t]:n}function o(e){return'HTML'===e.nodeName?e:e.parentNode||e.host}function n(e){if(!e)return document.body;switch(e.nodeName){case'HTML':case'BODY':return e.ownerDocument.body;case'#document':return e.body;}var i=t(e),r=i.overflow,p=i.overflowX,s=i.overflowY;return /(auto|scroll|overlay)/.test(r+s+p)?e:n(o(e))}function i(e){return e&&e.referenceNode?e.referenceNode:e}function r(e){return 11===e?re:10===e?pe:re||pe}function p(e){if(!e)return document.documentElement;for(var o=r(10)?document.body:null,n=e.offsetParent||null;n===o&&e.nextElementSibling;)n=(e=e.nextElementSibling).offsetParent;var i=n&&n.nodeName;return i&&'BODY'!==i&&'HTML'!==i?-1!==['TH','TD','TABLE'].indexOf(n.nodeName)&&'static'===t(n,'position')?p(n):n:e?e.ownerDocument.documentElement:document.documentElement}function s(e){var t=e.nodeName;return'BODY'!==t&&('HTML'===t||p(e.firstElementChild)===e)}function d(e){return null===e.parentNode?e:d(e.parentNode)}function a(e,t){if(!e||!e.nodeType||!t||!t.nodeType)return document.documentElement;var o=e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING,n=o?e:t,i=o?t:e,r=document.createRange();r.setStart(n,0),r.setEnd(i,0);var l=r.commonAncestorContainer;if(e!==l&&t!==l||n.contains(i))return s(l)?l:p(l);var f=d(e);return f.host?a(f.host,t):a(e,d(t).host)}function l(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:'top',o='top'===t?'scrollTop':'scrollLeft',n=e.nodeName;if('BODY'===n||'HTML'===n){var i=e.ownerDocument.documentElement,r=e.ownerDocument.scrollingElement||i;return r[o]}return e[o]}function f(e,t){var o=2<arguments.length&&void 0!==arguments[2]&&arguments[2],n=l(t,'top'),i=l(t,'left'),r=o?-1:1;return e.top+=n*r,e.bottom+=n*r,e.left+=i*r,e.right+=i*r,e}function m(e,t){var o='x'===t?'Left':'Top',n='Left'==o?'Right':'Bottom';return parseFloat(e['border'+o+'Width'])+parseFloat(e['border'+n+'Width'])}function h(e,t,o,n){return ee(t['offset'+e],t['scroll'+e],o['client'+e],o['offset'+e],o['scroll'+e],r(10)?parseInt(o['offset'+e])+parseInt(n['margin'+('Height'===e?'Top':'Left')])+parseInt(n['margin'+('Height'===e?'Bottom':'Right')]):0)}function c(e){var t=e.body,o=e.documentElement,n=r(10)&&getComputedStyle(o);return{height:h('Height',t,o,n),width:h('Width',t,o,n)}}function g(e){return le({},e,{right:e.left+e.width,bottom:e.top+e.height})}function u(e){var o={};try{if(r(10)){o=e.getBoundingClientRect();var n=l(e,'top'),i=l(e,'left');o.top+=n,o.left+=i,o.bottom+=n,o.right+=i}else o=e.getBoundingClientRect()}catch(t){}var p={left:o.left,top:o.top,width:o.right-o.left,height:o.bottom-o.top},s='HTML'===e.nodeName?c(e.ownerDocument):{},d=s.width||e.clientWidth||p.width,a=s.height||e.clientHeight||p.height,f=e.offsetWidth-d,h=e.offsetHeight-a;if(f||h){var u=t(e);f-=m(u,'x'),h-=m(u,'y'),p.width-=f,p.height-=h}return g(p)}function b(e,o){var i=2<arguments.length&&void 0!==arguments[2]&&arguments[2],p=r(10),s='HTML'===o.nodeName,d=u(e),a=u(o),l=n(e),m=t(o),h=parseFloat(m.borderTopWidth),c=parseFloat(m.borderLeftWidth);i&&s&&(a.top=ee(a.top,0),a.left=ee(a.left,0));var b=g({top:d.top-a.top-h,left:d.left-a.left-c,width:d.width,height:d.height});if(b.marginTop=0,b.marginLeft=0,!p&&s){var w=parseFloat(m.marginTop),y=parseFloat(m.marginLeft);b.top-=h-w,b.bottom-=h-w,b.left-=c-y,b.right-=c-y,b.marginTop=w,b.marginLeft=y}return(p&&!i?o.contains(l):o===l&&'BODY'!==l.nodeName)&&(b=f(b,o)),b}function w(e){var t=1<arguments.length&&void 0!==arguments[1]&&arguments[1],o=e.ownerDocument.documentElement,n=b(e,o),i=ee(o.clientWidth,window.innerWidth||0),r=ee(o.clientHeight,window.innerHeight||0),p=t?0:l(o),s=t?0:l(o,'left'),d={top:p-n.top+n.marginTop,left:s-n.left+n.marginLeft,width:i,height:r};return g(d)}function y(e){var n=e.nodeName;if('BODY'===n||'HTML'===n)return!1;if('fixed'===t(e,'position'))return!0;var i=o(e);return!!i&&y(i)}function E(e){if(!e||!e.parentElement||r())return document.documentElement;for(var o=e.parentElement;o&&'none'===t(o,'transform');)o=o.parentElement;return o||document.documentElement}function v(e,t,r,p){var s=4<arguments.length&&void 0!==arguments[4]&&arguments[4],d={top:0,left:0},l=s?E(e):a(e,i(t));if('viewport'===p)d=w(l,s);else{var f;'scrollParent'===p?(f=n(o(t)),'BODY'===f.nodeName&&(f=e.ownerDocument.documentElement)):'window'===p?f=e.ownerDocument.documentElement:f=p;var m=b(f,l,s);if('HTML'===f.nodeName&&!y(l)){var h=c(e.ownerDocument),g=h.height,u=h.width;d.top+=m.top-m.marginTop,d.bottom=g+m.top,d.left+=m.left-m.marginLeft,d.right=u+m.left}else d=m}r=r||0;var v='number'==typeof r;return d.left+=v?r:r.left||0,d.top+=v?r:r.top||0,d.right-=v?r:r.right||0,d.bottom-=v?r:r.bottom||0,d}function x(e){var t=e.width,o=e.height;return t*o}function O(e,t,o,n,i){var r=5<arguments.length&&void 0!==arguments[5]?arguments[5]:0;if(-1===e.indexOf('auto'))return e;var p=v(o,n,r,i),s={top:{width:p.width,height:t.top-p.top},right:{width:p.right-t.right,height:p.height},bottom:{width:p.width,height:p.bottom-t.bottom},left:{width:t.left-p.left,height:p.height}},d=Object.keys(s).map(function(e){return le({key:e},s[e],{area:x(s[e])})}).sort(function(e,t){return t.area-e.area}),a=d.filter(function(e){var t=e.width,n=e.height;return t>=o.clientWidth&&n>=o.clientHeight}),l=0<a.length?a[0].key:d[0].key,f=e.split('-')[1];return l+(f?'-'+f:'')}function L(e,t,o){var n=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null,r=n?E(t):a(t,i(o));return b(o,r,n)}function S(e){var t=e.ownerDocument.defaultView,o=t.getComputedStyle(e),n=parseFloat(o.marginTop||0)+parseFloat(o.marginBottom||0),i=parseFloat(o.marginLeft||0)+parseFloat(o.marginRight||0),r={width:e.offsetWidth+i,height:e.offsetHeight+n};return r}function T(e){var t={left:'right',right:'left',bottom:'top',top:'bottom'};return e.replace(/left|right|bottom|top/g,function(e){return t[e]})}function C(e,t,o){o=o.split('-')[0];var n=S(e),i={width:n.width,height:n.height},r=-1!==['right','left'].indexOf(o),p=r?'top':'left',s=r?'left':'top',d=r?'height':'width',a=r?'width':'height';return i[p]=t[p]+t[d]/2-n[d]/2,i[s]=o===s?t[s]-n[a]:t[T(s)],i}function D(e,t){return Array.prototype.find?e.find(t):e.filter(t)[0]}function N(e,t,o){if(Array.prototype.findIndex)return e.findIndex(function(e){return e[t]===o});var n=D(e,function(e){return e[t]===o});return e.indexOf(n)}function P(t,o,n){var i=void 0===n?t:t.slice(0,N(t,'name',n));return i.forEach(function(t){t['function']&&console.warn('`modifier.function` is deprecated, use `modifier.fn`!');var n=t['function']||t.fn;t.enabled&&e(n)&&(o.offsets.popper=g(o.offsets.popper),o.offsets.reference=g(o.offsets.reference),o=n(o,t))}),o}function k(){if(!this.state.isDestroyed){var e={instance:this,styles:{},arrowStyles:{},attributes:{},flipped:!1,offsets:{}};e.offsets.reference=L(this.state,this.popper,this.reference,this.options.positionFixed),e.placement=O(this.options.placement,e.offsets.reference,this.popper,this.reference,this.options.modifiers.flip.boundariesElement,this.options.modifiers.flip.padding),e.originalPlacement=e.placement,e.positionFixed=this.options.positionFixed,e.offsets.popper=C(this.popper,e.offsets.reference,e.placement),e.offsets.popper.position=this.options.positionFixed?'fixed':'absolute',e=P(this.modifiers,e),this.state.isCreated?this.options.onUpdate(e):(this.state.isCreated=!0,this.options.onCreate(e))}}function W(e,t){return e.some(function(e){var o=e.name,n=e.enabled;return n&&o===t})}function B(e){for(var t=[!1,'ms','Webkit','Moz','O'],o=e.charAt(0).toUpperCase()+e.slice(1),n=0;n<t.length;n++){var i=t[n],r=i?''+i+o:e;if('undefined'!=typeof document.body.style[r])return r}return null}function H(){return this.state.isDestroyed=!0,W(this.modifiers,'applyStyle')&&(this.popper.removeAttribute('x-placement'),this.popper.style.position='',this.popper.style.top='',this.popper.style.left='',this.popper.style.right='',this.popper.style.bottom='',this.popper.style.willChange='',this.popper.style[B('transform')]=''),this.disableEventListeners(),this.options.removeOnDestroy&&this.popper.parentNode.removeChild(this.popper),this}function A(e){var t=e.ownerDocument;return t?t.defaultView:window}function M(e,t,o,i){var r='BODY'===e.nodeName,p=r?e.ownerDocument.defaultView:e;p.addEventListener(t,o,{passive:!0}),r||M(n(p.parentNode),t,o,i),i.push(p)}function F(e,t,o,i){o.updateBound=i,A(e).addEventListener('resize',o.updateBound,{passive:!0});var r=n(e);return M(r,'scroll',o.updateBound,o.scrollParents),o.scrollElement=r,o.eventsEnabled=!0,o}function I(){this.state.eventsEnabled||(this.state=F(this.reference,this.options,this.state,this.scheduleUpdate))}function R(e,t){return A(e).removeEventListener('resize',t.updateBound),t.scrollParents.forEach(function(e){e.removeEventListener('scroll',t.updateBound)}),t.updateBound=null,t.scrollParents=[],t.scrollElement=null,t.eventsEnabled=!1,t}function U(){this.state.eventsEnabled&&(cancelAnimationFrame(this.scheduleUpdate),this.state=R(this.reference,this.state))}function Y(e){return''!==e&&!isNaN(parseFloat(e))&&isFinite(e)}function V(e,t){Object.keys(t).forEach(function(o){var n='';-1!==['width','height','top','right','bottom','left'].indexOf(o)&&Y(t[o])&&(n='px'),e.style[o]=t[o]+n})}function j(e,t){Object.keys(t).forEach(function(o){var n=t[o];!1===n?e.removeAttribute(o):e.setAttribute(o,t[o])})}function q(e,t){var o=e.offsets,n=o.popper,i=o.reference,r=$,p=function(e){return e},s=r(i.width),d=r(n.width),a=-1!==['left','right'].indexOf(e.placement),l=-1!==e.placement.indexOf('-'),f=t?a||l||s%2==d%2?r:Z:p,m=t?r:p;return{left:f(1==s%2&&1==d%2&&!l&&t?n.left-1:n.left),top:m(n.top),bottom:m(n.bottom),right:f(n.right)}}function K(e,t,o){var n=D(e,function(e){var o=e.name;return o===t}),i=!!n&&e.some(function(e){return e.name===o&&e.enabled&&e.order<n.order});if(!i){var r='`'+t+'`';console.warn('`'+o+'`'+' modifier is required by '+r+' modifier in order to work, be sure to include it before '+r+'!')}return i}function z(e){return'end'===e?'start':'start'===e?'end':e}function G(e){var t=1<arguments.length&&void 0!==arguments[1]&&arguments[1],o=he.indexOf(e),n=he.slice(o+1).concat(he.slice(0,o));return t?n.reverse():n}function _(e,t,o,n){var i=e.match(/((?:\\-|\\+)?\\d*\\.?\\d*)(.*)/),r=+i[1],p=i[2];if(!r)return e;if(0===p.indexOf('%')){var s;switch(p){case'%p':s=o;break;case'%':case'%r':default:s=n;}var d=g(s);return d[t]/100*r}if('vh'===p||'vw'===p){var a;return a='vh'===p?ee(document.documentElement.clientHeight,window.innerHeight||0):ee(document.documentElement.clientWidth,window.innerWidth||0),a/100*r}return r}function X(e,t,o,n){var i=[0,0],r=-1!==['right','left'].indexOf(n),p=e.split(/(\\+|\\-)/).map(function(e){return e.trim()}),s=p.indexOf(D(p,function(e){return-1!==e.search(/,|\\s/)}));p[s]&&-1===p[s].indexOf(',')&&console.warn('Offsets separated by white space(s) are deprecated, use a comma (,) instead.');var d=/\\s*,\\s*|\\s+/,a=-1===s?[p]:[p.slice(0,s).concat([p[s].split(d)[0]]),[p[s].split(d)[1]].concat(p.slice(s+1))];return a=a.map(function(e,n){var i=(1===n?!r:r)?'height':'width',p=!1;return e.reduce(function(e,t){return''===e[e.length-1]&&-1!==['+','-'].indexOf(t)?(e[e.length-1]=t,p=!0,e):p?(e[e.length-1]+=t,p=!1,e):e.concat(t)},[]).map(function(e){return _(e,i,t,o)})}),a.forEach(function(e,t){e.forEach(function(o,n){Y(o)&&(i[t]+=o*('-'===e[n-1]?-1:1))})}),i}function J(e,t){var o,n=t.offset,i=e.placement,r=e.offsets,p=r.popper,s=r.reference,d=i.split('-')[0];return o=Y(+n)?[+n,0]:X(n,p,s,d),'left'===d?(p.top+=o[0],p.left-=o[1]):'right'===d?(p.top+=o[0],p.left+=o[1]):'top'===d?(p.left+=o[0],p.top-=o[1]):'bottom'===d&&(p.left+=o[0],p.top+=o[1]),e.popper=p,e}var Q=Math.min,Z=Math.floor,$=Math.round,ee=Math.max,te='undefined'!=typeof window&&'undefined'!=typeof document&&'undefined'!=typeof navigator,oe=function(){for(var e=['Edge','Trident','Firefox'],t=0;t<e.length;t+=1)if(te&&0<=navigator.userAgent.indexOf(e[t]))return 1;return 0}(),ne=te&&window.Promise,ie=ne?function(e){var t=!1;return function(){t||(t=!0,window.Promise.resolve().then(function(){t=!1,e()}))}}:function(e){var t=!1;return function(){t||(t=!0,setTimeout(function(){t=!1,e()},oe))}},re=te&&!!(window.MSInputMethodContext&&document.documentMode),pe=te&&/MSIE 10/.test(navigator.userAgent),se=function(e,t){if(!(e instanceof t))throw new TypeError('Cannot call a class as a function')},de=function(){function e(e,t){for(var o,n=0;n<t.length;n++)o=t[n],o.enumerable=o.enumerable||!1,o.configurable=!0,'value'in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}return function(t,o,n){return o&&e(t.prototype,o),n&&e(t,n),t}}(),ae=function(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e},le=Object.assign||function(e){for(var t,o=1;o<arguments.length;o++)for(var n in t=arguments[o],t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},fe=te&&/Firefox/i.test(navigator.userAgent),me=['auto-start','auto','auto-end','top-start','top','top-end','right-start','right','right-end','bottom-end','bottom','bottom-start','left-end','left','left-start'],he=me.slice(3),ce={FLIP:'flip',CLOCKWISE:'clockwise',COUNTERCLOCKWISE:'counterclockwise'},ge=function(){function t(o,n){var i=this,r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{};se(this,t),this.scheduleUpdate=function(){return requestAnimationFrame(i.update)},this.update=ie(this.update.bind(this)),this.options=le({},t.Defaults,r),this.state={isDestroyed:!1,isCreated:!1,scrollParents:[]},this.reference=o&&o.jquery?o[0]:o,this.popper=n&&n.jquery?n[0]:n,this.options.modifiers={},Object.keys(le({},t.Defaults.modifiers,r.modifiers)).forEach(function(e){i.options.modifiers[e]=le({},t.Defaults.modifiers[e]||{},r.modifiers?r.modifiers[e]:{})}),this.modifiers=Object.keys(this.options.modifiers).map(function(e){return le({name:e},i.options.modifiers[e])}).sort(function(e,t){return e.order-t.order}),this.modifiers.forEach(function(t){t.enabled&&e(t.onLoad)&&t.onLoad(i.reference,i.popper,i.options,t,i.state)}),this.update();var p=this.options.eventsEnabled;p&&this.enableEventListeners(),this.state.eventsEnabled=p}return de(t,[{key:'update',value:function(){return k.call(this)}},{key:'destroy',value:function(){return H.call(this)}},{key:'enableEventListeners',value:function(){return I.call(this)}},{key:'disableEventListeners',value:function(){return U.call(this)}}]),t}();return ge.Utils=('undefined'==typeof window?global:window).PopperUtils,ge.placements=me,ge.Defaults={placement:'bottom',positionFixed:!1,eventsEnabled:!0,removeOnDestroy:!1,onCreate:function(){},onUpdate:function(){},modifiers:{shift:{order:100,enabled:!0,fn:function(e){var t=e.placement,o=t.split('-')[0],n=t.split('-')[1];if(n){var i=e.offsets,r=i.reference,p=i.popper,s=-1!==['bottom','top'].indexOf(o),d=s?'left':'top',a=s?'width':'height',l={start:ae({},d,r[d]),end:ae({},d,r[d]+r[a]-p[a])};e.offsets.popper=le({},p,l[n])}return e}},offset:{order:200,enabled:!0,fn:J,offset:0},preventOverflow:{order:300,enabled:!0,fn:function(e,t){var o=t.boundariesElement||p(e.instance.popper);e.instance.reference===o&&(o=p(o));var n=B('transform'),i=e.instance.popper.style,r=i.top,s=i.left,d=i[n];i.top='',i.left='',i[n]='';var a=v(e.instance.popper,e.instance.reference,t.padding,o,e.positionFixed);i.top=r,i.left=s,i[n]=d,t.boundaries=a;var l=t.priority,f=e.offsets.popper,m={primary:function(e){var o=f[e];return f[e]<a[e]&&!t.escapeWithReference&&(o=ee(f[e],a[e])),ae({},e,o)},secondary:function(e){var o='right'===e?'left':'top',n=f[o];return f[e]>a[e]&&!t.escapeWithReference&&(n=Q(f[o],a[e]-('right'===e?f.width:f.height))),ae({},o,n)}};return l.forEach(function(e){var t=-1===['left','top'].indexOf(e)?'secondary':'primary';f=le({},f,m[t](e))}),e.offsets.popper=f,e},priority:['left','right','top','bottom'],padding:5,boundariesElement:'scrollParent'},keepTogether:{order:400,enabled:!0,fn:function(e){var t=e.offsets,o=t.popper,n=t.reference,i=e.placement.split('-')[0],r=Z,p=-1!==['top','bottom'].indexOf(i),s=p?'right':'bottom',d=p?'left':'top',a=p?'width':'height';return o[s]<r(n[d])&&(e.offsets.popper[d]=r(n[d])-o[a]),o[d]>r(n[s])&&(e.offsets.popper[d]=r(n[s])),e}},arrow:{order:500,enabled:!0,fn:function(e,o){var n;if(!K(e.instance.modifiers,'arrow','keepTogether'))return e;var i=o.element;if('string'==typeof i){if(i=e.instance.popper.querySelector(i),!i)return e;}else if(!e.instance.popper.contains(i))return console.warn('WARNING: `arrow.element` must be child of its popper element!'),e;var r=e.placement.split('-')[0],p=e.offsets,s=p.popper,d=p.reference,a=-1!==['left','right'].indexOf(r),l=a?'height':'width',f=a?'Top':'Left',m=f.toLowerCase(),h=a?'left':'top',c=a?'bottom':'right',u=S(i)[l];d[c]-u<s[m]&&(e.offsets.popper[m]-=s[m]-(d[c]-u)),d[m]+u>s[c]&&(e.offsets.popper[m]+=d[m]+u-s[c]),e.offsets.popper=g(e.offsets.popper);var b=d[m]+d[l]/2-u/2,w=t(e.instance.popper),y=parseFloat(w['margin'+f]),E=parseFloat(w['border'+f+'Width']),v=b-e.offsets.popper[m]-y-E;return v=ee(Q(s[l]-u,v),0),e.arrowElement=i,e.offsets.arrow=(n={},ae(n,m,$(v)),ae(n,h,''),n),e},element:'[x-arrow]'},flip:{order:600,enabled:!0,fn:function(e,t){if(W(e.instance.modifiers,'inner'))return e;if(e.flipped&&e.placement===e.originalPlacement)return e;var o=v(e.instance.popper,e.instance.reference,t.padding,t.boundariesElement,e.positionFixed),n=e.placement.split('-')[0],i=T(n),r=e.placement.split('-')[1]||'',p=[];switch(t.behavior){case ce.FLIP:p=[n,i];break;case ce.CLOCKWISE:p=G(n);break;case ce.COUNTERCLOCKWISE:p=G(n,!0);break;default:p=t.behavior;}return p.forEach(function(s,d){if(n!==s||p.length===d+1)return e;n=e.placement.split('-')[0],i=T(n);var a=e.offsets.popper,l=e.offsets.reference,f=Z,m='left'===n&&f(a.right)>f(l.left)||'right'===n&&f(a.left)<f(l.right)||'top'===n&&f(a.bottom)>f(l.top)||'bottom'===n&&f(a.top)<f(l.bottom),h=f(a.left)<f(o.left),c=f(a.right)>f(o.right),g=f(a.top)<f(o.top),u=f(a.bottom)>f(o.bottom),b='left'===n&&h||'right'===n&&c||'top'===n&&g||'bottom'===n&&u,w=-1!==['top','bottom'].indexOf(n),y=!!t.flipVariations&&(w&&'start'===r&&h||w&&'end'===r&&c||!w&&'start'===r&&g||!w&&'end'===r&&u),E=!!t.flipVariationsByContent&&(w&&'start'===r&&c||w&&'end'===r&&h||!w&&'start'===r&&u||!w&&'end'===r&&g),v=y||E;(m||b||v)&&(e.flipped=!0,(m||b)&&(n=p[d+1]),v&&(r=z(r)),e.placement=n+(r?'-'+r:''),e.offsets.popper=le({},e.offsets.popper,C(e.instance.popper,e.offsets.reference,e.placement)),e=P(e.instance.modifiers,e,'flip'))}),e},behavior:'flip',padding:5,boundariesElement:'viewport',flipVariations:!1,flipVariationsByContent:!1},inner:{order:700,enabled:!1,fn:function(e){var t=e.placement,o=t.split('-')[0],n=e.offsets,i=n.popper,r=n.reference,p=-1!==['left','right'].indexOf(o),s=-1===['top','left'].indexOf(o);return i[p?'left':'top']=r[o]-(s?i[p?'width':'height']:0),e.placement=T(t),e.offsets.popper=g(i),e}},hide:{order:800,enabled:!0,fn:function(e){if(!K(e.instance.modifiers,'hide','preventOverflow'))return e;var t=e.offsets.reference,o=D(e.instance.modifiers,function(e){return'preventOverflow'===e.name}).boundaries;if(t.bottom<o.top||t.left>o.right||t.top>o.bottom||t.right<o.left){if(!0===e.hide)return e;e.hide=!0,e.attributes['x-out-of-boundaries']=''}else{if(!1===e.hide)return e;e.hide=!1,e.attributes['x-out-of-boundaries']=!1}return e}},computeStyle:{order:850,enabled:!0,fn:function(e,t){var o=t.x,n=t.y,i=e.offsets.popper,r=D(e.instance.modifiers,function(e){return'applyStyle'===e.name}).gpuAcceleration;void 0!==r&&console.warn('WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!');var s,d,a=void 0===r?t.gpuAcceleration:r,l=p(e.instance.popper),f=u(l),m={position:i.position},h=q(e,2>window.devicePixelRatio||!fe),c='bottom'===o?'top':'bottom',g='right'===n?'left':'right',b=B('transform');if(d='bottom'==c?'HTML'===l.nodeName?-l.clientHeight+h.bottom:-f.height+h.bottom:h.top,s='right'==g?'HTML'===l.nodeName?-l.clientWidth+h.right:-f.width+h.right:h.left,a&&b)m[b]='translate3d('+s+'px, '+d+'px, 0)',m[c]=0,m[g]=0,m.willChange='transform';else{var w='bottom'==c?-1:1,y='right'==g?-1:1;m[c]=d*w,m[g]=s*y,m.willChange=c+', '+g}var E={\"x-placement\":e.placement};return e.attributes=le({},E,e.attributes),e.styles=le({},m,e.styles),e.arrowStyles=le({},e.offsets.arrow,e.arrowStyles),e},gpuAcceleration:!0,x:'bottom',y:'right'},applyStyle:{order:900,enabled:!0,fn:function(e){return V(e.instance.popper,e.styles),j(e.instance.popper,e.attributes),e.arrowElement&&Object.keys(e.arrowStyles).length&&V(e.arrowElement,e.arrowStyles),e},onLoad:function(e,t,o,n,i){var r=L(i,t,e,o.positionFixed),p=O(o.placement,r,t,e,o.modifiers.flip.boundariesElement,o.modifiers.flip.padding);return t.setAttribute('x-placement',p),V(t,{position:o.positionFixed?'fixed':'absolute'}),o},gpuAcceleration:void 0}}},ge});\n","/*! rangeslider.js - v2.3.2 | (c) 2018 @andreruffert | MIT license | https://github.com/andreruffert/rangeslider.js */\n!function(a){\"use strict\";\"function\"==typeof define&&define.amd?define([\"jquery\"],a):\"object\"==typeof exports?module.exports=a(require(\"jquery\")):a(jQuery)}(function(a){\"use strict\";function b(){var a=document.createElement(\"input\");return a.setAttribute(\"type\",\"range\"),\"text\"!==a.type}function c(a,b){var c=Array.prototype.slice.call(arguments,2);return setTimeout(function(){return a.apply(null,c)},b)}function d(a,b){return b=b||100,function(){if(!a.debouncing){var c=Array.prototype.slice.apply(arguments);a.lastReturnVal=a.apply(window,c),a.debouncing=!0}return clearTimeout(a.debounceTimeout),a.debounceTimeout=setTimeout(function(){a.debouncing=!1},b),a.lastReturnVal}}function e(a){return a&&(0===a.offsetWidth||0===a.offsetHeight||!1===a.open)}function f(a){for(var b=[],c=a.parentNode;e(c);)b.push(c),c=c.parentNode;return b}function g(a,b){function c(a){void 0!==a.open&&(a.open=!a.open)}var d=f(a),e=d.length,g=[],h=a[b];if(e){for(var i=0;i<e;i++)g[i]=d[i].style.cssText,d[i].style.setProperty?d[i].style.setProperty(\"display\",\"block\",\"important\"):d[i].style.cssText+=\";display: block !important\",d[i].style.height=\"0\",d[i].style.overflow=\"hidden\",d[i].style.visibility=\"hidden\",c(d[i]);h=a[b];for(var j=0;j<e;j++)d[j].style.cssText=g[j],c(d[j])}return h}function h(a,b){var c=parseFloat(a);return Number.isNaN(c)?b:c}function i(a){return a.charAt(0).toUpperCase()+a.substr(1)}function j(b,e){if(this.$window=a(window),this.$document=a(document),this.$element=a(b),this.options=a.extend({},n,e),this.polyfill=this.options.polyfill,this.orientation=this.$element[0].getAttribute(\"data-orientation\")||this.options.orientation,this.onInit=this.options.onInit,this.onSlide=this.options.onSlide,this.onSlideEnd=this.options.onSlideEnd,this.DIMENSION=o.orientation[this.orientation].dimension,this.DIRECTION=o.orientation[this.orientation].direction,this.DIRECTION_STYLE=o.orientation[this.orientation].directionStyle,this.COORDINATE=o.orientation[this.orientation].coordinate,this.polyfill&&m)return!1;this.identifier=\"js-\"+k+\"-\"+l++,this.startEvent=this.options.startEvent.join(\".\"+this.identifier+\" \")+\".\"+this.identifier,this.moveEvent=this.options.moveEvent.join(\".\"+this.identifier+\" \")+\".\"+this.identifier,this.endEvent=this.options.endEvent.join(\".\"+this.identifier+\" \")+\".\"+this.identifier,this.toFixed=(this.step+\"\").replace(\".\",\"\").length-1,this.$fill=a('<div class=\"'+this.options.fillClass+'\" />'),this.$handle=a('<div class=\"'+this.options.handleClass+'\" />'),this.$range=a('<div class=\"'+this.options.rangeClass+\" \"+this.options[this.orientation+\"Class\"]+'\" id=\"'+this.identifier+'\" />').insertAfter(this.$element).prepend(this.$fill,this.$handle),this.$element.css({position:\"absolute\",width:\"1px\",height:\"1px\",overflow:\"hidden\",opacity:\"0\"}),this.handleDown=a.proxy(this.handleDown,this),this.handleMove=a.proxy(this.handleMove,this),this.handleEnd=a.proxy(this.handleEnd,this),this.init();var f=this;this.$window.on(\"resize.\"+this.identifier,d(function(){c(function(){f.update(!1,!1)},300)},20)),this.$document.on(this.startEvent,\"#\"+this.identifier+\":not(.\"+this.options.disabledClass+\")\",this.handleDown),this.$element.on(\"change.\"+this.identifier,function(a,b){if(!b||b.origin!==f.identifier){var c=a.target.value,d=f.getPositionFromValue(c);f.setPosition(d)}})}Number.isNaN=Number.isNaN||function(a){return\"number\"==typeof a&&a!==a};var k=\"rangeslider\",l=0,m=b(),n={polyfill:!0,orientation:\"horizontal\",rangeClass:\"rangeslider\",disabledClass:\"rangeslider--disabled\",activeClass:\"rangeslider--active\",horizontalClass:\"rangeslider--horizontal\",verticalClass:\"rangeslider--vertical\",fillClass:\"rangeslider__fill\",handleClass:\"rangeslider__handle\",startEvent:[\"mousedown\",\"touchstart\",\"pointerdown\"],moveEvent:[\"mousemove\",\"touchmove\",\"pointermove\"],endEvent:[\"mouseup\",\"touchend\",\"pointerup\"]},o={orientation:{horizontal:{dimension:\"width\",direction:\"left\",directionStyle:\"left\",coordinate:\"x\"},vertical:{dimension:\"height\",direction:\"top\",directionStyle:\"bottom\",coordinate:\"y\"}}};return j.prototype.init=function(){this.update(!0,!1),this.onInit&&\"function\"==typeof this.onInit&&this.onInit()},j.prototype.update=function(a,b){a=a||!1,a&&(this.min=h(this.$element[0].getAttribute(\"min\"),0),this.max=h(this.$element[0].getAttribute(\"max\"),100),this.value=h(this.$element[0].value,Math.round(this.min+(this.max-this.min)/2)),this.step=h(this.$element[0].getAttribute(\"step\"),1)),this.handleDimension=g(this.$handle[0],\"offset\"+i(this.DIMENSION)),this.rangeDimension=g(this.$range[0],\"offset\"+i(this.DIMENSION)),this.maxHandlePos=this.rangeDimension-this.handleDimension,this.grabPos=this.handleDimension/2,this.position=this.getPositionFromValue(this.value),this.$element[0].disabled?this.$range.addClass(this.options.disabledClass):this.$range.removeClass(this.options.disabledClass),this.setPosition(this.position,b)},j.prototype.handleDown=function(a){if(a.preventDefault(),!(a.button&&0!==a.button||(this.$document.on(this.moveEvent,this.handleMove),this.$document.on(this.endEvent,this.handleEnd),this.$range.addClass(this.options.activeClass),(\" \"+a.target.className+\" \").replace(/[\\n\\t]/g,\" \").indexOf(this.options.handleClass)>-1))){var b=this.getRelativePosition(a),c=this.$range[0].getBoundingClientRect()[this.DIRECTION],d=this.getPositionFromNode(this.$handle[0])-c,e=\"vertical\"===this.orientation?this.maxHandlePos-(b-this.grabPos):b-this.grabPos;this.setPosition(e),b>=d&&b<d+this.handleDimension&&(this.grabPos=b-d)}},j.prototype.handleMove=function(a){a.preventDefault();var b=this.getRelativePosition(a),c=\"vertical\"===this.orientation?this.maxHandlePos-(b-this.grabPos):b-this.grabPos;this.setPosition(c)},j.prototype.handleEnd=function(a){a.preventDefault(),this.$document.off(this.moveEvent,this.handleMove),this.$document.off(this.endEvent,this.handleEnd),this.$range.removeClass(this.options.activeClass),this.$element.trigger(\"change\",{origin:this.identifier}),this.onSlideEnd&&\"function\"==typeof this.onSlideEnd&&this.onSlideEnd(this.position,this.value)},j.prototype.cap=function(a,b,c){return a<b?b:a>c?c:a},j.prototype.setPosition=function(a,b){var c,d;void 0===b&&(b=!0),c=this.getValueFromPosition(this.cap(a,0,this.maxHandlePos)),d=this.getPositionFromValue(c),this.$fill[0].style[this.DIMENSION]=d+this.grabPos+\"px\",this.$handle[0].style[this.DIRECTION_STYLE]=d+\"px\",this.setValue(c),this.position=d,this.value=c,b&&this.onSlide&&\"function\"==typeof this.onSlide&&this.onSlide(d,c)},j.prototype.getPositionFromNode=function(a){for(var b=0;null!==a;)b+=a.offsetLeft,a=a.offsetParent;return b},j.prototype.getRelativePosition=function(a){var b=i(this.COORDINATE),c=this.$range[0].getBoundingClientRect()[this.DIRECTION],d=0;return void 0!==a.originalEvent[\"client\"+b]?d=a.originalEvent[\"client\"+b]:a.originalEvent.touches&&a.originalEvent.touches[0]&&void 0!==a.originalEvent.touches[0][\"client\"+b]?d=a.originalEvent.touches[0][\"client\"+b]:a.currentPoint&&void 0!==a.currentPoint[this.COORDINATE]&&(d=a.currentPoint[this.COORDINATE]),d-c},j.prototype.getPositionFromValue=function(a){var b;return b=(a-this.min)/(this.max-this.min),Number.isNaN(b)?0:b*this.maxHandlePos},j.prototype.getValueFromPosition=function(a){var b,c;return b=a/(this.maxHandlePos||1),c=this.step*Math.round(b*(this.max-this.min)/this.step)+this.min,Number(c.toFixed(this.toFixed))},j.prototype.setValue=function(a){a===this.value&&\"\"!==this.$element[0].value||this.$element.val(a).trigger(\"input\",{origin:this.identifier})},j.prototype.destroy=function(){this.$document.off(\".\"+this.identifier),this.$window.off(\".\"+this.identifier),this.$element.off(\".\"+this.identifier).removeAttr(\"style\").removeData(\"plugin_\"+k),this.$range&&this.$range.length&&this.$range[0].parentNode.removeChild(this.$range[0])},a.fn[k]=function(b){var c=Array.prototype.slice.call(arguments,1);return this.each(function(){var d=a(this),e=d.data(\"plugin_\"+k);e||d.data(\"plugin_\"+k,e=new j(this,b)),\"string\"==typeof b&&e[b].apply(e,c)})},\"rangeslider.js is available in jQuery context e.g $(selector).rangeslider(options);\"});","/*!\n * Datepicker for Bootstrap v1.9.0 (https://github.com/uxsolutions/bootstrap-datepicker)\n *\n * Licensed under the Apache License v2.0 (http://www.apache.org/licenses/LICENSE-2.0)\n */\n\n!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(\"\")},\nheadTemplate:'<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\"]'))})});","!function(t){let e=function(t,e){return e=e||null,moment(t,e).locale(\"en\")};t.widget(\"mdb.eventCalendar\",{options:{showAdd:!0,showImage:!1,showLegends:!0,showTooltipActions:!0,showOwners:!1,sliderWidth:\"200px\",showSlider:!0,eventClass:\"height-36\",eventImageSize:\"square\",slider:{id:\"mega-toolbar-slider\",min:18,max:90,value:18,step:18},classes:{megaCalendarWrap:\"megaCalendarWrap\",\"mega-content\":\"mega-content\",\"mega-toolbar\":\"mega-toolbar\",\"mega-toolbar-add-event\":\"mega-toolbar-add-event\",\"mega-toolbar-select-month\":\"mega-toolbar-select-month\",\"mega-toolbar-prev\":\"mega-toolbar-prev\",\"mega-toolbar-next\":\"mega-toolbar-next\",\"mega-toolbar-month\":\"mega-toolbar-month\",\"mega-toolbar-slider\":\"mega-toolbar-slider\",\"mega-view\":\"mega-view\",\"mega-view-header\":\"mega-view-header\",\"mega-view-header-weekday\":\"mega-view-header-weekday\",\"mega-view-body\":\"mega-view-body\",\"mega-view-week\":\"mega-view-week\",\"mega-view-day\":\"mega-view-day\",\"mega-view-day-header\":\"mega-view-day-header\",\"mega-view-day-content\":\"mega-view-day-content\",\"mega-view-day-content-event\":\"mega-view-day-content-event\",\"mega-view-day-content-event-text\":\"mega-view-day-content-event-text\",\"mega-view-day-content-event-image\":\"mega-view-day-content-event-image\",\"mega-loading-animation\":\"mega-loading-animation\",\"mega-legend\":\"mega-legend\",\"mega-legend-header\":\"mega-legend-header\",\"mega-legend-body\":\"mega-legend-body\",\"mega-legend-items\":\"mega-legend-items\",\"mega-legend-item\":\"mega-legend-item\",\"mega-tooltip\":\"mega-tooltip\"},dateFormat:{toolbar:\"MMMM YYYY\",calendar:\"DD\",calendarFirst:\"MMM DD\",eventDate:\"MM-DD-YYYY\"},timeFormat:\"HH:mm\",shortWeekdaysName:!0,loaderImageUrl:null,defaultEventImageUrl:null,calendarCreate:null,calendarAddEvent:null,calendarViewChange:null},showLoader:function(){this._removeClass(this.calendarLoader,\"mega-loading-animation\",\"hidden\")._addClass(this.calendarLoader,\"mega-loading-animation\",\"visible\")},hideLoader:function(){this.eventLoaderInterval&&clearInterval(this.eventLoaderInterval),void 0!==this.eventProcessingDone?this.eventLoaderInterval=setInterval(function(){!0===this.eventProcessingDone&&(clearInterval(this.eventLoaderInterval),this._hideLoader())}.bind(this),100):this._hideLoader()},showPopup:function(e){const a=this.events.filter((function(t){return t.attr(\"id\")===`event-${e}`}))[0];this._hideTooltip();const n=t(\"div.arrow-zone\",this.tooltip);n.hasClass(\"top\")&&this._removeClass(n,\"top\")._addClass(n,\"bottom\"),this.tooltip.show();const s=this.tooltip.find(\"div.megaToolContent\");this._removeClass(s,\"megaToolContent\",\"visible\")._addClass(s,\"megaToolContent\",\"hidden\");const o=this.tooltip.find(\"div.animation\");this._removeClass(o,\"animation\",\"hidden\")._addClass(o,\"animation\",\"visible\");const i=t=>{this._removeClass(n,\"top bottom\"),t.originalPlacement!==t.placement?this._addClass(n,t.placement):this._addClass(n,t.originalPlacement)},d={placement:\"bottom\",modifiers:{preventOverflow:{boundariesElement:this.content.get(0)},arrow:{element:\".arrow\"}},eventsEnabled:!0,onCreate:i,onUpdate:i};this.popper=new Popper(a,this.tooltip,d)},setEvent:function(t){const e=this.tooltip.find(\"div.animation\");this._removeClass(e,\"animation\",\"visible\")._addClass(e,\"animation\",\"hidden\"),this._createTooltipContent(t)},clear:function(){this.calendarBody.remove(),this.toolbarMonth.html(this.startOfMonth.format(this.options.dateFormat.toolbar)),this._processCalendarBody()},refresh:function(){this._refresh()},refreshTooltip:function(){this.popper.update()},showImage:function(t){this.options.showImage=t},_create:function(){this.widgetEventPrefix=\"eventcalendar.\",this.now=e(),this.startOfMonth=this._getStartOfMonth(this.now),this.endOfMonth=this._getEndOfMonth(this.now),this._addClass(this.element,\"megaCalendarWrap postbox\"),this.content=t(\"<div/>\"),this.content.appendTo(this.element),this._addClass(this.content,\"mega-content\"),this._processToolbar(),this._processCalendarView(),this._processCalendarLoader(),this.options.showLegends&&this._processLegend(),this._processTooltip(),this._trigger(\"calendarCreate\",null,{widget:this})},_setOption:function(e,a){\"events\"===e&&a.events&&(this.eventsData=a.events.reverse(),this.eventProcessingInterval&&clearInterval(this.eventProcessingInterval),this.events=[],this.eventProcessingDone=!1,this.options.showSlider?this.eventCurrentClass=`height-${t(this.toolbarSlider).val()}`:this.eventCurrentClass=this.options.eventClass,this.eventProcessingInterval=setInterval(function(){this.eventsData&&0==this.eventsData.length&&(clearInterval(this.eventProcessingInterval),this.eventProcessingDone=!0);const t=[];let e=0;for(;10!==e&&0!=this.eventsData.length;){const a=this.eventsData.pop();e++,t.push(a)}this._processEvents(t)}.bind(this),300))},_processToolbar:function(){this.toolbar=t(\"<div/>\"),this._addClass(this.toolbar,\"mega-toolbar\"),this.toolbar.appendTo(this.content),this._processToolbarButtons(),this._processToolbarMonth(),this._processToolbarSlider()},_processToolbarButtons:function(){!0===this.options.showAdd&&this._processAddEventButton(),this._processSelectMonthButton(),this._processPrevButton(),this._processNextButton()},_processAddEventButton:function(){this.addEvent=t('\\n\\t\\t\\t\\t\\t<button>\\n\\t\\t\\t\\t\\t\\t<i class=\"fui-plus\" aria-hidden=\"true\"></i>\\n\\t\\t\\t\\t\\t\\tAdd Event\\n\\t\\t\\t\\t\\t</button>\\n\\t\\t\\t\\t'),this._addClass(this.addEvent,\"mega-toolbar-add-event\",\"button\",\"mega-toolbar-button\",\"page-title-action\"),this.addEvent.appendTo(this.toolbar),this.addEvent.attr(\"title\",\"Add an Event, or click on any date directly\"),this.addEvent.on(\"click\",function(t){this._trigger(\"calendarAddEvent\",t,{date:new Date})}.bind(this))},_processSelectMonthButton:function(){let a=this;this.selectMonth=t('\\n\\t\\t\\t\\t\\t<div>\\n\\t\\t\\t\\t\\t\\t<div class=\"input-group-addon\">\\n\\t\\t\\t\\t\\t\\t\\t<i class=\"fui-calendar-solid\" aria-hidden=\"true\"></i>\\n\\t\\t\\t\\t\\t\\t\\tMonth\\n\\t\\t\\t\\t\\t\\t</div>\\n\\t\\t\\t\\t\\t</div>\\n\\t\\t\\t\\t'),this._addClass(this.selectMonth,\"mega-toolbar-select-month\",\"mega-toolbar-button input-group date\"),this.selectMonth.appendTo(this.toolbar),this.selectMonth.attr(\"title\",\"Select a month to view in the calendar\"),this.selectMonth.attr(\"tabindex\",0),this.selectMonth.datepicker({startView:\"months\",minViewMode:\"months\",todayBtn:\"linked\",autoclose:!0}),this.selectMonth.datepicker(\"setDate\",this.startOfMonth.toDate()),this.selectMonth.datepicker().on(\"changeDate\",function(t){const a=t.date,n=e(a);this.startOfMonth=this._getStartOfMonth(n),this.endOfMonth=this._getEndOfMonth(n),this._refresh(t)}.bind(this)),this.selectMonth.datepicker().on(\"show\",(function(e){const a=t(\"div.datepicker\"),n=a.offset();a.offset({top:n.top+30,left:n.left+20})})),this.selectMonth.on(\"keyup\",(function(t){\"Enter\"==t.key&&a.selectMonth.datepicker(\"show\")}))},_processPrevButton:function(){this.prev=t('\\n\\t\\t\\t\\t\\t<button>\\n\\t\\t\\t\\t\\t\\t<i class=\"fui-arrow-left\" aria-hidden=\"true\"></i>\\n\\t\\t\\t\\t\\t</button>\\n\\t\\t\\t\\t'),this._addClass(this.prev,\"mega-toolbar-prev\",\"mega-toolbar-button mega-toolbar-nav\"),this.prev.appendTo(this.toolbar),this.prev.attr(\"title\",\"Move to previous month\"),this.prev.attr(\"tabindex\",0),this.prev.on(\"click\",function(t){this.endOfMonth=this.startOfMonth.subtract(1,\"day\"),this.startOfMonth=this._getStartOfMonth(this.endOfMonth),this._refresh(t)}.bind(this))},_processNextButton:function(){this.next=t('\\n\\t\\t\\t\\t\\t<button>\\n\\t\\t\\t\\t\\t\\t<i class=\"fui-arrow-right\" aria-hidden=\"true\"></i>\\n\\t\\t\\t\\t\\t</button>\\n\\t\\t\\t\\t'),this._addClass(this.next,\"mega-toolbar-next\",\"mega-toolbar-button mega-toolbar-nav\"),this.next.appendTo(this.toolbar),this.next.attr(\"title\",\"Move to next month\"),this.next.attr(\"tabindex\",0),this.next.on(\"click\",function(t){this.startOfMonth=this.endOfMonth.add(1,\"day\"),this.endOfMonth=this._getEndOfMonth(this.startOfMonth),this._refresh(t)}.bind(this))},_processToolbarMonth:function(){this.toolbarMonth=t(\"<div/>\"),this._addClass(this.toolbarMonth,\"mega-toolbar-month\"),this.toolbarMonth.attr(\"tabindex\",0),this.toolbarMonth.appendTo(this.toolbar),this.toolbarMonth.html(this.startOfMonth.format(this.options.dateFormat.toolbar))},_processToolbarSlider:function(){if(this.options.showSlider){const a=t(\"<div />\");a.appendTo(this.toolbar),this._addClass(a,\"mega-toolbar-slider\"),a.css(\"width\",this.options.sliderWidth);var e=t('<label class=\"sr-only\" for=\"mega-toolbar-slider\">Event Height</label>');this.toolbarSlider=t('<input type=\"range\"/>'),this.toolbarSlider.attr({...this.options.slider}),this.toolbarSlider.appendTo(a),e.appendTo(a);const n=this;t(this.toolbarSlider).rangeslider({polyfill:!1,onSlideEnd:function(t,e){const a=`height-${e}`;n.events.forEach((function(t){n._removeClass(t,\"mega-view-day-content-event\",n.eventCurrentClass)._addClass(t,\"mega-view-day-content-event\",a)})),n.eventCurrentClass=a}})}},_processCalendarView:function(){this.view=t(\"<div/>\"),this._addClass(this.view,\"mega-view\"),this.view.appendTo(this.content),this._processCalendarHeader(),this._processCalendarBody()},_processCalendarHeader:function(){this.calendarHeader=t(\"<div/>\"),this._addClass(this.calendarHeader,\"mega-view-header\"),this.calendarHeader.appendTo(this.view);const e=this.options.shortWeekdaysName?moment.weekdaysShort():moment.weekdays();this.weekdays=e.map(function(e,a){const n=t(\"<div/>\");return this._addClass(n,\"mega-view-header-weekday\"),n.appendTo(this.calendarHeader),n.html(e),n}.bind(this))},_processCalendarBody:function(){this.calendarBody=t(\"<div/>\"),this._addClass(this.calendarBody,\"mega-view-body\"),this.calendarBody.appendTo(this.view);const e=this._getCalendarDates();this.days=[];let a=[];for(let t=0;t<e.length;t++){const n=e[t];a.push(n),(t+1)%7==0&&(this._processWeek(a),a=[])}},_processWeek:function(e){const a=t(\"<div/>\");this._addClass(a,\"mega-view-week\"),a.appendTo(this.calendarBody);const n=e.map(function(e,n){const s=t(\"<div/>\");this.now.isSame(e,\"day\")?this._addClass(s,\"mega-view-day\",\"today\"):this._addClass(s,\"mega-view-day\"),s.appendTo(a),s.data(\"date\",e.toDate());const o=t(\"<div/>\");this._addClass(o,\"mega-view-day-header\"),o.appendTo(s);const i=1===e.date()?this.options.dateFormat.calendarFirst:this.options.dateFormat.calendar;o.html(e.format(i));const d=t(\"<div />\");return this._addClass(d,\"mega-view-day-content\"),this.options.showAdd?(this._addClass(d,\"mega-view-day-content\",\"current-month show-add\"),d.attr(\"title\",\"Add event for \"+e.format(\"MMMM Do\"))):(this._addClass(d,\"mega-view-day-content\",\"current-month\"),d.attr(\"title\",e.format(\"MMMM Do\"))),d.attr(\"tabindex\",0),d.on(\"keyup\",(function(e){\"Enter\"===e.key&&t(this).trigger(\"click\")})),d.appendTo(s),!0===this.options.showAdd&&(o.on(\"click\",function(t){this._trigger(\"calendarAddEvent\",t,{date:e.toDate()})}.bind(this)),d.on(\"click\",function(t){this._trigger(\"calendarAddEvent\",t,{date:e.toDate()})}.bind(this))),s}.bind(this));this.days.push(...n)},_processCalendarLoader:function(){if(this.calendarLoader=t(\"<div/>\"),this._addClass(this.calendarLoader,\"mega-loading-animation\",\"hidden\"),this.calendarLoader.appendTo(this.content),this.options.loaderImageUrl){t(`<img src=\"${this.options.loaderImageUrl}\" alt=\"Loading Spinner\" />`).appendTo(this.calendarLoader)}},_processLegend:function(){this.legend=t(\"<div/>\"),this._addClass(this.legend,\"mega-legend\"),this.legend.appendTo(this.content),this.legendHeader=t(\"<div/>\"),this.legendHeader.html(\"Legend\"),this._addClass(this.legendHeader,\"mega-legend-header\"),this.legendHeader.appendTo(this.legend),this.legendBody=t(\"<div/>\"),this._addClass(this.legendBody,\"mega-legend-body\"),this.legendBody.appendTo(this.legend),this._processLegendItem(\"icon-bullhorn\",\"Event is Published\")},_processLegendItem:function(e,a){const n=t(\"<div/>\");this._addClass(n,\"mega-legend-items\"),n.appendTo(this.legendBody);const s=t(\"<div/>\");this._addClass(s,\"mega-legend-item\"),s.appendTo(n);const o=t(\"<i/>\");this._addClass(o,e),o.appendTo(s);const i=t(\"<div/>\");this._addClass(i,\"mega-legend-item\"),i.appendTo(n);const d=t(\"<span/>\");d.html(\"=\"),d.appendTo(i);const r=t(\"<div/>\");this._addClass(r,\"mega-legend-item\"),r.appendTo(n);const h=t(\"<span/>\");h.html(a),h.appendTo(r)},_processEvents:function(a){this.days.forEach(function(n){const s=e(n.data(\"date\")).format(this.options.dateFormat.eventDate),o=t(\"div.mega-view-day-content\",n);a.forEach(function(a){const{eventDate:n,id:i,title:d,published:r,createdByMe:h,owner:l}=a;if(e(n).format(this.options.dateFormat.eventDate)===s){const n=t(\"<button />\");n.attr({id:`event-${i}`}),n.data(\"eventData\",a),n.appendTo(o),n.attr(\"tabindex\",0);const s=a.category?\"event-category-\"+a.category.id:\"\";if(this._addClass(n,`megaEvent mega-view-day-content-event ${s}`,this.eventCurrentClass),this.events.push(n),this.options.showImage){const e=t(\"<div/>\");this._addClass(e,\"megaDayImage mega-view-day-content-event-image\"),e.appendTo(n);const s=t(\"<div/>\");this._addClass(s,\"image-zone\"),s.appendTo(e),this._processEventImage(a,e)}else this._addClass(n,\"noImageEvent\");const c=t(\"<div/>\");if(c.appendTo(n),this.options.showImage?this._addClass(c,\"megaEventText mega-view-day-content-event-text\",\"has-image-sibling\"):this._addClass(c,\"megaEventText mega-view-day-content-event-text\",\"full-height\"),r?this._addClass(c,\"mega-published-event\"):this._addClass(c,\"mega-unpublished-event\"),h?this._addClass(c,\"mega-my-event\"):this._addClass(c,\"mega-shared-event\"),a.startTime){let n=e(a.startTime,\"HH:mm\").format(this.options.timeFormat);const s=t(\"<span/>\");s.html(n),this._addClass(s,\"megaTime time\"),s.appendTo(c)}if(d&&\"-\"!==t.trim(d)){const e=t(\"<div/>\"),a=t(\"<span/>\");if(a.html(t.trim(d)),a.addClass(\"megaTitlePara\"),a.appendTo(e),this._addClass(e,\"megaTitle title\"),!h&&this.options.showOwners){const t=`Owned by ${l.calendarName} (${l.handle})`;e.attr(\"title\",t)}e.appendTo(c)}if(this.options.showLegends){const e=t(\"<div/>\");if(this._addClass(e,\"megaIcons\"),e.appendTo(c),r){const a=t(\"<i/>\");this._addClass(a,\"icon-bullhorn\"),a.attr(\"aria-hidden\",!0),a.appendTo(e);const n=t(\"<span />\");this._addClass(n,\"sr-only\"),n.html(\"Published Event\"),n.appendTo(c)}}n.on(\"click\",function(t){this._trigger(\"eventClick\",t,{eventId:i,createdByMe:h}),t.stopPropagation()}.bind(this)),n.on(\"contextmenu\",function(t){this._preventEventPropagation(t),this._trigger(\"eventContextMenu\",t,{eventId:i})}.bind(this)),n.on(\"mouseover focus\",function(t){this._preventEventPropagation(t),this._trigger(\"eventHover\",t,{eventId:i})}.bind(this))}}.bind(this))}.bind(this))},_processEventImage:function(t,e){const{imageUrl:a,imageUrlSquare:n,imageUrlDetail:s,iamgeUrlBanner:o}=t;let i=a;switch(this.options.eventImageSize){case\"square\":i=n||a;break;case\"detail\":i=s||a;break;case\"banner\":i=o||a;break;case\"full\":default:i=a}i?this._createPanelImageHolder(e,\"one-image\",i):(this._addClass(e,\"noImage\"),this._addClass(e.parent(),\"noImageEvent\"),this.options.defaultEventImageUrl&&this._processPanelDefaultImage(e,this.options.defaultEventImageUrl))},_hideLoader:function(){this._removeClass(this.calendarLoader,\"mega-loading-animation\",\"visible\")._addClass(this.calendarLoader,\"mega-loading-animation\",\"hidden\")},_processTooltip:function(){this.tooltip=t(\"<div/>\"),this._addClass(this.tooltip,\"mega-tooltip\"),this.tooltip.appendTo(this.content),this.tooltip.hide();const e=t(\"<div/>\");this._addClass(e,\"arrow-zone bottom\"),e.appendTo(this.tooltip);const a=t(\"<div/>\");this._addClass(a,\"arrow\"),a.appendTo(e);const n=t(\"<div/>\");this._addClass(n,\"view\"),n.appendTo(this.tooltip);const s=t(\"<div/>\");this._addClass(s,\"megaToolContent\",\"hidden\"),s.appendTo(n);const o=t(\"<div/>\");if(this._addClass(o,\"animation\",\"hidden\"),o.appendTo(n),this.options.loaderImageUrl){t(`<img src=\"${this.options.loaderImageUrl}\" alt=\"Loading Spinner\" />`).appendTo(o)}t(\"body\").on(\"click mouseover\",function(e){!1===t(e.target).is(this.tooltip)&&!1===t.contains(this.tooltip.get(0),e.target)&&this._hideTooltip()}.bind(this)),parent.document&&t(parent.document).on(\"click mouseover\",function(t){this._hideTooltip()}.bind(this))},_createTooltipContent:function(t){const e=this.tooltip.find(\"div.megaToolContent\");e.empty(),e.html(t),this._removeClass(e,\"megaToolContent\",\"hidden\")._addClass(e,\"megaToolContent\",\"visible\")},_createTooltipPanels:function(t,e){},_processPanelDefaultImage:function(t,e){this._createPanelImageHolder(t,\"one-image\",e)},_createPanelImageHolder:function(e,a,n){const s=e.find(\"div.image-zone\"),o=t(\"<div/>\");this._addClass(o,a),o.appendTo(s);const i=t(\"<img/>\");i.attr(\"src\",n),i.attr(\"alt\",\"An image representing the event\"),i.appendTo(o)},_hideTooltip:function(){this.popper&&this.popper.destroy(),this.tooltip.hide()},_refresh:function(t){this.calendarBody.remove(),this.toolbarMonth.html(this.startOfMonth.format(this.options.dateFormat.toolbar)),this._processCalendarBody(),this._trigger(\"calendarViewChange\",t,{date:this.startOfMonth.toDate()})},_getCalendarDates:function(){let t=this._getStartOfCalendar(this.startOfMonth),e=this._getEndOfCalendar(this.endOfMonth);const a=[];for(;!t.isAfter(e,\"day\");)a.push(t.clone()),t=t.add(1,\"day\");return a},_getStartOfMonth:function(t){return this._resetTime(t.clone().startOf(\"month\"))},_getEndOfMonth:function(t){return this._resetTime(t.clone().endOf(\"month\"))},_getStartOfCalendar:function(t){return this._resetTime(t.clone().startOf(\"week\"))},_getEndOfCalendar:function(t){return this._resetTime(t.clone().endOf(\"week\"))},_resetTime:function(t){return t.hours(0).minutes(0).seconds(0).milliseconds(0)},_preventEventPropagation:function(t){t&&(t.preventDefault(),t.stopPropagation())},_getImageAtSize:function(t,e){return t.replace(/\\.([^\\.]*)$/,\"-\"+e+\".$1\")}})}(jQuery);","//Front end JS for MegaCal Integration Plugin \r\n(function( $ ) {\r\n\r\n\tvar RESULTS_PER_PAGE;\r\n\tconst GENERIC_ERROR_MSG = '<p class=\"megacal-err-msg\">Please <a href=\"#\" class=\"megacal-err-reload\">click to refresh</a> the calendar.</p>';\r\n\r\n\t$(document).ready(function() {\r\n\r\n\t\t/** Only run on pages where the plugin exists **/\r\n\t\tif( $( \".megacal-events-integration\" ).length > 0 ) {\r\n\t\t\t\r\n\t\t\tvar upcomingEvents = $( '.megacalUpcomingEvents' );\r\n\t\t\tvar pastEvents = $( '.megacalPastEvents' );\r\n\t\t\tvar $calendar = $( '.megacal-public-calendar' );\r\n\t\t\tvar date = new Date();\r\n\r\n\t\t\t$( document ).on( 'click', 'a.megacal-err-reload', function( e ) {\r\n\t\t\t\te.preventDefault();\r\n\t\t\t\twindow.location.reload();\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\t/** loadEvents function definition **/\r\n\t\t\tconst loadEvents = function( container, listType, currentPage ) {\r\n\r\n\t\t\t\tvar pluginWrap = container.closest( '.megacal-events-integration' );\r\n\t\t\t\tvar eventList = container.find('.eventsList');\r\n\t\t\t\t//var preLoader = container.find('.preLoader');\r\n\t\t\t\tvar preLoader = container.find('.preLoader').first();\r\n\t\t\t\t\r\n\t\t\t\tvar descrip = pluginWrap.find( '.descripParam' ).val();\r\n\t\t\t\tvar buttons = pluginWrap.find( '.buttonsParam' ).val();\r\n\t\t\t\tvar list_style = pluginWrap.find( '.listStyleParam' ).val();\r\n\t\t\t\tvar nextDateField = ( 'past' === listType ) ? pluginWrap.find( '.megacalPastListDate' ) : pluginWrap.find( '.megacalUpcomingListDate' );\r\n\t\t\t\tvar list_date = nextDateField.val();\r\n\t\t\t\tvar eventOwner = pluginWrap.find( '.eventOwnerParam' ).val();\r\n\r\n\t\t\t\tpreLoader.show();\r\n\r\n\t\t\t\t/** Validate POST params **/\r\n\r\n\t\t\t\t\tif( typeof listType !== 'string' ) {\r\n\t\t\t\t\t\tconsole.error(\"listType must be a string\");\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t} else if(listType.trim() != 'upcoming' && listType.trim() != 'past') {\r\n\t\t\t\t\t\tconsole.error(\"listType must be 'upcoming' or 'past'\");\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif( typeof descrip === 'undefined' ) {\r\n\t\t\t\t\t\tconsole.error(\"descrip must be 'true' or 'false'\");\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif( typeof buttons !== 'string' ) {\r\n\t\t\t\t\t\tconsole.error(\"buttons must be a string\");\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t} else if(buttons.trim() != 'left' && buttons.trim() != 'right' && buttons.trim() != 'center') {\r\n\t\t\t\t\t\tconsole.error(\"buttons must be 'left', 'right', or 'center'\");\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif( typeof list_style !== 'string' ) {\r\n\t\t\t\t\t\tconsole.error( 'list_style must be a string' );\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif( typeof currentPage !== 'number' ) {\r\n\t\t\t\t\t\tconsole.error( \"currentPage must be a number\" );\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t/** End Validation **/\r\n\r\n\t\t\t\tvar _nonce = pluginWrap.find( '#_megacal_fetch_public_events_nonce' ).val();\r\n\r\n\t\t\t\tvar prevMonthLabel = container.find( '.megacal-month-label' ).last();\r\n\t\t\t\tvar prevMonth = prevMonthLabel.length > 0 ? prevMonthLabel.text() : '';\r\n\t\t\t\tvar lastEvent = container.find( '.listItem' ).last();\r\n\t\t\t\t\r\n\t\t\t\tvar event_list_data = {\r\n\t\t\t\t\t'action' : 'megacal_load_events_list',\r\n\t\t\t\t\t_nonce,\r\n\t\t\t\t\tlistType,\r\n\t\t\t\t\tdescrip,\r\n\t\t\t\t\tbuttons,\r\n\t\t\t\t\tlist_style,\r\n\t\t\t\t\tlist_date,\r\n\t\t\t\t\teventOwner,\r\n\t\t\t\t\tcurrentPage,\r\n\t\t\t\t\tprevMonth,\r\n\t\t\t\t};\r\n\r\n\t\t\t\t$.post(\r\n\t\t\t\t\tmegacal_script_opts.ajax_url,\r\n\t\t\t\t\tevent_list_data,\r\n\t\t\t\t\tfunction( response ) {\r\n\r\n\t\t\t\t\t\tif( false === response.success ) {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tconsole.error( 'error loading events' );\r\n\t\t\t\t\t\t\tcontainer.find(\".loadMoreBtn\").hide();\r\n\t\t\t\t\t\t\treturn;\r\n\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\teventList.append( response.data.content );\r\n\r\n\t\t\t\t\t\tvar $totalPages = container.find( '.megacal-list-total-pages' );\r\n\t\t\t\t\t\tvar total = parseInt( $totalPages.val() ) - 1;\r\n\r\n\t\t\t\t\t\tif( total > currentPage )\r\n\t\t\t\t\t\t\tcontainer.find( '.loadMoreBtn' ).show();\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\tcontainer.find( '.loadMoreBtn' ).hide();\r\n\r\n\t\t\t\t\t\teventList.find('.summaryToggle').unbind('click').click( function(e) {\r\n\t\t\t\t\t\t\te.preventDefault();\r\n\r\n\t\t\t\t\t\t\tvar event = $(this).parents('.listEvent');\r\n\r\n\t\t\t\t\t\t\t$(this).toggleClass('expanded');\r\n\t\t\t\t\t\t\t$(this).toggleClass('collapsed');\r\n\r\n\t\t\t\t\t\t\tevent.find('.fullInfo').stop().slideToggle(200);\r\n\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\tif( 'past' === listType ) {\r\n\t\t\t\t\t\t\tnextDateField.val( response.data.next_date );\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif( currentPage > 0 ) {\r\n\t\t\t\t\t\t\tlastEvent.find( 'a' ).first().focus();\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t})\r\n\t\t\t\t.fail( function() {\r\n\r\n\t\t\t\t\tconsole.error( 'error loading events' );\r\n\t\t\t\t\tcontainer.find(\".loadMoreBtn\").hide();\r\n\t\t\t\t\tshowReloadBtn( container );\r\n\r\n\t\t\t\t})\r\n\t\t\t\t.complete( function() {\r\n\r\n\t\t\t\t\tpreLoader.hide();\r\n\r\n\t\t\t\t});\r\n\r\n\t\t\t};\r\n\r\n\t\t\tconst loadCalendarView = function( $eventCalendar, date ) {\r\n\r\n\t\t\t\tvar pluginWrap = $eventCalendar.closest( '.megacal-events-integration' );\r\n                \r\n\t\t\t\tconst format = 'YYYY-MM-DD';\r\n                const aMoment = moment( date ).hours(0)\r\n                    .minutes(0)\r\n                    .seconds(0)\r\n                    .milliseconds(0);\r\n\r\n                const startDate = aMoment.clone().startOf( 'month' ).startOf( 'week' ).format( format );\r\n                const endDate = aMoment.clone().endOf( 'month' ).endOf( 'week' ).format( format );\r\n    \r\n\t\t\t\tvar _nonce = pluginWrap.find( '#_megacal_fetch_public_events_nonce' ).val();\r\n\t\t\t\tvar eventOwner = pluginWrap.find( '.eventOwnerParam' ).val();\r\n\t\t\t\tvar currentFilter;\r\n\t\t\t\tvar eventCategories;\r\n\r\n\t\t\t\tcurrentFilter = $eventCalendar.data( 'category-filter' );\r\n\t\t\t\teventCategories = ( currentFilter !== '' ) ? [parseInt( currentFilter )] : null;\r\n\r\n                $eventCalendar.eventCalendar( 'showLoader' );\r\n\r\n                var fetchEventsData = {\r\n                    action: 'megacal_fetch_public_calendar_events',\r\n                    _nonce,\r\n                    startDate,\r\n                    endDate,\r\n\t\t\t\t\teventOwner,\r\n\t\t\t\t\teventCategories,\r\n                };\r\n\r\n                $.post(\r\n\r\n                    megacal_script_opts.ajax_url,\r\n                    fetchEventsData,\r\n                    function( response ) {\r\n                        \r\n                        if( false == response.success ) {\r\n                            console.error( response.data.message );\r\n                            return;\r\n                        }\r\n                        \r\n                        $eventCalendar.eventCalendar( \r\n                            'option', \r\n                            'events', \r\n                            { \r\n                                'events': response.data.events \r\n                            } \r\n                        );\r\n\r\n                    }\r\n\r\n                )\r\n                .fail( function() {\r\n                    \r\n\t\t\t\t\tshowReloadBtn( $eventCalendar.parent() );\r\n\r\n                })\r\n                .done( function() {\r\n\r\n                    $eventCalendar.eventCalendar( 'hideLoader' );\r\n\r\n                });\r\n            };\r\n\r\n\t\t\tconst displayPopupContent = function( $eventCalendar, data ) {\r\n\r\n\t\t\t\t$eventCalendar.eventCalendar( 'showPopup', data.eventId );\r\n\t\t\t\t\r\n\t\t\t\tvar $pluginWrap = $eventCalendar.closest( '.megacal-events-integration' );\r\n\t\t\t\tvar eventId = data.eventId;\r\n\t\t\t\tvar _nonce = $pluginWrap.find( '#_megacal_get_event_popup_nonce' ).val();\r\n\r\n\t\t\t\tvar getPopupData = {\r\n\t\t\t\t\taction: 'megacal_load_event_popup',\r\n\t\t\t\t\teventId,\r\n\t\t\t\t\t_nonce,\r\n\t\t\t\t};\r\n\r\n\t\t\t\t$.post(\r\n\r\n                    megacal_script_opts.ajax_url,\r\n                    getPopupData,\r\n                    function( response ) {\r\n                        \r\n                        if( false == response.success ) {\r\n                            console.error( response.data.message );\r\n                            return;\r\n                        }\r\n\r\n\t\t\t\t\t\t$eventCalendar.eventCalendar( 'setEvent', response.data.content );\r\n\t\t\t\t\t\t$eventCalendar.eventCalendar( 'refreshTooltip' );\r\n\r\n                    }\r\n\r\n                ).fail( function() {\r\n\t\t\t\t\t$eventCalendar.eventCalendar( 'setEvent', GENERIC_ERROR_MSG );\r\n\t\t\t\t\t$eventCalendar.eventCalendar( 'refreshTooltip' );\r\n\t\t\t\t});\r\n\r\n\t\t\t};\r\n\r\n\t\t\t/** LOAD EVENTS ON PAGE LOAD **/\r\n\t\t\tupcomingEvents.each(function() {\r\n\t\t\t\tloadEvents( $( this ), \"upcoming\", 0 );\r\n\t\t\t});\r\n\r\n\t\t\tpastEvents.each(function() {\r\n\t\t\t\tloadEvents( $( this ), \"past\", 0 );\r\n\t\t\t});\r\n\r\n\t\t\t//Click Load More \r\n\t\t\t$(\".loadMoreBtn\").click(function(e) {\r\n\r\n\t\t\t\te.preventDefault();\r\n\r\n\t\t\t\tvar container = $( this ).closest( '.megacal-tab' );\r\n\t\t\t\tvar preLoader = container.find( '.preLoader' );\r\n\t\t\t\tvar currentPage = parseInt( container.find( '.pageNum' ).val() );\r\n\t\t\t\tvar listType;\r\n\r\n\t\t\t\tif( container.hasClass( 'megacalUpcomingEvents' ) ) {\r\n\t\t\t\t\tlistType = 'upcoming';\r\n\t\t\t\t} else if( container.hasClass( 'megacalPastEvents' ) ) {\r\n\t\t\t\t\tlistType = 'past';\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$( this ).hide();\r\n\t\t\t\tpreLoader.show();\r\n\r\n\t\t\t\tcontainer.find( '.pageNum' ).val( currentPage + 1 );\r\n\t\t\t\tcontainer.find( '.megacal-list-total-pages' ).remove();\r\n\r\n\t\t\t\tloadEvents( container, listType, currentPage );\r\n\r\n\t\t\t});\r\n\r\n\t\t\t//Tabs\r\n\t\t\t$( '.megacal-tabNav' ).each( function() {\r\n\r\n\t\t\t\tvar $this = $( this );\r\n\t\t\t\t$this.attr( 'role', 'tablist' );\r\n\r\n\t\t\t\t$this.find( 'li > a' ).each( function() {\r\n\t\t\t\t\t\r\n\t\t\t\t\tvar $tab = $( this );\r\n\t\t\t\t\tvar id = $tab.attr( 'href' );\r\n\r\n\t\t\t\t\t$tab.attr( 'role', 'tab' );\r\n\t\t\t\t\t$tab.attr( 'aria-controls', id );\r\n\t\t\t\t\t$( id ).attr( 'role', 'tabpanel' );\r\n\t\t\t\t\t\r\n\t\t\t\t} );\r\n\r\n\t\t\t} );\r\n\r\n\t\t\t$('.megacal-tabNav a').click(function(e) {\r\n\t\t\t\te.preventDefault();\r\n\t\t\t\t\r\n\t\t\t\tvar id = $(this).attr('href');\r\n\t\t\t\tvar navContainer = $(this).closest('.megacal-tabNav');\r\n\t\t\t\tvar container = navContainer.closest('.megacal-tabs');\r\n\t\t\t\tvar liElem = $(this).parent();\r\n\r\n\t\t\t\tnavContainer.find('li').removeClass('current');\r\n\t\t\t\tliElem.addClass('current');\r\n\r\n\t\t\t\tnavContainer.find( 'a' ).attr( 'aria-selected', false );\r\n\t\t\t\t$( this ).attr( 'aria-selected', true );\r\n\r\n\t\t\t\tcontainer.children('.megacal-tab').removeClass('current');\r\n\t\t\t\t$(id).addClass('current');\r\n\t\t\t});\r\n\r\n\t\t\t\r\n\t\t\t$calendar.each( function() {\r\n\t\t\t\t\r\n\t\t\t\t$this = $( this );\r\n\t\t\t\tvar $pluginWrap = $this.closest( '.megacal-events-integration' );\r\n\t\t\t\tvar imgHeight = $pluginWrap.find( '.imgHeightParam' ).val();\r\n\r\n\t\t\t\tvar sliderVal = ( $.isNumeric( imgHeight ) ) ? parseInt( imgHeight ) : 20;\r\n\t\t\t\tvar showImage = ( 'img' == $pluginWrap.find( '.displayParam').val() );\r\n\t\t\t\t\r\n\t\t\t\t$this.eventCalendar({\r\n\r\n\t\t\t\t\tshowAdd: false,\r\n\t\t\t\t\tshowLegends: false,\r\n\t\t\t\t\tshowImage: showImage,\r\n\t\t\t\t\ttimeFormat: megacal_script_opts.time_fmt_setting,\r\n\t\t\t\t\tdateFormat: {\r\n\t\t\t\t\t\tcalendar: 'D',\r\n\t\t\t\t\t\tcalendarFirst: 'MMM D',\r\n\t\t\t\t\t},\r\n\t\t\t\t\tslider: {\r\n\t\t\t\t\t\tvalue: sliderVal, \r\n\t\t\t\t\t},\r\n\t\t\t\t\tshowSlider: false,\r\n\t\t\t\t\tloaderImageUrl: megacal_script_opts.base_url + '/assets/img/loading.svg',\r\n\t\t\t\t\tdefaultEventImageUrl: megacal_script_opts.default_image_path\r\n\r\n\t\t\t\t}).on('eventcalendar.calendarviewchange', ( event, data ) => {\r\n\t\t\t\t\t\r\n\t\t\t\t\tloadCalendarView( $this, data.date );\r\n\t\t\t\t\tdate = data.date;\r\n\r\n\t\t\t\t});\r\n\r\n\t\t\t\tloadCalendarView( $this, date );\r\n\t\t\t\r\n\t\t\t}).on('eventcalendar.eventhover', ( event, data ) => {\r\n    \r\n\t\t\t\tdisplayPopupContent( $this, data );\r\n\r\n            }).on( 'eventcalendar.eventclick', ( event, data ) => {\r\n\r\n\t\t\t\tif( megacal_script_opts.permalink_structure == '/' || megacal_script_opts.permalink_structure == '' ) {\r\n\t\t\t\t\twindow.location.assign( megacal_script_opts.event_url + '&event_id=' + data.eventId );\r\n\t\t\t\t} else {\r\n\t\t\t\t\twindow.location.assign( megacal_script_opts.event_url + data.eventId );\r\n\t\t\t\t}\r\n\r\n\t\t\t});\r\n\r\n\t\t\t$( '.megacal-subscribe-select' ).on( 'change', function() {\r\n\r\n\t\t\t\tvar url = $( this ).val();\r\n\t\t\t\tif( typeof url == 'undefined' || url.trim() == '' ) {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\twindow.open( url, '_blank' );\r\n\r\n\t\t\t});\r\n\r\n\t\t\t$( '.megacal-filter-cat-btn' ).on( 'click', function( e ) {\r\n\r\n\t\t\t\te.preventDefault();\r\n\t\t\t\tvar $this = $( this );\r\n\t\t\t\tvar $container = $this.closest( '.megacal-filter-section' );\r\n\t\t\t\tvar pluginWrap = $this.closest( '.megacal-events-integration' );\r\n\t\t\t\tvar $closestCal = pluginWrap.find( '.megacal-public-calendar' );\r\n\r\n\t\t\t\t$container.find( '.megacal-filter-cat-btn' ).removeClass( 'current' );\r\n\t\t\t\t$container.find( '.megacal-filter-cat-btn' ).attr( 'aria-pressed', false );\r\n\t\t\t\t$this.addClass( 'current' );\r\n\t\t\t\t$this.attr( 'aria-pressed', true );\r\n\r\n\t\t\t\t$closestCal.data( 'category-filter', $this.data( 'cat-id' ) );\r\n\t\t\t\t$closestCal.eventCalendar( 'refresh' );\r\n\t\t\t\r\n\t\t\t} );\r\n\r\n\t\t}\r\n\r\n\t});\r\n\r\n\t$(window).load(function() {\r\n\t\tif($(\".megacal-events-integration\").length > 0) {\r\n\t\t\tif($('#viewParam').length > 0) {\r\n\t\t\t\tvar view = $('#viewParam').val();\r\n\r\n\t\t\t\tif(view !== undefined && view.trim() !== '') {\r\n\t\t\t\t\tif(view == 'list')\r\n\t\t\t\t\t\t$('#listViewToggle').click();\r\n\t\t\t\t\telse if(view == 'cal')\r\n\t\t\t\t\t\t$('#calViewToggle').click();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n\r\n\t//Function Definitions\r\n\tfunction showEventPopupDetails( eventId ) {\r\n\t\tvar modalContainer = $('.eventDetailModal');\r\n\t\tvar mask = $('.megacal-integration-mask');\r\n\r\n\t\tif(megacal_script_opts !== undefined) {\t\t\r\n\t\t\tvar preLoader = modalContainer.find('.preLoader').first();\r\n\r\n\t\t\tvar list_style = $('#listStyleParam').val();\r\n\t\t\tvar show_venue = $('#showVenueParam').val();\r\n\t\t\t\r\n\t\t\tif( list_style !== undefined && typeof list_style !== 'string' ) {\r\n\t\t\t\tconsole.error( 'list_style must be a string' );\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\r\n\t\t\tif( show_venue === undefined ) {\r\n\t\t\t\tconsole.error( 'show_venue is required' );\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\r\n\t\t\tmask.fadeIn(200);\r\n\t\t\tmodalContainer.fadeIn(200);\r\n\r\n\t\t\t/** Validate POST params **/\r\n\t\t\t\tif(eventId === undefined || (eventId !== undefined && !$.isNumeric(eventId))) {\r\n\t\t\t\t\tconsole.log(\"eventId must be a number\");\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t/** End Validation **/\r\n\r\n\t\t\tvar event_detail_data = {\r\n\t\t\t\t'action' : 'load_event_details',\r\n\t\t\t\t'eventId' : eventId,\r\n\t\t\t\t'security' : megacal_script_opts.ajax_nonce,\r\n\t\t\t\t'list_style': list_style,\r\n\t\t\t\t'show_venue': show_venue\r\n\t\t\t};\r\n\r\n\t\t\t$.post(\r\n\t\t\t\tmegacal_script_opts.ajax_url,\r\n\t\t\t\tevent_detail_data,\r\n\t\t\t\tfunction(html) {\r\n\t\t\t\t\tmodalContainer.html(html);\r\n\r\n\t\t\t\t\t$('body').addClass('noScroll');\r\n\t\t\t\t\t$('html').css(\"overflow\", \"hidden\");\r\n\r\n\t\t\t\t\t//Set up the click listener on the close button\r\n\t\t\t\t\tmodalContainer.find('.modalClose').click(function(e) {\r\n\t\t\t\t\t\te.preventDefault();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tmodalContainer.fadeOut(200, function() {\r\n\t\t\t\t\t\t\tmodalContainer.html(preLoader);\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tmask.fadeOut(200);\r\n\t\t\t\t\t\t$('body').removeClass('noScroll');\r\n\t\t\t\t\t\t$('html').css(\"overflow\", \"auto\");\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\t$(\".megacal-integration-mask\").click(function(e) {\r\n\t\t\t\t\t\te.preventDefault();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tmodalContainer.fadeOut(200, function() {\r\n\t\t\t\t\t\t\tmodalContainer.html(preLoader);\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tmask.fadeOut(200);\r\n\t\t\t\t\t\t$('body').removeClass('noScroll');\r\n\t\t\t\t\t\t$('html').css(\"overflow\", \"auto\");\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\tloadMediaTabsMegaCal();\r\n\r\n\t\t\t\t}\r\n\t\t\t);\r\n\t\t}\r\n\t}\r\n\r\n\tfunction loadMediaTabsMegaCal() {\r\n\t\t$(\".mediaTabNav a\").click(function(e){\r\n\t\t\te.preventDefault();\r\n\r\n\t\t\tvar tabId = $(this).attr(\"href\").substring(1);\r\n\t\t\tvar navContainer = $(this).closest(\".mediaTabNav\");\r\n\t\t\tvar container = navContainer.closest(\".mediaHolder\");\r\n\t\t\tvar tabContainer = container.find(\".artistMediaTabs\");\r\n\t\t\tvar tab = tabContainer.find(\".\"+tabId);\r\n\r\n\t\t\tnavContainer.find('.current').removeClass('current');\r\n\t\t\t$(this).parent().addClass('current');\r\n\r\n\t\t\ttabContainer.find('.current').removeClass('current');\r\n\t\t\ttab.addClass('current');\r\n\t\t});\r\n\r\n\t\t$(\".artistMediaExpander\").click(function(e){\r\n\t\t\te.preventDefault();\r\n\r\n\t\t\tvar artistMediaSection = $(this).next(\".artistMediaSection\");\r\n\r\n\t\t\tif(artistMediaSection.hasClass('expanded')) {\r\n\t\t\t\tartistMediaSection.removeClass('expanded').stop().slideUp();\r\n\t\t\t} else {\r\n\t\t\t\tartistMediaSection.addClass('expanded').stop().slideDown();\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tfunction showReloadBtn( $container ) {\r\n\t\t$container.html( GENERIC_ERROR_MSG );\r\n\t}\r\n\r\n})( jQuery );"]}
  • megabase-calendar/trunk/assets/src/js/admin/admin-scripts.js

    r2927202 r2935728  
    3737            } catch (err) {
    3838
    39                 console.log(err);
     39                console.error( err );
    4040                $('.copyFail').fadeIn().delay(200).fadeOut();
    4141           
     
    375375                        }
    376376
    377                         console.log( response );
    378    
    379377                        approvalNotice.fadeOut( 200, function() {
    380378                            $( this ).remove();
     
    516514                            }
    517515
    518                             console.log( response );
    519                            
    520516                            $saveEventWrap.fadeOut( 500, function() {
    521517                                $calendar.eventCalendar( 'refresh' );
     
    902898                            showAlertNotification( response.data.message, 'error' );
    903899
    904                             console.log( response );
    905900                            return;
    906901                        }
     
    931926                                        showAlertNotification( response.data.message, 'error' );
    932927
    933                                         console.log( response );
    934928                                        return;
    935929                                    }
     
    10481042                            }
    10491043
     1044                            if( $customRecurrenceTypeSelect.length < 1 ) {
     1045                                return;
     1046                            }
     1047
    10501048                            var customRecurrenceType = $customRecurrenceTypeSelect.val().toLowerCase();
    10511049                            var customDetail = recurrence_details.custom;
     
    10541052                            var afterOccurrence = detailVals.end_condition.after_occurrence;
    10551053                            var repetition = customDetail.repetition;
    1056 
    1057                             if( recurrence ) {
    1058 
     1054                           
     1055                            if( recurrence ) {   
     1056                               
    10591057                                if( recurrence.custom ) {
    1060                                     var recurrenceDetails = recurrence.custom[customRecurrenceType + '_custom'];
     1058                                    var recurrenceDetails = recurrence.custom[customRecurrenceType + '_custom'] || recurrence.custom;
    10611059                                    repetition = recurrence.custom.repetition||repetition;
    10621060
  • megabase-calendar/trunk/class-megabase-calendar.php

    r2932767 r2935728  
    55Description: A flexible calendar and event list for communities, businesses and organizations.
    66Author: Megabase
    7 Version: 1.2.8
     7Version: 1.2.9
    88Author URI: https://megabase.co/
    99
  • megabase-calendar/trunk/readme.txt

    r2932767 r2935728  
    55Tested up to: 6.2.2
    66Requires PHP: 7.4
    7 Stable tag: 1.2.8
     7Stable tag: 1.2.9
    88License: GPLv3 or later
    99License URI: https://www.gnu.org/licenses/gpl.html
     
    9393== Changelog ==
    9494
     95= 1.2.9 =
     96* Fixed a bug with custom daily recurrence
     97
    9598= 1.2.8 =
    9699* Fixed a rogue sourcemap 404
Note: See TracChangeset for help on using the changeset viewer.