if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(n){"use strict";var t=n.fn.jquery.split(" ")[0].split(".");if(t[0]<2&&t[1]<9||1==t[0]&&9==t[1]&&t[2]<1||t[0]>3)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4");}(jQuery);+function(n){"use strict";function t(){var i=document.createElement("bootstrap"),n={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var t in n)if(void 0!==i.style[t])return{end:n[t]};return!1}n.fn.emulateTransitionEnd=function(t){var i=!1,u=this,r;n(this).one("bsTransitionEnd",function(){i=!0});return r=function(){i||n(u).trigger(n.support.transition.end)},setTimeout(r,t),this};n(function(){n.support.transition=t();n.support.transition&&(n.event.special.bsTransitionEnd={bindType:n.support.transition.end,delegateType:n.support.transition.end,handle:function(t){if(n(t.target).is(this))return t.handleObj.handler.apply(this,arguments)}})})}(jQuery);+function(n){"use strict";function u(i){return this.each(function(){var r=n(this),u=r.data("bs.alert");u||r.data("bs.alert",u=new t(this));"string"==typeof i&&u[i].call(r)})}var i='[data-dismiss="alert"]',t=function(t){n(t).on("click",i,this.close)},r;t.VERSION="3.3.7";t.TRANSITION_DURATION=150;t.prototype.close=function(i){function e(){r.detach().trigger("closed.bs.alert").remove()}var f=n(this),u=f.attr("data-target"),r;u||(u=f.attr("href"),u=u&&u.replace(/.*(?=#[^\s]*$)/,""));r=n("#"===u?[]:u);i&&i.preventDefault();r.length||(r=f.closest(".alert"));r.trigger(i=n.Event("close.bs.alert"));i.isDefaultPrevented()||(r.removeClass("in"),n.support.transition&&r.hasClass("fade")?r.one("bsTransitionEnd",e).emulateTransitionEnd(t.TRANSITION_DURATION):e())};r=n.fn.alert;n.fn.alert=u;n.fn.alert.Constructor=t;n.fn.alert.noConflict=function(){return n.fn.alert=r,this};n(document).on("click.bs.alert.data-api",i,t.prototype.close)}(jQuery);+function(n){"use strict";function i(i){return this.each(function(){var u=n(this),r=u.data("bs.button"),f="object"==typeof i&&i;r||u.data("bs.button",r=new t(this,f));"toggle"==i?r.toggle():i&&r.setState(i)})}var t=function(i,r){this.$element=n(i);this.options=n.extend({},t.DEFAULTS,r);this.isLoading=!1},r;t.VERSION="3.3.7";t.DEFAULTS={loadingText:"loading..."};t.prototype.setState=function(t){var i="disabled",r=this.$element,f=r.is("input")?"val":"html",u=r.data();t+="Text";null==u.resetText&&r.data("resetText",r[f]());setTimeout(n.proxy(function(){r[f](null==u[t]?this.options[t]:u[t]);"loadingText"==t?(this.isLoading=!0,r.addClass(i).attr(i,i).prop(i,!0)):this.isLoading&&(this.isLoading=!1,r.removeClass(i).removeAttr(i).prop(i,!1))},this),0)};t.prototype.toggle=function(){var t=!0,i=this.$element.closest('[data-toggle="buttons"]'),n;i.length?(n=this.$element.find("input"),"radio"==n.prop("type")?(n.prop("checked")&&(t=!1),i.find(".active").removeClass("active"),this.$element.addClass("active")):"checkbox"==n.prop("type")&&(n.prop("checked")!==this.$element.hasClass("active")&&(t=!1),this.$element.toggleClass("active")),n.prop("checked",this.$element.hasClass("active")),t&&n.trigger("change")):(this.$element.attr("aria-pressed",!this.$element.hasClass("active")),this.$element.toggleClass("active"))};r=n.fn.button;n.fn.button=i;n.fn.button.Constructor=t;n.fn.button.noConflict=function(){return n.fn.button=r,this};n(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(t){var r=n(t.target).closest(".btn");i.call(r,"toggle");n(t.target).is('input[type="radio"], input[type="checkbox"]')||(t.preventDefault(),r.is("input,button")?r.trigger("focus"):r.find("input:visible,button:visible").first().trigger("focus"))}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(t){n(t.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(t.type))})}(jQuery);+function(n){"use strict";function i(i){return this.each(function(){var u=n(this),r=u.data("bs.carousel"),f=n.extend({},t.DEFAULTS,u.data(),"object"==typeof i&&i),e="string"==typeof i?i:f.slide;r||u.data("bs.carousel",r=new t(this,f));"number"==typeof i?r.to(i):e?r[e]():f.interval&&r.pause().cycle()})}var t=function(t,i){this.$element=n(t);this.$indicators=this.$element.find(".carousel-indicators");this.options=i;this.paused=null;this.sliding=null;this.interval=null;this.$active=null;this.$items=null;this.options.keyboard&&this.$element.on("keydown.bs.carousel",n.proxy(this.keydown,this));"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",n.proxy(this.pause,this)).on("mouseleave.bs.carousel",n.proxy(this.cycle,this))},u,r;t.VERSION="3.3.7";t.TRANSITION_DURATION=600;t.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0};t.prototype.keydown=function(n){if(!/input|textarea/i.test(n.target.tagName)){switch(n.which){case 37:this.prev();break;case 39:this.next();break;default:return}n.preventDefault()}};t.prototype.cycle=function(t){return t||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(n.proxy(this.next,this),this.options.interval)),this};t.prototype.getItemIndex=function(n){return this.$items=n.parent().children(".item"),this.$items.index(n||this.$active)};t.prototype.getItemForDirection=function(n,t){var i=this.getItemIndex(t),f="prev"==n&&0===i||"next"==n&&i==this.$items.length-1,r,u;return f&&!this.options.wrap?t:(r="prev"==n?-1:1,u=(i+r)%this.$items.length,this.$items.eq(u))};t.prototype.to=function(n){var i=this,t=this.getItemIndex(this.$active=this.$element.find(".item.active"));if(!(n>this.$items.length-1||n<0))return this.sliding?this.$element.one("slid.bs.carousel",function(){i.to(n)}):t==n?this.pause().cycle():this.slide(n>t?"next":"prev",this.$items.eq(n))};t.prototype.pause=function(t){return t||(this.paused=!0),this.$element.find(".next, .prev").length&&n.support.transition&&(this.$element.trigger(n.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this};t.prototype.next=function(){if(!this.sliding)return this.slide("next")};t.prototype.prev=function(){if(!this.sliding)return this.slide("prev")};t.prototype.slide=function(i,r){var e=this.$element.find(".item.active"),u=r||this.getItemForDirection(i,e),l=this.interval,f="next"==i?"left":"right",a=this,o,s,h,c;return u.hasClass("active")?this.sliding=!1:(o=u[0],s=n.Event("slide.bs.carousel",{relatedTarget:o,direction:f}),(this.$element.trigger(s),!s.isDefaultPrevented())?((this.sliding=!0,l&&this.pause(),this.$indicators.length)&&(this.$indicators.find(".active").removeClass("active"),h=n(this.$indicators.children()[this.getItemIndex(u)]),h&&h.addClass("active")),c=n.Event("slid.bs.carousel",{relatedTarget:o,direction:f}),n.support.transition&&this.$element.hasClass("slide")?(u.addClass(i),u[0].offsetWidth,e.addClass(f),u.addClass(f),e.one("bsTransitionEnd",function(){u.removeClass([i,f].join(" ")).addClass("active");e.removeClass(["active",f].join(" "));a.sliding=!1;setTimeout(function(){a.$element.trigger(c)},0)}).emulateTransitionEnd(t.TRANSITION_DURATION)):(e.removeClass("active"),u.addClass("active"),this.sliding=!1,this.$element.trigger(c)),l&&this.cycle(),this):void 0)};u=n.fn.carousel;n.fn.carousel=i;n.fn.carousel.Constructor=t;n.fn.carousel.noConflict=function(){return n.fn.carousel=u,this};r=function(t){var o,r=n(this),u=n(r.attr("data-target")||(o=r.attr("href"))&&o.replace(/.*(?=#[^\s]+$)/,"")),e,f;u.hasClass("carousel")&&(e=n.extend({},u.data(),r.data()),f=r.attr("data-slide-to"),f&&(e.interval=!1),i.call(u,e),f&&u.data("bs.carousel").to(f),t.preventDefault())};n(document).on("click.bs.carousel.data-api","[data-slide]",r).on("click.bs.carousel.data-api","[data-slide-to]",r);n(window).on("load",function(){n('[data-ride="carousel"]').each(function(){var t=n(this);i.call(t,t.data())})})}(jQuery);+function(n){"use strict";function r(t){var i,r=t.attr("data-target")||(i=t.attr("href"))&&i.replace(/.*(?=#[^\s]+$)/,"");return n(r)}function i(i){return this.each(function(){var u=n(this),r=u.data("bs.collapse"),f=n.extend({},t.DEFAULTS,u.data(),"object"==typeof i&&i);!r&&f.toggle&&/show|hide/.test(i)&&(f.toggle=!1);r||u.data("bs.collapse",r=new t(this,f));"string"==typeof i&&r[i]()})}var t=function(i,r){this.$element=n(i);this.options=n.extend({},t.DEFAULTS,r);this.$trigger=n('[data-toggle="collapse"][href="#'+i.id+'"],[data-toggle="collapse"][data-target="#'+i.id+'"]');this.transitioning=null;this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger);this.options.toggle&&this.toggle()},u;t.VERSION="3.3.7";t.TRANSITION_DURATION=350;t.DEFAULTS={toggle:!0};t.prototype.dimension=function(){var n=this.$element.hasClass("width");return n?"width":"height"};t.prototype.show=function(){var f,r,e,u,o,s;if(!this.transitioning&&!this.$element.hasClass("in")&&(r=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing"),!(r&&r.length&&(f=r.data("bs.collapse"),f&&f.transitioning))&&(e=n.Event("show.bs.collapse"),this.$element.trigger(e),!e.isDefaultPrevented()))){if(r&&r.length&&(i.call(r,"hide"),f||r.data("bs.collapse",null)),u=this.dimension(),this.$element.removeClass("collapse").addClass("collapsing")[u](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1,o=function(){this.$element.removeClass("collapsing").addClass("collapse in")[u]("");this.transitioning=0;this.$element.trigger("shown.bs.collapse")},!n.support.transition)return o.call(this);s=n.camelCase(["scroll",u].join("-"));this.$element.one("bsTransitionEnd",n.proxy(o,this)).emulateTransitionEnd(t.TRANSITION_DURATION)[u](this.$element[0][s])}};t.prototype.hide=function(){var r,i,u;if(!this.transitioning&&this.$element.hasClass("in")&&(r=n.Event("hide.bs.collapse"),this.$element.trigger(r),!r.isDefaultPrevented()))return i=this.dimension(),this.$element[i](this.$element[i]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1,u=function(){this.transitioning=0;this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")},n.support.transition?void this.$element[i](0).one("bsTransitionEnd",n.proxy(u,this)).emulateTransitionEnd(t.TRANSITION_DURATION):u.call(this)};t.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()};t.prototype.getParent=function(){return n(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(n.proxy(function(t,i){var u=n(i);this.addAriaAndCollapsedClass(r(u),u)},this)).end()};t.prototype.addAriaAndCollapsedClass=function(n,t){var i=n.hasClass("in");n.attr("aria-expanded",i);t.toggleClass("collapsed",!i).attr("aria-expanded",i)};u=n.fn.collapse;n.fn.collapse=i;n.fn.collapse.Constructor=t;n.fn.collapse.noConflict=function(){return n.fn.collapse=u,this};n(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(t){var u=n(this);u.attr("data-target")||t.preventDefault();var f=r(u),e=f.data("bs.collapse"),o=e?"toggle":u.data();i.call(f,o)})}(jQuery);+function(n){"use strict";function r(t){var i=t.attr("data-target"),r;return i||(i=t.attr("href"),i=i&&/#[A-Za-z]/.test(i)&&i.replace(/.*(?=#[^\s]*$)/,"")),r=i&&n(i),r&&r.length?r:t.parent()}function u(t){t&&3===t.which||(n(o).remove(),n(i).each(function(){var u=n(this),i=r(u),f={relatedTarget:this};i.hasClass("open")&&(t&&"click"==t.type&&/input|textarea/i.test(t.target.tagName)&&n.contains(i[0],t.target)||(i.trigger(t=n.Event("hide.bs.dropdown",f)),t.isDefaultPrevented()||(u.attr("aria-expanded","false"),i.removeClass("open").trigger(n.Event("hidden.bs.dropdown",f)))))}))}function e(i){return this.each(function(){var r=n(this),u=r.data("bs.dropdown");u||r.data("bs.dropdown",u=new t(this));"string"==typeof i&&u[i].call(r)})}var o=".dropdown-backdrop",i='[data-toggle="dropdown"]',t=function(t){n(t).on("click.bs.dropdown",this.toggle)},f;t.VERSION="3.3.7";t.prototype.toggle=function(t){var f=n(this),i,o,e;if(!f.is(".disabled, :disabled")){if(i=r(f),o=i.hasClass("open"),u(),!o){if("ontouchstart"in document.documentElement&&!i.closest(".navbar-nav").length&&n(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(n(this)).on("click",u),e={relatedTarget:this},i.trigger(t=n.Event("show.bs.dropdown",e)),t.isDefaultPrevented())return;f.trigger("focus").attr("aria-expanded","true");i.toggleClass("open").trigger(n.Event("shown.bs.dropdown",e))}return!1}};t.prototype.keydown=function(t){var e,o,s,h,f,u;if(/(38|40|27|32)/.test(t.which)&&!/input|textarea/i.test(t.target.tagName)&&(e=n(this),t.preventDefault(),t.stopPropagation(),!e.is(".disabled, :disabled"))){if(o=r(e),s=o.hasClass("open"),!s&&27!=t.which||s&&27==t.which)return 27==t.which&&o.find(i).trigger("focus"),e.trigger("click");h=" li:not(.disabled):visible a";f=o.find(".dropdown-menu"+h);f.length&&(u=f.index(t.target),38==t.which&&u>0&&u--,40==t.which&&u<f.length-1&&u++,~u||(u=0),f.eq(u).trigger("focus"))}};f=n.fn.dropdown;n.fn.dropdown=e;n.fn.dropdown.Constructor=t;n.fn.dropdown.noConflict=function(){return n.fn.dropdown=f,this};n(document).on("click.bs.dropdown.data-api",u).on("click.bs.dropdown.data-api",".dropdown form",function(n){n.stopPropagation()}).on("click.bs.dropdown.data-api",i,t.prototype.toggle).on("keydown.bs.dropdown.data-api",i,t.prototype.keydown).on("keydown.bs.dropdown.data-api",".dropdown-menu",t.prototype.keydown)}(jQuery);+function(n){"use strict";function i(i,r){return this.each(function(){var f=n(this),u=f.data("bs.modal"),e=n.extend({},t.DEFAULTS,f.data(),"object"==typeof i&&i);u||f.data("bs.modal",u=new t(this,e));"string"==typeof i?u[i](r):e.show&&u.show(r)})}var t=function(t,i){this.options=i;this.$body=n(document.body);this.$element=n(t);this.$dialog=this.$element.find(".modal-dialog");this.$backdrop=null;this.isShown=null;this.originalBodyPad=null;this.scrollbarWidth=0;this.ignoreBackdropClick=!1;this.options.remote&&this.$element.find(".modal-content").load(this.options.remote,n.proxy(function(){this.$element.trigger("loaded.bs.modal")},this))},r;t.VERSION="3.3.7";t.TRANSITION_DURATION=300;t.BACKDROP_TRANSITION_DURATION=150;t.DEFAULTS={backdrop:!0,keyboard:!0,show:!0};t.prototype.toggle=function(n){return this.isShown?this.hide():this.show(n)};t.prototype.show=function(i){var r=this,u=n.Event("show.bs.modal",{relatedTarget:i});this.$element.trigger(u);this.isShown||u.isDefaultPrevented()||(this.isShown=!0,this.checkScrollbar(),this.setScrollbar(),this.$body.addClass("modal-open"),this.escape(),this.resize(),this.$element.on("click.dismiss.bs.modal",'[data-dismiss="modal"]',n.proxy(this.hide,this)),this.$dialog.on("mousedown.dismiss.bs.modal",function(){r.$element.one("mouseup.dismiss.bs.modal",function(t){n(t.target).is(r.$element)&&(r.ignoreBackdropClick=!0)})}),this.backdrop(function(){var f=n.support.transition&&r.$element.hasClass("fade"),u;r.$element.parent().length||r.$element.appendTo(r.$body);r.$element.show().scrollTop(0);r.adjustDialog();f&&r.$element[0].offsetWidth;r.$element.addClass("in");r.enforceFocus();u=n.Event("shown.bs.modal",{relatedTarget:i});f?r.$dialog.one("bsTransitionEnd",function(){r.$element.trigger("focus").trigger(u)}).emulateTransitionEnd(t.TRANSITION_DURATION):r.$element.trigger("focus").trigger(u)}))};t.prototype.hide=function(i){i&&i.preventDefault();i=n.Event("hide.bs.modal");this.$element.trigger(i);this.isShown&&!i.isDefaultPrevented()&&(this.isShown=!1,this.escape(),this.resize(),n(document).off("focusin.bs.modal"),this.$element.removeClass("in").off("click.dismiss.bs.modal").off("mouseup.dismiss.bs.modal"),this.$dialog.off("mousedown.dismiss.bs.modal"),n.support.transition&&this.$element.hasClass("fade")?this.$element.one("bsTransitionEnd",n.proxy(this.hideModal,this)).emulateTransitionEnd(t.TRANSITION_DURATION):this.hideModal())};t.prototype.enforceFocus=function(){n(document).off("focusin.bs.modal").on("focusin.bs.modal",n.proxy(function(n){document===n.target||this.$element[0]===n.target||this.$element.has(n.target).length||this.$element.trigger("focus")},this))};t.prototype.escape=function(){this.isShown&&this.options.keyboard?this.$element.on("keydown.dismiss.bs.modal",n.proxy(function(n){27==n.which&&this.hide()},this)):this.isShown||this.$element.off("keydown.dismiss.bs.modal")};t.prototype.resize=function(){this.isShown?n(window).on("resize.bs.modal",n.proxy(this.handleUpdate,this)):n(window).off("resize.bs.modal")};t.prototype.hideModal=function(){var n=this;this.$element.hide();this.backdrop(function(){n.$body.removeClass("modal-open");n.resetAdjustments();n.resetScrollbar();n.$element.trigger("hidden.bs.modal")})};t.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove();this.$backdrop=null};t.prototype.backdrop=function(i){var e=this,f=this.$element.hasClass("fade")?"fade":"",r,u;if(this.isShown&&this.options.backdrop){if(r=n.support.transition&&f,this.$backdrop=n(document.createElement("div")).addClass("modal-backdrop "+f).appendTo(this.$body),this.$element.on("click.dismiss.bs.modal",n.proxy(function(n){return this.ignoreBackdropClick?void(this.ignoreBackdropClick=!1):void(n.target===n.currentTarget&&("static"==this.options.backdrop?this.$element[0].focus():this.hide()))},this)),r&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!i)return;r?this.$backdrop.one("bsTransitionEnd",i).emulateTransitionEnd(t.BACKDROP_TRANSITION_DURATION):i()}else!this.isShown&&this.$backdrop?(this.$backdrop.removeClass("in"),u=function(){e.removeBackdrop();i&&i()},n.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one("bsTransitionEnd",u).emulateTransitionEnd(t.BACKDROP_TRANSITION_DURATION):u()):i&&i()};t.prototype.handleUpdate=function(){this.adjustDialog()};t.prototype.adjustDialog=function(){var n=this.$element[0].scrollHeight>document.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&n?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!n?this.scrollbarWidth:""})};t.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})};t.prototype.checkScrollbar=function(){var n=window.innerWidth,t;n||(t=document.documentElement.getBoundingClientRect(),n=t.right-Math.abs(t.left));this.bodyIsOverflowing=document.body.clientWidth<n;this.scrollbarWidth=this.measureScrollbar()};t.prototype.setScrollbar=function(){var n=parseInt(this.$body.css("padding-right")||0,10);this.originalBodyPad=document.body.style.paddingRight||"";this.bodyIsOverflowing&&this.$body.css("padding-right",n+this.scrollbarWidth)};t.prototype.resetScrollbar=function(){this.$body.css("padding-right",this.originalBodyPad)};t.prototype.measureScrollbar=function(){var n=document.createElement("div"),t;return n.className="modal-scrollbar-measure",this.$body.append(n),t=n.offsetWidth-n.clientWidth,this.$body[0].removeChild(n),t};r=n.fn.modal;n.fn.modal=i;n.fn.modal.Constructor=t;n.fn.modal.noConflict=function(){return n.fn.modal=r,this};n(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',function(t){var r=n(this),f=r.attr("href"),u=n(r.attr("data-target")||f&&f.replace(/.*(?=#[^\s]+$)/,"")),e=u.data("bs.modal")?"toggle":n.extend({remote:!/#/.test(f)&&f},u.data(),r.data());r.is("a")&&t.preventDefault();u.one("show.bs.modal",function(n){n.isDefaultPrevented()||u.one("hidden.bs.modal",function(){r.is(":visible")&&r.trigger("focus")})});i.call(u,e,this)})}(jQuery);+function(n){"use strict";function r(i){return this.each(function(){var u=n(this),r=u.data("bs.tooltip"),f="object"==typeof i&&i;!r&&/destroy|hide/.test(i)||(r||u.data("bs.tooltip",r=new t(this,f)),"string"==typeof i&&r[i]())})}var t=function(n,t){this.type=null;this.options=null;this.enabled=null;this.timeout=null;this.hoverState=null;this.$element=null;this.inState=null;this.init("tooltip",n,t)},i;t.VERSION="3.3.7";t.TRANSITION_DURATION=150;t.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"><\/div><div class="tooltip-inner"><\/div><\/div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}};t.prototype.init=function(t,i,r){var f,e,u,o,s;if(this.enabled=!0,this.type=t,this.$element=n(i),this.options=this.getOptions(r),this.$viewport=this.options.viewport&&n(n.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(f=this.options.trigger.split(" "),e=f.length;e--;)if(u=f[e],"click"==u)this.$element.on("click."+this.type,this.options.selector,n.proxy(this.toggle,this));else"manual"!=u&&(o="hover"==u?"mouseenter":"focusin",s="hover"==u?"mouseleave":"focusout",this.$element.on(o+"."+this.type,this.options.selector,n.proxy(this.enter,this)),this.$element.on(s+"."+this.type,this.options.selector,n.proxy(this.leave,this)));this.options.selector?this._options=n.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()};t.prototype.getDefaults=function(){return t.DEFAULTS};t.prototype.getOptions=function(t){return t=n.extend({},this.getDefaults(),this.$element.data(),t),t.delay&&"number"==typeof t.delay&&(t.delay={show:t.delay,hide:t.delay}),t};t.prototype.getDelegateOptions=function(){var t={},i=this.getDefaults();return this._options&&n.each(this._options,function(n,r){i[n]!=r&&(t[n]=r)}),t};t.prototype.enter=function(t){var i=t instanceof this.constructor?t:n(t.currentTarget).data("bs."+this.type);return i||(i=new this.constructor(t.currentTarget,this.getDelegateOptions()),n(t.currentTarget).data("bs."+this.type,i)),t instanceof n.Event&&(i.inState["focusin"==t.type?"focus":"hover"]=!0),i.tip().hasClass("in")||"in"==i.hoverState?void(i.hoverState="in"):(clearTimeout(i.timeout),i.hoverState="in",i.options.delay&&i.options.delay.show?void(i.timeout=setTimeout(function(){"in"==i.hoverState&&i.show()},i.options.delay.show)):i.show())};t.prototype.isInStateTrue=function(){for(var n in this.inState)if(this.inState[n])return!0;return!1};t.prototype.leave=function(t){var i=t instanceof this.constructor?t:n(t.currentTarget).data("bs."+this.type);if(i||(i=new this.constructor(t.currentTarget,this.getDelegateOptions()),n(t.currentTarget).data("bs."+this.type,i)),t instanceof n.Event&&(i.inState["focusout"==t.type?"focus":"hover"]=!1),!i.isInStateTrue())return clearTimeout(i.timeout),i.hoverState="out",i.options.delay&&i.options.delay.hide?void(i.timeout=setTimeout(function(){"out"==i.hoverState&&i.hide()},i.options.delay.hide)):i.hide()};t.prototype.show=function(){var c=n.Event("show.bs."+this.type),l,p,e,w,h;if(this.hasContent()&&this.enabled){if(this.$element.trigger(c),l=n.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]),c.isDefaultPrevented()||!l)return;var u=this,r=this.tip(),a=this.getUID(this.type);this.setContent();r.attr("id",a);this.$element.attr("aria-describedby",a);this.options.animation&&r.addClass("fade");var i="function"==typeof this.options.placement?this.options.placement.call(this,r[0],this.$element[0]):this.options.placement,v=/\s?auto?\s?/i,y=v.test(i);y&&(i=i.replace(v,"")||"top");r.detach().css({top:0,left:0,display:"block"}).addClass(i).data("bs."+this.type,this);this.options.container?r.appendTo(this.options.container):r.insertAfter(this.$element);this.$element.trigger("inserted.bs."+this.type);var f=this.getPosition(),o=r[0].offsetWidth,s=r[0].offsetHeight;y&&(p=i,e=this.getPosition(this.$viewport),i="bottom"==i&&f.bottom+s>e.bottom?"top":"top"==i&&f.top-s<e.top?"bottom":"right"==i&&f.right+o>e.width?"left":"left"==i&&f.left-o<e.left?"right":i,r.removeClass(p).addClass(i));w=this.getCalculatedOffset(i,f,o,s);this.applyPlacement(w,i);h=function(){var n=u.hoverState;u.$element.trigger("shown.bs."+u.type);u.hoverState=null;"out"==n&&u.leave(u)};n.support.transition&&this.$tip.hasClass("fade")?r.one("bsTransitionEnd",h).emulateTransitionEnd(t.TRANSITION_DURATION):h()}};t.prototype.applyPlacement=function(t,i){var r=this.tip(),l=r[0].offsetWidth,e=r[0].offsetHeight,o=parseInt(r.css("margin-top"),10),s=parseInt(r.css("margin-left"),10),h,f,u;isNaN(o)&&(o=0);isNaN(s)&&(s=0);t.top+=o;t.left+=s;n.offset.setOffset(r[0],n.extend({using:function(n){r.css({top:Math.round(n.top),left:Math.round(n.left)})}},t),0);r.addClass("in");h=r[0].offsetWidth;f=r[0].offsetHeight;"top"==i&&f!=e&&(t.top=t.top+e-f);u=this.getViewportAdjustedDelta(i,t,h,f);u.left?t.left+=u.left:t.top+=u.top;var c=/top|bottom/.test(i),a=c?2*u.left-l+h:2*u.top-e+f,v=c?"offsetWidth":"offsetHeight";r.offset(t);this.replaceArrow(a,r[0][v],c)};t.prototype.replaceArrow=function(n,t,i){this.arrow().css(i?"left":"top",50*(1-n/t)+"%").css(i?"top":"left","")};t.prototype.setContent=function(){var n=this.tip(),t=this.getTitle();n.find(".tooltip-inner")[this.options.html?"html":"text"](t);n.removeClass("fade in top bottom left right")};t.prototype.hide=function(i){function f(){"in"!=r.hoverState&&u.detach();r.$element&&r.$element.removeAttr("aria-describedby").trigger("hidden.bs."+r.type);i&&i()}var r=this,u=n(this.$tip),e=n.Event("hide.bs."+this.type);if(this.$element.trigger(e),!e.isDefaultPrevented())return u.removeClass("in"),n.support.transition&&u.hasClass("fade")?u.one("bsTransitionEnd",f).emulateTransitionEnd(t.TRANSITION_DURATION):f(),this.hoverState=null,this};t.prototype.fixTitle=function(){var n=this.$element;(n.attr("title")||"string"!=typeof n.attr("data-original-title"))&&n.attr("data-original-title",n.attr("title")||"").attr("title","")};t.prototype.hasContent=function(){return this.getTitle()};t.prototype.getPosition=function(t){t=t||this.$element;var r=t[0],u="BODY"==r.tagName,i=r.getBoundingClientRect();null==i.width&&(i=n.extend({},i,{width:i.right-i.left,height:i.bottom-i.top}));var f=window.SVGElement&&r instanceof window.SVGElement,e=u?{top:0,left:0}:f?null:t.offset(),o={scroll:u?document.documentElement.scrollTop||document.body.scrollTop:t.scrollTop()},s=u?{width:n(window).width(),height:n(window).height()}:null;return n.extend({},i,o,s,e)};t.prototype.getCalculatedOffset=function(n,t,i,r){return"bottom"==n?{top:t.top+t.height,left:t.left+t.width/2-i/2}:"top"==n?{top:t.top-r,left:t.left+t.width/2-i/2}:"left"==n?{top:t.top+t.height/2-r/2,left:t.left-i}:{top:t.top+t.height/2-r/2,left:t.left+t.width}};t.prototype.getViewportAdjustedDelta=function(n,t,i,r){var f={top:0,left:0},e,u,o,s,h,c;return this.$viewport?(e=this.options.viewport&&this.options.viewport.padding||0,u=this.getPosition(this.$viewport),/right|left/.test(n)?(o=t.top-e-u.scroll,s=t.top+e-u.scroll+r,o<u.top?f.top=u.top-o:s>u.top+u.height&&(f.top=u.top+u.height-s)):(h=t.left-e,c=t.left+e+i,h<u.left?f.left=u.left-h:c>u.right&&(f.left=u.left+u.width-c)),f):f};t.prototype.getTitle=function(){var t=this.$element,n=this.options;return t.attr("data-original-title")||("function"==typeof n.title?n.title.call(t[0]):n.title)};t.prototype.getUID=function(n){do n+=~~(1e6*Math.random());while(document.getElementById(n));return n};t.prototype.tip=function(){if(!this.$tip&&(this.$tip=n(this.options.template),1!=this.$tip.length))throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!");return this.$tip};t.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")};t.prototype.enable=function(){this.enabled=!0};t.prototype.disable=function(){this.enabled=!1};t.prototype.toggleEnabled=function(){this.enabled=!this.enabled};t.prototype.toggle=function(t){var i=this;t&&(i=n(t.currentTarget).data("bs."+this.type),i||(i=new this.constructor(t.currentTarget,this.getDelegateOptions()),n(t.currentTarget).data("bs."+this.type,i)));t?(i.inState.click=!i.inState.click,i.isInStateTrue()?i.enter(i):i.leave(i)):i.tip().hasClass("in")?i.leave(i):i.enter(i)};t.prototype.destroy=function(){var n=this;clearTimeout(this.timeout);this.hide(function(){n.$element.off("."+n.type).removeData("bs."+n.type);n.$tip&&n.$tip.detach();n.$tip=null;n.$arrow=null;n.$viewport=null;n.$element=null})};i=n.fn.tooltip;n.fn.tooltip=r;n.fn.tooltip.Constructor=t;n.fn.tooltip.noConflict=function(){return n.fn.tooltip=i,this}}(jQuery);+function(n){"use strict";function r(i){return this.each(function(){var u=n(this),r=u.data("bs.popover"),f="object"==typeof i&&i;!r&&/destroy|hide/.test(i)||(r||u.data("bs.popover",r=new t(this,f)),"string"==typeof i&&r[i]())})}var t=function(n,t){this.init("popover",n,t)},i;if(!n.fn.tooltip)throw new Error("Popover requires tooltip.js");t.VERSION="3.3.7";t.DEFAULTS=n.extend({},n.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:'<div class="popover" role="tooltip"><div class="arrow"><\/div><h3 class="popover-title"><\/h3><div class="popover-content"><\/div><\/div>'});t.prototype=n.extend({},n.fn.tooltip.Constructor.prototype);t.prototype.constructor=t;t.prototype.getDefaults=function(){return t.DEFAULTS};t.prototype.setContent=function(){var n=this.tip(),i=this.getTitle(),t=this.getContent();n.find(".popover-title")[this.options.html?"html":"text"](i);n.find(".popover-content").children().detach().end()[this.options.html?"string"==typeof t?"html":"append":"text"](t);n.removeClass("fade top bottom left right in");n.find(".popover-title").html()||n.find(".popover-title").hide()};t.prototype.hasContent=function(){return this.getTitle()||this.getContent()};t.prototype.getContent=function(){var t=this.$element,n=this.options;return t.attr("data-content")||("function"==typeof n.content?n.content.call(t[0]):n.content)};t.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};i=n.fn.popover;n.fn.popover=r;n.fn.popover.Constructor=t;n.fn.popover.noConflict=function(){return n.fn.popover=i,this}}(jQuery);+function(n){"use strict";function t(i,r){this.$body=n(document.body);this.$scrollElement=n(n(i).is(document.body)?window:i);this.options=n.extend({},t.DEFAULTS,r);this.selector=(this.options.target||"")+" .nav li > a";this.offsets=[];this.targets=[];this.activeTarget=null;this.scrollHeight=0;this.$scrollElement.on("scroll.bs.scrollspy",n.proxy(this.process,this));this.refresh();this.process()}function i(i){return this.each(function(){var u=n(this),r=u.data("bs.scrollspy"),f="object"==typeof i&&i;r||u.data("bs.scrollspy",r=new t(this,f));"string"==typeof i&&r[i]()})}t.VERSION="3.3.7";t.DEFAULTS={offset:10};t.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)};t.prototype.refresh=function(){var t=this,i="offset",r=0;this.offsets=[];this.targets=[];this.scrollHeight=this.getScrollHeight();n.isWindow(this.$scrollElement[0])||(i="position",r=this.$scrollElement.scrollTop());this.$body.find(this.selector).map(function(){var f=n(this),u=f.data("target")||f.attr("href"),t=/^#./.test(u)&&n(u);return t&&t.length&&t.is(":visible")&&[[t[i]().top+r,u]]||null}).sort(function(n,t){return n[0]-t[0]}).each(function(){t.offsets.push(this[0]);t.targets.push(this[1])})};t.prototype.process=function(){var n,i=this.$scrollElement.scrollTop()+this.options.offset,f=this.getScrollHeight(),e=this.options.offset+f-this.$scrollElement.height(),t=this.offsets,r=this.targets,u=this.activeTarget;if(this.scrollHeight!=f&&this.refresh(),i>=e)return u!=(n=r[r.length-1])&&this.activate(n);if(u&&i<t[0])return this.activeTarget=null,this.clear();for(n=t.length;n--;)u!=r[n]&&i>=t[n]&&(void 0===t[n+1]||i<t[n+1])&&this.activate(r[n])};t.prototype.activate=function(t){this.activeTarget=t;this.clear();var r=this.selector+'[data-target="'+t+'"],'+this.selector+'[href="'+t+'"]',i=n(r).parents("li").addClass("active");i.parent(".dropdown-menu").length&&(i=i.closest("li.dropdown").addClass("active"));i.trigger("activate.bs.scrollspy")};t.prototype.clear=function(){n(this.selector).parentsUntil(this.options.target,".active").removeClass("active")};var r=n.fn.scrollspy;n.fn.scrollspy=i;n.fn.scrollspy.Constructor=t;n.fn.scrollspy.noConflict=function(){return n.fn.scrollspy=r,this};n(window).on("load.bs.scrollspy.data-api",function(){n('[data-spy="scroll"]').each(function(){var t=n(this);i.call(t,t.data())})})}(jQuery);+function(n){"use strict";function r(i){return this.each(function(){var u=n(this),r=u.data("bs.tab");r||u.data("bs.tab",r=new t(this));"string"==typeof i&&r[i]()})}var t=function(t){this.element=n(t)},u,i;t.VERSION="3.3.7";t.TRANSITION_DURATION=150;t.prototype.show=function(){var t=this.element,f=t.closest("ul:not(.dropdown-menu)"),i=t.data("target"),u;if(i||(i=t.attr("href"),i=i&&i.replace(/.*(?=#[^\s]*$)/,"")),!t.parent("li").hasClass("active")){var r=f.find(".active:last a"),e=n.Event("hide.bs.tab",{relatedTarget:t[0]}),o=n.Event("show.bs.tab",{relatedTarget:r[0]});(r.trigger(e),t.trigger(o),o.isDefaultPrevented()||e.isDefaultPrevented())||(u=n(i),this.activate(t.closest("li"),f),this.activate(u,u.parent(),function(){r.trigger({type:"hidden.bs.tab",relatedTarget:t[0]});t.trigger({type:"shown.bs.tab",relatedTarget:r[0]})}))}};t.prototype.activate=function(i,r,u){function e(){f.removeClass("active").find("> .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1);i.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0);o?(i[0].offsetWidth,i.addClass("in")):i.removeClass("fade");i.parent(".dropdown-menu").length&&i.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0);u&&u()}var f=r.find("> .active"),o=u&&n.support.transition&&(f.length&&f.hasClass("fade")||!!r.find("> .fade").length);f.length&&o?f.one("bsTransitionEnd",e).emulateTransitionEnd(t.TRANSITION_DURATION):e();f.removeClass("in")};u=n.fn.tab;n.fn.tab=r;n.fn.tab.Constructor=t;n.fn.tab.noConflict=function(){return n.fn.tab=u,this};i=function(t){t.preventDefault();r.call(n(this),"show")};n(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',i).on("click.bs.tab.data-api",'[data-toggle="pill"]',i)}(jQuery);+function(n){"use strict";function i(i){return this.each(function(){var u=n(this),r=u.data("bs.affix"),f="object"==typeof i&&i;r||u.data("bs.affix",r=new t(this,f));"string"==typeof i&&r[i]()})}var t=function(i,r){this.options=n.extend({},t.DEFAULTS,r);this.$target=n(this.options.target).on("scroll.bs.affix.data-api",n.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",n.proxy(this.checkPositionWithEventLoop,this));this.$element=n(i);this.affixed=null;this.unpin=null;this.pinnedOffset=null;this.checkPosition()},r;t.VERSION="3.3.7";t.RESET="affix affix-top affix-bottom";t.DEFAULTS={offset:0,target:window};t.prototype.getState=function(n,t,i,r){var u=this.$target.scrollTop(),f=this.$element.offset(),e=this.$target.height();if(null!=i&&"top"==this.affixed)return u<i&&"top";if("bottom"==this.affixed)return null!=i?!(u+this.unpin<=f.top)&&"bottom":!(u+e<=n-r)&&"bottom";var o=null==this.affixed,s=o?u:f.top,h=o?e:t;return null!=i&&u<=i?"top":null!=r&&s+h>=n-r&&"bottom"};t.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(t.RESET).addClass("affix");var n=this.$target.scrollTop(),i=this.$element.offset();return this.pinnedOffset=i.top-n};t.prototype.checkPositionWithEventLoop=function(){setTimeout(n.proxy(this.checkPosition,this),1)};t.prototype.checkPosition=function(){var i,e,o;if(this.$element.is(":visible")){var s=this.$element.height(),r=this.options.offset,f=r.top,u=r.bottom,h=Math.max(n(document).height(),n(document.body).height());if("object"!=typeof r&&(u=f=r),"function"==typeof f&&(f=r.top(this.$element)),"function"==typeof u&&(u=r.bottom(this.$element)),i=this.getState(h,s,f,u),this.affixed!=i){if(null!=this.unpin&&this.$element.css("top",""),e="affix"+(i?"-"+i:""),o=n.Event(e+".bs.affix"),this.$element.trigger(o),o.isDefaultPrevented())return;this.affixed=i;this.unpin="bottom"==i?this.getPinnedOffset():null;this.$element.removeClass(t.RESET).addClass(e).trigger(e.replace("affix","affixed")+".bs.affix")}"bottom"==i&&this.$element.offset({top:h-s-u})}};r=n.fn.affix;n.fn.affix=i;n.fn.affix.Constructor=t;n.fn.affix.noConflict=function(){return n.fn.affix=r,this};n(window).on("load",function(){n('[data-spy="affix"]').each(function(){var r=n(this),t=r.data();t.offset=t.offset||{};null!=t.offsetBottom&&(t.offset.bottom=t.offsetBottom);null!=t.offsetTop&&(t.offset.top=t.offsetTop);i.call(r,t)})})}(jQuery);!function(n){"use strict";n.matchMedia=n.matchMedia||function(n){var u,i=n.documentElement,f=i.firstElementChild||i.firstChild,r=n.createElement("body"),t=n.createElement("div");return t.id="mq-test-1",t.style.cssText="position:absolute;top:-100em",r.style.background="none",r.appendChild(t),function(n){return t.innerHTML='&shy;<style media="'+n+'"> #mq-test-1 { width: 42px; }<\/style>',i.insertBefore(r,f),u=42===t.offsetWidth,i.removeChild(r),{matches:u,media:n}}}(n.document)}(this),function(n){"use strict";function p(){y(!0)}var t={};n.respond=t;t.update=function(){};var f=[],tt=function(){var t=!1;try{t=new n.XMLHttpRequest}catch(i){t=new n.ActiveXObject("Microsoft.XMLHTTP")}return function(){return t}}(),w=function(n,t){var i=tt();i&&(i.open("GET",n,!0),i.onreadystatechange=function(){4!==i.readyState||200!==i.status&&304!==i.status||t(i.responseText)},4!==i.readyState&&i.send(null))};if(t.ajax=w,t.queue=f,t.regex={media:/@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+/gi,keyframes:/@(?:\-(?:o|moz|webkit)\-)?keyframes[^\{]+\{(?:[^\{\}]*\{[^\}\{]*\})+[^\}]*\}/gi,urls:/(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g,findStyles:/@media *([^\{]+)\{([\S\s]+?)$/,only:/(only\s+)?([a-zA-Z]+)\s?/,minw:/\([\s]*min\-width\s*:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/,maxw:/\([\s]*max\-width\s*:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/},t.mediaQueriesSupported=n.matchMedia&&null!==n.matchMedia("only all")&&n.matchMedia("only all").matches,!t.mediaQueriesSupported){var c,b,l,i=n.document,r=i.documentElement,e=[],o=[],u=[],a={},k=30,s=i.getElementsByTagName("head")[0]||r,it=i.getElementsByTagName("base")[0],h=s.getElementsByTagName("link"),v=function(){var u,t=i.createElement("div"),n=i.body,o=r.style.fontSize,e=n&&n.style.fontSize,f=!1;return t.style.cssText="position:absolute;font-size:1em;width:1em",n||(n=f=i.createElement("body"),n.style.background="none"),r.style.fontSize="100%",n.style.fontSize="100%",n.appendChild(t),f&&r.insertBefore(n,r.firstChild),u=t.offsetWidth,f?r.removeChild(n):n.removeChild(t),r.style.fontSize=o,e&&(n.style.fontSize=e),u=l=parseFloat(u)},y=function(t){var rt="clientWidth",ut=r[rt],ft="CSS1Compat"===i.compatMode&&ut||i.body[rt]||ut,p={},ct=h[h.length-1],et=(new Date).getTime(),tt,g,nt,f,it;if(t&&c&&k>et-c)return n.clearTimeout(b),b=n.setTimeout(y,k),void 0;c=et;for(tt in e)if(e.hasOwnProperty(tt)){var a=e[tt],w=a.minw,d=a.maxw,ot=null===w,st=null===d,ht="em";w&&(w=parseFloat(w)*(w.indexOf(ht)>-1?l||v():1));d&&(d=parseFloat(d)*(d.indexOf(ht)>-1?l||v():1));a.hasquery&&(ot&&st||!(ot||ft>=w)||!(st||d>=ft))||(p[a.media]||(p[a.media]=[]),p[a.media].push(o[a.rules]))}for(g in u)u.hasOwnProperty(g)&&u[g]&&u[g].parentNode===s&&s.removeChild(u[g]);u.length=0;for(nt in p)p.hasOwnProperty(nt)&&(f=i.createElement("style"),it=p[nt].join("\n"),f.type="text/css",f.media=nt,s.insertBefore(f,ct.nextSibling),f.styleSheet?f.styleSheet.cssText=it:f.appendChild(i.createTextNode(it)),u.push(f))},d=function(n,i,r){var h=n.replace(t.regex.keyframes,"").match(t.regex.media),c=h&&h.length||0,l,a,f,v,u,p,w,s;for(i=i.substring(0,i.lastIndexOf("/")),l=function(n){return n.replace(t.regex.urls,"$1"+i+"$2$3")},a=!c&&r,i.length&&(i+="/"),a&&(c=1),f=0;c>f;f++)for(a?(v=r,o.push(l(n))):(v=h[f].match(t.regex.findStyles)&&RegExp.$1,o.push(RegExp.$2&&l(RegExp.$2))),p=v.split(","),w=p.length,s=0;w>s;s++)u=p[s],e.push({media:u.split("(")[0].match(t.regex.only)&&RegExp.$2||"all",rules:o.length-1,hasquery:u.indexOf("(")>-1,minw:u.match(t.regex.minw)&&parseFloat(RegExp.$1)+(RegExp.$2||""),maxw:u.match(t.regex.maxw)&&parseFloat(RegExp.$1)+(RegExp.$2||"")});y()},g=function(){if(f.length){var t=f.shift();w(t.href,function(i){d(i,t.href,t.media);a[t.href]=!0;n.setTimeout(function(){g()},0)})}},nt=function(){for(var r=0;r<h.length;r++){var i=h[r],t=i.href,u=i.media,e=i.rel&&"stylesheet"===i.rel.toLowerCase();t&&e&&!a[t]&&(i.styleSheet&&i.styleSheet.rawCssText?(d(i.styleSheet.rawCssText,t,u),a[t]=!0):(!/^([a-zA-Z:]*\/\/)/.test(t)&&!it||t.replace(RegExp.$1,"").split("/")[0]===n.location.host)&&("//"===t.substring(0,2)&&(t=n.location.protocol+t),f.push({href:t,media:u})))}g()};nt();t.update=nt;t.getEmValue=v;n.addEventListener?n.addEventListener("resize",p,!1):n.attachEvent&&n.attachEvent("onresize",p)}}(this);!function(n){"function"==typeof define&&define.amd?define(["jquery","bootstrap"],n):n(jQuery)}(function(n){if("undefined"==typeof n)throw new Error("Fuel UX's JavaScript requires jQuery");if("undefined"==typeof n.fn.dropdown||"undefined"==typeof n.fn.collapse)throw new Error("Fuel UX's JavaScript requires Bootstrap");!function(n){var i=n.fn.checkbox,t=function(t,i){if(this.options=n.extend({},n.fn.checkbox.defaults,i),"label"===t.tagName.toLowerCase()){this.$label=n(t);this.$chk=this.$label.find('input[type="checkbox"]');this.$container=n(t).parent(".checkbox");var r=this.$chk.attr("data-toggle");this.$toggleContainer=n(r);this.$chk.on("change",n.proxy(this.itemchecked,this));this.setInitialState()}};t.prototype={constructor:t,setInitialState:function(){var n=this.$chk,t=(this.$label,n.prop("checked")),i=n.prop("disabled");this.setCheckedState(n,t);this.setDisabledState(n,i)},setCheckedState:function(n,t){var r=n,i=this.$label,u=(this.$container,this.$toggleContainer);t?(r.prop("checked",!0),i.addClass("checked"),u.removeClass("hide hidden"),i.trigger("checked.fu.checkbox")):(r.prop("checked",!1),i.removeClass("checked"),u.addClass("hidden"),i.trigger("unchecked.fu.checkbox"));i.trigger("changed.fu.checkbox",t)},setDisabledState:function(n,t){var i=this.$label;t?(this.$chk.prop("disabled",!0),i.addClass("disabled"),i.trigger("disabled.fu.checkbox")):(this.$chk.prop("disabled",!1),i.removeClass("disabled"),i.trigger("enabled.fu.checkbox"))},itemchecked:function(t){var i=n(t.target),r=i.prop("checked");this.setCheckedState(i,r)},toggle:function(){var n=this.isChecked();n?this.uncheck():this.check()},check:function(){this.setCheckedState(this.$chk,!0)},uncheck:function(){this.setCheckedState(this.$chk,!1)},isChecked:function(){return this.$chk.prop("checked")},enable:function(){this.setDisabledState(this.$chk,!1)},disable:function(){this.setDisabledState(this.$chk,!0)},destroy:function(){return this.$label.remove(),this.$label[0].outerHTML}};t.prototype.getValue=t.prototype.isChecked;n.fn.checkbox=function(i){var r,u=Array.prototype.slice.call(arguments,1),f=this.each(function(){var e=n(this),f=e.data("fu.checkbox"),o="object"==typeof i&&i;f||e.data("fu.checkbox",f=new t(this,o));"string"==typeof i&&(r=f[i].apply(f,u))});return void 0===r?f:r};n.fn.checkbox.defaults={};n.fn.checkbox.Constructor=t;n.fn.checkbox.noConflict=function(){return n.fn.checkbox=i,this};n(document).on("mouseover.fu.checkbox.data-api","[data-initialize=checkbox]",function(t){var i=n(t.target);i.data("fu.checkbox")||i.checkbox(i.data())});n(function(){n("[data-initialize=checkbox]").each(function(){var t=n(this);t.data("fu.checkbox")||t.checkbox(t.data())})})}(n),function(n){var i=n.fn.combobox,t=function(t,i){this.$element=n(t);this.options=n.extend({},n.fn.combobox.defaults,i);this.$dropMenu=this.$element.find(".dropdown-menu");this.$input=this.$element.find("input");this.$button=this.$element.find(".btn");this.$element.on("click.fu.combobox","a",n.proxy(this.itemclicked,this));this.$element.on("change.fu.combobox","input",n.proxy(this.inputchanged,this));this.$element.on("shown.bs.dropdown",n.proxy(this.menuShown,this));this.setDefaultSelection();var r=this.$dropMenu.children("li");0===r.length&&this.$button.addClass("disabled")};t.prototype={constructor:t,destroy:function(){return this.$element.remove(),this.$element.find("input").each(function(){n(this).attr("value",n(this).val())}),this.$element[0].outerHTML},doSelect:function(n){"undefined"!=typeof n[0]?(this.$selectedItem=n,this.$input.val(this.$selectedItem.text().trim())):this.$selectedItem=null},menuShown:function(){this.options.autoResizeMenu&&this.resizeMenu()},resizeMenu:function(){var n=this.$element.outerWidth();this.$dropMenu.outerWidth(n)},selectedItem:function(){var r=this.$selectedItem,t={},i;return r?(i=this.$selectedItem.text().trim(),t=n.extend({text:i},this.$selectedItem.data())):t={text:this.$input.val()},t},selectByText:function(t){var i=n([]);this.$element.find("li").each(function(){if((this.textContent||this.innerText||n(this).text()||"").toLowerCase()===(t||"").toLowerCase())return(i=n(this),!1)});this.doSelect(i)},selectByValue:function(n){var t='li[data-value="'+n+'"]';this.selectBySelector(t)},selectByIndex:function(n){var t="li:eq("+n+")";this.selectBySelector(t)},selectBySelector:function(n){var t=this.$element.find(n);this.doSelect(t)},setDefaultSelection:function(){var t="li[data-selected=true]:first",n=this.$element.find(t);n.length>0&&(this.selectBySelector(t),n.removeData("selected"),n.removeAttr("data-selected"))},enable:function(){this.$element.removeClass("disabled");this.$input.removeAttr("disabled");this.$button.removeClass("disabled")},disable:function(){this.$element.addClass("disabled");this.$input.attr("disabled",!0);this.$button.addClass("disabled")},itemclicked:function(t){this.$selectedItem=n(t.target).parent();this.$input.val(this.$selectedItem.text().trim()).trigger("change",{synthetic:!0});var i=this.selectedItem();this.$element.trigger("changed.fu.combobox",i);t.preventDefault();this.$element.find(".dropdown-toggle").focus()},inputchanged:function(t,i){var u,r;i&&i.synthetic||(u=n(t.target).val(),this.selectByText(u),r=this.selectedItem(),0===r.text.length&&(r={text:u}),this.$element.trigger("changed.fu.combobox",r))}};t.prototype.getValue=t.prototype.selectedItem;n.fn.combobox=function(i){var r,u=Array.prototype.slice.call(arguments,1),f=this.each(function(){var e=n(this),f=e.data("fu.combobox"),o="object"==typeof i&&i;f||e.data("fu.combobox",f=new t(this,o));"string"==typeof i&&(r=f[i].apply(f,u))});return void 0===r?f:r};n.fn.combobox.defaults={autoResizeMenu:!0};n.fn.combobox.Constructor=t;n.fn.combobox.noConflict=function(){return n.fn.combobox=i,this};n(document).on("mousedown.fu.combobox.data-api","[data-initialize=combobox]",function(t){var i=n(t.target).closest(".combobox");i.data("fu.combobox")||i.combobox(i.data())});n(function(){n("[data-initialize=combobox]").each(function(){var t=n(this);t.data("fu.combobox")||t.combobox(t.data())})})}(n),function(n){var e="Invalid Date",u="moment.js is not available so you cannot use this function",r=[],t=!1,s=n.fn.datepicker,o=!1,f=function(){var n,t;for(o=!0,n=0,t=r.length;t>n;n++)r[n].init.call(r[n].scope);r=[]},i;"function"==typeof define&&define.amd?require(["moment"],function(n){t=n;f()},function(n){var t=n.requireModules&&n.requireModules[0];"moment"===t&&f()}):f();i=function(i,u){this.$element=n(i);this.options=n.extend(!0,{},n.fn.datepicker.defaults,u);this.$calendar=this.$element.find(".datepicker-calendar");this.$days=this.$calendar.find(".datepicker-calendar-days");this.$header=this.$calendar.find(".datepicker-calendar-header");this.$headerTitle=this.$header.find(".title");this.$input=this.$element.find("input");this.$wheels=this.$element.find(".datepicker-wheels");this.$wheelsMonth=this.$element.find(".datepicker-wheels-month");this.$wheelsYear=this.$element.find(".datepicker-wheels-year");this.artificialScrolling=!1;this.formatDate=this.options.formatDate||this.formatDate;this.inputValue=null;this.moment=!1;this.momentFormat=null;this.parseDate=this.options.parseDate||this.parseDate;this.preventBlurHide=!1;this.restricted=this.options.restricted||[];this.restrictedParsed=[];this.restrictedText=this.options.restrictedText;this.sameYearOnly=this.options.sameYearOnly;this.selectedDate=null;this.yearRestriction=null;this.$calendar.find(".datepicker-today").on("click.fu.datepicker",n.proxy(this.todayClicked,this));this.$days.on("click.fu.datepicker","tr td button",n.proxy(this.dateClicked,this));this.$header.find(".next").on("click.fu.datepicker",n.proxy(this.next,this));this.$header.find(".prev").on("click.fu.datepicker",n.proxy(this.prev,this));this.$headerTitle.on("click.fu.datepicker",n.proxy(this.titleClicked,this));this.$input.on("change.fu.datepicker",n.proxy(this.inputChanged,this));this.$input.on("mousedown.fu.datepicker",n.proxy(this.showDropdown,this));this.$wheels.find(".datepicker-wheels-back").on("click.fu.datepicker",n.proxy(this.backClicked,this));this.$wheels.find(".datepicker-wheels-select").on("click.fu.datepicker",n.proxy(this.selectClicked,this));this.$wheelsMonth.on("click.fu.datepicker","ul button",n.proxy(this.monthClicked,this));this.$wheelsYear.on("click.fu.datepicker","ul button",n.proxy(this.yearClicked,this));this.$wheelsYear.find("ul").on("scroll.fu.datepicker",n.proxy(this.onYearScroll,this));var f=function(){this.checkForMomentJS()&&(t=t||window.moment,this.moment=!0,this.momentFormat=this.options.momentConfig.format,this.setCulture(this.options.momentConfig.culture),t.locale=t.locale||t.lang);this.setRestrictedDates(this.restricted);this.setDate(this.options.date)||(this.$input.val(""),this.inputValue=this.$input.val());this.sameYearOnly&&(this.yearRestriction=this.selectedDate?this.selectedDate.getFullYear():(new Date).getFullYear())};o?f.call(this):r.push({init:f,scope:this})};i.prototype={constructor:i,backClicked:function(){this.changeView("calendar")},changeView:function(n,t){"wheels"===n?(this.$calendar.hide().attr("aria-hidden","true"),this.$wheels.show().removeAttr("aria-hidden",""),t&&this.renderWheel(t)):(this.$wheels.hide().attr("aria-hidden","true"),this.$calendar.show().removeAttr("aria-hidden",""),t&&this.renderMonth(t))},checkForMomentJS:function(){return(n.isFunction(window.moment)||"undefined"!=typeof t&&n.isFunction(t))&&n.isPlainObject(this.options.momentConfig)&&"string"==typeof this.options.momentConfig.culture&&"string"==typeof this.options.momentConfig.format?!0:!1},dateClicked:function(t){var r,i=n(t.currentTarget).parents("td:first");i.hasClass("restricted")||(this.$days.find("td.selected").removeClass("selected"),i.addClass("selected"),r=new Date(i.attr("data-year"),i.attr("data-month"),i.attr("data-date")),this.selectedDate=r,this.$input.val(this.formatDate(r)),this.inputValue=this.$input.val(),this.hideDropdown(),this.$input.focus(),this.$element.trigger("dateClicked.fu.datepicker",r))},destroy:function(){return this.$element.remove(),this.$days.find("tbody").empty(),this.$wheelsYear.find("ul").empty(),this.$element[0].outerHTML},disable:function(){this.$element.addClass("disabled");this.$element.find("input, button").attr("disabled","disabled");this.$element.find(".input-group-btn").removeClass("open")},enable:function(){this.$element.removeClass("disabled");this.$element.find("input, button").removeAttr("disabled")},formatDate:function(n){var i=function(n){var t="0"+n;return t.substr(t.length-2)};return this.moment?t(n).format(this.momentFormat):i(n.getMonth()+1)+"/"+i(n.getDate())+"/"+n.getFullYear()},getCulture:function(){if(this.moment)return t.locale();throw u;},getDate:function(){return this.selectedDate?this.selectedDate:new Date(NaN)},getFormat:function(){if(this.moment)return this.momentFormat;throw u;},getFormattedDate:function(){return this.selectedDate?this.formatDate(this.selectedDate):e},getRestrictedDates:function(){return this.restricted},inputChanged:function(){var n,t=this.$input.val();t!==this.inputValue&&(n=this.setDate(t),null===n?this.$element.trigger("inputParsingFailed.fu.datepicker",t):n===!1?this.$element.trigger("inputRestrictedDate.fu.datepicker",n):this.$element.trigger("changed.fu.datepicker",n))},showDropdown:function(){this.$input.is(":focus")||this.$element.find(".input-group-btn").addClass("open")},hideDropdown:function(){this.$element.find(".input-group-btn").removeClass("open")},isInvalidDate:function(n){var t=n.toString();return t===e||"NaN"===t?!0:!1},isRestricted:function(n,t,i){var f,r,o,u,e=this.restrictedParsed;if(this.sameYearOnly&&null!==this.yearRestriction&&i!==this.yearRestriction)return!0;for(f=0,o=e.length;o>f;f++)if(r=e[f].from,u=e[f].to,(i>r.year||i===r.year&&t>r.month||i===r.year&&t===r.month&&n>=r.date)&&(i<u.year||i===u.year&&t<u.month||i===u.year&&t===u.month&&n<=u.date))return!0;return!1},monthClicked:function(t){this.$wheelsMonth.find(".selected").removeClass("selected");n(t.currentTarget).parent().addClass("selected")},next:function(){var n=this.$headerTitle.attr("data-month"),t=this.$headerTitle.attr("data-year");if(n++,n>11){if(this.sameYearOnly)return;n=0;t++}this.renderMonth(new Date(t,n,1))},onYearScroll:function(t){if(!this.artificialScrolling){var r,u,i=n(t.currentTarget),o="border-box"===i.css("box-sizing")?i.outerHeight():i.height(),f=i.get(0).scrollHeight,e=i.scrollTop(),s=o/(f-e)*100,h=e/f*100;if(5>h){for(u=parseInt(i.find("li:first").attr("data-year"),10),r=u-1;r>u-11;r--)i.prepend('<li data-year="'+r+'"><button type="button">'+r+"<\/button><\/li>");this.artificialScrolling=!0;i.scrollTop(i.get(0).scrollHeight-f+e);this.artificialScrolling=!1}else if(s>90)for(u=parseInt(i.find("li:last").attr("data-year"),10),r=u+1;u+11>r;r++)i.append('<li data-year="'+r+'"><button type="button">'+r+"<\/button><\/li>")}},parseDate:function(n){var i,c,u,f,e,o,r,s=this,h=new Date(NaN);if(n){if(this.moment)return f=function(n){var i=t(n,s.momentFormat);return!0===i.isValid()?i.toDate():h},u=function(n){var i=t(new Date(n));return!0===i.isValid()?i.toDate():h},e=function(n,t,i){var r=t(n);return s.isInvalidDate(r)?(r=i(r),s.isInvalidDate(r)?h:r):r},"string"==typeof n?e(n,f,u):e(n,u,f);if("string"==typeof n){if((i=new Date(Date.parse(n)),!this.isInvalidDate(i))||(n=n.split("T")[0],c=/^\s*(\d{4})-(\d\d)-(\d\d)\s*$/,r=c.exec(n),r&&(o=parseInt(r[2],10),i=new Date(r[1],o-1,r[3]),o===i.getMonth()+1)))return i}else if(i=new Date(n),!this.isInvalidDate(i))return i}return new Date(NaN)},prev:function(){var n=this.$headerTitle.attr("data-month"),t=this.$headerTitle.attr("data-year");if(n--,0>n){if(this.sameYearOnly)return;n=11;t--}this.renderMonth(new Date(t,n,1))},renderMonth:function(t){t=t||new Date;var r,f,e,s,h,a,u,c,v,i,y,p=new Date(t.getFullYear(),t.getMonth(),1).getDay(),g=new Date(t.getFullYear(),t.getMonth()+1,0).getDate(),nt=new Date(t.getFullYear(),t.getMonth(),0).getDate(),tt=this.$headerTitle.find(".month"),w=t.getMonth(),b=new Date,it=b.getDate(),k=b.getMonth(),l=b.getFullYear(),o=this.selectedDate,rt=this.$days.find("tbody"),d=t.getFullYear();for(o&&(o={date:o.getDate(),month:o.getMonth(),year:o.getFullYear()}),tt.find(".current").removeClass("current"),tt.find('span[data-month="'+w+'"]').addClass("current"),this.$headerTitle.find(".year").text(d),this.$headerTitle.attr({"data-month":w,"data-year":d}),rt.empty(),0!==p?(r=nt-p+1,u=-1):(r=1,u=0),a=35-p>=g?5:6,s=0;a>s;s++){for(y=n("<tr><\/tr>"),h=0;7>h;h++)i=n("<td><\/td>"),-1===u?(i.addClass("last-month"),c!==u&&i.addClass("first")):1===u&&(i.addClass("next-month"),c!==u&&i.addClass("first")),f=w+u,e=d,0>f?(f=11,e--):f>11&&(f=0,e++),i.attr({"data-date":r,"data-month":f,"data-year":e}),e===l&&f===k&&r===it?i.addClass("current-day"):(l>e||e===l&&k>f||e===l&&f===k&&it>r)&&(i.addClass("past"),this.options.allowPastDates||i.addClass("restricted").attr("title",this.restrictedText)),this.isRestricted(r,f,e)&&i.addClass("restricted").attr("title",this.restrictedText),o&&e===o.year&&f===o.month&&r===o.date&&i.addClass("selected"),i.hasClass("restricted")?i.html('<span><b class="datepicker-date">'+r+"<\/b><\/span>"):i.html('<span><button type="button" class="datepicker-date">'+r+"<\/button><\/span>"),r++,v=c,c=u,-1===u&&r>nt?(r=1,u=0,v!==u&&i.addClass("last")):0===u&&r>g&&(r=1,u=1,v!==u&&i.addClass("last")),s===a-1&&6===h&&i.addClass("last"),y.append(i);rt.append(y)}},renderWheel:function(n){var i,r,f,o=n.getMonth(),u=this.$wheelsMonth.find("ul"),e=n.getFullYear(),t=this.$wheelsYear.find("ul");for(this.sameYearOnly?(this.$wheelsMonth.addClass("full"),this.$wheelsYear.addClass("hidden")):(this.$wheelsMonth.removeClass("full"),this.$wheelsYear.removeClass("hide hidden")),u.find(".selected").removeClass("selected"),r=u.find('li[data-month="'+o+'"]'),r.addClass("selected"),u.scrollTop(u.scrollTop()+(r.position().top-u.outerHeight()/2-r.outerHeight(!0)/2)),t.empty(),i=e-10;e+11>i;i++)t.append('<li data-year="'+i+'"><button type="button">'+i+"<\/button><\/li>");f=t.find('li[data-year="'+e+'"]');f.addClass("selected");this.artificialScrolling=!0;t.scrollTop(t.scrollTop()+(f.position().top-t.outerHeight()/2-f.outerHeight(!0)/2));this.artificialScrolling=!1;r.find("button").focus()},selectClicked:function(){var n=this.$wheelsMonth.find(".selected").attr("data-month"),t=this.$wheelsYear.find(".selected").attr("data-year");this.changeView("calendar",new Date(t,n,1))},setCulture:function(n){if(!n)return!1;if(!this.moment)throw u;t.locale(n)},setDate:function(n){var t=this.parseDate(n);return this.isInvalidDate(t)?(this.selectedDate=null,this.renderMonth()):this.isRestricted(t.getDate(),t.getMonth(),t.getFullYear())?(this.selectedDate=!1,this.renderMonth()):(this.selectedDate=t,this.renderMonth(t),this.$input.val(this.formatDate(t))),this.inputValue=this.$input.val(),this.selectedDate},setFormat:function(n){if(!n)return!1;if(!this.moment)throw u;this.momentFormat=n},setRestrictedDates:function(n){var t,i,r=[],f=this,u=function(n){return n===-(1/0)?{date:-(1/0),month:-(1/0),year:-(1/0)}:n===1/0?{date:1/0,month:1/0,year:1/0}:(n=f.parseDate(n),{date:n.getDate(),month:n.getMonth(),year:n.getFullYear()})};for(this.restricted=n,t=0,i=n.length;i>t;t++)r.push({from:u(n[t].from),to:u(n[t].to)});this.restrictedParsed=r},titleClicked:function(){this.changeView("wheels",new Date(this.$headerTitle.attr("data-year"),this.$headerTitle.attr("data-month"),1))},todayClicked:function(){var n=new Date;(n.getMonth()+""!==this.$headerTitle.attr("data-month")||n.getFullYear()+""!==this.$headerTitle.attr("data-year"))&&this.renderMonth(n)},yearClicked:function(t){this.$wheelsYear.find(".selected").removeClass("selected");n(t.currentTarget).parent().addClass("selected")}};i.prototype.getValue=i.prototype.getDate;n.fn.datepicker=function(t){var r,u=Array.prototype.slice.call(arguments,1),f=this.each(function(){var e=n(this),f=e.data("fu.datepicker"),o="object"==typeof t&&t;f||e.data("fu.datepicker",f=new i(this,o));"string"==typeof t&&(r=f[t].apply(f,u))});return void 0===r?f:r};n.fn.datepicker.defaults={allowPastDates:!1,date:new Date,formatDate:null,momentConfig:{culture:"en",format:"L"},parseDate:null,restricted:[],restrictedText:"Restricted",sameYearOnly:!1};n.fn.datepicker.Constructor=i;n.fn.datepicker.noConflict=function(){return n.fn.datepicker=s,this};n(document).on("mousedown.fu.datepicker.data-api","[data-initialize=datepicker]",function(t){var i=n(t.target).closest(".datepicker");i.data("datepicker")||i.datepicker(i.data())});n(document).on("click.fu.datepicker.data-api",".datepicker .dropdown-menu",function(t){var i=n(t.target);(!i.is(".datepicker-date")||i.closest(".restricted").length)&&t.stopPropagation()});n(document).on("click.fu.datepicker.data-api",".datepicker input",function(n){n.stopPropagation()});n(function(){n("[data-initialize=datepicker]").each(function(){var t=n(this);t.data("datepicker")||t.datepicker(t.data())})})}(n),function(n){function t(t){n(t).css({visibility:"hidden"});i(t)?t.parent().addClass("dropup"):t.parent().removeClass("dropup");n(t).css({visibility:"visible"})}function i(n){var i=r(n),t={};return t.parentHeight=n.parent().outerHeight(),t.parentOffsetTop=n.parent().offset().top,t.dropdownHeight=n.outerHeight(),t.containerHeight=i.overflowElement.outerHeight(),t.containerOffsetTop=i.isWindow?i.overflowElement.scrollTop():i.overflowElement.offset().top,t.fromTop=t.parentOffsetTop-t.containerOffsetTop,t.fromBottom=t.containerHeight-t.parentHeight-(t.parentOffsetTop-t.containerOffsetTop),t.dropdownHeight<t.fromBottom?!1:t.dropdownHeight<t.fromTop?!0:t.dropdownHeight>=t.fromTop&&t.dropdownHeight>=t.fromBottom?t.fromTop>=t.fromBottom?!0:!1:void 0}function r(t){var i,u=t.attr("data-target"),r=!0;return u?"window"!==u&&(i=n(u),r=!1):n.each(t.parents(),function(t,u){if("visible"!==n(u).css("overflow"))return(i=u,r=!1,!1)}),r&&(i=window),{overflowElement:n(i),isWindow:r}}n(document.body).on("click.fu.dropdown-autoflip","[data-toggle=dropdown][data-flip]",function(){"auto"===n(this).data().flip&&t(n(this).next(".dropdown-menu"))});n(document.body).on("suggested.fu.pillbox",function(i,r){t(n(r));n(r).parent().addClass("open")});n.fn.dropdownautoflip=function(){}}(n),function(n){var i=n.fn.loader,t=function(t,i){this.$element=n(t);this.options=n.extend({},n.fn.loader.defaults,i);this.begin=this.$element.is("[data-begin]")?parseInt(this.$element.attr("data-begin"),10):1;this.delay=this.$element.is("[data-delay]")?parseFloat(this.$element.attr("data-delay")):150;this.end=this.$element.is("[data-end]")?parseInt(this.$element.attr("data-end"),10):8;this.frame=this.$element.is("[data-frame]")?parseInt(this.$element.attr("data-frame"),10):this.begin;this.isIElt9=!1;this.timeout={};var r=this.msieVersion();r!==!1&&9>r&&(this.$element.addClass("iefix"),this.isIElt9=!0);this.$element.attr("data-frame",this.frame+"");this.play()};t.prototype={constructor:t,destroy:function(){return this.pause(),this.$element.remove(),this.$element[0].outerHTML},ieRepaint:function(){this.isIElt9&&this.$element.addClass("iefix_repaint").removeClass("iefix_repaint")},msieVersion:function(){var n=window.navigator.userAgent,t=n.indexOf("MSIE ");return t>0?parseInt(n.substring(t+5,n.indexOf(".",t)),10):!1},next:function(){this.frame++;this.frame>this.end&&(this.frame=this.begin);this.$element.attr("data-frame",this.frame+"");this.ieRepaint()},pause:function(){clearTimeout(this.timeout)},play:function(){var n=this;clearTimeout(this.timeout);this.timeout=setTimeout(function(){n.next();n.play()},this.delay)},previous:function(){this.frame--;this.frame<this.begin&&(this.frame=this.end);this.$element.attr("data-frame",this.frame+"");this.ieRepaint()},reset:function(){this.frame=this.begin;this.$element.attr("data-frame",this.frame+"");this.ieRepaint()}};n.fn.loader=function(i){var r,u=Array.prototype.slice.call(arguments,1),f=this.each(function(){var e=n(this),f=e.data("fu.loader"),o="object"==typeof i&&i;f||e.data("fu.loader",f=new t(this,o));"string"==typeof i&&(r=f[i].apply(f,u))});return void 0===r?f:r};n.fn.loader.defaults={};n.fn.loader.Constructor=t;n.fn.loader.noConflict=function(){return n.fn.loader=i,this};n(function(){n("[data-initialize=loader]").each(function(){var t=n(this);t.data("fu.loader")||t.loader(t.data())})})}(n),function(n){var r=n.fn.placard,u={accepted:"onAccept",cancelled:"onCancel"},t=function(t,i){var r=this;this.$element=n(t);this.options=n.extend({},n.fn.placard.defaults,i);"true"===this.$element.attr("data-ellipsis")&&(this.options.applyEllipsis=!0);this.$accept=this.$element.find(".placard-accept");this.$cancel=this.$element.find(".placard-cancel");this.$field=this.$element.find(".placard-field");this.$footer=this.$element.find(".placard-footer");this.$header=this.$element.find(".placard-header");this.$popup=this.$element.find(".placard-popup");this.actualValue=null;this.clickStamp="_";this.previousValue="";-1===this.options.revertOnCancel&&(this.options.revertOnCancel=this.$accept.length>0);this.isContentEditableDiv=this.$field.is("div");this.isInput=this.$field.is("input");this.divInTextareaMode=this.isContentEditableDiv&&"true"===this.$field.attr("data-textarea");this.$field.on("focus.fu.placard",n.proxy(this.show,this));this.$field.on("keydown.fu.placard",n.proxy(this.keyComplete,this));this.$element.on("close.fu.placard",n.proxy(this.hide,this));this.$accept.on("click.fu.placard",n.proxy(this.complete,this,"accepted"));this.$cancel.on("click.fu.placard",function(n){n.preventDefault();r.complete("cancelled")});this.applyEllipsis()},i=function(n){return n.$element.hasClass("showing")},f=function(){var t;if(t=n(document).find(".placard.showing"),t.length>0){if(t.data("fu.placard")&&t.data("fu.placard").options.explicit)return!1;t.placard("externalClickListener",{},!0)}return!0};t.prototype={constructor:t,complete:function(n){var i=this.options[u[n]],t={previousValue:this.previousValue,value:this.getValue()};i?(i(t),this.$element.trigger(n+".fu.placard",t)):("cancelled"===n&&this.options.revertOnCancel&&this.setValue(this.previousValue,!0),this.$element.trigger(n+".fu.placard",t),this.hide())},keyComplete:function(n){(this.isContentEditableDiv&&!this.divInTextareaMode||this.isInput)&&13===n.keyCode?(this.complete("accepted"),this.$field.blur()):27===n.keyCode&&(this.complete("cancelled"),this.$field.blur())},destroy:function(){return this.$element.remove(),n(document).off("click.fu.placard.externalClick."+this.clickStamp),this.$element.find("input").each(function(){n(this).attr("value",n(this).val())}),this.$element[0].outerHTML},disable:function(){this.$element.addClass("disabled");this.$field.attr("disabled","disabled");this.isContentEditableDiv&&this.$field.removeAttr("contenteditable");this.hide()},applyEllipsis:function(){var t,i,n;if(this.options.applyEllipsis)if(t=this.$field.get(0),this.isContentEditableDiv&&!this.divInTextareaMode||this.isInput)t.scrollLeft=0;else if(t.scrollTop=0,t.clientHeight<t.scrollHeight){for(this.actualValue=this.getValue(),this.setValue("",!0),n="",i=0;t.clientHeight>=t.scrollHeight;)n+=this.actualValue[i],this.setValue(n+"...",!0),i++;n=n.length>0?n.substring(0,n.length-1):"";this.setValue(n+"...",!0)}},enable:function(){this.$element.removeClass("disabled");this.$field.removeAttr("disabled");this.isContentEditableDiv&&this.$field.attr("contenteditable","true")},externalClickListener:function(n,t){(t===!0||this.isExternalClick(n))&&this.complete(this.options.externalClickAction)},getValue:function(){return null!==this.actualValue?this.actualValue:this.isContentEditableDiv?this.$field.html():this.$field.val()},hide:function(){this.$element.hasClass("showing")&&(this.$element.removeClass("showing"),this.applyEllipsis(),n(document).off("click.fu.placard.externalClick."+this.clickStamp),this.$element.trigger("hidden.fu.placard"))},isExternalClick:function(t){var i,f,e=this.$element.get(0),r=this.options.externalClickExceptions||[],u=n(t.target);if(t.target===e||u.parents(".placard:first").get(0)===e)return!1;for(i=0,f=r.length;f>i;i++)if(u.is(r[i])||u.parents(r[i]).length>0)return!1;return!0},setValue:function(n,t){return"undefined"==typeof t&&(t=!this.options.applyEllipsis),this.isContentEditableDiv?this.$field.empty().append(n):this.$field.val(n),t||i(this)||this.applyEllipsis(),this.$field},show:function(){i(this)||f()&&(this.previousValue=this.isContentEditableDiv?this.$field.html():this.$field.val(),null!==this.actualValue&&(this.setValue(this.actualValue,!0),this.actualValue=null),this.showPlacard())},showPlacard:function(){this.$element.addClass("showing");this.$header.length>0&&this.$popup.css("top","-"+this.$header.outerHeight(!0)+"px");this.$footer.length>0&&this.$popup.css("bottom","-"+this.$footer.outerHeight(!0)+"px");this.$element.trigger("shown.fu.placard");this.clickStamp=(new Date).getTime()+(Math.floor(100*Math.random())+1);this.options.explicit||n(document).on("click.fu.placard.externalClick."+this.clickStamp,n.proxy(this.externalClickListener,this))}};n.fn.placard=function(i){var r,u=Array.prototype.slice.call(arguments,1),f=this.each(function(){var e=n(this),f=e.data("fu.placard"),o="object"==typeof i&&i;f||e.data("fu.placard",f=new t(this,o));"string"==typeof i&&(r=f[i].apply(f,u))});return void 0===r?f:r};n.fn.placard.defaults={onAccept:void 0,onCancel:void 0,externalClickAction:"cancelled",externalClickExceptions:[],explicit:!1,revertOnCancel:-1,applyEllipsis:!1};n.fn.placard.Constructor=t;n.fn.placard.noConflict=function(){return n.fn.placard=r,this};n(document).on("focus.fu.placard.data-api","[data-initialize=placard]",function(t){var i=n(t.target).closest(".placard");i.data("fu.placard")||i.placard(i.data())});n(function(){n("[data-initialize=placard]").each(function(){var t=n(this);t.data("fu.placard")||t.placard(t.data())})})}(n),function(n){var i=n.fn.radio,t=function(t,i){if(this.options=n.extend({},n.fn.radio.defaults,i),"label"===t.tagName.toLowerCase()){this.$label=n(t);this.$radio=this.$label.find('input[type="radio"]');this.groupName=this.$radio.attr("name");var r=this.$radio.attr("data-toggle");this.$toggleContainer=n(r);this.$radio.on("change",n.proxy(this.itemchecked,this));this.setInitialState()}};t.prototype={constructor:t,setInitialState:function(){var n=this.$radio,t=(this.$label,n.prop("checked")),i=n.prop("disabled");this.setCheckedState(n,t);this.setDisabledState(n,i)},resetGroup:function(){var t=n('input[name="'+this.groupName+'"]');t.each(function(t,i){var r=n(i),u=r.parent(),f=r.attr("data-toggle"),e=n(f);u.removeClass("checked");e.addClass("hidden")})},setCheckedState:function(t,i){var u=t,r=u.parent(),e=u.attr("data-toggle"),f=n(e);i?(this.resetGroup(),u.prop("checked",!0),r.addClass("checked"),f.removeClass("hide hidden"),r.trigger("checked.fu.radio")):(u.prop("checked",!1),r.removeClass("checked"),f.addClass("hidden"),r.trigger("unchecked.fu.radio"));r.trigger("changed.fu.radio",i)},setDisabledState:function(n,t){var i=this.$label;t?(this.$radio.prop("disabled",!0),i.addClass("disabled"),i.trigger("disabled.fu.radio")):(this.$radio.prop("disabled",!1),i.removeClass("disabled"),i.trigger("enabled.fu.radio"))},itemchecked:function(t){var i=n(t.target);this.setCheckedState(i,!0)},check:function(){this.setCheckedState(this.$radio,!0)},uncheck:function(){this.setCheckedState(this.$radio,!1)},isChecked:function(){return this.$radio.prop("checked")},enable:function(){this.setDisabledState(this.$radio,!1)},disable:function(){this.setDisabledState(this.$radio,!0)},destroy:function(){return this.$label.remove(),this.$label[0].outerHTML}};t.prototype.getValue=t.prototype.isChecked;n.fn.radio=function(i){var r,u=Array.prototype.slice.call(arguments,1),f=this.each(function(){var e=n(this),f=e.data("fu.radio"),o="object"==typeof i&&i;f||e.data("fu.radio",f=new t(this,o));"string"==typeof i&&(r=f[i].apply(f,u))});return void 0===r?f:r};n.fn.radio.defaults={};n.fn.radio.Constructor=t;n.fn.radio.noConflict=function(){return n.fn.radio=i,this};n(document).on("mouseover.fu.radio.data-api","[data-initialize=radio]",function(t){var i=n(t.target);i.data("fu.radio")||i.radio(i.data())});n(function(){n("[data-initialize=radio]").each(function(){var t=n(this);t.data("fu.radio")||t.radio(t.data())})})}(n),function(n){var i=n.fn.search,t=function(t,i){this.$element=n(t);this.options=n.extend({},n.fn.search.defaults,i);"true"===this.$element.attr("data-searchOnKeyPress")&&(this.options.searchOnKeyPress=!0);this.$button=this.$element.find("button");this.$input=this.$element.find("input");this.$icon=this.$element.find(".glyphicon");this.$button.on("click.fu.search",n.proxy(this.buttonclicked,this));this.$input.on("keyup.fu.search",n.proxy(this.keypress,this));this.activeSearch=""};t.prototype={constructor:t,destroy:function(){return this.$element.remove(),this.$element.find("input").each(function(){n(this).attr("value",n(this).val())}),this.$element[0].outerHTML},search:function(n){this.$icon.hasClass("glyphicon")&&this.$icon.removeClass("glyphicon-search").addClass("glyphicon-remove");this.activeSearch=n;this.$element.addClass("searched");this.$element.trigger("searched.fu.search",n)},clear:function(){this.$icon.hasClass("glyphicon")&&this.$icon.removeClass("glyphicon-remove").addClass("glyphicon-search");this.activeSearch="";this.$input.val("");this.$element.removeClass("searched");this.$element.trigger("cleared.fu.search")},action:function(){var n=this.$input.val();n&&n.length>0?this.search(n):this.clear()},buttonclicked:function(t){t.preventDefault();n(t.currentTarget).is(".disabled, :disabled")||(this.$element.hasClass("searched")?this.clear():this.action())},keypress:function(n){n.which===13?(n.preventDefault(),this.action()):n.which===9?n.preventDefault():n.which===27?(n.preventDefault(),this.clear()):this.options.searchOnKeyPress&&this.action()},disable:function(){this.$element.addClass("disabled");this.$input.attr("disabled","disabled");this.$button.addClass("disabled")},enable:function(){this.$element.removeClass("disabled");this.$input.removeAttr("disabled");this.$button.removeClass("disabled")}};n.fn.search=function(i){var r,u=Array.prototype.slice.call(arguments,1),f=this.each(function(){var e=n(this),f=e.data("fu.search"),o="object"==typeof i&&i;f||e.data("fu.search",f=new t(this,o));"string"==typeof i&&(r=f[i].apply(f,u))});return void 0===r?f:r};n.fn.search.defaults={clearOnEmpty:!1,searchOnKeyPress:!1};n.fn.search.Constructor=t;n.fn.search.noConflict=function(){return n.fn.search=i,this};n(document).on("mousedown.fu.search.data-api","[data-initialize=search]",function(t){var i=n(t.target).closest(".search");i.data("fu.search")||i.search(i.data())});n(function(){n("[data-initialize=search]").each(function(){var t=n(this);t.data("fu.search")||t.search(t.data())})})}(n),function(n){var i=n.fn.selectlist,t=function(t,i){this.$element=n(t);this.options=n.extend({},n.fn.selectlist.defaults,i);this.$button=this.$element.find(".btn.dropdown-toggle");this.$hiddenField=this.$element.find(".hidden-field");this.$label=this.$element.find(".selected-label");this.$dropdownMenu=this.$element.find(".dropdown-menu");this.$element.on("click.fu.selectlist",".dropdown-menu a",n.proxy(this.itemClicked,this));this.setDefaultSelection();("auto"===i.resize||"auto"===this.$element.attr("data-resize"))&&this.resize();var r=this.$dropdownMenu.children("li");0===r.length&&(this.disable(),this.doSelect(n(this.options.emptyLabelHTML)));this.$element.on("shown.bs.dropdown",function(){var t=n(this);n(document).on("keypress.fu.selectlist",function(i){var r=String.fromCharCode(i.which);t.find("li").each(function(t,i){if(n(i).text().charAt(0).toLowerCase()===r)return(n(i).children("a").focus(),!1)})})});this.$element.on("hide.bs.dropdown",function(){n(document).off("keypress.fu.selectlist")})};t.prototype={constructor:t,destroy:function(){return this.$element.remove(),this.$element[0].outerHTML},doSelect:function(t){var i;this.$selectedItem=i=t;this.$hiddenField.val(this.$selectedItem.attr("data-value"));this.$label.html(n(this.$selectedItem.children()[0]).html());this.$element.find("li").each(function(){i.is(n(this))?n(this).attr("data-selected",!0):n(this).removeData("selected").removeAttr("data-selected")})},itemClicked:function(t){this.$element.trigger("clicked.fu.selectlist",this.$selectedItem);t.preventDefault();n(t.currentTarget).parent("li").is(".disabled, :disabled")||(n(t.target).parent().is(this.$selectedItem)||this.itemChanged(t),this.$element.find(".dropdown-toggle").focus())},itemChanged:function(t){this.doSelect(n(t.target).closest("li"));var i=this.selectedItem();this.$element.trigger("changed.fu.selectlist",i)},resize:function(){var i=0,r=0,t=n("<div/>").addClass("selectlist-sizer");Boolean(n(document).find("html").hasClass("fuelux"))?n(document.body).append(t):n(".fuelux:first").append(t);t.append(this.$element.clone());this.$element.find("a").each(function(){t.find(".selected-label").text(n(this).text());r=t.find(".selectlist").outerWidth();r+=t.find(".sr-only").outerWidth();r>i&&(i=r)});1>=i||(this.$button.css("width",i),this.$dropdownMenu.css("width",i),t.remove())},selectedItem:function(){var t=this.$selectedItem.text();return n.extend({text:t},this.$selectedItem.data())},selectByText:function(t){var i=n([]);this.$element.find("li").each(function(){if((this.textContent||this.innerText||n(this).text()||"").toLowerCase()===(t||"").toLowerCase())return(i=n(this),!1)});this.doSelect(i)},selectByValue:function(n){var t='li[data-value="'+n+'"]';this.selectBySelector(t)},selectByIndex:function(n){var t="li:eq("+n+")";this.selectBySelector(t)},selectBySelector:function(n){var t=this.$element.find(n);this.doSelect(t)},setDefaultSelection:function(){var n=this.$element.find("li[data-selected=true]").eq(0);0===n.length&&(n=this.$element.find("li").has("a").eq(0));this.doSelect(n)},enable:function(){this.$element.removeClass("disabled");this.$button.removeClass("disabled")},disable:function(){this.$element.addClass("disabled");this.$button.addClass("disabled")}};t.prototype.getValue=t.prototype.selectedItem;n.fn.selectlist=function(i){var r,u=Array.prototype.slice.call(arguments,1),f=this.each(function(){var e=n(this),f=e.data("fu.selectlist"),o="object"==typeof i&&i;f||e.data("fu.selectlist",f=new t(this,o));"string"==typeof i&&(r=f[i].apply(f,u))});return void 0===r?f:r};n.fn.selectlist.defaults={emptyLabelHTML:'<li data-value=""><a href="#">No items<\/a><\/li>'};n.fn.selectlist.Constructor=t;n.fn.selectlist.noConflict=function(){return n.fn.selectlist=i,this};n(document).on("mousedown.fu.selectlist.data-api","[data-initialize=selectlist]",function(t){var i=n(t.target).closest(".selectlist");i.data("fu.selectlist")||i.selectlist(i.data())});n(function(){n("[data-initialize=selectlist]").each(function(){var t=n(this);t.data("fu.selectlist")||t.selectlist(t.data())})})}(n),function(n){var r=n.fn.spinbox,t=function(t,r){this.$element=n(t);this.$element.find(".btn").on("click",function(n){n.preventDefault()});this.options=n.extend({},n.fn.spinbox.defaults,r);this.options.step=this.$element.data("step")||this.options.step;this.options.value<this.options.min?this.options.value=this.options.min:this.options.max<this.options.value&&(this.options.value=this.options.max);this.$input=this.$element.find(".spinbox-input");this.$input.on("focusout.fu.spinbox",this.$input,n.proxy(this.change,this));this.$element.on("keydown.fu.spinbox",this.$input,n.proxy(this.keydown,this));this.$element.on("keyup.fu.spinbox",this.$input,n.proxy(this.keyup,this));this.bindMousewheelListeners();this.mousewheelTimeout={};this.options.hold?(this.$element.on("mousedown.fu.spinbox",".spinbox-up",n.proxy(function(){this.startSpin(!0)},this)),this.$element.on("mouseup.fu.spinbox",".spinbox-up, .spinbox-down",n.proxy(this.stopSpin,this)),this.$element.on("mouseout.fu.spinbox",".spinbox-up, .spinbox-down",n.proxy(this.stopSpin,this)),this.$element.on("mousedown.fu.spinbox",".spinbox-down",n.proxy(function(){this.startSpin(!1)},this))):(this.$element.on("click.fu.spinbox",".spinbox-up",n.proxy(function(){this.step(!0)},this)),this.$element.on("click.fu.spinbox",".spinbox-down",n.proxy(function(){this.step(!1)},this)));this.switches={count:1,enabled:!0};this.switches.speed="medium"===this.options.speed?300:"fast"===this.options.speed?100:500;this.options.defaultUnit=i(this.options.defaultUnit,this.options.units)?this.options.defaultUnit:"";this.unit=this.options.defaultUnit;this.lastValue=this.options.value;this.render();this.options.disabled&&this.disable()},u=function(n,t){return Math.round(n/t)*t},i=function(t,i){var r=!1,u=t.toLowerCase();return n.each(i,function(n,t){return t=t.toLowerCase(),u===t?(r=!0,!1):void 0}),r},f=function(n){return isNaN(parseFloat(n))?n:(n>this.options.max?n=this.options.cycle?this.options.min:this.options.max:n<this.options.min&&(n=this.options.cycle?this.options.max:this.options.min),this.options.limitToStep&&this.options.step&&(n=u(n,this.options.step),n>this.options.max?n-=this.options.step:n<this.options.min&&(n+=this.options.step)),n)};t.prototype={constructor:t,destroy:function(){return this.$element.remove(),this.$element.find("input").each(function(){n(this).attr("value",n(this).val())}),this.$element[0].outerHTML},render:function(){this.setValue(this.getDisplayValue())},change:function(){this.setValue(this.getDisplayValue());this.triggerChangedEvent()},stopSpin:function(){void 0!==this.switches.timeout&&(clearTimeout(this.switches.timeout),this.switches.count=1,this.triggerChangedEvent())},triggerChangedEvent:function(){var n=this.getValue();n!==this.lastValue&&(this.lastValue=n,this.$element.trigger("changed.fu.spinbox",n))},startSpin:function(t){if(!this.options.disabled){var i=this.switches.count;1===i?(this.step(t),i=1):i=3>i?1.5:8>i?2.5:4;this.switches.timeout=setTimeout(n.proxy(function(){this.iterate(t)},this),this.switches.speed/i);this.switches.count++}},iterate:function(n){this.step(n);this.startSpin(n)},step:function(n){this.setValue(this.getDisplayValue());var t;t=n?this.options.value+this.options.step:this.options.value-this.options.step;t=t.toFixed(5);this.setValue(t+this.unit)},getDisplayValue:function(){var n=this.parseInput(this.$input.val());return n?n:this.options.value},setDisplayValue:function(n){this.$input.val(n)},getValue:function(){var n=this.options.value;return"."!==this.options.decimalMark&&(n=(n+"").split(".").join(this.options.decimalMark)),n+this.unit},setValue:function(n){var r,t;return("."!==this.options.decimalMark&&(n=this.parseInput(n)),"number"!=typeof n)&&(r=n.replace(/[0-9.-]/g,""),this.unit=i(r,this.options.units)?r:this.options.defaultUnit),t=this.getIntValue(n),isNaN(t)&&!isFinite(t)?this.setValue(this.options.value):(t=f.call(this,t),this.options.value=t,n=t+this.unit,"."!==this.options.decimalMark&&(n=(n+"").split(".").join(this.options.decimalMark)),this.setDisplayValue(n),this)},value:function(n){return n||0===n?this.setValue(n):this.getValue()},parseInput:function(n){return(n+"").split(this.options.decimalMark).join(".")},getIntValue:function(n){return n="undefined"==typeof n?this.getValue():n,"undefined"!=typeof n?("string"==typeof n&&(n=this.parseInput(n)),n=parseFloat(n,10)):void 0},disable:function(){this.options.disabled=!0;this.$element.addClass("disabled");this.$input.attr("disabled","");this.$element.find("button").addClass("disabled")},enable:function(){this.options.disabled=!1;this.$element.removeClass("disabled");this.$input.removeAttr("disabled");this.$element.find("button").removeClass("disabled")},keydown:function(n){var t=n.keyCode;38===t?this.step(!0):40===t?this.step(!1):13===t&&this.change()},keyup:function(n){var t=n.keyCode;(38===t||40===t)&&this.triggerChangedEvent()},bindMousewheelListeners:function(){var t=this.$input.get(0);t.addEventListener?(t.addEventListener("mousewheel",n.proxy(this.mousewheelHandler,this),!1),t.addEventListener("DOMMouseScroll",n.proxy(this.mousewheelHandler,this),!1)):t.attachEvent("onmousewheel",n.proxy(this.mousewheelHandler,this))},mousewheelHandler:function(n){if(!this.options.disabled){var t=window.event||n,i=Math.max(-1,Math.min(1,t.wheelDelta||-t.detail)),r=this;return clearTimeout(this.mousewheelTimeout),this.mousewheelTimeout=setTimeout(function(){r.triggerChangedEvent()},300),0>i?this.step(!0):this.step(!1),t.preventDefault?t.preventDefault():t.returnValue=!1,!1}}};n.fn.spinbox=function(i){var r,u=Array.prototype.slice.call(arguments,1),f=this.each(function(){var e=n(this),f=e.data("fu.spinbox"),o="object"==typeof i&&i;f||e.data("fu.spinbox",f=new t(this,o));"string"==typeof i&&(r=f[i].apply(f,u))});return void 0===r?f:r};n.fn.spinbox.defaults={value:0,min:0,max:999,step:1,hold:!0,speed:"medium",disabled:!1,cycle:!1,units:[],decimalMark:".",defaultUnit:"",limitToStep:!1};n.fn.spinbox.Constructor=t;n.fn.spinbox.noConflict=function(){return n.fn.spinbox=r,this};n(document).on("mousedown.fu.spinbox.data-api","[data-initialize=spinbox]",function(t){var i=n(t.target).closest(".spinbox");i.data("fu.spinbox")||i.spinbox(i.data())});n(function(){n("[data-initialize=spinbox]").each(function(){var t=n(this);t.data("fu.spinbox")||t.spinbox(t.data())})})}(n),function(n){function r(n,t){n.addClass("tree-selected");"item"===n.data("type")&&t.hasClass("fueluxicon-bullet")&&t.removeClass("fueluxicon-bullet").addClass("glyphicon-ok")}function i(n,t){n.removeClass("tree-selected");"item"===n.data("type")&&t.hasClass("glyphicon-ok")&&t.removeClass("glyphicon-ok").addClass("fueluxicon-bullet")}function u(t,u,f){n.each(f.$elements,function(t,i){var r=n(i);r[0]!==u.$element[0]&&f.dataForEvent.push(n(r).data())});u.$element.hasClass("tree-selected")?(i(u.$element,u.$icon),f.eventType="deselected"):(r(u.$element,u.$icon),f.eventType="selected",f.dataForEvent.push(u.elementData))}function f(n,t,u){u.$elements[0]!==t.$element[0]?(n.deselectAll(n.$element),r(t.$element,t.$icon),u.eventType="selected",u.dataForEvent=[t.elementData]):(i(t.$element,t.$icon),u.eventType="deselected",u.dataForEvent=[])}var e=n.fn.tree,t=function(t,i){this.$element=n(t);this.options=n.extend({},n.fn.tree.defaults,i);this.options.itemSelect&&this.$element.on("click.fu.tree",".tree-item",n.proxy(function(n){this.selectItem(n.currentTarget)},this));this.$element.on("click.fu.tree",".tree-branch-name",n.proxy(function(n){this.toggleFolder(n.currentTarget)},this));this.options.folderSelect&&(this.$element.addClass("tree-folder-select"),this.$element.off("click.fu.tree",".tree-branch-name"),this.$element.on("click.fu.tree",".icon-caret",n.proxy(function(t){this.toggleFolder(n(t.currentTarget).parent())},this)),this.$element.on("click.fu.tree",".tree-branch-name",n.proxy(function(t){this.selectFolder(n(t.currentTarget))},this)));this.render()};t.prototype={constructor:t,deselectAll:function(t){t=t||this.$element;var r=n(t).find(".tree-selected");return r.each(function(t,r){i(n(r),n(r).find(".glyphicon"))}),r},destroy:function(){return this.$element.find("li:not([data-template])").remove(),this.$element.remove(),this.$element[0].outerHTML},render:function(){this.populate(this.$element)},populate:function(t,i){var u=this,r=t.hasClass("tree")?t:t.parent(),f=r.find(".tree-loader:eq(0)"),e=r.data();i=i||!1;i===!1&&f.removeClass("hide hidden");this.options.dataSource(e?e:{},function(i){f.addClass("hidden");n.each(i.data,function(i,f){var e,o;"folder"===f.type?(e=u.$element.find("[data-template=treebranch]:eq(0)").clone().removeClass("hide hidden").removeData("template"),e.data(f),e.find(".tree-branch-name > .tree-label").html(f.text||f.name)):"item"===f.type&&(e=u.$element.find("[data-template=treeitem]:eq(0)").clone().removeClass("hide hidden").removeData("template"),e.find(".tree-item-name > .tree-label").html(f.text||f.name),e.data(f));o=f.attr||f.dataAttributes||[];n.each(o,function(n,t){switch(n){case"cssClass":case"class":case"className":e.addClass(t);break;case"data-icon":e.find(".icon-item").removeClass().addClass("icon-item "+t);e.attr(n,t);break;case"id":e.attr(n,t);e.attr("aria-labelledby",t+"-label");e.find(".tree-branch-name > .tree-label").attr("id",t+"-label");break;default:e.attr(n,t)}});t.hasClass("tree-branch-header")?r.find(".tree-branch-children:eq(0)").append(e):t.append(e)});u.$element.trigger("loaded.fu.tree",r)})},selectTreeNode:function(t,i){var r={},e;r.$element=n(t);e={};e.$elements=this.$element.find(".tree-selected");e.dataForEvent=[];"folder"===i?(r.$element=r.$element.closest(".tree-branch"),r.$icon=r.$element.find(".icon-folder")):r.$icon=r.$element.find(".icon-item");r.elementData=r.$element.data();this.options.multiSelect?u(this,r,e):f(this,r,e);this.$element.trigger(e.eventType+".fu.tree",{target:r.elementData,selected:e.dataForEvent});r.$element.trigger("updated.fu.tree",{selected:e.dataForEvent,item:r.$element,eventType:e.eventType})},discloseFolder:function(t){var u=n(t),i=u.closest(".tree-branch"),r=i.find(".tree-branch-children"),f=r.eq(0);i.addClass("tree-open");i.attr("aria-expanded","true");f.removeClass("hide hidden");i.find("> .tree-branch-header .icon-folder").eq(0).removeClass("glyphicon-folder-close").addClass("glyphicon-folder-open");r.children().length||this.populate(r);this.$element.trigger("disclosedFolder.fu.tree",i.data())},closeFolder:function(t){var u=n(t),i=u.closest(".tree-branch"),f=i.find(".tree-branch-children"),r=f.eq(0);i.removeClass("tree-open");i.attr("aria-expanded","false");r.addClass("hidden");i.find("> .tree-branch-header .icon-folder").eq(0).removeClass("glyphicon-folder-open").addClass("glyphicon-folder-close");this.options.cacheItems||r.empty();this.$element.trigger("closed.fu.tree",i.data())},toggleFolder:function(t){var i=n(t);i.find(".glyphicon-folder-close").length?this.discloseFolder(t):i.find(".glyphicon-folder-open").length&&this.closeFolder(t)},selectFolder:function(n){this.options.folderSelect&&this.selectTreeNode(n,"folder")},selectItem:function(n){this.options.itemSelect&&this.selectTreeNode(n,"item")},selectedItems:function(){var i=this.$element.find(".tree-selected"),t=[];return n.each(i,function(i,r){t.push(n(r).data())}),t},collapse:function(){var n=this,t=[],i=function r(i,u){t.push(u);0===n.$element.find(".tree-branch.tree-open:not('.hidden, .hide')").length&&(n.$element.trigger("closedAll.fu.tree",{tree:n.$element,reportedClosed:t}),n.$element.off("loaded.fu.tree",n.$element,r))};n.$element.on("closed.fu.tree",i);n.$element.find(".tree-branch.tree-open:not('.hidden, .hide')").each(function(){n.closeFolder(this)})},discloseVisible:function(){var t=this,r=t.$element.find(".tree-branch:not('.tree-open, .hidden, .hide')"),i=[],u=function f(n,u){i.push(u);i.length===r.length&&(t.$element.trigger("disclosedVisible.fu.tree",{tree:t.$element,reportedOpened:i}),t.$element.off("loaded.fu.tree",t.$element,f))};t.$element.on("loaded.fu.tree",u);t.$element.find(".tree-branch:not('.tree-open, .hidden, .hide')").each(function(){t.discloseFolder(n(this).find(".tree-branch-header"))})},discloseAll:function(){var n=this,t,i;if("undefined"==typeof n.$element.data("disclosures")&&n.$element.data("disclosures",0),t=n.options.disclosuresUpperLimit>=1&&n.$element.data("disclosures")>=n.options.disclosuresUpperLimit,i=0===n.$element.find(".tree-branch:not('.tree-open, .hidden, .hide')").length,i)n.$element.trigger("disclosedAll.fu.tree",{tree:n.$element,disclosures:n.$element.data("disclosures")}),n.options.cacheItems||n.$element.one("closeAll.fu.tree",function(){n.$element.data("disclosures",0)});else{if(t&&(n.$element.trigger("exceededDisclosuresLimit.fu.tree",{tree:n.$element,disclosures:n.$element.data("disclosures")}),!n.$element.data("ignore-disclosures-limit")))return;n.$element.data("disclosures",n.$element.data("disclosures")+1);n.$element.one("disclosedVisible.fu.tree",function(){n.discloseAll()});n.discloseVisible()}},refreshFolder:function(n){var t=n.closest(".tree-branch"),i=t.find(".tree-branch-children");i.eq(0).empty();t.hasClass("tree-open")?this.populate(i,!1):this.populate(i,!0);this.$element.trigger("refreshedFolder.fu.tree",t.data())}};t.prototype.closeAll=t.prototype.collapse;t.prototype.openFolder=t.prototype.discloseFolder;t.prototype.getValue=t.prototype.selectedItems;n.fn.tree=function(i){var r,u=Array.prototype.slice.call(arguments,1),f=this.each(function(){var e=n(this),f=e.data("fu.tree"),o="object"==typeof i&&i;f||e.data("fu.tree",f=new t(this,o));"string"==typeof i&&(r=f[i].apply(f,u))});return void 0===r?f:r};n.fn.tree.defaults={dataSource:function(){},multiSelect:!1,cacheItems:!0,folderSelect:!0,itemSelect:!0,disclosuresUpperLimit:0};n.fn.tree.Constructor=t;n.fn.tree.noConflict=function(){return n.fn.tree=e,this}}(n),function(n){var i=n.fn.wizard,t=function(t,i){var r;this.$element=n(t);this.options=n.extend({},n.fn.wizard.defaults,i);this.options.disablePreviousStep="previous"===this.$element.attr("data-restrict")?!0:this.options.disablePreviousStep;this.currentStep=this.options.selectedItem.step;this.numSteps=this.$element.find(".steps li").length;this.$prevBtn=this.$element.find("button.btn-prev");this.$nextBtn=this.$element.find("button.btn-next");0===this.$element.children(".steps-container").length&&(this.$element.addClass("no-steps-container"),window&&window.console&&window.console.warn&&window.console.warn('please update your wizard markup to include ".steps-container" as seen in http://getfuelux.com/javascript.html#wizard-usage-markup'));r=this.$nextBtn.children().detach();this.nextText=n.trim(this.$nextBtn.text());this.$nextBtn.append(r);this.$prevBtn.on("click.fu.wizard",n.proxy(this.previous,this));this.$nextBtn.on("click.fu.wizard",n.proxy(this.next,this));this.$element.on("click.fu.wizard","li.complete",n.proxy(this.stepclicked,this));this.selectedItem(this.options.selectedItem);this.options.disablePreviousStep&&(this.$prevBtn.attr("disabled",!0),this.$element.find(".steps").addClass("previous-disabled"))};t.prototype={constructor:t,destroy:function(){return this.$element.remove(),this.$element[0].outerHTML},addSteps:function(t){var r,s,e,h,u,f,i=[].slice.call(arguments).slice(1),o=this.$element.find(".steps"),c=this.$element.find(".step-content");for(t=-1===t||t>this.numSteps+1?this.numSteps+1:t,i[0]instanceof Array&&(i=i[0]),u=o.find("li:nth-child("+t+")"),h=c.find(".step-pane:nth-child("+t+")"),u.length<1&&(u=null),r=0,s=i.length;s>r;r++)f=n('<li data-step="'+t+'"><span class="badge badge-info"><\/span><\/li>'),f.append(i[r].label||"").append('<span class="chevron"><\/span>'),f.find(".badge").append(i[r].badge||t),e=n('<div class="step-pane" data-step="'+t+'"><\/div>'),e.append(i[r].pane||""),u?(u.before(f),h.before(e)):(o.append(f),c.append(e)),t++;this.syncSteps();this.numSteps=o.find("li").length;this.setState()},removeSteps:function(t,i){var r,f="nextAll",e=0,u=this.$element.find(".steps"),o=this.$element.find(".step-content");i=void 0!==i?i:1;t>u.find("li").length?r=u.find("li:last"):(r=u.find("li:nth-child("+t+")").prev(),r.length<1&&(f="children",r=u));r[f]().each(function(){var t=n(this),r=t.attr("data-step");return i>e?(t.remove(),o.find('.step-pane[data-step="'+r+'"]:first').remove(),void e++):!1});this.syncSteps();this.numSteps=u.find("li").length;this.setState()},setState:function(){var p=this.currentStep>1,w=1===this.currentStep,b=this.currentStep===this.numSteps,f,e,c,o,l,s,a,i,h,v,r,u,t,y;this.options.disablePreviousStep||this.$prevBtn.attr("disabled",w===!0||p===!1);f=this.$nextBtn.attr("data-last");f&&(this.lastText=f,e=this.nextText,b===!0?(e=this.lastText,this.$element.addClass("complete")):this.$element.removeClass("complete"),c=this.$nextBtn.children().detach(),this.$nextBtn.text(e).append(c));o=this.$element.find(".steps li");o.removeClass("active").removeClass("complete");o.find("span.badge").removeClass("badge-info").removeClass("badge-success");l=".steps li:lt("+(this.currentStep-1)+")";s=this.$element.find(l);s.addClass("complete");s.find("span.badge").addClass("badge-success");a=".steps li:eq("+(this.currentStep-1)+")";i=this.$element.find(a);i.addClass("active");i.find("span.badge").addClass("badge-info");h=this.$element.find(".step-content");v=i.attr("data-step");h.find(".step-pane").removeClass("active");h.find('.step-pane[data-step="'+v+'"]:first').addClass("active");this.$element.find(".steps").first().attr("style","margin-left: 0");r=0;this.$element.find(".steps > li").each(function(){r+=n(this).outerWidth()});u=0;(u=this.$element.find(".actions").length?this.$element.width()-this.$element.find(".actions").first().outerWidth():this.$element.width(),r>u)&&(t=r-u,this.$element.find(".steps").first().attr("style","margin-left: -"+t+"px"),this.$element.find("li.active").first().position().left<200&&(t+=this.$element.find("li.active").first().position().left-200,1>t?this.$element.find(".steps").first().attr("style","margin-left: 0"):this.$element.find(".steps").first().attr("style","margin-left: -"+t+"px")));"undefined"!=typeof this.initialized&&(y=n.Event("changed.fu.wizard"),this.$element.trigger(y,{step:this.currentStep}));this.initialized=!0},stepclicked:function(t){var u=n(t.currentTarget),i=this.$element.find(".steps li").index(u),r;i<this.currentStep&&this.options.disablePreviousStep||(r=n.Event("stepclicked.fu.wizard"),this.$element.trigger(r,{step:i+1}),r.isDefaultPrevented()||(this.currentStep=i+1,this.setState()))},syncSteps:function(){var t=1,i=this.$element.find(".steps"),r=this.$element.find(".step-content");i.children().each(function(){var i=n(this),u=i.find(".badge"),f=i.attr("data-step");isNaN(parseInt(u.html(),10))||u.html(t);i.attr("data-step",t);r.find('.step-pane[data-step="'+f+'"]:last').attr("data-step",t);t++})},previous:function(){var t,i;this.options.disablePreviousStep||1===this.currentStep||(t=n.Event("actionclicked.fu.wizard"),(this.$element.trigger(t,{step:this.currentStep,direction:"previous"}),!t.isDefaultPrevented()&&(this.currentStep-=1,this.setState(),this.$prevBtn.is(":focus")))&&(i=this.$element.find(".active").find("input, select, textarea")[0],"undefined"!=typeof i?n(i).focus():0===this.$element.find(".active input:first").length&&this.$prevBtn.is(":disabled")&&this.$nextBtn.focus()))},next:function(){var i=n.Event("actionclicked.fu.wizard"),t;(this.$element.trigger(i,{step:this.currentStep,direction:"next"}),!i.isDefaultPrevented()&&(this.currentStep<this.numSteps?(this.currentStep+=1,this.setState()):this.$element.trigger("finished.fu.wizard"),this.$nextBtn.is(":focus")))&&(t=this.$element.find(".active").find("input, select, textarea")[0],"undefined"!=typeof t?n(t).focus():0===this.$element.find(".active input:first").length&&this.$nextBtn.is(":disabled")&&this.$prevBtn.focus())},selectedItem:function(n){var i,t;return n?(t=n.step||-1,t=Number(this.$element.find('.steps li[data-name="'+t+'"]').first().attr("data-step"))||Number(t),t>=1&&t<=this.numSteps?(this.currentStep=t,this.setState()):(t=this.$element.find(".steps li.active:first").attr("data-step"),isNaN(t)||(this.currentStep=parseInt(t,10),this.setState())),i=this):(i={step:this.currentStep},this.$element.find(".steps li.active:first[data-name]").length&&(i.stepname=this.$element.find(".steps li.active:first").attr("data-name"))),i}};n.fn.wizard=function(i){var r,u=Array.prototype.slice.call(arguments,1),f=this.each(function(){var e=n(this),f=e.data("fu.wizard"),o="object"==typeof i&&i;f||e.data("fu.wizard",f=new t(this,o));"string"==typeof i&&(r=f[i].apply(f,u))});return void 0===r?f:r};n.fn.wizard.defaults={disablePreviousStep:!1,selectedItem:{step:-1}};n.fn.wizard.Constructor=t;n.fn.wizard.noConflict=function(){return n.fn.wizard=i,this};n(document).on("mouseover.fu.wizard.data-api","[data-initialize=wizard]",function(t){var i=n(t.target).closest(".wizard");i.data("fu.wizard")||i.wizard(i.data())});n(function(){n("[data-initialize=wizard]").each(function(){var t=n(this);t.data("fu.wizard")||t.wizard(t.data())})})}(n),function(n){var i=n.fn.infinitescroll,t=function(t,i){this.$element=n(t);this.$element.addClass("infinitescroll");this.options=n.extend({},n.fn.infinitescroll.defaults,i);this.curScrollTop=this.$element.scrollTop();this.curPercentage=this.getPercentage();this.fetchingData=!1;this.$element.on("scroll.fu.infinitescroll",n.proxy(this.onScroll,this));this.onScroll()};t.prototype={constructor:t,destroy:function(){return this.$element.remove(),this.$element.empty(),this.$element[0].outerHTML},disable:function(){this.$element.off("scroll.fu.infinitescroll")},enable:function(){this.$element.on("scroll.fu.infinitescroll",n.proxy(this.onScroll,this))},end:function(t){var i=n('<div class="infinitescroll-end"><\/div>');t?i.append(t):i.append("---------");this.$element.append(i);this.disable()},getPercentage:function(){var n="border-box"===this.$element.css("box-sizing")?this.$element.outerHeight():this.$element.height(),t=this.$element.get(0).scrollHeight;return t>n?n/(t-this.curScrollTop)*100:0},fetchData:function(t){var r,u=n('<div class="infinitescroll-load"><\/div>'),i=this,f=function(){var r={percentage:i.curPercentage,scrollTop:i.curScrollTop},t=n('<div class="loader"><\/div>');u.append(t);t.loader();i.options.dataSource&&i.options.dataSource(r,function(n){var t;u.remove();n.content&&i.$element.append(n.content);n.end&&(t=n.end!==!0?n.end:void 0,i.end(t));i.fetchingData=!1})};this.fetchingData=!0;this.$element.append(u);this.options.hybrid&&t!==!0?(r=n('<button type="button" class="btn btn-primary"><\/button>'),"object"==typeof this.options.hybrid?r.append(this.options.hybrid.label):r.append('<span class="glyphicon glyphicon-repeat"><\/span>'),r.on("click.fu.infinitescroll",function(){r.remove();f()}),u.append(r)):f()},onScroll:function(){this.curScrollTop=this.$element.scrollTop();this.curPercentage=this.getPercentage();!this.fetchingData&&this.curPercentage>=this.options.percentage&&this.fetchData()}};n.fn.infinitescroll=function(i){var r,u=Array.prototype.slice.call(arguments,1),f=this.each(function(){var e=n(this),f=e.data("fu.infinitescroll"),o="object"==typeof i&&i;f||e.data("fu.infinitescroll",f=new t(this,o));"string"==typeof i&&(r=f[i].apply(f,u))});return void 0===r?f:r};n.fn.infinitescroll.defaults={dataSource:null,hybrid:!1,percentage:95};n.fn.infinitescroll.Constructor=t;n.fn.infinitescroll.noConflict=function(){return n.fn.infinitescroll=i,this}}(n),function(n){var i=n.fn.pillbox,t=function(t,i){this.$element=n(t);this.$moreCount=this.$element.find(".pillbox-more-count");this.$pillGroup=this.$element.find(".pill-group");this.$addItem=this.$element.find(".pillbox-add-item");this.$addItemWrap=this.$addItem.parent();this.$suggest=this.$element.find(".suggest");this.$pillHTML='<li class="btn btn-default pill">\t<span><\/span>\t<span class="glyphicon glyphicon-close">\t\t<span class="sr-only">Remove<\/span>\t<\/span><\/li>';this.options=n.extend({},n.fn.pillbox.defaults,i);-1===this.options.readonly?void 0!==this.$element.attr("data-readonly")&&this.readonly(!0):this.options.readonly&&this.readonly(!0);this.acceptKeyCodes=this._generateObject(this.options.acceptKeyCodes);this.$element.on("click.fu.pillbox",".pill-group > .pill",n.proxy(this.itemClicked,this));this.$element.on("click.fu.pillbox",n.proxy(this.inputFocus,this));this.$element.on("keydown.fu.pillbox",".pillbox-add-item",n.proxy(this.inputEvent,this));this.options.onKeyDown&&this.$element.on("mousedown.fu.pillbox",".suggest > li",n.proxy(this.suggestionClick,this));this.options.edit&&(this.$element.addClass("pills-editable"),this.$element.on("blur.fu.pillbox",".pillbox-add-item",n.proxy(this.cancelEdit,this)))};t.prototype={constructor:t,destroy:function(){return this.$element.remove(),this.$element[0].outerHTML},items:function(){var t=this;return this.$pillGroup.children(".pill").map(function(){return t.getItemData(n(this))}).get()},itemClicked:function(t){var i,r=n(t.target);if(t.preventDefault(),t.stopPropagation(),this._closeSuggestions(),r.hasClass("pill"))i=r;else if(i=r.parent(),void 0===this.$element.attr("data-readonly")){if(r.hasClass("glyphicon-close"))return this.options.onRemove?this.options.onRemove(this.getItemData(i,{el:i}),n.proxy(this._removeElement,this)):this._removeElement(this.getItemData(i,{el:i})),!1;if(this.options.edit){if(i.find(".pillbox-list-edit").length)return!1;this.openEdit(i)}}this.$element.trigger("clicked.fu.pillbox",this.getItemData(i))},readonly:function(n){n?this.$element.attr("data-readonly","readonly"):this.$element.removeAttr("data-readonly");this.options.truncate&&this.truncate(n)},suggestionClick:function(t){var i=n(t.currentTarget),r={text:i.html(),value:i.data("value")};t.preventDefault();this.$addItem.val("");i.data("attr")&&(r.attr=JSON.parse(i.data("attr")));r.data=i.data("data");this.addItems(r,!0);this._closeSuggestions()},itemCount:function(){return this.$pillGroup.children(".pill").length},addItems:function(){var t,u,r,i=this;!isFinite(String(arguments[0]))||arguments[0]instanceof Array?(t=[].slice.call(arguments).slice(0),r=t[1]&&!t[1].text):(t=[].slice.call(arguments).slice(1),u=arguments[0]);t[0]instanceof Array&&(t=t[0]);t.length&&(n.each(t,function(n,r){var u={text:r.text,value:r.value?r.value:r.text,el:i.$pillHTML};r.attr&&(u.attr=r.attr);r.data&&(u.data=r.data);t[n]=u}),this.options.edit&&this.currentEdit&&(t[0].el=this.currentEdit.wrap("<div><\/div>").parent().html()),r&&t.pop(1),i.options.onAdd&&r?this.options.edit&&this.currentEdit?i.options.onAdd(t[0],n.proxy(i.saveEdit,this)):i.options.onAdd(t[0],n.proxy(i.placeItems,this)):this.options.edit&&this.currentEdit?i.saveEdit(t):u?i.placeItems(u,t):i.placeItems(t,r))},removeItems:function(n,t){var i,r,u=this;if(n)for(t=t?t:1,i=0;t>i&&(r=u.$pillGroup.find("> .pill:nth-child("+n+")"),r);i++)r.remove();else this.$pillGroup.find(".pill").remove(),this._removePillTrigger({method:"removeAll"})},placeItems:function(){var t,r,u,f,i=[];!isFinite(String(arguments[0]))||arguments[0]instanceof Array?(t=[].slice.call(arguments).slice(0),f=t[1]&&!t[1].text):(t=[].slice.call(arguments).slice(1),r=arguments[0]);t[0]instanceof Array&&(t=t[0]);t.length&&(n.each(t,function(t,r){var u=n(r.el);u.attr("data-value",r.value);u.find("span:first").html(r.text);r.attr&&n.each(r.attr,function(n,t){"cssClass"===n||"class"===n?u.addClass(t):u.attr(n,t)});r.data&&u.data("data",r.data);i.push(u)}),this.$pillGroup.children(".pill").length>0?r?(u=this.$pillGroup.find(".pill:nth-child("+r+")"),u.length?u.before(i):this.$pillGroup.children(".pill:last").after(i)):this.$pillGroup.children(".pill:last").after(i):this.$pillGroup.prepend(i),f&&this.$element.trigger("added.fu.pillbox",{text:t[0].text,value:t[0].value}))},inputEvent:function(n){var u,f,i,r,e=this,t=this.$addItem.val();if(this.acceptKeyCodes[n.keyCode])return this.options.onKeyDown&&this._isSuggestionsOpen()&&(r=this.$suggest.find(".pillbox-suggest-sel"),r.length&&(t=r.html(),u=r.data("value"),f=r.data("attr"))),(t.replace(/[ ]*\,[ ]*/,"").match(/\S/)||this.options.allowEmptyPills&&t.length)&&(this._closeSuggestions(),this.$addItem.hide(),f?this.addItems({text:t,value:u,attr:JSON.parse(f)},!0):this.addItems({text:t,value:u},!0),setTimeout(function(){e.$addItem.show().val("").attr({size:10})},0)),n.preventDefault(),!0;if(8===n.keyCode||46===n.keyCode){if(!t.length)return n.preventDefault(),this.options.edit&&this.currentEdit?(this.cancelEdit(),!0):(this._closeSuggestions(),i=this.$pillGroup.children(".pill:last"),i.hasClass("pillbox-highlight")?this._removeElement(this.getItemData(i,{el:i})):i.addClass("pillbox-highlight"),!0)}else t.length>10&&this.$addItem.width()<this.$pillGroup.width()-6&&this.$addItem.attr({size:t.length+3});if(this.$pillGroup.find(".pill").removeClass("pillbox-highlight"),this.options.onKeyDown){if(9===n.keyCode||38===n.keyCode||40===n.keyCode)return this._isSuggestionsOpen()&&this._keySuggestions(n),!0;this.callbackId=n.timeStamp;this.options.onKeyDown({event:n,value:t},function(t){e._openSuggestions(n,t)})}},openEdit:function(n){var i=n.index()+1,t=this.$addItemWrap.detach().hide();this.$pillGroup.find(".pill:nth-child("+i+")").before(t);this.currentEdit=n.detach();t.addClass("editing");this.$addItem.val(n.find("span:first").html());t.show();this.$addItem.focus().select()},cancelEdit:function(n){var t;return this.currentEdit?(this._closeSuggestions(),n&&this.$addItemWrap.before(this.currentEdit),this.currentEdit=!1,t=this.$addItemWrap.detach(),t.removeClass("editing"),this.$addItem.val(""),void this.$pillGroup.append(t)):!1},saveEdit:function(){var t=arguments[0][0]?arguments[0][0]:arguments[0];this.currentEdit=n(t.el);this.currentEdit.data("value",t.value);this.currentEdit.find("span:first").html(t.text);this.$addItemWrap.hide();this.$addItemWrap.before(this.currentEdit);this.currentEdit=!1;this.$addItem.val("");this.$addItemWrap.removeClass("editing");this.$pillGroup.append(this.$addItemWrap.detach().show());this.$element.trigger("edited.fu.pillbox",{value:t.value,text:t.text})},removeBySelector:function(){var t=[].slice.call(arguments).slice(0),i=this;n.each(t,function(n,t){i.$pillGroup.find(t).remove()});this._removePillTrigger({method:"removeBySelector",removedSelectors:t})},removeByValue:function(){var t=[].slice.call(arguments).slice(0),i=this;n.each(t,function(n,t){i.$pillGroup.find('> .pill[data-value="'+t+'"]').remove()});this._removePillTrigger({method:"removeByValue",removedValues:t})},removeByText:function(){var t=[].slice.call(arguments).slice(0),i=this;n.each(t,function(n,t){i.$pillGroup.find('> .pill:contains("'+t+'")').remove()});this._removePillTrigger({method:"removeByText",removedText:t})},truncate:function(t){var o,u,i,r,f,e=this;this.$element.removeClass("truncate");this.$addItemWrap.removeClass("truncated");this.$pillGroup.find(".pill").removeClass("truncated");t&&(this.$element.addClass("truncate"),o=this.$element.width(),u=!1,i=0,r=this.$pillGroup.find(".pill").length,f=0,this.$pillGroup.find(".pill").each(function(){var t=n(this);u?t.addClass("truncated"):(i++,e.$moreCount.text(r-i),f+t.outerWidth(!0)+e.$addItemWrap.outerWidth(!0)<=o?f+=t.outerWidth(!0):(e.$moreCount.text(r-i+1),t.addClass("truncated"),u=!0))}),i===r&&this.$addItemWrap.addClass("truncated"))},inputFocus:function(){this.$element.find(".pillbox-add-item").focus()},getItemData:function(t,i){return n.extend({text:t.find("span:first").html()},t.data(),i)},_removeElement:function(n){n.el.remove();delete n.el;this.$element.trigger("removed.fu.pillbox",n)},_removePillTrigger:function(n){this.$element.trigger("removed.fu.pillbox",n)},_generateObject:function(t){var i={};return n.each(t,function(n,t){i[t]=!0}),i},_openSuggestions:function(t,i){var r=n("<ul>");return this.callbackId!==t.timeStamp?!1:void(i.data&&i.data.length&&(n.each(i.data,function(t,i){var f=i.value?i.value:i.text,u=n('<li data-value="'+f+'">'+i.text+"<\/li>");i.attr&&u.data("attr",JSON.stringify(i.attr));i.data&&u.data("data",i.data);r.append(u)}),this.$suggest.html("").append(r.children()),n(document.body).trigger("suggested.fu.pillbox",this.$suggest)))},_closeSuggestions:function(){this.$suggest.html("").parent().removeClass("open")},_isSuggestionsOpen:function(){return this.$suggest.parent().hasClass("open")},_keySuggestions:function(n){var i,t=this.$suggest.find("li.pillbox-suggest-sel"),r=38===n.keyCode;n.preventDefault();t.length?(i=r?t.prev():t.next(),i.length||(i=r?this.$suggest.find("li:last"):this.$suggest.find("li:first")),i&&(i.addClass("pillbox-suggest-sel"),t.removeClass("pillbox-suggest-sel"))):(t=this.$suggest.find("li:first"),t.addClass("pillbox-suggest-sel"))}};t.prototype.getValue=t.prototype.items;n.fn.pillbox=function(i){var r,u=Array.prototype.slice.call(arguments,1),f=this.each(function(){var e=n(this),f=e.data("fu.pillbox"),o="object"==typeof i&&i;f||e.data("fu.pillbox",f=new t(this,o));"string"==typeof i&&(r=f[i].apply(f,u))});return void 0===r?f:r};n.fn.pillbox.defaults={onAdd:void 0,onRemove:void 0,onKeyDown:void 0,edit:!1,readonly:-1,truncate:!1,acceptKeyCodes:[13,188],allowEmptyPills:!1};n.fn.pillbox.Constructor=t;n.fn.pillbox.noConflict=function(){return n.fn.pillbox=i,this};n(document).on("mousedown.fu.pillbox.data-api","[data-initialize=pillbox]",function(t){var i=n(t.target).closest(".pillbox");i.data("fu.pillbox")||i.pillbox(i.data())});n(function(){n("[data-initialize=pillbox]").each(function(){var t=n(this);t.data("fu.pillbox")||t.pillbox(t.data())})})}(n),function(n){var i=n.fn.repeater,t=function(t,i){var f,u,r=this;this.$element=n(t);this.$canvas=this.$element.find(".repeater-canvas");this.$count=this.$element.find(".repeater-count");this.$end=this.$element.find(".repeater-end");this.$filters=this.$element.find(".repeater-filters");this.$loader=this.$element.find(".repeater-loader");this.$pageSize=this.$element.find(".repeater-itemization .selectlist");this.$nextBtn=this.$element.find(".repeater-next");this.$pages=this.$element.find(".repeater-pages");this.$prevBtn=this.$element.find(".repeater-prev");this.$primaryPaging=this.$element.find(".repeater-primaryPaging");this.$search=this.$element.find(".repeater-search").find(".search");this.$secondaryPaging=this.$element.find(".repeater-secondaryPaging");this.$start=this.$element.find(".repeater-start");this.$viewport=this.$element.find(".repeater-viewport");this.$views=this.$element.find(".repeater-views");this.currentPage=0;this.currentView=null;this.isDisabled=!1;this.infiniteScrollingCallback=function(){};this.infiniteScrollingCont=null;this.infiniteScrollingEnabled=!1;this.infiniteScrollingEnd=null;this.infiniteScrollingOptions={};this.lastPageInput=0;this.options=n.extend({},n.fn.repeater.defaults,i);this.pageIncrement=0;this.resizeTimeout={};this.stamp=(new Date).getTime()+(Math.floor(100*Math.random())+1);this.storedDataSourceOpts=null;this.syncingViewButtonState=!1;this.viewOptions={};this.viewType=null;this.$filters.selectlist();this.$pageSize.selectlist();this.$primaryPaging.find(".combobox").combobox();this.$search.search({searchOnKeyPress:this.options.searchOnKeyPress});this.$filters.on("changed.fu.selectlist",function(n,t){r.$element.trigger("filtered.fu.repeater",t);r.render({clearInfinite:!0,pageIncrement:null})});this.$nextBtn.on("click.fu.repeater",n.proxy(this.next,this));this.$pageSize.on("changed.fu.selectlist",function(n,t){r.$element.trigger("pageSizeChanged.fu.repeater",t);r.render({pageIncrement:null})});this.$prevBtn.on("click.fu.repeater",n.proxy(this.previous,this));this.$primaryPaging.find(".combobox").on("changed.fu.combobox",function(n,t){r.$element.trigger("pageChanged.fu.repeater",[t.text,t]);r.pageInputChange(t.text)});this.$search.on("searched.fu.search cleared.fu.search",function(n,t){r.$element.trigger("searchChanged.fu.repeater",t);r.render({clearInfinite:!0,pageIncrement:null})});this.$secondaryPaging.on("blur.fu.repeater",function(){r.pageInputChange(r.$secondaryPaging.val())});this.$secondaryPaging.on("keyup",function(n){13===n.keyCode&&r.pageInputChange(r.$secondaryPaging.val())});this.$views.find("input").on("change.fu.repeater",n.proxy(this.viewChanged,this));n(window).on("resize.fu.repeater."+this.stamp,function(){clearTimeout(r.resizeTimeout);r.resizeTimeout=setTimeout(function(){r.resize();r.$element.trigger("resized.fu.repeater")},75)});this.$loader.loader();this.$loader.loader("pause");-1!==this.options.defaultView?u=this.options.defaultView:(f=this.$views.find("label.active input"),u=f.length>0?f.val():"list");this.setViewOptions(u);this.initViewTypes(function(){r.resize();r.$element.trigger("resized.fu.repeater");r.render({changeView:u})})};t.prototype={constructor:t,clear:function(t){function r(t){var i=[];t.children().each(function(){var t=n(this),u=t.attr("data-preserve");"deep"===u?(t.detach(),i.push(t)):"shallow"===u&&(r(t),t.detach(),i.push(t))});t.empty();t.append(i)}var u,i;t=t||{};t.preserve?(!this.infiniteScrollingEnabled||t.clearInfinite)&&r(this.$canvas):this.$canvas.empty();u=void 0!==t.viewChanged?t.viewChanged:!1;i=n.fn.repeater.viewTypes[this.viewType]||{};!u&&i.cleared&&i.cleared.call(this,{options:t})},clearPreservedDataSourceOptions:function(){this.storedDataSourceOpts=null},destroy:function(){var t;return this.$element.find("input").each(function(){n(this).attr("value",n(this).val())}),this.$canvas.empty(),t=this.$element[0].outerHTML,this.$element.find(".combobox").combobox("destroy"),this.$element.find(".selectlist").selectlist("destroy"),this.$element.find(".search").search("destroy"),this.infiniteScrollingEnabled&&n(this.infiniteScrollingCont).infinitescroll("destroy"),this.$element.remove(),n(window).off("resize.fu.repeater."+this.stamp),t},disable:function(){var i="disable",t="disabled",r=n.fn.repeater.viewTypes[this.viewType]||{};this.$search.search(i);this.$filters.selectlist(i);this.$views.find("label, input").addClass(t).attr(t,t);this.$pageSize.selectlist(i);this.$primaryPaging.find(".combobox").combobox(i);this.$secondaryPaging.attr(t,t);this.$prevBtn.attr(t,t);this.$nextBtn.attr(t,t);r.enabled&&r.enabled.call(this,{status:!1});this.isDisabled=!0;this.$element.addClass("disabled");this.$element.trigger("disabled.fu.repeater")},enable:function(){var t="disabled",r="enable",i="page-end",u=n.fn.repeater.viewTypes[this.viewType]||{};this.$search.search(r);this.$filters.selectlist(r);this.$views.find("label, input").removeClass(t).removeAttr(t);this.$pageSize.selectlist("enable");this.$primaryPaging.find(".combobox").combobox(r);this.$secondaryPaging.removeAttr(t);this.$prevBtn.hasClass(i)||this.$prevBtn.removeAttr(t);this.$nextBtn.hasClass(i)||this.$nextBtn.removeAttr(t);this.$prevBtn.hasClass(i)&&this.$nextBtn.hasClass(i)&&this.$primaryPaging.combobox("disable");0!==parseInt(this.$count.html())?this.$pageSize.selectlist("enable"):this.$pageSize.selectlist("disable");u.enabled&&u.enabled.call(this,{status:!0});this.isDisabled=!1;this.$element.removeClass("disabled");this.$element.trigger("enabled.fu.repeater")},getDataOptions:function(t){var f,r,u={},i={};return t=t||{},i.filter=this.$filters.length>0?this.$filters.selectlist("selectedItem"):{text:"All",value:"all"},i.view=this.currentView,this.infiniteScrollingEnabled||(i.pageSize=this.$pageSize.length>0?parseInt(this.$pageSize.selectlist("selectedItem").value,10):25),void 0!==t.pageIncrement&&(null===t.pageIncrement?this.currentPage=0:this.currentPage+=t.pageIncrement),i.pageIndex=this.currentPage,f=this.$search.length>0?this.$search.find("input").val():"",""!==f&&(i.search=f),t.dataSourceOptions&&(u=t.dataSourceOptions,t.preserveDataSourceOptions&&(this.storedDataSourceOpts=this.storedDataSourceOpts?n.extend(this.storedDataSourceOpts,u):u)),this.storedDataSourceOpts&&(u=n.extend(this.storedDataSourceOpts,u)),r=n.fn.repeater.viewTypes[this.viewType]||{},r=r.dataOptions,r?(r=r.call(this,i),i=n.extend(r,u)):i=n.extend(i,u),i},infiniteScrolling:function(n,t){var i,f,r=this.$element.find(".repeater-footer"),u=this.$element.find(".repeater-viewport");t=t||{};n?(this.infiniteScrollingEnabled=!0,this.infiniteScrollingEnd=t.end,delete t.dataSource,delete t.end,this.infiniteScrollingOptions=t,u.css({height:u.height()+r.outerHeight()}),r.hide()):(i=this.infiniteScrollingCont,f=i.data(),delete f.infinitescroll,i.off("scroll"),i.removeClass("infinitescroll"),this.infiniteScrollingCont=null,this.infiniteScrollingEnabled=!1,this.infiniteScrollingEnd=null,this.infiniteScrollingOptions={},u.css({height:u.height()-r.outerHeight()}),r.show())},infiniteScrollPaging:function(n){var i=this.infiniteScrollingEnd!==!0?this.infiniteScrollingEnd:void 0,t=n.page,r=n.pages;this.currentPage=void 0!==t?t:NaN;(n.end===!0||this.currentPage+1>=r)&&this.infiniteScrollingCont.infinitescroll("end",i)},initInfiniteScrolling:function(){var i,r,t=this.$canvas.find('[data-infinite="true"]:first');t=t.length<1?this.$canvas:t;t.data("fu.infinitescroll")?t.infinitescroll("enable"):(r=this,i=n.extend({},this.infiniteScrollingOptions),i.dataSource=function(n,t){r.infiniteScrollingCallback=t;r.render({pageIncrement:1})},t.infinitescroll(i),this.infiniteScrollingCont=t)},initViewTypes:function(t){function u(n){function f(){n++;r>n?u(n):t()}i[n].initialize?i[n].initialize.call(e,{},function(){f()}):f()}var f,r,e=this,i=[];for(f in n.fn.repeater.viewTypes)i.push(n.fn.repeater.viewTypes[f]);r=i.length;r>0?u(0):t()},itemization:function(n){this.$count.html(void 0!==n.count?n.count:"?");this.$end.html(void 0!==n.end?n.end:"?");this.$start.html(void 0!==n.start?n.start:"?")},next:function(){var n="disabled";this.$nextBtn.attr(n,n);this.$prevBtn.attr(n,n);this.pageIncrement=1;this.$element.trigger("nextClicked.fu.repeater");this.render({pageIncrement:this.pageIncrement})},pageInputChange:function(n){var t;n!==this.lastPageInput&&(this.lastPageInput=n,n=parseInt(n,10)-1,t=n-this.currentPage,this.$element.trigger("pageChanged.fu.repeater",n),this.render({pageIncrement:t}))},pagination:function(n){var e,r,o,s,u="active",t="disabled",h=n.page,f="page-end",i=n.pages;if(this.currentPage=void 0!==h?h:NaN,this.$primaryPaging.removeClass(u),this.$secondaryPaging.removeClass(u),s=0===i?0:this.currentPage+1,i<=this.viewOptions.dropPagingCap){for(this.$primaryPaging.addClass(u),e=this.$primaryPaging.find(".dropdown-menu"),e.empty(),r=0;i>r;r++)o=r+1,e.append('<li data-value="'+o+'"><a href="#">'+o+"<\/a><\/li>");this.$primaryPaging.find("input.form-control").val(s)}else this.$secondaryPaging.addClass(u),this.$secondaryPaging.val(s);this.lastPageInput=this.currentPage+1+"";this.$pages.html(""+i);this.currentPage+1<i?(this.$nextBtn.removeAttr(t),this.$nextBtn.removeClass(f)):(this.$nextBtn.attr(t,t),this.$nextBtn.addClass(f));this.currentPage-1>=0?(this.$prevBtn.removeAttr(t),this.$prevBtn.removeClass(f)):(this.$prevBtn.attr(t,t),this.$prevBtn.addClass(f));0!==this.pageIncrement&&(this.pageIncrement>0?this.$nextBtn.is(":disabled")?this.$prevBtn.focus():this.$nextBtn.focus():this.$prevBtn.is(":disabled")?this.$nextBtn.focus():this.$prevBtn.focus())},previous:function(){var n="disabled";this.$nextBtn.attr(n,n);this.$prevBtn.attr(n,n);this.pageIncrement=-1;this.$element.trigger("previousClicked.fu.repeater");this.render({pageIncrement:this.pageIncrement})},render:function(t){var u,e,i=this,r=!1,f=n.fn.repeater.viewTypes[this.viewType]||{};t=t||{};this.disable();t.changeView&&this.currentView!==t.changeView&&(e=this.currentView,this.currentView=t.changeView,this.viewType=this.currentView.split(".")[0],this.setViewOptions(this.currentView),this.$element.attr("data-currentview",this.currentView),this.$element.attr("data-viewtype",this.viewType),r=!0,t.viewChanged=r,this.$element.trigger("viewChanged.fu.repeater",this.currentView),this.infiniteScrollingEnabled&&i.infiniteScrolling(!1),f=n.fn.repeater.viewTypes[this.viewType]||{},f.selected&&f.selected.call(this,{prevView:e}));this.syncViewButtonState();t.preserve=void 0!==t.preserve?t.preserve:!r;this.clear(t);(!this.infiniteScrollingEnabled||this.infiniteScrollingEnabled&&r)&&this.$loader.show().loader("play");u=this.getDataOptions(t);this.viewOptions.dataSource(u,function(n){n=n||{};i.infiniteScrollingEnabled?i.infiniteScrollingCallback({}):(i.itemization(n),i.pagination(n));i.runRenderer(f,n,function(){i.infiniteScrollingEnabled&&((r||t.clearInfinite)&&i.initInfiniteScrolling(),i.infiniteScrollPaging(n,t));i.$loader.hide().loader("pause");i.enable();i.$element.trigger("rendered.fu.repeater",{data:n,options:u,renderOptions:t});i.$element.trigger("loaded.fu.repeater",u)})})},resize:function(){var u,i,t=-1===this.viewOptions.staticHeight?this.$element.attr("data-staticheight"):this.viewOptions.staticHeight,r={};if(this.viewType&&(r=n.fn.repeater.viewTypes[this.viewType]||{}),void 0!==t&&t!==!1&&"false"!==t){this.$canvas.addClass("scrolling");i={bottom:this.$viewport.css("margin-bottom"),top:this.$viewport.css("margin-top")};var f="true"===t||t===!0?this.$element.height():parseInt(t,10),e=this.$element.find(".repeater-header").outerHeight(),o=this.$element.find(".repeater-footer").outerHeight(),s="auto"===i.bottom?0:parseInt(i.bottom,10),h="auto"===i.top?0:parseInt(i.top,10);u=f-e-o-s-h;this.$viewport.outerHeight(u)}else this.$canvas.removeClass("scrolling");r.resize&&r.resize.call(this,{height:this.$element.outerHeight(),width:this.$element.outerWidth()})},runRenderer:function(t,i,r){function c(t,i){var r;i&&(r=i.action?i.action:"append","none"!==r&&void 0!==i.item&&(t=void 0!==i.container?n(i.container):t,t[r](i.item)))}var o,f,h,s,u,e;if(t.render)t.render.call(this,{container:this.$canvas,data:i},function(){r()});else{if(t.before&&(s=t.before.call(this,{container:this.$canvas,data:i}),c(this.$canvas,s)),o=this.$canvas.find('[data-container="true"]:last'),o=o.length>0?o:this.$canvas,t.renderItem){for(u=t.repeat||"data.items",u=u.split("."),"data"===u[0]||"this"===u[0]?(e="this"===u[0]?this:i,u.shift()):(u=[],e=[],window.console&&window.console.warn&&window.console.warn('WARNING: Repeater plugin "repeat" value must start with either "data" or "this"')),f=0,h=u.length;h>f;f++){if(void 0===e[u[f]]){e=[];window.console&&window.console.warn&&window.console.warn("WARNING: Repeater unable to find property to iterate renderItem on.");break}e=e[u[f]]}for(f=0,h=e.length;h>f;f++)s=t.renderItem.call(this,{container:o,data:i,index:f,subset:e}),c(o,s)}t.after&&(s=t.after.call(this,{container:this.$canvas,data:i}),c(this.$canvas,s));r()}},setViewOptions:function(t){var i={},r=t.split(".")[1];i=this.options.views?this.options.views[r]||this.options.views[t]||{}:{};this.viewOptions=n.extend({},this.options,i)},viewChanged:function(t){var i=n(t.target),r=i.val();this.syncingViewButtonState||(this.isDisabled||i.parents("label:first").hasClass("disabled")?this.syncViewButtonState():this.render({changeView:r,pageIncrement:null}))},syncViewButtonState:function(){var n=this.$views.find('input[value="'+this.currentView+'"]');this.syncingViewButtonState=!0;this.$views.find("input").prop("checked",!1);this.$views.find("label.active").removeClass("active");n.length>0&&(n.prop("checked",!0),n.parents("label:first").addClass("active"));this.syncingViewButtonState=!1}};n.fn.repeater=function(i){var r,u=Array.prototype.slice.call(arguments,1),f=this.each(function(){var e=n(this),f=e.data("fu.repeater"),o="object"==typeof i&&i;f||e.data("fu.repeater",f=new t(this,o));"string"==typeof i&&(r=f[i].apply(f,u))});return void 0===r?f:r};n.fn.repeater.defaults={dataSource:function(n,t){t({count:0,end:0,items:[],page:0,pages:1,start:0})},defaultView:-1,dropPagingCap:10,staticHeight:-1,views:null,searchOnKeyPress:!1};n.fn.repeater.viewTypes={};n.fn.repeater.Constructor=t;n.fn.repeater.noConflict=function(){return n.fn.repeater=i,this}}(n),function(n){function r(n,t){var i,r;if(!t)return!1;if(!n||t.length!==n.length)return!0;for(i=0;i<t.length;i++){if(!n[i])return!0;for(r in t[i])if(n[i][r]!==t[i][r])return!0}return!1}function u(t,i,r,u,f){var s=u[f].className,e=i[r][u[f].property],o=n("<td><\/td>"),h=u[f]._auto_width,l=u[f].property,c;(this.viewOptions.list_actions!==!1&&"@_ACTIONS_@"===l&&(e='<div class="repeater-list-actions-placeholder" style="width: '+this.list_actions_width+'px"><\/div>'),e=void 0!==e?e:"",o.addClass(void 0!==s?s:"").append(e),void 0!==h&&o.outerWidth(h),t.append(o),"multi"===this.viewOptions.list_selectable&&"@_CHECKBOX_@"===u[f].property)&&(c='<label data-row="'+r+'" class="checkbox-custom checkbox-inline body-checkbox repeater-select-checkbox"><input class="sr-only" type="checkbox"><\/label>',o.html(c));"@_CHECKBOX_@"!==u[f].property&&"@_ACTIONS_@"!==u[f].property&&this.viewOptions.list_columnRendered&&this.viewOptions.list_columnRendered({container:t,columnAttr:u[f].property,item:o,rowData:i[r]},function(){})}function f(t,i,r){var s,a,h,v,e,c="glyphicon-chevron-down",p=".glyphicon.rlc:first",l="glyphicon-chevron-up",u=n('<div class="repeater-list-heading"><span class="glyphicon rlc"><\/span><\/div>'),o=n("<th><\/th>"),f=this,y;(u.data("fu_item_index",r),u.prepend(i[r].label),o.html(u.html()).find("[id]").removeAttr("id"),"@_CHECKBOX_@"!==i[r].property?o.append(u):o.append('<div class="repeater-list-heading header-checkbox"><label class="checkbox-custom checkbox-inline repeater-select-checkbox"><input class="sr-only" type="checkbox"><\/label><div class="clearfix"><\/div><\/div>'),s=o.add(u),v=u.find(p),e=v.add(o.find(p)),this.viewOptions.list_actions&&"@_ACTIONS_@"===i[r].property)&&(y=this.list_actions_width,o.css("width",y),u.css("width",y));a=i[r].className;void 0!==a&&s.addClass(a);h=i[r].sortable;h&&(s.addClass("sortable"),u.on("click.fu.repeaterList",function(){f.isDisabled||(f.list_sortProperty="string"==typeof h?h:i[r].property,u.hasClass("sorted")?v.hasClass(l)?(e.removeClass(l).addClass(c),f.list_sortDirection="desc"):f.viewOptions.list_sortClearing?(s.removeClass("sorted"),e.removeClass(c),f.list_sortDirection=null,f.list_sortProperty=null):(e.removeClass(c).addClass(l),f.list_sortDirection="asc"):(t.find("th, .repeater-list-heading").removeClass("sorted"),e.removeClass(c).addClass(l),f.list_sortDirection="asc",s.addClass("sorted")),f.render({clearInfinite:!0,pageIncrement:null}))}));("asc"===i[r].sortDirection||"desc"===i[r].sortDirection)&&(t.find("th, .repeater-list-heading").removeClass("sorted"),s.addClass("sortable sorted"),"asc"===i[r].sortDirection?(e.addClass(l),this.list_sortDirection="asc"):(e.addClass(c),this.list_sortDirection="desc"),this.list_sortProperty="string"==typeof h?h:i[r].property);t.append(o)}function e(t,r,f){var s,h,e=n("<tr><\/tr>"),o=this,c="multi"===this.viewOptions.list_selectable,l=this.viewOptions.list_actions;for(this.viewOptions.list_selectable&&(e.addClass("selectable"),e.attr("tabindex",0),e.data("item_data",r[f]),e.on("click.fu.repeaterList",function(){var t,r;if(!o.isDisabled){t=n(this);r=n(this).index();r+=1;var u=o.$element.find(".frozen-column-wrapper tr:nth-child("+r+")"),f=o.$element.find(".actions-column-wrapper tr:nth-child("+r+")"),e=o.$element.find(".frozen-column-wrapper tr:nth-child("+r+") .checkbox-inline");t.is(".selected")?(t.removeClass("selected"),c?(e.checkbox("uncheck"),u.removeClass("selected"),l&&f.removeClass("selected")):t.find(".repeater-list-check").remove(),o.$element.trigger("deselected.fu.repeaterList",t)):(c?(e.checkbox("check"),t.addClass("selected"),u.addClass("selected"),l&&f.addClass("selected")):(o.$canvas.find(".repeater-list-check").remove(),o.$canvas.find(".repeater-list tbody tr.selected").each(function(){n(this).removeClass("selected");o.$element.trigger("deselected.fu.repeaterList",n(this))}),t.find("td:first").prepend('<div class="repeater-list-check"><span class="glyphicon glyphicon-ok"><\/span><\/div>'),t.addClass("selected"),u.addClass("selected")),o.$element.trigger("selected.fu.repeaterList",t));i.call(o)}}),e.keyup(function(n){13===n.keyCode&&e.trigger("click.fu.repeaterList")})),this.viewOptions.list_actions&&!this.viewOptions.list_selectable&&e.data("item_data",r[f]),t.append(e),s=0,h=this.list_columns.length;h>s;s++)u.call(this,e,r,f,this.list_columns,s);this.viewOptions.list_rowRendered&&this.viewOptions.list_rowRendered({container:t,item:e,rowData:r[f]},function(){})}function o(t,i){var r,u=t.find("tbody");u.length<1&&(u=n('<tbody data-container="true"><\/tbody>'),t.append(u));"string"==typeof i.error&&i.error.length>0?(r=n('<tr class="empty text-danger"><td colspan="'+this.list_columns.length+'"><\/td><\/tr>'),r.find("td").append(i.error),u.append(r)):i.items&&i.items.length<1&&(r=n('<tr class="empty"><td colspan="'+this.list_columns.length+'"><\/td><\/tr>'),r.find("td").append(this.viewOptions.list_noItemsHTML),u.append(r))}function s(i,u){var s,c,h,e=u.columns||[],o=i.find("thead"),l,a,v,y;if(this.list_firstRender||r(this.list_columns,e)||0===o.length){for((o.remove(),u.count<1&&(this.list_noItems=!0),"multi"!==this.viewOptions.list_selectable||this.list_noItems)||(l={label:"c",property:"@_CHECKBOX_@",sortable:!1},e.splice(0,0,l)),(this.list_columns=e,this.list_firstRender=!1,this.$loader.removeClass("noHeader"),this.viewOptions.list_actions&&!this.list_noItems)&&(a={label:this.viewOptions.list_actions.label||'<span class="actions-hidden">a<\/span>',property:"@_ACTIONS_@",sortable:!1,width:this.list_actions_width},e.push(a)),o=n('<thead data-preserve="deep"><tr><\/tr><\/thead>'),h=o.find("tr"),s=0,c=e.length;c>s;s++)f.call(this,h,e,s);(i.prepend(o),"multi"!==this.viewOptions.list_selectable||this.list_noItems)||(v=this.$element.find(".repeater-list-wrapper .header-checkbox").outerWidth(),y=n.grep(e,function(n){return"@_CHECKBOX_@"===n.property})[0],y.width=v);t.call(this,h)}}function t(t){var i,f,u,e,r=[],o=this,s;if(this.viewOptions.list_columnSizing&&(i=0,e=0,t.find("th").each(function(){var u,t=n(this),f;void 0!==o.list_columns[i].width?(u=o.list_columns[i].width,t.outerWidth(u),e+=t.outerWidth(),o.list_columns[i]._auto_width=u):(f=t.find(".repeater-list-heading").outerWidth(),r.push({col:t,index:i,minWidth:f}));i++}),f=r.length,f>0))for(s=this.$canvas.find(".repeater-list-wrapper").outerWidth(),u=Math.floor((s-e)/f),i=0;f>i;i++)r[i].minWidth>u&&(u=r[i].minWidth),r[i].col.outerWidth(u),this.list_columns[r[i].index]._auto_width=u}function h(){var n=window.navigator.userAgent,t=n.indexOf("MSIE "),i=n.indexOf("Firefox");return t>0?"ie-"+parseInt(n.substring(t+5,n.indexOf(".",t))):i>0?"firefox":""}function i(){var t=this.$canvas.find(".repeater-list-wrapper > table .selected"),n=this.$element.find(".table-actions");t.length>0?n.find("thead .btn").removeAttr("disabled"):n.find("thead .btn").attr("disabled","disabled")}n.fn.repeater&&(n.fn.repeater.Constructor.prototype.list_clearSelectedItems=function(){this.$canvas.find(".repeater-list-check").remove();this.$canvas.find(".repeater-list table tbody tr.selected").removeClass("selected")},n.fn.repeater.Constructor.prototype.list_highlightColumn=function(t,i){var r=this.$canvas.find(".repeater-list-wrapper > table tbody");(this.viewOptions.list_highlightSortedColumn||i)&&(r.find("td.sorted").removeClass("sorted"),r.find("tr").each(function(){var i=n(this).find("td:nth-child("+(t+1)+")").filter(function(){return!n(this).parent().hasClass("empty")});i.addClass("sorted")}))},n.fn.repeater.Constructor.prototype.list_getSelectedItems=function(){var t=[];return this.$canvas.find(".repeater-list .repeater-list-wrapper > table tbody tr.selected").each(function(){var i=n(this);t.push({data:i.data("item_data"),element:i})}),t},n.fn.repeater.Constructor.prototype.getValue=n.fn.repeater.Constructor.prototype.list_getSelectedItems,n.fn.repeater.Constructor.prototype.list_positionHeadings=function(){var t=this.$element.find(".repeater-list-wrapper"),i=t.offset().left,r=t.scrollLeft();r>0?t.find(".repeater-list-heading").each(function(){var t=n(this),r=t.parents("th:first").offset().left-i+"px";t.addClass("shifted").css("left",r)}):t.find(".repeater-list-heading").each(function(){n(this).removeClass("shifted").css("left","")})},n.fn.repeater.Constructor.prototype.list_setSelectedItems=function(t,i){function h(){u=n(this);o=u.data("item_data")||{};o[t[r].property]===t[r].value&&e(u,t[r].selected)}function e(n,t){t=void 0!==t?t:!0;t?(i||"multi"===f||c.list_clearSelectedItems(),n.hasClass("selected")||(n.addClass("selected"),n.find("td:first").prepend('<div class="repeater-list-check"><span class="glyphicon glyphicon-ok"><\/span><\/div>'))):(n.find(".repeater-list-check").remove(),n.removeClass("selected"))}var o,r,u,s,f=this.viewOptions.list_selectable,c=this;for(n.isArray(t)||(t=[t]),s=i===!0||"multi"===f?t.length:f&&t.length>0?1:0,r=0;s>r;r++)void 0!==t[r].index?(u=this.$canvas.find(".repeater-list table tbody tr:nth-child("+(t[r].index+1)+")"),u.length>0&&e(u,t[r].selected)):void 0!==t[r].property&&void 0!==t[r].value&&this.$canvas.find(".repeater-list table tbody tr").each(h)},n.fn.repeater.Constructor.prototype.list_sizeHeadings=function(){var t=this.$element.find(".repeater-list table");t.find("thead th").each(function(){var t=n(this),i=t.find(".repeater-list-heading");i.css({height:t.outerHeight()});i.outerWidth(i.data("forced-width")||t.outerWidth())})},n.fn.repeater.Constructor.prototype.list_setFrozenColumns=function(){var o=this.$canvas.find(".table-frozen"),s=this.$element.find(".repeater-canvas"),u=this.$element.find(".repeater-list .repeater-list-wrapper > table"),h=this.$element.find(".repeater-list"),i=this.viewOptions.list_frozenColumns,c=this,f,t,r,e;("multi"===this.viewOptions.list_selectable&&(i+=1,s.addClass("multi-select-enabled")),o.length<1)&&(f=n('<div class="frozen-column-wrapper"><\/div>').insertBefore(u),t=u.clone().addClass("table-frozen"),t.find("th:not(:lt("+i+"))").remove(),t.find("td:not(:nth-child(n+0):nth-child(-n+"+i+"))").remove(),r=t.clone().removeClass("table-frozen"),r.find("tbody").remove(),e=n('<div class="frozen-thead-wrapper"><\/div>').append(r),f.append(t),h.append(e),this.$canvas.addClass("frozen-enabled"));this.list_sizeFrozenColumns();n(".frozen-thead-wrapper .repeater-list-heading").on("click",function(){var t=n(this).parent("th").index();t+=1;c.$element.find(".repeater-list-wrapper > table thead th:nth-child("+t+") .repeater-list-heading")[0].click()})},n.fn.repeater.Constructor.prototype.list_positionColumns=function(){var n=this.$element.find(".repeater-canvas"),i=n.scrollTop(),t=n.scrollLeft(),r=this.viewOptions.list_frozenColumns||"multi"===this.viewOptions.list_selectable,u=this.viewOptions.list_actions,f=this.$element.find(".repeater-canvas").outerWidth(),e=this.$element.find(".repeater-list .repeater-list-wrapper > table").outerWidth(),o=this.$element.find(".table-actions")?this.$element.find(".table-actions").outerWidth():0,s=e-(f-o)>=t;i>0?n.find(".repeater-list-heading").css("top",i):n.find(".repeater-list-heading").css("top","0");t>0?(r&&(n.find(".frozen-thead-wrapper").css("left",t),n.find(".frozen-column-wrapper").css("left",t)),u&&s&&(n.find(".actions-thead-wrapper").css("right",-t),n.find(".actions-column-wrapper").css("right",-t))):(r&&(n.find(".frozen-thead-wrapper").css("left","0"),n.find(".frozen-column-wrapper").css("left","0")),u&&(n.find(".actions-thead-wrapper").css("right","0"),n.find(".actions-column-wrapper").css("right","0")))},n.fn.repeater.Constructor.prototype.list_createItemActions=function(){for(var s="",i=this,h=this.$element.find(".repeater-list .repeater-list-wrapper > table"),v=this.$canvas.find(".table-actions"),u,c,f,l,t,e,a,r=0,o=this.viewOptions.list_actions.items.length;o>r;r++)u=this.viewOptions.list_actions.items[r],c=u.html,s+='<li><a href="#" data-action="'+u.name+'" class="action-item"> '+c+"<\/a><\/li>";f='<div class="btn-group"><button type="button" class="btn btn-xs btn-default dropdown-toggle repeater-actions-button" data-toggle="dropdown" data-flip="auto" aria-expanded="false"><span class="caret"><\/span><\/button><ul class="dropdown-menu dropdown-menu-right" role="menu">'+s+"<\/ul><\/div>";v.length<1&&(l=n('<div class="actions-column-wrapper" style="width: '+this.list_actions_width+'px"><\/div>').insertBefore(h),t=h.clone().addClass("table-actions"),(t.find("th:not(:last-child)").remove(),t.find("tr td:not(:last-child)").remove(),"multi"===this.viewOptions.list_selectable)?(t.find("thead tr").html('<th><div class="repeater-list-heading">'+f+"<\/div><\/th>"),t.find("thead .btn").attr("disabled","disabled")):(e=this.viewOptions.list_actions.label||'<span class="actions-hidden">a<\/span>',t.find("thead tr").addClass("empty-heading").html("<th>"+e+'<div class="repeater-list-heading">'+e+"<\/div><\/th>")),a=t.find("td"),a.each(function(t){n(this).html(f);n(this).find("a").attr("data-row",parseInt([t])+1)}),l.append(t),this.$canvas.addClass("actions-enabled"));this.list_sizeActionsTable();this.$element.find(".table-actions tbody .action-item").on("click",function(t){if(!i.isDisabled){var r=n(this).data("action"),u=n(this).data("row"),f={actionName:r,rows:[u]};i.list_getActionItems(f,t)}});this.$element.find(".table-actions thead .action-item").on("click",function(t){if(!i.isDisabled){var u=n(this).data("action"),r={actionName:u,rows:[]};i.$element.find(".repeater-list-wrapper > table .selected").each(function(){var t=n(this).index();t+=1;r.rows.push(t)});i.list_getActionItems(r,t)}})},n.fn.repeater.Constructor.prototype.list_getActionItems=function(t,i){for(var r=[],e=n.grep(this.viewOptions.list_actions.items,function(n){return n.name===t.actionName})[0],f,o,u=0;u<t.rows.length;u++)f=this.$canvas.find(".repeater-list-wrapper > table tbody tr:nth-child("+t.rows[u]+")"),r.push({item:f,rowData:f.data("item_data")});(1===r.length&&(r=r[0]),e.clickAction)&&(o=function(){},e.clickAction(r,o,i))},n.fn.repeater.Constructor.prototype.list_sizeActionsTable=function(){var i=this.$element.find(".repeater-list table.table-actions"),t=i.find("thead tr th"),r=this.$element.find(".repeater-list-wrapper > table");t.outerHeight(r.find("thead tr th").outerHeight());t.find(".repeater-list-heading").outerHeight(t.outerHeight());i.find("tbody tr td:first-child").each(function(t){n(this).outerHeight(r.find("tbody tr:eq("+t+") td").outerHeight())})},n.fn.repeater.Constructor.prototype.list_sizeFrozenColumns=function(){var t=this.$element.find(".repeater-list .repeater-list-wrapper > table"),i;this.$element.find(".repeater-list table.table-frozen tr").each(function(i){n(this).height(t.find("tr:eq("+i+")").height())});i=t.find("td:eq(0)").outerWidth();this.$element.find(".frozen-column-wrapper, .frozen-thead-wrapper").width(i)},n.fn.repeater.Constructor.prototype.list_frozenOptionsInitialize=function(){function r(n){t.list_revertingCheckbox=!0;n.checkbox("toggle");delete t.list_revertingCheckbox}var i=this.$element.find(".frozen-column-wrapper .checkbox-inline"),u=this.$element.find(".repeater-list table"),t=this;this.$element.find("tr.selectable").on("mouseover mouseleave",function(t){var i=n(this).index();i+=1;"mouseover"===t.type?u.find("tbody tr:nth-child("+i+")").addClass("hovered"):u.find("tbody tr:nth-child("+i+")").removeClass("hovered")});i.checkbox();this.$element.find(".table-frozen tbody .checkbox-inline").on("change",function(i){if(i.preventDefault(),!t.list_revertingCheckbox)if(t.isDisabled)r(n(i.currentTarget));else{var u=n(this).attr("data-row");u=parseInt(u)+1;t.$element.find(".repeater-list-wrapper > table tbody tr:nth-child("+u+")").click()}});this.$element.find(".frozen-thead-wrapper thead .checkbox-inline").on("change",function(u){t.list_revertingCheckbox||(t.isDisabled?r(n(u.currentTarget)):n(this).checkbox("isChecked")?(t.$element.find(".repeater-list-wrapper > table tbody tr:not(.selected)").click(),t.$element.trigger("selected.fu.repeaterList",i)):(t.$element.find(".repeater-list-wrapper > table tbody tr.selected").click(),t.$element.trigger("deselected.fu.repeaterList",i)))})},n.fn.repeater.defaults=n.extend({},n.fn.repeater.defaults,{list_columnRendered:null,list_columnSizing:!0,list_columnSyncing:!0,list_highlightSortedColumn:!0,list_infiniteScroll:!1,list_noItemsHTML:"no items found",list_selectable:!1,list_sortClearing:!1,list_rowRendered:null,list_frozenColumns:0,list_actions:!1}),n.fn.repeater.viewTypes.list={cleared:function(){this.viewOptions.list_columnSyncing&&this.list_sizeHeadings()},dataOptions:function(n){return this.list_sortDirection&&(n.sortDirection=this.list_sortDirection),this.list_sortProperty&&(n.sortProperty=this.list_sortProperty),n},enabled:function(n){this.viewOptions.list_actions&&(n.status?(this.$canvas.find(".repeater-actions-button").removeAttr("disabled"),i.call(this)):this.$canvas.find(".repeater-actions-button").attr("disabled","disabled"))},initialize:function(n,t){this.list_sortDirection=null;this.list_sortProperty=null;this.list_specialBrowserClass=h();this.list_actions_width=void 0!==this.viewOptions.list_actions.width?this.viewOptions.list_actions.width:37;this.list_noItems=!1;t()},resize:function(){t.call(this,this.$element.find(".repeater-list-wrapper > table thead tr"));this.viewOptions.list_actions&&this.list_sizeActionsTable();(this.viewOptions.list_frozenColumns||"multi"===this.viewOptions.list_selectable)&&this.list_sizeFrozenColumns();this.viewOptions.list_columnSyncing&&this.list_sizeHeadings()},selected:function(){var t,n=this.viewOptions.list_infiniteScroll;this.list_firstRender=!0;this.$loader.addClass("noHeader");n&&(t="object"==typeof n?n:{},this.infiniteScrolling(!0,t))},before:function(t){var u,r=t.container.find(".repeater-list"),i=this;return r.length<1&&(r=n('<div class="repeater-list '+this.list_specialBrowserClass+'" data-preserve="shallow"><div class="repeater-list-wrapper" data-infinite="true" data-preserve="shallow"><table aria-readonly="true" class="table" data-preserve="shallow" role="grid"><\/table><\/div><\/div>'),r.find(".repeater-list-wrapper").on("scroll.fu.repeaterList",function(){i.viewOptions.list_columnSyncing&&i.list_positionHeadings()}),(i.viewOptions.list_frozenColumns||i.viewOptions.list_actions||"multi"===i.viewOptions.list_selectable)&&t.container.on("scroll.fu.repeaterList",function(){i.list_positionColumns()}),t.container.append(r)),t.container.removeClass("actions-enabled actions-enabled multi-select-enabled"),u=r.find("table"),s.call(this,u,t.data),o.call(this,u,t.data),!1},renderItem:function(n){return e.call(this,n.container,n.subset,n.index),!1},after:function(){var n;return!this.viewOptions.list_frozenColumns&&"multi"!==this.viewOptions.list_selectable||this.list_noItems||this.list_setFrozenColumns(),this.viewOptions.list_actions&&!this.list_noItems&&(this.list_createItemActions(),this.list_sizeActionsTable()),!this.viewOptions.list_frozenColumns&&!this.viewOptions.list_actions&&"multi"!==this.viewOptions.list_selectable||this.list_noItems||(this.list_positionColumns(),this.list_frozenOptionsInitialize()),this.viewOptions.list_columnSyncing&&(this.list_sizeHeadings(),this.list_positionHeadings()),n=this.$canvas.find(".repeater-list-wrapper > table .repeater-list-heading.sorted"),n.length>0&&this.list_highlightColumn(n.data("fu_item_index")),!1}})}(n),function(n){function t(t,i){function u(){var e,u,f;u=i.indexOf("{{");e=i.indexOf("}}",u+2);u>-1&&e>-1?(f=n.trim(i.substring(u+2,e)),f=void 0!==t[f]?t[f]:"",i=i.substring(0,u)+f+i.substring(e+2)):r=!0}for(var r=!1;!r&&i.search("{{")>=0;)u(i);return i}n.fn.repeater&&(n.fn.repeater.Constructor.prototype.thumbnail_clearSelectedItems=function(){this.$canvas.find(".repeater-thumbnail-cont .selectable.selected").removeClass("selected")},n.fn.repeater.Constructor.prototype.thumbnail_getSelectedItems=function(){var t=[];return this.$canvas.find(".repeater-thumbnail-cont .selectable.selected").each(function(){t.push(n(this))}),t},n.fn.repeater.Constructor.prototype.thumbnail_setSelectedItems=function(t,i){function h(){return f===t[r].index?(u=n(this),!1):void f++}function c(){u=n(this);u.is(t[r].selector)&&o(u,t[r].selected)}function o(n,t){t=void 0!==t?t:!0;t?(i||"multi"===e||l.thumbnail_clearSelectedItems(),n.addClass("selected")):n.removeClass("selected")}var r,u,s,f,e=this.viewOptions.thumbnail_selectable,l=this;for(n.isArray(t)||(t=[t]),s=i===!0||"multi"===e?t.length:e&&t.length>0?1:0,r=0;s>r;r++)void 0!==t[r].index?(u=n(),f=0,this.$canvas.find(".repeater-thumbnail-cont .selectable").each(h),u.length>0&&o(u,t[r].selected)):t[r].selector&&this.$canvas.find(".repeater-thumbnail-cont .selectable").each(c)},n.fn.repeater.defaults=n.extend({},n.fn.repeater.defaults,{thumbnail_alignment:"left",thumbnail_infiniteScroll:!1,thumbnail_itemRendered:null,thumbnail_noItemsHTML:"no items found",thumbnail_selectable:!1,thumbnail_template:'<div class="thumbnail repeater-thumbnail"><img height="75" src="{{src}}" width="65"><span>{{name}}<\/span><\/div>'}),n.fn.repeater.viewTypes.thumbnail={selected:function(){var t,n=this.viewOptions.thumbnail_infiniteScroll;n&&(t="object"==typeof n?n:{},this.infiniteScrolling(!0,t))},before:function(t){var u,e,i=this.viewOptions.thumbnail_alignment,r=this.$canvas.find(".repeater-thumbnail-cont"),o=t.data,f={};return r.length<1?(r=n('<div class="clearfix repeater-thumbnail-cont" data-container="true" data-infinite="true" data-preserve="shallow"><\/div>'),i&&"none"!==i?(e={center:1,justify:1,left:1,right:1},i=e[i]?i:"justify",r.addClass("align-"+i),this.thumbnail_injectSpacers=!0):this.thumbnail_injectSpacers=!1,f.item=r):f.action="none",o.items&&o.items.length<1?(u=n('<div class="empty"><\/div>'),u.append(this.viewOptions.thumbnail_noItemsHTML),r.append(u)):r.find(".empty:first").remove(),f},renderItem:function(i){var e=this.viewOptions.thumbnail_selectable,f="selected",u=this,r=n(t(i.subset[i.index],this.viewOptions.thumbnail_template));return e&&(r.addClass("selectable"),r.on("click",function(){u.isDisabled||(r.hasClass(f)?(r.removeClass(f),u.$element.trigger("deselected.fu.repeaterThumbnail",r)):("multi"!==e&&u.$canvas.find(".repeater-thumbnail-cont .selectable.selected").each(function(){var t=n(this);t.removeClass(f);u.$element.trigger("deselected.fu.repeaterThumbnail",t)}),r.addClass(f),u.$element.trigger("selected.fu.repeaterThumbnail",r)))})),i.container.append(r),this.thumbnail_injectSpacers&&r.after('<span class="spacer">&nbsp;<\/span>'),this.viewOptions.thumbnail_itemRendered&&this.viewOptions.thumbnail_itemRendered({container:i.container,item:r,itemData:i.subset[i.index]},function(){}),!1}})}(n),function(n){var s=n.fn.scheduler,t=function(t,i){var u=this,r;this.$element=n(t);this.options=n.extend({},n.fn.scheduler.defaults,i);this.$startDate=this.$element.find(".start-datetime .start-date");this.$startTime=this.$element.find(".start-datetime .start-time");this.$timeZone=this.$element.find(".timezone-container .timezone");this.$repeatIntervalPanel=this.$element.find(".repeat-every-panel");this.$repeatIntervalSelect=this.$element.find(".repeat-options");this.$repeatIntervalSpinbox=this.$element.find(".repeat-every");this.$repeatIntervalTxt=this.$element.find(".repeat-every-text");this.$end=this.$element.find(".repeat-end");this.$endSelect=this.$end.find(".end-options");this.$endAfter=this.$end.find(".end-after");this.$endDate=this.$end.find(".end-on-date");this.$recurrencePanels=this.$element.find(".repeat-panel");this.$repeatIntervalSelect.selectlist();this.$element.find(".selectlist").selectlist();this.$startDate.datepicker(this.options.startDateOptions);r="function"==typeof this.options.startDateChanged?this.options.startDateChanged:this._guessEndDate;this.$startDate.on("change changed.fu.datepicker dateClicked.fu.datepicker",n.proxy(r,this));this.$startTime.combobox();""===this.$startTime.find("input").val()&&this.$startTime.combobox("selectByIndex",0);"0"===this.$repeatIntervalSpinbox.find("input").val()?this.$repeatIntervalSpinbox.spinbox({value:1,min:1,limitToStep:!0}):this.$repeatIntervalSpinbox.spinbox({min:1,limitToStep:!0});this.$endAfter.spinbox({value:1,min:1,limitToStep:!0});this.$endDate.datepicker(this.options.endDateOptions);this.$element.find(".radio-custom").radio();this.$repeatIntervalSelect.on("changed.fu.selectlist",n.proxy(this.repeatIntervalSelectChanged,this));this.$endSelect.on("changed.fu.selectlist",n.proxy(this.endSelectChanged,this));this.$element.find(".repeat-days-of-the-week .btn-group .btn").on("change.fu.scheduler",function(n,t){u.changed(n,t,!0)});this.$element.find(".combobox").on("changed.fu.combobox",n.proxy(this.changed,this));this.$element.find(".datepicker").on("changed.fu.datepicker",n.proxy(this.changed,this));this.$element.find(".datepicker").on("dateClicked.fu.datepicker",n.proxy(this.changed,this));this.$element.find(".selectlist").on("changed.fu.selectlist",n.proxy(this.changed,this));this.$element.find(".spinbox").on("changed.fu.spinbox",n.proxy(this.changed,this));this.$element.find(".repeat-monthly .radio-custom, .repeat-yearly .radio-custom").on("change.fu.scheduler",n.proxy(this.changed,this))},r=function(n,t){var i,r="";return r+=n.getFullYear(),r+=t,i=n.getMonth()+1,r+=10>i?"0"+i:i,r+=t,i=n.getDate(),r+(10>i?"0"+i:i)},u=1e3,f=60*u,e=60*f,o=24*e,i=7*o,h=5*i,c=52*i,l={secondly:u,minutely:f,hourly:e,daily:o,weekly:i,monthly:h,yearly:c},a=function(n,t,i,r){return new Date(n.getTime()+l[i]*r)};t.prototype={constructor:t,destroy:function(){var t;return this.$element.find("input").each(function(){n(this).attr("value",n(this).val())}),this.$element.find(".datepicker .calendar").empty(),t=this.$element[0].outerHTML,this.$element.find(".combobox").combobox("destroy"),this.$element.find(".datepicker").datepicker("destroy"),this.$element.find(".selectlist").selectlist("destroy"),this.$element.find(".spinbox").spinbox("destroy"),this.$element.find(".radio-custom").radio("destroy"),this.$element.remove(),t},changed:function(t,i,r){r||t.stopPropagation();this.$element.trigger("changed.fu.scheduler",{data:void 0!==i?i:n(t.currentTarget).data(),originalEvent:t,value:this.getValue()})},disable:function(){this.toggleState("disable")},enable:function(){this.toggleState("enable")},setUtcTime:function(n,t,i){var f=n.split("-"),u=t.split(":"),r=new Date(Date.UTC(f[0],f[1]-1,f[2],u[0],u[1],u[2]?u[2]:0)),o;if("Z"===i)r.setUTCHours(r.getUTCHours()+0);else{var s=new RegExp("(.).*?\\d.*?(\\d)",["i"]),e=s.exec(i);if(null!==e){var h=e[1],c=e[2],l="+"===h?1:-1;r.setUTCHours(r.getUTCHours()+l*parseInt(c,10))}}return o=r.getTimezoneOffset(),r.setMinutes(o),r},endSelectChanged:function(n,t){var r,i;t?i=t.value:(r=this.$endSelect.selectlist("selectedItem"),i=r.value);this.$endAfter.parent().addClass("hidden");this.$endAfter.parent().attr("aria-hidden","true");this.$endDate.parent().addClass("hidden");this.$endDate.parent().attr("aria-hidden","true");"after"===i?(this.$endAfter.parent().removeClass("hide hidden"),this.$endAfter.parent().attr("aria-hidden","false")):"date"===i&&(this.$endDate.parent().removeClass("hide hidden"),this.$endDate.parent().attr("aria-hidden","false"))},_guessEndDate:function(){var n=this.$repeatIntervalSelect.selectlist("selectedItem").value,t=new Date(this.$endDate.datepicker("getDate")),r=new Date(this.$startDate.datepicker("getDate")),i=this.$repeatIntervalSpinbox.find("input").val();"none"!==n&&r>=t&&(this.$repeatIntervalSpinbox.is(":visible")||(i=1),"weekdays"===n&&(i=1,n="weekly"),t=a(r,t,n,i),this.$endDate.datepicker("setDate",t))},getValue:function(){var i,o=this.$repeatIntervalSpinbox.spinbox("value"),t="",u=this.$repeatIntervalSelect.selectlist("selectedItem").value,h,f,p,w,c,l,e,s,a,y,v;return this.$startTime.combobox("selectedItem").value?(i=this.$startTime.combobox("selectedItem").value,i=i.toLowerCase()):i=this.$startTime.combobox("selectedItem").text.toLowerCase(),a=this.$timeZone.selectlist("selectedItem"),e=""+r(this.$startDate.datepicker("getDate"),"-"),e+="T",p=i.search("am")>=0,w=i.search("pm")>=0,i=n.trim(i.replace(/am/g,"").replace(/pm/g,"")).split(":"),i[0]=parseInt(i[0],10),i[1]=parseInt(i[1],10),p&&i[0]>11?i[0]=0:w&&i[0]<12&&(i[0]+=12),e+=i[0]<10?"0"+i[0]:i[0],e+=":",e+=i[1]<10?"0"+i[1]:i[1],e+="+00:00"===a.offset?"Z":a.offset,"none"===u?t="FREQ=DAILY;INTERVAL=1;COUNT=1;":"secondly"===u?(t="FREQ=SECONDLY;",t+="INTERVAL="+o+";"):"minutely"===u?(t="FREQ=MINUTELY;",t+="INTERVAL="+o+";"):"hourly"===u?(t="FREQ=HOURLY;",t+="INTERVAL="+o+";"):"daily"===u?(t+="FREQ=DAILY;",t+="INTERVAL="+o+";"):"weekdays"===u?(t+="FREQ=WEEKLY;",t+="BYDAY=MO,TU,WE,TH,FR;",t+="INTERVAL=1;"):"weekly"===u?(f=[],this.$element.find(".repeat-days-of-the-week .btn-group input:checked").each(function(){f.push(n(this).data().value)}),t+="FREQ=WEEKLY;",t+="BYDAY="+f.join(",")+";",t+="INTERVAL="+o+";"):"monthly"===u?(t+="FREQ=MONTHLY;",t+="INTERVAL="+o+";",s=this.$element.find("input[name=repeat-monthly]:checked").val(),"bymonthday"===s?(h=parseInt(this.$element.find(".repeat-monthly-date .selectlist").selectlist("selectedItem").text,10),t+="BYMONTHDAY="+h+";"):"bysetpos"===s&&(f=this.$element.find(".repeat-monthly-day .month-days").selectlist("selectedItem").value,l=this.$element.find(".repeat-monthly-day .month-day-pos").selectlist("selectedItem").value,t+="BYDAY="+f+";",t+="BYSETPOS="+l+";")):"yearly"===u&&(t+="FREQ=YEARLY;",s=this.$element.find("input[name=repeat-yearly]:checked").val(),"bymonthday"===s?(c=this.$element.find(".repeat-yearly-date .year-month").selectlist("selectedItem").value,h=this.$element.find(".repeat-yearly-date .year-month-day").selectlist("selectedItem").text,t+="BYMONTH="+c+";",t+="BYMONTHDAY="+h+";"):"bysetpos"===s&&(f=this.$element.find(".repeat-yearly-day .year-month-days").selectlist("selectedItem").value,l=this.$element.find(".repeat-yearly-day .year-month-day-pos").selectlist("selectedItem").value,c=this.$element.find(".repeat-yearly-day .year-month").selectlist("selectedItem").value,t+="BYDAY="+f+";",t+="BYSETPOS="+l+";",t+="BYMONTH="+c+";")),y=this.$endSelect.selectlist("selectedItem").value,v="","none"!==u&&("after"===y?v="COUNT="+this.$endAfter.spinbox("value")+";":"date"===y&&(v="UNTIL="+r(this.$endDate.datepicker("getDate"),"")+";")),t+=v,t=";"===t.substring(t.length-1)?t.substring(0,t.length-1):t,{startDateTime:e,timeZone:a,recurrencePattern:t}},repeatIntervalSelectChanged:function(n,t){var r,i,u;switch(t?(i=t.value,u=t.text):(r=this.$repeatIntervalSelect.selectlist("selectedItem"),i=r.value||"",u=r.text||""),this.$repeatIntervalTxt.text(u),i.toLowerCase()){case"hourly":case"daily":case"weekly":case"monthly":this.$repeatIntervalPanel.removeClass("hide hidden");this.$repeatIntervalPanel.attr("aria-hidden","false");break;default:this.$repeatIntervalPanel.addClass("hidden");this.$repeatIntervalPanel.attr("aria-hidden","true")}this.$recurrencePanels.addClass("hidden");this.$recurrencePanels.attr("aria-hidden","true");this.$element.find(".repeat-"+i).removeClass("hide hidden");this.$element.find(".repeat-"+i).attr("aria-hidden","false");"none"===i?(this.$end.addClass("hidden"),this.$end.attr("aria-hidden","true")):(this.$end.removeClass("hide hidden"),this.$end.attr("aria-hidden","false"));this._guessEndDate()},setValue:function(t){var e,f,u,h,o,y,r,i,a,s,c,l,v,w;if(t.startDateTime?(i=t.startDateTime.split("T"),a=i[0],i[1]?(i[1]=i[1].split(":"),e=parseInt(i[1][0],10),o=i[1][1]?parseInt(i[1][1].split("+")[0].split("-")[0].split("Z")[0],10):0,y=12>e?"AM":"PM",0===e?e=12:e>12&&(e-=12),o=10>o?"0"+o:o,s=e+":"+o,i=e+":"+o+" "+y,this.$startTime.find("input").val(i),this.$startTime.combobox("selectByText",i)):s="00:00"):(s="00:00",l=this.$startDate.datepicker("getDate"),a=l.getFullYear()+"-"+l.getMonth()+"-"+l.getDate()),u="li",t.timeZone?("string"==typeof t.timeZone?u+='[data-name="'+t.timeZone+'"]':n.each(t.timeZone,function(n,t){u+="[data-"+n+'="'+t+'"]'}),c=t.timeZone.offset,this.$timeZone.selectlist("selectBySelector",u)):t.startDateTime?(i=t.startDateTime.split("T")[1],i=i?i.search(/\+/)>-1?"+"+n.trim(i.split("+")[1]):i.search(/\-/)>-1?"-"+n.trim(i.split("-")[1]):"+00:00":"+00:00",c="+00:00"===i?"Z":i,u+='[data-offset="'+i+'"]',this.$timeZone.selectlist("selectBySelector",u)):c="Z",t.recurrencePattern){for(r={},i=t.recurrencePattern.toUpperCase().split(";"),f=0,h=i.length;h>f;f++)""!==i[f]&&(u=i[f].split("="),r[u[0]]=u[1]);if("DAILY"===r.FREQ)u="MO,TU,WE,TH,FR"===r.BYDAY?"weekdays":"1"===r.INTERVAL&&"1"===r.COUNT?"none":"daily";else if("SECONDLY"===r.FREQ)u="secondly";else if("MINUTELY"===r.FREQ)u="minutely";else if("HOURLY"===r.FREQ)u="hourly";else if("WEEKLY"===r.FREQ){if(u="weekly",r.BYDAY)if("MO,TU,WE,TH,FR"===r.BYDAY)u="weekdays";else for(v=this.$element.find(".repeat-days-of-the-week .btn-group"),v.find("label").removeClass("active"),i=r.BYDAY.split(","),f=0,h=i.length;h>f;f++)v.find('input[data-value="'+i[f]+'"]').prop("checked",!0).parent().addClass("active")}else"MONTHLY"===r.FREQ?(this.$element.find(".repeat-monthly input").removeAttr("checked").removeClass("checked"),this.$element.find(".repeat-monthly label.radio-custom").removeClass("checked"),r.BYMONTHDAY?(i=this.$element.find(".repeat-monthly-date"),i.find("input").addClass("checked").prop("checked",!0),i.find("label.radio-custom").addClass("checked"),i.find(".selectlist").selectlist("selectByValue",r.BYMONTHDAY)):r.BYDAY&&(i=this.$element.find(".repeat-monthly-day"),i.find("input").addClass("checked").prop("checked",!0),i.find("label.radio-custom").addClass("checked"),r.BYSETPOS&&i.find(".month-day-pos").selectlist("selectByValue",r.BYSETPOS),i.find(".month-days").selectlist("selectByValue",r.BYDAY)),u="monthly"):"YEARLY"===r.FREQ?(this.$element.find(".repeat-yearly input").removeAttr("checked").removeClass("checked"),this.$element.find(".repeat-yearly label.radio-custom").removeClass("checked"),r.BYMONTHDAY?(i=this.$element.find(".repeat-yearly-date"),i.find("input").addClass("checked").prop("checked",!0),i.find("label.radio-custom").addClass("checked"),r.BYMONTH&&i.find(".year-month").selectlist("selectByValue",r.BYMONTH),i.find(".year-month-day").selectlist("selectByValue",r.BYMONTHDAY)):r.BYSETPOS&&(i=this.$element.find(".repeat-yearly-day"),i.find("input").addClass("checked").prop("checked",!0),i.find("label.radio-custom").addClass("checked"),i.find(".year-month-day-pos").selectlist("selectByValue",r.BYSETPOS),r.BYDAY&&i.find(".year-month-days").selectlist("selectByValue",r.BYDAY),r.BYMONTH&&i.find(".year-month").selectlist("selectByValue",r.BYMONTH)),u="yearly"):u="none";if(r.COUNT)this.$endAfter.spinbox("value",parseInt(r.COUNT,10)),this.$endSelect.selectlist("selectByValue","after");else if(r.UNTIL){i=r.UNTIL;8===i.length&&(i=i.split(""),i.splice(4,0,"-"),i.splice(7,0,"-"),i=i.join(""));var p=this.$timeZone.selectlist("selectedItem"),b="+00:00"===p.offset?"Z":p.offset,k=this.setUtcTime(i,s,b);this.$endDate.datepicker("setDate",k);this.$endSelect.selectlist("selectByValue","date")}else this.$endSelect.selectlist("selectByValue","never");this.endSelectChanged();r.INTERVAL&&this.$repeatIntervalSpinbox.spinbox("value",parseInt(r.INTERVAL,10));this.$repeatIntervalSelect.selectlist("selectByValue",u);this.repeatIntervalSelectChanged()}w=this.setUtcTime(a,s,c);this.$startDate.datepicker("setDate",w)},toggleState:function(n){this.$element.find(".combobox").combobox(n);this.$element.find(".datepicker").datepicker(n);this.$element.find(".selectlist").selectlist(n);this.$element.find(".spinbox").spinbox(n);this.$element.find(".radio-custom").radio(n);n="disable"===n?"addClass":"removeClass";this.$element.find(".repeat-days-of-the-week .btn-group")[n]("disabled")},value:function(n){return n?this.setValue(n):this.getValue()}};n.fn.scheduler=function(i){var r,u=Array.prototype.slice.call(arguments,1),f=this.each(function(){var e=n(this),f=e.data("fu.scheduler"),o="object"==typeof i&&i;f||e.data("fu.scheduler",f=new t(this,o));"string"==typeof i&&(r=f[i].apply(f,u))});return void 0===r?f:r};n.fn.scheduler.defaults={};n.fn.scheduler.Constructor=t;n.fn.scheduler.noConflict=function(){return n.fn.scheduler=s,this};n(document).on("mousedown.fu.scheduler.data-api","[data-initialize=scheduler]",function(t){var i=n(t.target).closest(".scheduler");i.data("fu.scheduler")||i.scheduler(i.data())});n(function(){n("[data-initialize=scheduler]").each(function(){var t=n(this);t.data("scheduler")||t.scheduler(t.data())})})}(n),function(n){var u=n.fn.picker,t=function(t,i){var r=this;this.$element=n(t);this.options=n.extend({},n.fn.picker.defaults,i);this.$accept=this.$element.find(".picker-accept");this.$cancel=this.$element.find(".picker-cancel");this.$trigger=this.$element.find(".picker-trigger");this.$footer=this.$element.find(".picker-footer");this.$header=this.$element.find(".picker-header");this.$popup=this.$element.find(".picker-popup");this.$body=this.$element.find(".picker-body");this.clickStamp="_";this.isInput=this.$trigger.is("input");this.$trigger.on("keydown.fu.picker",n.proxy(this.keyComplete,this));this.$trigger.on("focus.fu.picker",n.proxy(function(t){("undefined"==typeof t||n(t.target).is("input[type=text]"))&&n.proxy(this.show(),this)},this));this.$trigger.on("click.fu.picker",n.proxy(function(t){n(t.target).is("input[type=text]")?n.proxy(this.show(),this):n.proxy(this.toggle(),this)},this));this.$accept.on("click.fu.picker",n.proxy(this.complete,this,"accepted"));this.$cancel.on("click.fu.picker",function(n){n.preventDefault();r.complete("cancelled")})},i=function(t){var u=Math.max(document.documentElement.clientHeight,window.innerHeight||0),i=n(document).scrollTop(),r=t.$popup.offset(),f=r.top+t.$popup.outerHeight(!0);return f>u+i||r.top<i?!0:!1},f=function(n){n.$popup.css("visibility","hidden");r(n);i(n)&&(e(n),i(n)&&r(n));n.$popup.css("visibility","visible")},e=function(n){n.$popup.css("top",-n.$popup.outerHeight(!0)+"px")},r=function(n){n.$popup.css("top",n.$trigger.outerHeight(!0)+"px")};t.prototype={constructor:t,complete:function(n){var i=this.options[{accepted:"onAccept",cancelled:"onCancel",exited:"onExit"}[n]],t={contents:this.$body};i?(i(t),this.$element.trigger(n+".fu.picker",t)):(this.$element.trigger(n+".fu.picker",t),this.hide())},keyComplete:function(n){this.isInput&&13===n.keyCode?(this.complete("accepted"),this.$trigger.blur()):27===n.keyCode&&(this.complete("exited"),this.$trigger.blur())},destroy:function(){return this.$element.remove(),n(document).off("click.fu.picker.externalClick."+this.clickStamp),this.$element[0].outerHTML},disable:function(){this.$element.addClass("disabled");this.$trigger.attr("disabled","disabled")},enable:function(){this.$element.removeClass("disabled");this.$trigger.removeAttr("disabled")},toggle:function(){this.$element.hasClass("showing")?this.hide():this.show()},hide:function(){this.$element.hasClass("showing")&&(this.$element.removeClass("showing"),n(document).off("click.fu.picker.externalClick."+this.clickStamp),this.$element.trigger("hidden.fu.picker"))},externalClickListener:function(n,t){(t===!0||this.isExternalClick(n))&&this.complete("exited")},isExternalClick:function(t){var i,f,e=this.$element.get(0),r=this.options.externalClickExceptions||[],u=n(t.target);if(t.target===e||u.parents(".picker:first").get(0)===e)return!1;for(i=0,f=r.length;f>i;i++)if(u.is(r[i])||u.parents(r[i]).length>0)return!1;return!0},show:function(){var t;if(t=n(document).find(".picker.showing"),t.length>0){if(t.data("fu.picker")&&t.data("fu.picker").options.explicit)return;t.picker("externalClickListener",{},!0)}this.$element.addClass("showing");f(this);this.$element.trigger("shown.fu.picker");this.clickStamp=(new Date).getTime()+(Math.floor(100*Math.random())+1);this.options.explicit||n(document).on("click.fu.picker.externalClick."+this.clickStamp,n.proxy(this.externalClickListener,this))}};n.fn.picker=function(i){var r,u=Array.prototype.slice.call(arguments,1),f=this.each(function(){var e=n(this),f=e.data("fu.picker"),o="object"==typeof i&&i;f||e.data("fu.picker",f=new t(this,o));"string"==typeof i&&(r=f[i].apply(f,u))});return void 0===r?f:r};n.fn.picker.defaults={onAccept:void 0,onCancel:void 0,onExit:void 0,externalClickExceptions:[],explicit:!1};n.fn.picker.Constructor=t;n.fn.picker.noConflict=function(){return n.fn.picker=u,this};n(document).on("focus.fu.picker.data-api","[data-initialize=picker]",function(t){var i=n(t.target).closest(".picker");i.data("fu.picker")||i.picker(i.data())});n(function(){n("[data-initialize=picker]").each(function(){var t=n(this);t.data("fu.picker")||t.picker(t.data())})})}(n)});!function(n,t){"use strict";"function"==typeof define&&define.amd?define(["jquery"],t):"object"==typeof exports?module.exports=t(require("jquery")):n.bootbox=t(n.jQuery)}(this,function a(n,t){"use strict";function a(n){var t=f[o.locale];return t?t[n]:f.en[n]}function e(t,i,r){t.stopPropagation();t.preventDefault();var u=n.isFunction(r)&&r.call(i,t)===!1;u||i.modal("hide")}function v(n){var i,t=0;for(i in n)t++;return t}function r(t,i){var r=0;n.each(t,function(n,t){i(n,t,r++)})}function y(t){var i,u;if("object"!=typeof t)throw new Error("Please supply an object of options");if(!t.message)throw new Error("Please specify a message");return t=n.extend({},o,t),t.buttons||(t.buttons={}),i=t.buttons,u=v(i),r(i,function(t,r,f){if(n.isFunction(r)&&(r=i[t]={callback:r}),"object"!==n.type(r))throw new Error("button with key "+t+" must be an object");r.label||(r.label=t);r.className||(r.className=2>=u&&f===u-1?"btn-primary":"btn-default")}),t}function p(n,t){var r=n.length,i={};if(1>r||r>2)throw new Error("Invalid argument length");return 2===r||"string"==typeof n[0]?(i[t[0]]=n[0],i[t[1]]=n[1]):i=n[0],i}function s(t,i,r){return n.extend(!0,{},t,p(i,r))}function h(n,t,i,r){var u={className:"bootbox-"+n,buttons:c.apply(null,t)};return l(s(u,r,i),t)}function c(){for(var t={},n=0,r=arguments.length;r>n;n++){var i=arguments[n],u=i.toLowerCase(),f=i.toUpperCase();t[u]={label:a(f)}}return t}function l(n,i){var u={};return r(i,function(n,t){u[t]=!0}),r(n.buttons,function(n){if(u[n]===t)throw new Error("button key "+n+" is not allowed (options are "+i.join("\n")+")");}),n}var u={dialog:"<div class='bootbox modal' tabindex='-1' role='dialog'><div class='modal-dialog'><div class='modal-content'><div class='modal-body'><div class='bootbox-body'><\/div><\/div><\/div><\/div><\/div>",header:"<div class='modal-header'><h4 class='modal-title'><\/h4><\/div>",footer:"<div class='modal-footer'><\/div>",closeButton:"<button type='button' class='bootbox-close-button close' data-dismiss='modal' aria-hidden='true'>&times;<\/button>",form:"<form class='bootbox-form'><\/form>",inputs:{text:"<input class='bootbox-input bootbox-input-text form-control' autocomplete=off type=text />",textarea:"<textarea class='bootbox-input bootbox-input-textarea form-control'><\/textarea>",email:"<input class='bootbox-input bootbox-input-email form-control' autocomplete='off' type='email' />",select:"<select class='bootbox-input bootbox-input-select form-control'><\/select>",checkbox:"<div class='checkbox'><label><input class='bootbox-input bootbox-input-checkbox' type='checkbox' /><\/label><\/div>",date:"<input class='bootbox-input bootbox-input-date form-control' autocomplete=off type='date' />",time:"<input class='bootbox-input bootbox-input-time form-control' autocomplete=off type='time' />",number:"<input class='bootbox-input bootbox-input-number form-control' autocomplete=off type='number' />",password:"<input class='bootbox-input bootbox-input-password form-control' autocomplete='off' type='password' />"}},o={locale:"en",backdrop:"static",animate:!0,className:null,closeButton:!0,show:!0,container:"body"},i={},f;return i.alert=function(){var t;if(t=h("alert",["ok"],["message","callback"],arguments),t.callback&&!n.isFunction(t.callback))throw new Error("alert requires callback property to be a function when provided");return t.buttons.ok.callback=t.onEscape=function(){return n.isFunction(t.callback)?t.callback.call(this):!0},i.dialog(t)},i.confirm=function(){var t;if(t=h("confirm",["cancel","confirm"],["message","callback"],arguments),t.buttons.cancel.callback=t.onEscape=function(){return t.callback.call(this,!1)},t.buttons.confirm.callback=function(){return t.callback.call(this,!0)},!n.isFunction(t.callback))throw new Error("confirm requires a callback");return i.dialog(t)},i.prompt=function(){var f,y,h,v,e,p,o,a,w;if(v=n(u.form),y={className:"bootbox-prompt",buttons:c("cancel","confirm"),value:"",inputType:"text"},f=l(s(y,arguments,["title","callback"]),["cancel","confirm"]),p=f.show===t?!0:f.show,f.message=v,f.buttons.cancel.callback=f.onEscape=function(){return f.callback.call(this,null)},f.buttons.confirm.callback=function(){var t,i;switch(f.inputType){case"text":case"textarea":case"email":case"select":case"date":case"time":case"number":case"password":t=e.val();break;case"checkbox":i=e.find("input:checked");t=[];r(i,function(i,r){t.push(n(r).val())})}return f.callback.call(this,t)},f.show=!1,!f.title)throw new Error("prompt requires a title");if(!n.isFunction(f.callback))throw new Error("prompt requires a callback");if(!u.inputs[f.inputType])throw new Error("invalid prompt type");switch(e=n(u.inputs[f.inputType]),f.inputType){case"text":case"textarea":case"email":case"date":case"time":case"number":case"password":e.val(f.value);break;case"select":if(a={},o=f.inputOptions||[],!n.isArray(o))throw new Error("Please pass an array of input options");if(!o.length)throw new Error("prompt with select requires options");r(o,function(i,r){var u=e;if(r.value===t||r.text===t)throw new Error("given options in wrong format");r.group&&(a[r.group]||(a[r.group]=n("<optgroup/>").attr("label",r.group)),u=a[r.group]);u.append("<option value='"+r.value+"'>"+r.text+"<\/option>")});r(a,function(n,t){e.append(t)});e.val(f.value);break;case"checkbox":if(w=n.isArray(f.value)?f.value:[f.value],o=f.inputOptions||[],!o.length)throw new Error("prompt with checkbox requires options");if(!o[0].value||!o[0].text)throw new Error("given options in wrong format");e=n("<div/>");r(o,function(t,i){var o=n(u.inputs[f.inputType]);o.find("input").attr("value",i.value);o.find("label").append(i.text);r(w,function(n,t){t===i.value&&o.find("input").prop("checked",!0)});e.append(o)})}return f.placeholder&&e.attr("placeholder",f.placeholder),f.pattern&&e.attr("pattern",f.pattern),f.maxlength&&e.attr("maxlength",f.maxlength),v.append(e),v.on("submit",function(n){n.preventDefault();n.stopPropagation();h.find(".btn-primary").click()}),h=i.dialog(f),h.off("shown.bs.modal"),h.on("shown.bs.modal",function(){e.focus()}),p===!0&&h.modal("show"),h},i.dialog=function(i){var c;i=y(i);var f=n(u.dialog),l=f.find(".modal-dialog"),s=f.find(".modal-body"),a=i.buttons,h="",o={onEscape:i.onEscape};if(n.fn.modal===t)throw new Error("$.fn.modal is not defined; please double check you have included the Bootstrap JavaScript library. See http://getbootstrap.com/javascript/ for more details.");return(r(a,function(n,t){h+="<button data-bb-handler='"+n+"' type='button' class='btn "+t.className+"'>"+t.label+"<\/button>";o[n]=t.callback}),s.find(".bootbox-body").html(i.message),i.animate===!0&&f.addClass("fade"),i.className&&f.addClass(i.className),"large"===i.size?l.addClass("modal-lg"):"small"===i.size&&l.addClass("modal-sm"),i.title&&s.before(u.header),i.closeButton)&&(c=n(u.closeButton),i.title?f.find(".modal-header").prepend(c):c.css("margin-top","-10px").prependTo(s)),i.title&&f.find(".modal-title").html(i.title),h.length&&(s.after(u.footer),f.find(".modal-footer").html(h)),f.on("hidden.bs.modal",function(n){n.target===this&&f.remove()}),f.on("shown.bs.modal",function(){f.find(".btn-primary:first").focus()}),"static"!==i.backdrop&&f.on("click.dismiss.bs.modal",function(n){f.children(".modal-backdrop").length&&(n.currentTarget=f.children(".modal-backdrop").get(0));n.target===n.currentTarget&&f.trigger("escape.close.bb")}),f.on("escape.close.bb",function(n){o.onEscape&&e(n,f,o.onEscape)}),f.on("click",".modal-footer button",function(t){var i=n(this).data("bb-handler");e(t,f,o[i])}),f.on("click",".bootbox-close-button",function(n){e(n,f,o.onEscape)}),f.on("keyup",function(n){27===n.which&&f.trigger("escape.close.bb")}),n(i.container).append(f),f.modal({backdrop:i.backdrop?"static":!1,keyboard:!1,show:!1}),i.show&&f.modal("show"),f},i.setDefaults=function(){var t={};2===arguments.length?t[arguments[0]]=arguments[1]:t=arguments[0];n.extend(o,t)},i.hideAll=function(){return n(".bootbox").modal("hide"),i},f={bg_BG:{OK:"Ок",CANCEL:"Отказ",CONFIRM:"Потвърждавам"},br:{OK:"OK",CANCEL:"Cancelar",CONFIRM:"Sim"},cs:{OK:"OK",CANCEL:"Zrušit",CONFIRM:"Potvrdit"},da:{OK:"OK",CANCEL:"Annuller",CONFIRM:"Accepter"},de:{OK:"OK",CANCEL:"Abbrechen",CONFIRM:"Akzeptieren"},el:{OK:"Εντάξει",CANCEL:"Ακύρωση",CONFIRM:"Επιβεβαίωση"},en:{OK:"OK",CANCEL:"Cancel",CONFIRM:"OK"},es:{OK:"OK",CANCEL:"Cancelar",CONFIRM:"Aceptar"},et:{OK:"OK",CANCEL:"Katkesta",CONFIRM:"OK"},fa:{OK:"قبول",CANCEL:"لغو",CONFIRM:"تایید"},fi:{OK:"OK",CANCEL:"Peruuta",CONFIRM:"OK"},fr:{OK:"OK",CANCEL:"Annuler",CONFIRM:"D'accord"},he:{OK:"אישור",CANCEL:"ביטול",CONFIRM:"אישור"},hu:{OK:"OK",CANCEL:"Mégsem",CONFIRM:"Megerősít"},hr:{OK:"OK",CANCEL:"Odustani",CONFIRM:"Potvrdi"},id:{OK:"OK",CANCEL:"Batal",CONFIRM:"OK"},it:{OK:"OK",CANCEL:"Annulla",CONFIRM:"Conferma"},ja:{OK:"OK",CANCEL:"キャンセル",CONFIRM:"確認"},lt:{OK:"Gerai",CANCEL:"Atšaukti",CONFIRM:"Patvirtinti"},lv:{OK:"Labi",CANCEL:"Atcelt",CONFIRM:"Apstiprināt"},nl:{OK:"OK",CANCEL:"Annuleren",CONFIRM:"Accepteren"},no:{OK:"OK",CANCEL:"Avbryt",CONFIRM:"OK"},pl:{OK:"OK",CANCEL:"Anuluj",CONFIRM:"Potwierdź"},pt:{OK:"OK",CANCEL:"Cancelar",CONFIRM:"Confirmar"},ru:{OK:"OK",CANCEL:"Отмена",CONFIRM:"Применить"},sq:{OK:"OK",CANCEL:"Anulo",CONFIRM:"Prano"},sv:{OK:"OK",CANCEL:"Avbryt",CONFIRM:"OK"},th:{OK:"ตกลง",CANCEL:"ยกเลิก",CONFIRM:"ยืนยัน"},tr:{OK:"Tamam",CANCEL:"İptal",CONFIRM:"Onayla"},zh_CN:{OK:"OK",CANCEL:"取消",CONFIRM:"确认"},zh_TW:{OK:"OK",CANCEL:"取消",CONFIRM:"確認"}},i.addLocale=function(t,r){return n.each(["OK","CANCEL","CONFIRM"],function(n,t){if(!r[t])throw new Error("Please supply a translation for '"+t+"'");}),f[t]={OK:r.OK,CANCEL:r.CANCEL,CONFIRM:r.CONFIRM},i},i.removeLocale=function(n){return delete f[n],i},i.setLocale=function(n){return i.setDefaults("locale",n)},i.init=function(t){return a(t||n)},i})