parcelRequire=function(e,r,t,n){var i,o="function"==typeof parcelRequire&&parcelRequire,u="function"==typeof require&&require;function f(t,n){if(!r[t]){if(!e[t]){var i="function"==typeof parcelRequire&&parcelRequire;if(!n&&i)return i(t,!0);if(o)return o(t,!0);if(u&&"string"==typeof t)return u(t);var c=new Error("Cannot find module '"+t+"'");throw c.code="MODULE_NOT_FOUND",c}p.resolve=function(r){return e[t][1][r]||r},p.cache={};var l=r[t]=new f.Module(t);e[t][0].call(l.exports,p,l,l.exports,this)}return r[t].exports;function p(e){return f(p.resolve(e))}}f.isParcelRequire=!0,f.Module=function(e){this.id=e,this.bundle=f,this.exports={}},f.modules=e,f.cache=r,f.parent=o,f.register=function(r,t){e[r]=[function(e,r){r.exports=t},{}]};for(var c=0;c<t.length;c++)try{f(t[c])}catch(e){i||(i=e)}if(t.length){var l=f(t[t.length-1]);"object"==typeof exports&&"undefined"!=typeof module?module.exports=l:"function"==typeof define&&define.amd?define(function(){return l}):n&&(this[n]=l)}if(parcelRequire=f,i)throw i;return f}({"jO1i":[function(require,module,exports) {

},{"./themes/default/assets/images/flags.png":[["flags.a62cc6a3.png","MQVP"],"MQVP"],"./themes/default/assets/fonts/icons.eot":[["icons.75bb2664.eot","uz16"],"uz16"],"./themes/default/assets/fonts/icons.woff2":[["icons.55af4fc1.woff2","yhOi"],"yhOi"],"./themes/default/assets/fonts/icons.woff":[["icons.1afd2853.woff","Qczh"],"Qczh"],"./themes/default/assets/fonts/icons.ttf":[["icons.9f781533.ttf","V6XQ"],"V6XQ"],"./themes/default/assets/fonts/icons.svg":[["icons.680d365a.svg","FEcM"],"FEcM"],"./themes/default/assets/fonts/outline-icons.eot":[["outline-icons.653ccd4f.eot","FoAB"],"FoAB"],"./themes/default/assets/fonts/outline-icons.woff2":[["outline-icons.cf1943ea.woff2","fFNy"],"fFNy"],"./themes/default/assets/fonts/outline-icons.woff":[["outline-icons.eeedd9bc.woff","Ssna"],"Ssna"],"./themes/default/assets/fonts/outline-icons.ttf":[["outline-icons.8f5655b0.ttf","NOBm"],"NOBm"],"./themes/default/assets/fonts/outline-icons.svg":[["outline-icons.78e93500.svg","WqY1"],"WqY1"],"./themes/default/assets/fonts/brand-icons.eot":[["brand-icons.c2094a80.eot","tGZz"],"tGZz"],"./themes/default/assets/fonts/brand-icons.woff2":[["brand-icons.088c083c.woff2","Mx19"],"Mx19"],"./themes/default/assets/fonts/brand-icons.woff":[["brand-icons.16abc57d.woff","SRNl"],"SRNl"],"./themes/default/assets/fonts/brand-icons.ttf":[["brand-icons.bd9767a7.ttf","fPio"],"fPio"],"./themes/default/assets/fonts/brand-icons.svg":[["brand-icons.ddedbaaa.svg","Or0c"],"Or0c"]}],"Sr7R":[function(require,module,exports) {

},{"./prism.png":[["prism.fabfd388.png","me0b"],"me0b"]}],"pBGv":[function(require,module,exports) {

var t,e,n=module.exports={};function r(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function i(e){if(t===setTimeout)return setTimeout(e,0);if((t===r||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}function u(t){if(e===clearTimeout)return clearTimeout(t);if((e===o||!e)&&clearTimeout)return e=clearTimeout,clearTimeout(t);try{return e(t)}catch(n){try{return e.call(null,t)}catch(n){return e.call(this,t)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:r}catch(n){t=r}try{e="function"==typeof clearTimeout?clearTimeout:o}catch(n){e=o}}();var c,s=[],l=!1,a=-1;function f(){l&&c&&(l=!1,c.length?s=c.concat(s):a=-1,s.length&&h())}function h(){if(!l){var t=i(f);l=!0;for(var e=s.length;e;){for(c=s,s=[];++a<e;)c&&c[a].run();a=-1,e=s.length}c=null,l=!1,u(t)}}function m(t,e){this.fun=t,this.array=e}function p(){}n.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];s.push(new m(t,e)),1!==s.length||l||i(h)},m.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.env={},n.argv=[],n.version="",n.versions={},n.on=p,n.addListener=p,n.once=p,n.off=p,n.removeListener=p,n.removeAllListeners=p,n.emit=p,n.prependListener=p,n.prependOnceListener=p,n.listeners=function(t){return[]},n.binding=function(t){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(t){throw new Error("process.chdir is not supported")},n.umask=function(){return 0};
},{}],"juYr":[function(require,module,exports) {
var global = arguments[3];
var process = require("process");
var define;
var e,t=arguments[3],n=require("process");!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(t,n){"use strict";var r=[],i=Object.getPrototypeOf,o=r.slice,a=r.flat?function(e){return r.flat.call(e)}:function(e){return r.concat.apply([],e)},s=r.push,u=r.indexOf,l={},c=l.toString,f=l.hasOwnProperty,p=f.toString,d=p.call(Object),h={},g=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},v=function(e){return null!=e&&e===e.window},y=t.document,m={type:!0,src:!0,nonce:!0,noModule:!0};function x(e,t,n){var r,i,o=(n=n||y).createElement("script");if(o.text=e,t)for(r in m)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function b(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?l[c.call(e)]||"object":typeof e}var w=function(e,t){return new w.fn.init(e,t)};function T(e){var t=!!e&&"length"in e&&e.length,n=b(e);return!g(e)&&!v(e)&&("array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e)}w.fn=w.prototype={jquery:"3.6.0",constructor:w,length:0,toArray:function(){return o.call(this)},get:function(e){return null==e?o.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=w.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return w.each(this,e)},map:function(e){return this.pushStack(w.map(this,function(t,n){return e.call(t,n,t)}))},slice:function(){return this.pushStack(o.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(w.grep(this,function(e,t){return(t+1)%2}))},odd:function(){return this.pushStack(w.grep(this,function(e,t){return t%2}))},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(n>=0&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:s,sort:r.sort,splice:r.splice},w.extend=w.fn.extend=function(){var e,t,n,r,i,o,a=arguments[0]||{},s=1,u=arguments.length,l=!1;for("boolean"==typeof a&&(l=a,a=arguments[s]||{},s++),"object"==typeof a||g(a)||(a={}),s===u&&(a=this,s--);s<u;s++)if(null!=(e=arguments[s]))for(t in e)r=e[t],"__proto__"!==t&&a!==r&&(l&&r&&(w.isPlainObject(r)||(i=Array.isArray(r)))?(n=a[t],o=i&&!Array.isArray(n)?[]:i||w.isPlainObject(n)?n:{},i=!1,a[t]=w.extend(l,o,r)):void 0!==r&&(a[t]=r));return a},w.extend({expando:"jQuery"+("3.6.0"+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,n;return!(!e||"[object Object]"!==c.call(e))&&(!(t=i(e))||"function"==typeof(n=f.call(t,"constructor")&&t.constructor)&&p.call(n)===d)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e,t,n){x(e,{nonce:t&&t.nonce},n)},each:function(e,t){var n,r=0;if(T(e))for(n=e.length;r<n&&!1!==t.call(e[r],r,e[r]);r++);else for(r in e)if(!1===t.call(e[r],r,e[r]))break;return e},makeArray:function(e,t){var n=t||[];return null!=e&&(T(Object(e))?w.merge(n,"string"==typeof e?[e]:e):s.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:u.call(t,e,n)},merge:function(e,t){for(var n=+t.length,r=0,i=e.length;r<n;r++)e[i++]=t[r];return e.length=i,e},grep:function(e,t,n){for(var r=[],i=0,o=e.length,a=!n;i<o;i++)!t(e[i],i)!==a&&r.push(e[i]);return r},map:function(e,t,n){var r,i,o=0,s=[];if(T(e))for(r=e.length;o<r;o++)null!=(i=t(e[o],o,n))&&s.push(i);else for(o in e)null!=(i=t(e[o],o,n))&&s.push(i);return a(s)},guid:1,support:h}),"function"==typeof Symbol&&(w.fn[Symbol.iterator]=r[Symbol.iterator]),w.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){l["[object "+t+"]"]=t.toLowerCase()});var C=function(e){var t,n,r,i,o,a,s,u,l,c,f,p,d,h,g,v,y,m,x,b="sizzle"+1*new Date,w=e.document,T=0,C=0,E=ue(),S=ue(),k=ue(),A=ue(),N=function(e,t){return e===t&&(f=!0),0},j={}.hasOwnProperty,D=[],q=D.pop,L=D.push,H=D.push,O=D.slice,P=function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},R="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",I="(?:\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",W="\\["+M+"*("+I+")(?:"+M+"*([*^$|!~]?=)"+M+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+I+"))|)"+M+"*\\]",F=":("+I+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+W+")*)|.*)\\)|)",B=new RegExp(M+"+","g"),$=new RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),_=new RegExp("^"+M+"*,"+M+"*"),z=new RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp(F),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){p()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(D=O.call(w.childNodes),w.childNodes),D[w.childNodes.length].nodeType}catch(Se){H={apply:D.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}function se(e,t,r,i){var o,s,l,c,f,h,y,m=t&&t.ownerDocument,w=t?t.nodeType:9;if(r=r||[],"string"!=typeof e||!e||1!==w&&9!==w&&11!==w)return r;if(!i&&(p(t),t=t||d,g)){if(11!==w&&(f=Z.exec(e)))if(o=f[1]){if(9===w){if(!(l=t.getElementById(o)))return r;if(l.id===o)return r.push(l),r}else if(m&&(l=m.getElementById(o))&&x(t,l)&&l.id===o)return r.push(l),r}else{if(f[2])return H.apply(r,t.getElementsByTagName(e)),r;if((o=f[3])&&n.getElementsByClassName&&t.getElementsByClassName)return H.apply(r,t.getElementsByClassName(o)),r}if(n.qsa&&!A[e+" "]&&(!v||!v.test(e))&&(1!==w||"object"!==t.nodeName.toLowerCase())){if(y=e,m=t,1===w&&(U.test(e)||z.test(e))){for((m=ee.test(e)&&ye(t.parentNode)||t)===t&&n.scope||((c=t.getAttribute("id"))?c=c.replace(re,ie):t.setAttribute("id",c=b)),s=(h=a(e)).length;s--;)h[s]=(c?"#"+c:":scope")+" "+xe(h[s]);y=h.join(",")}try{return H.apply(r,m.querySelectorAll(y)),r}catch(T){A(e,!0)}finally{c===b&&t.removeAttribute("id")}}}return u(e.replace($,"$1"),t,r,i)}function ue(){var e=[];return function t(n,i){return e.push(n+" ")>r.cacheLength&&delete t[e.shift()],t[n+" "]=i}}function le(e){return e[b]=!0,e}function ce(e){var t=d.createElement("fieldset");try{return!!e(t)}catch(Se){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){for(var n=e.split("|"),i=n.length;i--;)r.attrHandle[n[i]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function de(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function he(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function ge(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&ae(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function ve(e){return le(function(t){return t=+t,le(function(n,r){for(var i,o=e([],n.length,t),a=o.length;a--;)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}function ye(e){return e&&void 0!==e.getElementsByTagName&&e}for(t in n=se.support={},o=se.isXML=function(e){var t=e&&e.namespaceURI,n=e&&(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},p=se.setDocument=function(e){var t,i,a=e?e.ownerDocument||e:w;return a!=d&&9===a.nodeType&&a.documentElement?(h=(d=a).documentElement,g=!o(d),w!=d&&(i=d.defaultView)&&i.top!==i&&(i.addEventListener?i.addEventListener("unload",oe,!1):i.attachEvent&&i.attachEvent("onunload",oe)),n.scope=ce(function(e){return h.appendChild(e).appendChild(d.createElement("div")),void 0!==e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),n.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),n.getElementsByTagName=ce(function(e){return e.appendChild(d.createComment("")),!e.getElementsByTagName("*").length}),n.getElementsByClassName=K.test(d.getElementsByClassName),n.getById=ce(function(e){return h.appendChild(e).id=b,!d.getElementsByName||!d.getElementsByName(b).length}),n.getById?(r.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},r.find.ID=function(e,t){if(void 0!==t.getElementById&&g){var n=t.getElementById(e);return n?[n]:[]}}):(r.filter.ID=function(e){var t=e.replace(te,ne);return function(e){var n=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},r.find.ID=function(e,t){if(void 0!==t.getElementById&&g){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];for(i=t.getElementsByName(e),r=0;o=i[r++];)if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),r.find.TAG=n.getElementsByTagName?function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):n.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o},r.find.CLASS=n.getElementsByClassName&&function(e,t){if(void 0!==t.getElementsByClassName&&g)return t.getElementsByClassName(e)},y=[],v=[],(n.qsa=K.test(d.querySelectorAll))&&(ce(function(e){var t;h.appendChild(e).innerHTML="<a id='"+b+"'></a><select id='"+b+"-\r\\' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+b+"-]").length||v.push("~="),(t=d.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||v.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+b+"+*").length||v.push(".#.+[+~]"),e.querySelectorAll("\\\f"),v.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var t=d.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),h.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(n.matchesSelector=K.test(m=h.matches||h.webkitMatchesSelector||h.mozMatchesSelector||h.oMatchesSelector||h.msMatchesSelector))&&ce(function(e){n.disconnectedMatch=m.call(e,"*"),m.call(e,"[s!='']:x"),y.push("!=",F)}),v=v.length&&new RegExp(v.join("|")),y=y.length&&new RegExp(y.join("|")),t=K.test(h.compareDocumentPosition),x=t||K.test(h.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},N=t?function(e,t){if(e===t)return f=!0,0;var r=!e.compareDocumentPosition-!t.compareDocumentPosition;return r||(1&(r=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!n.sortDetached&&t.compareDocumentPosition(e)===r?e==d||e.ownerDocument==w&&x(w,e)?-1:t==d||t.ownerDocument==w&&x(w,t)?1:c?P(c,e)-P(c,t):0:4&r?-1:1)}:function(e,t){if(e===t)return f=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==d?-1:t==d?1:i?-1:o?1:c?P(c,e)-P(c,t):0;if(i===o)return pe(e,t);for(n=e;n=n.parentNode;)a.unshift(n);for(n=t;n=n.parentNode;)s.unshift(n);for(;a[r]===s[r];)r++;return r?pe(a[r],s[r]):a[r]==w?-1:s[r]==w?1:0},d):d},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(p(e),n.matchesSelector&&g&&!A[t+" "]&&(!y||!y.test(t))&&(!v||!v.test(t)))try{var r=m.call(e,t);if(r||n.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(Se){A(t,!0)}return se(t,d,null,[e]).length>0},se.contains=function(e,t){return(e.ownerDocument||e)!=d&&p(e),x(e,t)},se.attr=function(e,t){(e.ownerDocument||e)!=d&&p(e);var i=r.attrHandle[t.toLowerCase()],o=i&&j.call(r.attrHandle,t.toLowerCase())?i(e,t,!g):void 0;return void 0!==o?o:n.attributes||!g?e.getAttribute(t):(o=e.getAttributeNode(t))&&o.specified?o.value:null},se.escape=function(e){return(e+"").replace(re,ie)},se.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},se.uniqueSort=function(e){var t,r=[],i=0,o=0;if(f=!n.detectDuplicates,c=!n.sortStable&&e.slice(0),e.sort(N),f){for(;t=e[o++];)t===e[o]&&(i=r.push(o));for(;i--;)e.splice(r[i],1)}return c=null,e},i=se.getText=function(e){var t,n="",r=0,o=e.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=i(e)}else if(3===o||4===o)return e.nodeValue}else for(;t=e[r++];)n+=i(t);return n},(r=se.selectors={cacheLength:50,createPseudo:le,match:G,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=a(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=E[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&E(e,function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=se.attr(r,e);return null==i?"!="===t:!t||(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i.replace(B," ")+" ").indexOf(n)>-1:"|="===t&&(i===n||i.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,u){var l,c,f,p,d,h,g=o!==a?"nextSibling":"previousSibling",v=t.parentNode,y=s&&t.nodeName.toLowerCase(),m=!u&&!s,x=!1;if(v){if(o){for(;g;){for(p=t;p=p[g];)if(s?p.nodeName.toLowerCase()===y:1===p.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?v.firstChild:v.lastChild],a&&m){for(x=(d=(l=(c=(f=(p=v)[b]||(p[b]={}))[p.uniqueID]||(f[p.uniqueID]={}))[e]||[])[0]===T&&l[1])&&l[2],p=d&&v.childNodes[d];p=++d&&p&&p[g]||(x=d=0)||h.pop();)if(1===p.nodeType&&++x&&p===t){c[e]=[T,d,x];break}}else if(m&&(x=d=(l=(c=(f=(p=t)[b]||(p[b]={}))[p.uniqueID]||(f[p.uniqueID]={}))[e]||[])[0]===T&&l[1]),!1===x)for(;(p=++d&&p&&p[g]||(x=d=0)||h.pop())&&((s?p.nodeName.toLowerCase()!==y:1!==p.nodeType)||!++x||(m&&((c=(f=p[b]||(p[b]={}))[p.uniqueID]||(f[p.uniqueID]={}))[e]=[T,x]),p!==t)););return(x-=i)===r||x%r==0&&x/r>=0}}},PSEUDO:function(e,t){var n,i=r.pseudos[e]||r.setFilters[e.toLowerCase()]||se.error("unsupported pseudo: "+e);return i[b]?i(t):i.length>1?(n=[e,e,"",t],r.setFilters.hasOwnProperty(e.toLowerCase())?le(function(e,n){for(var r,o=i(e,t),a=o.length;a--;)e[r=P(e,o[a])]=!(n[r]=o[a])}):function(e){return i(e,0,n)}):i}},pseudos:{not:le(function(e){var t=[],n=[],r=s(e.replace($,"$1"));return r[b]?le(function(e,t,n,i){for(var o,a=r(e,null,i,[]),s=e.length;s--;)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),t[0]=null,!n.pop()}}),has:le(function(e){return function(t){return se(e,t).length>0}}),contains:le(function(e){return e=e.replace(te,ne),function(t){return(t.textContent||i(t)).indexOf(e)>-1}}),lang:le(function(e){return V.test(e||"")||se.error("unsupported lang: "+e),e=e.replace(te,ne).toLowerCase(),function(t){var n;do{if(n=g?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===h},focus:function(e){return e===d.activeElement&&(!d.hasFocus||d.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:ge(!1),disabled:ge(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!r.pseudos.empty(e)},header:function(e){return J.test(e.nodeName)},input:function(e){return Q.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:ve(function(){return[0]}),last:ve(function(e,t){return[t-1]}),eq:ve(function(e,t,n){return[n<0?n+t:n]}),even:ve(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:ve(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:ve(function(e,t,n){for(var r=n<0?n+t:n>t?t:n;--r>=0;)e.push(r);return e}),gt:ve(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}}).pseudos.nth=r.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})r.pseudos[t]=de(t);for(t in{submit:!0,reset:!0})r.pseudos[t]=he(t);function me(){}function xe(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function be(e,t,n){var r=t.dir,i=t.next,o=i||r,a=n&&"parentNode"===o,s=C++;return t.first?function(t,n,i){for(;t=t[r];)if(1===t.nodeType||a)return e(t,n,i);return!1}:function(t,n,u){var l,c,f,p=[T,s];if(u){for(;t=t[r];)if((1===t.nodeType||a)&&e(t,n,u))return!0}else for(;t=t[r];)if(1===t.nodeType||a)if(c=(f=t[b]||(t[b]={}))[t.uniqueID]||(f[t.uniqueID]={}),i&&i===t.nodeName.toLowerCase())t=t[r]||t;else{if((l=c[o])&&l[0]===T&&l[1]===s)return p[2]=l[2];if(c[o]=p,p[2]=e(t,n,u))return!0}return!1}}function we(e){return e.length>1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function Te(e,t,n,r,i){for(var o,a=[],s=0,u=e.length,l=null!=t;s<u;s++)(o=e[s])&&(n&&!n(o,r,i)||(a.push(o),l&&t.push(s)));return a}function Ce(e,t,n,r,i,o){return r&&!r[b]&&(r=Ce(r)),i&&!i[b]&&(i=Ce(i,o)),le(function(o,a,s,u){var l,c,f,p=[],d=[],h=a.length,g=o||function(e,t,n){for(var r=0,i=t.length;r<i;r++)se(e,t[r],n);return n}(t||"*",s.nodeType?[s]:s,[]),v=!e||!o&&t?g:Te(g,p,e,s,u),y=n?i||(o?e:h||r)?[]:a:v;if(n&&n(v,y,s,u),r)for(l=Te(y,d),r(l,[],s,u),c=l.length;c--;)(f=l[c])&&(y[d[c]]=!(v[d[c]]=f));if(o){if(i||e){if(i){for(l=[],c=y.length;c--;)(f=y[c])&&l.push(v[c]=f);i(null,y=[],l,u)}for(c=y.length;c--;)(f=y[c])&&(l=i?P(o,f):p[c])>-1&&(o[l]=!(a[l]=f))}}else y=Te(y===a?y.splice(h,y.length):y),i?i(null,a,y,u):H.apply(a,y)})}function Ee(e){for(var t,n,i,o=e.length,a=r.relative[e[0].type],s=a||r.relative[" "],u=a?1:0,c=be(function(e){return e===t},s,!0),f=be(function(e){return P(t,e)>-1},s,!0),p=[function(e,n,r){var i=!a&&(r||n!==l)||((t=n).nodeType?c(e,n,r):f(e,n,r));return t=null,i}];u<o;u++)if(n=r.relative[e[u].type])p=[be(we(p),n)];else{if((n=r.filter[e[u].type].apply(null,e[u].matches))[b]){for(i=++u;i<o&&!r.relative[e[i].type];i++);return Ce(u>1&&we(p),u>1&&xe(e.slice(0,u-1).concat({value:" "===e[u-2].type?"*":""})).replace($,"$1"),n,u<i&&Ee(e.slice(u,i)),i<o&&Ee(e=e.slice(i)),i<o&&xe(e))}p.push(n)}return we(p)}return me.prototype=r.filters=r.pseudos,r.setFilters=new me,a=se.tokenize=function(e,t){var n,i,o,a,s,u,l,c=S[e+" "];if(c)return t?0:c.slice(0);for(s=e,u=[],l=r.preFilter;s;){for(a in n&&!(i=_.exec(s))||(i&&(s=s.slice(i[0].length)||s),u.push(o=[])),n=!1,(i=z.exec(s))&&(n=i.shift(),o.push({value:n,type:i[0].replace($," ")}),s=s.slice(n.length)),r.filter)!(i=G[a].exec(s))||l[a]&&!(i=l[a](i))||(n=i.shift(),o.push({value:n,type:a,matches:i}),s=s.slice(n.length));if(!n)break}return t?s.length:s?se.error(e):S(e,u).slice(0)},s=se.compile=function(e,t){var n,i=[],o=[],s=k[e+" "];if(!s){for(t||(t=a(e)),n=t.length;n--;)(s=Ee(t[n]))[b]?i.push(s):o.push(s);(s=k(e,function(e,t){var n=t.length>0,i=e.length>0,o=function(o,a,s,u,c){var f,h,v,y=0,m="0",x=o&&[],b=[],w=l,C=o||i&&r.find.TAG("*",c),E=T+=null==w?1:Math.random()||.1,S=C.length;for(c&&(l=a==d||a||c);m!==S&&null!=(f=C[m]);m++){if(i&&f){for(h=0,a||f.ownerDocument==d||(p(f),s=!g);v=e[h++];)if(v(f,a||d,s)){u.push(f);break}c&&(T=E)}n&&((f=!v&&f)&&y--,o&&x.push(f))}if(y+=m,n&&m!==y){for(h=0;v=t[h++];)v(x,b,a,s);if(o){if(y>0)for(;m--;)x[m]||b[m]||(b[m]=q.call(u));b=Te(b)}H.apply(u,b),c&&!o&&b.length>0&&y+t.length>1&&se.uniqueSort(u)}return c&&(T=E,l=w),x};return n?le(o):o}(o,i))).selector=e}return s},u=se.select=function(e,t,n,i){var o,u,l,c,f,p="function"==typeof e&&e,d=!i&&a(e=p.selector||e);if(n=n||[],1===d.length){if((u=d[0]=d[0].slice(0)).length>2&&"ID"===(l=u[0]).type&&9===t.nodeType&&g&&r.relative[u[1].type]){if(!(t=(r.find.ID(l.matches[0].replace(te,ne),t)||[])[0]))return n;p&&(t=t.parentNode),e=e.slice(u.shift().value.length)}for(o=G.needsContext.test(e)?0:u.length;o--&&(l=u[o],!r.relative[c=l.type]);)if((f=r.find[c])&&(i=f(l.matches[0].replace(te,ne),ee.test(u[0].type)&&ye(t.parentNode)||t))){if(u.splice(o,1),!(e=i.length&&xe(u)))return H.apply(n,i),n;break}}return(p||s(e,d))(i,t,!g,n,!t||ee.test(e)&&ye(t.parentNode)||t),n},n.sortStable=b.split("").sort(N).join("")===b,n.detectDuplicates=!!f,p(),n.sortDetached=ce(function(e){return 1&e.compareDocumentPosition(d.createElement("fieldset"))}),ce(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||fe("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),n.attributes&&ce(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||fe("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),ce(function(e){return null==e.getAttribute("disabled")})||fe(R,function(e,t,n){var r;if(!n)return!0===e[t]?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),se}(t);w.find=C,w.expr=C.selectors,w.expr[":"]=w.expr.pseudos,w.uniqueSort=w.unique=C.uniqueSort,w.text=C.getText,w.isXMLDoc=C.isXML,w.contains=C.contains,w.escapeSelector=C.escape;var E=function(e,t,n){for(var r=[],i=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(i&&w(e).is(n))break;r.push(e)}return r},S=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},k=w.expr.match.needsContext;function A(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var N=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,t,n){return g(t)?w.grep(e,function(e,r){return!!t.call(e,r,e)!==n}):t.nodeType?w.grep(e,function(e){return e===t!==n}):"string"!=typeof t?w.grep(e,function(e){return u.call(t,e)>-1!==n}):w.filter(t,e,n)}w.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?w.find.matchesSelector(r,e)?[r]:[]:w.find.matches(e,w.grep(t,function(e){return 1===e.nodeType}))},w.fn.extend({find:function(e){var t,n,r=this.length,i=this;if("string"!=typeof e)return this.pushStack(w(e).filter(function(){for(t=0;t<r;t++)if(w.contains(i[t],this))return!0}));for(n=this.pushStack([]),t=0;t<r;t++)w.find(e,i[t],n);return r>1?w.uniqueSort(n):n},filter:function(e){return this.pushStack(j(this,e||[],!1))},not:function(e){return this.pushStack(j(this,e||[],!0))},is:function(e){return!!j(this,"string"==typeof e&&k.test(e)?w(e):e||[],!1).length}});var D,q=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(w.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||D,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:q.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof w?t[0]:t,w.merge(this,w.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:y,!0)),N.test(r[1])&&w.isPlainObject(t))for(r in t)g(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=y.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):g(e)?void 0!==n.ready?n.ready(e):e(w):w.makeArray(e,this)}).prototype=w.fn,D=w(y);var L=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}w.fn.extend({has:function(e){var t=w(e,this),n=t.length;return this.filter(function(){for(var e=0;e<n;e++)if(w.contains(this,t[e]))return!0})},closest:function(e,t){var n,r=0,i=this.length,o=[],a="string"!=typeof e&&w(e);if(!k.test(e))for(;r<i;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(a?a.index(n)>-1:1===n.nodeType&&w.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(o.length>1?w.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?u.call(w(e),this[0]):u.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(w.uniqueSort(w.merge(this.get(),w(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),w.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return E(e,"parentNode")},parentsUntil:function(e,t,n){return E(e,"parentNode",n)},next:function(e){return O(e,"nextSibling")},prev:function(e){return O(e,"previousSibling")},nextAll:function(e){return E(e,"nextSibling")},prevAll:function(e){return E(e,"previousSibling")},nextUntil:function(e,t,n){return E(e,"nextSibling",n)},prevUntil:function(e,t,n){return E(e,"previousSibling",n)},siblings:function(e){return S((e.parentNode||{}).firstChild,e)},children:function(e){return S(e.firstChild)},contents:function(e){return null!=e.contentDocument&&i(e.contentDocument)?e.contentDocument:(A(e,"template")&&(e=e.content||e),w.merge([],e.childNodes))}},function(e,t){w.fn[e]=function(n,r){var i=w.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=w.filter(r,i)),this.length>1&&(H[e]||w.uniqueSort(i),L.test(e)&&i.reverse()),this.pushStack(i)}});var P=/[^\x20\t\r\n\f]+/g;function R(e){return e}function M(e){throw e}function I(e,t,n,r){var i;try{e&&g(i=e.promise)?i.call(e).done(t).fail(n):e&&g(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}w.Callbacks=function(e){e="string"==typeof e?function(e){var t={};return w.each(e.match(P)||[],function(e,n){t[n]=!0}),t}(e):w.extend({},e);var t,n,r,i,o=[],a=[],s=-1,u=function(){for(i=i||e.once,r=t=!0;a.length;s=-1)for(n=a.shift();++s<o.length;)!1===o[s].apply(n[0],n[1])&&e.stopOnFalse&&(s=o.length,n=!1);e.memory||(n=!1),t=!1,i&&(o=n?[]:"")},l={add:function(){return o&&(n&&!t&&(s=o.length-1,a.push(n)),function t(n){w.each(n,function(n,r){g(r)?e.unique&&l.has(r)||o.push(r):r&&r.length&&"string"!==b(r)&&t(r)})}(arguments),n&&!t&&u()),this},remove:function(){return w.each(arguments,function(e,t){for(var n;(n=w.inArray(t,o,n))>-1;)o.splice(n,1),n<=s&&s--}),this},has:function(e){return e?w.inArray(e,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return i=a=[],o=n="",this},disabled:function(){return!o},lock:function(){return i=a=[],n||t||(o=n=""),this},locked:function(){return!!i},fireWith:function(e,n){return i||(n=[e,(n=n||[]).slice?n.slice():n],a.push(n),t||u()),this},fire:function(){return l.fireWith(this,arguments),this},fired:function(){return!!r}};return l},w.extend({Deferred:function(e){var n=[["notify","progress",w.Callbacks("memory"),w.Callbacks("memory"),2],["resolve","done",w.Callbacks("once memory"),w.Callbacks("once memory"),0,"resolved"],["reject","fail",w.Callbacks("once memory"),w.Callbacks("once memory"),1,"rejected"]],r="pending",i={state:function(){return r},always:function(){return o.done(arguments).fail(arguments),this},catch:function(e){return i.then(null,e)},pipe:function(){var e=arguments;return w.Deferred(function(t){w.each(n,function(n,r){var i=g(e[r[4]])&&e[r[4]];o[r[1]](function(){var e=i&&i.apply(this,arguments);e&&g(e.promise)?e.promise().progress(t.notify).done(t.resolve).fail(t.reject):t[r[0]+"With"](this,i?[e]:arguments)})}),e=null}).promise()},then:function(e,r,i){var o=0;function a(e,n,r,i){return function(){var s=this,u=arguments,l=function(){var t,l;if(!(e<o)){if((t=r.apply(s,u))===n.promise())throw new TypeError("Thenable self-resolution");l=t&&("object"==typeof t||"function"==typeof t)&&t.then,g(l)?i?l.call(t,a(o,n,R,i),a(o,n,M,i)):(o++,l.call(t,a(o,n,R,i),a(o,n,M,i),a(o,n,R,n.notifyWith))):(r!==R&&(s=void 0,u=[t]),(i||n.resolveWith)(s,u))}},c=i?l:function(){try{l()}catch(t){w.Deferred.exceptionHook&&w.Deferred.exceptionHook(t,c.stackTrace),e+1>=o&&(r!==M&&(s=void 0,u=[t]),n.rejectWith(s,u))}};e?c():(w.Deferred.getStackHook&&(c.stackTrace=w.Deferred.getStackHook()),t.setTimeout(c))}}return w.Deferred(function(t){n[0][3].add(a(0,t,g(i)?i:R,t.notifyWith)),n[1][3].add(a(0,t,g(e)?e:R)),n[2][3].add(a(0,t,g(r)?r:M))}).promise()},promise:function(e){return null!=e?w.extend(e,i):i}},o={};return w.each(n,function(e,t){var a=t[2],s=t[5];i[t[1]]=a.add,s&&a.add(function(){r=s},n[3-e][2].disable,n[3-e][3].disable,n[0][2].lock,n[0][3].lock),a.add(t[3].fire),o[t[0]]=function(){return o[t[0]+"With"](this===o?void 0:this,arguments),this},o[t[0]+"With"]=a.fireWith}),i.promise(o),e&&e.call(o,o),o},when:function(e){var t=arguments.length,n=t,r=Array(n),i=o.call(arguments),a=w.Deferred(),s=function(e){return function(n){r[e]=this,i[e]=arguments.length>1?o.call(arguments):n,--t||a.resolveWith(r,i)}};if(t<=1&&(I(e,a.done(s(n)).resolve,a.reject,!t),"pending"===a.state()||g(i[n]&&i[n].then)))return a.then();for(;n--;)I(i[n],s(n),a.reject);return a.promise()}});var W=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;w.Deferred.exceptionHook=function(e,n){t.console&&t.console.warn&&e&&W.test(e.name)&&t.console.warn("jQuery.Deferred exception: "+e.message,e.stack,n)},w.readyException=function(e){t.setTimeout(function(){throw e})};var F=w.Deferred();function B(){y.removeEventListener("DOMContentLoaded",B),t.removeEventListener("load",B),w.ready()}w.fn.ready=function(e){return F.then(e).catch(function(e){w.readyException(e)}),this},w.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--w.readyWait:w.isReady)||(w.isReady=!0,!0!==e&&--w.readyWait>0||F.resolveWith(y,[w]))}}),w.ready.then=F.then,"complete"===y.readyState||"loading"!==y.readyState&&!y.documentElement.doScroll?t.setTimeout(w.ready):(y.addEventListener("DOMContentLoaded",B),t.addEventListener("load",B));var $=function(e,t,n,r,i,o,a){var s=0,u=e.length,l=null==n;if("object"===b(n))for(s in i=!0,n)$(e,t,s,n[s],!0,o,a);else if(void 0!==r&&(i=!0,g(r)||(a=!0),l&&(a?(t.call(e,r),t=null):(l=t,t=function(e,t,n){return l.call(w(e),n)})),t))for(;s<u;s++)t(e[s],n,a?r:r.call(e[s],s,t(e[s],n)));return i?e:l?t.call(e):u?t(e[0],n):o},_=/^-ms-/,z=/-([a-z])/g;function U(e,t){return t.toUpperCase()}function X(e){return e.replace(_,"ms-").replace(z,U)}var V=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};function G(){this.expando=w.expando+G.uid++}G.uid=1,G.prototype={cache:function(e){var t=e[this.expando];return t||(t={},V(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,n){var r,i=this.cache(e);if("string"==typeof t)i[X(t)]=n;else for(r in t)i[X(r)]=t[r];return i},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][X(t)]},access:function(e,t,n){return void 0===t||t&&"string"==typeof t&&void 0===n?this.get(e,t):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,r=e[this.expando];if(void 0!==r){if(void 0!==t){n=(t=Array.isArray(t)?t.map(X):(t=X(t))in r?[t]:t.match(P)||[]).length;for(;n--;)delete r[t[n]]}(void 0===t||w.isEmptyObject(r))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!w.isEmptyObject(t)}};var Y=new G,Q=new G,J=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,K=/[A-Z]/g;function Z(e,t,n){var r;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace(K,"-$&").toLowerCase(),"string"==typeof(n=e.getAttribute(r))){try{n=function(e){return"true"===e||"false"!==e&&("null"===e?null:e===+e+""?+e:J.test(e)?JSON.parse(e):e)}(n)}catch(i){}Q.set(e,t,n)}else n=void 0;return n}w.extend({hasData:function(e){return Q.hasData(e)||Y.hasData(e)},data:function(e,t,n){return Q.access(e,t,n)},removeData:function(e,t){Q.remove(e,t)},_data:function(e,t,n){return Y.access(e,t,n)},_removeData:function(e,t){Y.remove(e,t)}}),w.fn.extend({data:function(e,t){var n,r,i,o=this[0],a=o&&o.attributes;if(void 0===e){if(this.length&&(i=Q.get(o),1===o.nodeType&&!Y.get(o,"hasDataAttrs"))){for(n=a.length;n--;)a[n]&&0===(r=a[n].name).indexOf("data-")&&(r=X(r.slice(5)),Z(o,r,i[r]));Y.set(o,"hasDataAttrs",!0)}return i}return"object"==typeof e?this.each(function(){Q.set(this,e)}):$(this,function(t){var n;if(o&&void 0===t)return void 0!==(n=Q.get(o,e))?n:void 0!==(n=Z(o,e))?n:void 0;this.each(function(){Q.set(this,e,t)})},null,t,arguments.length>1,null,!0)},removeData:function(e){return this.each(function(){Q.remove(this,e)})}}),w.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=Y.get(e,t),n&&(!r||Array.isArray(n)?r=Y.access(e,t,w.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=w.queue(e,t),r=n.length,i=n.shift(),o=w._queueHooks(e,t);"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,function(){w.dequeue(e,t)},o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return Y.get(e,n)||Y.access(e,n,{empty:w.Callbacks("once memory").add(function(){Y.remove(e,[t+"queue",n])})})}}),w.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length<n?w.queue(this[0],e):void 0===t?this:this.each(function(){var n=w.queue(this,e,t);w._queueHooks(this,e),"fx"===e&&"inprogress"!==n[0]&&w.dequeue(this,e)})},dequeue:function(e){return this.each(function(){w.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,i=w.Deferred(),o=this,a=this.length,s=function(){--r||i.resolveWith(o,[o])};for("string"!=typeof e&&(t=e,e=void 0),e=e||"fx";a--;)(n=Y.get(o[a],e+"queueHooks"))&&n.empty&&(r++,n.empty.add(s));return s(),i.promise(t)}});var ee=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,te=new RegExp("^(?:([+-])=|)("+ee+")([a-z%]*)$","i"),ne=["Top","Right","Bottom","Left"],re=y.documentElement,ie=function(e){return w.contains(e.ownerDocument,e)},oe={composed:!0};re.getRootNode&&(ie=function(e){return w.contains(e.ownerDocument,e)||e.getRootNode(oe)===e.ownerDocument});var ae=function(e,t){return"none"===(e=t||e).style.display||""===e.style.display&&ie(e)&&"none"===w.css(e,"display")};function se(e,t,n,r){var i,o,a=20,s=r?function(){return r.cur()}:function(){return w.css(e,t,"")},u=s(),l=n&&n[3]||(w.cssNumber[t]?"":"px"),c=e.nodeType&&(w.cssNumber[t]||"px"!==l&&+u)&&te.exec(w.css(e,t));if(c&&c[3]!==l){for(u/=2,l=l||c[3],c=+u||1;a--;)w.style(e,t,c+l),(1-o)*(1-(o=s()/u||.5))<=0&&(a=0),c/=o;c*=2,w.style(e,t,c+l),n=n||[]}return n&&(c=+c||+u||0,i=n[1]?c+(n[1]+1)*n[2]:+n[2],r&&(r.unit=l,r.start=c,r.end=i)),i}var ue={};function le(e){var t,n=e.ownerDocument,r=e.nodeName,i=ue[r];return i||(t=n.body.appendChild(n.createElement(r)),i=w.css(t,"display"),t.parentNode.removeChild(t),"none"===i&&(i="block"),ue[r]=i,i)}function ce(e,t){for(var n,r,i=[],o=0,a=e.length;o<a;o++)(r=e[o]).style&&(n=r.style.display,t?("none"===n&&(i[o]=Y.get(r,"display")||null,i[o]||(r.style.display="")),""===r.style.display&&ae(r)&&(i[o]=le(r))):"none"!==n&&(i[o]="none",Y.set(r,"display",n)));for(o=0;o<a;o++)null!=i[o]&&(e[o].style.display=i[o]);return e}w.fn.extend({show:function(){return ce(this,!0)},hide:function(){return ce(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){ae(this)?w(this).show():w(this).hide()})}});var fe,pe,de=/^(?:checkbox|radio)$/i,he=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,ge=/^$|^module$|\/(?:java|ecma)script/i;fe=y.createDocumentFragment().appendChild(y.createElement("div")),(pe=y.createElement("input")).setAttribute("type","radio"),pe.setAttribute("checked","checked"),pe.setAttribute("name","t"),fe.appendChild(pe),h.checkClone=fe.cloneNode(!0).cloneNode(!0).lastChild.checked,fe.innerHTML="<textarea>x</textarea>",h.noCloneChecked=!!fe.cloneNode(!0).lastChild.defaultValue,fe.innerHTML="<option></option>",h.option=!!fe.lastChild;var ve={thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};function ye(e,t){var n;return n=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?w.merge([e],n):n}function me(e,t){for(var n=0,r=e.length;n<r;n++)Y.set(e[n],"globalEval",!t||Y.get(t[n],"globalEval"))}ve.tbody=ve.tfoot=ve.colgroup=ve.caption=ve.thead,ve.th=ve.td,h.option||(ve.optgroup=ve.option=[1,"<select multiple='multiple'>","</select>"]);var xe=/<|&#?\w+;/;function be(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d<h;d++)if((o=e[d])||0===o)if("object"===b(o))w.merge(p,o.nodeType?[o]:o);else if(xe.test(o)){for(a=a||f.appendChild(t.createElement("div")),s=(he.exec(o)||["",""])[1].toLowerCase(),u=ve[s]||ve._default,a.innerHTML=u[1]+w.htmlPrefilter(o)+u[2],c=u[0];c--;)a=a.lastChild;w.merge(p,a.childNodes),(a=f.firstChild).textContent=""}else p.push(t.createTextNode(o));for(f.textContent="",d=0;o=p[d++];)if(r&&w.inArray(o,r)>-1)i&&i.push(o);else if(l=ie(o),a=ye(f.appendChild(o),"script"),l&&me(a),n)for(c=0;o=a[c++];)ge.test(o.type||"")&&n.push(o);return f}var we=/^([^.]*)(?:\.(.+)|)/;function Te(){return!0}function Ce(){return!1}function Ee(e,t){return e===function(){try{return y.activeElement}catch(e){}}()==("focus"===t)}function Se(e,t,n,r,i,o){var a,s;if("object"==typeof t){for(s in"string"!=typeof n&&(r=r||n,n=void 0),t)Se(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=Ce;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return w().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=w.guid++)),e.each(function(){w.event.add(this,t,i,r,n)})}function ke(e,t,n){n?(Y.set(e,t,!1),w.event.add(e,t,{namespace:!1,handler:function(e){var r,i,a=Y.get(this,t);if(1&e.isTrigger&&this[t]){if(a.length)(w.event.special[t]||{}).delegateType&&e.stopPropagation();else if(a=o.call(arguments),Y.set(this,t,a),r=n(this,t),this[t](),a!==(i=Y.get(this,t))||r?Y.set(this,t,!1):i={},a!==i)return e.stopImmediatePropagation(),e.preventDefault(),i&&i.value}else a.length&&(Y.set(this,t,{value:w.event.trigger(w.extend(a[0],w.Event.prototype),a.slice(1),this)}),e.stopImmediatePropagation())}})):void 0===Y.get(e,t)&&w.event.add(e,t,Te)}w.event={global:{},add:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Y.get(e);if(V(e))for(n.handler&&(n=(o=n).handler,i=o.selector),i&&w.find.matchesSelector(re,i),n.guid||(n.guid=w.guid++),(u=v.events)||(u=v.events=Object.create(null)),(a=v.handle)||(a=v.handle=function(t){return void 0!==w&&w.event.triggered!==t.type?w.event.dispatch.apply(e,arguments):void 0}),l=(t=(t||"").match(P)||[""]).length;l--;)d=g=(s=we.exec(t[l])||[])[1],h=(s[2]||"").split(".").sort(),d&&(f=w.event.special[d]||{},d=(i?f.delegateType:f.bindType)||d,f=w.event.special[d]||{},c=w.extend({type:d,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&w.expr.match.needsContext.test(i),namespace:h.join(".")},o),(p=u[d])||((p=u[d]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(e,r,h,a)||e.addEventListener&&e.addEventListener(d,a)),f.add&&(f.add.call(e,c),c.handler.guid||(c.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,c):p.push(c),w.event.global[d]=!0)},remove:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Y.hasData(e)&&Y.get(e);if(v&&(u=v.events)){for(l=(t=(t||"").match(P)||[""]).length;l--;)if(d=g=(s=we.exec(t[l])||[])[1],h=(s[2]||"").split(".").sort(),d){for(f=w.event.special[d]||{},p=u[d=(r?f.delegateType:f.bindType)||d]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;o--;)c=p[o],!i&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,f.remove&&f.remove.call(e,c));a&&!p.length&&(f.teardown&&!1!==f.teardown.call(e,h,v.handle)||w.removeEvent(e,d,v.handle),delete u[d])}else for(d in u)w.event.remove(e,d+t[l],n,r,!0);w.isEmptyObject(u)&&Y.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,a,s=new Array(arguments.length),u=w.event.fix(e),l=(Y.get(this,"events")||Object.create(null))[u.type]||[],c=w.event.special[u.type]||{};for(s[0]=u,t=1;t<arguments.length;t++)s[t]=arguments[t];if(u.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,u)){for(a=w.event.handlers.call(this,u,l),t=0;(i=a[t++])&&!u.isPropagationStopped();)for(u.currentTarget=i.elem,n=0;(o=i.handlers[n++])&&!u.isImmediatePropagationStopped();)u.rnamespace&&!1!==o.namespace&&!u.rnamespace.test(o.namespace)||(u.handleObj=o,u.data=o.data,void 0!==(r=((w.event.special[o.origType]||{}).handle||o.handler).apply(i.elem,s))&&!1===(u.result=r)&&(u.preventDefault(),u.stopPropagation()));return c.postDispatch&&c.postDispatch.call(this,u),u.result}},handlers:function(e,t){var n,r,i,o,a,s=[],u=t.delegateCount,l=e.target;if(u&&l.nodeType&&!("click"===e.type&&e.button>=1))for(;l!==this;l=l.parentNode||this)if(1===l.nodeType&&("click"!==e.type||!0!==l.disabled)){for(o=[],a={},n=0;n<u;n++)void 0===a[i=(r=t[n]).selector+" "]&&(a[i]=r.needsContext?w(i,this).index(l)>-1:w.find(i,this,null,[l]).length),a[i]&&o.push(r);o.length&&s.push({elem:l,handlers:o})}return l=this,u<t.length&&s.push({elem:l,handlers:t.slice(u)}),s},addProp:function(e,t){Object.defineProperty(w.Event.prototype,e,{enumerable:!0,configurable:!0,get:g(t)?function(){if(this.originalEvent)return t(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[e]},set:function(t){Object.defineProperty(this,e,{enumerable:!0,configurable:!0,writable:!0,value:t})}})},fix:function(e){return e[w.expando]?e:new w.Event(e)},special:{load:{noBubble:!0},click:{setup:function(e){var t=this||e;return de.test(t.type)&&t.click&&A(t,"input")&&ke(t,"click",Te),!1},trigger:function(e){var t=this||e;return de.test(t.type)&&t.click&&A(t,"input")&&ke(t,"click"),!0},_default:function(e){var t=e.target;return de.test(t.type)&&t.click&&A(t,"input")&&Y.get(t,"click")||A(t,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},w.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},w.Event=function(e,t){if(!(this instanceof w.Event))return new w.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?Te:Ce,this.target=e.target&&3===e.target.nodeType?e.target.parentNode:e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget):this.type=e,t&&w.extend(this,t),this.timeStamp=e&&e.timeStamp||Date.now(),this[w.expando]=!0},w.Event.prototype={constructor:w.Event,isDefaultPrevented:Ce,isPropagationStopped:Ce,isImmediatePropagationStopped:Ce,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=Te,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=Te,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=Te,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},w.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,char:!0,code:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:!0},w.event.addProp),w.each({focus:"focusin",blur:"focusout"},function(e,t){w.event.special[e]={setup:function(){return ke(this,e,Ee),!1},trigger:function(){return ke(this,e),!0},_default:function(){return!0},delegateType:t}}),w.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,t){w.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=e.relatedTarget,i=e.handleObj;return r&&(r===this||w.contains(this,r))||(e.type=i.origType,n=i.handler.apply(this,arguments),e.type=t),n}}}),w.fn.extend({on:function(e,t,n,r){return Se(this,e,t,n,r)},one:function(e,t,n,r){return Se(this,e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,w(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof e){for(i in e)this.off(i,t,e[i]);return this}return!1!==t&&"function"!=typeof t||(n=t,t=void 0),!1===n&&(n=Ce),this.each(function(){w.event.remove(this,e,n,t)})}});var Ae=/<script|<style|<link/i,Ne=/checked\s*(?:[^=]|=\s*.checked.)/i,je=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function De(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&w(e).children("tbody")[0]||e}function qe(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Le(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function He(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Y.hasData(e)&&(s=Y.get(e).events))for(i in Y.remove(t,"handle events"),s)for(n=0,r=s[i].length;n<r;n++)w.event.add(t,i,s[i][n]);Q.hasData(e)&&(o=Q.access(e),a=w.extend({},o),Q.set(t,a))}}function Oe(e,t,n,r){t=a(t);var i,o,s,u,l,c,f=0,p=e.length,d=p-1,v=t[0],y=g(v);if(y||p>1&&"string"==typeof v&&!h.checkClone&&Ne.test(v))return e.each(function(i){var o=e.eq(i);y&&(t[0]=v.call(this,i,o.html())),Oe(o,t,n,r)});if(p&&(o=(i=be(t,e[0].ownerDocument,!1,e,r)).firstChild,1===i.childNodes.length&&(i=o),o||r)){for(u=(s=w.map(ye(i,"script"),qe)).length;f<p;f++)l=i,f!==d&&(l=w.clone(l,!0,!0),u&&w.merge(s,ye(l,"script"))),n.call(e[f],l,f);if(u)for(c=s[s.length-1].ownerDocument,w.map(s,Le),f=0;f<u;f++)l=s[f],ge.test(l.type||"")&&!Y.access(l,"globalEval")&&w.contains(c,l)&&(l.src&&"module"!==(l.type||"").toLowerCase()?w._evalUrl&&!l.noModule&&w._evalUrl(l.src,{nonce:l.nonce||l.getAttribute("nonce")},c):x(l.textContent.replace(je,""),l,c))}return e}function Pe(e,t,n){for(var r,i=t?w.filter(t,e):e,o=0;null!=(r=i[o]);o++)n||1!==r.nodeType||w.cleanData(ye(r)),r.parentNode&&(n&&ie(r)&&me(ye(r,"script")),r.parentNode.removeChild(r));return e}w.extend({htmlPrefilter:function(e){return e},clone:function(e,t,n){var r,i,o,a,s,u,l,c=e.cloneNode(!0),f=ie(e);if(!(h.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||w.isXMLDoc(e)))for(a=ye(c),r=0,i=(o=ye(e)).length;r<i;r++)s=o[r],u=a[r],l=void 0,"input"===(l=u.nodeName.toLowerCase())&&de.test(s.type)?u.checked=s.checked:"input"!==l&&"textarea"!==l||(u.defaultValue=s.defaultValue);if(t)if(n)for(o=o||ye(e),a=a||ye(c),r=0,i=o.length;r<i;r++)He(o[r],a[r]);else He(e,c);return(a=ye(c,"script")).length>0&&me(a,!f&&ye(e,"script")),c},cleanData:function(e){for(var t,n,r,i=w.event.special,o=0;void 0!==(n=e[o]);o++)if(V(n)){if(t=n[Y.expando]){if(t.events)for(r in t.events)i[r]?w.event.remove(n,r):w.removeEvent(n,r,t.handle);n[Y.expando]=void 0}n[Q.expando]&&(n[Q.expando]=void 0)}}}),w.fn.extend({detach:function(e){return Pe(this,e,!0)},remove:function(e){return Pe(this,e)},text:function(e){return $(this,function(e){return void 0===e?w.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return Oe(this,arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||De(this,e).appendChild(e)})},prepend:function(){return Oe(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=De(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return Oe(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return Oe(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(w.cleanData(ye(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return w.clone(this,e,t)})},html:function(e){return $(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!Ae.test(e)&&!ve[(he.exec(e)||["",""])[1].toLowerCase()]){e=w.htmlPrefilter(e);try{for(;n<r;n++)1===(t=this[n]||{}).nodeType&&(w.cleanData(ye(t,!1)),t.innerHTML=e);t=0}catch(i){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=[];return Oe(this,arguments,function(t){var n=this.parentNode;w.inArray(this,e)<0&&(w.cleanData(ye(this)),n&&n.replaceChild(t,this))},e)}}),w.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){w.fn[e]=function(e){for(var n,r=[],i=w(e),o=i.length-1,a=0;a<=o;a++)n=a===o?this:this.clone(!0),w(i[a])[t](n),s.apply(r,n.get());return this.pushStack(r)}});var Re=new RegExp("^("+ee+")(?!px)[a-z%]+$","i"),Me=function(e){var n=e.ownerDocument.defaultView;return n&&n.opener||(n=t),n.getComputedStyle(e)},Ie=function(e,t,n){var r,i,o={};for(i in t)o[i]=e.style[i],e.style[i]=t[i];for(i in r=n.call(e),t)e.style[i]=o[i];return r},We=new RegExp(ne.join("|"),"i");function Fe(e,t,n){var r,i,o,a,s=e.style;return(n=n||Me(e))&&(""!==(a=n.getPropertyValue(t)||n[t])||ie(e)||(a=w.style(e,t)),!h.pixelBoxStyles()&&Re.test(a)&&We.test(t)&&(r=s.width,i=s.minWidth,o=s.maxWidth,s.minWidth=s.maxWidth=s.width=a,a=n.width,s.width=r,s.minWidth=i,s.maxWidth=o)),void 0!==a?a+"":a}function Be(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}!function(){function e(){if(c){l.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",c.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",re.appendChild(l).appendChild(c);var e=t.getComputedStyle(c);r="1%"!==e.top,u=12===n(e.marginLeft),c.style.right="60%",a=36===n(e.right),i=36===n(e.width),c.style.position="absolute",o=12===n(c.offsetWidth/3),re.removeChild(l),c=null}}function n(e){return Math.round(parseFloat(e))}var r,i,o,a,s,u,l=y.createElement("div"),c=y.createElement("div");c.style&&(c.style.backgroundClip="content-box",c.cloneNode(!0).style.backgroundClip="",h.clearCloneStyle="content-box"===c.style.backgroundClip,w.extend(h,{boxSizingReliable:function(){return e(),i},pixelBoxStyles:function(){return e(),a},pixelPosition:function(){return e(),r},reliableMarginLeft:function(){return e(),u},scrollboxSize:function(){return e(),o},reliableTrDimensions:function(){var e,n,r,i;return null==s&&(e=y.createElement("table"),n=y.createElement("tr"),r=y.createElement("div"),e.style.cssText="position:absolute;left:-11111px;border-collapse:separate",n.style.cssText="border:1px solid",n.style.height="1px",r.style.height="9px",r.style.display="block",re.appendChild(e).appendChild(n).appendChild(r),i=t.getComputedStyle(n),s=parseInt(i.height,10)+parseInt(i.borderTopWidth,10)+parseInt(i.borderBottomWidth,10)===n.offsetHeight,re.removeChild(e)),s}}))}();var $e=["Webkit","Moz","ms"],_e=y.createElement("div").style,ze={};function Ue(e){var t=w.cssProps[e]||ze[e];return t||(e in _e?e:ze[e]=function(e){for(var t=e[0].toUpperCase()+e.slice(1),n=$e.length;n--;)if((e=$e[n]+t)in _e)return e}(e)||e)}var Xe=/^(none|table(?!-c[ea]).+)/,Ve=/^--/,Ge={position:"absolute",visibility:"hidden",display:"block"},Ye={letterSpacing:"0",fontWeight:"400"};function Qe(e,t,n){var r=te.exec(t);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):t}function Je(e,t,n,r,i,o){var a="width"===t?1:0,s=0,u=0;if(n===(r?"border":"content"))return 0;for(;a<4;a+=2)"margin"===n&&(u+=w.css(e,n+ne[a],!0,i)),r?("content"===n&&(u-=w.css(e,"padding"+ne[a],!0,i)),"margin"!==n&&(u-=w.css(e,"border"+ne[a]+"Width",!0,i))):(u+=w.css(e,"padding"+ne[a],!0,i),"padding"!==n?u+=w.css(e,"border"+ne[a]+"Width",!0,i):s+=w.css(e,"border"+ne[a]+"Width",!0,i));return!r&&o>=0&&(u+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-o-u-s-.5))||0),u}function Ke(e,t,n){var r=Me(e),i=(!h.boxSizingReliable()||n)&&"border-box"===w.css(e,"boxSizing",!1,r),o=i,a=Fe(e,t,r),s="offset"+t[0].toUpperCase()+t.slice(1);if(Re.test(a)){if(!n)return a;a="auto"}return(!h.boxSizingReliable()&&i||!h.reliableTrDimensions()&&A(e,"tr")||"auto"===a||!parseFloat(a)&&"inline"===w.css(e,"display",!1,r))&&e.getClientRects().length&&(i="border-box"===w.css(e,"boxSizing",!1,r),(o=s in e)&&(a=e[s])),(a=parseFloat(a)||0)+Je(e,t,n||(i?"border":"content"),o,r,a)+"px"}function Ze(e,t,n,r,i){return new Ze.prototype.init(e,t,n,r,i)}w.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Fe(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,s=X(t),u=Ve.test(t),l=e.style;if(u||(t=Ue(s)),a=w.cssHooks[t]||w.cssHooks[s],void 0===n)return a&&"get"in a&&void 0!==(i=a.get(e,!1,r))?i:l[t];"string"===(o=typeof n)&&(i=te.exec(n))&&i[1]&&(n=se(e,t,i),o="number"),null!=n&&n==n&&("number"!==o||u||(n+=i&&i[3]||(w.cssNumber[s]?"":"px")),h.clearCloneStyle||""!==n||0!==t.indexOf("background")||(l[t]="inherit"),a&&"set"in a&&void 0===(n=a.set(e,n,r))||(u?l.setProperty(t,n):l[t]=n))}},css:function(e,t,n,r){var i,o,a,s=X(t);return Ve.test(t)||(t=Ue(s)),(a=w.cssHooks[t]||w.cssHooks[s])&&"get"in a&&(i=a.get(e,!0,n)),void 0===i&&(i=Fe(e,t,r)),"normal"===i&&t in Ye&&(i=Ye[t]),""===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),w.each(["height","width"],function(e,t){w.cssHooks[t]={get:function(e,n,r){if(n)return!Xe.test(w.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?Ke(e,t,r):Ie(e,Ge,function(){return Ke(e,t,r)})},set:function(e,n,r){var i,o=Me(e),a=!h.scrollboxSize()&&"absolute"===o.position,s=(a||r)&&"border-box"===w.css(e,"boxSizing",!1,o),u=r?Je(e,t,r,s,o):0;return s&&a&&(u-=Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-parseFloat(o[t])-Je(e,t,"border",!1,o)-.5)),u&&(i=te.exec(n))&&"px"!==(i[3]||"px")&&(e.style[t]=n,n=w.css(e,t)),Qe(0,n,u)}}}),w.cssHooks.marginLeft=Be(h.reliableMarginLeft,function(e,t){if(t)return(parseFloat(Fe(e,"marginLeft"))||e.getBoundingClientRect().left-Ie(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px"}),w.each({margin:"",padding:"",border:"Width"},function(e,t){w.cssHooks[e+t]={expand:function(n){for(var r=0,i={},o="string"==typeof n?n.split(" "):[n];r<4;r++)i[e+ne[r]+t]=o[r]||o[r-2]||o[0];return i}},"margin"!==e&&(w.cssHooks[e+t].set=Qe)}),w.fn.extend({css:function(e,t){return $(this,function(e,t,n){var r,i,o={},a=0;if(Array.isArray(t)){for(r=Me(e),i=t.length;a<i;a++)o[t[a]]=w.css(e,t[a],!1,r);return o}return void 0!==n?w.style(e,t,n):w.css(e,t)},e,t,arguments.length>1)}}),w.Tween=Ze,Ze.prototype={constructor:Ze,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||w.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(w.cssNumber[n]?"":"px")},cur:function(){var e=Ze.propHooks[this.prop];return e&&e.get?e.get(this):Ze.propHooks._default.get(this)},run:function(e){var t,n=Ze.propHooks[this.prop];return this.options.duration?this.pos=t=w.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):Ze.propHooks._default.set(this),this}},Ze.prototype.init.prototype=Ze.prototype,Ze.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=w.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){w.fx.step[e.prop]?w.fx.step[e.prop](e):1!==e.elem.nodeType||!w.cssHooks[e.prop]&&null==e.elem.style[Ue(e.prop)]?e.elem[e.prop]=e.now:w.style(e.elem,e.prop,e.now+e.unit)}}},Ze.propHooks.scrollTop=Ze.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},w.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},w.fx=Ze.prototype.init,w.fx.step={};var et,tt,nt=/^(?:toggle|show|hide)$/,rt=/queueHooks$/;function it(){tt&&(!1===y.hidden&&t.requestAnimationFrame?t.requestAnimationFrame(it):t.setTimeout(it,w.fx.interval),w.fx.tick())}function ot(){return t.setTimeout(function(){et=void 0}),et=Date.now()}function at(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)i["margin"+(n=ne[r])]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function st(e,t,n){for(var r,i=(ut.tweeners[t]||[]).concat(ut.tweeners["*"]),o=0,a=i.length;o<a;o++)if(r=i[o].call(n,t,e))return r}function ut(e,t,n){var r,i,o=0,a=ut.prefilters.length,s=w.Deferred().always(function(){delete u.elem}),u=function(){if(i)return!1;for(var t=et||ot(),n=Math.max(0,l.startTime+l.duration-t),r=1-(n/l.duration||0),o=0,a=l.tweens.length;o<a;o++)l.tweens[o].run(r);return s.notifyWith(e,[l,r,n]),r<1&&a?n:(a||s.notifyWith(e,[l,1,0]),s.resolveWith(e,[l]),!1)},l=s.promise({elem:e,props:w.extend({},t),opts:w.extend(!0,{specialEasing:{},easing:w.easing._default},n),originalProperties:t,originalOptions:n,startTime:et||ot(),duration:n.duration,tweens:[],createTween:function(t,n){var r=w.Tween(e,l.opts,t,n,l.opts.specialEasing[t]||l.opts.easing);return l.tweens.push(r),r},stop:function(t){var n=0,r=t?l.tweens.length:0;if(i)return this;for(i=!0;n<r;n++)l.tweens[n].run(1);return t?(s.notifyWith(e,[l,1,0]),s.resolveWith(e,[l,t])):s.rejectWith(e,[l,t]),this}}),c=l.props;for(!function(e,t){var n,r,i,o,a;for(n in e)if(i=t[r=X(n)],o=e[n],Array.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),(a=w.cssHooks[r])&&"expand"in a)for(n in o=a.expand(o),delete e[r],o)n in e||(e[n]=o[n],t[n]=i);else t[r]=i}(c,l.opts.specialEasing);o<a;o++)if(r=ut.prefilters[o].call(l,e,c,l.opts))return g(r.stop)&&(w._queueHooks(l.elem,l.opts.queue).stop=r.stop.bind(r)),r;return w.map(c,st,l),g(l.opts.start)&&l.opts.start.call(e,l),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always),w.fx.timer(w.extend(u,{elem:e,anim:l,queue:l.opts.queue})),l}w.Animation=w.extend(ut,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return se(n.elem,e,te.exec(t),n),n}]},tweener:function(e,t){g(e)?(t=e,e=["*"]):e=e.match(P);for(var n,r=0,i=e.length;r<i;r++)n=e[r],ut.tweeners[n]=ut.tweeners[n]||[],ut.tweeners[n].unshift(t)},prefilters:[function(e,t,n){var r,i,o,a,s,u,l,c,f="width"in t||"height"in t,p=this,d={},h=e.style,g=e.nodeType&&ae(e),v=Y.get(e,"fxshow");for(r in n.queue||(null==(a=w._queueHooks(e,"fx")).unqueued&&(a.unqueued=0,s=a.empty.fire,a.empty.fire=function(){a.unqueued||s()}),a.unqueued++,p.always(function(){p.always(function(){a.unqueued--,w.queue(e,"fx").length||a.empty.fire()})})),t)if(i=t[r],nt.test(i)){if(delete t[r],o=o||"toggle"===i,i===(g?"hide":"show")){if("show"!==i||!v||void 0===v[r])continue;g=!0}d[r]=v&&v[r]||w.style(e,r)}if((u=!w.isEmptyObject(t))||!w.isEmptyObject(d))for(r in f&&1===e.nodeType&&(n.overflow=[h.overflow,h.overflowX,h.overflowY],null==(l=v&&v.display)&&(l=Y.get(e,"display")),"none"===(c=w.css(e,"display"))&&(l?c=l:(ce([e],!0),l=e.style.display||l,c=w.css(e,"display"),ce([e]))),("inline"===c||"inline-block"===c&&null!=l)&&"none"===w.css(e,"float")&&(u||(p.done(function(){h.display=l}),null==l&&(c=h.display,l="none"===c?"":c)),h.display="inline-block")),n.overflow&&(h.overflow="hidden",p.always(function(){h.overflow=n.overflow[0],h.overflowX=n.overflow[1],h.overflowY=n.overflow[2]})),u=!1,d)u||(v?"hidden"in v&&(g=v.hidden):v=Y.access(e,"fxshow",{display:l}),o&&(v.hidden=!g),g&&ce([e],!0),p.done(function(){for(r in g||ce([e]),Y.remove(e,"fxshow"),d)w.style(e,r,d[r])})),u=st(g?v[r]:0,r,p),r in v||(v[r]=u.start,g&&(u.end=u.start,u.start=0))}],prefilter:function(e,t){t?ut.prefilters.unshift(e):ut.prefilters.push(e)}}),w.speed=function(e,t,n){var r=e&&"object"==typeof e?w.extend({},e):{complete:n||!n&&t||g(e)&&e,duration:e,easing:n&&t||t&&!g(t)&&t};return w.fx.off?r.duration=0:"number"!=typeof r.duration&&(r.duration in w.fx.speeds?r.duration=w.fx.speeds[r.duration]:r.duration=w.fx.speeds._default),null!=r.queue&&!0!==r.queue||(r.queue="fx"),r.old=r.complete,r.complete=function(){g(r.old)&&r.old.call(this),r.queue&&w.dequeue(this,r.queue)},r},w.fn.extend({fadeTo:function(e,t,n,r){return this.filter(ae).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=w.isEmptyObject(e),o=w.speed(t,n,r),a=function(){var t=ut(this,w.extend({},e),o);(i||Y.get(this,"finish"))&&t.stop(!0)};return a.finish=a,i||!1===o.queue?this.each(a):this.queue(o.queue,a)},stop:function(e,t,n){var r=function(e){var t=e.stop;delete e.stop,t(n)};return"string"!=typeof e&&(n=t,t=e,e=void 0),t&&this.queue(e||"fx",[]),this.each(function(){var t=!0,i=null!=e&&e+"queueHooks",o=w.timers,a=Y.get(this);if(i)a[i]&&a[i].stop&&r(a[i]);else for(i in a)a[i]&&a[i].stop&&rt.test(i)&&r(a[i]);for(i=o.length;i--;)o[i].elem!==this||null!=e&&o[i].queue!==e||(o[i].anim.stop(n),t=!1,o.splice(i,1));!t&&n||w.dequeue(this,e)})},finish:function(e){return!1!==e&&(e=e||"fx"),this.each(function(){var t,n=Y.get(this),r=n[e+"queue"],i=n[e+"queueHooks"],o=w.timers,a=r?r.length:0;for(n.finish=!0,w.queue(this,e,[]),i&&i.stop&&i.stop.call(this,!0),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;t<a;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish})}}),w.each(["toggle","show","hide"],function(e,t){var n=w.fn[t];w.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(at(t,!0),e,r,i)}}),w.each({slideDown:at("show"),slideUp:at("hide"),slideToggle:at("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){w.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),w.timers=[],w.fx.tick=function(){var e,t=0,n=w.timers;for(et=Date.now();t<n.length;t++)(e=n[t])()||n[t]!==e||n.splice(t--,1);n.length||w.fx.stop(),et=void 0},w.fx.timer=function(e){w.timers.push(e),w.fx.start()},w.fx.interval=13,w.fx.start=function(){tt||(tt=!0,it())},w.fx.stop=function(){tt=null},w.fx.speeds={slow:600,fast:200,_default:400},w.fn.delay=function(e,n){return e=w.fx&&w.fx.speeds[e]||e,n=n||"fx",this.queue(n,function(n,r){var i=t.setTimeout(n,e);r.stop=function(){t.clearTimeout(i)}})},function(){var e=y.createElement("input"),t=y.createElement("select").appendChild(y.createElement("option"));e.type="checkbox",h.checkOn=""!==e.value,h.optSelected=t.selected,(e=y.createElement("input")).value="t",e.type="radio",h.radioValue="t"===e.value}();var lt,ct=w.expr.attrHandle;w.fn.extend({attr:function(e,t){return $(this,w.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){w.removeAttr(this,e)})}}),w.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return void 0===e.getAttribute?w.prop(e,t,n):(1===o&&w.isXMLDoc(e)||(i=w.attrHooks[t.toLowerCase()]||(w.expr.match.bool.test(t)?lt:void 0)),void 0!==n?null===n?void w.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:null==(r=w.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!h.radioValue&&"radio"===t&&A(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,i=t&&t.match(P);if(i&&1===e.nodeType)for(;n=i[r++];)e.removeAttribute(n)}}),lt={set:function(e,t,n){return!1===t?w.removeAttr(e,n):e.setAttribute(n,n),n}},w.each(w.expr.match.bool.source.match(/\w+/g),function(e,t){var n=ct[t]||w.find.attr;ct[t]=function(e,t,r){var i,o,a=t.toLowerCase();return r||(o=ct[a],ct[a]=i,i=null!=n(e,t,r)?a:null,ct[a]=o),i}});var ft=/^(?:input|select|textarea|button)$/i,pt=/^(?:a|area)$/i;function dt(e){return(e.match(P)||[]).join(" ")}function ht(e){return e.getAttribute&&e.getAttribute("class")||""}function gt(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(P)||[]}w.fn.extend({prop:function(e,t){return $(this,w.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each(function(){delete this[w.propFix[e]||e]})}}),w.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&w.isXMLDoc(e)||(t=w.propFix[t]||t,i=w.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=w.find.attr(e,"tabindex");return t?parseInt(t,10):ft.test(e.nodeName)||pt.test(e.nodeName)&&e.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),h.optSelected||(w.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),w.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){w.propFix[this.toLowerCase()]=this}),w.fn.extend({addClass:function(e){var t,n,r,i,o,a,s,u=0;if(g(e))return this.each(function(t){w(this).addClass(e.call(this,t,ht(this)))});if((t=gt(e)).length)for(;n=this[u++];)if(i=ht(n),r=1===n.nodeType&&" "+dt(i)+" "){for(a=0;o=t[a++];)r.indexOf(" "+o+" ")<0&&(r+=o+" ");i!==(s=dt(r))&&n.setAttribute("class",s)}return this},removeClass:function(e){var t,n,r,i,o,a,s,u=0;if(g(e))return this.each(function(t){w(this).removeClass(e.call(this,t,ht(this)))});if(!arguments.length)return this.attr("class","");if((t=gt(e)).length)for(;n=this[u++];)if(i=ht(n),r=1===n.nodeType&&" "+dt(i)+" "){for(a=0;o=t[a++];)for(;r.indexOf(" "+o+" ")>-1;)r=r.replace(" "+o+" "," ");i!==(s=dt(r))&&n.setAttribute("class",s)}return this},toggleClass:function(e,t){var n=typeof e,r="string"===n||Array.isArray(e);return"boolean"==typeof t&&r?t?this.addClass(e):this.removeClass(e):g(e)?this.each(function(n){w(this).toggleClass(e.call(this,n,ht(this),t),t)}):this.each(function(){var t,i,o,a;if(r)for(i=0,o=w(this),a=gt(e);t=a[i++];)o.hasClass(t)?o.removeClass(t):o.addClass(t);else void 0!==e&&"boolean"!==n||((t=ht(this))&&Y.set(this,"__className__",t),this.setAttribute&&this.setAttribute("class",t||!1===e?"":Y.get(this,"__className__")||""))})},hasClass:function(e){var t,n,r=0;for(t=" "+e+" ";n=this[r++];)if(1===n.nodeType&&(" "+dt(ht(n))+" ").indexOf(t)>-1)return!0;return!1}});var vt=/\r/g;w.fn.extend({val:function(e){var t,n,r,i=this[0];return arguments.length?(r=g(e),this.each(function(n){var i;1===this.nodeType&&(null==(i=r?e.call(this,n,w(this).val()):e)?i="":"number"==typeof i?i+="":Array.isArray(i)&&(i=w.map(i,function(e){return null==e?"":e+""})),(t=w.valHooks[this.type]||w.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))})):i?(t=w.valHooks[i.type]||w.valHooks[i.nodeName.toLowerCase()])&&"get"in t&&void 0!==(n=t.get(i,"value"))?n:"string"==typeof(n=i.value)?n.replace(vt,""):null==n?"":n:void 0}}),w.extend({valHooks:{option:{get:function(e){var t=w.find.attr(e,"value");return null!=t?t:dt(w.text(e))}},select:{get:function(e){var t,n,r,i=e.options,o=e.selectedIndex,a="select-one"===e.type,s=a?null:[],u=a?o+1:i.length;for(r=o<0?u:a?o:0;r<u;r++)if(((n=i[r]).selected||r===o)&&!n.disabled&&(!n.parentNode.disabled||!A(n.parentNode,"optgroup"))){if(t=w(n).val(),a)return t;s.push(t)}return s},set:function(e,t){for(var n,r,i=e.options,o=w.makeArray(t),a=i.length;a--;)((r=i[a]).selected=w.inArray(w.valHooks.option.get(r),o)>-1)&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),w.each(["radio","checkbox"],function(){w.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=w.inArray(w(e).val(),t)>-1}},h.checkOn||(w.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}),h.focusin="onfocusin"in t;var yt=/^(?:focusinfocus|focusoutblur)$/,mt=function(e){e.stopPropagation()};w.extend(w.event,{trigger:function(e,n,r,i){var o,a,s,u,l,c,p,d,h=[r||y],m=f.call(e,"type")?e.type:e,x=f.call(e,"namespace")?e.namespace.split("."):[];if(a=d=s=r=r||y,3!==r.nodeType&&8!==r.nodeType&&!yt.test(m+w.event.triggered)&&(m.indexOf(".")>-1&&(x=m.split("."),m=x.shift(),x.sort()),l=m.indexOf(":")<0&&"on"+m,(e=e[w.expando]?e:new w.Event(m,"object"==typeof e&&e)).isTrigger=i?2:3,e.namespace=x.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+x.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=r),n=null==n?[e]:w.makeArray(n,[e]),p=w.event.special[m]||{},i||!p.trigger||!1!==p.trigger.apply(r,n))){if(!i&&!p.noBubble&&!v(r)){for(u=p.delegateType||m,yt.test(u+m)||(a=a.parentNode);a;a=a.parentNode)h.push(a),s=a;s===(r.ownerDocument||y)&&h.push(s.defaultView||s.parentWindow||t)}for(o=0;(a=h[o++])&&!e.isPropagationStopped();)d=a,e.type=o>1?u:p.bindType||m,(c=(Y.get(a,"events")||Object.create(null))[e.type]&&Y.get(a,"handle"))&&c.apply(a,n),(c=l&&a[l])&&c.apply&&V(a)&&(e.result=c.apply(a,n),!1===e.result&&e.preventDefault());return e.type=m,i||e.isDefaultPrevented()||p._default&&!1!==p._default.apply(h.pop(),n)||!V(r)||l&&g(r[m])&&!v(r)&&((s=r[l])&&(r[l]=null),w.event.triggered=m,e.isPropagationStopped()&&d.addEventListener(m,mt),r[m](),e.isPropagationStopped()&&d.removeEventListener(m,mt),w.event.triggered=void 0,s&&(r[l]=s)),e.result}},simulate:function(e,t,n){var r=w.extend(new w.Event,n,{type:e,isSimulated:!0});w.event.trigger(r,null,t)}}),w.fn.extend({trigger:function(e,t){return this.each(function(){w.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return w.event.trigger(e,t,n,!0)}}),h.focusin||w.each({focus:"focusin",blur:"focusout"},function(e,t){var n=function(e){w.event.simulate(t,e.target,w.event.fix(e))};w.event.special[t]={setup:function(){var r=this.ownerDocument||this.document||this,i=Y.access(r,t);i||r.addEventListener(e,n,!0),Y.access(r,t,(i||0)+1)},teardown:function(){var r=this.ownerDocument||this.document||this,i=Y.access(r,t)-1;i?Y.access(r,t,i):(r.removeEventListener(e,n,!0),Y.remove(r,t))}}});var xt=t.location,bt={guid:Date.now()},wt=/\?/;w.parseXML=function(e){var n,r;if(!e||"string"!=typeof e)return null;try{n=(new t.DOMParser).parseFromString(e,"text/xml")}catch(i){}return r=n&&n.getElementsByTagName("parsererror")[0],n&&!r||w.error("Invalid XML: "+(r?w.map(r.childNodes,function(e){return e.textContent}).join("\n"):e)),n};var Tt=/\[\]$/,Ct=/\r?\n/g,Et=/^(?:submit|button|image|reset|file)$/i,St=/^(?:input|select|textarea|keygen)/i;function kt(e,t,n,r){var i;if(Array.isArray(t))w.each(t,function(t,i){n||Tt.test(e)?r(e,i):kt(e+"["+("object"==typeof i&&null!=i?t:"")+"]",i,n,r)});else if(n||"object"!==b(t))r(e,t);else for(i in t)kt(e+"["+i+"]",t[i],n,r)}w.param=function(e,t){var n,r=[],i=function(e,t){var n=g(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(null==e)return"";if(Array.isArray(e)||e.jquery&&!w.isPlainObject(e))w.each(e,function(){i(this.name,this.value)});else for(n in e)kt(n,e[n],t,i);return r.join("&")},w.fn.extend({serialize:function(){return w.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=w.prop(this,"elements");return e?w.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!w(this).is(":disabled")&&St.test(this.nodeName)&&!Et.test(e)&&(this.checked||!de.test(e))}).map(function(e,t){var n=w(this).val();return null==n?null:Array.isArray(n)?w.map(n,function(e){return{name:t.name,value:e.replace(Ct,"\r\n")}}):{name:t.name,value:n.replace(Ct,"\r\n")}}).get()}});var At=/%20/g,Nt=/#.*$/,jt=/([?&])_=[^&]*/,Dt=/^(.*?):[ \t]*([^\r\n]*)$/gm,qt=/^(?:GET|HEAD)$/,Lt=/^\/\//,Ht={},Ot={},Pt="*/".concat("*"),Rt=y.createElement("a");function Mt(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(P)||[];if(g(n))for(;r=o[i++];)"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function It(e,t,n,r){var i={},o=e===Ot;function a(s){var u;return i[s]=!0,w.each(e[s]||[],function(e,s){var l=s(t,n,r);return"string"!=typeof l||o||i[l]?o?!(u=l):void 0:(t.dataTypes.unshift(l),a(l),!1)}),u}return a(t.dataTypes[0])||!i["*"]&&a("*")}function Wt(e,t){var n,r,i=w.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&w.extend(!0,e,r),e}Rt.href=xt.href,w.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:xt.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(xt.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Pt,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":w.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Wt(Wt(e,w.ajaxSettings),t):Wt(w.ajaxSettings,e)},ajaxPrefilter:Mt(Ht),ajaxTransport:Mt(Ot),ajax:function(e,n){"object"==typeof e&&(n=e,e=void 0),n=n||{};var r,i,o,a,s,u,l,c,f,p,d=w.ajaxSetup({},n),h=d.context||d,g=d.context&&(h.nodeType||h.jquery)?w(h):w.event,v=w.Deferred(),m=w.Callbacks("once memory"),x=d.statusCode||{},b={},T={},C="canceled",E={readyState:0,getResponseHeader:function(e){var t;if(l){if(!a)for(a={};t=Dt.exec(o);)a[t[1].toLowerCase()+" "]=(a[t[1].toLowerCase()+" "]||[]).concat(t[2]);t=a[e.toLowerCase()+" "]}return null==t?null:t.join(", ")},getAllResponseHeaders:function(){return l?o:null},setRequestHeader:function(e,t){return null==l&&(e=T[e.toLowerCase()]=T[e.toLowerCase()]||e,b[e]=t),this},overrideMimeType:function(e){return null==l&&(d.mimeType=e),this},statusCode:function(e){var t;if(e)if(l)E.always(e[E.status]);else for(t in e)x[t]=[x[t],e[t]];return this},abort:function(e){var t=e||C;return r&&r.abort(t),S(0,t),this}};if(v.promise(E),d.url=((e||d.url||xt.href)+"").replace(Lt,xt.protocol+"//"),d.type=n.method||n.type||d.method||d.type,d.dataTypes=(d.dataType||"*").toLowerCase().match(P)||[""],null==d.crossDomain){u=y.createElement("a");try{u.href=d.url,u.href=u.href,d.crossDomain=Rt.protocol+"//"+Rt.host!=u.protocol+"//"+u.host}catch(k){d.crossDomain=!0}}if(d.data&&d.processData&&"string"!=typeof d.data&&(d.data=w.param(d.data,d.traditional)),It(Ht,d,n,E),l)return E;for(f in(c=w.event&&d.global)&&0==w.active++&&w.event.trigger("ajaxStart"),d.type=d.type.toUpperCase(),d.hasContent=!qt.test(d.type),i=d.url.replace(Nt,""),d.hasContent?d.data&&d.processData&&0===(d.contentType||"").indexOf("application/x-www-form-urlencoded")&&(d.data=d.data.replace(At,"+")):(p=d.url.slice(i.length),d.data&&(d.processData||"string"==typeof d.data)&&(i+=(wt.test(i)?"&":"?")+d.data,delete d.data),!1===d.cache&&(i=i.replace(jt,"$1"),p=(wt.test(i)?"&":"?")+"_="+bt.guid+++p),d.url=i+p),d.ifModified&&(w.lastModified[i]&&E.setRequestHeader("If-Modified-Since",w.lastModified[i]),w.etag[i]&&E.setRequestHeader("If-None-Match",w.etag[i])),(d.data&&d.hasContent&&!1!==d.contentType||n.contentType)&&E.setRequestHeader("Content-Type",d.contentType),E.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+("*"!==d.dataTypes[0]?", "+Pt+"; q=0.01":""):d.accepts["*"]),d.headers)E.setRequestHeader(f,d.headers[f]);if(d.beforeSend&&(!1===d.beforeSend.call(h,E,d)||l))return E.abort();if(C="abort",m.add(d.complete),E.done(d.success),E.fail(d.error),r=It(Ot,d,n,E)){if(E.readyState=1,c&&g.trigger("ajaxSend",[E,d]),l)return E;d.async&&d.timeout>0&&(s=t.setTimeout(function(){E.abort("timeout")},d.timeout));try{l=!1,r.send(b,S)}catch(k){if(l)throw k;S(-1,k)}}else S(-1,"No Transport");function S(e,n,a,u){var f,p,y,b,T,C=n;l||(l=!0,s&&t.clearTimeout(s),r=void 0,o=u||"",E.readyState=e>0?4:0,f=e>=200&&e<300||304===e,a&&(b=function(e,t,n){for(var r,i,o,a,s=e.contents,u=e.dataTypes;"*"===u[0];)u.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in s)if(s[i]&&s[i].test(r)){u.unshift(i);break}if(u[0]in n)o=u[0];else{for(i in n){if(!u[0]||e.converters[i+" "+u[0]]){o=i;break}a||(a=i)}o=o||a}if(o)return o!==u[0]&&u.unshift(o),n[o]}(d,E,a)),!f&&w.inArray("script",d.dataTypes)>-1&&w.inArray("json",d.dataTypes)<0&&(d.converters["text script"]=function(){}),b=function(e,t,n,r){var i,o,a,s,u,l={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)l[a.toLowerCase()]=e.converters[a];for(o=c.shift();o;)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!u&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u=o,o=c.shift())if("*"===o)o=u;else if("*"!==u&&u!==o){if(!(a=l[u+" "+o]||l["* "+o]))for(i in l)if((s=i.split(" "))[1]===o&&(a=l[u+" "+s[0]]||l["* "+s[0]])){!0===a?a=l[i]:!0!==l[i]&&(o=s[0],c.unshift(s[1]));break}if(!0!==a)if(a&&e.throws)t=a(t);else try{t=a(t)}catch(k){return{state:"parsererror",error:a?k:"No conversion from "+u+" to "+o}}}return{state:"success",data:t}}(d,b,E,f),f?(d.ifModified&&((T=E.getResponseHeader("Last-Modified"))&&(w.lastModified[i]=T),(T=E.getResponseHeader("etag"))&&(w.etag[i]=T)),204===e||"HEAD"===d.type?C="nocontent":304===e?C="notmodified":(C=b.state,p=b.data,f=!(y=b.error))):(y=C,!e&&C||(C="error",e<0&&(e=0))),E.status=e,E.statusText=(n||C)+"",f?v.resolveWith(h,[p,C,E]):v.rejectWith(h,[E,C,y]),E.statusCode(x),x=void 0,c&&g.trigger(f?"ajaxSuccess":"ajaxError",[E,d,f?p:y]),m.fireWith(h,[E,C]),c&&(g.trigger("ajaxComplete",[E,d]),--w.active||w.event.trigger("ajaxStop")))}return E},getJSON:function(e,t,n){return w.get(e,t,n,"json")},getScript:function(e,t){return w.get(e,void 0,t,"script")}}),w.each(["get","post"],function(e,t){w[t]=function(e,n,r,i){return g(n)&&(i=i||r,r=n,n=void 0),w.ajax(w.extend({url:e,type:t,dataType:i,data:n,success:r},w.isPlainObject(e)&&e))}}),w.ajaxPrefilter(function(e){var t;for(t in e.headers)"content-type"===t.toLowerCase()&&(e.contentType=e.headers[t]||"")}),w._evalUrl=function(e,t,n){return w.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(e){w.globalEval(e,t,n)}})},w.fn.extend({wrapAll:function(e){var t;return this[0]&&(g(e)&&(e=e.call(this[0])),t=w(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(e){return g(e)?this.each(function(t){w(this).wrapInner(e.call(this,t))}):this.each(function(){var t=w(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=g(e);return this.each(function(n){w(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(e){return this.parent(e).not("body").each(function(){w(this).replaceWith(this.childNodes)}),this}}),w.expr.pseudos.hidden=function(e){return!w.expr.pseudos.visible(e)},w.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},w.ajaxSettings.xhr=function(){try{return new t.XMLHttpRequest}catch(e){}};var Ft={0:200,1223:204},Bt=w.ajaxSettings.xhr();h.cors=!!Bt&&"withCredentials"in Bt,h.ajax=Bt=!!Bt,w.ajaxTransport(function(e){var n,r;if(h.cors||Bt&&!e.crossDomain)return{send:function(i,o){var a,s=e.xhr();if(s.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(a in e.xhrFields)s[a]=e.xhrFields[a];for(a in e.mimeType&&s.overrideMimeType&&s.overrideMimeType(e.mimeType),e.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest"),i)s.setRequestHeader(a,i[a]);n=function(e){return function(){n&&(n=r=s.onload=s.onerror=s.onabort=s.ontimeout=s.onreadystatechange=null,"abort"===e?s.abort():"error"===e?"number"!=typeof s.status?o(0,"error"):o(s.status,s.statusText):o(Ft[s.status]||s.status,s.statusText,"text"!==(s.responseType||"text")||"string"!=typeof s.responseText?{binary:s.response}:{text:s.responseText},s.getAllResponseHeaders()))}},s.onload=n(),r=s.onerror=s.ontimeout=n("error"),void 0!==s.onabort?s.onabort=r:s.onreadystatechange=function(){4===s.readyState&&t.setTimeout(function(){n&&r()})},n=n("abort");try{s.send(e.hasContent&&e.data||null)}catch(u){if(n)throw u}},abort:function(){n&&n()}}}),w.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),w.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return w.globalEval(e),e}}}),w.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),w.ajaxTransport("script",function(e){var t,n;if(e.crossDomain||e.scriptAttrs)return{send:function(r,i){t=w("<script>").attr(e.scriptAttrs||{}).prop({charset:e.scriptCharset,src:e.url}).on("load error",n=function(e){t.remove(),n=null,e&&i("error"===e.type?404:200,e.type)}),y.head.appendChild(t[0])},abort:function(){n&&n()}}});var $t,_t=[],zt=/(=)\?(?=&|$)|\?\?/;w.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=_t.pop()||w.expando+"_"+bt.guid++;return this[e]=!0,e}}),w.ajaxPrefilter("json jsonp",function(e,n,r){var i,o,a,s=!1!==e.jsonp&&(zt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&zt.test(e.data)&&"data");if(s||"jsonp"===e.dataTypes[0])return i=e.jsonpCallback=g(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,s?e[s]=e[s].replace(zt,"$1"+i):!1!==e.jsonp&&(e.url+=(wt.test(e.url)?"&":"?")+e.jsonp+"="+i),e.converters["script json"]=function(){return a||w.error(i+" was not called"),a[0]},e.dataTypes[0]="json",o=t[i],t[i]=function(){a=arguments},r.always(function(){void 0===o?w(t).removeProp(i):t[i]=o,e[i]&&(e.jsonpCallback=n.jsonpCallback,_t.push(i)),a&&g(o)&&o(a[0]),a=o=void 0}),"script"}),h.createHTMLDocument=(($t=y.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===$t.childNodes.length),w.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(h.createHTMLDocument?((r=(t=y.implementation.createHTMLDocument("")).createElement("base")).href=y.location.href,t.head.appendChild(r)):t=y),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=be([e],t,o),o&&o.length&&w(o).remove(),w.merge([],i.childNodes)));var r,i,o},w.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return s>-1&&(r=dt(e.slice(s)),e=e.slice(0,s)),g(t)?(n=t,t=void 0):t&&"object"==typeof t&&(i="POST"),a.length>0&&w.ajax({url:e,type:i||"GET",dataType:"html",data:t}).done(function(e){o=arguments,a.html(r?w("<div>").append(w.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},w.expr.pseudos.animated=function(e){return w.grep(w.timers,function(t){return e===t.elem}).length},w.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=w.css(e,"position"),c=w(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=w.css(e,"top"),u=w.css(e,"left"),("absolute"===l||"fixed"===l)&&(o+u).indexOf("auto")>-1?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),g(t)&&(t=t.call(e,n,w.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},w.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each(function(t){w.offset.setOffset(this,e,t)});var t,n,r=this[0];return r?r.getClientRects().length?(t=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:t.top+n.pageYOffset,left:t.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===w.css(r,"position"))t=r.getBoundingClientRect();else{for(t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;e&&(e===n.body||e===n.documentElement)&&"static"===w.css(e,"position");)e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=w(e).offset()).top+=w.css(e,"borderTopWidth",!0),i.left+=w.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-w.css(r,"marginTop",!0),left:t.left-i.left-w.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent;e&&"static"===w.css(e,"position");)e=e.offsetParent;return e||re})}}),w.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,t){var n="pageYOffset"===t;w.fn[e]=function(r){return $(this,function(e,r,i){var o;if(v(e)?o=e:9===e.nodeType&&(o=e.defaultView),void 0===i)return o?o[t]:e[r];o?o.scrollTo(n?o.pageXOffset:i,n?i:o.pageYOffset):e[r]=i},e,r,arguments.length)}}),w.each(["top","left"],function(e,t){w.cssHooks[t]=Be(h.pixelPosition,function(e,n){if(n)return n=Fe(e,t),Re.test(n)?w(e).position()[t]+"px":n})}),w.each({Height:"height",Width:"width"},function(e,t){w.each({padding:"inner"+e,content:t,"":"outer"+e},function(n,r){w.fn[r]=function(i,o){var a=arguments.length&&(n||"boolean"!=typeof i),s=n||(!0===i||!0===o?"margin":"border");return $(this,function(t,n,i){var o;return v(t)?0===r.indexOf("outer")?t["inner"+e]:t.document.documentElement["client"+e]:9===t.nodeType?(o=t.documentElement,Math.max(t.body["scroll"+e],o["scroll"+e],t.body["offset"+e],o["offset"+e],o["client"+e])):void 0===i?w.css(t,n,s):w.style(t,n,i,s)},t,a?i:void 0,a)}})}),w.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){w.fn[t]=function(e){return this.on(t,e)}}),w.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),w.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,t){w.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}});var Ut=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;w.proxy=function(e,t){var n,r,i;if("string"==typeof t&&(n=e[t],t=e,e=n),g(e))return r=o.call(arguments,2),(i=function(){return e.apply(t||this,r.concat(o.call(arguments)))}).guid=e.guid=e.guid||w.guid++,i},w.holdReady=function(e){e?w.readyWait++:w.ready(!0)},w.isArray=Array.isArray,w.parseJSON=JSON.parse,w.nodeName=A,w.isFunction=g,w.isWindow=v,w.camelCase=X,w.type=b,w.now=Date.now,w.isNumeric=function(e){var t=w.type(e);return("number"===t||"string"===t)&&!isNaN(e-parseFloat(e))},w.trim=function(e){return null==e?"":(e+"").replace(Ut,"")},"function"==typeof e&&e.amd&&e("jquery",[],function(){return w});var Xt=t.jQuery,Vt=t.$;return w.noConflict=function(e){return t.$===w&&(t.$=Vt),e&&t.jQuery===w&&(t.jQuery=Xt),w},void 0===n&&(t.jQuery=t.$=w),w});
},{"process":"pBGv"}],"I3hs":[function(require,module,exports) {
!function(e,t,n,i){e.isFunction=e.isFunction||function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},e.site=e.fn.site=function(i){var o,a,r=(new Date).getTime(),s=[],l=arguments[0],c="string"==typeof l,u=[].slice.call(arguments,1),d=e.isPlainObject(i)?e.extend(!0,{},e.site.settings,i):e.extend({},e.site.settings),f=d.namespace,m=d.error,g="module-"+f,p=e(n),v=this,h=p.data(g);return o={initialize:function(){o.instantiate()},instantiate:function(){o.verbose("Storing instance of site",o),h=o,p.data(g,o)},normalize:function(){o.fix.console(),o.fix.requestAnimationFrame()},fix:{console:function(){o.debug("Normalizing window.console"),void 0!==console&&void 0!==console.log||(o.verbose("Console not available, normalizing events"),o.disable.console()),void 0!==console.group&&void 0!==console.groupEnd&&void 0!==console.groupCollapsed||(o.verbose("Console group not available, normalizing events"),t.console.group=function(){},t.console.groupEnd=function(){},t.console.groupCollapsed=function(){}),void 0===console.markTimeline&&(o.verbose("Mark timeline not available, normalizing events"),t.console.markTimeline=function(){})},consoleClear:function(){o.debug("Disabling programmatic console clearing"),t.console.clear=function(){}},requestAnimationFrame:function(){o.debug("Normalizing requestAnimationFrame"),void 0===t.requestAnimationFrame&&(o.debug("RequestAnimationFrame not available, normalizing event"),t.requestAnimationFrame=t.requestAnimationFrame||t.mozRequestAnimationFrame||t.webkitRequestAnimationFrame||t.msRequestAnimationFrame||function(e){setTimeout(e,0)})}},moduleExists:function(t){return void 0!==e.fn[t]&&void 0!==e.fn[t].settings},enabled:{modules:function(t){var n=[];return t=t||d.modules,e.each(t,function(e,t){o.moduleExists(t)&&n.push(t)}),n}},disabled:{modules:function(t){var n=[];return t=t||d.modules,e.each(t,function(e,t){o.moduleExists(t)||n.push(t)}),n}},change:{setting:function(t,n,i,a){i="string"==typeof i?"all"===i?d.modules:[i]:i||d.modules,a=void 0===a||a,e.each(i,function(i,r){var s,l=!o.moduleExists(r)||(e.fn[r].settings.namespace||!1);o.moduleExists(r)&&(o.verbose("Changing default setting",t,n,r),e.fn[r].settings[t]=n,a&&l&&(s=e(":data(module-"+l+")")).length>0&&(o.verbose("Modifying existing settings",s),s[r]("setting",t,n)))})},settings:function(t,n,i){n="string"==typeof n?[n]:n||d.modules,i=void 0===i||i,e.each(n,function(n,a){var r;o.moduleExists(a)&&(o.verbose("Changing default setting",t,a),e.extend(!0,e.fn[a].settings,t),i&&f&&(r=e(":data(module-"+f+")")).length>0&&(o.verbose("Modifying existing settings",r),r[a]("setting",t)))})}},enable:{console:function(){o.console(!0)},debug:function(e,t){e=e||d.modules,o.debug("Enabling debug for modules",e),o.change.setting("debug",!0,e,t)},verbose:function(e,t){e=e||d.modules,o.debug("Enabling verbose debug for modules",e),o.change.setting("verbose",!0,e,t)}},disable:{console:function(){o.console(!1)},debug:function(e,t){e=e||d.modules,o.debug("Disabling debug for modules",e),o.change.setting("debug",!1,e,t)},verbose:function(e,t){e=e||d.modules,o.debug("Disabling verbose debug for modules",e),o.change.setting("verbose",!1,e,t)}},console:function(e){if(e){if(void 0===h.cache.console)return void o.error(m.console);o.debug("Restoring console function"),t.console=h.cache.console}else o.debug("Disabling console function"),h.cache.console=t.console,t.console={clear:function(){},error:function(){},group:function(){},groupCollapsed:function(){},groupEnd:function(){},info:function(){},log:function(){},markTimeline:function(){},warn:function(){}}},destroy:function(){o.verbose("Destroying previous site for",p),p.removeData(g)},cache:{},setting:function(t,n){if(e.isPlainObject(t))e.extend(!0,d,t);else{if(void 0===n)return d[t];d[t]=n}},internal:function(t,n){if(e.isPlainObject(t))e.extend(!0,o,t);else{if(void 0===n)return o[t];o[t]=n}},debug:function(){d.debug&&(d.performance?o.performance.log(arguments):(o.debug=Function.prototype.bind.call(console.info,console,d.name+":"),o.debug.apply(console,arguments)))},verbose:function(){d.verbose&&d.debug&&(d.performance?o.performance.log(arguments):(o.verbose=Function.prototype.bind.call(console.info,console,d.name+":"),o.verbose.apply(console,arguments)))},error:function(){o.error=Function.prototype.bind.call(console.error,console,d.name+":"),o.error.apply(console,arguments)},performance:{log:function(e){var t,n;d.performance&&(n=(t=(new Date).getTime())-(r||t),r=t,s.push({Element:v,Name:e[0],Arguments:[].slice.call(e,1)||"","Execution Time":n})),clearTimeout(o.performance.timer),o.performance.timer=setTimeout(o.performance.display,500)},display:function(){var t=d.name+":",n=0;r=!1,clearTimeout(o.performance.timer),e.each(s,function(e,t){n+=t["Execution Time"]}),t+=" "+n+"ms",(void 0!==console.group||void 0!==console.table)&&s.length>0&&(console.groupCollapsed(t),console.table?console.table(s):e.each(s,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),s=[]}},invoke:function(t,n,i){var r,s,l,c=h;return n=n||u,i=v||i,"string"==typeof t&&void 0!==c&&(t=t.split(/[\. ]/),r=t.length-1,e.each(t,function(n,i){var a=n!=r?i+t[n+1].charAt(0).toUpperCase()+t[n+1].slice(1):t;if(e.isPlainObject(c[a])&&n!=r)c=c[a];else{if(void 0!==c[a])return s=c[a],!1;if(!e.isPlainObject(c[i])||n==r)return void 0!==c[i]?(s=c[i],!1):(o.error(m.method,t),!1);c=c[i]}})),e.isFunction(s)?l=s.apply(i,n):void 0!==s&&(l=s),Array.isArray(a)?a.push(l):void 0!==a?a=[a,l]:void 0!==l&&(a=l),s}},c?(void 0===h&&o.initialize(),o.invoke(l)):(void 0!==h&&o.destroy(),o.initialize()),void 0!==a?a:this},e.site.settings={name:"Site",namespace:"site",error:{console:"Console cannot be restored, most likely it was overwritten outside of module",method:"The method you called is not defined."},debug:!1,verbose:!1,performance:!0,modules:["accordion","api","calendar","checkbox","dimmer","dropdown","embed","form","modal","nag","popup","slider","rating","shape","sidebar","state","sticky","tab","toast","transition","visibility","visit"],siteNamespace:"site",namespaceStub:{cache:{},config:{},sections:{},section:{},utilities:{}}},e.extend(e.expr[":"],{data:e.expr.createPseudo?e.expr.createPseudo(function(t){return function(n){return!!e.data(n,t)}}):function(t,n,i){return!!e.data(t,i[3])}})}(jQuery,window,document),function(e,t,n,i){"use strict";e.isFunction=e.isFunction||function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},t=void 0!==t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),e.fn.form=function(i){var o,a=e(this),r=a.selector||"",s=(new Date).getTime(),l=[],c=arguments[0],u=arguments[1],d="string"==typeof c,f=[].slice.call(arguments,1);return a.each(function(){var m,g,p,v,h,b,y,x,C,w,k,T,S,D,A,E,F=e(this),P=this,O=[],R=!1,M=!1,I=!1,j=["clean","clean"];(E={initialize:function(){E.get.settings(),d?(void 0===A&&E.instantiate(),E.invoke(c)):(void 0!==A&&(A.invoke("destroy"),E.refresh()),E.verbose("Initializing form validation",F,h),E.bindEvents(),E.set.defaults(),h.autoCheckRequired&&E.set.autoCheck(),E.instantiate())},instantiate:function(){E.verbose("Storing instance of module",E),A=E,F.data(S,E)},destroy:function(){E.verbose("Destroying previous module",A),E.removeEvents(),F.removeData(S)},refresh:function(){E.verbose("Refreshing selector cache"),m=F.find(x.field),g=F.find(x.group),p=F.find(x.message),F.find(x.prompt),v=F.find(x.submit),F.find(x.clear),F.find(x.reset)},submit:function(){E.verbose("Submitting form",F),M=!0,F.submit()},attachEvents:function(t,n){n=n||"submit",e(t).on("click"+D,function(e){E[n](),e.preventDefault()})},bindEvents:function(){E.verbose("Attaching form events"),F.on("submit"+D,E.validate.form).on("blur"+D,x.field,E.event.field.blur).on("click"+D,x.submit,E.submit).on("click"+D,x.reset,E.reset).on("click"+D,x.clear,E.clear),h.keyboardShortcuts&&F.on("keydown"+D,x.field,E.event.field.keydown),m.each(function(t,n){var i=e(n),o=i.prop("type"),a=E.get.changeEvent(o,i);i.on(a+D,E.event.field.change)}),h.preventLeaving&&e(t).on("beforeunload"+D,E.event.beforeUnload),m.on("change click keyup keydown blur",function(e){E.determine.isDirty()}),F.on("dirty"+D,function(e){h.onDirty.call()}),F.on("clean"+D,function(e){h.onClean.call()})},clear:function(){m.each(function(t,n){var i=e(n),o=i.parent(),a=i.closest(g),r=a.find(x.prompt),s=i.closest(x.uiCalendar),l=i.data(y.defaultValue)||"",c=o.is(x.uiCheckbox),u=o.is(x.uiDropdown)&&E.can.useElement("dropdown"),d=s.length>0&&E.can.useElement("calendar");a.hasClass(C.error)&&(E.verbose("Resetting error on field",a),a.removeClass(C.error),r.remove()),u?(E.verbose("Resetting dropdown value",o,l),o.dropdown("clear",!0)):c?i.prop("checked",!1):d?s.calendar("clear"):(E.verbose("Resetting field value",i,l),i.val(""))}),E.remove.states()},reset:function(){m.each(function(t,n){var i=e(n),o=i.parent(),a=i.closest(g),r=i.closest(x.uiCalendar),s=a.find(x.prompt),l=i.data(y.defaultValue),c=o.is(x.uiCheckbox),u=o.is(x.uiDropdown)&&E.can.useElement("dropdown"),d=r.length>0&&E.can.useElement("calendar"),f=a.hasClass(C.error);void 0!==l&&(f&&(E.verbose("Resetting error on field",a),a.removeClass(C.error),s.remove()),u?(E.verbose("Resetting dropdown value",o,l),o.dropdown("restore defaults",!0)):c?(E.verbose("Resetting checkbox value",o,l),i.prop("checked",l)):d?r.calendar("set date",l):(E.verbose("Resetting field value",i,l),i.val(l)))}),E.remove.states()},determine:{isValid:function(){var t=!0;return e.each(b,function(e,n){E.validate.field(n,e,!0)||(t=!1)}),t},isDirty:function(t){var n=!1;m.each(function(t,i){var o,a=e(i);o=a.filter(x.checkbox).length>0?E.is.checkboxDirty(a):E.is.fieldDirty(a),a.data(h.metadata.isDirty,o),n|=o}),n?E.set.dirty():E.set.clean()}},is:{bracketedRule:function(e){return e.type&&e.type.match(h.regExp.bracket)},shorthandRules:function(e){return"string"==typeof e||Array.isArray(e)},empty:function(e){return!e||0===e.length||(e.is(x.checkbox)?!e.is(":checked"):E.is.blank(e))},blank:function(e){return""===String(e.val()).trim()},valid:function(t,n){var i=!0;return t?(E.verbose("Checking if field is valid",t),E.validate.field(b[t],t,!!n)):(E.verbose("Checking if form is valid"),e.each(b,function(e,t){E.is.valid(e,n)||(i=!1)}),i)},dirty:function(){return I},clean:function(){return!I},fieldDirty:function(e){var t=e.data(y.defaultValue);null==t?t="":Array.isArray(t)&&(t=t.toString());var n=e.val();null==n?n="":Array.isArray(n)&&(n=n.toString());var i=/^(true|false)$/i;return i.test(t)&&i.test(n)?!new RegExp("^"+t+"$","i").test(n):n!==t},checkboxDirty:function(e){return e.data(y.defaultValue)!==e.is(":checked")},justDirty:function(){return"dirty"===j[0]},justClean:function(){return"clean"===j[0]}},removeEvents:function(){F.off(D),m.off(D),v.off(D),m.off(D)},event:{field:{keydown:function(t){var n=e(this),i=t.which,o=n.is(x.input),a=n.is(x.checkbox),r=n.closest(x.uiDropdown).length>0,s=13;i==27&&(E.verbose("Escape key pressed blurring field"),n[0].blur()),t.ctrlKey||i!=s||!o||r||a||(R||(n.one("keyup"+D,E.event.field.keyup),E.submit(),E.debug("Enter pressed on input submitting form")),R=!0)},keyup:function(){R=!1},blur:function(t){var n=e(this),i=n.closest(g),o=E.get.validation(n);o&&("blur"==h.on||i.hasClass(C.error)&&h.revalidate)&&(E.debug("Revalidating field",n,o),E.validate.field(o),h.inline||E.validate.form(!1,!0))},change:function(t){var n=e(this),i=n.closest(g),o=E.get.validation(n);o&&("change"==h.on||i.hasClass(C.error)&&h.revalidate)&&(clearTimeout(E.timer),E.timer=setTimeout(function(){E.debug("Revalidating field",n,o),E.validate.field(o),h.inline||E.validate.form(!1,!0)},h.delay))}},beforeUnload:function(e){if(E.is.dirty()&&!M)return(e=e||t.event)&&(e.returnValue=h.text.leavingMessage),h.text.leavingMessage}},get:{ancillaryValue:function(e){return!(!e.type||!e.value&&!E.is.bracketedRule(e))&&(void 0!==e.value?e.value:e.type.match(h.regExp.bracket)[1]+"")},ruleName:function(e){return E.is.bracketedRule(e)?e.type.replace(e.type.match(h.regExp.bracket)[0],""):e.type},changeEvent:function(e,t){return"checkbox"==e||"radio"==e||"hidden"==e||t.is("select")?"change":E.get.inputEvent()},inputEvent:function(){return void 0!==n.createElement("input").oninput?"input":void 0!==n.createElement("input").onpropertychange?"propertychange":"keyup"},fieldsFromShorthand:function(t){var n={};return e.each(t,function(t,i){Array.isArray(i)||"object"!=typeof i?("string"==typeof i&&(i=[i]),n[t]={rules:[]},e.each(i,function(e,i){n[t].rules.push({type:i})})):n[t]=i}),n},prompt:function(t,n){var i,o,a,r=E.get.ruleName(t),s=E.get.ancillaryValue(t),l=E.get.field(n.identifier),c=l.val(),u=e.isFunction(t.prompt)?t.prompt(c):t.prompt||h.prompt[r]||h.text.unspecifiedRule,d=-1!==u.search("{value}"),f=-1!==u.search("{name}");return s&&s.indexOf("..")>=0&&(a=s.split("..",2),t.prompt||(u+=(""===a[0]?h.prompt.maxValue.replace(/\{ruleValue\}/g,"{max}"):""===a[1]?h.prompt.minValue.replace(/\{ruleValue\}/g,"{min}"):h.prompt.range).replace(/\{name\}/g," "+h.text.and)),u=(u=u.replace(/\{min\}/g,a[0])).replace(/\{max\}/g,a[1])),d&&(u=u.replace(/\{value\}/g,l.val())),f&&(o=1==(i=l.closest(x.group).find("label").eq(0)).length?i.text():l.prop("placeholder")||h.text.unspecifiedField,u=u.replace(/\{name\}/g,o)),u=(u=u.replace(/\{identifier\}/g,n.identifier)).replace(/\{ruleValue\}/g,s),t.prompt||E.verbose("Using default validation prompt for type",u,r),u},settings:function(){if(e.isPlainObject(i)){var t=Object.keys(i);t.length>0&&(void 0!==i[t[0]].identifier&&void 0!==i[t[0]].rules)?(h=e.extend(!0,{},e.fn.form.settings,u),b=e.extend({},e.fn.form.settings.defaults,i),E.error(h.error.oldSyntax,P),E.verbose("Extending settings from legacy parameters",b,h)):(i.fields&&(i.fields=E.get.fieldsFromShorthand(i.fields)),h=e.extend(!0,{},e.fn.form.settings,i),b=e.extend({},e.fn.form.settings.defaults,h.fields),E.verbose("Extending settings",b,h))}else h=e.fn.form.settings,b=e.fn.form.settings.defaults,E.verbose("Using default form validation",b,h);T=h.namespace,y=h.metadata,x=h.selector,C=h.className,w=h.regExp,k=h.error,S="module-"+T,D="."+T,((A=F.data(S))||E).refresh()},field:function(t){var n;return E.verbose("Finding field with identifier",t),t=E.escape.string(t),(n=m.filter("#"+t)).length>0?n:(n=m.filter('[name="'+t+'"]')).length>0?n:(n=m.filter('[name="'+t+'[]"]')).length>0?n:(n=m.filter("[data-"+y.validate+'="'+t+'"]')).length>0?n:e("<input/>")},fields:function(t){var n=e();return e.each(t,function(e,t){n=n.add(E.get.field(t))}),n},validation:function(t){var n,i;return!!b&&(e.each(b,function(o,a){i=a.identifier||o,e.each(E.get.field(i),function(e,o){if(o==t[0])return a.identifier=i,n=a,!1})}),n||!1)},value:function(e){var t=[];return t.push(e),E.get.values.call(P,t)[e]},values:function(t){var n=Array.isArray(t)?E.get.fields(t):m,i={};return n.each(function(t,n){var o=e(n),a=o.closest(x.uiCalendar),r=o.prop("name"),s=o.val(),l=o.is(x.checkbox),c=o.is(x.radio),u=-1!==r.indexOf("[]"),d=a.length>0&&E.can.useElement("calendar"),f=!!l&&o.is(":checked");if(r)if(u)r=r.replace("[]",""),i[r]||(i[r]=[]),l?f?i[r].push(s||!0):i[r].push(!1):i[r].push(s);else if(c)void 0!==i[r]&&!1!==i[r]||(i[r]=!!f&&(s||!0));else if(l)i[r]=!!f&&(s||!0);else if(d){var m=a.calendar("get date");if(null!==m){if("date"==h.dateHandling)i[r]=m;else if("input"==h.dateHandling)i[r]=a.calendar("get input date");else if("formatter"==h.dateHandling){var g=a.calendar("setting","type");switch(g){case"date":i[r]=h.formatter.date(m);break;case"datetime":i[r]=h.formatter.datetime(m);break;case"time":i[r]=h.formatter.time(m);break;case"month":i[r]=h.formatter.month(m);break;case"year":i[r]=h.formatter.year(m);break;default:E.debug("Wrong calendar mode",a,g),i[r]=""}}}else i[r]=""}else i[r]=s}),i},dirtyFields:function(){return m.filter(function(t,n){return e(n).data(y.isDirty)})}},has:{field:function(e){return E.verbose("Checking for existence of a field with identifier",e),"string"!=typeof(e=E.escape.string(e))&&E.error(k.identifier,e),m.filter("#"+e).length>0||(m.filter('[name="'+e+'"]').length>0||m.filter("[data-"+y.validate+'="'+e+'"]').length>0)}},can:{useElement:function(t){return void 0!==e.fn[t]||(E.error(k.noElement.replace("{element}",t)),!1)}},escape:{string:function(e){return(e=String(e)).replace(w.escape,"\\$&")}},add:{rule:function(e,t){E.add.field(e,t)},field:function(t,n){void 0!==b[t]&&void 0!==b[t].rules||(b[t]={rules:[]});var i={rules:[]};E.is.shorthandRules(n)?(n=Array.isArray(n)?n:[n],e.each(n,function(e,t){i.rules.push({type:t})})):i.rules=n.rules,e.each(i.rules,function(n,i){0==e.grep(b[t].rules,function(e){return e.type==i.type}).length&&b[t].rules.push(i)}),E.debug("Adding rules",i.rules,b)},fields:function(t){b=e.extend({},b,E.get.fieldsFromShorthand(t))},prompt:function(e,t,n){var i=E.get.field(e).closest(g),o=i.children(x.prompt),a=0!==o.length;t="string"==typeof t?[t]:t,E.verbose("Adding field error state",e),n||i.addClass(C.error),h.inline&&(a||(o=h.templates.prompt(t,C.label)).appendTo(i),o.html(t[0]),a?E.verbose("Inline errors are disabled, no inline error added",e):h.transition&&E.can.useElement("transition")&&F.transition("is supported")?(E.verbose("Displaying error with css transition",h.transition),o.transition(h.transition+" in",h.duration)):(E.verbose("Displaying error with fallback javascript animation"),o.fadeIn(h.duration)))},errors:function(e){E.debug("Adding form error messages",e),E.set.error(),p.html(h.templates.error(e))}},remove:{errors:function(){E.debug("Removing form error messages"),p.empty()},states:function(){F.removeClass(C.error).removeClass(C.success),h.inline||E.remove.errors(),E.determine.isDirty()},rule:function(t,n){var i=Array.isArray(n)?n:[n];if(void 0!==b[t]&&Array.isArray(b[t].rules))return void 0===n?(E.debug("Removed all rules"),void(b[t].rules=[])):void e.each(b[t].rules,function(e,n){n&&-1!==i.indexOf(n.type)&&(E.debug("Removed rule",n.type),b[t].rules.splice(e,1))})},field:function(t){var n=Array.isArray(t)?t:[t];e.each(n,function(e,t){E.remove.rule(t)})},rules:function(t,n){Array.isArray(t)?e.each(t,function(e,t){E.remove.rule(t,n)}):E.remove.rule(t,n)},fields:function(e){E.remove.field(e)},prompt:function(e){var t=E.get.field(e).closest(g),n=t.children(x.prompt);t.removeClass(C.error),h.inline&&n.is(":visible")&&(E.verbose("Removing prompt for field",e),h.transition&&E.can.useElement("transition")&&F.transition("is supported")?n.transition(h.transition+" out",h.duration,function(){n.remove()}):n.fadeOut(h.duration,function(){n.remove()}))}},set:{success:function(){F.removeClass(C.error).addClass(C.success)},defaults:function(){m.each(function(t,n){var i=e(n),o=i.parent(),a=i.filter(x.checkbox).length>0,r=o.is(x.uiDropdown)&&E.can.useElement("dropdown"),s=i.closest(x.uiCalendar),l=s.length>0&&E.can.useElement("calendar"),c=a?i.is(":checked"):i.val();r?o.dropdown("save defaults"):l&&s.calendar("refresh"),i.data(y.defaultValue,c),i.data(y.isDirty,!1)})},error:function(){F.removeClass(C.success).addClass(C.error)},value:function(e,t){var n={};return n[e]=t,E.set.values.call(P,n)},values:function(t){e.isEmptyObject(t)||e.each(t,function(t,n){var i,o=E.get.field(t),a=o.parent(),r=o.closest(x.uiCalendar),s=Array.isArray(n),l=a.is(x.uiCheckbox)&&E.can.useElement("checkbox"),c=a.is(x.uiDropdown)&&E.can.useElement("dropdown"),u=o.is(x.radio)&&l,d=r.length>0&&E.can.useElement("calendar");o.length>0&&(s&&l?(E.verbose("Selecting multiple",n,o),a.checkbox("uncheck"),e.each(n,function(e,t){i=o.filter('[value="'+t+'"]'),a=i.parent(),i.length>0&&a.checkbox("check")})):u?(E.verbose("Selecting radio value",n,o),o.filter('[value="'+n+'"]').parent(x.uiCheckbox).checkbox("check")):l?(E.verbose("Setting checkbox value",n,a),!0===n||1===n?a.checkbox("check"):a.checkbox("uncheck")):c?(E.verbose("Setting dropdown value",n,a),a.dropdown("set selected",n)):d?r.calendar("set date",n):(E.verbose("Setting field value",n,o),o.val(n)))})},dirty:function(){E.verbose("Setting state dirty"),I=!0,j[0]=j[1],j[1]="dirty",E.is.justClean()&&F.trigger("dirty")},clean:function(){E.verbose("Setting state clean"),I=!1,j[0]=j[1],j[1]="clean",E.is.justDirty()&&F.trigger("clean")},asClean:function(){E.set.defaults(),E.set.clean()},asDirty:function(){E.set.defaults(),E.set.dirty()},autoCheck:function(){E.debug("Enabling auto check on required fields"),m.each(function(t,n){var i=e(n),o=e(n).closest(g),a=i.filter(x.checkbox).length>0,r=i.prop("required")||o.hasClass(C.required)||o.parent().hasClass(C.required),s=i.is(":disabled")||o.hasClass(C.disabled)||o.parent().hasClass(C.disabled),l=E.get.validation(i),c=!!l&&0!==e.grep(l.rules,function(e){return"empty"==e.type}),u=l.identifier||i.attr("id")||i.attr("name")||i.data(y.validate);!r||s||c||void 0===u||(a?(E.verbose("Adding 'checked' rule on field",u),E.add.rule(u,"checked")):(E.verbose("Adding 'empty' rule on field",u),E.add.rule(u,"empty")))})},optional:function(t,n){n=!1!==n,e.each(b,function(e,i){t!=e&&t!=i.identifier||(i.optional=n)})}},validate:{form:function(t,n){var i=E.get.values();if(R)return!1;if(O=[],E.determine.isValid()){if(E.debug("Form has no validation errors, submitting"),E.set.success(),h.inline||E.remove.errors(),!0!==n)return h.onSuccess.call(P,t,i)}else{if(E.debug("Form has errors"),M=!1,E.set.error(),h.inline||E.add.errors(O),t&&void 0!==F.data("moduleApi")&&t.stopImmediatePropagation(),h.errorFocus){var o,a=!0;"string"==typeof h.errorFocus?(a=(o=e(h.errorFocus)).is("[tabindex]"))||o.attr("tabindex",-1):o=g.filter("."+C.error).first().find(x.field),o.focus(),a||o.removeAttr("tabindex")}if(!0!==n)return h.onFailure.call(P,O,i)}},field:function(t,n,i){i=void 0===i||i,"string"==typeof t&&(E.verbose("Validating field",t),n=t,t=b[t]);var o=t.identifier||n,a=E.get.field(o),r=!!t.depends&&E.get.field(t.depends),s=!0,l=[];return t.identifier||(E.debug("Using field name as identifier",o),t.identifier=o),!a.filter(":not(:disabled)").length?E.debug("Field is disabled. Skipping",o):t.optional&&E.is.blank(a)?E.debug("Field is optional and blank. Skipping",o):t.depends&&E.is.empty(r)?E.debug("Field depends on another value that is not present or empty. Skipping",r):void 0!==t.rules&&(i&&a.closest(g).removeClass(C.error),e.each(t.rules,function(n,a){if(E.has.field(o)){var r=E.validate.rule(t,a,!0)||[];r.length>0&&(E.debug("Field is invalid",o,a.type),l.push(E.get.prompt(a,t)),s=!1,i&&e(r).closest(g).addClass(C.error))}})),s?(i&&(E.remove.prompt(o,l),h.onValid.call(a)),!0):(i&&(O=O.concat(l),E.add.prompt(o,l,!0),h.onInvalid.call(a,l)),!1)},rule:function(t,n,i){var o=E.get.field(t.identifier),a=E.get.ancillaryValue(n),r=E.get.ruleName(n),s=h.rules[r],l=[],c=o.is(x.checkbox),u=function(t){var i=c?e(t).filter(":checked").val():e(t).val();return i=void 0===i||""===i||null===i?"":h.shouldTrim&&!1!==n.shouldTrim||n.shouldTrim?String(i+"").trim():String(i+""),s.call(t,i,a,F)};if(e.isFunction(s))return c?u(o)||(l=o):e.each(o,function(e,t){u(t)||l.push(t)}),i?l:!(l.length>0);E.error(k.noRule,r)}},setting:function(t,n){if(e.isPlainObject(t))e.extend(!0,h,t);else{if(void 0===n)return h[t];h[t]=n}},internal:function(t,n){if(e.isPlainObject(t))e.extend(!0,E,t);else{if(void 0===n)return E[t];E[t]=n}},debug:function(){!h.silent&&h.debug&&(h.performance?E.performance.log(arguments):(E.debug=Function.prototype.bind.call(console.info,console,h.name+":"),E.debug.apply(console,arguments)))},verbose:function(){!h.silent&&h.verbose&&h.debug&&(h.performance?E.performance.log(arguments):(E.verbose=Function.prototype.bind.call(console.info,console,h.name+":"),E.verbose.apply(console,arguments)))},error:function(){h.silent||(E.error=Function.prototype.bind.call(console.error,console,h.name+":"),E.error.apply(console,arguments))},performance:{log:function(e){var t,n;h.performance&&(n=(t=(new Date).getTime())-(s||t),s=t,l.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:P,"Execution Time":n})),clearTimeout(E.performance.timer),E.performance.timer=setTimeout(E.performance.display,500)},display:function(){var t=h.name+":",n=0;s=!1,clearTimeout(E.performance.timer),e.each(l,function(e,t){n+=t["Execution Time"]}),t+=" "+n+"ms",r&&(t+=" '"+r+"'"),a.length>1&&(t+=" ("+a.length+")"),(void 0!==console.group||void 0!==console.table)&&l.length>0&&(console.groupCollapsed(t),console.table?console.table(l):e.each(l,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),l=[]}},invoke:function(t,n,i){var a,r,s,l=A;return n=n||f,i=P||i,"string"==typeof t&&void 0!==l&&(t=t.split(/[\. ]/),a=t.length-1,e.each(t,function(n,i){var o=n!=a?i+t[n+1].charAt(0).toUpperCase()+t[n+1].slice(1):t;if(e.isPlainObject(l[o])&&n!=a)l=l[o];else{if(void 0!==l[o])return r=l[o],!1;if(!e.isPlainObject(l[i])||n==a)return void 0!==l[i]&&(r=l[i],!1);l=l[i]}})),e.isFunction(r)?s=r.apply(i,n):void 0!==r&&(s=r),Array.isArray(o)?o.push(s):void 0!==o?o=[o,s]:void 0!==s&&(o=s),r}}).initialize()}),void 0!==o?o:this},e.fn.form.settings={name:"Form",namespace:"form",debug:!1,verbose:!1,performance:!0,fields:!1,keyboardShortcuts:!0,on:"submit",inline:!1,delay:200,revalidate:!0,shouldTrim:!0,transition:"scale",duration:200,autoCheckRequired:!1,preventLeaving:!1,errorFocus:!1,dateHandling:"date",onValid:function(){},onInvalid:function(){},onSuccess:function(){return!0},onFailure:function(){return!1},onDirty:function(){},onClean:function(){},metadata:{defaultValue:"default",validate:"validate",isDirty:"isDirty"},regExp:{htmlID:/^[a-zA-Z][\w:.-]*$/g,bracket:/\[(.*)\]/i,decimal:/^\d+\.?\d*$/,email:/^[a-z0-9!#$%&'*+\/=?^_`{|}~.-]+@[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$/i,escape:/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|:,=@]/g,flags:/^\/(.*)\/(.*)?/,integer:/^\-?\d+$/,number:/^\-?\d*(\.\d+)?$/,url:/(https?:\/\/(?:www\.|(?!www))[^\s\.]+\.[^\s]{2,}|www\.[^\s]+\.[^\s]{2,})/i},text:{and:"and",unspecifiedRule:"Please enter a valid value",unspecifiedField:"This field",leavingMessage:"There are unsaved changes on this page which will be discarded if you continue."},prompt:{range:"{name} must be in a range from {min} to {max}",maxValue:"{name} must have a maximum value of {ruleValue}",minValue:"{name} must have a minimum value of {ruleValue}",empty:"{name} must have a value",checked:"{name} must be checked",email:"{name} must be a valid e-mail",url:"{name} must be a valid url",regExp:"{name} is not formatted correctly",integer:"{name} must be an integer",decimal:"{name} must be a decimal number",number:"{name} must be set to a number",is:'{name} must be "{ruleValue}"',isExactly:'{name} must be exactly "{ruleValue}"',not:'{name} cannot be set to "{ruleValue}"',notExactly:'{name} cannot be set to exactly "{ruleValue}"',contain:'{name} must contain "{ruleValue}"',containExactly:'{name} must contain exactly "{ruleValue}"',doesntContain:'{name} cannot contain  "{ruleValue}"',doesntContainExactly:'{name} cannot contain exactly "{ruleValue}"',minLength:"{name} must be at least {ruleValue} characters",length:"{name} must be at least {ruleValue} characters",exactLength:"{name} must be exactly {ruleValue} characters",maxLength:"{name} cannot be longer than {ruleValue} characters",match:"{name} must match {ruleValue} field",different:"{name} must have a different value than {ruleValue} field",creditCard:"{name} must be a valid credit card number",minCount:"{name} must have at least {ruleValue} choices",exactCount:"{name} must have exactly {ruleValue} choices",maxCount:"{name} must have {ruleValue} or less choices"},selector:{checkbox:'input[type="checkbox"], input[type="radio"]',clear:".clear",field:'input:not(.search):not([type="file"]), textarea, select',group:".field",input:'input:not([type="file"])',message:".error.message",prompt:".prompt.label",radio:'input[type="radio"]',reset:'.reset:not([type="reset"])',submit:'.submit:not([type="submit"])',uiCheckbox:".ui.checkbox",uiDropdown:".ui.dropdown",uiCalendar:".ui.calendar"},className:{error:"error",label:"ui basic red pointing prompt label",pressed:"down",success:"success",required:"required",disabled:"disabled"},error:{identifier:"You must specify a string identifier for each field",method:"The method you called is not defined.",noRule:"There is no rule matching the one you specified",oldSyntax:"Starting in 2.0 forms now only take a single settings object. Validation settings converted to new syntax automatically.",noElement:"This module requires ui {element}"},templates:{error:function(t){var n='<ul class="list">';return e.each(t,function(e,t){n+="<li>"+t+"</li>"}),e(n+="</ul>")},prompt:function(t,n){return e("<div/>").addClass(n).html(t[0])}},formatter:{date:function(e){return Intl.DateTimeFormat("en-GB").format(e)},datetime:function(e){return Intl.DateTimeFormat("en-GB",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(e)},time:function(e){return Intl.DateTimeFormat("en-GB",{hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(e)},month:function(e){return Intl.DateTimeFormat("en-GB",{month:"2-digit",year:"numeric"}).format(e)},year:function(e){return Intl.DateTimeFormat("en-GB",{year:"numeric"}).format(e)}},rules:{empty:function(e){return!(void 0===e||""===e||Array.isArray(e)&&0===e.length)},checked:function(){return e(this).filter(":checked").length>0},email:function(t){return e.fn.form.settings.regExp.email.test(t)},url:function(t){return e.fn.form.settings.regExp.url.test(t)},regExp:function(t,n){if(n instanceof RegExp)return t.match(n);var i,o=n.match(e.fn.form.settings.regExp.flags);return o&&(n=o.length>=2?o[1]:n,i=o.length>=3?o[2]:""),t.match(new RegExp(n,i))},minValue:function(t,n){return e.fn.form.settings.rules.range(t,n+"..","number")},maxValue:function(t,n){return e.fn.form.settings.rules.range(t,".."+n,"number")},integer:function(t,n){return e.fn.form.settings.rules.range(t,n,"integer")},range:function(t,n,i){var o,a,r;return"string"==typeof i&&(i=e.fn.form.settings.regExp[i]),i instanceof RegExp||(i=e.fn.form.settings.regExp.integer),n&&-1===["",".."].indexOf(n)&&(-1==n.indexOf("..")?i.test(n)&&(o=a=n-0):(r=n.split("..",2),i.test(r[0])&&(o=r[0]-0),i.test(r[1])&&(a=r[1]-0))),i.test(t)&&(void 0===o||t>=o)&&(void 0===a||t<=a)},decimal:function(t,n){return e.fn.form.settings.rules.range(t,n,"decimal")},number:function(t,n){return e.fn.form.settings.rules.range(t,n,"number")},is:function(e,t){return t="string"==typeof t?t.toLowerCase():t,(e="string"==typeof e?e.toLowerCase():e)==t},isExactly:function(e,t){return e==t},not:function(e,t){return(e="string"==typeof e?e.toLowerCase():e)!=(t="string"==typeof t?t.toLowerCase():t)},notExactly:function(e,t){return e!=t},contains:function(t,n){return n=n.replace(e.fn.form.settings.regExp.escape,"\\$&"),-1!==t.search(new RegExp(n,"i"))},containsExactly:function(t,n){return n=n.replace(e.fn.form.settings.regExp.escape,"\\$&"),-1!==t.search(new RegExp(n))},doesntContain:function(t,n){return n=n.replace(e.fn.form.settings.regExp.escape,"\\$&"),-1===t.search(new RegExp(n,"i"))},doesntContainExactly:function(t,n){return n=n.replace(e.fn.form.settings.regExp.escape,"\\$&"),-1===t.search(new RegExp(n))},minLength:function(e,t){return void 0!==e&&e.length>=t},length:function(e,t){return void 0!==e&&e.length>=t},exactLength:function(e,t){return void 0!==e&&e.length==t},maxLength:function(e,t){return void 0!==e&&e.length<=t},match:function(e,t,n){var i,o;return(o=n.find('[data-validate="'+t+'"]')).length>0?i=o.val():(o=n.find("#"+t)).length>0?i=o.val():(o=n.find('[name="'+t+'"]')).length>0?i=o.val():(o=n.find('[name="'+t+'[]"]')).length>0&&(i=o),void 0!==i&&e.toString()==i.toString()},different:function(e,t,n){var i,o;return(o=n.find('[data-validate="'+t+'"]')).length>0?i=o.val():(o=n.find("#"+t)).length>0?i=o.val():(o=n.find('[name="'+t+'"]')).length>0?i=o.val():(o=n.find('[name="'+t+'[]"]')).length>0&&(i=o),void 0!==i&&e.toString()!==i.toString()},creditCard:function(t,n){var i,o,a={visa:{pattern:/^4/,length:[16]},amex:{pattern:/^3[47]/,length:[15]},mastercard:{pattern:/^5[1-5]/,length:[16]},discover:{pattern:/^(6011|622(12[6-9]|1[3-9][0-9]|[2-8][0-9]{2}|9[0-1][0-9]|92[0-5]|64[4-9])|65)/,length:[16]},unionPay:{pattern:/^(62|88)/,length:[16,17,18,19]},jcb:{pattern:/^35(2[89]|[3-8][0-9])/,length:[16]},maestro:{pattern:/^(5018|5020|5038|6304|6759|676[1-3])/,length:[12,13,14,15,16,17,18,19]},dinersClub:{pattern:/^(30[0-5]|^36)/,length:[14]},laser:{pattern:/^(6304|670[69]|6771)/,length:[16,17,18,19]},visaElectron:{pattern:/^(4026|417500|4508|4844|491(3|7))/,length:[16]}},r={},s=!1,l="string"==typeof n&&n.split(",");if("string"==typeof t&&0!==t.length){if(t=t.replace(/[\s\-]/g,""),l&&(e.each(l,function(n,i){(o=a[i])&&(r={length:-1!==e.inArray(t.length,o.length),pattern:-1!==t.search(o.pattern)}).length&&r.pattern&&(s=!0)}),!s))return!1;if((i={number:-1!==e.inArray(t.length,a.unionPay.length),pattern:-1!==t.search(a.unionPay.pattern)}).number&&i.pattern)return!0;for(var c=t.length,u=0,d=[[0,1,2,3,4,5,6,7,8,9],[0,2,4,6,8,1,3,5,7,9]],f=0;c--;)f+=d[u][parseInt(t.charAt(c),10)],u^=1;return f%10==0&&f>0}},minCount:function(e,t){return 0==t||(1==t?""!==e:e.split(",").length>=t)},exactCount:function(e,t){return 0==t?""===e:1==t?""!==e&&-1===e.search(","):e.split(",").length==t},maxCount:function(e,t){return 0!=t&&(1==t?-1===e.search(","):e.split(",").length<=t)}}}}(jQuery,window,document),function(e,t,n,i){"use strict";e.isFunction=e.isFunction||function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},t=void 0!==t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),e.fn.accordion=function(n){var i,o=e(this),a=(new Date).getTime(),r=[],s=arguments[0],l="string"==typeof s,c=[].slice.call(arguments,1);return o.each(function(){var u,d,f=e.isPlainObject(n)?e.extend(!0,{},e.fn.accordion.settings,n):e.extend({},e.fn.accordion.settings),m=f.className,g=f.namespace,p=f.selector,v=f.error,h="."+g,b="module-"+g,y=o.selector||"",x=e(this),C=x.find(p.title),w=x.find(p.content),k=this,T=x.data(b);d={initialize:function(){d.debug("Initializing",x),d.bind.events(),f.observeChanges&&d.observeChanges(),d.instantiate()},instantiate:function(){T=d,x.data(b,d)},destroy:function(){d.debug("Destroying previous instance",x),x.off(h).removeData(b)},refresh:function(){C=x.find(p.title),w=x.find(p.content)},observeChanges:function(){"MutationObserver"in t&&((u=new MutationObserver(function(e){d.debug("DOM tree modified, updating selector cache"),d.refresh()})).observe(k,{childList:!0,subtree:!0}),d.debug("Setting up mutation observer",u))},bind:{events:function(){d.debug("Binding delegated events"),x.on(f.on+h,p.trigger,d.event.click)}},event:{click:function(){d.toggle.call(this)}},toggle:function(t){var n=void 0!==t?"number"==typeof t?C.eq(t):e(t).closest(p.title):e(this).closest(p.title),i=n.next(w),o=i.hasClass(m.animating),a=i.hasClass(m.active),r=a&&!o,s=!a&&o;d.debug("Toggling visibility of content",n),r||s?f.collapsible?d.close.call(n):d.debug("Cannot close accordion content collapsing is disabled"):d.open.call(n)},open:function(t){var n=void 0!==t?"number"==typeof t?C.eq(t):e(t).closest(p.title):e(this).closest(p.title),i=n.next(w),o=i.hasClass(m.animating);i.hasClass(m.active)||o?d.debug("Accordion already open, skipping",i):(d.debug("Opening accordion content",n),f.onOpening.call(i),f.onChanging.call(i),f.exclusive&&d.closeOthers.call(n),n.addClass(m.active),i.stop(!0,!0).addClass(m.animating),f.animateChildren&&(void 0!==e.fn.transition&&x.transition("is supported")?i.children().transition({animation:"fade in",queue:!1,useFailSafe:!0,debug:f.debug,verbose:f.verbose,duration:f.duration,skipInlineHidden:!0,onComplete:function(){i.children().removeClass(m.transition)}}):i.children().stop(!0,!0).animate({opacity:1},f.duration,d.resetOpacity)),i.slideDown(f.duration,f.easing,function(){i.removeClass(m.animating).addClass(m.active),d.reset.display.call(this),f.onOpen.call(this),f.onChange.call(this)}))},close:function(t){var n=void 0!==t?"number"==typeof t?C.eq(t):e(t).closest(p.title):e(this).closest(p.title),i=n.next(w),o=i.hasClass(m.animating),a=i.hasClass(m.active);!a&&!(!a&&o)||a&&o||(d.debug("Closing accordion content",i),f.onClosing.call(i),f.onChanging.call(i),n.removeClass(m.active),i.stop(!0,!0).addClass(m.animating),f.animateChildren&&(void 0!==e.fn.transition&&x.transition("is supported")?i.children().transition({animation:"fade out",queue:!1,useFailSafe:!0,debug:f.debug,verbose:f.verbose,duration:f.duration,skipInlineHidden:!0}):i.children().stop(!0,!0).animate({opacity:0},f.duration,d.resetOpacity)),i.slideUp(f.duration,f.easing,function(){i.removeClass(m.animating).removeClass(m.active),d.reset.display.call(this),f.onClose.call(this),f.onChange.call(this)}))},closeOthers:function(t){var n,i,o,a=void 0!==t?C.eq(t):e(this).closest(p.title),r=a.parents(p.content).prev(p.title),s=a.closest(p.accordion),l=p.title+"."+m.active+":visible",c=p.content+"."+m.active+":visible";f.closeNested?o=(n=s.find(l).not(r)).next(w):(n=s.find(l).not(r),i=s.find(c).find(l).not(r),o=(n=n.not(i)).next(w)),n.length>0&&(d.debug("Exclusive enabled, closing other content",n),n.removeClass(m.active),o.removeClass(m.animating).stop(!0,!0),f.animateChildren&&(void 0!==e.fn.transition&&x.transition("is supported")?o.children().transition({animation:"fade out",useFailSafe:!0,debug:f.debug,verbose:f.verbose,duration:f.duration,skipInlineHidden:!0}):o.children().stop(!0,!0).animate({opacity:0},f.duration,d.resetOpacity)),o.slideUp(f.duration,f.easing,function(){e(this).removeClass(m.active),d.reset.display.call(this)}))},reset:{display:function(){d.verbose("Removing inline display from element",this),e(this).css("display",""),""===e(this).attr("style")&&e(this).attr("style","").removeAttr("style")},opacity:function(){d.verbose("Removing inline opacity from element",this),e(this).css("opacity",""),""===e(this).attr("style")&&e(this).attr("style","").removeAttr("style")}},setting:function(t,n){if(d.debug("Changing setting",t,n),e.isPlainObject(t))e.extend(!0,f,t);else{if(void 0===n)return f[t];e.isPlainObject(f[t])?e.extend(!0,f[t],n):f[t]=n}},internal:function(t,n){if(d.debug("Changing internal",t,n),void 0===n)return d[t];e.isPlainObject(t)?e.extend(!0,d,t):d[t]=n},debug:function(){!f.silent&&f.debug&&(f.performance?d.performance.log(arguments):(d.debug=Function.prototype.bind.call(console.info,console,f.name+":"),d.debug.apply(console,arguments)))},verbose:function(){!f.silent&&f.verbose&&f.debug&&(f.performance?d.performance.log(arguments):(d.verbose=Function.prototype.bind.call(console.info,console,f.name+":"),d.verbose.apply(console,arguments)))},error:function(){f.silent||(d.error=Function.prototype.bind.call(console.error,console,f.name+":"),d.error.apply(console,arguments))},performance:{log:function(e){var t,n;f.performance&&(n=(t=(new Date).getTime())-(a||t),a=t,r.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:k,"Execution Time":n})),clearTimeout(d.performance.timer),d.performance.timer=setTimeout(d.performance.display,500)},display:function(){var t=f.name+":",n=0;a=!1,clearTimeout(d.performance.timer),e.each(r,function(e,t){n+=t["Execution Time"]}),t+=" "+n+"ms",y&&(t+=" '"+y+"'"),(void 0!==console.group||void 0!==console.table)&&r.length>0&&(console.groupCollapsed(t),console.table?console.table(r):e.each(r,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),r=[]}},invoke:function(t,n,o){var a,r,s,l=T;return n=n||c,o=k||o,"string"==typeof t&&void 0!==l&&(t=t.split(/[\. ]/),a=t.length-1,e.each(t,function(n,i){var o=n!=a?i+t[n+1].charAt(0).toUpperCase()+t[n+1].slice(1):t;if(e.isPlainObject(l[o])&&n!=a)l=l[o];else{if(void 0!==l[o])return r=l[o],!1;if(!e.isPlainObject(l[i])||n==a)return void 0!==l[i]?(r=l[i],!1):(d.error(v.method,t),!1);l=l[i]}})),e.isFunction(r)?s=r.apply(o,n):void 0!==r&&(s=r),Array.isArray(i)?i.push(s):void 0!==i?i=[i,s]:void 0!==s&&(i=s),r}},l?(void 0===T&&d.initialize(),d.invoke(s)):(void 0!==T&&T.invoke("destroy"),d.initialize())}),void 0!==i?i:this},e.fn.accordion.settings={name:"Accordion",namespace:"accordion",silent:!1,debug:!1,verbose:!1,performance:!0,on:"click",observeChanges:!0,exclusive:!0,collapsible:!0,closeNested:!1,animateChildren:!0,duration:350,easing:"easeOutQuad",onOpening:function(){},onClosing:function(){},onChanging:function(){},onOpen:function(){},onClose:function(){},onChange:function(){},error:{method:"The method you called is not defined"},className:{active:"active",animating:"animating",transition:"transition"},selector:{accordion:".accordion",title:".title",trigger:".title",content:".content"}},e.extend(e.easing,{easeOutQuad:function(e,t,n,i,o){return-i*(t/=o)*(t-2)+n}})}(jQuery,window,document),function(e,t,n,i){"use strict";e.isFunction=e.isFunction||function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},t=void 0!==t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),e.fn.calendar=function(i){var o,a=e(this),r=a.selector||"",s=(new Date).getTime(),l=[],c=arguments[0],u="string"==typeof c,d=[].slice.call(arguments,1),f={5:{row:4,column:3},10:{row:3,column:2},15:{row:2,column:2},20:{row:3,column:1},30:{row:2,column:1}},m=["","one","two","three","four","five","six","seven","eight"];return a.each(function(){var a,g,p,v=e.isPlainObject(i)?e.extend(!0,{},e.fn.calendar.settings,i):e.extend({},e.fn.calendar.settings),h=v.className,b=v.namespace,y=v.selector,x=v.formatter,C=v.parser,w=v.metadata,k=f[v.minTimeGap],T=v.error,S="."+b,D="module-"+b,A=e(this),E=A.find(y.input),F=A.find(y.popup),P=A.find(y.activator),O=this,R=A.data(D),M=!1,I=A.hasClass(h.inverted),j=!1,V=!1;p={initialize:function(){p.debug("Initializing calendar for",O,A),a=p.get.isTouch(),p.setup.config(),p.setup.popup(),p.setup.inline(),p.setup.input(),p.setup.date(),p.create.calendar(),p.bind.events(),p.observeChanges(),p.instantiate()},instantiate:function(){p.verbose("Storing instance of calendar"),R=p,A.data(D,R)},destroy:function(){p.verbose("Destroying previous calendar for",O),A.removeData(D),p.unbind.events(),p.disconnect.classObserver()},setup:{config:function(){null!==p.get.minDate()&&p.set.minDate(A.data(w.minDate)),null!==p.get.maxDate()&&p.set.maxDate(A.data(w.maxDate)),p.setting("type",p.get.type()),p.setting("on",v.on||(E.length?"focus":"click"))},popup:function(){if(!v.inline&&(P.length||(P=A.children().first()).length))if(void 0!==e.fn.popup){if(!F.length){var t=P.parent(),n=0!==t.closest(y.append).length?"appendTo":"prependTo";F=e("<div/>").addClass(h.popup)[n](t)}F.addClass(h.calendar),I&&F.addClass(h.inverted);var i=function(){return p.refreshTooltips(),v.onVisible.apply(F,arguments)},o=v.onHidden;E.length||(F.attr("tabindex","0"),i=function(){return p.refreshTooltips(),p.focus(),v.onVisible.apply(F,arguments)},o=function(){return p.blur(),v.onHidden.apply(F,arguments)});var a=p.setting("on"),r=e.extend({},v.popupOptions,{popup:F,on:a,hoverable:"hover"===a,closable:"click"===a,onShow:function(){return p.set.focusDate(p.get.date()),p.set.mode(p.get.validatedMode(v.startMode)),v.onShow.apply(F,arguments)},onVisible:i,onHide:v.onHide,onHidden:o});p.popup(r)}else p.error(T.popup)},inline:function(){P.length&&!v.inline||(v.inline=!0,F=e("<div/>").addClass(h.calendar).appendTo(A),E.length||F.attr("tabindex","0"))},input:function(){v.touchReadonly&&E.length&&a&&E.prop("readonly",!0),p.check.disabled()},date:function(){var e;v.initialDate?e=C.date(v.initialDate,v):void 0!==A.data(w.date)?e=C.date(A.data(w.date),v):E.length&&(e=C.date(E.val(),v)),p.set.date(e,v.formatInput,!1),p.set.mode(p.get.mode(),!1)}},trigger:{change:function(){var e=E[0];if(e){var t=n.createEvent("HTMLEvents");p.verbose("Triggering native change event"),t.initEvent("change",!0,!1),e.dispatchEvent(t)}}},create:{calendar:function(){var t,n,i,o,a,r,s,l=p.get.mode(),c=new Date,u=p.get.date(),d=p.get.focusDate(),f=p.helper.dateInRange(d||u||v.initialDate||c);d||(d=f,p.set.focusDate(d,!1,!1));var g="year"===l,b="month"===l,y="day"===l,C="hour"===l,T="minute"===l,S="time"===v.type,D=Math.max(v.multiMonth,1),A=y?p.get.monthOffset():0,E=f.getMinutes(),P=f.getHours(),O=f.getDate(),R=f.getMonth()+A,M=f.getFullYear(),j=y?v.showWeekNumbers?8:7:C?4:k.column,V=y||C?6:k.row,L=y?D:1,q=F,z=q.hasClass("left")?"right center":"left center";for(q.empty(),L>1&&(s=e("<div/>").addClass(h.grid).appendTo(q)),o=0;o<L;o++){if(L>1)q=e("<div/>").addClass(h.column).appendTo(s);var N=R+o,H=(new Date(M,N,1).getDay()-v.firstDayOfWeek%7+7)%7;if(!v.constantHeight&&y){var U=new Date(M,N+1,0).getDate()+H;V=Math.ceil(U/7)}var B=g?10:b?1:0,W=y?1:0,Y=C||T?1:0,Q=C||T?O:1,X=new Date(M-B,N-W,Q-Y,P),K=new Date(M+B,N+W,Q+Y,P),$=g?new Date(10*Math.ceil(M/10)-9,0,0):b?new Date(M,0,0):y?new Date(M,N,0):new Date(M,N,O,-1),G=g?new Date(10*Math.ceil(M/10)+1,0,1):b?new Date(M+1,0,1):y?new Date(M,N+1,1):new Date(M,N,O+1),J=l;y&&v.showWeekNumbers&&(J+=" andweek");var Z=e("<table/>").addClass(h.table).addClass(J).addClass(m[j]+" column").appendTo(q);I&&Z.addClass(h.inverted);var _=j;if(!S){var ee=e("<thead/>").appendTo(Z);a=e("<tr/>").appendTo(ee),r=e("<th/>").attr("colspan",""+j).appendTo(a);var te=g||b?new Date(M,0,1):y?new Date(M,N,1):new Date(M,N,O,P,E),ne=e("<span/>").addClass(h.link).appendTo(r);ne.text(x.header(te,l,v));var ie=b?v.disableYear?"day":"year":y?v.disableMonth?"year":"month":"day";if(ne.data(w.mode,ie),0===o){var oe=e("<span/>").addClass(h.prev).appendTo(r);oe.data(w.focusDate,X),oe.toggleClass(h.disabledCell,!p.helper.isDateInRange($,l)),e("<i/>").addClass(h.prevIcon).appendTo(oe)}if(o===L-1){var ae=e("<span/>").addClass(h.next).appendTo(r);ae.data(w.focusDate,K),ae.toggleClass(h.disabledCell,!p.helper.isDateInRange(G,l)),e("<i/>").addClass(h.nextIcon).appendTo(ae)}if(y)for(a=e("<tr/>").appendTo(ee),v.showWeekNumbers&&((r=e("<th/>").appendTo(a)).text(v.text.weekNo),r.addClass(h.weekCell),_--),t=0;t<_;t++)(r=e("<th/>").appendTo(a)).text(x.dayColumnHeader((t+v.firstDayOfWeek)%7,v))}var re=e("<tbody/>").appendTo(Z);for(t=g?10*Math.ceil(M/10)-9:y?1-H:0,n=0;n<V;n++)for(a=e("<tr/>").appendTo(re),y&&v.showWeekNumbers&&((r=e("<th/>").appendTo(a)).text(p.get.weekOfYear(M,N,t+1-v.firstDayOfWeek)),r.addClass(h.weekCell)),i=0;i<_;i++,t++){var se=g?new Date(t,N,1,P,E):b?new Date(M,t,1,P,E):y?new Date(M,N,t,P,E):C?new Date(M,N,O,t):new Date(M,N,O,P,t*v.minTimeGap),le=g?t:b?v.text.monthsShort[t]:y?se.getDate():x.time(se,v,!0);(r=e("<td/>").addClass(h.cell).appendTo(a)).text(le),r.data(w.date,se);var ce,ue=y&&se.getMonth()!==(N+12)%12,de=!v.selectAdjacentDays&&ue||!p.helper.isDateInRange(se,l)||v.isDisabled(se,l)||p.helper.isDisabled(se,l)||!p.helper.isEnabled(se,l);if(de){var fe=p.helper.findDayAsObject(se,l,v.disabledDates);null!==fe&&fe[w.message]&&(r.attr("data-tooltip",fe[w.message]),r.attr("data-position",fe[w.position]||z),(fe[w.inverted]||I&&void 0===fe[w.inverted])&&r.attr("data-inverted",""),fe[w.variation]&&r.attr("data-variation",fe[w.variation]))}else null!==(ce=p.helper.findDayAsObject(se,l,v.eventDates))&&(r.addClass(ce[w.class]||v.eventClass),ce[w.message]&&(r.attr("data-tooltip",ce[w.message]),r.attr("data-position",ce[w.position]||z),(ce[w.inverted]||I&&void 0===ce[w.inverted])&&r.attr("data-inverted",""),ce[w.variation]&&r.attr("data-variation",ce[w.variation])));var me=p.helper.dateEqual(se,u,l),ge=p.helper.dateEqual(se,c,l);r.toggleClass(h.adjacentCell,ue&&!ce),r.toggleClass(h.disabledCell,de),r.toggleClass(h.activeCell,me&&!(ue&&de)),C||T||r.toggleClass(h.todayCell,!ue&&ge);var pe={mode:l,adjacent:ue,disabled:de,active:me,today:ge};x.cell(r,se,pe),p.helper.dateEqual(se,d,l)&&p.set.focusDate(se,!1,!1)}if(v.today){var ve=e("<tr/>").appendTo(re),he=e("<td/>").attr("colspan",""+j).addClass(h.today).appendTo(ve);he.text(x.today(v)),he.data(w.date,c)}p.update.focus(!1,Z),v.inline&&p.refreshTooltips()}}},update:{focus:function(t,n){n=n||F;var i=p.get.mode(),o=p.get.date(),r=p.get.focusDate(),s=p.get.startDate(),l=p.get.endDate(),c=(t?r:null)||o||(a?null:r);n.find("td").each(function(){var t=e(this),n=t.data(w.date);if(n){var o=t.hasClass(h.disabledCell),u=t.hasClass(h.activeCell),d=t.hasClass(h.adjacentCell),f=p.helper.dateEqual(n,r,i),m=!!c&&(!!s&&p.helper.isDateInRange(n,i,s,c)||!!l&&p.helper.isDateInRange(n,i,c,l));t.toggleClass(h.focusCell,f&&(!a||M)&&(!d||v.selectAdjacentDays&&d)&&!o),p.helper.isTodayButton(t)||t.toggleClass(h.rangeCell,m&&!u&&!o)}})}},refresh:function(){p.create.calendar()},refreshTooltips:function(){var n=e(t).width();F.find("td[data-position]").each(function(){var i=e(this),o=t.getComputedStyle(i[0],":after").width.replace(/[^0-9\.]/g,""),a=i.attr("data-position"),r=n-i.width()-(parseInt(o,10)||250)>i.offset().left?"right":"left";-1===a.indexOf(r)&&i.attr("data-position",a.replace(/(left|right)/,r))})},bind:{events:function(){p.debug("Binding events"),F.on("mousedown"+S,p.event.mousedown),F.on("touchstart"+S,p.event.mousedown),F.on("mouseup"+S,p.event.mouseup),F.on("touchend"+S,p.event.mouseup),F.on("mouseover"+S,p.event.mouseover),E.length?(E.on("input"+S,p.event.inputChange),E.on("focus"+S,p.event.inputFocus),E.on("blur"+S,p.event.inputBlur),E.on("keydown"+S,p.event.keydown)):F.on("keydown"+S,p.event.keydown)}},unbind:{events:function(){p.debug("Unbinding events"),F.off(S),E.length&&E.off(S)}},event:{mouseover:function(t){var n=e(t.target).data(w.date),i=1===t.buttons;n&&p.set.focusDate(n,!1,!0,i)},mousedown:function(t){E.length&&t.preventDefault(),M=t.type.indexOf("touch")>=0;var n=e(t.target).data(w.date);n&&p.set.focusDate(n,!1,!0,!0)},mouseup:function(t){p.focus(),t.preventDefault(),t.stopPropagation(),M=!1;var n=e(t.target);if(!n.hasClass("disabled")){var i=n.parent();(i.data(w.date)||i.data(w.focusDate)||i.data(w.mode))&&(n=i);var o=n.data(w.date),a=n.data(w.focusDate),r=n.data(w.mode);if(o&&!1!==v.onSelect.call(O,o,p.get.mode())){var s=n.hasClass(h.today);p.selectDate(o,s)}else a?p.set.focusDate(a):r&&p.set.mode(r)}},keydown:function(e){var t=e.which;if(27!==t&&9!==t||p.popup("hide"),p.popup("is visible"))if(37===t||38===t||39===t||40===t){var n="day"===(d=p.get.mode())?7:"hour"===d?4:"minute"===d?k.column:3,i=37===t?-1:38===t?-n:39==t?1:n;i*="minute"===d?v.minTimeGap:1;var o=p.get.focusDate()||p.get.date()||new Date,a=o.getFullYear()+("year"===d?i:0),r=o.getMonth()+("month"===d?i:0),s=o.getDate()+("day"===d?i:0),l=o.getHours()+("hour"===d?i:0),c=o.getMinutes()+("minute"===d?i:0),u=new Date(a,r,s,l,c);"time"===v.type&&(u=p.helper.mergeDateTime(o,u)),p.helper.isDateInRange(u,d)&&p.set.focusDate(u)}else if(13===t){var d=p.get.mode(),f=p.get.focusDate();f&&!v.isDisabled(f,d)&&!p.helper.isDisabled(f,d)&&p.helper.isEnabled(f,d)&&p.selectDate(f),e.preventDefault(),e.stopPropagation()}38!==t&&40!==t||(e.preventDefault(),p.popup("show"))},inputChange:function(){var e=E.val(),t=C.date(e,v);p.set.date(t,!1)},inputFocus:function(){F.addClass(h.active)},inputBlur:function(){if(F.removeClass(h.active),v.formatInput){var e=p.get.date(),t=x.datetime(e,v);E.val(t)}V&&(p.trigger.change(),V=!1)},class:{mutation:function(e){e.forEach(function(e){"class"===e.attributeName&&p.check.disabled()})}}},observeChanges:function(){"MutationObserver"in t&&(g=new MutationObserver(p.event.class.mutation),p.debug("Setting up mutation observer",g),p.observe.class())},disconnect:{classObserver:function(){E.length&&g&&g.disconnect()}},observe:{class:function(){E.length&&g&&g.observe(A[0],{attributes:!0})}},is:{disabled:function(){return A.hasClass(h.disabled)}},check:{disabled:function(){E.attr("tabindex",p.is.disabled()?-1:0)}},get:{weekOfYear:function(e,t,n){var i,o,a;return i=Date.UTC(e,t,n+3)/864e5,o=Math.floor(i/7),a=new Date(6048e5*o).getUTCFullYear(),o-Math.floor(Date.UTC(a,0,7)/6048e5)+1},date:function(){return p.helper.sanitiseDate(A.data(w.date))||null},inputDate:function(){return E.val()},focusDate:function(){return A.data(w.focusDate)||null},startDate:function(){var e=p.get.calendarModule(v.startCalendar);return(e?e.get.date():A.data(w.startDate))||null},endDate:function(){var e=p.get.calendarModule(v.endCalendar);return(e?e.get.date():A.data(w.endDate))||null},minDate:function(){return A.data(w.minDate)||null},maxDate:function(){return A.data(w.maxDate)||null},monthOffset:function(){return A.data(w.monthOffset)||0},mode:function(){var e=A.data(w.mode)||v.startMode;return p.get.validatedMode(e)},validatedMode:function(t){var n=p.get.validModes();return e.inArray(t,n)>=0?t:"time"===v.type?"hour":"month"===v.type?"month":"year"===v.type?"year":"day"},type:function(){return A.data(w.type)||v.type},validModes:function(){var e=[];return"time"!==v.type&&(v.disableYear&&"year"!==v.type||e.push("year"),(!v.disableMonth&&"year"!==v.type||"month"===v.type)&&e.push("month"),v.type.indexOf("date")>=0&&e.push("day")),v.type.indexOf("time")>=0&&(e.push("hour"),v.disableMinute||e.push("minute")),e},isTouch:function(){try{return n.createEvent("TouchEvent"),!0}catch(e){return!1}},calendarModule:function(t){return t?(t instanceof e||(t=e(t).first()),t.data(D)):null}},set:{date:function(e,t,n){t=!1!==t,n=!1!==n,e=p.helper.sanitiseDate(e),e=p.helper.dateInRange(e);var i=p.get.mode(),o=x.datetime(e,v);if(n&&!1===v.onBeforeChange.call(O,e,o,i))return!1;if(p.set.focusDate(e),v.isDisabled(e,i))return!1;var a=p.get.endDate();a&&e&&e>a&&p.set.endDate(void 0),p.set.dataKeyValue(w.date,e),t&&E.length&&E.val(o),n&&v.onChange.call(O,e,o,i)},startDate:function(e,t){e=p.helper.sanitiseDate(e);var n=p.get.calendarModule(v.startCalendar);n&&n.set.date(e),p.set.dataKeyValue(w.startDate,e,t)},endDate:function(e,t){e=p.helper.sanitiseDate(e);var n=p.get.calendarModule(v.endCalendar);n&&n.set.date(e),p.set.dataKeyValue(w.endDate,e,t)},focusDate:function(e,t,n,i){e=p.helper.sanitiseDate(e),e=p.helper.dateInRange(e);var o="day"===p.get.mode(),a=p.get.focusDate();if(o&&e&&a){var r=12*(e.getFullYear()-a.getFullYear())+e.getMonth()-a.getMonth();if(r){var s=p.get.monthOffset()-r;p.set.monthOffset(s,!1)}}var l=p.set.dataKeyValue(w.focusDate,e,!!e&&t);n=!1!==n&&l&&!1===t||j!=i,j=i,n&&p.update.focus(i)},minDate:function(e){e=p.helper.sanitiseDate(e),null!==v.maxDate&&v.maxDate<=e?p.verbose("Unable to set minDate variable bigger that maxDate variable",e,v.maxDate):(p.setting("minDate",e),p.set.dataKeyValue(w.minDate,e))},maxDate:function(e){e=p.helper.sanitiseDate(e),null!==v.minDate&&v.minDate>=e?p.verbose("Unable to set maxDate variable lower that minDate variable",e,v.minDate):(p.setting("maxDate",e),p.set.dataKeyValue(w.maxDate,e))},monthOffset:function(e,t){var n=Math.max(v.multiMonth,1);e=Math.max(1-n,Math.min(0,e)),p.set.dataKeyValue(w.monthOffset,e,t)},mode:function(e,t){p.set.dataKeyValue(w.mode,e,t)},dataKeyValue:function(e,t,n){var i=A.data(e),o=i===t||i<=t&&i>=t;return t?A.data(e,t):A.removeData(e),(n=!1!==n&&!o)&&p.refresh(),!o}},selectDate:function(e,t){p.verbose("New date selection",e);var n=p.get.mode();if(t||"minute"===n||v.disableMinute&&"hour"===n||"date"===v.type&&"day"===n||"month"===v.type&&"month"===n||"year"===v.type&&"year"===n){if(!(!1===p.set.date(e))&&(V=!0,v.closable)){p.popup("hide");var i=p.get.calendarModule(v.endCalendar);i&&("focus"!==i.setting("on")&&i.popup("show"),i.focus())}}else{var o="year"===n?v.disableMonth?"day":"month":"month"===n?"day":"day"===n?"hour":"minute";p.set.mode(o),"hour"===n||"day"===n&&p.get.date()?p.set.date(e,!0,!1):p.set.focusDate(e)}},changeDate:function(e){p.set.date(e)},clear:function(){p.set.date(void 0)},popup:function(){return P.popup.apply(P,arguments)},focus:function(){E.length?E.focus():F.focus()},blur:function(){E.length?E.blur():F.blur()},helper:{isDisabled:function(e,t){return("day"===t||"month"===t||"year"===t)&&("day"===t&&-1!==v.disabledDaysOfWeek.indexOf(e.getDay())||v.disabledDates.some(function(n){if("string"==typeof n&&(n=p.helper.sanitiseDate(n)),n instanceof Date)return p.helper.dateEqual(e,n,t);if(null!==n&&"object"==typeof n)if(n[w.year]){if("number"==typeof n[w.year])return e.getFullYear()==n[w.year];if(Array.isArray(n[w.year]))return n[w.year].indexOf(e.getFullYear())>-1}else if(n[w.month]){if("number"==typeof n[w.month])return e.getMonth()==n[w.month];if(Array.isArray(n[w.month]))return n[w.month].indexOf(e.getMonth())>-1;if(n[w.month]instanceof Date){var i=p.helper.sanitiseDate(n[w.month]);return e.getMonth()==i.getMonth()&&e.getFullYear()==i.getFullYear()}}else if(n[w.date]&&"day"===t){if(n[w.date]instanceof Date)return p.helper.dateEqual(e,p.helper.sanitiseDate(n[w.date]),t);if(Array.isArray(n[w.date]))return n[w.date].some(function(n){return p.helper.dateEqual(e,n,t)})}}))},isEnabled:function(e,t){return"day"!==t||(0===v.enabledDates.length||v.enabledDates.some(function(n){return"string"==typeof n&&(n=p.helper.sanitiseDate(n)),n instanceof Date?p.helper.dateEqual(e,n,t):null!==n&&"object"==typeof n&&n[w.date]?p.helper.dateEqual(e,p.helper.sanitiseDate(n[w.date]),t):void 0}))},findDayAsObject:function(e,t,n){if("day"===t||"month"===t||"year"===t)for(var i,o=0;o<n.length;o++){if("string"==typeof(i=n[o])&&(i=p.helper.sanitiseDate(i)),i instanceof Date&&p.helper.dateEqual(e,i,t)){var a={};return a[w.date]=i,a}if(null!==i&&"object"==typeof i)if(i[w.year]){if("number"==typeof i[w.year]&&e.getFullYear()==i[w.year])return i;if(Array.isArray(i[w.year])&&i[w.year].indexOf(e.getFullYear())>-1)return i}else if(i[w.month]){if("number"==typeof i[w.month]&&e.getMonth()==i[w.month])return i;if(Array.isArray(i[w.month])){if(i[w.month].indexOf(e.getMonth())>-1)return i}else if(i[w.month]instanceof Date){var r=p.helper.sanitiseDate(i[w.month]);if(e.getMonth()==r.getMonth()&&e.getFullYear()==r.getFullYear())return i}}else if(i[w.date]&&"day"===t){if(i[w.date]instanceof Date&&p.helper.dateEqual(e,p.helper.sanitiseDate(i[w.date]),t))return i;if(Array.isArray(i[w.date])&&i[w.date].some(function(n){return p.helper.dateEqual(e,n,t)}))return i}}return null},sanitiseDate:function(e){return e instanceof Date||(e=C.date(""+e,v)),!e||isNaN(e.getTime())?null:e},dateDiff:function(e,t,n){n=n||"day";var i="time"===v.type,o="year"===n,a=o||"month"===n,r="minute"===n,s=r||"hour"===n;return e=new Date(i?2e3:e.getFullYear(),i?0:o?0:e.getMonth(),i?1:a?1:e.getDate(),s?e.getHours():0,r?v.minTimeGap*Math.floor(e.getMinutes()/v.minTimeGap):0),(t=new Date(i?2e3:t.getFullYear(),i?0:o?0:t.getMonth(),i?1:a?1:t.getDate(),s?t.getHours():0,r?v.minTimeGap*Math.floor(t.getMinutes()/v.minTimeGap):0)).getTime()-e.getTime()},dateEqual:function(e,t,n){return!!e&&!!t&&0===p.helper.dateDiff(e,t,n)},isDateInRange:function(e,t,n,i){if(!n&&!i){var o=p.get.startDate();n=o&&v.minDate?new Date(Math.max(o,v.minDate)):o||v.minDate,i=v.maxDate}return n=n&&new Date(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),v.minTimeGap*Math.ceil(n.getMinutes()/v.minTimeGap)),!(!e||n&&p.helper.dateDiff(e,n,t)>0||i&&p.helper.dateDiff(i,e,t)>0)},dateInRange:function(e,t,n){if(!t&&!n){var i=p.get.startDate();t=i&&v.minDate?new Date(Math.max(i,v.minDate)):i||v.minDate,n=v.maxDate}t=t&&new Date(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),v.minTimeGap*Math.ceil(t.getMinutes()/v.minTimeGap));var o="time"===v.type;return e?t&&p.helper.dateDiff(e,t,"minute")>0?o?p.helper.mergeDateTime(e,t):t:n&&p.helper.dateDiff(n,e,"minute")>0?o?p.helper.mergeDateTime(e,n):n:e:e},mergeDateTime:function(e,t){return e&&t?new Date(e.getFullYear(),e.getMonth(),e.getDate(),t.getHours(),t.getMinutes()):t},isTodayButton:function(e){return e.text()===v.text.today}},setting:function(t,n){if(p.debug("Changing setting",t,n),e.isPlainObject(t))e.extend(!0,v,t);else{if(void 0===n)return v[t];e.isPlainObject(v[t])?e.extend(!0,v[t],n):v[t]=n}},internal:function(t,n){if(e.isPlainObject(t))e.extend(!0,p,t);else{if(void 0===n)return p[t];p[t]=n}},debug:function(){!v.silent&&v.debug&&(v.performance?p.performance.log(arguments):(p.debug=Function.prototype.bind.call(console.info,console,v.name+":"),p.debug.apply(console,arguments)))},verbose:function(){!v.silent&&v.verbose&&v.debug&&(v.performance?p.performance.log(arguments):(p.verbose=Function.prototype.bind.call(console.info,console,v.name+":"),p.verbose.apply(console,arguments)))},error:function(){v.silent||(p.error=Function.prototype.bind.call(console.error,console,v.name+":"),p.error.apply(console,arguments))},performance:{log:function(e){var t,n;v.performance&&(n=(t=(new Date).getTime())-(s||t),s=t,l.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:O,"Execution Time":n})),clearTimeout(p.performance.timer),p.performance.timer=setTimeout(p.performance.display,500)},display:function(){var t=v.name+":",n=0;s=!1,clearTimeout(p.performance.timer),e.each(l,function(e,t){n+=t["Execution Time"]}),t+=" "+n+"ms",r&&(t+=" '"+r+"'"),(void 0!==console.group||void 0!==console.table)&&l.length>0&&(console.groupCollapsed(t),console.table?console.table(l):e.each(l,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),l=[]}},invoke:function(t,n,i){var a,r,s,l=R;return n=n||d,i=O||i,"string"==typeof t&&void 0!==l&&(t=t.split(/[\. ]/),a=t.length-1,e.each(t,function(n,i){var o=n!=a?i+t[n+1].charAt(0).toUpperCase()+t[n+1].slice(1):t;if(e.isPlainObject(l[o])&&n!=a)l=l[o];else{if(void 0!==l[o])return r=l[o],!1;if(!e.isPlainObject(l[i])||n==a)return void 0!==l[i]?(r=l[i],!1):(p.error(T.method,t),!1);l=l[i]}})),e.isFunction(r)?s=r.apply(i,n):void 0!==r&&(s=r),Array.isArray(o)?o.push(s):void 0!==o?o=[o,s]:void 0!==s&&(o=s),r}},u?(void 0===R&&p.initialize(),p.invoke(c)):(void 0!==R&&R.invoke("destroy"),p.initialize())}),void 0!==o?o:this},e.fn.calendar.settings={name:"Calendar",namespace:"calendar",silent:!1,debug:!1,verbose:!1,performance:!1,type:"datetime",firstDayOfWeek:0,constantHeight:!0,today:!1,closable:!0,monthFirst:!0,touchReadonly:!0,inline:!1,on:null,initialDate:null,startMode:!1,minDate:null,maxDate:null,ampm:!0,disableYear:!1,disableMonth:!1,disableMinute:!1,formatInput:!0,startCalendar:null,endCalendar:null,multiMonth:1,minTimeGap:5,showWeekNumbers:null,disabledDates:[],disabledDaysOfWeek:[],enabledDates:[],eventDates:[],centuryBreak:60,currentCentury:2e3,selectAdjacentDays:!1,popupOptions:{position:"bottom left",lastResort:"bottom left",prefer:"opposite",hideOnScroll:!1},text:{days:["S","M","T","W","T","F","S"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],today:"Today",now:"Now",am:"AM",pm:"PM",weekNo:"Week"},formatter:{header:function(e,t,n){return"year"===t?n.formatter.yearHeader(e,n):"month"===t?n.formatter.monthHeader(e,n):"day"===t?n.formatter.dayHeader(e,n):"hour"===t?n.formatter.hourHeader(e,n):n.formatter.minuteHeader(e,n)},yearHeader:function(e,t){var n=10*Math.ceil(e.getFullYear()/10);return n-9+" - "+(n+2)},monthHeader:function(e,t){return e.getFullYear()},dayHeader:function(e,t){return t.text.months[e.getMonth()]+" "+e.getFullYear()},hourHeader:function(e,t){return t.formatter.date(e,t)},minuteHeader:function(e,t){return t.formatter.date(e,t)},dayColumnHeader:function(e,t){return t.text.days[e]},datetime:function(e,t){if(!e)return"";var n="time"===t.type?"":t.formatter.date(e,t),i=t.type.indexOf("time")<0?"":t.formatter.time(e,t,!1);return n+("datetime"===t.type?" ":"")+i},date:function(e,t){if(!e)return"";var n=e.getDate(),i=t.text.months[e.getMonth()],o=e.getFullYear();return"year"===t.type?o:"month"===t.type?i+" "+o:(t.monthFirst?i+" "+n:n+" "+i)+", "+o},time:function(e,t,n){if(!e)return"";var i=e.getHours(),o=e.getMinutes(),a="";return t.ampm&&(a=" "+(i<12?t.text.am:t.text.pm),i=0===i?12:i>12?i-12:i),i+":"+(o<10?"0":"")+o+a},today:function(e){return"date"===e.type?e.text.today:e.text.now},cell:function(e,t,n){}},parser:{date:function(t,n){if(t instanceof Date)return t;if(!t)return null;if(0===(t=String(t).trim()).length)return null;t.match(/^[0-9]{4}[\/\-\.][0-9]{1,2}[\/\-\.][0-9]{1,2}$/)&&(t=t.replace(/[\/\-\.]/g,"/")+" 00:00:00"),t=n.monthFirst||!t.match(/^[0-9]{1,2}[\/\-\.]/)?t:t.replace(/[\/\-\.]/g,"/").replace(/([0-9]+)\/([0-9]+)/,"$2/$1");var i,o,a,r=new Date(t);if(!(null!==t.match(/^[0-9]+$/))&&!isNaN(r.getDate()))return r;t=t.toLowerCase();var s,l,c,u=-1,d=-1,f=-1,m=-1,g=-1,p=void 0,v="time"===n.type,h=n.type.indexOf("time")<0,b=t.split(n.regExp.dateWords),y=t.split(n.regExp.dateNumbers);if(!h)for(p=e.inArray(n.text.am.toLowerCase(),b)>=0||!(e.inArray(n.text.pm.toLowerCase(),b)>=0)&&void 0,i=0;i<y.length;i++)if((l=y[i]).indexOf(":")>=0){if(d<0||u<0)for(c=l.split(":"),a=0;a<Math.min(2,c.length);a++)o=parseInt(c[a]),isNaN(o)&&(o=0),0===a?d=o%24:u=o%60;y.splice(i,1)}if(!v){for(i=0;i<b.length;i++)if(!((s=b[i]).length<=0)){for(o=0;o<n.text.months.length;o++)if(n.text.months[o].substring(0,s.length).toLowerCase()===s){m=o+1;break}if(m>=0)break}for(i=0;i<y.length;i++)if(o=parseInt(y[i]),!isNaN(o)&&o>=n.centuryBreak&&i===y.length-1){o<=99&&(o+=n.currentCentury-100),g=o,y.splice(i,1);break}if(m<0)for(i=0;i<y.length;i++)if(a=i>1||n.monthFirst?i:1===i?0:1,o=parseInt(y[a]),!isNaN(o)&&1<=o&&o<=12){m=o,y.splice(a,1);break}for(i=0;i<y.length;i++)if(o=parseInt(y[i]),!isNaN(o)&&1<=o&&o<=31){f=o,y.splice(i,1);break}if(g<0)for(i=y.length-1;i>=0;i--)if(o=parseInt(y[i]),!isNaN(o)){o<=99&&(o+=n.currentCentury),g=o,y.splice(i,1);break}}if(!h){if(d<0)for(i=0;i<y.length;i++)if(o=parseInt(y[i]),!isNaN(o)&&0<=o&&o<=23){d=o,y.splice(i,1);break}if(u<0)for(i=0;i<y.length;i++)if(o=parseInt(y[i]),!isNaN(o)&&0<=o&&o<=59){u=o,y.splice(i,1);break}}if(u<0&&d<0&&f<0&&m<0&&g<0)return null;u<0&&(u=0),d<0&&(d=0),f<0&&(f=1),m<0&&(m=1),g<0&&(g=(new Date).getFullYear()),void 0!==p&&(p?12===d&&(d=0):d<12&&(d+=12));var x=new Date(g,m-1,f,d,u);return x.getMonth()===m-1&&x.getFullYear()===g||(x=new Date(g,m,0,d,u)),isNaN(x.getTime())?null:x}},onBeforeChange:function(e,t,n){return!0},onChange:function(e,t,n){},onShow:function(){},onVisible:function(){},onHide:function(){},onHidden:function(){},onSelect:function(e,t){},isDisabled:function(e,t){return!1},selector:{popup:".ui.popup",input:"input",activator:"input",append:".inline.field,.inline.fields"},regExp:{dateWords:/[^A-Za-z\u00C0-\u024F]+/g,dateNumbers:/[^\d:]+/g},error:{popup:"UI Popup, a required component is not included in this page",method:"The method you called is not defined."},className:{calendar:"calendar",active:"active",popup:"ui popup",grid:"ui equal width grid",column:"column",table:"ui celled center aligned unstackable table",inverted:"inverted",prev:"prev link",next:"next link",prevIcon:"chevron left icon",nextIcon:"chevron right icon",link:"link",cell:"link",disabledCell:"disabled",weekCell:"disabled",adjacentCell:"adjacent",activeCell:"active",rangeCell:"range",focusCell:"focus",todayCell:"today",today:"today link",disabled:"disabled"},metadata:{date:"date",focusDate:"focusDate",startDate:"startDate",endDate:"endDate",minDate:"minDate",maxDate:"maxDate",mode:"mode",type:"type",monthOffset:"monthOffset",message:"message",class:"class",inverted:"inverted",variation:"variation",position:"position",month:"month",year:"year"},eventClass:"blue"}}(jQuery,window,document),function(e,t,n,i){"use strict";e.isFunction=e.isFunction||function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},t=void 0!==t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),e.fn.checkbox=function(i){var o,a=e(this),r=a.selector||"",s=(new Date).getTime(),l=[],c=arguments[0],u="string"==typeof c,d=[].slice.call(arguments,1);return a.each(function(){var a,f,m=e.extend(!0,{},e.fn.checkbox.settings,i),g=m.className,p=m.namespace,v=m.selector,h=m.error,b="."+p,y="module-"+p,x=e(this),C=e(this).children(v.label),w=e(this).children(v.input),k=w[0],T=!1,S=!1,D=x.data(y),A=this;f={initialize:function(){f.verbose("Initializing checkbox",m),f.create.label(),f.bind.events(),f.set.tabbable(),f.hide.input(),f.observeChanges(),f.instantiate(),f.setup()},instantiate:function(){f.verbose("Storing instance of module",f),D=f,x.data(y,f)},destroy:function(){f.verbose("Destroying module"),f.unbind.events(),f.show.input(),x.removeData(y)},fix:{reference:function(){x.is(v.input)&&(f.debug("Behavior called on <input> adjusting invoked element"),x=x.closest(v.checkbox),f.refresh())}},setup:function(){f.set.initialLoad(),f.is.indeterminate()?(f.debug("Initial value is indeterminate"),f.indeterminate()):f.is.checked()?(f.debug("Initial value is checked"),f.check()):(f.debug("Initial value is unchecked"),f.uncheck()),f.remove.initialLoad()},refresh:function(){C=x.children(v.label),w=x.children(v.input),k=w[0]},hide:{input:function(){f.verbose("Modifying <input> z-index to be unselectable"),w.addClass(g.hidden)}},show:{input:function(){f.verbose("Modifying <input> z-index to be selectable"),w.removeClass(g.hidden)}},observeChanges:function(){"MutationObserver"in t&&((a=new MutationObserver(function(e){f.debug("DOM tree modified, updating selector cache"),f.refresh()})).observe(A,{childList:!0,subtree:!0}),f.debug("Setting up mutation observer",a))},attachEvents:function(t,n){var i=e(t);n=e.isFunction(f[n])?f[n]:f.toggle,i.length>0?(f.debug("Attaching checkbox events to element",t,n),i.on("click"+b,n)):f.error(h.notFound)},preventDefaultOnInputTarget:function(){"undefined"!=typeof event&&null!==event&&e(event.target).is(v.input)&&(f.verbose("Preventing default check action after manual check action"),event.preventDefault())},event:{change:function(e){f.should.ignoreCallbacks()||m.onChange.call(k)},click:function(t){var n=e(t.target);n.is(v.input)?f.verbose("Using default check action on initialized checkbox"):n.is(v.link)?f.debug("Clicking link inside checkbox, skipping toggle"):(f.toggle(),w.focus(),t.preventDefault())},keydown:function(t){var n=t.which,i=13,o=32,a=27,r=37,s=38,l=39,c=40,u=f.get.radios(),d=u.index(x),g=u.length,p=!1;if(n==r||n==s?p=(0===d?g:d)-1:n!=l&&n!=c||(p=d===g-1?0:d+1),!f.should.ignoreCallbacks()&&!1!==p){if(!1===m.beforeUnchecked.apply(k))return f.verbose("Option not allowed to be unchecked, cancelling key navigation"),!1;if(!1===m.beforeChecked.apply(e(u[p]).children(v.input)[0]))return f.verbose("Next option should not allow check, cancelling key navigation"),!1}n==a?(f.verbose("Escape key pressed blurring field"),w.blur(),S=!0):!t.ctrlKey&&(n==o||n==i&&m.enableEnterKey)?(f.verbose("Enter/space key pressed, toggling checkbox"),f.toggle(),S=!0):S=!1},keyup:function(e){S&&e.preventDefault()}},check:function(){f.should.allowCheck()&&(f.debug("Checking checkbox",w),f.set.checked(),f.should.ignoreCallbacks()||(m.onChecked.call(k),f.trigger.change()),f.preventDefaultOnInputTarget())},uncheck:function(){f.should.allowUncheck()&&(f.debug("Unchecking checkbox"),f.set.unchecked(),f.should.ignoreCallbacks()||(m.onUnchecked.call(k),f.trigger.change()),f.preventDefaultOnInputTarget())},indeterminate:function(){f.should.allowIndeterminate()?f.debug("Checkbox is already indeterminate"):(f.debug("Making checkbox indeterminate"),f.set.indeterminate(),f.should.ignoreCallbacks()||(m.onIndeterminate.call(k),f.trigger.change()))},determinate:function(){f.should.allowDeterminate()?f.debug("Checkbox is already determinate"):(f.debug("Making checkbox determinate"),f.set.determinate(),f.should.ignoreCallbacks()||(m.onDeterminate.call(k),f.trigger.change()))},enable:function(){f.is.enabled()?f.debug("Checkbox is already enabled"):(f.debug("Enabling checkbox"),f.set.enabled(),f.should.ignoreCallbacks()||(m.onEnable.call(k),m.onEnabled.call(k),f.trigger.change()))},disable:function(){f.is.disabled()?f.debug("Checkbox is already disabled"):(f.debug("Disabling checkbox"),f.set.disabled(),f.should.ignoreCallbacks()||(m.onDisable.call(k),m.onDisabled.call(k),f.trigger.change()))},get:{radios:function(){var t=f.get.name();return e('input[name="'+t+'"]').closest(v.checkbox)},otherRadios:function(){return f.get.radios().not(x)},name:function(){return w.attr("name")}},is:{initialLoad:function(){return T},radio:function(){return w.hasClass(g.radio)||"radio"==w.attr("type")},indeterminate:function(){return void 0!==w.prop("indeterminate")&&w.prop("indeterminate")},checked:function(){return void 0!==w.prop("checked")&&w.prop("checked")},disabled:function(){return void 0!==w.prop("disabled")&&w.prop("disabled")},enabled:function(){return!f.is.disabled()},determinate:function(){return!f.is.indeterminate()},unchecked:function(){return!f.is.checked()}},should:{allowCheck:function(){return f.is.determinate()&&f.is.checked()&&!f.is.initialLoad()?(f.debug("Should not allow check, checkbox is already checked"),!1):!(!f.should.ignoreCallbacks()&&!1===m.beforeChecked.apply(k))||(f.debug("Should not allow check, beforeChecked cancelled"),!1)},allowUncheck:function(){return f.is.determinate()&&f.is.unchecked()&&!f.is.initialLoad()?(f.debug("Should not allow uncheck, checkbox is already unchecked"),!1):!(!f.should.ignoreCallbacks()&&!1===m.beforeUnchecked.apply(k))||(f.debug("Should not allow uncheck, beforeUnchecked cancelled"),!1)},allowIndeterminate:function(){return f.is.indeterminate()&&!f.is.initialLoad()?(f.debug("Should not allow indeterminate, checkbox is already indeterminate"),!1):!(!f.should.ignoreCallbacks()&&!1===m.beforeIndeterminate.apply(k))||(f.debug("Should not allow indeterminate, beforeIndeterminate cancelled"),!1)},allowDeterminate:function(){return f.is.determinate()&&!f.is.initialLoad()?(f.debug("Should not allow determinate, checkbox is already determinate"),!1):!(!f.should.ignoreCallbacks()&&!1===m.beforeDeterminate.apply(k))||(f.debug("Should not allow determinate, beforeDeterminate cancelled"),!1)},ignoreCallbacks:function(){return T&&!m.fireOnInit}},can:{change:function(){return!(x.hasClass(g.disabled)||x.hasClass(g.readOnly)||w.prop("disabled")||w.prop("readonly"))},uncheck:function(){return"boolean"==typeof m.uncheckable?m.uncheckable:!f.is.radio()}},set:{initialLoad:function(){T=!0},checked:function(){f.verbose("Setting class to checked"),x.removeClass(g.indeterminate).addClass(g.checked),f.is.radio()&&f.uncheckOthers(),f.is.indeterminate()||!f.is.checked()?(f.verbose("Setting state to checked",k),w.prop("indeterminate",!1).prop("checked",!0)):f.debug("Input is already checked, skipping input property change")},unchecked:function(){f.verbose("Removing checked class"),x.removeClass(g.indeterminate).removeClass(g.checked),f.is.indeterminate()||!f.is.unchecked()?(f.debug("Setting state to unchecked"),w.prop("indeterminate",!1).prop("checked",!1)):f.debug("Input is already unchecked")},indeterminate:function(){f.verbose("Setting class to indeterminate"),x.addClass(g.indeterminate),f.is.indeterminate()?f.debug("Input is already indeterminate, skipping input property change"):(f.debug("Setting state to indeterminate"),w.prop("indeterminate",!0))},determinate:function(){f.verbose("Removing indeterminate class"),x.removeClass(g.indeterminate),f.is.determinate()?f.debug("Input is already determinate, skipping input property change"):(f.debug("Setting state to determinate"),w.prop("indeterminate",!1))},disabled:function(){f.verbose("Setting class to disabled"),x.addClass(g.disabled),f.is.disabled()?f.debug("Input is already disabled, skipping input property change"):(f.debug("Setting state to disabled"),w.prop("disabled","disabled"))},enabled:function(){f.verbose("Removing disabled class"),x.removeClass(g.disabled),f.is.enabled()?f.debug("Input is already enabled, skipping input property change"):(f.debug("Setting state to enabled"),w.prop("disabled",!1))},tabbable:function(){f.verbose("Adding tabindex to checkbox"),void 0===w.attr("tabindex")&&w.attr("tabindex",0)}},remove:{initialLoad:function(){T=!1}},trigger:{change:function(){var e=w[0];if(e){var t=n.createEvent("HTMLEvents");f.verbose("Triggering native change event"),t.initEvent("change",!0,!1),e.dispatchEvent(t)}}},create:{label:function(){w.prevAll(v.label).length>0?(w.prev(v.label).detach().insertAfter(w),f.debug("Moving existing label",C)):f.has.label()||(C=e("<label>").insertAfter(w),f.debug("Creating label",C))}},has:{label:function(){return C.length>0}},bind:{events:function(){f.verbose("Attaching checkbox events"),x.on("click"+b,f.event.click).on("change"+b,f.event.change).on("keydown"+b,v.input,f.event.keydown).on("keyup"+b,v.input,f.event.keyup)}},unbind:{events:function(){f.debug("Removing events"),x.off(b)}},uncheckOthers:function(){var e=f.get.otherRadios();f.debug("Unchecking other radios",e),e.removeClass(g.checked)},toggle:function(){f.can.change()?f.is.indeterminate()||f.is.unchecked()?(f.debug("Currently unchecked"),f.check()):f.is.checked()&&f.can.uncheck()&&(f.debug("Currently checked"),f.uncheck()):f.is.radio()||f.debug("Checkbox is read-only or disabled, ignoring toggle")},setting:function(t,n){if(f.debug("Changing setting",t,n),e.isPlainObject(t))e.extend(!0,m,t);else{if(void 0===n)return m[t];e.isPlainObject(m[t])?e.extend(!0,m[t],n):m[t]=n}},internal:function(t,n){if(e.isPlainObject(t))e.extend(!0,f,t);else{if(void 0===n)return f[t];f[t]=n}},debug:function(){!m.silent&&m.debug&&(m.performance?f.performance.log(arguments):(f.debug=Function.prototype.bind.call(console.info,console,m.name+":"),f.debug.apply(console,arguments)))},verbose:function(){!m.silent&&m.verbose&&m.debug&&(m.performance?f.performance.log(arguments):(f.verbose=Function.prototype.bind.call(console.info,console,m.name+":"),f.verbose.apply(console,arguments)))},error:function(){m.silent||(f.error=Function.prototype.bind.call(console.error,console,m.name+":"),f.error.apply(console,arguments))},performance:{log:function(e){var t,n;m.performance&&(n=(t=(new Date).getTime())-(s||t),s=t,l.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:A,"Execution Time":n})),clearTimeout(f.performance.timer),f.performance.timer=setTimeout(f.performance.display,500)},display:function(){var t=m.name+":",n=0;s=!1,clearTimeout(f.performance.timer),e.each(l,function(e,t){n+=t["Execution Time"]}),t+=" "+n+"ms",r&&(t+=" '"+r+"'"),(void 0!==console.group||void 0!==console.table)&&l.length>0&&(console.groupCollapsed(t),console.table?console.table(l):e.each(l,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),l=[]}},invoke:function(t,n,i){var a,r,s,l=D;return n=n||d,i=A||i,"string"==typeof t&&void 0!==l&&(t=t.split(/[\. ]/),a=t.length-1,e.each(t,function(n,i){var o=n!=a?i+t[n+1].charAt(0).toUpperCase()+t[n+1].slice(1):t;if(e.isPlainObject(l[o])&&n!=a)l=l[o];else{if(void 0!==l[o])return r=l[o],!1;if(!e.isPlainObject(l[i])||n==a)return void 0!==l[i]?(r=l[i],!1):(f.error(h.method,t),!1);l=l[i]}})),e.isFunction(r)?s=r.apply(i,n):void 0!==r&&(s=r),Array.isArray(o)?o.push(s):void 0!==o?o=[o,s]:void 0!==s&&(o=s),r}},u?(void 0===D&&f.initialize(),f.invoke(c)):(void 0!==D&&D.invoke("destroy"),f.initialize())}),void 0!==o?o:this},e.fn.checkbox.settings={name:"Checkbox",namespace:"checkbox",silent:!1,debug:!1,verbose:!0,performance:!0,uncheckable:"auto",fireOnInit:!1,enableEnterKey:!0,onChange:function(){},beforeChecked:function(){},beforeUnchecked:function(){},beforeDeterminate:function(){},beforeIndeterminate:function(){},onChecked:function(){},onUnchecked:function(){},onDeterminate:function(){},onIndeterminate:function(){},onEnable:function(){},onDisable:function(){},onEnabled:function(){},onDisabled:function(){},className:{checked:"checked",indeterminate:"indeterminate",disabled:"disabled",hidden:"hidden",radio:"radio",readOnly:"read-only"},error:{method:"The method you called is not defined"},selector:{checkbox:".ui.checkbox",label:"label, .box",input:'input[type="checkbox"], input[type="radio"]',link:"a[href]"}}}(jQuery,window,document),function(e,t,n,i){"use strict";e.isFunction=e.isFunction||function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},t=void 0!==t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),e.fn.dimmer=function(t){var i,o=e(this),a=(new Date).getTime(),r=[],s=arguments[0],l="string"==typeof s,c=[].slice.call(arguments,1);return o.each(function(){var u,d,f,m=e.isPlainObject(t)?e.extend(!0,{},e.fn.dimmer.settings,t):e.extend({},e.fn.dimmer.settings),g=m.selector,p=m.namespace,v=m.className,h=m.error,b="."+p,y="module-"+p,x=o.selector||"",C="ontouchstart"in n.documentElement?"touchstart":"click",w=e(this),k=this,T=w.data(y);(f={preinitialize:function(){f.is.dimmer()?(d=w.parent(),u=w):(d=w,u=f.has.dimmer()?m.dimmerName?d.find(g.dimmer).filter("."+m.dimmerName):d.find(g.dimmer):f.create())},initialize:function(){f.debug("Initializing dimmer",m),f.bind.events(),f.set.dimmable(),f.instantiate()},instantiate:function(){f.verbose("Storing instance of module",f),T=f,w.data(y,T)},destroy:function(){f.verbose("Destroying previous module",u),f.unbind.events(),f.remove.variation(),d.off(b)},bind:{events:function(){"hover"==m.on?d.on("mouseenter"+b,f.show).on("mouseleave"+b,f.hide):"click"==m.on&&d.on(C+b,f.toggle),f.is.page()&&(f.debug("Setting as a page dimmer",d),f.set.pageDimmer()),f.is.closable()&&(f.verbose("Adding dimmer close event",u),d.on(C+b,g.dimmer,f.event.click))}},unbind:{events:function(){w.removeData(y),d.off(b)}},event:{click:function(t){f.verbose("Determining if event occurred on dimmer",t),(0===u.find(t.target).length||e(t.target).is(g.content))&&(f.hide(),t.stopImmediatePropagation())}},addContent:function(t){var n=e(t);f.debug("Add content to dimmer",n),n.parent()[0]!==u[0]&&n.detach().appendTo(u)},create:function(){var t=e(m.template.dimmer(m));return m.dimmerName&&(f.debug("Creating named dimmer",m.dimmerName),t.addClass(m.dimmerName)),t.appendTo(d),t},show:function(t){t=e.isFunction(t)?t:function(){},f.debug("Showing dimmer",u,m),f.set.variation(),f.is.dimmed()&&!f.is.animating()||!f.is.enabled()?f.debug("Dimmer is already shown or disabled"):(f.animate.show(t),m.onShow.call(k),m.onChange.call(k))},hide:function(t){t=e.isFunction(t)?t:function(){},f.is.dimmed()||f.is.animating()?(f.debug("Hiding dimmer",u),f.animate.hide(t),m.onHide.call(k),m.onChange.call(k)):f.debug("Dimmer is not visible")},toggle:function(){f.verbose("Toggling dimmer visibility",u),f.is.dimmed()?f.is.closable()&&f.hide():f.show()},animate:{show:function(t){t=e.isFunction(t)?t:function(){},m.useCSS&&void 0!==e.fn.transition&&u.transition("is supported")?(m.useFlex?(f.debug("Using flex dimmer"),f.remove.legacy()):(f.debug("Using legacy non-flex dimmer"),f.set.legacy()),"auto"!==m.opacity&&f.set.opacity(),u.transition({displayType:m.useFlex?"flex":"block",animation:(m.transition.showMethod||m.transition)+" in",queue:!1,duration:f.get.duration(),useFailSafe:!0,onStart:function(){f.set.dimmed()},onComplete:function(){f.set.active(),t()}})):(f.verbose("Showing dimmer animation with javascript"),f.set.dimmed(),"auto"==m.opacity&&(m.opacity=.8),u.stop().css({opacity:0,width:"100%",height:"100%"}).fadeTo(f.get.duration(),m.opacity,function(){u.removeAttr("style"),f.set.active(),t()}))},hide:function(t){t=e.isFunction(t)?t:function(){},m.useCSS&&void 0!==e.fn.transition&&u.transition("is supported")?(f.verbose("Hiding dimmer with css"),u.transition({displayType:m.useFlex?"flex":"block",animation:(m.transition.hideMethod||m.transition)+" out",queue:!1,duration:f.get.duration(),useFailSafe:!0,onComplete:function(){f.remove.dimmed(),f.remove.variation(),f.remove.active(),t()}})):(f.verbose("Hiding dimmer with javascript"),u.stop().fadeOut(f.get.duration(),function(){f.remove.dimmed(),f.remove.active(),u.removeAttr("style"),t()}))}},get:{dimmer:function(){return u},duration:function(){return f.is.active()?m.transition.hideDuration||m.duration.hide||m.duration:m.transition.showDuration||m.duration.show||m.duration}},has:{dimmer:function(){return m.dimmerName?w.find(g.dimmer).filter("."+m.dimmerName).length>0:w.find(g.dimmer).length>0}},is:{active:function(){return u.hasClass(v.active)},animating:function(){return u.is(":animated")||u.hasClass(v.animating)},closable:function(){return"auto"==m.closable?"hover"!=m.on:m.closable},dimmer:function(){return w.hasClass(v.dimmer)},dimmable:function(){return w.hasClass(v.dimmable)},dimmed:function(){return d.hasClass(v.dimmed)},disabled:function(){return d.hasClass(v.disabled)},enabled:function(){return!f.is.disabled()},page:function(){return d.is("body")},pageDimmer:function(){return u.hasClass(v.pageDimmer)}},can:{show:function(){return!u.hasClass(v.disabled)}},set:{opacity:function(e){var t=u.css("background-color"),n=t.split(","),i=n&&n.length>=3;e=0===m.opacity?0:m.opacity||e,i?(n[2]=n[2].replace(")",""),n[3]=e+")",t=n.join(",")):t="rgba(0, 0, 0, "+e+")",f.debug("Setting opacity to",e),u.css("background-color",t)},legacy:function(){u.addClass(v.legacy)},active:function(){u.addClass(v.active)},dimmable:function(){d.addClass(v.dimmable)},dimmed:function(){d.addClass(v.dimmed)},pageDimmer:function(){u.addClass(v.pageDimmer)},disabled:function(){u.addClass(v.disabled)},variation:function(e){(e=e||m.variation)&&u.addClass(e)}},remove:{active:function(){u.removeClass(v.active)},legacy:function(){u.removeClass(v.legacy)},dimmed:function(){d.removeClass(v.dimmed)},disabled:function(){u.removeClass(v.disabled)},variation:function(e){(e=e||m.variation)&&u.removeClass(e)}},setting:function(t,n){if(f.debug("Changing setting",t,n),e.isPlainObject(t))e.extend(!0,m,t);else{if(void 0===n)return m[t];e.isPlainObject(m[t])?e.extend(!0,m[t],n):m[t]=n}},internal:function(t,n){if(e.isPlainObject(t))e.extend(!0,f,t);else{if(void 0===n)return f[t];f[t]=n}},debug:function(){!m.silent&&m.debug&&(m.performance?f.performance.log(arguments):(f.debug=Function.prototype.bind.call(console.info,console,m.name+":"),f.debug.apply(console,arguments)))},verbose:function(){!m.silent&&m.verbose&&m.debug&&(m.performance?f.performance.log(arguments):(f.verbose=Function.prototype.bind.call(console.info,console,m.name+":"),f.verbose.apply(console,arguments)))},error:function(){m.silent||(f.error=Function.prototype.bind.call(console.error,console,m.name+":"),f.error.apply(console,arguments))},performance:{log:function(e){var t,n;m.performance&&(n=(t=(new Date).getTime())-(a||t),a=t,r.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:k,"Execution Time":n})),clearTimeout(f.performance.timer),f.performance.timer=setTimeout(f.performance.display,500)},display:function(){var t=m.name+":",n=0;a=!1,clearTimeout(f.performance.timer),e.each(r,function(e,t){n+=t["Execution Time"]}),t+=" "+n+"ms",x&&(t+=" '"+x+"'"),o.length>1&&(t+=" ("+o.length+")"),(void 0!==console.group||void 0!==console.table)&&r.length>0&&(console.groupCollapsed(t),console.table?console.table(r):e.each(r,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),r=[]}},invoke:function(t,n,o){var a,r,s,l=T;return n=n||c,o=k||o,"string"==typeof t&&void 0!==l&&(t=t.split(/[\. ]/),a=t.length-1,e.each(t,function(n,i){var o=n!=a?i+t[n+1].charAt(0).toUpperCase()+t[n+1].slice(1):t;if(e.isPlainObject(l[o])&&n!=a)l=l[o];else{if(void 0!==l[o])return r=l[o],!1;if(!e.isPlainObject(l[i])||n==a)return void 0!==l[i]?(r=l[i],!1):(f.error(h.method,t),!1);l=l[i]}})),e.isFunction(r)?s=r.apply(o,n):void 0!==r&&(s=r),Array.isArray(i)?i.push(s):void 0!==i?i=[i,s]:void 0!==s&&(i=s),r}}).preinitialize(),l?(void 0===T&&f.initialize(),f.invoke(s)):(void 0!==T&&T.invoke("destroy"),f.initialize())}),void 0!==i?i:this},e.fn.dimmer.settings={name:"Dimmer",namespace:"dimmer",silent:!1,debug:!1,verbose:!1,performance:!0,useFlex:!0,dimmerName:!1,variation:!1,closable:"auto",useCSS:!0,transition:"fade",on:!1,opacity:"auto",duration:{show:500,hide:500},displayLoader:!1,loaderText:!1,loaderVariation:"",onChange:function(){},onShow:function(){},onHide:function(){},error:{method:"The method you called is not defined."},className:{active:"active",animating:"animating",dimmable:"dimmable",dimmed:"dimmed",dimmer:"dimmer",disabled:"disabled",hide:"hide",legacy:"legacy",pageDimmer:"page",show:"show",loader:"ui loader"},selector:{dimmer:"> .ui.dimmer",content:".ui.dimmer > .content, .ui.dimmer > .content > .center"},template:{dimmer:function(t){var n,i=e("<div/>").addClass("ui dimmer");return t.displayLoader&&(n=e("<div/>").addClass(t.className.loader).addClass(t.loaderVariation),t.loaderText&&(n.text(t.loaderText),n.addClass("text")),i.append(n)),i}}}}(jQuery,window,document),function(e,t,n,i){"use strict";e.isFunction=e.isFunction||function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},t=void 0!==t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),e.fn.dropdown=function(i){var o,a=e(this),r=e(n),s=a.selector||"",l="ontouchstart"in n.documentElement,c=l?"touchstart":"click",u=(new Date).getTime(),d=[],f=arguments[0],m="string"==typeof f,g=[].slice.call(arguments,1);return a.each(function(p){var v,h,b,y,x,C,w,k,T,S,D=e.isPlainObject(i)?e.extend(!0,{},e.fn.dropdown.settings,i):e.extend({},e.fn.dropdown.settings),A=D.className,E=D.message,F=D.fields,P=D.keys,O=D.metadata,R=D.namespace,M=D.regExp,I=D.selector,j=D.error,V=D.templates,L="."+R,q="module-"+R,z=e(this),N=e(D.context),H=z.find(I.text),U=z.find(I.search),B=z.find(I.sizer),W=z.find(I.input),Y=z.find(I.icon),Q=z.find(I.clearIcon),X=z.prev().find(I.text).length>0?z.prev().find(I.text):z.prev(),K=z.children(I.menu),$=K.find(I.item),G=D.hideDividers?$.parent().children(I.divider):e(),J=!1,Z=!1,_=!1,ee=!1,te=this,ne=!1,ie=z.data(q);S={initialize:function(){S.debug("Initializing dropdown",D),S.is.alreadySetup()?S.setup.reference():(D.ignoreDiacritics&&!String.prototype.normalize&&(D.ignoreDiacritics=!1,S.error(j.noNormalize,te)),S.setup.layout(),D.values&&(S.set.initialLoad(),S.change.values(D.values),S.remove.initialLoad()),S.refreshData(),S.save.defaults(),S.restore.selected(),S.create.id(),S.bind.events(),S.observeChanges(),S.instantiate())},instantiate:function(){S.verbose("Storing instance of dropdown",S),ie=S,z.data(q,S)},destroy:function(){S.verbose("Destroying previous dropdown",z),S.remove.tabbable(),S.remove.active(),K.transition("stop all"),K.removeClass(A.visible).addClass(A.hidden),z.off(L).removeData(q),K.off(L),r.off(x),S.disconnect.menuObserver(),S.disconnect.selectObserver(),S.disconnect.classObserver()},observeChanges:function(){"MutationObserver"in t&&(w=new MutationObserver(S.event.select.mutation),k=new MutationObserver(S.event.menu.mutation),T=new MutationObserver(S.event.class.mutation),S.debug("Setting up mutation observer",w,k,T),S.observe.select(),S.observe.menu(),S.observe.class())},disconnect:{menuObserver:function(){k&&k.disconnect()},selectObserver:function(){w&&w.disconnect()},classObserver:function(){T&&T.disconnect()}},observe:{select:function(){S.has.input()&&w&&w.observe(z[0],{childList:!0,subtree:!0})},menu:function(){S.has.menu()&&k&&k.observe(K[0],{childList:!0,subtree:!0})},class:function(){S.has.search()&&T&&T.observe(z[0],{attributes:!0})}},create:{id:function(){C=(Math.random().toString(16)+"000000000").substr(2,8),x="."+C,S.verbose("Creating unique id for element",C)},userChoice:function(t){var n,i,o;return!!(t=t||S.get.userValues())&&(t=Array.isArray(t)?t:[t],e.each(t,function(t,a){!1===S.get.item(a)&&(o=D.templates.addition(S.add.variables(E.addResult,a)),i=e("<div />").html(o).attr("data-"+O.value,a).attr("data-"+O.text,a).addClass(A.addition).addClass(A.item),D.hideAdditions&&i.addClass(A.hidden),n=void 0===n?i:n.add(i),S.verbose("Creating user choices for value",a,i))}),n)},userLabels:function(t){var n=S.get.userValues();n&&(S.debug("Adding user labels",n),e.each(n,function(e,t){S.verbose("Adding custom user value"),S.add.label(t,t)}))},menu:function(){K=e("<div />").addClass(A.menu).appendTo(z)},sizer:function(){B=e("<span />").addClass(A.sizer).insertAfter(U)}},search:function(e){e=void 0!==e?e:S.get.query(),S.verbose("Searching for query",e),!1===D.fireOnInit&&S.is.initialLoad()?S.verbose("Skipping callback on initial load",D.onSearch):S.has.minCharacters(e)&&!1!==D.onSearch.call(te,e)?S.filter(e):S.hide(null,!0)},select:{firstUnfiltered:function(){S.verbose("Selecting first non-filtered element"),S.remove.selectedItem(),$.not(I.unselectable).not(I.addition+I.hidden).eq(0).addClass(A.selected)},nextAvailable:function(e){var t=(e=e.eq(0)).nextAll(I.item).not(I.unselectable).eq(0),n=e.prevAll(I.item).not(I.unselectable).eq(0);t.length>0?(S.verbose("Moving selection to",t),t.addClass(A.selected)):(S.verbose("Moving selection to",n),n.addClass(A.selected))}},setup:{api:function(){var e={debug:D.debug,urlData:{value:S.get.value(),query:S.get.query()},on:!1};S.verbose("First request, initializing API"),z.api(e)},layout:function(){z.is("select")&&(S.setup.select(),S.setup.returnedObject()),S.has.menu()||S.create.menu(),S.is.clearable()&&!S.has.clearItem()&&(S.verbose("Adding clear icon"),Q=e("<i />").addClass("remove icon").insertBefore(H)),S.is.search()&&!S.has.search()&&(S.verbose("Adding search input"),U=e("<input />").addClass(A.search).prop("autocomplete",S.is.chrome()?"fomantic-search":"off").insertBefore(H)),S.is.multiple()&&S.is.searchSelection()&&!S.has.sizer()&&S.create.sizer(),D.allowTab&&S.set.tabbable()},select:function(){var t=S.get.selectValues();S.debug("Dropdown initialized on a select",t),z.is("select")&&(W=z),W.parent(I.dropdown).length>0?(S.debug("UI dropdown already exists. Creating dropdown menu only"),z=W.closest(I.dropdown),S.has.menu()||S.create.menu(),K=z.children(I.menu),S.setup.menu(t)):(S.debug("Creating entire dropdown from select"),z=e("<div />").attr("class",W.attr("class")).addClass(A.selection).addClass(A.dropdown).html(V.dropdown(t,F,D.preserveHTML,D.className)).insertBefore(W),W.hasClass(A.multiple)&&!1===W.prop("multiple")&&(S.error(j.missingMultiple),W.prop("multiple",!0)),W.is("[multiple]")&&S.set.multiple(),W.prop("disabled")&&(S.debug("Disabling dropdown"),z.addClass(A.disabled)),W.removeAttr("required").removeAttr("class").detach().prependTo(z)),S.refresh()},menu:function(t){K.html(V.menu(t,F,D.preserveHTML,D.className)),$=K.find(I.item),G=D.hideDividers?$.parent().children(I.divider):e()},reference:function(){S.debug("Dropdown behavior was called on select, replacing with closest dropdown"),z=z.parent(I.dropdown),ie=z.data(q),te=z.get(0),S.refresh(),S.setup.returnedObject()},returnedObject:function(){var e=a.slice(0,p),t=a.slice(p+1);a=e.add(z).add(t)}},refresh:function(){S.refreshSelectors(),S.refreshData()},refreshItems:function(){$=K.find(I.item),G=D.hideDividers?$.parent().children(I.divider):e()},refreshSelectors:function(){S.verbose("Refreshing selector cache"),H=z.find(I.text),U=z.find(I.search),W=z.find(I.input),Y=z.find(I.icon),X=z.prev().find(I.text).length>0?z.prev().find(I.text):z.prev(),K=z.children(I.menu),$=K.find(I.item),G=D.hideDividers?$.parent().children(I.divider):e()},refreshData:function(){S.verbose("Refreshing cached metadata"),$.removeData(O.text).removeData(O.value)},clearData:function(){S.verbose("Clearing metadata"),$.removeData(O.text).removeData(O.value),z.removeData(O.defaultText).removeData(O.defaultValue).removeData(O.placeholderText)},clearItems:function(){K.empty(),S.refreshItems()},toggle:function(){S.verbose("Toggling menu visibility"),S.is.active()?S.hide():S.show()},show:function(t,n){if(t=e.isFunction(t)?t:function(){},(ne||ee)&&S.is.remote()&&S.is.noApiCache()&&S.clearItems(),!S.can.show()&&S.is.remote()&&(S.debug("No API results retrieved, searching before show"),S.queryRemote(S.get.query(),S.show,[t,n])),S.can.show()&&!S.is.active()){if(S.debug("Showing dropdown"),!S.has.message()||S.has.maxSelections()||S.has.allResultsFiltered()||S.remove.message(),S.is.allFiltered())return!0;!1!==D.onShow.call(te)&&S.animate.show(function(){S.can.click()&&S.bind.intent(),S.has.search()&&!n&&S.focusSearch(),S.set.visible(),t.call(te)})}},hide:function(t,n){t=e.isFunction(t)?t:function(){},S.is.active()&&!S.is.animatingOutward()?(S.debug("Hiding dropdown"),!1!==D.onHide.call(te)&&S.animate.hide(function(){S.remove.visible(),S.is.focusedOnSearch()&&!0!==n&&U.blur(),t.call(te)})):S.can.click()&&S.unbind.intent(),ee=!1,ne=!1},hideOthers:function(){S.verbose("Finding other dropdowns to hide"),a.not(z).has(I.menu+"."+A.visible).dropdown("hide")},hideMenu:function(){S.verbose("Hiding menu  instantaneously"),S.remove.active(),S.remove.visible(),K.transition("hide")},hideSubMenus:function(){var e=K.children(I.item).find(I.menu);S.verbose("Hiding sub menus",e),e.transition("hide")},bind:{events:function(){S.bind.keyboardEvents(),S.bind.inputEvents(),S.bind.mouseEvents()},keyboardEvents:function(){S.verbose("Binding keyboard events"),z.on("keydown"+L,S.event.keydown),S.has.search()&&z.on(S.get.inputEvent()+L,I.search,S.event.input),S.is.multiple()&&r.on("keydown"+x,S.event.document.keydown)},inputEvents:function(){S.verbose("Binding input change events"),z.on("change"+L,I.input,S.event.change)},mouseEvents:function(){S.verbose("Binding mouse events"),S.is.multiple()&&z.on(c+L,I.label,S.event.label.click).on(c+L,I.remove,S.event.remove.click),S.is.searchSelection()?(z.on("mousedown"+L,S.event.mousedown).on("mouseup"+L,S.event.mouseup).on("mousedown"+L,I.menu,S.event.menu.mousedown).on("mouseup"+L,I.menu,S.event.menu.mouseup).on(c+L,I.icon,S.event.icon.click).on(c+L,I.clearIcon,S.event.clearIcon.click).on("focus"+L,I.search,S.event.search.focus).on(c+L,I.search,S.event.search.focus).on("blur"+L,I.search,S.event.search.blur).on(c+L,I.text,S.event.text.focus),S.is.multiple()&&z.on(c+L,S.event.click).on(c+L,S.event.search.focus)):("click"==D.on?z.on(c+L,I.icon,S.event.icon.click).on(c+L,S.event.test.toggle):"hover"==D.on?z.on("mouseenter"+L,S.delay.show).on("mouseleave"+L,S.delay.hide):z.on(D.on+L,S.toggle),z.on("mousedown"+L,S.event.mousedown).on("mouseup"+L,S.event.mouseup).on("focus"+L,S.event.focus).on(c+L,I.clearIcon,S.event.clearIcon.click),S.has.menuSearch()?z.on("blur"+L,I.search,S.event.search.blur):z.on("blur"+L,S.event.blur)),K.on((l?"touchstart":"mouseenter")+L,I.item,S.event.item.mouseenter).on("mouseleave"+L,I.item,S.event.item.mouseleave).on("click"+L,I.item,S.event.item.click)},intent:function(){S.verbose("Binding hide intent event to document"),l&&r.on("touchstart"+x,S.event.test.touch).on("touchmove"+x,S.event.test.touch),r.on(c+x,S.event.test.hide)}},unbind:{intent:function(){S.verbose("Removing hide intent event from document"),l&&r.off("touchstart"+x).off("touchmove"+x),r.off(c+x)}},filter:function(t){var n=void 0!==t?t:S.get.query(),i=function(){S.is.multiple()&&S.filterActive(),(t||!t&&0==S.get.activeItem().length)&&S.select.firstUnfiltered(),S.has.allResultsFiltered()?D.onNoResults.call(te,n)?D.allowAdditions?D.hideAdditions&&(S.verbose("User addition with no menu, setting empty style"),S.set.empty(),S.hideMenu()):(S.verbose("All items filtered, showing message",n),S.add.message(E.noResults)):(S.verbose("All items filtered, hiding dropdown",n),S.hideMenu()):(S.remove.empty(),S.remove.message()),D.allowAdditions&&S.add.userSuggestion(S.escape.htmlEntities(t)),S.is.searchSelection()&&S.can.show()&&S.is.focusedOnSearch()&&S.show()};D.useLabels&&S.has.maxSelections()||(D.apiSettings?S.can.useAPI()?S.queryRemote(n,function(){D.filterRemoteData&&S.filterItems(n);var t=W.val();Array.isArray(t)||(t=t&&""!==t?t.split(D.delimiter):[]),S.is.multiple()&&e.each(t,function(e,t){$.filter('[data-value="'+t+'"]').addClass(A.filtered)}),S.focusSearch(!0),i()}):S.error(j.noAPI):(S.filterItems(n),i()))},queryRemote:function(t,n,i){Array.isArray(i)||(i=[i]);var o={errorDuration:!1,cache:"local",throttle:D.throttle,urlData:{query:t},onError:function(){S.add.message(E.serverError),ee=!1,ne=!1,n.apply(null,i)},onFailure:function(){S.add.message(E.serverError),ee=!1,ne=!1,n.apply(null,i)},onSuccess:function(e){var t=e[F.remoteValues];Array.isArray(t)||(t=[]),S.remove.message();var o={};if(o[F.values]=t,S.setup.menu(o),0!==t.length||D.allowAdditions){var a=S.is.multiple()?S.get.values():S.get.value();""!==a&&(S.verbose("Value(s) present after click icon, select value(s) in items"),S.set.selected(a,null,null,!0))}else S.add.message(E.noResults);ee=!1,ne=!1,n.apply(null,i)}};z.api("get request")||S.setup.api(),o=e.extend(!0,{},o,D.apiSettings),z.api("setting",o).api("query")},filterItems:function(t){var n=S.remove.diacritics(void 0!==t?t:S.get.query()),i=null,o=S.escape.string(n),a=(D.ignoreSearchCase?"i":"")+"gm",r=new RegExp("^"+o,a);S.has.query()&&(i=[],S.verbose("Searching for matching values",n),$.each(function(){var t,o,a=e(this);if(a.hasClass(A.unfilterable))return i.push(this),!0;if("both"===D.match||"text"===D.match){if(-1!==(t=S.remove.diacritics(String(S.get.choiceText(a,!1)))).search(r))return i.push(this),!0;if("exact"===D.fullTextSearch&&S.exactSearch(n,t))return i.push(this),!0;if(!0===D.fullTextSearch&&S.fuzzySearch(n,t))return i.push(this),!0}if("both"===D.match||"value"===D.match){if(-1!==(o=S.remove.diacritics(String(S.get.choiceValue(a,t)))).search(r))return i.push(this),!0;if("exact"===D.fullTextSearch&&S.exactSearch(n,o))return i.push(this),!0;if(!0===D.fullTextSearch&&S.fuzzySearch(n,o))return i.push(this),!0}})),S.debug("Showing only matched items",n),S.remove.filteredItem(),i&&$.not(i).addClass(A.filtered),S.has.query()?!0===D.hideDividers?G.addClass(A.hidden):"empty"===D.hideDividers&&G.removeClass(A.hidden).filter(function(){var t=e(this).nextUntil(I.item);return 0===(t.length?t:e(this)).nextUntil(I.divider).filter(I.item+":not(."+A.filtered+")").length}).addClass(A.hidden):G.removeClass(A.hidden)},fuzzySearch:function(e,t){var n=t.length,i=e.length;if(e=D.ignoreSearchCase?e.toLowerCase():e,t=D.ignoreSearchCase?t.toLowerCase():t,i>n)return!1;if(i===n)return e===t;e:for(var o=0,a=0;o<i;o++){for(var r=e.charCodeAt(o);a<n;)if(t.charCodeAt(a++)===r)continue e;return!1}return!0},exactSearch:function(e,t){return e=D.ignoreSearchCase?e.toLowerCase():e,(t=D.ignoreSearchCase?t.toLowerCase():t).indexOf(e)>-1},filterActive:function(){D.useLabels&&$.filter("."+A.active).addClass(A.filtered)},focusSearch:function(e){S.has.search()&&!S.is.focusedOnSearch()&&(e?(z.off("focus"+L,I.search),U.focus(),z.on("focus"+L,I.search,S.event.search.focus)):U.focus())},blurSearch:function(){S.has.search()&&U.blur()},forceSelection:function(){var e=$.not(A.filtered).filter("."+A.selected).eq(0),t=$.not(A.filtered).filter("."+A.active).eq(0),n=e.length>0?e:t,i=n.length>0;D.allowAdditions||i&&!S.is.multiple()?(S.debug("Forcing partial selection to selected item",n),S.event.item.click.call(n,{},!0)):S.remove.searchTerm()},change:{values:function(t){D.allowAdditions||S.clear(),S.debug("Creating dropdown with specified values",t);var n={};n[F.values]=t,S.setup.menu(n),e.each(t,function(e,t){if(1==t.selected&&(S.debug("Setting initial selection to",t[F.value]),S.set.selected(t[F.value]),!S.is.multiple()))return!1}),S.has.selectInput()&&(S.disconnect.selectObserver(),W.html(""),W.append("<option disabled selected value></option>"),e.each(t,function(e,t){var n=D.templates.deQuote(t[F.value]),i=D.templates.escape(t[F.name]||"",D.preserveHTML);W.append('<option value="'+n+'">'+i+"</option>")}),S.observe.select())}},event:{change:function(){_||(S.debug("Input changed, updating selection"),S.set.selected())},focus:function(){D.showOnFocus&&!J&&S.is.hidden()&&!b&&(ne=!0,S.show())},blur:function(e){b=n.activeElement===this,J||b||(S.remove.activeLabel(),S.hide())},mousedown:function(){S.is.searchSelection()?y=!0:J=!0},mouseup:function(){S.is.searchSelection()?y=!1:J=!1},click:function(t){e(t.target).is(z)&&(S.is.focusedOnSearch()?S.show():S.focusSearch())},search:{focus:function(e){J=!0,S.is.multiple()&&S.remove.activeLabel(),ne||S.is.active()||!(D.showOnFocus||"focus"!==e.type&&"focusin"!==e.type)||(ne=!0,S.search())},blur:function(e){b=n.activeElement===this,S.is.searchSelection()&&!y&&(Z||b||(D.forceSelection?S.forceSelection():D.allowAdditions||S.remove.searchTerm(),S.hide())),y=!1}},clearIcon:{click:function(e){S.clear(),S.is.searchSelection()&&S.remove.searchTerm(),S.hide(),e.stopPropagation()}},icon:{click:function(e){ee=!0,S.has.search()?S.is.active()?S.blurSearch():D.showOnFocus?S.focusSearch():S.toggle():S.toggle(),e.stopPropagation()}},text:{focus:function(e){J=!0,S.focusSearch()}},input:function(e){(S.is.multiple()||S.is.searchSelection())&&S.set.filtered(),clearTimeout(S.timer),S.timer=setTimeout(S.search,D.delay.search)},label:{click:function(t){var n=e(this),i=z.find(I.label),o=i.filter("."+A.active),a=n.nextAll("."+A.active),r=n.prevAll("."+A.active),s=a.length>0?n.nextUntil(a).add(o).add(n):n.prevUntil(r).add(o).add(n);t.shiftKey?(o.removeClass(A.active),s.addClass(A.active)):t.ctrlKey?n.toggleClass(A.active):(o.removeClass(A.active),n.addClass(A.active)),D.onLabelSelect.apply(this,i.filter("."+A.active)),t.stopPropagation()}},remove:{click:function(t){var n=e(this).parent();n.hasClass(A.active)?S.remove.activeLabels():S.remove.activeLabels(n),t.stopPropagation()}},test:{toggle:function(e){var t=S.is.multiple()?S.show:S.toggle;S.is.bubbledLabelClick(e)||S.is.bubbledIconClick(e)||((!S.is.multiple()||S.is.multiple()&&!S.is.active())&&(ne=!0),S.determine.eventOnElement(e,t)&&e.preventDefault())},touch:function(e){S.determine.eventOnElement(e,function(){"touchstart"==e.type?S.timer=setTimeout(function(){S.hide()},D.delay.touch):"touchmove"==e.type&&clearTimeout(S.timer)}),e.stopPropagation()},hide:function(t){S.determine.eventInModule(t,S.hide)&&te.id&&e(t.target).attr("for")===te.id&&t.preventDefault()}},class:{mutation:function(e){e.forEach(function(e){"class"===e.attributeName&&S.check.disabled()})}},select:{mutation:function(e){S.debug("<select> modified, recreating menu"),S.is.selectMutation(e)&&(S.disconnect.selectObserver(),S.refresh(),S.setup.select(),S.set.selected(),S.observe.select())}},menu:{mutation:function(t){var n=t[0],i=n.addedNodes?e(n.addedNodes[0]):e(!1),o=n.removedNodes?e(n.removedNodes[0]):e(!1),a=i.add(o),r=a.is(I.addition)||a.closest(I.addition).length>0,s=a.is(I.message)||a.closest(I.message).length>0;r||s?(S.debug("Updating item selector cache"),S.refreshItems()):(S.debug("Menu modified, updating selector cache"),S.refresh())},mousedown:function(){Z=!0},mouseup:function(){Z=!1}},item:{mouseenter:function(t){var n=e(t.target),i=e(this),o=i.children(I.menu),a=i.siblings(I.item).children(I.menu),r=o.length>0;!(o.find(n).length>0)&&r&&(clearTimeout(S.itemTimer),S.itemTimer=setTimeout(function(){S.verbose("Showing sub-menu",o),e.each(a,function(){S.animate.hide(!1,e(this))}),S.animate.show(!1,o)},D.delay.show),t.preventDefault())},mouseleave:function(t){var n=e(this).children(I.menu);n.length>0&&(clearTimeout(S.itemTimer),S.itemTimer=setTimeout(function(){S.verbose("Hiding sub-menu",n),S.animate.hide(!1,n)},D.delay.hide))},click:function(t,i){var o=e(this),a=e(t?t.target:""),r=o.find(I.menu),s=S.get.choiceText(o),l=S.get.choiceValue(o,s),c=r.length>0,u=r.find(a).length>0;"input"!==n.activeElement.tagName.toLowerCase()&&e(n.activeElement).blur(),u||c&&!D.allowCategorySelection||(S.is.searchSelection()&&(D.allowAdditions&&S.remove.userAddition(),S.remove.searchTerm(),S.is.focusedOnSearch()||1==i||S.focusSearch(!0)),D.useLabels||(S.remove.filteredItem(),S.set.scrollPosition(o)),S.determine.selectAction.call(this,s,l))}},document:{keydown:function(e){var t=e.which;if(S.is.inObject(t,P)){var n=z.find(I.label),i=n.filter("."+A.active),o=(i.data(O.value),n.index(i)),a=n.length,r=i.length>0,s=i.length>1,l=0===o,c=o+1==a,u=S.is.searchSelection(),d=S.is.focusedOnSearch(),f=S.is.focused(),m=d&&0===S.get.caretPosition(!1),g=m&&0!==S.get.caretPosition(!0);if(u&&!r&&!d)return;t==P.leftArrow?!f&&!m||r?r&&(e.shiftKey?S.verbose("Adding previous label to selection"):(S.verbose("Selecting previous label"),n.removeClass(A.active)),l&&!s?i.addClass(A.active):i.prev(I.siblingLabel).addClass(A.active).end(),e.preventDefault()):(S.verbose("Selecting previous label"),n.last().addClass(A.active)):t==P.rightArrow?(f&&!r&&n.first().addClass(A.active),r&&(e.shiftKey?S.verbose("Adding next label to selection"):(S.verbose("Selecting next label"),n.removeClass(A.active)),c?u?d?n.removeClass(A.active):S.focusSearch():s?i.next(I.siblingLabel).addClass(A.active):i.addClass(A.active):i.next(I.siblingLabel).addClass(A.active),e.preventDefault())):t==P.deleteKey||t==P.backspace?r?(S.verbose("Removing active labels"),c&&u&&!d&&S.focusSearch(),i.last().next(I.siblingLabel).addClass(A.active),S.remove.activeLabels(i),e.preventDefault()):!m||g||r||t!=P.backspace||(S.verbose("Removing last label on input backspace"),i=n.last().addClass(A.active),S.remove.activeLabels(i)):i.removeClass(A.active)}}},keydown:function(e){var t=e.which;if(S.is.inObject(t,P)){var n,i=$.not(I.unselectable).filter("."+A.selected).eq(0),o=K.children("."+A.active).eq(0),a=i.length>0?i:o,r=a.length>0?a.siblings(":not(."+A.filtered+")").addBack():K.children(":not(."+A.filtered+")"),s=a.children(I.menu),l=a.closest(I.menu),c=l.hasClass(A.visible)||l.hasClass(A.animating)||l.parent(I.menu).length>0,u=s.length>0,d=a.length>0,f=a.not(I.unselectable).length>0,m=t==P.delimiter&&D.allowAdditions&&S.is.multiple();if(D.allowAdditions&&D.hideAdditions&&(t==P.enter||m)&&f&&(S.verbose("Selecting item from keyboard shortcut",a),S.event.item.click.call(a,e),S.is.searchSelection()&&S.remove.searchTerm(),S.is.multiple()&&e.preventDefault()),S.is.visible()){if((t==P.enter||m)&&(t==P.enter&&d&&u&&!D.allowCategorySelection?(S.verbose("Pressed enter on unselectable category, opening sub menu"),t=P.rightArrow):f&&(S.verbose("Selecting item from keyboard shortcut",a),S.event.item.click.call(a,e),S.is.searchSelection()&&(S.remove.searchTerm(),S.is.multiple()&&U.focus())),e.preventDefault()),d&&(t==P.leftArrow&&l[0]!==K[0]&&(S.verbose("Left key pressed, closing sub-menu"),S.animate.hide(!1,l),a.removeClass(A.selected),l.closest(I.item).addClass(A.selected),e.preventDefault()),t==P.rightArrow&&u&&(S.verbose("Right key pressed, opening sub-menu"),S.animate.show(!1,s),a.removeClass(A.selected),s.find(I.item).eq(0).addClass(A.selected),e.preventDefault())),t==P.upArrow){if(n=d&&c?a.prevAll(I.item+":not("+I.unselectable+")").eq(0):$.eq(0),r.index(n)<0)return S.verbose("Up key pressed but reached top of current menu"),void e.preventDefault();S.verbose("Up key pressed, changing active item"),a.removeClass(A.selected),n.addClass(A.selected),S.set.scrollPosition(n),D.selectOnKeydown&&S.is.single()&&S.set.selectedItem(n),e.preventDefault()}if(t==P.downArrow){if(0===(n=d&&c?n=a.nextAll(I.item+":not("+I.unselectable+")").eq(0):$.eq(0)).length)return S.verbose("Down key pressed but reached bottom of current menu"),void e.preventDefault();S.verbose("Down key pressed, changing active item"),$.removeClass(A.selected),n.addClass(A.selected),S.set.scrollPosition(n),D.selectOnKeydown&&S.is.single()&&S.set.selectedItem(n),e.preventDefault()}t==P.pageUp&&(S.scrollPage("up"),e.preventDefault()),t==P.pageDown&&(S.scrollPage("down"),e.preventDefault()),t==P.escape&&(S.verbose("Escape key pressed, closing dropdown"),S.hide())}else m&&e.preventDefault(),t!=P.downArrow||S.is.visible()||(S.verbose("Down key pressed, showing dropdown"),S.show(),e.preventDefault())}else S.has.search()||S.set.selectedLetter(String.fromCharCode(t))}},trigger:{change:function(){var e=W[0];if(e){var t=n.createEvent("HTMLEvents");S.verbose("Triggering native change event"),t.initEvent("change",!0,!1),e.dispatchEvent(t)}}},determine:{selectAction:function(t,n){v=!0,S.verbose("Determining action",D.action),e.isFunction(S.action[D.action])?(S.verbose("Triggering preset action",D.action,t,n),S.action[D.action].call(te,t,n,this)):e.isFunction(D.action)?(S.verbose("Triggering user action",D.action,t,n),D.action.call(te,t,n,this)):S.error(j.action,D.action),v=!1},eventInModule:function(t,i){var o=e(t.target),a=o.closest(n.documentElement).length>0,r=o.closest(z).length>0;return i=e.isFunction(i)?i:function(){},a&&!r?(S.verbose("Triggering event",i),i(),!0):(S.verbose("Event occurred in dropdown, canceling callback"),!1)},eventOnElement:function(t,i){var o=e(t.target),a=o.closest(I.siblingLabel),r=n.body.contains(t.target),s=0===z.find(a).length||!(S.is.multiple()&&D.useLabels),l=0===o.closest(K).length;return i=e.isFunction(i)?i:function(){},r&&s&&l?(S.verbose("Triggering event",i),i(),!0):(S.verbose("Event occurred in dropdown menu, canceling callback"),!1)}},action:{nothing:function(){},activate:function(t,n,i){n=void 0!==n?n:t,S.can.activate(e(i))&&(S.set.selected(n,e(i)),S.is.multiple()||S.hideAndClear())},select:function(t,n,i){n=void 0!==n?n:t,S.can.activate(e(i))&&(S.set.value(n,t,e(i)),S.is.multiple()||S.hideAndClear())},combo:function(t,n,i){n=void 0!==n?n:t,S.set.selected(n,e(i)),S.hideAndClear()},hide:function(t,n,i){S.set.value(n,t,e(i)),S.hideAndClear()}},get:{id:function(){return C},defaultText:function(){return z.data(O.defaultText)},defaultValue:function(){return z.data(O.defaultValue)},placeholderText:function(){return"auto"!=D.placeholder&&"string"==typeof D.placeholder?D.placeholder:z.data(O.placeholderText)||""},text:function(){return D.preserveHTML?H.html():H.text()},query:function(){return String(U.val()).trim()},searchWidth:function(e){return e=void 0!==e?e:U.val(),B.text(e),Math.ceil(B.width()+1)},selectionCount:function(){var e=S.get.values();return S.is.multiple()?Array.isArray(e)?e.length:0:""!==S.get.value()?1:0},transition:function(e){return"auto"===D.transition?S.is.upward(e)?"slide up":"slide down":D.transition},userValues:function(){var t=S.get.values();return!!t&&(t=Array.isArray(t)?t:[t],e.grep(t,function(e){return!1===S.get.item(e)}))},uniqueArray:function(t){return e.grep(t,function(n,i){return e.inArray(n,t)===i})},caretPosition:function(e){var t,i,o=U.get(0);return e&&"selectionEnd"in o?o.selectionEnd:!e&&"selectionStart"in o?o.selectionStart:n.selection?(o.focus(),i=(t=n.selection.createRange()).text.length,e?i:(t.moveStart("character",-o.value.length),t.text.length-i)):void 0},value:function(){var e=W.length>0?W.val():z.data(O.value),t=Array.isArray(e)&&1===e.length&&""===e[0];return void 0===e||t?"":e},values:function(e){var t=S.get.value();return""===t?"":!S.has.selectInput()&&S.is.multiple()?"string"==typeof t?(e?t:S.escape.htmlEntities(t)).split(D.delimiter):"":t},remoteValues:function(){var t=S.get.values(),n=!1;return t&&("string"==typeof t&&(t=[t]),e.each(t,function(e,t){var i=S.read.remoteData(t);S.verbose("Restoring value from session data",i,t),i&&(n||(n={}),n[t]=i)})),n},choiceText:function(e,t){if(t=void 0!==t?t:D.preserveHTML,e)return e.find(I.menu).length>0&&(S.verbose("Retrieving text of element with sub-menu"),(e=e.clone()).find(I.menu).remove(),e.find(I.menuIcon).remove()),void 0!==e.data(O.text)?e.data(O.text):t?e.html()&&e.html().trim():e.text()&&e.text().trim()},choiceValue:function(e,t){return t=t||S.get.choiceText(e),!!e&&(void 0!==e.data(O.value)?String(e.data(O.value)):"string"==typeof t?String(D.ignoreSearchCase?t.toLowerCase():t).trim():String(t))},inputEvent:function(){var e=U[0];return!!e&&(void 0!==e.oninput?"input":void 0!==e.onpropertychange?"propertychange":"keyup")},selectValues:function(){var t={},n=[],i=[];return z.find("option").each(function(){var o=e(this),a=o.html(),r=o.attr("disabled"),s=void 0!==o.attr("value")?o.attr("value"):a,l=void 0!==o.data(O.text)?o.data(O.text):a,c=o.parent("optgroup");"auto"===D.placeholder&&""===s?t.placeholder=a:(c.length===n.length&&c[0]===n[0]||(i.push({type:"header",divider:D.headerDivider,name:c.attr("label")||""}),n=c),i.push({name:a,value:s,text:l,disabled:r}))}),D.placeholder&&"auto"!==D.placeholder&&(S.debug("Setting placeholder value to",D.placeholder),t.placeholder=D.placeholder),D.sortSelect?(!0===D.sortSelect?i.sort(function(e,t){return e.name.localeCompare(t.name)}):"natural"===D.sortSelect?i.sort(function(e,t){return e.name.toLowerCase().localeCompare(t.name.toLowerCase())}):e.isFunction(D.sortSelect)&&i.sort(D.sortSelect),t[F.values]=i,S.debug("Retrieved and sorted values from select",t)):(t[F.values]=i,S.debug("Retrieved values from select",t)),t},activeItem:function(){return $.filter("."+A.active)},selectedItem:function(){var e=$.not(I.unselectable).filter("."+A.selected);return e.length>0?e:$.eq(0)},itemWithAdditions:function(e){var t=S.get.item(e),n=S.create.userChoice(e);return n&&n.length>0&&(t=t.length>0?t.add(n):n),t},item:function(t,n){var i,o,a=!1;return t=void 0!==t?t:void 0!==S.get.values()?S.get.values():S.get.text(),i=(o=S.is.multiple()&&Array.isArray(t))?t.length>0:null!=t,n=""===t||!1===t||!0===t||(n||!1),i&&$.each(function(){var i=e(this),r=S.get.choiceText(i),s=S.get.choiceValue(i,r);if(null!=s)if(o)-1!==e.inArray(S.escape.htmlEntities(String(s)),t.map(function(e){return String(e)}))&&(a=a?a.add(i):i);else if(n){if(S.verbose("Ambiguous dropdown value using strict type check",i,t),s===t)return a=i,!0}else if(D.ignoreCase&&(s=s.toLowerCase(),t=t.toLowerCase()),S.escape.htmlEntities(String(s))===S.escape.htmlEntities(String(t)))return S.verbose("Found select item by value",s,t),a=i,!0}),a},displayType:function(){return z.hasClass("column")?"flex":D.displayType}},check:{maxSelections:function(e){return!D.maxSelections||((e=void 0!==e?e:S.get.selectionCount())>=D.maxSelections?(S.debug("Maximum selection count reached"),D.useLabels&&($.addClass(A.filtered),S.add.message(E.maxSelections)),!0):(S.verbose("No longer at maximum selection count"),S.remove.message(),S.remove.filteredItem(),S.is.searchSelection()&&S.filterItems(),!1))},disabled:function(){U.attr("tabindex",S.is.disabled()?-1:0)}},restore:{defaults:function(e){S.clear(e),S.restore.defaultText(),S.restore.defaultValue()},defaultText:function(){var e=S.get.defaultText();e===S.get.placeholderText?(S.debug("Restoring default placeholder text",e),S.set.placeholderText(e)):(S.debug("Restoring default text",e),S.set.text(e))},placeholderText:function(){S.set.placeholderText()},defaultValue:function(){var e=S.get.defaultValue();void 0!==e&&(S.debug("Restoring default value",e),""!==e?(S.set.value(e),S.set.selected()):(S.remove.activeItem(),S.remove.selectedItem()))},labels:function(){D.allowAdditions&&(D.useLabels||(S.error(j.labels),D.useLabels=!0),S.debug("Restoring selected values"),S.create.userLabels()),S.check.maxSelections()},selected:function(){S.restore.values(),S.is.multiple()?(S.debug("Restoring previously selected values and labels"),S.restore.labels()):S.debug("Restoring previously selected values")},values:function(){S.set.initialLoad(),D.apiSettings&&D.saveRemoteData&&S.get.remoteValues()?S.restore.remoteValues():S.set.selected();var e=S.get.value();!e||""===e||Array.isArray(e)&&0===e.length?W.addClass(A.noselection):W.removeClass(A.noselection),S.remove.initialLoad()},remoteValues:function(){var t=S.get.remoteValues();S.debug("Recreating selected from session data",t),t&&(S.is.single()?e.each(t,function(e,t){S.set.text(t)}):e.each(t,function(e,t){S.add.label(e,t)}))}},read:{remoteData:function(e){var n;if(void 0!==t.Storage)return void 0!==(n=sessionStorage.getItem(e))&&n;S.error(j.noStorage)}},save:{defaults:function(){S.save.defaultText(),S.save.placeholderText(),S.save.defaultValue()},defaultValue:function(){var e=S.get.value();S.verbose("Saving default value as",e),z.data(O.defaultValue,e)},defaultText:function(){var e=S.get.text();S.verbose("Saving default text as",e),z.data(O.defaultText,e)},placeholderText:function(){var e;!1!==D.placeholder&&H.hasClass(A.placeholder)&&(e=S.get.text(),S.verbose("Saving placeholder text as",e),z.data(O.placeholderText,e))},remoteData:function(e,n){void 0!==t.Storage?(S.verbose("Saving remote data to session storage",n,e),sessionStorage.setItem(n,e)):S.error(j.noStorage)}},clear:function(e){S.is.multiple()&&D.useLabels?S.remove.labels(z.find(I.label),e):(S.remove.activeItem(),S.remove.selectedItem(),S.remove.filteredItem()),S.set.placeholderText(),S.clearValue(e)},clearValue:function(e){S.set.value("",null,null,e)},scrollPage:function(e,t){var n,i,o=t||S.get.selectedItem(),a=o.closest(I.menu),r=a.outerHeight(),s=a.scrollTop(),l=$.eq(0).outerHeight(),c=Math.floor(r/l),u=(a.prop("scrollHeight"),"up"==e?s-l*c:s+l*c),d=$.not(I.unselectable);i="up"==e?d.index(o)-c:d.index(o)+c,(n=("up"==e?i>=0:i<d.length)?d.eq(i):"up"==e?d.first():d.last()).length>0&&(S.debug("Scrolling page",e,n),o.removeClass(A.selected),n.addClass(A.selected),D.selectOnKeydown&&S.is.single()&&S.set.selectedItem(n),a.scrollTop(u))},set:{filtered:function(){var e=S.is.multiple(),t=S.is.searchSelection(),n=e&&t,i=t?S.get.query():"",o="string"==typeof i&&i.length>0,a=S.get.searchWidth(),r=""!==i;e&&o&&(S.verbose("Adjusting input width",a,D.glyphWidth),U.css("width",a)),o||n&&r?(S.verbose("Hiding placeholder text"),H.addClass(A.filtered)):(!e||n&&!r)&&(S.verbose("Showing placeholder text"),H.removeClass(A.filtered))},empty:function(){z.addClass(A.empty)},loading:function(){z.addClass(A.loading)},placeholderText:function(e){e=e||S.get.placeholderText(),S.debug("Setting placeholder text",e),S.set.text(e),H.addClass(A.placeholder)},tabbable:function(){S.is.searchSelection()?(S.debug("Added tabindex to searchable dropdown"),U.val(""),S.check.disabled(),K.attr("tabindex",-1)):(S.debug("Added tabindex to dropdown"),void 0===z.attr("tabindex")&&(z.attr("tabindex",0),K.attr("tabindex",-1)))},initialLoad:function(){S.verbose("Setting initial load"),h=!0},activeItem:function(e){D.allowAdditions&&e.filter(I.addition).length>0?e.addClass(A.filtered):e.addClass(A.active)},partialSearch:function(e){var t=S.get.query().length;U.val(e.substr(0,t))},scrollPosition:function(e,t){var n,i,o,a,r,s;n=(e=e||S.get.selectedItem()).closest(I.menu),i=e&&e.length>0,t=void 0!==t&&t,0===S.get.activeItem().length&&(t=!1),e&&n.length>0&&i&&(e.position().top,n.addClass(A.loading),o=(a=n.scrollTop())-n.offset().top+e.offset().top,t||(s=a+n.height()<o+5,r=o-5<a),S.debug("Scrolling to active item",o),(t||r||s)&&n.scrollTop(o),n.removeClass(A.loading))},text:function(e){"combo"===D.action?(S.debug("Changing combo button text",e,X),D.preserveHTML?X.html(e):X.text(e)):"activate"===D.action&&(e!==S.get.placeholderText()&&H.removeClass(A.placeholder),S.debug("Changing text",e,H),H.removeClass(A.filtered),D.preserveHTML?H.html(e):H.text(e))},selectedItem:function(e){var t=S.get.choiceValue(e),n=S.get.choiceText(e,!1),i=S.get.choiceText(e,!0);S.debug("Setting user selection to item",e),S.remove.activeItem(),S.set.partialSearch(n),S.set.activeItem(e),S.set.selected(t,e),S.set.text(i)},selectedLetter:function(t){var n,i=$.filter("."+A.selected),o=i.length>0&&S.has.firstLetter(i,t),a=!1;o&&(n=i.nextAll($).eq(0),S.has.firstLetter(n,t)&&(a=n)),a||$.each(function(){if(S.has.firstLetter(e(this),t))return a=e(this),!1}),a&&(S.verbose("Scrolling to next value with letter",t),S.set.scrollPosition(a),i.removeClass(A.selected),a.addClass(A.selected),D.selectOnKeydown&&S.is.single()&&S.set.selectedItem(a))},direction:function(e){"auto"==D.direction?(e?S.is.upward(e)&&S.remove.upward(e):S.remove.upward(),S.can.openDownward(e)?S.remove.upward(e):S.set.upward(e),S.is.leftward(e)||S.can.openRightward(e)||S.set.leftward(e)):"upward"==D.direction&&S.set.upward(e)},upward:function(e){(e||z).addClass(A.upward)},leftward:function(e){(e||K).addClass(A.leftward)},value:function(e,t,n,i){void 0===e||""===e||Array.isArray(e)&&0===e.length?W.addClass(A.noselection):W.removeClass(A.noselection);var o=S.escape.value(e),a=W.length>0,r=S.get.values(),s=void 0!==e?String(e):e;if(a){if(!D.allowReselection&&s==r&&(S.verbose("Skipping value update already same value",e,r),!S.is.initialLoad()))return;S.is.single()&&S.has.selectInput()&&S.can.extendSelect()&&(S.debug("Adding user option",e),S.add.optionValue(e)),S.debug("Updating input value",o,r),_=!0,W.val(o),!1===D.fireOnInit&&S.is.initialLoad()?S.debug("Input native change event ignored on initial load"):!0!==i&&S.trigger.change(),_=!1}else S.verbose("Storing value in metadata",o,W),o!==r&&z.data(O.value,s);!1===D.fireOnInit&&S.is.initialLoad()?S.verbose("No callback on initial load",D.onChange):!0!==i&&D.onChange.call(te,e,t,n)},active:function(){z.addClass(A.active)},multiple:function(){z.addClass(A.multiple)},visible:function(){z.addClass(A.visible)},exactly:function(e,t){S.debug("Setting selected to exact values"),S.clear(),S.set.selected(e,t)},selected:function(t,n,i,o){var a=S.is.multiple();(n=D.allowAdditions?n||S.get.itemWithAdditions(t):n||S.get.item(t))&&(S.debug("Setting selected menu item to",n),S.is.multiple()&&S.remove.searchWidth(),S.is.single()?(S.remove.activeItem(),S.remove.selectedItem()):D.useLabels&&S.remove.selectedItem(),n.each(function(){var t=e(this),r=S.get.choiceText(t),s=S.get.choiceValue(t,r),l=t.hasClass(A.filtered),c=t.hasClass(A.active),u=t.hasClass(A.addition),d=a&&1==n.length;a?!c||u?(D.apiSettings&&D.saveRemoteData&&S.save.remoteData(r,s),D.useLabels?(S.add.label(s,r,d),S.add.value(s,r,t),S.set.activeItem(t),S.filterActive(),S.select.nextAvailable(n)):(S.add.value(s,r,t),S.set.text(S.add.variables(E.count)),S.set.activeItem(t))):l||!D.useLabels&&!v||(S.debug("Selected active value, removing label"),S.remove.selected(s)):(D.apiSettings&&D.saveRemoteData&&S.save.remoteData(r,s),o||S.set.text(r),S.set.value(s,r,t,i),t.addClass(A.active).addClass(A.selected))}),o||S.remove.searchTerm())}},add:{label:function(t,n,i){var o,a=S.is.searchSelection()?U:H,r=S.escape.value(t);D.ignoreCase&&(r=r.toLowerCase()),o=e("<a />").addClass(A.label).attr("data-"+O.value,r).html(V.label(r,n,D.preserveHTML,D.className)),o=D.onLabelCreate.call(o,r,n),S.has.label(t)?S.debug("User selection already exists, skipping",r):(D.label.variation&&o.addClass(D.label.variation),!0===i?(S.debug("Animating in label",o),o.addClass(A.hidden).insertBefore(a).transition({animation:D.label.transition,debug:D.debug,verbose:D.verbose,duration:D.label.duration})):(S.debug("Adding selection label",o),o.insertBefore(a)))},message:function(t){var n=K.children(I.message),i=D.templates.message(S.add.variables(t));n.length>0?n.html(i):n=e("<div/>").html(i).addClass(A.message).appendTo(K)},optionValue:function(t){var n=S.escape.value(t);W.find('option[value="'+S.escape.string(n)+'"]').length>0||(S.disconnect.selectObserver(),S.is.single()&&(S.verbose("Removing previous user addition"),W.find("option."+A.addition).remove()),e("<option/>").prop("value",n).addClass(A.addition).html(t).appendTo(W),S.verbose("Adding user addition as an <option>",t),S.observe.select())},userSuggestion:function(e){var t,n=K.children(I.addition),i=S.get.item(e),o=i&&i.not(I.addition).length,a=n.length>0;D.useLabels&&S.has.maxSelections()||(""===e||o?n.remove():(a?(n.data(O.value,e).data(O.text,e).attr("data-"+O.value,e).attr("data-"+O.text,e).removeClass(A.filtered),D.hideAdditions||(t=D.templates.addition(S.add.variables(E.addResult,e)),n.html(t)),S.verbose("Replacing user suggestion with new value",n)):((n=S.create.userChoice(e)).prependTo(K),S.verbose("Adding item choice to menu corresponding with user choice addition",n)),D.hideAdditions&&!S.is.allFiltered()||n.addClass(A.selected).siblings().removeClass(A.selected),S.refreshItems()))},variables:function(e,t){var n,i,o=-1!==e.search("{count}"),a=-1!==e.search("{maxCount}"),r=-1!==e.search("{term}");return S.verbose("Adding templated variables to message",e),o&&(n=S.get.selectionCount(),e=e.replace("{count}",n)),a&&(n=S.get.selectionCount(),e=e.replace("{maxCount}",D.maxSelections)),r&&(i=t||S.get.query(),e=e.replace("{term}",i)),e},value:function(e,t,n){var i,o=S.get.values(!0);S.has.value(e)?S.debug("Value already selected"):""!==e?(Array.isArray(o)?(i=o.concat([e]),i=S.get.uniqueArray(i)):i=[e],S.has.selectInput()?S.can.extendSelect()&&(S.debug("Adding value to select",e,i,W),S.add.optionValue(e)):(i=i.join(D.delimiter),S.debug("Setting hidden input to delimited value",i,W)),!1===D.fireOnInit&&S.is.initialLoad()?S.verbose("Skipping onadd callback on initial load",D.onAdd):D.onAdd.call(te,e,t,n),S.set.value(i,t,n),S.check.maxSelections()):S.debug("Cannot select blank values from multiselect")}},remove:{active:function(){z.removeClass(A.active)},activeLabel:function(){z.find(I.label).removeClass(A.active)},empty:function(){z.removeClass(A.empty)},loading:function(){z.removeClass(A.loading)},initialLoad:function(){h=!1},upward:function(e){(e||z).removeClass(A.upward)},leftward:function(e){(e||K).removeClass(A.leftward)},visible:function(){z.removeClass(A.visible)},activeItem:function(){$.removeClass(A.active)},filteredItem:function(){D.useLabels&&S.has.maxSelections()||(D.useLabels&&S.is.multiple()?$.not("."+A.active).removeClass(A.filtered):$.removeClass(A.filtered),D.hideDividers&&G.removeClass(A.hidden),S.remove.empty())},optionValue:function(e){var t=S.escape.value(e),n=W.find('option[value="'+S.escape.string(t)+'"]');n.length>0&&n.hasClass(A.addition)&&(w&&(w.disconnect(),S.verbose("Temporarily disconnecting mutation observer")),n.remove(),S.verbose("Removing user addition as an <option>",t),w&&w.observe(W[0],{childList:!0,subtree:!0}))},message:function(){K.children(I.message).remove()},searchWidth:function(){U.css("width","")},searchTerm:function(){S.verbose("Cleared search term"),U.val(""),S.set.filtered()},userAddition:function(){$.filter(I.addition).remove()},selected:function(t,n,i){if(!(n=D.allowAdditions?n||S.get.itemWithAdditions(t):n||S.get.item(t)))return!1;n.each(function(){var t=e(this),n=S.get.choiceText(t),o=S.get.choiceValue(t,n);S.is.multiple()?D.useLabels?(S.remove.value(o,n,t,i),S.remove.label(o)):(S.remove.value(o,n,t,i),0===S.get.selectionCount()?S.set.placeholderText():S.set.text(S.add.variables(E.count))):S.remove.value(o,n,t,i),t.removeClass(A.filtered).removeClass(A.active),D.useLabels&&t.removeClass(A.selected)})},selectedItem:function(){$.removeClass(A.selected)},value:function(e,t,n,i){var o,a=S.get.values();e=S.escape.htmlEntities(e),S.has.selectInput()?(S.verbose("Input is <select> removing selected option",e),o=S.remove.arrayValue(e,a),S.remove.optionValue(e)):(S.verbose("Removing from delimited values",e),o=(o=S.remove.arrayValue(e,a)).join(D.delimiter)),!1===D.fireOnInit&&S.is.initialLoad()?S.verbose("No callback on initial load",D.onRemove):D.onRemove.call(te,e,t,n),S.set.value(o,t,n,i),S.check.maxSelections()},arrayValue:function(t,n){return Array.isArray(n)||(n=[n]),n=e.grep(n,function(e){return t!=e}),S.verbose("Removed value from delimited string",t,n),n},label:function(e,t){var n=S.escape.value(e),i=z.find(I.label).filter("[data-"+O.value+'="'+S.escape.string(D.ignoreCase?n.toLowerCase():n)+'"]');S.verbose("Removing label",i),i.remove()},activeLabels:function(e){e=e||z.find(I.label).filter("."+A.active),S.verbose("Removing active label selections",e),S.remove.labels(e)},labels:function(t,n){t=t||z.find(I.label),S.verbose("Removing labels",t),t.each(function(){var t=e(this),i=t.data(O.value),o=void 0!==i?String(i):i,a=S.is.userValue(o);!1!==D.onLabelRemove.call(t,i)?(S.remove.message(),a?(S.remove.value(o,o,S.get.item(o),n),S.remove.label(o)):S.remove.selected(o,!1,n)):S.debug("Label remove callback cancelled removal")})},tabbable:function(){S.is.searchSelection()?(S.debug("Searchable dropdown initialized"),U.removeAttr("tabindex"),K.removeAttr("tabindex")):(S.debug("Simple selection dropdown initialized"),z.removeAttr("tabindex"),K.removeAttr("tabindex"))},diacritics:function(e){return D.ignoreDiacritics?e.normalize("NFD").replace(/[\u0300-\u036f]/g,""):e}},has:{menuSearch:function(){return S.has.search()&&U.closest(K).length>0},clearItem:function(){return Q.length>0},search:function(){return U.length>0},sizer:function(){return B.length>0},selectInput:function(){return W.is("select")},minCharacters:function(e){return D.minCharacters&&!ee?(e=void 0!==e?String(e):String(S.get.query())).length>=D.minCharacters:(ee=!1,!0)},firstLetter:function(e,t){var n;return!(!e||0===e.length||"string"!=typeof t)&&(n=S.get.choiceText(e,!1),(t=t.toLowerCase())==String(n).charAt(0).toLowerCase())},input:function(){return W.length>0},items:function(){return $.length>0},menu:function(){return K.length>0},subMenu:function(e){return(e||K).find(I.menu).length>0},message:function(){return 0!==K.children(I.message).length},label:function(e){var t=S.escape.value(e),n=z.find(I.label);return D.ignoreCase&&(t=t.toLowerCase()),n.filter("[data-"+O.value+'="'+S.escape.string(t)+'"]').length>0},maxSelections:function(){return D.maxSelections&&S.get.selectionCount()>=D.maxSelections},allResultsFiltered:function(){var e=$.not(I.addition);return e.filter(I.unselectable).length===e.length},userSuggestion:function(){return K.children(I.addition).length>0},query:function(){return""!==S.get.query()},value:function(e){return D.ignoreCase?S.has.valueIgnoringCase(e):S.has.valueMatchingCase(e)},valueMatchingCase:function(t){var n=S.get.values(!0);return!!(Array.isArray(n)?n&&-1!==e.inArray(t,n):n==t)},valueIgnoringCase:function(t){var n=S.get.values(!0),i=!1;return Array.isArray(n)||(n=[n]),e.each(n,function(e,n){if(String(t).toLowerCase()==String(n).toLowerCase())return i=!0,!1}),i}},is:{active:function(){return z.hasClass(A.active)},animatingInward:function(){return K.transition("is inward")},animatingOutward:function(){return K.transition("is outward")},bubbledLabelClick:function(t){return e(t.target).is("select, input")&&z.closest("label").length>0},bubbledIconClick:function(t){return e(t.target).closest(Y).length>0},chrome:function(){return!(!t.chrome||!t.chrome.webstore&&!t.chrome.runtime)},alreadySetup:function(){return z.is("select")&&void 0!==z.parent(I.dropdown).data(q)&&0===z.prev().length},animating:function(e){return e?e.transition&&e.transition("is animating"):K.transition&&K.transition("is animating")},leftward:function(e){return(e||K).hasClass(A.leftward)},clearable:function(){return z.hasClass(A.clearable)||D.clearable},disabled:function(){return z.hasClass(A.disabled)},focused:function(){return n.activeElement===z[0]},focusedOnSearch:function(){return n.activeElement===U[0]},allFiltered:function(){return(S.is.multiple()||S.has.search())&&!(0==D.hideAdditions&&S.has.userSuggestion())&&!S.has.message()&&S.has.allResultsFiltered()},hidden:function(e){return!S.is.visible(e)},initialLoad:function(){return h},inObject:function(t,n){var i=!1;return e.each(n,function(e,n){if(n==t)return i=!0,!0}),i},multiple:function(){return z.hasClass(A.multiple)},remote:function(){return D.apiSettings&&S.can.useAPI()},noApiCache:function(){return D.apiSettings&&!D.apiSettings.cache},single:function(){return!S.is.multiple()},selectMutation:function(t){var n=!1;return e.each(t,function(t,i){if(e(i.target).is("select")||e(i.addedNodes).is("select"))return n=!0,!1}),n},search:function(){return z.hasClass(A.search)},searchSelection:function(){return S.has.search()&&1===U.parent(I.dropdown).length},selection:function(){return z.hasClass(A.selection)},userValue:function(t){return-1!==e.inArray(t,S.get.userValues())},upward:function(e){return(e||z).hasClass(A.upward)},visible:function(e){return e?e.hasClass(A.visible):K.hasClass(A.visible)},verticallyScrollableContext:function(){var e=N.get(0)!==t&&N.css("overflow-y");return"auto"==e||"scroll"==e},horizontallyScrollableContext:function(){var e=N.get(0)!==t&&N.css("overflow-X");return"auto"==e||"scroll"==e}},can:{activate:function(e){return!!D.useLabels||(!S.has.maxSelections()||!(!S.has.maxSelections()||!e.hasClass(A.active)))},openDownward:function(e){var n,i,o=e||K,a=!0;return o.addClass(A.loading),i={context:{offset:N.get(0)===t?{top:0,left:0}:N.offset(),scrollTop:N.scrollTop(),height:N.outerHeight()},menu:{offset:o.offset(),height:o.outerHeight()}},S.is.verticallyScrollableContext()&&(i.menu.offset.top+=i.context.scrollTop),S.has.subMenu(o)&&(i.menu.height+=o.find(I.menu).first().outerHeight()),(n={above:i.context.scrollTop<=i.menu.offset.top-i.context.offset.top-i.menu.height,below:i.context.scrollTop+i.context.height>=i.menu.offset.top-i.context.offset.top+i.menu.height}).below?(S.verbose("Dropdown can fit in context downward",n),a=!0):n.below||n.above?(S.verbose("Dropdown cannot fit below, opening upward",n),a=!1):(S.verbose("Dropdown cannot fit in either direction, favoring downward",n),a=!0),o.removeClass(A.loading),a},openRightward:function(e){var n,i,o=e||K,a=!0;return o.addClass(A.loading),i={context:{offset:N.get(0)===t?{top:0,left:0}:N.offset(),scrollLeft:N.scrollLeft(),width:N.outerWidth()},menu:{offset:o.offset(),width:o.outerWidth()}},S.is.horizontallyScrollableContext()&&(i.menu.offset.left+=i.context.scrollLeft),(n=i.menu.offset.left-i.context.offset.left+i.menu.width>=i.context.scrollLeft+i.context.width)&&(S.verbose("Dropdown cannot fit in context rightward",n),a=!1),o.removeClass(A.loading),a},click:function(){return l||"click"==D.on},extendSelect:function(){return D.allowAdditions||D.apiSettings},show:function(){return!S.is.disabled()&&(S.has.items()||S.has.message())},useAPI:function(){return void 0!==e.fn.api}},animate:{show:function(t,n){var i,o=n||K,a=n?function(){}:function(){S.hideSubMenus(),S.hideOthers(),S.set.active()};t=e.isFunction(t)?t:function(){},S.verbose("Doing menu show animation",o),S.set.direction(n),i=D.transition.showMethod||S.get.transition(n),S.is.selection()&&S.set.scrollPosition(S.get.selectedItem(),!0),(S.is.hidden(o)||S.is.animating(o))&&("none"===i?(a(),o.transition({displayType:S.get.displayType()}).transition("show"),t.call(te)):void 0!==e.fn.transition&&z.transition("is supported")?o.transition({animation:i+" in",debug:D.debug,verbose:D.verbose,duration:D.transition.showDuration||D.duration,queue:!0,onStart:a,displayType:S.get.displayType(),onComplete:function(){t.call(te)}}):S.error(j.noTransition,i))},hide:function(t,n){var i=n||K,o=n?function(){}:function(){S.can.click()&&S.unbind.intent(),S.remove.active()},a=D.transition.hideMethod||S.get.transition(n);t=e.isFunction(t)?t:function(){},(S.is.visible(i)||S.is.animating(i))&&(S.verbose("Doing menu hide animation",i),"none"===a?(o(),i.transition({displayType:S.get.displayType()}).transition("hide"),t.call(te)):void 0!==e.fn.transition&&z.transition("is supported")?i.transition({animation:a+" out",duration:D.transition.hideDuration||D.duration,debug:D.debug,verbose:D.verbose,queue:!1,onStart:o,displayType:S.get.displayType(),onComplete:function(){t.call(te)}}):S.error(j.transition))}},hideAndClear:function(){S.remove.searchTerm(),S.has.maxSelections()||(S.has.search()?S.hide(function(){S.remove.filteredItem()}):S.hide())},delay:{show:function(){S.verbose("Delaying show event to ensure user intent"),clearTimeout(S.timer),S.timer=setTimeout(S.show,D.delay.show)},hide:function(){S.verbose("Delaying hide event to ensure user intent"),clearTimeout(S.timer),S.timer=setTimeout(S.hide,D.delay.hide)}},escape:{value:function(t){var n=Array.isArray(t),i="string"==typeof t,o=!i&&!n,a=i&&-1!==t.search(M.quote),r=[];return o||!a?t:(S.debug("Encoding quote values for use in select",t),n?(e.each(t,function(e,t){r.push(t.replace(M.quote,"&quot;"))}),r):t.replace(M.quote,"&quot;"))},string:function(e){return(e=String(e)).replace(M.escape,"\\$&")},htmlEntities:function(e){var t={"<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"};return/[&<>"'`]/.test(e)?(e=e.replace(/&(?![a-z0-9#]{1,6};)/,"&amp;")).replace(/[<>"'`]/g,function(e){return t[e]}):e}},setting:function(t,n){if(S.debug("Changing setting",t,n),e.isPlainObject(t))e.extend(!0,D,t);else{if(void 0===n)return D[t];e.isPlainObject(D[t])?e.extend(!0,D[t],n):D[t]=n}},internal:function(t,n){if(e.isPlainObject(t))e.extend(!0,S,t);else{if(void 0===n)return S[t];S[t]=n}},debug:function(){!D.silent&&D.debug&&(D.performance?S.performance.log(arguments):(S.debug=Function.prototype.bind.call(console.info,console,D.name+":"),S.debug.apply(console,arguments)))},verbose:function(){!D.silent&&D.verbose&&D.debug&&(D.performance?S.performance.log(arguments):(S.verbose=Function.prototype.bind.call(console.info,console,D.name+":"),S.verbose.apply(console,arguments)))},error:function(){D.silent||(S.error=Function.prototype.bind.call(console.error,console,D.name+":"),S.error.apply(console,arguments))},performance:{log:function(e){var t,n;D.performance&&(n=(t=(new Date).getTime())-(u||t),u=t,d.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:te,"Execution Time":n})),clearTimeout(S.performance.timer),S.performance.timer=setTimeout(S.performance.display,500)},display:function(){var t=D.name+":",n=0;u=!1,clearTimeout(S.performance.timer),e.each(d,function(e,t){n+=t["Execution Time"]}),t+=" "+n+"ms",s&&(t+=" '"+s+"'"),(void 0!==console.group||void 0!==console.table)&&d.length>0&&(console.groupCollapsed(t),console.table?console.table(d):e.each(d,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),d=[]}},invoke:function(t,n,i){var a,r,s,l=ie;return n=n||g,i=te||i,"string"==typeof t&&void 0!==l&&(t=t.split(/[\. ]/),a=t.length-1,e.each(t,function(n,i){var o=n!=a?i+t[n+1].charAt(0).toUpperCase()+t[n+1].slice(1):t;if(e.isPlainObject(l[o])&&n!=a)l=l[o];else{if(void 0!==l[o])return r=l[o],!1;if(!e.isPlainObject(l[i])||n==a)return void 0!==l[i]?(r=l[i],!1):(S.error(j.method,t),!1);l=l[i]}})),e.isFunction(r)?s=r.apply(i,n):void 0!==r&&(s=r),Array.isArray(o)?o.push(s):void 0!==o?o=[o,s]:void 0!==s&&(o=s),r}},m?(void 0===ie&&S.initialize(),S.invoke(f)):(void 0!==ie&&ie.invoke("destroy"),S.initialize())}),void 0!==o?o:a},e.fn.dropdown.settings={silent:!1,debug:!1,verbose:!1,performance:!0,on:"click",action:"activate",values:!1,clearable:!1,apiSettings:!1,selectOnKeydown:!0,minCharacters:0,filterRemoteData:!1,saveRemoteData:!0,throttle:200,context:t,direction:"auto",keepOnScreen:!0,match:"both",fullTextSearch:!1,ignoreDiacritics:!1,hideDividers:!1,placeholder:"auto",preserveHTML:!0,sortSelect:!1,forceSelection:!0,allowAdditions:!1,ignoreCase:!1,ignoreSearchCase:!0,hideAdditions:!0,maxSelections:!1,useLabels:!0,delimiter:",",showOnFocus:!0,allowReselection:!1,allowTab:!0,allowCategorySelection:!1,fireOnInit:!1,transition:"auto",duration:200,displayType:!1,glyphWidth:1.037,headerDivider:!0,label:{transition:"scale",duration:200,variation:!1},delay:{hide:300,show:200,search:20,touch:50},onChange:function(e,t,n){},onAdd:function(e,t,n){},onRemove:function(e,t,n){},onSearch:function(e){},onLabelSelect:function(e){},onLabelCreate:function(t,n){return e(this)},onLabelRemove:function(e){return!0},onNoResults:function(e){return!0},onShow:function(){},onHide:function(){},name:"Dropdown",namespace:"dropdown",message:{addResult:"Add <b>{term}</b>",count:"{count} selected",maxSelections:"Max {maxCount} selections",noResults:"No results found.",serverError:"There was an error contacting the server"},error:{action:"You called a dropdown action that was not defined",alreadySetup:"Once a select has been initialized behaviors must be called on the created ui dropdown",labels:"Allowing user additions currently requires the use of labels.",missingMultiple:"<select> requires multiple property to be set to correctly preserve multiple values",method:"The method you called is not defined.",noAPI:"The API module is required to load resources remotely",noStorage:"Saving remote data requires session storage",noTransition:"This module requires ui transitions <https://github.com/Semantic-Org/UI-Transition>",noNormalize:'"ignoreDiacritics" setting will be ignored. Browser does not support String().normalize(). You may consider including <https://cdn.jsdelivr.net/npm/unorm@1.4.1/lib/unorm.min.js> as a polyfill.'},regExp:{escape:/[-[\]{}()*+?.,\\^$|#\s:=@]/g,quote:/"/g},metadata:{defaultText:"defaultText",defaultValue:"defaultValue",placeholderText:"placeholder",text:"text",value:"value"},fields:{remoteValues:"results",values:"values",disabled:"disabled",name:"name",description:"description",descriptionVertical:"descriptionVertical",value:"value",text:"text",type:"type",image:"image",imageClass:"imageClass",icon:"icon",iconClass:"iconClass",class:"class",divider:"divider"},keys:{backspace:8,delimiter:188,deleteKey:46,enter:13,escape:27,pageUp:33,pageDown:34,leftArrow:37,upArrow:38,rightArrow:39,downArrow:40},selector:{addition:".addition",divider:".divider, .header",dropdown:".ui.dropdown",hidden:".hidden",icon:"> .dropdown.icon",input:'> input[type="hidden"], > select',item:".item",label:"> .label",remove:"> .label > .delete.icon",siblingLabel:".label",menu:".menu",message:".message",menuIcon:".dropdown.icon",search:"input.search, .menu > .search > input, .menu input.search",sizer:"> span.sizer",text:"> .text:not(.icon)",unselectable:".disabled, .filtered",clearIcon:"> .remove.icon"},className:{active:"active",addition:"addition",animating:"animating",description:"description",descriptionVertical:"vertical",disabled:"disabled",empty:"empty",dropdown:"ui dropdown",filtered:"filtered",hidden:"hidden transition",icon:"icon",image:"image",item:"item",label:"ui label",loading:"loading",menu:"menu",message:"message",multiple:"multiple",placeholder:"default",sizer:"sizer",search:"search",selected:"selected",selection:"selection",text:"text",upward:"upward",leftward:"left",visible:"visible",clearable:"clearable",noselection:"noselection",delete:"delete",header:"header",divider:"divider",groupIcon:"",unfilterable:"unfilterable"}},e.fn.dropdown.settings.templates={deQuote:function(e,t){return String(e).replace(/"/g,t?"&quot;":"")},escape:function(e,t){if(t)return e;var n={"<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"};return/[&<>"'`]/.test(e)?(e=e.replace(/&(?![a-z0-9#]{1,6};)/,"&amp;")).replace(/[<>"'`]/g,function(e){return n[e]}):e},dropdown:function(t,n,i,o){var a=t.placeholder||!1,r="",s=e.fn.dropdown.settings.templates.escape;return r+='<i class="dropdown icon"></i>',r+=a?'<div class="default text">'+s(a,i)+"</div>":'<div class="text"></div>',r+='<div class="'+o.menu+'">',r+=e.fn.dropdown.settings.templates.menu(t,n,i,o),r+="</div>"},menu:function(t,n,i,o){var a=t[n.values]||[],r="",s=e.fn.dropdown.settings.templates.escape,l=e.fn.dropdown.settings.templates.deQuote;return e.each(a,function(t,a){var c=a[n.type]?a[n.type]:"item",u=-1!==c.indexOf("menu");if("item"===c||u){var d=a[n.text]?' data-text="'+l(a[n.text],!0)+'"':"",f=a[n.disabled]?o.disabled+" ":"",m=a[n.descriptionVertical]?o.descriptionVertical+" ":"",g=""!=s(a[n.description]||"",i);r+='<div class="'+f+m+(a[n.class]?l(a[n.class]):o.item)+'" data-value="'+l(a[n.value],!0)+'"'+d+">",u&&(r+='<i class="'+(-1!==c.indexOf("left")?"left":"")+' dropdown icon"></i>'),a[n.image]&&(r+='<img class="'+(a[n.imageClass]?l(a[n.imageClass]):o.image)+'" src="'+l(a[n.image])+'">'),a[n.icon]&&(r+='<i class="'+l(a[n.icon])+" "+(a[n.iconClass]?l(a[n.iconClass]):o.icon)+'"></i>'),g&&(r+='<span class="'+o.description+'">'+s(a[n.description]||"",i)+"</span>",r+=u?"":'<span class="'+o.text+'">'),u&&(r+='<span class="'+o.text+'">'),r+=s(a[n.name]||"",i),u?(r+="</span>",r+='<div class="'+c+'">',r+=e.fn.dropdown.settings.templates.menu(a,n,i,o),r+="</div>"):g&&(r+="</span>"),r+="</div>"}else if("header"===c){var p=s(a[n.name]||"",i),v=a[n.icon]?l(a[n.icon]):o.groupIcon;""===p&&""===v||(r+='<div class="'+(a[n.class]?l(a[n.class]):o.header)+'">',""!==v&&(r+='<i class="'+v+" "+(a[n.iconClass]?l(a[n.iconClass]):o.icon)+'"></i>'),r+=p,r+="</div>"),a[n.divider]&&(r+='<div class="'+o.divider+'"></div>')}}),r},label:function(t,n,i,o){return(0,e.fn.dropdown.settings.templates.escape)(n,i)+'<i class="'+o.delete+' icon"></i>'},message:function(e){return e},addition:function(e){return e}}}(jQuery,window,document),function(e,t,n,i){"use strict";e.isFunction=e.isFunction||function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},t=void 0!==t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),e.fn.embed=function(t){var n,i=e(this),o=i.selector||"",a=(new Date).getTime(),r=[],s=arguments[0],l="string"==typeof s,c=[].slice.call(arguments,1);return i.each(function(){var u,d=e.isPlainObject(t)?e.extend(!0,{},e.fn.embed.settings,t):e.extend({},e.fn.embed.settings),f=d.selector,m=d.className,g=d.sources,p=d.error,v=d.metadata,h=d.namespace,b=d.templates,y="."+h,x="module-"+h,C=e(this),w=(C.find(f.placeholder),C.find(f.icon),C.find(f.embed)),k=this,T=C.data(x);u={initialize:function(){u.debug("Initializing embed"),u.determine.autoplay(),u.create(),u.bind.events(),u.instantiate()},instantiate:function(){u.verbose("Storing instance of module",u),T=u,C.data(x,u)},destroy:function(){u.verbose("Destroying previous instance of embed"),u.reset(),C.removeData(x).off(y)},refresh:function(){u.verbose("Refreshing selector cache"),C.find(f.placeholder),C.find(f.icon),w=C.find(f.embed)},bind:{events:function(){u.has.placeholder()&&(u.debug("Adding placeholder events"),C.on("click"+y,f.placeholder,u.createAndShow).on("click"+y,f.icon,u.createAndShow))}},create:function(){u.get.placeholder()?u.createPlaceholder():u.createAndShow()},createPlaceholder:function(e){var t=u.get.icon(),n=u.get.url();u.generate.embed(n);e=e||u.get.placeholder(),C.html(b.placeholder(e,t)),u.debug("Creating placeholder for embed",e,t)},createEmbed:function(t){u.refresh(),t=t||u.get.url(),w=e("<div/>").addClass(m.embed).html(u.generate.embed(t)).appendTo(C),d.onCreate.call(k,t),u.debug("Creating embed object",w)},changeEmbed:function(e){w.html(u.generate.embed(e))},createAndShow:function(){u.createEmbed(),u.show()},change:function(e,t,n){u.debug("Changing video to ",e,t,n),C.data(v.source,e).data(v.id,t),n?C.data(v.url,n):C.removeData(v.url),u.has.embed()?u.changeEmbed():u.create()},reset:function(){u.debug("Clearing embed and showing placeholder"),u.remove.data(),u.remove.active(),u.remove.embed(),u.showPlaceholder(),d.onReset.call(k)},show:function(){u.debug("Showing embed"),u.set.active(),d.onDisplay.call(k)},hide:function(){u.debug("Hiding embed"),u.showPlaceholder()},showPlaceholder:function(){u.debug("Showing placeholder image"),u.remove.active(),d.onPlaceholderDisplay.call(k)},get:{id:function(){return d.id||C.data(v.id)},placeholder:function(){return d.placeholder||C.data(v.placeholder)},icon:function(){return d.icon?d.icon:void 0!==C.data(v.icon)?C.data(v.icon):u.determine.icon()},source:function(e){return d.source?d.source:void 0!==C.data(v.source)?C.data(v.source):u.determine.source()},type:function(){var e=u.get.source();return void 0!==g[e]&&g[e].type},url:function(){return d.url?d.url:void 0!==C.data(v.url)?C.data(v.url):u.determine.url()}},determine:{autoplay:function(){u.should.autoplay()&&(d.autoplay=!0)},source:function(t){var n=!1;return(t=t||u.get.url())&&e.each(g,function(e,i){if(-1!==t.search(i.domain))return n=e,!1}),n},icon:function(){var e=u.get.source();return void 0!==g[e]&&g[e].icon},url:function(){var e,t=d.id||C.data(v.id),n=d.source||C.data(v.source);return(e=void 0!==g[n]&&g[n].url.replace("{id}",t))&&C.data(v.url,e),e}},set:{active:function(){C.addClass(m.active)}},remove:{data:function(){C.removeData(v.id).removeData(v.icon).removeData(v.placeholder).removeData(v.source).removeData(v.url)},active:function(){C.removeClass(m.active)},embed:function(){w.empty()}},encode:{parameters:function(e){var t,n=[];for(t in e)n.push(encodeURIComponent(t)+"="+encodeURIComponent(e[t]));return n.join("&amp;")}},generate:{embed:function(e){u.debug("Generating embed html");var t,n,i=u.get.source();return(e=u.get.url(e))?(n=u.generate.parameters(i),t=b.iframe(e,n)):u.error(p.noURL,C),t},parameters:function(t,n){var i=g[t]&&void 0!==g[t].parameters?g[t].parameters(d):{};return(n=n||d.parameters)&&(i=e.extend({},i,n)),i=d.onEmbed(i),u.encode.parameters(i)}},has:{embed:function(){return w.length>0},placeholder:function(){return d.placeholder||C.data(v.placeholder)}},should:{autoplay:function(){return"auto"===d.autoplay?d.placeholder||void 0!==C.data(v.placeholder):d.autoplay}},is:{video:function(){return"video"==u.get.type()}},setting:function(t,n){if(u.debug("Changing setting",t,n),e.isPlainObject(t))e.extend(!0,d,t);else{if(void 0===n)return d[t];e.isPlainObject(d[t])?e.extend(!0,d[t],n):d[t]=n}},internal:function(t,n){if(e.isPlainObject(t))e.extend(!0,u,t);else{if(void 0===n)return u[t];u[t]=n}},debug:function(){!d.silent&&d.debug&&(d.performance?u.performance.log(arguments):(u.debug=Function.prototype.bind.call(console.info,console,d.name+":"),u.debug.apply(console,arguments)))},verbose:function(){!d.silent&&d.verbose&&d.debug&&(d.performance?u.performance.log(arguments):(u.verbose=Function.prototype.bind.call(console.info,console,d.name+":"),u.verbose.apply(console,arguments)))},error:function(){d.silent||(u.error=Function.prototype.bind.call(console.error,console,d.name+":"),u.error.apply(console,arguments))},performance:{log:function(e){var t,n;d.performance&&(n=(t=(new Date).getTime())-(a||t),a=t,r.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:k,"Execution Time":n})),clearTimeout(u.performance.timer),u.performance.timer=setTimeout(u.performance.display,500)},display:function(){var t=d.name+":",n=0;a=!1,clearTimeout(u.performance.timer),e.each(r,function(e,t){n+=t["Execution Time"]}),t+=" "+n+"ms",o&&(t+=" '"+o+"'"),i.length>1&&(t+=" ("+i.length+")"),(void 0!==console.group||void 0!==console.table)&&r.length>0&&(console.groupCollapsed(t),console.table?console.table(r):e.each(r,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),r=[]}},invoke:function(t,i,o){var a,r,s,l=T;return i=i||c,o=k||o,"string"==typeof t&&void 0!==l&&(t=t.split(/[\. ]/),a=t.length-1,e.each(t,function(n,i){var o=n!=a?i+t[n+1].charAt(0).toUpperCase()+t[n+1].slice(1):t;if(e.isPlainObject(l[o])&&n!=a)l=l[o];else{if(void 0!==l[o])return r=l[o],!1;if(!e.isPlainObject(l[i])||n==a)return void 0!==l[i]?(r=l[i],!1):(u.error(p.method,t),!1);l=l[i]}})),e.isFunction(r)?s=r.apply(o,i):void 0!==r&&(s=r),Array.isArray(n)?n.push(s):void 0!==n?n=[n,s]:void 0!==s&&(n=s),r}},l?(void 0===T&&u.initialize(),u.invoke(s)):(void 0!==T&&T.invoke("destroy"),u.initialize())}),void 0!==n?n:this},e.fn.embed.settings={name:"Embed",namespace:"embed",silent:!1,debug:!1,verbose:!1,performance:!0,icon:!1,source:!1,url:!1,id:!1,autoplay:"auto",color:"#444444",hd:!0,brandedUI:!1,parameters:!1,onDisplay:function(){},onPlaceholderDisplay:function(){},onReset:function(){},onCreate:function(e){},onEmbed:function(e){return e},metadata:{id:"id",icon:"icon",placeholder:"placeholder",source:"source",url:"url"},error:{noURL:"No URL specified",method:"The method you called is not defined"},className:{active:"active",embed:"embed"},selector:{embed:".embed",placeholder:".placeholder",icon:".icon"},sources:{youtube:{name:"youtube",type:"video",icon:"video play",domain:"youtube.com",url:"//www.youtube.com/embed/{id}",parameters:function(e){return{autohide:!e.brandedUI,autoplay:e.autoplay,color:e.color||void 0,hq:e.hd,jsapi:e.api,modestbranding:!e.brandedUI}}},vimeo:{name:"vimeo",type:"video",icon:"video play",domain:"vimeo.com",url:"//player.vimeo.com/video/{id}",parameters:function(e){return{api:e.api,autoplay:e.autoplay,byline:e.brandedUI,color:e.color||void 0,portrait:e.brandedUI,title:e.brandedUI}}}},templates:{iframe:function(e,t){var n=e;return t&&(n+="?"+t),'<iframe src="'+n+'" width="100%" height="100%" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>'},placeholder:function(e,t){var n="";return t&&(n+='<i class="'+t+' icon"></i>'),e&&(n+='<img class="placeholder" src="'+e+'">'),n}},api:!1,onPause:function(){},onPlay:function(){},onStop:function(){}}}(jQuery,window,document),function(e,t,n,i){"use strict";e.isFunction=e.isFunction||function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},t=void 0!==t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),e.fn.modal=function(i){var o,a=e(this),r=e(t),s=e(n),l=e("body"),c=a.selector||"",u=(new Date).getTime(),d=[],f=arguments[0],m="string"==typeof f,g=[].slice.call(arguments,1),p=t.requestAnimationFrame||t.mozRequestAnimationFrame||t.webkitRequestAnimationFrame||t.msRequestAnimationFrame||function(e){setTimeout(e,0)};return a.each(function(){var a,v,h,b,y,x,C,w,k,T,S,D=e.isPlainObject(i)?e.extend(!0,{},e.fn.modal.settings,i):e.extend({},e.fn.modal.settings),A=D.selector,E=D.className,F=D.namespace,P=D.fields,O=D.error,R="."+F,M="module-"+F,I=e(this),j=e(D.context),V=I.find(A.close),L=this,q=I.hasClass("modal")?I.data(M):void 0,z=!1,N="",H="";S={initialize:function(){if(I.hasClass("modal")||(S.create.modal(),e.isFunction(D.onHidden)||(D.onHidden=function(){S.destroy(),I.remove()})),I.addClass(D.class),""!==D.title&&I.find(A.title).html(S.helpers.escape(D.title,D.preserveHTML)).addClass(D.classTitle),""!==D.content&&I.find(A.content).html(S.helpers.escape(D.content,D.preserveHTML)).addClass(D.classContent),S.has.configActions()){var t=I.find(A.actions).addClass(D.classActions);0===t.length?t=e("<div/>",{class:E.actions+" "+(D.classActions||"")}).appendTo(I):t.empty(),D.actions.forEach(function(n){var i=n[P.icon]?'<i class="'+S.helpers.deQuote(n[P.icon])+' icon"></i>':"",o=S.helpers.escape(n[P.text]||"",D.preserveHTML),a=S.helpers.deQuote(n[P.class]||""),r=n[P.click]&&e.isFunction(n[P.click])?n[P.click]:function(){};t.append(e("<button/>",{html:i+o,class:E.button+" "+a,click:function(){!1!==r.call(L,I)&&S.hide()}}))})}S.cache={},S.verbose("Initializing dimmer",j),S.create.id(),S.create.dimmer(),D.allowMultiple&&S.create.innerDimmer(),D.centered||I.addClass("top aligned"),S.refreshModals(),S.bind.events(),D.observeChanges&&S.observeChanges(),S.instantiate(),D.autoShow&&S.show()},instantiate:function(){S.verbose("Storing instance of modal"),q=S,I.data(M,q)},create:{modal:function(){I=e("<div/>",{class:E.modal}),D.closeIcon&&(V=e("<i/>",{class:E.close}),I.append(V)),""!==D.title&&e("<div/>",{class:E.title}).appendTo(I),""!==D.content&&e("<div/>",{class:E.content}).appendTo(I),S.has.configActions()&&e("<div/>",{class:E.actions}).appendTo(I),j.append(I)},dimmer:function(){var t={debug:D.debug,dimmerName:"modals"},n=e.extend(!0,t,D.dimmerSettings);void 0!==e.fn.dimmer?(S.debug("Creating dimmer"),b=j.dimmer(n),D.detachable?(S.verbose("Modal is detachable, moving content into dimmer"),b.dimmer("add content",I)):S.set.undetached(),y=b.dimmer("get dimmer")):S.error(O.dimmer)},id:function(){k=(Math.random().toString(16)+"000000000").substr(2,8),w="."+k,S.verbose("Creating unique id for element",k)},innerDimmer:function(){0==I.find(A.dimmer).length&&I.prepend('<div class="ui inverted dimmer"></div>')}},destroy:function(){T&&T.disconnect(),S.verbose("Destroying previous modal"),I.removeData(M).off(R),r.off(w),y.off(w),V.off(R),j.dimmer("destroy")},observeChanges:function(){"MutationObserver"in t&&((T=new MutationObserver(function(e){S.debug("DOM tree modified, refreshing"),S.refresh()})).observe(L,{childList:!0,subtree:!0}),S.debug("Setting up mutation observer",T))},refresh:function(){S.remove.scrolling(),S.cacheSizes(),S.can.useFlex()||S.set.modalOffset(),S.set.screenHeight(),S.set.type()},refreshModals:function(){v=I.siblings(A.modal),a=v.add(I)},attachEvents:function(t,n){var i=e(t);n=e.isFunction(S[n])?S[n]:S.toggle,i.length>0?(S.debug("Attaching modal events to element",t,n),i.off(R).on("click"+R,n)):S.error(O.notFound,t)},bind:{events:function(){S.verbose("Attaching events"),I.on("click"+R,A.close,S.event.close).on("click"+R,A.approve,S.event.approve).on("click"+R,A.deny,S.event.deny),r.on("resize"+w,S.event.resize)},scrollLock:function(){b.get(0).addEventListener("touchmove",S.event.preventScroll,{passive:!1})}},unbind:{scrollLock:function(){b.get(0).removeEventListener("touchmove",S.event.preventScroll,{passive:!1})}},get:{id:function(){return(Math.random().toString(16)+"000000000").substr(2,8)},element:function(){return I},settings:function(){return D}},event:{approve:function(){z||!1===D.onApprove.call(L,e(this))?S.verbose("Approve callback returned false cancelling hide"):(z=!0,S.hide(function(){z=!1}))},preventScroll:function(e){-1!==e.target.className.indexOf("dimmer")&&e.preventDefault()},deny:function(){z||!1===D.onDeny.call(L,e(this))?S.verbose("Deny callback returned false cancelling hide"):(z=!0,S.hide(function(){z=!1}))},close:function(){S.hide()},mousedown:function(n){var i=e(n.target),o=S.is.rtl();(x=i.closest(A.modal).length>0)&&S.verbose("Mouse down event registered inside the modal"),(C=S.is.scrolling()&&(!o&&e(t).outerWidth()-D.scrollbarWidth<=n.clientX||o&&D.scrollbarWidth>=n.clientX))&&S.verbose("Mouse down event registered inside the scrollbar")},mouseup:function(t){if(D.closable)if(x)S.debug("Dimmer clicked but mouse down was initially registered inside the modal");else if(C)S.debug("Dimmer clicked but mouse down was initially registered inside the scrollbar");else{var i=e(t.target).closest(A.modal).length>0,o=e.contains(n.documentElement,t.target);if(!i&&o&&S.is.active()&&I.hasClass(E.front)){if(S.debug("Dimmer clicked, hiding all modals"),D.allowMultiple){if(!S.hideAll())return}else if(!S.hide())return;S.remove.clickaway()}}else S.verbose("Dimmer clicked but closable setting is disabled")},debounce:function(e,t){clearTimeout(S.timer),S.timer=setTimeout(e,t)},keyboard:function(e){27==e.which&&(D.closable?(S.debug("Escape key pressed hiding modal"),I.hasClass(E.front)&&S.hide()):S.debug("Escape key pressed, but closable is set to false"),e.preventDefault())},resize:function(){b.dimmer("is active")&&(S.is.animating()||S.is.active())&&p(S.refresh)}},toggle:function(){S.is.active()||S.is.animating()?S.hide():S.show()},show:function(t){t=e.isFunction(t)?t:function(){},S.refreshModals(),S.set.dimmerSettings(),S.set.dimmerStyles(),S.showModal(t)},hide:function(t){return t=e.isFunction(t)?t:function(){},S.refreshModals(),S.hideModal(t)},showModal:function(t){t=e.isFunction(t)?t:function(){},S.is.animating()||!S.is.active()?(S.showDimmer(),S.cacheSizes(),S.set.bodyMargin(),S.can.useFlex()?S.remove.legacy():(S.set.legacy(),S.set.modalOffset(),S.debug("Using non-flex legacy modal positioning.")),S.set.screenHeight(),S.set.type(),S.set.clickaway(),!D.allowMultiple&&S.others.active()?S.hideOthers(S.showModal):(z=!1,D.allowMultiple&&(S.others.active()&&v.filter("."+E.active).find(A.dimmer).addClass("active"),D.detachable&&I.detach().appendTo(y)),D.onShow.call(L),D.transition&&void 0!==e.fn.transition&&I.transition("is supported")?(S.debug("Showing modal with css animations"),I.transition({debug:D.debug,animation:(D.transition.showMethod||D.transition)+" in",queue:D.queue,duration:D.transition.showDuration||D.duration,useFailSafe:!0,onComplete:function(){D.onVisible.apply(L),D.keyboardShortcuts&&S.add.keyboardShortcuts(),S.save.focus(),S.set.active(),D.autofocus&&S.set.autofocus(),t()}})):S.error(O.noTransition))):S.debug("Modal is already visible")},hideModal:function(t,n,i){var o=v.filter("."+E.active).last();if(t=e.isFunction(t)?t:function(){},S.debug("Hiding modal"),!1===D.onHide.call(L,e(this)))return S.verbose("Hide callback returned false cancelling hide"),z=!1,!1;(S.is.animating()||S.is.active())&&(D.transition&&void 0!==e.fn.transition&&I.transition("is supported")?(S.remove.active(),I.transition({debug:D.debug,animation:(D.transition.hideMethod||D.transition)+" out",queue:D.queue,duration:D.transition.hideDuration||D.duration,useFailSafe:!0,onStart:function(){S.others.active()||S.others.animating()||n||S.hideDimmer(),D.keyboardShortcuts&&!S.others.active()&&S.remove.keyboardShortcuts()},onComplete:function(){S.unbind.scrollLock(),D.allowMultiple&&(o.addClass(E.front),I.removeClass(E.front),i?a.find(A.dimmer).removeClass("active"):o.find(A.dimmer).removeClass("active")),e.isFunction(D.onHidden)&&D.onHidden.call(L),S.remove.dimmerStyles(),S.restore.focus(),t()}})):S.error(O.noTransition))},showDimmer:function(){b.dimmer("is animating")||!b.dimmer("is active")?(S.save.bodyMargin(),S.debug("Showing dimmer"),b.dimmer("show")):S.debug("Dimmer already visible")},hideDimmer:function(){b.dimmer("is animating")||b.dimmer("is active")?(S.unbind.scrollLock(),b.dimmer("hide",function(){S.restore.bodyMargin(),S.remove.clickaway(),S.remove.screenHeight()})):S.debug("Dimmer is not visible cannot hide")},hideAll:function(t){var n=a.filter("."+E.active+", ."+E.animating);if(t=e.isFunction(t)?t:function(){},n.length>0){S.debug("Hiding all visible modals");var i=!0;return e(n.get().reverse()).each(function(n,o){i&&(i=e(o).modal("hide modal",t,!1,!0))}),i&&S.hideDimmer(),i}},hideOthers:function(t){var n=v.filter("."+E.active+", ."+E.animating);t=e.isFunction(t)?t:function(){},n.length>0&&(S.debug("Hiding other modals",v),n.modal("hide modal",t,!0))},others:{active:function(){return v.filter("."+E.active).length>0},animating:function(){return v.filter("."+E.animating).length>0}},add:{keyboardShortcuts:function(){S.verbose("Adding keyboard shortcuts"),s.on("keyup"+R,S.event.keyboard)}},save:{focus:function(){e(n.activeElement).closest(I).length>0||(h=e(n.activeElement).blur())},bodyMargin:function(){N=l.css("margin-"+(S.can.leftBodyScrollbar()?"left":"right"));var e=parseInt(N.replace(/[^\d.]/g,"")),i=t.innerWidth-n.documentElement.clientWidth;H=e+i}},restore:{focus:function(){h&&h.length>0&&D.restoreFocus&&h.focus()},bodyMargin:function(){var t=S.can.leftBodyScrollbar()?"left":"right";l.css("margin-"+t,N),l.find(A.bodyFixed.replace("right",t)).each(function(){var n=e(this),i="fixed"===n.css("position")?"padding-"+t:t;n.css(i,"")})}},remove:{active:function(){I.removeClass(E.active)},legacy:function(){I.removeClass(E.legacy)},clickaway:function(){D.detachable||I.off("mousedown"+w),y.off("mousedown"+w),y.off("mouseup"+w)},dimmerStyles:function(){y.removeClass(E.inverted),b.removeClass(E.blurring)},bodyStyle:function(){""===l.attr("style")&&(S.verbose("Removing style attribute"),l.removeAttr("style"))},screenHeight:function(){S.debug("Removing page height"),l.css("height","")},keyboardShortcuts:function(){S.verbose("Removing keyboard shortcuts"),s.off("keyup"+R)},scrolling:function(){b.removeClass(E.scrolling),I.removeClass(E.scrolling)}},cacheSizes:function(){I.addClass(E.loading);var i=I.prop("scrollHeight"),o=I.outerWidth(),a=I.outerHeight();void 0!==S.cache.pageHeight&&0===a||(e.extend(S.cache,{pageHeight:e(n).outerHeight(),width:o,height:a+D.offset,scrollHeight:i+D.offset,contextHeight:"body"==D.context?e(t).height():b.height()}),S.cache.topOffset=-S.cache.height/2),I.removeClass(E.loading),S.debug("Caching modal and container sizes",S.cache)},helpers:{deQuote:function(e){return String(e).replace(/"/g,"")},escape:function(e,t){if(t)return e;var n={"<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"};return/[&<>"'`]/.test(e)?(e=e.replace(/&(?![a-z0-9#]{1,6};)/,"&amp;")).replace(/[<>"'`]/g,function(e){return n[e]}):e}},can:{leftBodyScrollbar:function(){return void 0===S.cache.leftBodyScrollbar&&(S.cache.leftBodyScrollbar=S.is.rtl()&&(S.is.iframe&&!S.is.firefox()||S.is.safari()||S.is.edge()||S.is.ie())),S.cache.leftBodyScrollbar},useFlex:function(){return"auto"===D.useFlex?D.detachable&&!S.is.ie():(D.useFlex&&S.is.ie()?S.debug("useFlex true is not supported in IE"):D.useFlex&&!D.detachable&&S.debug("useFlex true in combination with detachable false is not supported"),D.useFlex)},fit:function(){var e=S.cache.contextHeight,t=S.cache.contextHeight/2,n=S.cache.topOffset,i=S.cache.scrollHeight,o=S.cache.height,a=D.padding;return i>o?t+n+i+a<e:o+2*a<e}},has:{configActions:function(){return Array.isArray(D.actions)&&D.actions.length>0}},is:{active:function(){return I.hasClass(E.active)},ie:function(){if(void 0===S.cache.isIE){var e=!t.ActiveXObject&&"ActiveXObject"in t,n="ActiveXObject"in t;S.cache.isIE=e||n}return S.cache.isIE},animating:function(){return I.transition("is supported")?I.transition("is animating"):I.is(":visible")},scrolling:function(){return b.hasClass(E.scrolling)},modernBrowser:function(){return!(t.ActiveXObject||"ActiveXObject"in t)},rtl:function(){return void 0===S.cache.isRTL&&(S.cache.isRTL="rtl"===l.attr("dir")||"rtl"===l.css("direction")),S.cache.isRTL},safari:function(){return void 0===S.cache.isSafari&&(S.cache.isSafari=/constructor/i.test(t.HTMLElement)||!!t.ApplePaySession),S.cache.isSafari},edge:function(){return void 0===S.cache.isEdge&&(S.cache.isEdge=!!t.setImmediate&&!S.is.ie()),S.cache.isEdge},firefox:function(){return void 0===S.cache.isFirefox&&(S.cache.isFirefox=!!t.InstallTrigger),S.cache.isFirefox},iframe:function(){return!(self===top)}},set:{autofocus:function(){var t=I.find("[tabindex], :input").filter(":visible").filter(function(){return 0===e(this).closest(".disabled").length}),n=t.filter("[autofocus]"),i=n.length>0?n.first():t.first();i.length>0&&i.focus()},bodyMargin:function(){var t=S.can.leftBodyScrollbar()?"left":"right";(D.detachable||S.can.fit())&&l.css("margin-"+t,H+"px"),l.find(A.bodyFixed.replace("right",t)).each(function(){var n=e(this),i="fixed"===n.css("position")?"padding-"+t:t;n.css(i,"calc("+n.css(i)+" + "+H+"px)")})},clickaway:function(){D.detachable||I.on("mousedown"+w,S.event.mousedown),y.on("mousedown"+w,S.event.mousedown),y.on("mouseup"+w,S.event.mouseup)},dimmerSettings:function(){if(void 0!==e.fn.dimmer){var t={debug:D.debug,dimmerName:"modals",closable:"auto",useFlex:S.can.useFlex(),duration:{show:D.transition.showDuration||D.duration,hide:D.transition.hideDuration||D.duration}},n=e.extend(!0,t,D.dimmerSettings);D.inverted&&(n.variation=void 0!==n.variation?n.variation+" inverted":"inverted"),j.dimmer("setting",n)}else S.error(O.dimmer)},dimmerStyles:function(){D.inverted?y.addClass(E.inverted):y.removeClass(E.inverted),D.blurring?b.addClass(E.blurring):b.removeClass(E.blurring)},modalOffset:function(){if(D.detachable)I.css({marginTop:!I.hasClass("aligned")&&S.can.fit()?-S.cache.height/2:D.padding/2,marginLeft:-S.cache.width/2});else{var t=S.can.fit();I.css({top:!I.hasClass("aligned")&&t?e(n).scrollTop()+(S.cache.contextHeight-S.cache.height)/2:!t||I.hasClass("top")?e(n).scrollTop()+D.padding:e(n).scrollTop()+(S.cache.contextHeight-S.cache.height-D.padding),marginLeft:-S.cache.width/2})}S.verbose("Setting modal offset for legacy mode")},screenHeight:function(){S.can.fit()?l.css("height",""):I.hasClass("bottom")||(S.debug("Modal is taller than page content, resizing page height"),l.css("height",S.cache.height+2*D.padding))},active:function(){I.addClass(E.active+" "+E.front),v.filter("."+E.active).removeClass(E.front)},scrolling:function(){b.addClass(E.scrolling),I.addClass(E.scrolling),S.unbind.scrollLock()},legacy:function(){I.addClass(E.legacy)},type:function(){S.can.fit()?(S.verbose("Modal fits on screen"),S.others.active()||S.others.animating()||(S.remove.scrolling(),S.bind.scrollLock())):I.hasClass("bottom")?S.verbose("Bottom aligned modal not fitting on screen is unsupported for scrolling"):(S.verbose("Modal cannot fit on screen setting to scrolling"),S.set.scrolling())},undetached:function(){b.addClass(E.undetached)}},setting:function(t,n){if(S.debug("Changing setting",t,n),e.isPlainObject(t))e.extend(!0,D,t);else{if(void 0===n)return D[t];e.isPlainObject(D[t])?e.extend(!0,D[t],n):D[t]=n}},internal:function(t,n){if(e.isPlainObject(t))e.extend(!0,S,t);else{if(void 0===n)return S[t];S[t]=n}},debug:function(){!D.silent&&D.debug&&(D.performance?S.performance.log(arguments):(S.debug=Function.prototype.bind.call(console.info,console,D.name+":"),S.debug.apply(console,arguments)))},verbose:function(){!D.silent&&D.verbose&&D.debug&&(D.performance?S.performance.log(arguments):(S.verbose=Function.prototype.bind.call(console.info,console,D.name+":"),S.verbose.apply(console,arguments)))},error:function(){D.silent||(S.error=Function.prototype.bind.call(console.error,console,D.name+":"),S.error.apply(console,arguments))},performance:{log:function(e){var t,n;D.performance&&(n=(t=(new Date).getTime())-(u||t),u=t,d.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:L,"Execution Time":n})),clearTimeout(S.performance.timer),S.performance.timer=setTimeout(S.performance.display,500)},display:function(){var t=D.name+":",n=0;u=!1,clearTimeout(S.performance.timer),e.each(d,function(e,t){n+=t["Execution Time"]}),t+=" "+n+"ms",c&&(t+=" '"+c+"'"),(void 0!==console.group||void 0!==console.table)&&d.length>0&&(console.groupCollapsed(t),console.table?console.table(d):e.each(d,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),d=[]}},invoke:function(t,n,i){var a,r,s,l=q;return n=n||g,i=L||i,"string"==typeof t&&void 0!==l&&(t=t.split(/[\. ]/),a=t.length-1,e.each(t,function(n,i){var o=n!=a?i+t[n+1].charAt(0).toUpperCase()+t[n+1].slice(1):t;if(e.isPlainObject(l[o])&&n!=a)l=l[o];else{if(void 0!==l[o])return r=l[o],!1;if(!e.isPlainObject(l[i])||n==a)return void 0!==l[i]&&(r=l[i],!1);l=l[i]}})),e.isFunction(r)?s=r.apply(i,n):void 0!==r&&(s=r),Array.isArray(o)?o.push(s):void 0!==o?o=[o,s]:void 0!==s&&(o=s),r}},m?(void 0===q&&(e.isFunction(D.templates[f])&&(D.autoShow=!0,D.className.modal=D.className.template,D=e.extend(!0,{},D,D.templates[f].apply(S,g)),E=D.className,F=D.namespace,P=D.fields,O=D.error),S.initialize()),e.isFunction(D.templates[f])||S.invoke(f)):(void 0!==q&&q.invoke("destroy"),S.initialize(),o=I)}),void 0!==o?o:this},e.fn.modal.settings={name:"Modal",namespace:"modal",useFlex:"auto",offset:0,silent:!1,debug:!1,verbose:!1,performance:!0,observeChanges:!1,allowMultiple:!1,detachable:!0,closable:!0,autofocus:!0,restoreFocus:!0,autoShow:!1,inverted:!1,blurring:!1,centered:!0,dimmerSettings:{closable:!1,useCSS:!0},keyboardShortcuts:!0,context:"body",queue:!1,duration:500,transition:"scale",padding:50,scrollbarWidth:10,title:"",content:"",class:"",classTitle:"",classContent:"",classActions:"",closeIcon:!1,actions:!1,preserveHTML:!0,fields:{class:"class",text:"text",icon:"icon",click:"click"},onShow:function(){},onVisible:function(){},onHide:function(){return!0},onHidden:!1,onApprove:function(){return!0},onDeny:function(){return!0},selector:{title:"> .header",content:"> .content",actions:"> .actions",close:"> .close",approve:".actions .positive, .actions .approve, .actions .ok",deny:".actions .negative, .actions .deny, .actions .cancel",modal:".ui.modal",dimmer:"> .ui.dimmer",bodyFixed:"> .ui.fixed.menu, > .ui.right.toast-container, > .ui.right.sidebar, > .ui.fixed.nag, > .ui.fixed.nag > .close",prompt:".ui.input > input"},error:{dimmer:"UI Dimmer, a required component is not included in this page",method:"The method you called is not defined.",notFound:"The element you specified could not be found"},className:{active:"active",animating:"animating",blurring:"blurring",inverted:"inverted",legacy:"legacy",loading:"loading",scrolling:"scrolling",undetached:"undetached",front:"front",close:"close icon",button:"ui button",modal:"ui modal",title:"header",content:"content",actions:"actions",template:"ui tiny modal",ok:"positive",cancel:"negative",prompt:"ui fluid input"},text:{ok:"Ok",cancel:"Cancel"}},e.fn.modal.settings.templates={getArguments:function(t){var n=[].slice.call(t);return e.isPlainObject(n[0])?e.extend({handler:function(){},content:"",title:""},n[0]):(e.isFunction(n[n.length-1])||n.push(function(){}),{handler:n.pop(),content:n.pop()||"",title:n.pop()||""})},alert:function(){var e=this.get.settings(),t=e.templates.getArguments(arguments);return{title:t.title,content:t.content,actions:[{text:e.text.ok,class:e.className.ok,click:t.handler}]}},confirm:function(){var e=this.get.settings(),t=e.templates.getArguments(arguments);return{title:t.title,content:t.content,actions:[{text:e.text.ok,class:e.className.ok,click:function(){t.handler(!0)}},{text:e.text.cancel,class:e.className.cancel,click:function(){t.handler(!1)}}]}},prompt:function(){var t=this,n=this.get.settings(),i=n.templates.getArguments(arguments);return 0===e(e.parseHTML(i.content)).filter(".ui.input").length&&(i.content+='<p><div class="'+n.className.prompt+'"><input placeholder="'+this.helpers.deQuote(i.placeholder||"")+'" type="text" value="'+this.helpers.deQuote(i.defaultValue||"")+'"></div></p>'),{title:i.title,content:i.content,actions:[{text:n.text.ok,class:n.className.ok,click:function(){var n=t.get.settings(),o=t.get.element().find(n.selector.prompt)[0];i.handler(e(o).val())}},{text:n.text.cancel,class:n.className.cancel,click:function(){i.handler(null)}}]}}}}(jQuery,window,document),function(e,t,n,i){"use strict";e.isFunction=e.isFunction||function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},t=void 0!==t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),e.fn.nag=function(i){var o,a=e(this),r=a.selector||"",s=(new Date).getTime(),l=[],c=arguments[0],u="string"==typeof c,d=[].slice.call(arguments,1);return a.each(function(){var a,f,m=e.isPlainObject(i)?e.extend(!0,{},e.fn.nag.settings,i):e.extend({},e.fn.nag.settings),g=m.selector,p=m.error,v=m.namespace,h="."+v,b=v+"-module",y=e(this),x=m.context?e(m.context):e("body"),C=this,w=y.data(b);f={initialize:function(){f.verbose("Initializing element"),a=f.get.storage(),y.on("click"+h,g.close,f.dismiss).data(b,f),m.detachable&&y.parent()[0]!==x[0]&&y.detach().prependTo(x),m.displayTime>0&&setTimeout(f.hide,m.displayTime),f.show()},destroy:function(){f.verbose("Destroying instance"),y.removeData(b).off(h)},show:function(){if(f.should.show()&&!y.is(":visible")){if(!1===m.onShow.call(C))return f.debug("onShow callback returned false, cancelling nag animation"),!1;f.debug("Showing nag",m.animation.show),"fade"===m.animation.show?y.fadeIn(m.duration,m.easing,m.onVisible):y.slideDown(m.duration,m.easing,m.onVisible)}},hide:function(){if(!1===m.onHide.call(C))return f.debug("onHide callback returned false, cancelling nag animation"),!1;f.debug("Hiding nag",m.animation.hide),"fade"===m.animation.hide?y.fadeOut(m.duration,m.easing,m.onHidden):y.slideUp(m.duration,m.easing,m.onHidden)},dismiss:function(e){!1!==f.hide()&&m.storageMethod&&(f.debug("Dismissing nag",m.storageMethod,m.key,m.value,m.expires),f.storage.set(m.key,m.value)),e.stopImmediatePropagation(),e.preventDefault()},should:{show:function(){return m.persist?(f.debug("Persistent nag is set, can show nag"),!0):f.storage.get(m.key)!=m.value.toString()?(f.debug("Stored value is not set, can show nag",f.storage.get(m.key)),!0):(f.debug("Stored value is set, cannot show nag",f.storage.get(m.key)),!1)}},get:{expirationDate:function(e){if("number"==typeof e&&(e=new Date(Date.now()+864e5*e)),e instanceof Date&&e.getTime())return e.toUTCString();f.error(p.expiresFormat)},storage:function(){return"localstorage"===m.storageMethod&&void 0!==t.localStorage?(f.debug("Using local storage"),t.localStorage):"sessionstorage"===m.storageMethod&&void 0!==t.sessionStorage?(f.debug("Using session storage"),t.sessionStorage):"cookie"in n?(f.debug("Using cookie"),{setItem:function(e,t,i){e=encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),t=encodeURIComponent(t).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent);var o="";for(var a in i)i.hasOwnProperty(a)&&(o+="; "+a,"string"==typeof i[a]&&(o+="="+i[a].split(";")[0]));n.cookie=e+"="+t+o},getItem:function(e){for(var t=n.cookie.split("; "),i=0,o=t.length;i<o;i++){var a=t[i].split("=");if(e===a[0].replace(/(%[\dA-F]{2})+/gi,decodeURIComponent))return a[1]||""}},removeItem:function(e,t){a.setItem(e,"",t)}}):void f.error(p.noStorage)},storageOptions:function(){var e={};return m.expires&&(e.expires=f.get.expirationDate(m.expires)),m.domain&&(e.domain=m.domain),m.path&&(e.path=m.path),m.secure&&(e.secure=m.secure),m.samesite&&(e.samesite=m.samesite),e}},clear:function(){f.storage.remove(m.key)},storage:{set:function(e,n){var i=f.get.storageOptions();a===t.localStorage&&i.expires&&(f.debug("Storing expiration value in localStorage",e,i.expires),a.setItem(e+m.expirationKey,i.expires)),f.debug("Value stored",e,n);try{a.setItem(e,n,i)}catch(o){f.error(p.setItem,o)}},get:function(e){var n;if(n=a.getItem(e),a===t.localStorage){var i=a.getItem(e+m.expirationKey);null!=i&&new Date(i)<new Date&&(f.debug("Value in localStorage has expired. Deleting key",e),f.storage.remove(e),n=null)}return"undefined"!=n&&"null"!=n&&null!=n||(n=void 0),n},remove:function(e){var n=f.get.storageOptions();n.expires=f.get.expirationDate(-1),a===t.localStorage&&a.removeItem(e+m.expirationKey),a.removeItem(e,n)}},setting:function(t,n){if(f.debug("Changing setting",t,n),e.isPlainObject(t))e.extend(!0,m,t);else{if(void 0===n)return m[t];e.isPlainObject(m[t])?e.extend(!0,m[t],n):m[t]=n}},internal:function(t,n){if(e.isPlainObject(t))e.extend(!0,f,t);else{if(void 0===n)return f[t];f[t]=n}},debug:function(){!m.silent&&m.debug&&(m.performance?f.performance.log(arguments):(f.debug=Function.prototype.bind.call(console.info,console,m.name+":"),f.debug.apply(console,arguments)))},verbose:function(){!m.silent&&m.verbose&&m.debug&&(m.performance?f.performance.log(arguments):(f.verbose=Function.prototype.bind.call(console.info,console,m.name+":"),f.verbose.apply(console,arguments)))},error:function(){m.silent||(f.error=Function.prototype.bind.call(console.error,console,m.name+":"),f.error.apply(console,arguments))},performance:{log:function(e){var t,n;m.performance&&(n=(t=(new Date).getTime())-(s||t),s=t,l.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:C,"Execution Time":n})),clearTimeout(f.performance.timer),f.performance.timer=setTimeout(f.performance.display,500)},display:function(){var t=m.name+":",n=0;s=!1,clearTimeout(f.performance.timer),e.each(l,function(e,t){n+=t["Execution Time"]}),t+=" "+n+"ms",r&&(t+=" '"+r+"'"),(void 0!==console.group||void 0!==console.table)&&l.length>0&&(console.groupCollapsed(t),console.table?console.table(l):e.each(l,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),l=[]}},invoke:function(t,n,i){var a,r,s,l=w;return n=n||d,i=C||i,"string"==typeof t&&void 0!==l&&(t=t.split(/[\. ]/),a=t.length-1,e.each(t,function(n,i){var o=n!=a?i+t[n+1].charAt(0).toUpperCase()+t[n+1].slice(1):t;if(e.isPlainObject(l[o])&&n!=a)l=l[o];else{if(void 0!==l[o])return r=l[o],!1;if(!e.isPlainObject(l[i])||n==a)return void 0!==l[i]?(r=l[i],!1):(f.error(p.method,t),!1);l=l[i]}})),e.isFunction(r)?s=r.apply(i,n):void 0!==r&&(s=r),Array.isArray(o)?o.push(s):void 0!==o?o=[o,s]:void 0!==s&&(o=s),r}},u?(void 0===w&&f.initialize(),f.invoke(c)):(void 0!==w&&w.invoke("destroy"),f.initialize())}),void 0!==o?o:this},e.fn.nag.settings={name:"Nag",silent:!1,debug:!1,verbose:!1,performance:!0,namespace:"Nag",persist:!1,displayTime:0,animation:{show:"slide",hide:"slide"},context:!1,detachable:!1,expires:30,domain:!1,path:"/",secure:!1,samesite:!1,storageMethod:"cookie",key:"nag",value:"dismiss",expirationKey:"ExpirationDate",error:{noStorage:"Unsupported storage method",method:"The method you called is not defined.",setItem:"Unexpected error while setting value",expiresFormat:'"expires" must be a number of days or a Date Object'},className:{bottom:"bottom",fixed:"fixed"},selector:{close:"> .close.icon"},duration:500,easing:"easeOutQuad",onShow:function(){},onVisible:function(){},onHide:function(){},onHidden:function(){}},e.extend(e.easing,{easeOutQuad:function(e,t,n,i,o){return-i*(t/=o)*(t-2)+n}})}(jQuery,window,document),function(e,t,n,i){"use strict";e.isFunction=e.isFunction||function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},t=void 0!==t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),e.fn.popup=function(i){var o,a=e(this),r=e(n),s=e(t),l=e("body"),c=a.selector||"",u="ontouchstart"in n.documentElement?"touchstart":"click",d=(new Date).getTime(),f=[],m=arguments[0],g="string"==typeof m,p=[].slice.call(arguments,1);return a.each(function(){var a,v,h,b,y,x,C=e.isPlainObject(i)?e.extend(!0,{},e.fn.popup.settings,i):e.extend({},e.fn.popup.settings),w=C.selector,k=C.className,T=C.error,S=C.metadata,D=C.namespace,A="."+C.namespace,E="module-"+D,F=e(this),P=e(C.context),O=e(C.scrollContext),R=e(C.boundary),M=C.target?e(C.target):F,I=0,j=!1,V=!1,L=this,q=F.data(E);x={initialize:function(){x.debug("Initializing",F),x.createID(),x.bind.events(),!x.exists()&&C.preserve&&x.create(),C.observeChanges&&x.observeChanges(),x.instantiate()},instantiate:function(){x.verbose("Storing instance",x),q=x,F.data(E,q)},observeChanges:function(){"MutationObserver"in t&&((h=new MutationObserver(x.event.documentChanged)).observe(n,{childList:!0,subtree:!0}),x.debug("Setting up mutation observer",h))},refresh:function(){C.popup?a=e(C.popup).eq(0):C.inline&&(a=M.nextAll(w.popup).eq(0),C.popup=a),C.popup?(a.addClass(k.loading),v=x.get.offsetParent(),a.removeClass(k.loading),C.movePopup&&x.has.popup()&&x.get.offsetParent(a)[0]!==v[0]&&(x.debug("Moving popup to the same offset parent as target"),a.detach().appendTo(v))):v=C.inline?x.get.offsetParent(M):x.has.popup()?x.get.offsetParent(a):l,v.is("html")&&v[0]!==l[0]&&(x.debug("Setting page as offset parent"),v=l),x.get.variation()&&x.set.variation()},reposition:function(){x.refresh(),x.set.position()},destroy:function(){x.debug("Destroying previous module"),h&&h.disconnect(),a&&!C.preserve&&x.removePopup(),clearTimeout(x.hideTimer),clearTimeout(x.showTimer),x.unbind.close(),x.unbind.events(),F.removeData(E)},event:{start:function(t){var n=e.isPlainObject(C.delay)?C.delay.show:C.delay;clearTimeout(x.hideTimer),(!V||V&&C.addTouchEvents)&&(x.showTimer=setTimeout(x.show,n))},end:function(){var t=e.isPlainObject(C.delay)?C.delay.hide:C.delay;clearTimeout(x.showTimer),x.hideTimer=setTimeout(x.hide,t)},touchstart:function(e){V=!0,C.addTouchEvents&&x.show()},resize:function(){x.is.visible()&&x.set.position()},documentChanged:function(t){[].forEach.call(t,function(t){t.removedNodes&&[].forEach.call(t.removedNodes,function(t){(t==L||e(t).find(L).length>0)&&(x.debug("Element removed from DOM, tearing down events"),x.destroy())})})},hideGracefully:function(t){var i=e(t.target),o=e.contains(n.documentElement,t.target),a=i.closest(w.popup).length>0;t&&!a&&o?(x.debug("Click occurred outside popup hiding popup"),x.hide()):x.debug("Click was inside popup, keeping popup open")}},create:function(){var t=x.get.html(),n=x.get.title(),i=x.get.content();t||i||n?(x.debug("Creating pop-up html"),t||(t=C.templates.popup({title:n,content:i})),a=e("<div/>").addClass(k.popup).data(S.activator,F).html(t),C.inline?(x.verbose("Inserting popup element inline",a),a.insertAfter(F)):(x.verbose("Appending popup element to body",a),a.appendTo(P)),x.refresh(),x.set.variation(),C.hoverable&&x.bind.popup(),C.onCreate.call(a,L)):C.popup?(e(C.popup).data(S.activator,F),x.verbose("Used popup specified in settings"),x.refresh(),C.hoverable&&x.bind.popup()):0!==M.next(w.popup).length?(x.verbose("Pre-existing popup found"),C.inline=!0,C.popup=M.next(w.popup).data(S.activator,F),x.refresh(),C.hoverable&&x.bind.popup()):x.debug("No content specified skipping display",L)},createID:function(){y=(Math.random().toString(16)+"000000000").substr(2,8),b="."+y,x.verbose("Creating unique id for element",y)},toggle:function(){x.debug("Toggling pop-up"),x.is.hidden()?(x.debug("Popup is hidden, showing pop-up"),x.unbind.close(),x.show()):(x.debug("Popup is visible, hiding pop-up"),x.hide())},show:function(e){if(e=e||function(){},x.debug("Showing pop-up",C.transition),x.is.hidden()&&(!x.is.active()||!x.is.dropdown())){if(x.exists()||x.create(),!1===C.onShow.call(a,L))return void x.debug("onShow callback returned false, cancelling popup animation");C.preserve||C.popup||x.refresh(),a&&x.set.position()&&(x.save.conditions(),C.exclusive&&x.hideAll(),x.animate.show(e))}},hide:function(e){if(e=e||function(){},x.is.visible()||x.is.animating()){if(!1===C.onHide.call(a,L))return void x.debug("onHide callback returned false, cancelling popup animation");x.remove.visible(),x.unbind.close(),x.restore.conditions(),x.animate.hide(e)}},hideAll:function(){e(w.popup).filter("."+k.popupVisible).each(function(){e(this).data(S.activator).popup("hide")})},exists:function(){return!!a&&(C.inline||C.popup?x.has.popup():a.closest(P).length>=1)},removePopup:function(){x.has.popup()&&!C.popup&&(x.debug("Removing popup",a),a.remove(),a=void 0,C.onRemove.call(a,L))},save:{conditions:function(){x.cache={title:F.attr("title")},x.cache.title&&F.removeAttr("title"),x.verbose("Saving original attributes",x.cache.title)}},restore:{conditions:function(){return x.cache&&x.cache.title&&(F.attr("title",x.cache.title),x.verbose("Restoring original attributes",x.cache.title)),!0}},supports:{svg:function(){return"undefined"!=typeof SVGGraphicsElement}},animate:{show:function(t){t=e.isFunction(t)?t:function(){},C.transition&&void 0!==e.fn.transition&&F.transition("is supported")?(x.set.visible(),a.transition({animation:(C.transition.showMethod||C.transition)+" in",queue:!1,debug:C.debug,verbose:C.verbose,duration:C.transition.showDuration||C.duration,onComplete:function(){x.bind.close(),t.call(a,L),C.onVisible.call(a,L)}})):x.error(T.noTransition)},hide:function(t){t=e.isFunction(t)?t:function(){},x.debug("Hiding pop-up"),C.transition&&void 0!==e.fn.transition&&F.transition("is supported")?a.transition({animation:(C.transition.hideMethod||C.transition)+" out",queue:!1,duration:C.transition.hideDuration||C.duration,debug:C.debug,verbose:C.verbose,onComplete:function(){x.reset(),t.call(a,L),C.onHidden.call(a,L)}}):x.error(T.noTransition)}},change:{content:function(e){a.html(e)}},get:{html:function(){return F.removeData(S.html),F.data(S.html)||C.html},title:function(){return F.removeData(S.title),F.data(S.title)||C.title},content:function(){return F.removeData(S.content),F.data(S.content)||C.content||F.attr("title")},variation:function(){return F.removeData(S.variation),F.data(S.variation)||C.variation},popup:function(){return a},popupOffset:function(){return a.offset()},calculations:function(){var e,n=x.get.offsetParent(a),i=M[0],o=R[0]==t,r=M.offset(),l=C.inline||C.popup&&C.movePopup?M.offsetParent().offset():{top:0,left:0},c=o?{top:0,left:0}:R.offset(),u={},d=o?{top:s.scrollTop(),left:s.scrollLeft()}:{top:0,left:0};if(u={target:{element:M[0],width:M.outerWidth(),height:M.outerHeight(),top:r.top-l.top,left:r.left-l.left,margin:{}},popup:{width:a.outerWidth(),height:a.outerHeight()},parent:{width:v.outerWidth(),height:v.outerHeight()},screen:{top:c.top,left:c.left,scroll:{top:d.top,left:d.left},width:R.width(),height:R.height()}},n.get(0)!==v.get(0)){var f=n.offset();u.target.top-=f.top,u.target.left-=f.left,u.parent.width=n.outerWidth(),u.parent.height=n.outerHeight()}return C.setFluidWidth&&x.is.fluid()&&(u.container={width:a.parent().outerWidth()},u.popup.width=u.container.width),u.target.margin.top=C.inline?parseInt(t.getComputedStyle(i).getPropertyValue("margin-top"),10):0,u.target.margin.left=C.inline?x.is.rtl()?parseInt(t.getComputedStyle(i).getPropertyValue("margin-right"),10):parseInt(t.getComputedStyle(i).getPropertyValue("margin-left"),10):0,e=u.screen,u.boundary={top:e.top+e.scroll.top,bottom:e.top+e.scroll.top+e.height,left:e.left+e.scroll.left,right:e.left+e.scroll.left+e.width},u},id:function(){return y},startEvent:function(){return"hover"==C.on?"mouseenter":"focus"==C.on&&"focus"},scrollEvent:function(){return"scroll"},endEvent:function(){return"hover"==C.on?"mouseleave":"focus"==C.on&&"blur"},distanceFromBoundary:function(e,t){var n,i,o={};return n=(t=t||x.get.calculations()).popup,i=t.boundary,e&&(o={top:e.top-i.top,left:e.left-i.left,right:i.right-(e.left+n.width),bottom:i.bottom-(e.top+n.height)},x.verbose("Distance from boundaries determined",e,o)),o},offsetParent:function(t){var n=(void 0!==t?t[0]:M[0]).parentNode,i=e(n);if(n)for(var o="none"===i.css("transform"),a="static"===i.css("position"),r=i.is("body");n&&!r&&a&&o;)n=n.parentNode,o="none"===(i=e(n)).css("transform"),a="static"===i.css("position"),r=i.is("body");return i&&i.length>0?i:e()},positions:function(){return{"top left":!1,"top center":!1,"top right":!1,"bottom left":!1,"bottom center":!1,"bottom right":!1,"left center":!1,"right center":!1}},nextPosition:function(e){var t=e.split(" "),n=t[0],i=t[1],o="top"==n||"bottom"==n,a=!1,r=!1,s=!1;return j||(x.verbose("All available positions available"),j=x.get.positions()),x.debug("Recording last position tried",e),j[e]=!0,"opposite"===C.prefer&&(s=(s=[{top:"bottom",bottom:"top",left:"right",right:"left"}[n],i]).join(" "),a=!0===j[s],x.debug("Trying opposite strategy",s)),"adjacent"===C.prefer&&o&&(s=(s=[n,{left:"center",center:"right",right:"left"}[i]]).join(" "),r=!0===j[s],x.debug("Trying adjacent strategy",s)),(r||a)&&(x.debug("Using backup position",s),s={"top left":"top center","top center":"top right","top right":"right center","right center":"bottom right","bottom right":"bottom center","bottom center":"bottom left","bottom left":"left center","left center":"top left"}[e]),s}},set:{position:function(e,t){if(0!==M.length&&0!==a.length){var n,i,o,r,s,l,c,u;if(t=t||x.get.calculations(),e=e||F.data(S.position)||C.position,n=F.data(S.offset)||C.offset,i=C.distanceAway,o=t.target,r=t.popup,s=t.parent,x.should.centerArrow(t)&&(x.verbose("Adjusting offset to center arrow on small target element"),"top left"!=e&&"bottom left"!=e||(n+=o.width/2,n-=C.arrowPixelsFromEdge),"top right"!=e&&"bottom right"!=e||(n-=o.width/2,n+=C.arrowPixelsFromEdge)),0===o.width&&0===o.height&&!x.is.svg(o.element))return x.debug("Popup target is hidden, no action taken"),!1;switch(C.inline&&(x.debug("Adding margin to calculation",o.margin),"left center"==e||"right center"==e?(n+=o.margin.top,i+=-o.margin.left):"top left"==e||"top center"==e||"top right"==e?(n+=o.margin.left,i-=o.margin.top):(n+=o.margin.left,i+=o.margin.top)),x.debug("Determining popup position from calculations",e,t),x.is.rtl()&&(e=e.replace(/left|right/g,function(e){return"left"==e?"right":"left"}),x.debug("RTL: Popup position updated",e)),I==C.maxSearchDepth&&"string"==typeof C.lastResort&&(e=C.lastResort),e){case"top left":l={top:"auto",bottom:s.height-o.top+i,left:o.left+n,right:"auto"};break;case"top center":l={bottom:s.height-o.top+i,left:o.left+o.width/2-r.width/2+n,top:"auto",right:"auto"};break;case"top right":l={bottom:s.height-o.top+i,right:s.width-o.left-o.width-n,top:"auto",left:"auto"};break;case"left center":l={top:o.top+o.height/2-r.height/2+n,right:s.width-o.left+i,left:"auto",bottom:"auto"};break;case"right center":l={top:o.top+o.height/2-r.height/2+n,left:o.left+o.width+i,bottom:"auto",right:"auto"};break;case"bottom left":l={top:o.top+o.height+i,left:o.left+n,bottom:"auto",right:"auto"};break;case"bottom center":l={top:o.top+o.height+i,left:o.left+o.width/2-r.width/2+n,bottom:"auto",right:"auto"};break;case"bottom right":l={top:o.top+o.height+i,right:s.width-o.left-o.width-n,left:"auto",bottom:"auto"}}if(void 0===l&&x.error(T.invalidPosition,e),x.debug("Calculated popup positioning values",l),a.css(l).removeClass(k.position).addClass(e).addClass(k.loading),c=x.get.popupOffset(),u=x.get.distanceFromBoundary(c,t),!C.forcePosition&&x.is.offstage(u,e)){if(x.debug("Position is outside viewport",e),I<C.maxSearchDepth)return I++,e=x.get.nextPosition(e),x.debug("Trying new position",e),!!a&&x.set.position(e,t);if(!C.lastResort)return x.debug("Popup could not find a position to display",a),x.error(T.cannotPlace,L),x.remove.attempts(),x.remove.loading(),x.reset(),C.onUnplaceable.call(a,L),!1;x.debug("No position found, showing with last position")}return x.debug("Position is on stage",e),x.remove.attempts(),x.remove.loading(),C.setFluidWidth&&x.is.fluid()&&x.set.fluidWidth(t),!0}x.error(T.notFound)},fluidWidth:function(e){e=e||x.get.calculations(),x.debug("Automatically setting element width to parent width",e.parent.width),a.css("width",e.container.width)},variation:function(e){(e=e||x.get.variation())&&x.has.popup()&&(x.verbose("Adding variation to popup",e),a.addClass(e))},visible:function(){F.addClass(k.visible)}},remove:{loading:function(){a.removeClass(k.loading)},variation:function(e){(e=e||x.get.variation())&&(x.verbose("Removing variation",e),a.removeClass(e))},visible:function(){F.removeClass(k.visible)},attempts:function(){x.verbose("Resetting all searched positions"),I=0,j=!1}},bind:{events:function(){x.debug("Binding popup events to module"),"click"==C.on&&F.on(u+A,x.toggle),"hover"==C.on&&F.on("touchstart"+A,x.event.touchstart),x.get.startEvent()&&F.on(x.get.startEvent()+A,x.event.start).on(x.get.endEvent()+A,x.event.end),C.target&&x.debug("Target set to element",M),s.on("resize"+b,x.event.resize)},popup:function(){x.verbose("Allowing hover events on popup to prevent closing"),a&&x.has.popup()&&a.on("mouseenter"+A,x.event.start).on("mouseleave"+A,x.event.end)},close:function(){(!0===C.hideOnScroll||"auto"==C.hideOnScroll&&"click"!=C.on)&&x.bind.closeOnScroll(),x.is.closable()?x.bind.clickaway():"hover"==C.on&&V&&x.bind.touchClose()},closeOnScroll:function(){x.verbose("Binding scroll close event to document"),O.one(x.get.scrollEvent()+b,x.event.hideGracefully)},touchClose:function(){x.verbose("Binding popup touchclose event to document"),r.on("touchstart"+b,function(e){x.verbose("Touched away from popup"),x.event.hideGracefully.call(L,e)})},clickaway:function(){x.verbose("Binding popup close event to document"),r.on(u+b,function(e){x.verbose("Clicked away from popup"),x.event.hideGracefully.call(L,e)})}},unbind:{events:function(){s.off(b),F.off(A)},close:function(){r.off(b),O.off(b)}},has:{popup:function(){return a&&a.length>0}},should:{centerArrow:function(e){return!x.is.basic()&&e.target.width<=2*C.arrowPixelsFromEdge}},is:{closable:function(){return"auto"==C.closable?"hover"!=C.on:C.closable},offstage:function(t,n){var i=[];return e.each(t,function(e,t){t<-C.jitter&&(x.debug("Position exceeds allowable distance from edge",e,t,n),i.push(e))}),i.length>0},svg:function(e){return x.supports.svg()&&e instanceof SVGGraphicsElement},basic:function(){return F.hasClass(k.basic)},active:function(){return F.hasClass(k.active)},animating:function(){return void 0!==a&&a.hasClass(k.animating)},fluid:function(){return void 0!==a&&a.hasClass(k.fluid)},visible:function(){return void 0!==a&&a.hasClass(k.popupVisible)},dropdown:function(){return F.hasClass(k.dropdown)},hidden:function(){return!x.is.visible()},rtl:function(){return"rtl"===F.attr("dir")||"rtl"===F.css("direction")}},reset:function(){x.remove.visible(),C.preserve?void 0!==e.fn.transition&&a.transition("remove transition"):x.removePopup()},setting:function(t,n){if(e.isPlainObject(t))e.extend(!0,C,t);else{if(void 0===n)return C[t];C[t]=n}},internal:function(t,n){if(e.isPlainObject(t))e.extend(!0,x,t);else{if(void 0===n)return x[t];x[t]=n}},debug:function(){!C.silent&&C.debug&&(C.performance?x.performance.log(arguments):(x.debug=Function.prototype.bind.call(console.info,console,C.name+":"),x.debug.apply(console,arguments)))},verbose:function(){!C.silent&&C.verbose&&C.debug&&(C.performance?x.performance.log(arguments):(x.verbose=Function.prototype.bind.call(console.info,console,C.name+":"),x.verbose.apply(console,arguments)))},error:function(){C.silent||(x.error=Function.prototype.bind.call(console.error,console,C.name+":"),x.error.apply(console,arguments))},performance:{log:function(e){var t,n;C.performance&&(n=(t=(new Date).getTime())-(d||t),d=t,f.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:L,"Execution Time":n})),clearTimeout(x.performance.timer),x.performance.timer=setTimeout(x.performance.display,500)},display:function(){var t=C.name+":",n=0;d=!1,clearTimeout(x.performance.timer),e.each(f,function(e,t){n+=t["Execution Time"]}),t+=" "+n+"ms",c&&(t+=" '"+c+"'"),(void 0!==console.group||void 0!==console.table)&&f.length>0&&(console.groupCollapsed(t),console.table?console.table(f):e.each(f,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),f=[]}},invoke:function(t,n,i){var a,r,s,l=q;return n=n||p,i=L||i,"string"==typeof t&&void 0!==l&&(t=t.split(/[\. ]/),a=t.length-1,e.each(t,function(n,i){var o=n!=a?i+t[n+1].charAt(0).toUpperCase()+t[n+1].slice(1):t;if(e.isPlainObject(l[o])&&n!=a)l=l[o];else{if(void 0!==l[o])return r=l[o],!1;if(!e.isPlainObject(l[i])||n==a)return void 0!==l[i]&&(r=l[i],!1);l=l[i]}})),e.isFunction(r)?s=r.apply(i,n):void 0!==r&&(s=r),Array.isArray(o)?o.push(s):void 0!==o?o=[o,s]:void 0!==s&&(o=s),r}},g?(void 0===q&&x.initialize(),x.invoke(m)):(void 0!==q&&q.invoke("destroy"),x.initialize())}),void 0!==o?o:this},e.fn.popup.settings={name:"Popup",silent:!1,debug:!1,verbose:!1,performance:!0,namespace:"popup",observeChanges:!0,onCreate:function(){},onRemove:function(){},onShow:function(){},onVisible:function(){},onHide:function(){},onUnplaceable:function(){},onHidden:function(){},on:"hover",boundary:t,addTouchEvents:!0,position:"top left",forcePosition:!1,variation:"",movePopup:!0,target:!1,popup:!1,inline:!1,preserve:!1,hoverable:!1,content:!1,html:!1,title:!1,closable:!0,hideOnScroll:"auto",exclusive:!1,context:"body",scrollContext:t,prefer:"opposite",lastResort:!1,arrowPixelsFromEdge:20,delay:{show:50,hide:70},setFluidWidth:!0,duration:200,transition:"scale",distanceAway:0,jitter:2,offset:0,maxSearchDepth:15,error:{invalidPosition:"The position you specified is not a valid position",cannotPlace:"Popup does not fit within the boundaries of the viewport",method:"The method you called is not defined.",noTransition:"This module requires ui transitions <https://github.com/Semantic-Org/UI-Transition>",notFound:"The target or popup you specified does not exist on the page"},metadata:{activator:"activator",content:"content",html:"html",offset:"offset",position:"position",title:"title",variation:"variation"},className:{active:"active",basic:"basic",animating:"animating",dropdown:"dropdown",fluid:"fluid",loading:"loading",popup:"ui popup",position:"top left center bottom right",visible:"visible",popupVisible:"visible"},selector:{popup:".ui.popup"},templates:{escape:function(e){var t={"<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"};return/[&<>"'`]/.test(e)?(e=e.replace(/&(?![a-z0-9#]{1,6};)/,"&amp;")).replace(/[<>"'`]/g,function(e){return t[e]}):e},popup:function(t){var n="",i=e.fn.popup.settings.templates.escape;return void 0!==typeof t&&(void 0!==typeof t.title&&t.title&&(t.title=i(t.title),n+='<div class="header">'+t.title+"</div>"),void 0!==typeof t.content&&t.content&&(t.content=i(t.content),n+='<div class="content">'+t.content+"</div>")),n}}}}(jQuery,window,document),function(e,t,n,i){"use strict";e.isFunction=e.isFunction||function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},t=void 0!==t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),e.fn.progress=function(t){var i,o=e(this),a=o.selector||"",r=(new Date).getTime(),s=[],l=arguments[0],c="string"==typeof l,u=[].slice.call(arguments,1);return o.each(function(){var o,d=e.isPlainObject(t)?e.extend(!0,{},e.fn.progress.settings,t):e.extend({},e.fn.progress.settings),f=d.className,m=d.metadata,g=d.namespace,p=d.selector,v=d.error,h="."+g,b="module-"+g,y=e(this),x=e(this).find(p.bar),C=e(this).find(p.progress),w=e(this).find(p.label),k=this,T=y.data(b),S=!1;o={helper:{sum:function(e){return Array.isArray(e)?e.reduce(function(e,t){return e+Number(t)},0):0},derivePrecision:function(e,t){for(var n=0,i=1,o=e/t;n<10&&!((o*=i)>1);)i=Math.pow(10,n++);return i},forceArray:function(e){return Array.isArray(e)?e:isNaN(e)?"string"==typeof e?e.split(","):[]:[e]}},initialize:function(){o.set.duration(),o.set.transitionEvent(),o.debug(k),o.read.metadata(),o.read.settings(),o.instantiate()},instantiate:function(){o.verbose("Storing instance of progress",o),T=o,y.data(b,o)},destroy:function(){o.verbose("Destroying previous progress for",y),clearInterval(T.interval),o.remove.state(),y.removeData(b),T=void 0},reset:function(){o.remove.nextValue(),o.update.progress(0)},complete:function(e){(void 0===o.percent||o.percent<100)&&(o.remove.progressPoll(),!0!==e&&o.set.percent(100))},read:{metadata:function(){var e={percent:o.helper.forceArray(y.data(m.percent)),total:y.data(m.total),value:o.helper.forceArray(y.data(m.value))};void 0!==e.total&&(o.debug("Total value set from metadata",e.total),o.set.total(e.total)),e.value.length>0&&(o.debug("Current value set from metadata",e.value),o.set.value(e.value),o.set.progress(e.value)),e.percent.length>0&&(o.debug("Current percent value set from metadata",e.percent),o.set.percent(e.percent))},settings:function(){!1!==d.total&&(o.debug("Current total set in settings",d.total),o.set.total(d.total)),!1!==d.value&&(o.debug("Current value set in settings",d.value),o.set.value(d.value),o.set.progress(o.value)),!1!==d.percent&&(o.debug("Current percent set in settings",d.percent),o.set.percent(d.percent))}},bind:{transitionEnd:function(e){var t=o.get.transitionEnd();x.one(t+h,function(t){clearTimeout(o.failSafeTimer),e.call(this,t)}),o.failSafeTimer=setTimeout(function(){x.triggerHandler(t)},d.duration+d.failSafeDelay),o.verbose("Adding fail safe timer",o.timer)}},increment:function(e){var t,n;o.has.total()?(t=o.get.value(),e=e||1):(t=o.get.percent(),e=e||o.get.randomValue()),n=t+e,o.debug("Incrementing percentage by",t,n,e),n=o.get.normalizedValue(n),o.set.progress(n)},decrement:function(e){var t,n;o.get.total()?(n=(t=o.get.value())-(e=e||1),o.debug("Decrementing value by",e,t)):(n=(t=o.get.percent())-(e=e||o.get.randomValue()),o.debug("Decrementing percentage by",e,t)),n=o.get.normalizedValue(n),o.set.progress(n)},has:{progressPoll:function(){return o.progressPoll},total:function(){return!1!==o.get.total()}},get:{text:function(e,t){var n=t||0,i=o.get.value(n),a=o.get.total(),r=S?o.get.displayPercent(n):o.get.percent(n),s=!1!==a?Math.max(0,a-i):100-r;return e=(e=e||"").replace("{value}",i).replace("{total}",a||0).replace("{left}",s).replace("{percent}",r).replace("{bar}",d.text.bars[n]||""),o.verbose("Adding variables to progress bar text",e),e},normalizedValue:function(e){if(e<0)return o.debug("Value cannot decrement below 0"),0;if(o.has.total()){if(e>o.total)return o.debug("Value cannot increment above total",o.total),o.total}else if(e>100)return o.debug("Value cannot increment above 100 percent"),100;return e},updateInterval:function(){return"auto"==d.updateInterval?d.duration:d.updateInterval},randomValue:function(){return o.debug("Generating random increment percentage"),Math.floor(Math.random()*d.random.max+d.random.min)},numericValue:function(e){return"string"==typeof e?""!==e.replace(/[^\d.]/g,"")&&+e.replace(/[^\d.]/g,""):e},transitionEnd:function(){var e,t=n.createElement("element"),i={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"};for(e in i)if(void 0!==t.style[e])return i[e]},displayPercent:function(t){var n=e(x[t]),i=n.width(),a=y.width(),r=i>parseInt(n.css("min-width"),10)?i/a*100:o.percent;return d.precision>0?Math.round(r*(10*d.precision))/(10*d.precision):Math.round(r)},percent:function(e){return o.percent&&o.percent[e||0]||0},value:function(e){return o.nextValue||o.value&&o.value[e||0]||0},total:function(){return void 0!==o.total&&o.total}},create:{progressPoll:function(){o.progressPoll=setTimeout(function(){o.update.toNextValue(),o.remove.progressPoll()},o.get.updateInterval())}},is:{complete:function(){return o.is.success()||o.is.warning()||o.is.error()},success:function(){return y.hasClass(f.success)},warning:function(){return y.hasClass(f.warning)},error:function(){return y.hasClass(f.error)},active:function(){return y.hasClass(f.active)},visible:function(){return y.is(":visible")}},remove:{progressPoll:function(){o.verbose("Removing progress poll timer"),o.progressPoll&&(clearTimeout(o.progressPoll),delete o.progressPoll)},nextValue:function(){o.verbose("Removing progress value stored for next update"),delete o.nextValue},state:function(){o.verbose("Removing stored state"),delete o.total,delete o.percent,delete o.value},active:function(){o.verbose("Removing active state"),y.removeClass(f.active)},success:function(){o.verbose("Removing success state"),y.removeClass(f.success)},warning:function(){o.verbose("Removing warning state"),y.removeClass(f.warning)},error:function(){o.verbose("Removing error state"),y.removeClass(f.error)}},set:{barWidth:function(t){o.debug("set bar width with ",t),t=o.helper.forceArray(t);var n=-1,i=-1,a=o.helper.sum(t),r=x.length,s=r>1,l=t.map(function(t,o){var l=o===r-1&&0===a,c=e(x[o]);return 0===t&&s&&!l?c.css("display","none"):(s&&l&&c.css("background","transparent"),-1==n&&(n=o),i=o,c.css({display:"block",width:t+"%"})),parseFloat(t)});t.forEach(function(t,o){e(x[o]).css({borderTopLeftRadius:o==n?"":0,borderBottomLeftRadius:o==n?"":0,borderTopRightRadius:o==i?"":0,borderBottomRightRadius:o==i?"":0})}),y.attr("data-percent",l)},duration:function(e){e="number"==typeof(e=e||d.duration)?e+"ms":e,o.verbose("Setting progress bar transition duration",e),x.css({"transition-duration":e})},percent:function(e){e=o.helper.forceArray(e).map(function(e){return e="string"==typeof e?+e.replace("%",""):e,d.limitValues?Math.max(0,Math.min(100,e)):e});var t=o.has.total(),n=o.helper.sum(e),i=e.length>1&&t,a=o.helper.sum(o.helper.forceArray(o.value));if(i&&a>o.total)o.error(v.sumExceedsTotal,a,o.total);else if(!i&&n>100)o.error(v.tooHigh,n);else if(n<0)o.error(v.tooLow,n);else{var r=d.precision>0?d.precision:i?o.helper.derivePrecision(Math.min.apply(null,o.value),o.total):0,s=e.map(function(e){return r>0?Math.round(e*(10*r))/(10*r):Math.round(e)});o.percent=s,t&&(o.value=e.map(function(e){return r>0?Math.round(e/100*o.total*(10*r))/(10*r):Math.round(e/100*o.total*10)/10})),o.set.barWidth(e),o.set.labelInterval()}d.onChange.call(k,e,o.value,o.total)},labelInterval:function(){clearInterval(o.interval),o.bind.transitionEnd(function(){o.verbose("Bar finished animating, removing continuous label updates"),clearInterval(o.interval),S=!1,o.set.labels()}),S=!0,o.interval=setInterval(function(){e.contains(n.documentElement,k)||(clearInterval(o.interval),S=!1),o.set.labels()},d.framerate)},labels:function(){o.verbose("Setting both bar progress and outer label text"),o.set.barLabel(),o.set.state()},label:function(e){(e=e||"")&&(e=o.get.text(e),o.verbose("Setting label to text",e),w.text(e))},state:function(e){100===(e=void 0!==e?e:o.helper.sum(o.percent))?d.autoSuccess&&1===x.length&&!(o.is.warning()||o.is.error()||o.is.success())?(o.set.success(),o.debug("Automatically triggering success at 100%")):(o.verbose("Reached 100% removing active state"),o.remove.active(),o.remove.progressPoll()):e>0?(o.verbose("Adjusting active progress bar label",e),o.set.active()):(o.remove.active(),o.set.label(d.text.active))},barLabel:function(t){C.map(function(n,i){var a=e(i);void 0!==t?a.text(o.get.text(t,n)):"ratio"==d.label&&o.has.total()?(o.verbose("Adding ratio to bar label"),a.text(o.get.text(d.text.ratio,n))):"percent"==d.label&&(o.verbose("Adding percentage to bar label"),a.text(o.get.text(d.text.percent,n)))})},active:function(e){e=e||d.text.active,o.debug("Setting active state"),d.showActivity&&!o.is.active()&&y.addClass(f.active),o.remove.warning(),o.remove.error(),o.remove.success(),(e=d.onLabelUpdate("active",e,o.value,o.total))&&o.set.label(e),o.bind.transitionEnd(function(){d.onActive.call(k,o.value,o.total)})},success:function(e,t){e=e||d.text.success||d.text.active,o.debug("Setting success state"),y.addClass(f.success),o.remove.active(),o.remove.warning(),o.remove.error(),o.complete(t),d.text.success?(e=d.onLabelUpdate("success",e,o.value,o.total),o.set.label(e)):(e=d.onLabelUpdate("active",e,o.value,o.total),o.set.label(e)),o.bind.transitionEnd(function(){d.onSuccess.call(k,o.total)})},warning:function(e,t){e=e||d.text.warning,o.debug("Setting warning state"),y.addClass(f.warning),o.remove.active(),o.remove.success(),o.remove.error(),o.complete(t),(e=d.onLabelUpdate("warning",e,o.value,o.total))&&o.set.label(e),o.bind.transitionEnd(function(){d.onWarning.call(k,o.value,o.total)})},error:function(e,t){e=e||d.text.error,o.debug("Setting error state"),y.addClass(f.error),o.remove.active(),o.remove.success(),o.remove.warning(),o.complete(t),(e=d.onLabelUpdate("error",e,o.value,o.total))&&o.set.label(e),o.bind.transitionEnd(function(){d.onError.call(k,o.value,o.total)})},transitionEvent:function(){o.get.transitionEnd()},total:function(e){o.total=e},value:function(e){o.value=o.helper.forceArray(e)},progress:function(e){o.has.progressPoll()?(o.debug("Updated within interval, setting next update to use new value",e),o.set.nextValue(e)):(o.debug("First update in progress update interval, immediately updating",e),o.update.progress(e),o.create.progressPoll())},nextValue:function(e){o.nextValue=e}},update:{toNextValue:function(){var e=o.nextValue;e&&(o.debug("Update interval complete using last updated value",e),o.update.progress(e),o.remove.nextValue())},progress:function(e){var t=o.has.total();t&&o.set.value(e);var n=o.helper.forceArray(e).map(function(e){var n;return!1===(e=o.get.numericValue(e))&&o.error(v.nonNumeric,e),e=o.get.normalizedValue(e),t?(n=o.total>0?e/o.total*100:100,o.debug("Calculating percent complete from total",n)):(n=e,o.debug("Setting value to exact percentage value",n)),n});o.set.percent(n)}},setting:function(t,n){if(o.debug("Changing setting",t,n),e.isPlainObject(t))e.extend(!0,d,t);else{if(void 0===n)return d[t];e.isPlainObject(d[t])?e.extend(!0,d[t],n):d[t]=n}},internal:function(t,n){if(e.isPlainObject(t))e.extend(!0,o,t);else{if(void 0===n)return o[t];o[t]=n}},debug:function(){!d.silent&&d.debug&&(d.performance?o.performance.log(arguments):(o.debug=Function.prototype.bind.call(console.info,console,d.name+":"),o.debug.apply(console,arguments)))},verbose:function(){!d.silent&&d.verbose&&d.debug&&(d.performance?o.performance.log(arguments):(o.verbose=Function.prototype.bind.call(console.info,console,d.name+":"),o.verbose.apply(console,arguments)))},error:function(){d.silent||(o.error=Function.prototype.bind.call(console.error,console,d.name+":"),o.error.apply(console,arguments))},performance:{log:function(e){var t,n;d.performance&&(n=(t=(new Date).getTime())-(r||t),r=t,s.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:k,"Execution Time":n})),clearTimeout(o.performance.timer),o.performance.timer=setTimeout(o.performance.display,500)},display:function(){var t=d.name+":",n=0;r=!1,clearTimeout(o.performance.timer),e.each(s,function(e,t){n+=t["Execution Time"]}),t+=" "+n+"ms",a&&(t+=" '"+a+"'"),(void 0!==console.group||void 0!==console.table)&&s.length>0&&(console.groupCollapsed(t),console.table?console.table(s):e.each(s,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),s=[]}},invoke:function(t,n,a){var r,s,l,c=T;return n=n||u,a=k||a,"string"==typeof t&&void 0!==c&&(t=t.split(/[\. ]/),r=t.length-1,e.each(t,function(n,i){var a=n!=r?i+t[n+1].charAt(0).toUpperCase()+t[n+1].slice(1):t;if(e.isPlainObject(c[a])&&n!=r)c=c[a];else{if(void 0!==c[a])return s=c[a],!1;if(!e.isPlainObject(c[i])||n==r)return void 0!==c[i]?(s=c[i],!1):(o.error(v.method,t),!1);c=c[i]}})),e.isFunction(s)?l=s.apply(a,n):void 0!==s&&(l=s),Array.isArray(i)?i.push(l):void 0!==i?i=[i,l]:void 0!==l&&(i=l),s}},c?(void 0===T&&o.initialize(),o.invoke(l)):(void 0!==T&&T.invoke("destroy"),o.initialize())}),void 0!==i?i:this},e.fn.progress.settings={name:"Progress",namespace:"progress",silent:!1,debug:!1,verbose:!1,performance:!0,random:{min:2,max:5},duration:300,updateInterval:"auto",autoSuccess:!0,showActivity:!0,limitValues:!0,label:"percent",precision:0,framerate:1e3/30,percent:!1,total:!1,value:!1,failSafeDelay:100,onLabelUpdate:function(e,t,n,i){return t},onChange:function(e,t,n){},onSuccess:function(e){},onActive:function(e,t){},onError:function(e,t){},onWarning:function(e,t){},error:{method:"The method you called is not defined.",nonNumeric:"Progress value is non numeric",tooHigh:"Value specified is above 100%",tooLow:"Value specified is below 0%",sumExceedsTotal:"Sum of multple values exceed total"},regExp:{variable:/\{\$*[A-z0-9]+\}/g},metadata:{percent:"percent",total:"total",value:"value"},selector:{bar:"> .bar",label:"> .label",progress:".bar > .progress"},text:{active:!1,error:!1,success:!1,warning:!1,percent:"{percent}%",ratio:"{value} of {total}",bars:[""]},className:{active:"active",error:"error",success:"success",warning:"warning"}}}(jQuery,window,document),function(e,t,n,i){"use strict";t=void 0!==t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),e.fn.slider=function(i){var o,a=e(this),r=e(t),s=a.selector||"",l=(new Date).getTime(),c=[],u=arguments[0],d="string"==typeof u,f=[].slice.call(arguments,1),m=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],g=0;return a.each(function(){var t,a,p,v,h,b,y,x,C,w,k,T,S,D,A,E,F,P=e.isPlainObject(i)?e.extend(!0,{},e.fn.slider.settings,i):e.extend({},e.fn.slider.settings),O=P.className,R=P.metadata,M=P.namespace,I=P.error,j=P.keys,V=P.interpretLabel,L=!1,q="."+M,z="module-"+M,N=e(this),H=this,U=N.data(z),B=1;F={initialize:function(){F.debug("Initializing slider",P),E=!0,y=g+=1,S=F.setup.testOutTouch(),F.setup.layout(),F.setup.labels(),F.is.disabled()||F.bind.events(),F.read.metadata(),F.read.settings(),E=!1,F.instantiate()},instantiate:function(){F.verbose("Storing instance of slider",F),U=F,N.data(z,F)},destroy:function(){F.verbose("Destroying previous slider for",N),clearInterval(U.interval),F.unbind.events(),F.unbind.slidingEvents(),N.removeData(z),U=void 0},setup:{layout:function(){void 0===N.attr("tabindex")&&N.attr("tabindex",0),0==N.find(".inner").length&&N.append("<div class='inner'><div class='track'></div><div class='track-fill'></div><div class='thumb'></div></div>"),T=F.get.precision(),a=N.find(".thumb:not(.second)"),t=a,F.is.range()&&(0==N.find(".thumb.second").length&&N.find(".inner").append("<div class='thumb second'></div>"),p=N.find(".thumb.second")),v=N.find(".track"),h=N.find(".track-fill"),k=a.width()/2},labels:function(){F.is.labeled()&&(0!=(b=N.find(".labels:not(.auto)")).length?F.setup.customLabel():F.setup.autoLabel(),P.showLabelTicks&&N.addClass(O.ticked))},testOutTouch:function(){try{return n.createEvent("TouchEvent"),!0}catch(e){return!1}},customLabel:function(){var t,n=b.find(".label"),i=n.length,o=F.get.min(),a=F.get.max();n.each(function(n){var r=e(this).attr("data-value");t=r?((r=r>a?a:r<o?o:r)-o)/(a-o):(n+1)/(i+1),F.update.labelPosition(t,e(this))})},autoLabel:function(){0!=(b=N.find(".labels")).length?b.empty():b=N.append('<ul class="auto labels"></ul>').find(".labels");for(var t=0,n=F.get.numLabels();t<=n;t++){var i=F.get.label(t),o=""!==i?t%F.get.gapRatio()?e('<li class="halftick label"></li>'):e('<li class="label">'+i+"</li>"):null,a=t/n;o&&(F.update.labelPosition(a,o),b.append(o))}}},bind:{events:function(){F.bind.globalKeyboardEvents(),F.bind.keyboardEvents(),F.bind.mouseEvents(),F.is.touch()&&F.bind.touchEvents(),P.autoAdjustLabels&&F.bind.windowEvents()},keyboardEvents:function(){F.verbose("Binding keyboard events"),N.on("keydown"+q,F.event.keydown)},globalKeyboardEvents:function(){e(n).on("keydown"+q+y,F.event.activateFocus)},mouseEvents:function(){F.verbose("Binding mouse events"),N.find(".track, .thumb, .inner").on("mousedown"+q,function(e){e.stopImmediatePropagation(),e.preventDefault(),F.event.down(e)}),N.on("mousedown"+q,F.event.down),N.on("mouseenter"+q,function(e){L=!0}),N.on("mouseleave"+q,function(e){L=!1})},touchEvents:function(){F.verbose("Binding touch events"),N.find(".track, .thumb, .inner").on("touchstart"+q,function(e){e.stopImmediatePropagation(),e.preventDefault(),F.event.down(e)}),N.on("touchstart"+q,F.event.down)},slidingEvents:function(){F.verbose("Binding page wide events while handle is being draged"),F.is.touch()?(e(n).on("touchmove"+q,F.event.move),e(n).on("touchend"+q,F.event.up)):(e(n).on("mousemove"+q,F.event.move),e(n).on("mouseup"+q,F.event.up))},windowEvents:function(){r.on("resize"+q,F.event.resize)}},unbind:{events:function(){N.find(".track, .thumb, .inner").off("mousedown"+q),N.find(".track, .thumb, .inner").off("touchstart"+q),N.off("mousedown"+q),N.off("mouseenter"+q),N.off("mouseleave"+q),N.off("touchstart"+q),N.off("keydown"+q),N.off("focusout"+q),e(n).off("keydown"+q+y,F.event.activateFocus),r.off("resize"+q)},slidingEvents:function(){F.is.touch()?(e(n).off("touchmove"+q),e(n).off("touchend"+q)):(e(n).off("mousemove"+q),e(n).off("mouseup"+q))}},event:{down:function(e){if(e.preventDefault(),F.is.range()){var n=F.determine.eventPos(e),i=F.determine.pos(n);P.preventCrossover&&F.is.range()&&F.thumbVal===F.secondThumbVal?(A=i,t=void 0):t=F.determine.closestThumb(i),void 0===D&&(D=F.get.currentThumbValue())}else void 0===D&&(D=F.get.value());F.is.disabled()||F.bind.slidingEvents()},move:function(e){e.preventDefault();var n=F.determine.valueFromEvent(e);if(void 0===t){var i=F.determine.eventPos(e),o=F.determine.pos(i);t=A>o?a:p}if(0==F.get.step()||F.is.smooth()){var r=F.thumbVal,s=F.secondThumbVal,l=F.determine.smoothValueFromEvent(e);t.hasClass("second")?(P.preventCrossover&&F.is.range()&&(n=Math.max(r,n),l=Math.max(r,l)),s=n):(P.preventCrossover&&F.is.range()&&(n=Math.min(s,n),l=Math.min(s,l)),r=n),n=Math.abs(r-(s||0)),F.update.position(l),P.onMove.call(H,n,r,s)}else F.update.value(n,function(e,t,n){P.onMove.call(H,e,t,n)})},up:function(e){e.preventDefault();var t=F.determine.valueFromEvent(e);F.set.value(t),F.unbind.slidingEvents(),void 0!==D&&(D=void 0)},keydown:function(i,o){if(P.preventCrossover&&F.is.range()&&F.thumbVal===F.secondThumbVal&&(t=void 0),F.is.focused()&&e(n).trigger(i),o||F.is.focused()){var a=F.determine.keyMovement(i);if(0!=a)switch(i.preventDefault(),a){case 1:F.takeStep();break;case 2:F.takeStep(F.get.multiplier());break;case-1:F.backStep();break;case-2:F.backStep(F.get.multiplier())}}},activateFocus:function(e){!F.is.focused()&&F.is.hover()&&0!=F.determine.keyMovement(e)&&(e.preventDefault(),F.event.keydown(e,!0),N.focus())},resize:function(e){B!=F.get.gapRatio()&&(F.setup.labels(),B=F.get.gapRatio())}},resync:function(){F.verbose("Resyncing thumb position based on value"),F.is.range()&&F.update.position(F.secondThumbVal,p),F.update.position(F.thumbVal,a),F.setup.labels()},takeStep:function(e){e=null!=e?e:1;var t=F.get.step(),n=F.get.currentThumbValue();if(F.verbose("Taking a step"),t>0)F.set.value(n+t*e);else if(0==t){var i=F.get.precision(),o=n+e/i;F.set.value(Math.round(o*i)/i)}},backStep:function(e){e=null!=e?e:1;var t=F.get.step(),n=F.get.currentThumbValue();if(F.verbose("Going back a step"),t>0)F.set.value(n-t*e);else if(0==t){var i=F.get.precision(),o=n-e/i;F.set.value(Math.round(o*i)/i)}},is:{range:function(){return N.hasClass(P.className.range)},hover:function(){return L},focused:function(){return N.is(":focus")},disabled:function(){return N.hasClass(P.className.disabled)},labeled:function(){return N.hasClass(P.className.labeled)},reversed:function(){return N.hasClass(P.className.reversed)},vertical:function(){return N.hasClass(P.className.vertical)},smooth:function(){return P.smooth||N.hasClass(P.className.smooth)},touch:function(){return S}},get:{trackOffset:function(){return F.is.vertical()?v.offset().top:v.offset().left},trackLength:function(){return F.is.vertical()?v.height():v.width()},trackLeft:function(){return F.is.vertical()?v.position().top:v.position().left},trackStartPos:function(){return F.is.reversed()?F.get.trackLeft()+F.get.trackLength():F.get.trackLeft()},trackEndPos:function(){return F.is.reversed()?F.get.trackLeft():F.get.trackLeft()+F.get.trackLength()},trackStartMargin:function(){return(F.is.vertical()?F.is.reversed()?N.css("padding-bottom"):N.css("padding-top"):F.is.reversed()?N.css("padding-right"):N.css("padding-left"))||"0px"},trackEndMargin:function(){return(F.is.vertical()?F.is.reversed()?N.css("padding-top"):N.css("padding-bottom"):F.is.reversed()?N.css("padding-left"):N.css("padding-right"))||"0px"},precision:function(){var e,t=F.get.step();if(0!=t){var n=String(t).split(".");e=2==n.length?n[1].length:0}else e=P.decimalPlaces;var i=Math.pow(10,e);return F.debug("Precision determined",i),i},min:function(){return P.min},max:function(){var e=F.get.step(),t=F.get.min(),n=0===e?0:Math.floor((P.max-t)/e);return 0===(0===e?0:(P.max-t)%e)?P.max:t+n*e},step:function(){return P.step},numLabels:function(){var e=Math.round((F.get.max()-F.get.min())/(0===F.get.step()?1:F.get.step()));return F.debug("Determined that there should be "+e+" labels"),e},labelType:function(){return P.labelType},label:function(e){if(V)return V(e);switch(P.labelType){case P.labelTypes.number:return Math.round((e*(0===F.get.step()?1:F.get.step())+F.get.min())*T)/T;case P.labelTypes.letter:return m[e%26];default:return e}},value:function(){return x},currentThumbValue:function(){return void 0!==t&&t.hasClass("second")?F.secondThumbVal:F.thumbVal},thumbValue:function(e){switch(e){case"second":if(F.is.range())return F.secondThumbVal;F.error(I.notrange);break;case"first":default:return F.thumbVal}},multiplier:function(){return P.pageMultiplier},thumbPosition:function(e){switch(e){case"second":if(F.is.range())return w;F.error(I.notrange);break;case"first":default:return C}},gapRatio:function(){var e=1;if(P.autoAdjustLabels){var t=F.get.numLabels(),n=F.get.trackLength(),i=1;if(n>0)for(;n/t*i<P.labelDistance;)t%i||(e=i),i+=1}return e}},determine:{pos:function(e){return F.is.reversed()?F.get.trackStartPos()-e+F.get.trackOffset():e-F.get.trackOffset()-F.get.trackStartPos()},closestThumb:function(e){var t=parseFloat(F.determine.thumbPos(a)),n=Math.abs(e-t),i=parseFloat(F.determine.thumbPos(p)),o=Math.abs(e-i);return n===o&&F.get.thumbValue()===F.get.min()?p:n<=o?a:p},closestThumbPos:function(e){var t=parseFloat(F.determine.thumbPos(a)),n=Math.abs(e-t),i=parseFloat(F.determine.thumbPos(p));return n<=Math.abs(e-i)?t:i},thumbPos:function(e){return F.is.vertical()?F.is.reversed()?e.css("bottom"):e.css("top"):F.is.reversed()?e.css("right"):e.css("left")},positionFromValue:function(e){var t=F.get.min(),n=F.get.max(),i=(e=e>n?n:e<t?t:e,F.get.trackLength()),o=(e-t)/(n-t),a=Math.round(o*i);return F.verbose("Determined position: "+a+" from value: "+e),a},positionFromRatio:function(e){var t=F.get.trackLength(),n=F.get.step(),i=Math.round(e*t);return 0==n?i:Math.round(i/n)*n},valueFromEvent:function(e){var t=F.determine.eventPos(e),n=F.determine.pos(t);return t<F.get.trackOffset()?F.is.reversed()?F.get.max():F.get.min():t>F.get.trackOffset()+F.get.trackLength()?F.is.reversed()?F.get.min():F.get.max():F.determine.value(n)},smoothValueFromEvent:function(e){var t,n=F.get.min(),i=F.get.max(),o=F.get.trackLength(),a=F.determine.eventPos(e)-F.get.trackOffset();return t=(a=a<0?0:a>o?o:a)/o,F.is.reversed()&&(t=1-t),t*(i-n)+n},eventPos:function(e){if(F.is.touch()){var t=e.changedTouches?e:e.originalEvent,n=t.changedTouches[0]?t.changedTouches:t.touches,i=n[0].pageY,o=n[0].pageX;return F.is.vertical()?i:o}var a=e.pageY||e.originalEvent.pageY,r=e.pageX||e.originalEvent.pageX;return F.is.vertical()?a:r},value:function(e){var t=F.is.reversed()?F.get.trackEndPos():F.get.trackStartPos(),n=(e-t)/((F.is.reversed()?F.get.trackStartPos():F.get.trackEndPos())-t),i=F.get.max()-F.get.min(),o=F.get.step(),a=n*i,r=0==o?a:Math.round(a/o)*o;return F.verbose("Determined value based upon position: "+e+" as: "+a),a!=r&&F.verbose("Rounding value to closest step: "+r),F.verbose("Cutting off additional decimal places"),Math.round((r+F.get.min())*T)/T},keyMovement:function(e){var t=e.which,n=F.is.vertical()?F.is.reversed()?j.downArrow:j.upArrow:j.downArrow,i=F.is.vertical()?F.is.reversed()?j.upArrow:j.downArrow:j.upArrow,o=F.is.vertical()?j.leftArrow:F.is.reversed()?j.rightArrow:j.leftArrow,a=F.is.vertical()?j.rightArrow:F.is.reversed()?j.leftArrow:j.rightArrow;return t==n||t==o?-1:t==i||t==a?1:t==j.pageDown?-2:t==j.pageUp?2:0}},handleNewValuePosition:function(e){var t=F.get.min(),n=F.get.max();return e<=t?e=t:e>=n&&(e=n),F.determine.positionFromValue(e)},set:{value:function(e,t){t=!1!==t;var n=void 0===D;D=void 0===D?F.get.value():D,F.update.value(e,function(i,o,a){E&&!P.fireOnInit||!t||(e!==D&&P.onChange.call(H,i,o,a),P.onMove.call(H,i,o,a)),n&&(D=void 0)})},rangeValue:function(e,t,n){if(n=!1!==n,F.is.range()){var i=F.get.min(),o=F.get.max(),r=void 0===D;D=void 0===D?F.get.value():D,e<=i?e=i:e>=o&&(e=o),t<=i?t=i:t>=o&&(t=o),F.thumbVal=e,F.secondThumbVal=t,x=Math.abs(F.thumbVal-F.secondThumbVal),F.update.position(F.thumbVal,a),F.update.position(F.secondThumbVal,p),E&&!P.fireOnInit||!n||(x!==D&&P.onChange.call(H,x,F.thumbVal,F.secondThumbVal),P.onMove.call(H,x,F.thumbVal,F.secondThumbVal)),r&&(D=void 0)}else F.error(I.notrange)},position:function(e,t){var n=F.determine.value(e);switch(t){case"second":F.secondThumbVal=n,F.update.position(n,p);break;default:F.thumbVal=n,F.update.position(n,a)}x=Math.abs(F.thumbVal-(F.secondThumbVal||0)),F.set.value(x)}},update:{value:function(e,n){var i=F.get.min(),o=F.get.max();e<=i?e=i:e>=o&&(e=o),F.is.range()?(void 0===t&&(t=e<=F.get.currentThumbValue()?a:p),t.hasClass("second")?(P.preventCrossover&&F.is.range()&&(e=Math.max(F.thumbVal,e)),F.secondThumbVal=e):(P.preventCrossover&&F.is.range()&&(e=Math.min(F.secondThumbVal,e)),F.thumbVal=e),x=Math.abs(F.thumbVal-F.secondThumbVal)):(x=e,F.thumbVal=x),F.update.position(e),F.debug("Setting slider value to "+x),"function"==typeof n&&n(x,F.thumbVal,F.secondThumbVal)},position:function(e,n){var i=F.handleNewValuePosition(e),o=null!=n?n:t,a=F.thumbVal||F.get.min(),r=F.secondThumbVal||F.get.min();F.is.range()&&o.hasClass("second")?(w=i,r=e):(C=i,a=e);var s,l,c=F.get.min(),u=F.get.max(),d=100*(e-c)/(u-c),f=100*(Math.min(a,r)-c)/(u-c),m=100*(1-(Math.max(a,r)-c)/(u-c));F.is.vertical()?F.is.reversed()?(l={bottom:"calc("+d+"% - "+k+"px)",top:"auto"},s={bottom:f+"%",top:m+"%"}):(l={top:"calc("+d+"% - "+k+"px)",bottom:"auto"},s={top:f+"%",bottom:m+"%"}):F.is.reversed()?(l={right:"calc("+d+"% - "+k+"px)",left:"auto"},s={right:f+"%",left:m+"%"}):(l={left:"calc("+d+"% - "+k+"px)",right:"auto"},s={left:f+"%",right:m+"%"}),o.css(l),h.css(s),F.debug("Setting slider position to "+i)},labelPosition:function(e,t){var n=F.get.trackStartMargin(),i=F.get.trackEndMargin(),o=F.is.vertical()?F.is.reversed()?"bottom":"top":F.is.reversed()?"right":"left",a=F.is.reversed()&&!F.is.vertical()?" - ":" + ",r="(100% - "+n+" - "+i+") * "+e;t.css(o,"calc("+r+a+n+")")}},goto:{max:function(){F.set.value(F.get.max())},min:function(){F.set.value(F.get.min())}},read:{metadata:function(){var e={thumbVal:N.data(R.thumbVal),secondThumbVal:N.data(R.secondThumbVal)};e.thumbVal&&(F.is.range()&&e.secondThumbVal?(F.debug("Current value set from metadata",e.thumbVal,e.secondThumbVal),F.set.rangeValue(e.thumbVal,e.secondThumbVal)):(F.debug("Current value set from metadata",e.thumbVal),F.set.value(e.thumbVal)))},settings:function(){!1!==P.start&&(F.is.range()?(F.debug("Start position set from settings",P.start,P.end),F.set.rangeValue(P.start,P.end)):(F.debug("Start position set from settings",P.start),F.set.value(P.start)))}},setting:function(t,n){if(F.debug("Changing setting",t,n),e.isPlainObject(t))e.extend(!0,P,t);else{if(void 0===n)return P[t];e.isPlainObject(P[t])?e.extend(!0,P[t],n):P[t]=n}},internal:function(t,n){if(e.isPlainObject(t))e.extend(!0,F,t);else{if(void 0===n)return F[t];F[t]=n}},debug:function(){!P.silent&&P.debug&&(P.performance?F.performance.log(arguments):(F.debug=Function.prototype.bind.call(console.info,console,P.name+":"),F.debug.apply(console,arguments)))},verbose:function(){!P.silent&&P.verbose&&P.debug&&(P.performance?F.performance.log(arguments):(F.verbose=Function.prototype.bind.call(console.info,console,P.name+":"),F.verbose.apply(console,arguments)))},error:function(){P.silent||(F.error=Function.prototype.bind.call(console.error,console,P.name+":"),F.error.apply(console,arguments))},performance:{log:function(e){var t,n;P.performance&&(n=(t=(new Date).getTime())-(l||t),l=t,c.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:H,"Execution Time":n})),clearTimeout(F.performance.timer),F.performance.timer=setTimeout(F.performance.display,500)},display:function(){var t=P.name+":",n=0;l=!1,clearTimeout(F.performance.timer),e.each(c,function(e,t){n+=t["Execution Time"]}),t+=" "+n+"ms",s&&(t+=" '"+s+"'"),(void 0!==console.group||void 0!==console.table)&&c.length>0&&(console.groupCollapsed(t),console.table?console.table(c):e.each(c,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),c=[]}},invoke:function(t,n,i){var a,r,s,l=U;return n=n||f,i=H||i,"string"==typeof t&&void 0!==l&&(t=t.split(/[\. ]/),a=t.length-1,e.each(t,function(n,i){var o=n!=a?i+t[n+1].charAt(0).toUpperCase()+t[n+1].slice(1):t;if(e.isPlainObject(l[o])&&n!=a)l=l[o];else{if(void 0!==l[o])return r=l[o],!1;if(!e.isPlainObject(l[i])||n==a)return void 0!==l[i]?(r=l[i],!1):(F.error(I.method,t),!1);l=l[i]}})),e.isFunction(r)?s=r.apply(i,n):void 0!==r&&(s=r),e.isArray(o)?o.push(s):void 0!==o?o=[o,s]:void 0!==s&&(o=s),r}},d?(void 0===U&&F.initialize(),F.invoke(u)):(void 0!==U&&U.invoke("destroy"),F.initialize())}),void 0!==o?o:this},e.fn.slider.settings={silent:!1,debug:!1,verbose:!1,performance:!0,name:"Slider",namespace:"slider",error:{method:"The method you called is not defined.",notrange:"This slider is not a range slider"},metadata:{thumbVal:"thumbVal",secondThumbVal:"secondThumbVal"},min:0,max:20,step:1,start:0,end:20,labelType:"number",showLabelTicks:!1,smooth:!1,autoAdjustLabels:!0,labelDistance:100,preventCrossover:!0,fireOnInit:!1,interpretLabel:!1,decimalPlaces:2,pageMultiplier:2,selector:{},className:{reversed:"reversed",disabled:"disabled",labeled:"labeled",ticked:"ticked",vertical:"vertical",range:"range",smooth:"smooth"},keys:{pageUp:33,pageDown:34,leftArrow:37,upArrow:38,rightArrow:39,downArrow:40},labelTypes:{number:"number",letter:"letter"},onChange:function(e,t,n){},onMove:function(e,t,n){}}}(jQuery,window,document),function(e,t,n,i){"use strict";e.isFunction=e.isFunction||function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},t=void 0!==t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),e.fn.rating=function(t){var n,i=e(this),o=i.selector||"",a=(new Date).getTime(),r=[],s=arguments[0],l="string"==typeof s,c=[].slice.call(arguments,1);return i.each(function(){var u,d,f=e.isPlainObject(t)?e.extend(!0,{},e.fn.rating.settings,t):e.extend({},e.fn.rating.settings),m=f.namespace,g=f.className,p=f.metadata,v=f.selector,h=f.cssVars,b="."+m,y="module-"+m,x=this,C=e(this).data(y),w=e(this),k=w.find(v.icon);d={initialize:function(){d.verbose("Initializing rating module",f),0===k.length&&d.setup.layout(),f.interactive&&!d.is.disabled()?d.enable():d.disable(),d.set.initialLoad(),d.set.rating(d.get.initialRating()),d.remove.initialLoad(),d.instantiate()},instantiate:function(){d.verbose("Instantiating module",f),C=d,w.data(y,d)},destroy:function(){d.verbose("Destroying previous instance",C),d.remove.events(),w.removeData(y)},refresh:function(){k=w.find(v.icon)},setup:{layout:function(){var t=d.get.maxRating(),n=d.get.icon(),i=e.fn.rating.settings.templates.icon(t,n);d.debug("Generating icon html dynamically"),w.html(i),d.refresh()}},event:{mouseenter:function(){var t=e(this);t.nextAll().removeClass(g.selected),w.addClass(g.selected),t.addClass(g.selected).prevAll().addClass(g.selected)},mouseleave:function(){w.removeClass(g.selected),k.removeClass(g.selected)},click:function(){var t=e(this),n=d.get.rating(),i=k.index(t)+1;("auto"==f.clearable?1===k.length:f.clearable)&&n==i?d.clearRating():d.set.rating(i)}},clearRating:function(){d.debug("Clearing current rating"),d.set.rating(0)},bind:{events:function(){d.verbose("Binding events"),w.on("mouseenter"+b,v.icon,d.event.mouseenter).on("mouseleave"+b,v.icon,d.event.mouseleave).on("click"+b,v.icon,d.event.click)}},remove:{events:function(){d.verbose("Removing events"),w.off(b)},initialLoad:function(){u=!1}},enable:function(){d.debug("Setting rating to interactive mode"),d.bind.events(),w.removeClass(g.disabled)},disable:function(){d.debug("Setting rating to read-only mode"),d.remove.events(),w.addClass(g.disabled)},is:{initialLoad:function(){return u},disabled:function(){return w.hasClass(g.disabled)}},get:{icon:function(){var e=w.data(p.icon);return e&&w.removeData(p.icon),e||f.icon},initialRating:function(){return void 0!==w.data(p.rating)?(w.removeData(p.rating),w.data(p.rating)):f.initialRating},maxRating:function(){return void 0!==w.data(p.maxRating)?(w.removeData(p.maxRating),w.data(p.maxRating)):f.maxRating},rating:function(){var e=k.filter("."+g.active).length;return d.verbose("Current rating retrieved",e),e}},set:{rating:function(e){var t=Math.floor(e-1>=0?e-1:0),n=k.eq(t),i=e<=1?n:n.next(),o=e%1*100;w.removeClass(g.selected),k.removeClass(g.selected).removeClass(g.active).removeClass(g.partiallyActive),e>0&&(d.verbose("Setting current rating to",e),n.prevAll().addBack().addClass(g.active),n.next()&&e%1!=0&&(i.addClass(g.partiallyActive).addClass(g.active),i.css(h.filledCustomPropName,o+"%"),"transparent"===i.css("backgroundColor")&&i.removeClass(g.partiallyActive).removeClass(g.active))),d.is.initialLoad()||f.onRate.call(x,e)},initialLoad:function(){u=!0}},setting:function(t,n){if(d.debug("Changing setting",t,n),e.isPlainObject(t))e.extend(!0,f,t);else{if(void 0===n)return f[t];e.isPlainObject(f[t])?e.extend(!0,f[t],n):f[t]=n}},internal:function(t,n){if(e.isPlainObject(t))e.extend(!0,d,t);else{if(void 0===n)return d[t];d[t]=n}},debug:function(){!f.silent&&f.debug&&(f.performance?d.performance.log(arguments):(d.debug=Function.prototype.bind.call(console.info,console,f.name+":"),d.debug.apply(console,arguments)))},verbose:function(){!f.silent&&f.verbose&&f.debug&&(f.performance?d.performance.log(arguments):(d.verbose=Function.prototype.bind.call(console.info,console,f.name+":"),d.verbose.apply(console,arguments)))},error:function(){f.silent||(d.error=Function.prototype.bind.call(console.error,console,f.name+":"),d.error.apply(console,arguments))},performance:{log:function(e){var t,n;f.performance&&(n=(t=(new Date).getTime())-(a||t),a=t,r.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:x,"Execution Time":n})),clearTimeout(d.performance.timer),d.performance.timer=setTimeout(d.performance.display,500)},display:function(){var t=f.name+":",n=0;a=!1,clearTimeout(d.performance.timer),e.each(r,function(e,t){n+=t["Execution Time"]}),t+=" "+n+"ms",o&&(t+=" '"+o+"'"),i.length>1&&(t+=" ("+i.length+")"),(void 0!==console.group||void 0!==console.table)&&r.length>0&&(console.groupCollapsed(t),console.table?console.table(r):e.each(r,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),r=[]}},invoke:function(t,i,o){var a,r,s,l=C;return i=i||c,o=x||o,"string"==typeof t&&void 0!==l&&(t=t.split(/[\. ]/),a=t.length-1,e.each(t,function(n,i){var o=n!=a?i+t[n+1].charAt(0).toUpperCase()+t[n+1].slice(1):t;if(e.isPlainObject(l[o])&&n!=a)l=l[o];else{if(void 0!==l[o])return r=l[o],!1;if(!e.isPlainObject(l[i])||n==a)return void 0!==l[i]&&(r=l[i],!1);l=l[i]}})),e.isFunction(r)?s=r.apply(o,i):void 0!==r&&(s=r),Array.isArray(n)?n.push(s):void 0!==n?n=[n,s]:void 0!==s&&(n=s),r}},l?(void 0===C&&d.initialize(),d.invoke(s)):(void 0!==C&&C.invoke("destroy"),d.initialize())}),void 0!==n?n:this},e.fn.rating.settings={name:"Rating",namespace:"rating",icon:"star",silent:!1,debug:!1,verbose:!1,performance:!0,initialRating:0,interactive:!0,maxRating:4,clearable:"auto",fireOnInit:!1,onRate:function(e){},error:{method:"The method you called is not defined",noMaximum:"No maximum rating specified. Cannot generate HTML automatically"},metadata:{rating:"rating",maxRating:"maxRating",icon:"icon"},className:{active:"active",disabled:"disabled",selected:"selected",loading:"loading",partiallyActive:"partial"},cssVars:{filledCustomPropName:"--full"},selector:{icon:".icon"},templates:{icon:function(e,t){for(var n=1,i="";n<=e;)i+='<i class="'+t+' icon"></i>',n++;return i}}}}(jQuery,window,document),function(e,t,n,i){"use strict";e.isFunction=e.isFunction||function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},t=void 0!==t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),e.fn.search=function(i){var o,a=e(this),r=a.selector||"",s=(new Date).getTime(),l=[],c=arguments[0],u="string"==typeof c,d=[].slice.call(arguments,1);return e(this).each(function(){var f,m=e.isPlainObject(i)?e.extend(!0,{},e.fn.search.settings,i):e.extend({},e.fn.search.settings),g=m.className,p=m.metadata,v=m.regExp,h=m.fields,b=m.selector,y=m.error,x=m.namespace,C="."+x,w=x+"-module",k=e(this),T=k.find(b.prompt),S=k.find(b.searchButton),D=k.find(b.results),A=k.find(b.result),E=(k.find(b.category),this),F=k.data(w),P=!1,O=!1;f={initialize:function(){f.verbose("Initializing module"),f.get.settings(),f.determine.searchFields(),f.bind.events(),f.set.type(),f.create.results(),f.instantiate()},instantiate:function(){f.verbose("Storing instance of module",f),F=f,k.data(w,f)},destroy:function(){f.verbose("Destroying instance"),k.off(C).removeData(w)},refresh:function(){f.debug("Refreshing selector cache"),T=k.find(b.prompt),S=k.find(b.searchButton),k.find(b.category),D=k.find(b.results),A=k.find(b.result)},refreshResults:function(){D=k.find(b.results),A=k.find(b.result)},bind:{events:function(){f.verbose("Binding events to search"),m.automatic&&(k.on(f.get.inputEvent()+C,b.prompt,f.event.input),T.attr("autocomplete",f.is.chrome()?"fomantic-search":"off")),k.on("focus"+C,b.prompt,f.event.focus).on("blur"+C,b.prompt,f.event.blur).on("keydown"+C,b.prompt,f.handleKeyboard).on("click"+C,b.searchButton,f.query).on("mousedown"+C,b.results,f.event.result.mousedown).on("mouseup"+C,b.results,f.event.result.mouseup).on("click"+C,b.result,f.event.result.click)}},determine:{searchFields:function(){i&&void 0!==i.searchFields&&(m.searchFields=i.searchFields)}},event:{input:function(){m.searchDelay?(clearTimeout(f.timer),f.timer=setTimeout(function(){f.is.focused()&&f.query()},m.searchDelay)):f.query()},focus:function(){f.set.focus(),m.searchOnFocus&&f.has.minimumCharacters()&&f.query(function(){f.can.show()&&f.showResults()})},blur:function(e){var t=n.activeElement===this,i=function(){f.cancel.query(),f.remove.focus(),f.timer=setTimeout(f.hideResults,m.hideDelay)};t||(O=!1,f.resultsClicked?(f.debug("Determining if user action caused search to close"),k.one("click.close"+C,b.results,function(e){f.is.inMessage(e)||P?T.focus():(P=!1,f.is.animating()||f.is.hidden()||i())})):(f.debug("Input blurred without user action, closing results"),i()))},result:{mousedown:function(){f.resultsClicked=!0},mouseup:function(){f.resultsClicked=!1},click:function(n){f.debug("Search result selected");var i=e(this),o=i.find(b.title).eq(0),a=i.is("a[href]")?i:i.find("a[href]").eq(0),r=a.attr("href")||!1,s=a.attr("target")||!1,l=o.length>0&&o.text(),c=f.get.results(),u=i.data(p.result)||f.get.result(l,c),d=f.get.value();if(e.isFunction(m.onSelect)&&!1===m.onSelect.call(E,u,c))return f.debug("Custom onSelect callback cancelled default select action"),void(P=!0);f.hideResults(),l&&f.get.value()===d&&f.set.value(l),r&&(n.preventDefault(),f.verbose("Opening search link found in result",a),"_blank"==s||n.ctrlKey?t.open(r):t.location.href=r)}}},ensureVisible:function(e){var t,n,i,o;0!==e.length&&(n=(t=e.position().top)+e.outerHeight(!0),i=D.scrollTop(),o=D.height(),t<0?D.scrollTop(i+t):o<n&&D.scrollTop(i+(n-o)))},handleKeyboard:function(e){var t,n=k.find(b.result),i=k.find(b.category),o=n.filter("."+g.active),a=n.index(o),r=n.length,s=o.length>0,l=e.which,c=13,u=38,d=40;if(l==27&&(f.verbose("Escape key pressed, blurring search field"),f.hideResults(),O=!0),f.is.visible())if(l==c){if(f.verbose("Enter key pressed, selecting active result"),n.filter("."+g.active).length>0)return f.event.result.click.call(n.filter("."+g.active),e),e.preventDefault(),!1}else l==u&&s?(f.verbose("Up key pressed, changing active result"),t=a-1<0?a:a-1,i.removeClass(g.active),n.removeClass(g.active).eq(t).addClass(g.active).closest(i).addClass(g.active),f.ensureVisible(n.eq(t)),e.preventDefault()):l==d&&(f.verbose("Down key pressed, changing active result"),t=a+1>=r?a:a+1,i.removeClass(g.active),n.removeClass(g.active).eq(t).addClass(g.active).closest(i).addClass(g.active),f.ensureVisible(n.eq(t)),e.preventDefault());else l==c&&(f.verbose("Enter key pressed, executing query"),f.query(),f.set.buttonPressed(),T.one("keyup",f.remove.buttonFocus))},setup:{api:function(t,n){var i={debug:m.debug,on:!1,cache:m.cache,action:"search",urlData:{query:t},onSuccess:function(e){f.parse.response.call(E,e,t),n()},onFailure:function(){f.displayMessage(y.serverError),n()},onAbort:function(e){},onError:f.error};e.extend(!0,i,m.apiSettings),f.verbose("Setting up API request",i),k.api(i)}},can:{useAPI:function(){return void 0!==e.fn.api},show:function(){return f.is.focused()&&!f.is.visible()&&!f.is.empty()},transition:function(){return m.transition&&void 0!==e.fn.transition&&k.transition("is supported")}},is:{animating:function(){return D.hasClass(g.animating)},chrome:function(){return!(!t.chrome||!t.chrome.webstore&&!t.chrome.runtime)},hidden:function(){return D.hasClass(g.hidden)},inMessage:function(t){if(t.target){var i=e(t.target);return e.contains(n.documentElement,t.target)&&i.closest(b.message).length>0}},empty:function(){return""===D.html()},visible:function(){return D.filter(":visible").length>0},focused:function(){return T.filter(":focus").length>0}},get:{settings:function(){e.isPlainObject(i)&&i.searchFullText&&(m.fullTextSearch=i.searchFullText,f.error(m.error.oldSearchSyntax,E)),m.ignoreDiacritics&&!String.prototype.normalize&&(m.ignoreDiacritics=!1,f.error(y.noNormalize,E))},inputEvent:function(){var e=T[0];return void 0!==e&&void 0!==e.oninput?"input":void 0!==e&&void 0!==e.onpropertychange?"propertychange":"keyup"},value:function(){return T.val()},results:function(){return k.data(p.results)},result:function(t,n){var i=!1;return t=void 0!==t?t:f.get.value(),n=void 0!==n?n:f.get.results(),"category"===m.type?(f.debug("Finding result that matches",t),e.each(n,function(e,n){if(Array.isArray(n.results)&&(i=f.search.object(t,n.results)[0]))return!1})):(f.debug("Finding result in results object",t),i=f.search.object(t,n)[0]),i||!1}},select:{firstResult:function(){f.verbose("Selecting first result"),A.first().addClass(g.active)}},set:{focus:function(){k.addClass(g.focus)},loading:function(){k.addClass(g.loading)},value:function(e){f.verbose("Setting search input value",e),T.val(e)},type:function(e){e=e||m.type,"category"==m.type&&k.addClass(m.type)},buttonPressed:function(){S.addClass(g.pressed)}},remove:{loading:function(){k.removeClass(g.loading)},focus:function(){k.removeClass(g.focus)},buttonPressed:function(){S.removeClass(g.pressed)},diacritics:function(e){return m.ignoreDiacritics?e.normalize("NFD").replace(/[\u0300-\u036f]/g,""):e}},query:function(t){t=e.isFunction(t)?t:function(){};var n=f.get.value(),i=f.read.cache(n);t=t||function(){},f.has.minimumCharacters()?(i?(f.debug("Reading result from cache",n),f.save.results(i.results),f.addResults(i.html),f.inject.id(i.results),t()):(f.debug("Querying for",n),e.isPlainObject(m.source)||Array.isArray(m.source)?(f.search.local(n),t()):f.can.useAPI()?f.search.remote(n,t):(f.error(y.source),t())),m.onSearchQuery.call(E,n)):f.hideResults()},search:{local:function(e){var t,n=f.search.object(e,m.source);f.set.loading(),f.save.results(n),f.debug("Returned full local search results",n),m.maxResults>0&&(f.debug("Using specified max results",n),n=n.slice(0,m.maxResults)),"category"==m.type&&(n=f.create.categoryResults(n)),t=f.generateResults({results:n}),f.remove.loading(),f.addResults(t),f.inject.id(n),f.write.cache(e,{html:t,results:n})},remote:function(t,n){n=e.isFunction(n)?n:function(){},k.api("is loading")&&k.api("abort"),f.setup.api(t,n),k.api("query")},object:function(t,n,i){t=f.remove.diacritics(String(t));var o=[],a=[],r=[],s=t.replace(v.escape,"\\$&"),l=new RegExp(v.beginsWith+s,"i"),c=function(t,n){var i=-1==e.inArray(n,o),s=-1==e.inArray(n,r),l=-1==e.inArray(n,a);i&&s&&l&&t.push(n)};return n=n||m.source,i=void 0!==i?i:m.searchFields,Array.isArray(i)||(i=[i]),void 0===n||!1===n?(f.error(y.source),[]):(e.each(i,function(i,s){e.each(n,function(e,n){var i;"string"!=typeof n[s]&&"number"!=typeof n[s]||(-1!==(i="string"==typeof n[s]?f.remove.diacritics(n[s]):n[s].toString()).search(l)?c(o,n):"exact"===m.fullTextSearch&&f.exactSearch(t,i)?c(a,n):1==m.fullTextSearch&&f.fuzzySearch(t,i)&&c(r,n))})}),e.merge(a,r),e.merge(o,a),o)}},exactSearch:function(e,t){return e=e.toLowerCase(),(t=t.toLowerCase()).indexOf(e)>-1},fuzzySearch:function(e,t){var n=t.length,i=e.length;if("string"!=typeof e)return!1;if(e=e.toLowerCase(),t=t.toLowerCase(),i>n)return!1;if(i===n)return e===t;e:for(var o=0,a=0;o<i;o++){for(var r=e.charCodeAt(o);a<n;)if(t.charCodeAt(a++)===r)continue e;return!1}return!0},parse:{response:function(e,t){if(Array.isArray(e)){var n={};n[h.results]=e,e=n}var i=f.generateResults(e);f.verbose("Parsing server response",e),void 0!==e&&void 0!==t&&void 0!==e[h.results]&&(f.addResults(i),f.inject.id(e[h.results]),f.write.cache(t,{html:i,results:e[h.results]}),f.save.results(e[h.results]))}},cancel:{query:function(){f.can.useAPI()&&k.api("abort")}},has:{minimumCharacters:function(){return f.get.value().length>=m.minCharacters},results:function(){return 0!==D.length&&""!=D.html()}},clear:{cache:function(e){var t=k.data(p.cache);e?e&&t&&t[e]&&(f.debug("Removing value from cache",e),delete t[e],k.data(p.cache,t)):(f.debug("Clearing cache",e),k.removeData(p.cache))}},read:{cache:function(e){var t=k.data(p.cache);return!!m.cache&&(f.verbose("Checking cache for generated html for query",e),"object"==typeof t&&void 0!==t[e]&&t[e])}},create:{categoryResults:function(t){var n={};return e.each(t,function(e,t){t.category&&(void 0===n[t.category]?(f.verbose("Creating new category of results",t.category),n[t.category]={name:t.category,results:[t]}):n[t.category].results.push(t))}),n},id:function(e,t){var n,i=e+1;return void 0!==t?(n=String.fromCharCode(97+t)+i,f.verbose("Creating category result id",n)):(n=i,f.verbose("Creating result id",n)),n},results:function(){0===D.length&&(D=e("<div />").addClass(g.results).appendTo(k))}},inject:{result:function(e,t,n){f.verbose("Injecting result into results");var i=void 0!==n?D.children().eq(n).children(b.results).first().children(b.result).eq(t):D.children(b.result).eq(t);f.verbose("Injecting results metadata",i),i.data(p.result,e)},id:function(t){f.debug("Injecting unique ids into results");var n=0,i=0;return"category"===m.type?e.each(t,function(t,o){o.results.length>0&&(i=0,e.each(o.results,function(e,t){void 0===t.id&&(t.id=f.create.id(i,n)),f.inject.result(t,i,n),i++}),n++)}):e.each(t,function(e,t){void 0===t.id&&(t.id=f.create.id(i)),f.inject.result(t,i),i++}),t}},save:{results:function(e){f.verbose("Saving current search results to metadata",e),k.data(p.results,e)}},write:{cache:function(e,t){var n=void 0!==k.data(p.cache)?k.data(p.cache):{};m.cache&&(f.verbose("Writing generated html to cache",e,t),n[e]=t,k.data(p.cache,n))}},addResults:function(t){if(e.isFunction(m.onResultsAdd)&&!1===m.onResultsAdd.call(D,t))return f.debug("onResultsAdd callback cancelled default action"),!1;t?(D.html(t),f.refreshResults(),m.selectFirstResult&&f.select.firstResult(),f.showResults()):f.hideResults(function(){D.empty()})},showResults:function(t){t=e.isFunction(t)?t:function(){},O||!f.is.visible()&&f.has.results()&&(f.can.transition()?(f.debug("Showing results with css animations"),D.transition({animation:m.transition+" in",debug:m.debug,verbose:m.verbose,duration:m.duration,onShow:function(){var e=k.find(b.result).eq(0);f.ensureVisible(e)},onComplete:function(){t()},queue:!0})):(f.debug("Showing results with javascript"),D.stop().fadeIn(m.duration,m.easing)),m.onResultsOpen.call(D))},hideResults:function(t){t=e.isFunction(t)?t:function(){},f.is.visible()&&(f.can.transition()?(f.debug("Hiding results with css animations"),D.transition({animation:m.transition+" out",debug:m.debug,verbose:m.verbose,duration:m.duration,onComplete:function(){t()},queue:!0})):(f.debug("Hiding results with javascript"),D.stop().fadeOut(m.duration,m.easing)),m.onResultsClose.call(D))},generateResults:function(t){f.debug("Generating html from response",t);var n=m.templates[m.type],i=e.isPlainObject(t[h.results])&&!e.isEmptyObject(t[h.results]),o=Array.isArray(t[h.results])&&t[h.results].length>0,a="";return i||o?(m.maxResults>0&&(i?"standard"==m.type&&f.error(y.maxResults):t[h.results]=t[h.results].slice(0,m.maxResults)),e.isFunction(n)?a=n(t,h,m.preserveHTML):f.error(y.noTemplate,!1)):m.showNoResults&&(a=f.displayMessage(y.noResults,"empty",y.noResultsHeader)),m.onResults.call(E,t),a},displayMessage:function(e,t,n){return t=t||"standard",f.debug("Displaying message",e,t,n),f.addResults(m.templates.message(e,t,n)),m.templates.message(e,t,n)},setting:function(t,n){if(e.isPlainObject(t))e.extend(!0,m,t);else{if(void 0===n)return m[t];m[t]=n}},internal:function(t,n){if(e.isPlainObject(t))e.extend(!0,f,t);else{if(void 0===n)return f[t];f[t]=n}},debug:function(){!m.silent&&m.debug&&(m.performance?f.performance.log(arguments):(f.debug=Function.prototype.bind.call(console.info,console,m.name+":"),f.debug.apply(console,arguments)))},verbose:function(){!m.silent&&m.verbose&&m.debug&&(m.performance?f.performance.log(arguments):(f.verbose=Function.prototype.bind.call(console.info,console,m.name+":"),f.verbose.apply(console,arguments)))},error:function(){m.silent||(f.error=Function.prototype.bind.call(console.error,console,m.name+":"),f.error.apply(console,arguments))},performance:{log:function(e){var t,n;m.performance&&(n=(t=(new Date).getTime())-(s||t),s=t,l.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:E,"Execution Time":n})),clearTimeout(f.performance.timer),f.performance.timer=setTimeout(f.performance.display,500)},display:function(){var t=m.name+":",n=0;s=!1,clearTimeout(f.performance.timer),e.each(l,function(e,t){n+=t["Execution Time"]}),t+=" "+n+"ms",r&&(t+=" '"+r+"'"),a.length>1&&(t+=" ("+a.length+")"),(void 0!==console.group||void 0!==console.table)&&l.length>0&&(console.groupCollapsed(t),console.table?console.table(l):e.each(l,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),l=[]}},invoke:function(t,n,i){var a,r,s,l=F;return n=n||d,i=E||i,"string"==typeof t&&void 0!==l&&(t=t.split(/[\. ]/),a=t.length-1,e.each(t,function(n,i){var o=n!=a?i+t[n+1].charAt(0).toUpperCase()+t[n+1].slice(1):t;if(e.isPlainObject(l[o])&&n!=a)l=l[o];else{if(void 0!==l[o])return r=l[o],!1;if(!e.isPlainObject(l[i])||n==a)return void 0!==l[i]&&(r=l[i],!1);l=l[i]}})),e.isFunction(r)?s=r.apply(i,n):void 0!==r&&(s=r),Array.isArray(o)?o.push(s):void 0!==o?o=[o,s]:void 0!==s&&(o=s),r}},u?(void 0===F&&f.initialize(),f.invoke(c)):(void 0!==F&&F.invoke("destroy"),f.initialize())}),void 0!==o?o:this},e.fn.search.settings={name:"Search",namespace:"search",silent:!1,debug:!1,verbose:!1,performance:!0,type:"standard",minCharacters:1,selectFirstResult:!1,apiSettings:!1,source:!1,searchOnFocus:!0,searchFields:["id","title","description"],displayField:"",fullTextSearch:"exact",ignoreDiacritics:!1,automatic:!0,hideDelay:0,searchDelay:200,maxResults:7,cache:!0,showNoResults:!0,preserveHTML:!0,transition:"scale",duration:200,easing:"easeOutExpo",onSelect:!1,onResultsAdd:!1,onSearchQuery:function(e){},onResults:function(e){},onResultsOpen:function(){},onResultsClose:function(){},className:{animating:"animating",active:"active",empty:"empty",focus:"focus",hidden:"hidden",loading:"loading",results:"results",pressed:"down"},error:{source:"Cannot search. No source used, and Semantic API module was not included",noResultsHeader:"No Results",noResults:"Your search returned no results",logging:"Error in debug logging, exiting.",noEndpoint:"No search endpoint was specified",noTemplate:"A valid template name was not specified.",oldSearchSyntax:"searchFullText setting has been renamed fullTextSearch for consistency, please adjust your settings.",serverError:"There was an issue querying the server.",maxResults:"Results must be an array to use maxResults setting",method:"The method you called is not defined.",noNormalize:'"ignoreDiacritics" setting will be ignored. Browser does not support String().normalize(). You may consider including <https://cdn.jsdelivr.net/npm/unorm@1.4.1/lib/unorm.min.js> as a polyfill.'},metadata:{cache:"cache",results:"results",result:"result"},regExp:{escape:/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,beginsWith:"(?:s|^)"},fields:{categories:"results",categoryName:"name",categoryResults:"results",description:"description",image:"image",price:"price",results:"results",title:"title",url:"url",action:"action",actionText:"text",actionURL:"url"},selector:{prompt:".prompt",searchButton:".search.button",results:".results",message:".results > .message",category:".category",result:".result",title:".title, .name"},templates:{escape:function(e,t){if(t)return e;var n={"<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"};return/[&<>"'`]/.test(e)?(e=e.replace(/&(?![a-z0-9#]{1,6};)/,"&amp;")).replace(/[<>"'`]/g,function(e){return n[e]}):e},message:function(e,t,n){var i="";return void 0!==e&&void 0!==t&&(i+='<div class="message '+t+'">',n&&(i+='<div class="header">'+n+"</div>"),i+=' <div class="description">'+e+"</div>",i+="</div>"),i},category:function(t,n,i){var o="",a=e.fn.search.settings.templates.escape;return void 0!==t[n.categoryResults]&&(e.each(t[n.categoryResults],function(t,r){void 0!==r[n.results]&&r.results.length>0&&(o+='<div class="category">',void 0!==r[n.categoryName]&&(o+='<div class="name">'+a(r[n.categoryName],i)+"</div>"),o+='<div class="results">',e.each(r.results,function(e,t){t[n.url]?o+='<a class="result" href="'+t[n.url].replace(/"/g,"")+'">':o+='<a class="result">',void 0!==t[n.image]&&(o+='<div class="image"> <img src="'+t[n.image].replace(/"/g,"")+'"></div>'),o+='<div class="content">',void 0!==t[n.price]&&(o+='<div class="price">'+a(t[n.price],i)+"</div>"),void 0!==t[n.title]&&(o+='<div class="title">'+a(t[n.title],i)+"</div>"),void 0!==t[n.description]&&(o+='<div class="description">'+a(t[n.description],i)+"</div>"),o+="</div>",o+="</a>"}),o+="</div>",o+="</div>")}),t[n.action]&&(!1===n.actionURL?o+='<div class="action">'+a(t[n.action][n.actionText],i)+"</div>":o+='<a href="'+t[n.action][n.actionURL].replace(/"/g,"")+'" class="action">'+a(t[n.action][n.actionText],i)+"</a>"),o)},standard:function(t,n,i){var o="",a=e.fn.search.settings.templates.escape;return void 0!==t[n.results]&&(e.each(t[n.results],function(e,t){t[n.url]?o+='<a class="result" href="'+t[n.url].replace(/"/g,"")+'">':o+='<a class="result">',void 0!==t[n.image]&&(o+='<div class="image"> <img src="'+t[n.image].replace(/"/g,"")+'"></div>'),o+='<div class="content">',void 0!==t[n.price]&&(o+='<div class="price">'+a(t[n.price],i)+"</div>"),void 0!==t[n.title]&&(o+='<div class="title">'+a(t[n.title],i)+"</div>"),void 0!==t[n.description]&&(o+='<div class="description">'+a(t[n.description],i)+"</div>"),o+="</div>",o+="</a>"}),t[n.action]&&(!1===n.actionURL?o+='<div class="action">'+a(t[n.action][n.actionText],i)+"</div>":o+='<a href="'+t[n.action][n.actionURL].replace(/"/g,"")+'" class="action">'+a(t[n.action][n.actionText],i)+"</a>"),o)}}}}(jQuery,window,document),function(e,t,n,i){"use strict";e.isFunction=e.isFunction||function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},t=void 0!==t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),e.fn.shape=function(i){var o,a=e(this),r=(new Date).getTime(),s=[],l=arguments[0],c="string"==typeof l,u=[].slice.call(arguments,1),d=t.requestAnimationFrame||t.mozRequestAnimationFrame||t.webkitRequestAnimationFrame||t.msRequestAnimationFrame||function(e){setTimeout(e,0)};return a.each(function(){var t,f,m,g=a.selector||"",p=e.isPlainObject(i)?e.extend(!0,{},e.fn.shape.settings,i):e.extend({},e.fn.shape.settings),v=p.namespace,h=p.selector,b=p.error,y=p.className,x="."+v,C="module-"+v,w=e(this),k=w.find(">"+h.sides),T=k.find(">"+h.side),S=!1,D=this,A=w.data(C);if(m={initialize:function(){m.verbose("Initializing module for",D),m.set.defaultSide(),m.instantiate()},instantiate:function(){m.verbose("Storing instance of module",m),A=m,w.data(C,A)},destroy:function(){m.verbose("Destroying previous module for",D),w.removeData(C).off(x)},refresh:function(){m.verbose("Refreshing selector cache for",D),w=e(D),k=e(this).find(h.sides),T=e(this).find(h.side)},repaint:function(){m.verbose("Forcing repaint event");(k[0]||n.createElement("div")).offsetWidth},animate:function(e,n){m.verbose("Animating box with properties",e),n=n||function(e){m.verbose("Executing animation callback"),void 0!==e&&e.stopPropagation(),m.reset(),m.set.active()},p.beforeChange.call(f[0]),m.get.transitionEvent()?(m.verbose("Starting CSS animation"),w.addClass(y.animating),k.css(e).one(m.get.transitionEvent(),n),m.set.duration(p.duration),d(function(){w.addClass(y.animating),t.addClass(y.hidden)})):n()},queue:function(e){m.debug("Queueing animation of",e),k.one(m.get.transitionEvent(),function(){m.debug("Executing queued animation"),setTimeout(function(){w.shape(e)},0)})},reset:function(){m.verbose("Animating states reset"),w.removeClass(y.animating).attr("style","").removeAttr("style"),k.attr("style","").removeAttr("style"),T.attr("style","").removeAttr("style").removeClass(y.hidden),f.removeClass(y.animating).attr("style","").removeAttr("style")},is:{complete:function(){return T.filter("."+y.active)[0]==f[0]},animating:function(){return w.hasClass(y.animating)},hidden:function(){return w.closest(":hidden").length>0}},set:{defaultSide:function(){t=T.filter("."+p.className.active),f=t.next(h.side).length>0?t.next(h.side):T.first(),S=!1,m.verbose("Active side set to",t),m.verbose("Next side set to",f)},duration:function(e){e="number"==typeof(e=e||p.duration)?e+"ms":e,m.verbose("Setting animation duration",e),(p.duration||0===p.duration)&&k.add(T).css({"-webkit-transition-duration":e,"-moz-transition-duration":e,"-ms-transition-duration":e,"-o-transition-duration":e,"transition-duration":e})},currentStageSize:function(){var e=T.filter("."+p.className.active),t=e.outerWidth(!0),n=e.outerHeight(!0);w.css({width:t,height:n})},stageSize:function(){var e=w.clone().addClass(y.loading),t=e.find(">"+h.sides+">"+h.side),n=t.filter("."+p.className.active),i=S?t.eq(S):n.next(h.side).length>0?n.next(h.side):t.first(),o="next"===p.width?i.outerWidth(!0):"initial"===p.width?w.width():p.width,a="next"===p.height?i.outerHeight(!0):"initial"===p.height?w.height():p.height;n.removeClass(y.active),i.addClass(y.active),e.insertAfter(w),e.remove(),"auto"!==p.width&&(w.css("width",o+p.jitter),m.verbose("Specifying width during animation",o)),"auto"!==p.height&&(w.css("height",a+p.jitter),m.verbose("Specifying height during animation",a))},nextSide:function(e){S=e,f=T.filter(e),S=T.index(f),0===f.length&&(m.set.defaultSide(),m.error(b.side)),m.verbose("Next side manually set to",f)},active:function(){m.verbose("Setting new side to active",f),T.removeClass(y.active),f.addClass(y.active),p.onChange.call(f[0]),m.set.defaultSide()}},flip:{to:function(e,t){if(m.is.hidden())m.debug("Module not visible",f);else if(!m.is.complete()||m.is.animating()||p.allowRepeats){var n=m.get.transform[e]();m.is.animating()?m.queue("flip "+e):(m.debug("Flipping "+e,f),m.set.stageSize(),m.stage[t](),m.animate(n))}else m.debug("Side already visible",f)},up:function(){m.flip.to("up","above")},down:function(){m.flip.to("down","below")},left:function(){m.flip.to("left","left")},right:function(){m.flip.to("right","right")},over:function(){m.flip.to("over","behind")},back:function(){m.flip.to("back","behind")}},get:{transform:{up:function(){var e=t.outerHeight(!0)/2;return{transform:"translateY("+(f.outerHeight(!0)-e)+"px) translateZ(-"+e+"px) rotateX(-90deg)"}},down:function(){var e=t.outerHeight(!0)/2;return{transform:"translateY(-"+e+"px) translateZ(-"+e+"px) rotateX(90deg)"}},left:function(){var e=t.outerWidth(!0)/2;return{transform:"translateX("+(f.outerWidth(!0)-e)+"px) translateZ(-"+e+"px) rotateY(90deg)"}},right:function(){var e=t.outerWidth(!0)/2;return{transform:"translateX(-"+e+"px) translateZ(-"+e+"px) rotateY(-90deg)"}},over:function(){return{transform:"translateX("+-(t.outerWidth(!0)-f.outerWidth(!0))/2+"px) rotateY(180deg)"}},back:function(){return{transform:"translateX("+-(t.outerWidth(!0)-f.outerWidth(!0))/2+"px) rotateY(-180deg)"}}},transitionEvent:function(){var e,t=n.createElement("element"),i={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"};for(e in i)if(void 0!==t.style[e])return i[e]},nextSide:function(){return t.next(h.side).length>0?t.next(h.side):T.first()}},stage:{above:function(){var e={origin:(t.outerHeight(!0)-f.outerHeight(!0))/2,depth:{active:f.outerHeight(!0)/2,next:t.outerHeight(!0)/2}};m.verbose("Setting the initial animation position as above",f,e),t.css({transform:"rotateX(0deg)"}),f.addClass(y.animating).css({top:e.origin+"px",transform:"rotateX(90deg) translateZ("+e.depth.next+"px) translateY(-"+e.depth.active+"px)"})},below:function(){var e={origin:(t.outerHeight(!0)-f.outerHeight(!0))/2,depth:{active:f.outerHeight(!0)/2,next:t.outerHeight(!0)/2}};m.verbose("Setting the initial animation position as below",f,e),t.css({transform:"rotateX(0deg)"}),f.addClass(y.animating).css({top:e.origin+"px",transform:"rotateX(-90deg) translateZ("+e.depth.next+"px) translateY("+e.depth.active+"px)"})},left:function(){var e=t.outerWidth(!0),n=f.outerWidth(!0),i={origin:(e-n)/2,depth:{active:n/2,next:e/2}};m.verbose("Setting the initial animation position as left",f,i),t.css({transform:"rotateY(0deg)"}),f.addClass(y.animating).css({left:i.origin+"px",transform:"rotateY(-90deg) translateZ("+i.depth.next+"px) translateX(-"+i.depth.active+"px)"})},right:function(){var e=t.outerWidth(!0),n=f.outerWidth(!0),i={origin:(e-n)/2,depth:{active:n/2,next:e/2}};m.verbose("Setting the initial animation position as right",f,i),t.css({transform:"rotateY(0deg)"}),f.addClass(y.animating).css({left:i.origin+"px",transform:"rotateY(90deg) translateZ("+i.depth.next+"px) translateX("+i.depth.active+"px)"})},behind:function(){var e=t.outerWidth(!0),n=f.outerWidth(!0),i={origin:(e-n)/2,depth:{active:n/2,next:e/2}};m.verbose("Setting the initial animation position as behind",f,i),t.css({transform:"rotateY(0deg)"}),f.addClass(y.animating).css({left:i.origin+"px",transform:"rotateY(-180deg)"})}},setting:function(t,n){if(m.debug("Changing setting",t,n),e.isPlainObject(t))e.extend(!0,p,t);else{if(void 0===n)return p[t];e.isPlainObject(p[t])?e.extend(!0,p[t],n):p[t]=n}},internal:function(t,n){if(e.isPlainObject(t))e.extend(!0,m,t);else{if(void 0===n)return m[t];m[t]=n}},debug:function(){!p.silent&&p.debug&&(p.performance?m.performance.log(arguments):(m.debug=Function.prototype.bind.call(console.info,console,p.name+":"),m.debug.apply(console,arguments)))},verbose:function(){!p.silent&&p.verbose&&p.debug&&(p.performance?m.performance.log(arguments):(m.verbose=Function.prototype.bind.call(console.info,console,p.name+":"),m.verbose.apply(console,arguments)))},error:function(){p.silent||(m.error=Function.prototype.bind.call(console.error,console,p.name+":"),m.error.apply(console,arguments))},performance:{log:function(e){var t,n;p.performance&&(n=(t=(new Date).getTime())-(r||t),r=t,s.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:D,"Execution Time":n})),clearTimeout(m.performance.timer),m.performance.timer=setTimeout(m.performance.display,500)},display:function(){var t=p.name+":",n=0;r=!1,clearTimeout(m.performance.timer),e.each(s,function(e,t){n+=t["Execution Time"]}),t+=" "+n+"ms",g&&(t+=" '"+g+"'"),a.length>1&&(t+=" ("+a.length+")"),(void 0!==console.group||void 0!==console.table)&&s.length>0&&(console.groupCollapsed(t),console.table?console.table(s):e.each(s,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),s=[]}},invoke:function(t,n,i){var a,r,s,l=A;return n=n||u,i=D||i,"string"==typeof t&&void 0!==l&&(t=t.split(/[\. ]/),a=t.length-1,e.each(t,function(n,i){var o=n!=a?i+t[n+1].charAt(0).toUpperCase()+t[n+1].slice(1):t;if(e.isPlainObject(l[o])&&n!=a)l=l[o];else{if(void 0!==l[o])return r=l[o],!1;if(!e.isPlainObject(l[i])||n==a)return void 0!==l[i]&&(r=l[i],!1);l=l[i]}})),e.isFunction(r)?s=r.apply(i,n):void 0!==r&&(s=r),Array.isArray(o)?o.push(s):void 0!==o?o=[o,s]:void 0!==s&&(o=s),r}},c){void 0===A&&m.initialize();var E=w.find("input");E.length>0?(E.blur(),setTimeout(function(){m.invoke(l)},150)):m.invoke(l)}else void 0!==A&&A.invoke("destroy"),m.initialize()}),void 0!==o?o:this},e.fn.shape.settings={name:"Shape",silent:!1,debug:!1,verbose:!1,jitter:0,performance:!0,namespace:"shape",width:"initial",height:"initial",beforeChange:function(){},onChange:function(){},allowRepeats:!1,duration:!1,error:{side:"You tried to switch to a side that does not exist.",method:"The method you called is not defined"},className:{animating:"animating",hidden:"hidden",loading:"loading",active:"active"},selector:{sides:".sides",side:".side"}}}(jQuery,window,document),function(e,t,n,i){"use strict";e.isFunction=e.isFunction||function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},t=void 0!==t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),e.fn.sidebar=function(i){var o,a=e(this),r=e(t),s=e(n),l=e("html"),c=e("head"),u=a.selector||"",d=(new Date).getTime(),f=[],m=arguments[0],g="string"==typeof m,p=[].slice.call(arguments,1),v=t.requestAnimationFrame||t.mozRequestAnimationFrame||t.webkitRequestAnimationFrame||t.msRequestAnimationFrame||function(e){setTimeout(e,0)};return a.each(function(){var a,h,b,y,x,C,w=e.isPlainObject(i)?e.extend(!0,{},e.fn.sidebar.settings,i):e.extend({},e.fn.sidebar.settings),k=w.selector,T=w.className,S=w.namespace,D=w.regExp,A=w.error,E="."+S,F="module-"+S,P=e(this),O=e(w.context),R=P.children(k.sidebar),M=(O.children(k.fixed),O.children(k.pusher)),I=this,j=P.data(F);C={initialize:function(){C.debug("Initializing sidebar",i),C.create.id(),x=C.get.transitionEvent(),w.delaySetup?v(C.setup.layout):C.setup.layout(),v(function(){C.setup.cache()}),C.instantiate()},instantiate:function(){C.verbose("Storing instance of module",C),j=C,P.data(F,C)},create:{id:function(){b=(Math.random().toString(16)+"000000000").substr(2,8),h="."+b,C.verbose("Creating unique id for element",b)}},destroy:function(){C.verbose("Destroying previous module for",P),P.off(E).removeData(F),C.is.ios()&&C.remove.ios(),O.off(h),r.off(h),s.off(h)},event:{clickaway:function(e){if(w.closable){var t=M.find(e.target).length>0||M.is(e.target),n=O.is(e.target);t&&(C.verbose("User clicked on dimmed page"),C.hide()),n&&(C.verbose("User clicked on dimmable context (scaled out page)"),C.hide())}},touch:function(e){},containScroll:function(e){I.scrollTop<=0&&(I.scrollTop=1),I.scrollTop+I.offsetHeight>=I.scrollHeight&&(I.scrollTop=I.scrollHeight-I.offsetHeight-1)},scroll:function(t){0===e(t.target).closest(k.sidebar).length&&t.preventDefault()}},bind:{clickaway:function(){C.verbose("Adding clickaway events to context",O),O.on("click"+h,C.event.clickaway).on("touchend"+h,C.event.clickaway)},scrollLock:function(){w.scrollLock&&(C.debug("Disabling page scroll"),r.on("DOMMouseScroll"+h,C.event.scroll)),C.verbose("Adding events to contain sidebar scroll"),s.on("touchmove"+h,C.event.touch),P.on("scroll"+E,C.event.containScroll)}},unbind:{clickaway:function(){C.verbose("Removing clickaway events from context",O),O.off(h)},scrollLock:function(){C.verbose("Removing scroll lock from page"),s.off(h),r.off(h),P.off("scroll"+E)}},add:{inlineCSS:function(){var t,n=C.cache.width||P.outerWidth(),i=C.cache.height||P.outerHeight(),o=C.is.rtl(),r=C.get.direction(),s={left:n,right:-n,top:i,bottom:-i};o&&(C.verbose("RTL detected, flipping widths"),s.left=-n,s.right=n),t="<style>","left"===r||"right"===r?(C.debug("Adding CSS rules for animation distance",n),t+=" .ui.visible."+r+".sidebar ~ .fixed, .ui.visible."+r+".sidebar ~ .pusher {   -webkit-transform: translate3d("+s[r]+"px, 0, 0);           transform: translate3d("+s[r]+"px, 0, 0); }"):"top"!==r&&"bottom"!=r||(t+=" .ui.visible."+r+".sidebar ~ .fixed, .ui.visible."+r+".sidebar ~ .pusher {   -webkit-transform: translate3d(0, "+s[r]+"px, 0);           transform: translate3d(0, "+s[r]+"px, 0); }"),C.is.ie()&&("left"===r||"right"===r?(C.debug("Adding CSS rules for animation distance",n),t+=" body.pushable > .ui.visible."+r+".sidebar ~ .pusher:after {   -webkit-transform: translate3d("+s[r]+"px, 0, 0);           transform: translate3d("+s[r]+"px, 0, 0); }"):"top"!==r&&"bottom"!=r||(t+=" body.pushable > .ui.visible."+r+".sidebar ~ .pusher:after {   -webkit-transform: translate3d(0, "+s[r]+"px, 0);           transform: translate3d(0, "+s[r]+"px, 0); }"),t+=" body.pushable > .ui.visible.left.sidebar ~ .ui.visible.right.sidebar ~ .pusher:after, body.pushable > .ui.visible.right.sidebar ~ .ui.visible.left.sidebar ~ .pusher:after {   -webkit-transform: translate3d(0, 0, 0);           transform: translate3d(0, 0, 0); }"),a=e(t+="</style>").appendTo(c),C.debug("Adding sizing css to head",a)}},refresh:function(){C.verbose("Refreshing selector cache"),O=e(w.context),R=O.children(k.sidebar),M=O.children(k.pusher),O.children(k.fixed),C.clear.cache()},refreshSidebars:function(){C.verbose("Refreshing other sidebars"),R=O.children(k.sidebar)},repaint:function(){C.verbose("Forcing repaint event"),I.style.display="none";I.offsetHeight;I.scrollTop=I.scrollTop,I.style.display=""},setup:{cache:function(){C.cache={width:P.outerWidth(),height:P.outerHeight()}},layout:function(){0===O.children(k.pusher).length&&(C.debug("Adding wrapper element for sidebar"),C.error(A.pusher),M=e('<div class="pusher" />'),O.children().not(k.omitted).not(R).wrapAll(M),C.refresh()),0!==P.nextAll(k.pusher).length&&P.nextAll(k.pusher)[0]===M[0]||(C.debug("Moved sidebar to correct parent element"),C.error(A.movedSidebar,I),P.detach().prependTo(O),C.refresh()),C.clear.cache(),C.set.pushable(),C.set.direction()}},attachEvents:function(t,n){var i=e(t);n=e.isFunction(C[n])?C[n]:C.toggle,i.length>0?(C.debug("Attaching sidebar events to element",t,n),i.on("click"+E,n)):C.error(A.notFound,t)},show:function(t){if(t=e.isFunction(t)?t:function(){},C.is.hidden()){if(C.refreshSidebars(),w.overlay&&(C.error(A.overlay),w.transition="overlay"),C.refresh(),C.othersActive())if(C.debug("Other sidebars currently visible"),w.exclusive){if("overlay"!=w.transition)return void C.hideOthers(C.show);C.hideOthers()}else w.transition="overlay";C.pushPage(function(){t.call(I),w.onShow.call(I)}),w.onChange.call(I),w.onVisible.call(I)}else C.debug("Sidebar is already visible")},hide:function(t){t=e.isFunction(t)?t:function(){},(C.is.visible()||C.is.animating())&&(C.debug("Hiding sidebar",t),C.refreshSidebars(),C.pullPage(function(){t.call(I),w.onHidden.call(I)}),w.onChange.call(I),w.onHide.call(I))},othersAnimating:function(){return R.not(P).filter("."+T.animating).length>0},othersVisible:function(){return R.not(P).filter("."+T.visible).length>0},othersActive:function(){return C.othersVisible()||C.othersAnimating()},hideOthers:function(e){var t=R.not(P).filter("."+T.visible),n=t.length,i=0;e=e||function(){},t.sidebar("hide",function(){++i==n&&e()})},toggle:function(){C.verbose("Determining toggled direction"),C.is.hidden()?C.show():C.hide()},pushPage:function(t){var n,i,o,a=C.get.transition(),r="overlay"===a||C.othersActive()?P:M;t=e.isFunction(t)?t:function(){},"scale down"==w.transition&&C.scrollToTop(),C.set.transition(a),C.repaint(),n=function(){C.bind.clickaway(),C.add.inlineCSS(),C.set.animating(),C.set.visible()},i=function(){C.set.dimmed()},o=function(e){e.target==r[0]&&(r.off(x+h,o),C.remove.animating(),C.bind.scrollLock(),t.call(I))},r.off(x+h),r.on(x+h,o),v(n),w.dimPage&&!C.othersVisible()&&v(i)},pullPage:function(t){var n,i,o=C.get.transition(),a="overlay"==o||C.othersActive()?P:M;t=e.isFunction(t)?t:function(){},C.verbose("Removing context push state",C.get.direction()),C.unbind.clickaway(),C.unbind.scrollLock(),n=function(){C.set.transition(o),C.set.animating(),C.remove.visible(),w.dimPage&&!C.othersVisible()&&M.removeClass(T.dimmed)},i=function(e){e.target==a[0]&&(a.off(x+h,i),C.remove.animating(),C.remove.transition(),C.remove.inlineCSS(),("scale down"==o||w.returnScroll&&C.is.mobile())&&C.scrollBack(),t.call(I))},a.off(x+h),a.on(x+h,i),v(n)},scrollToTop:function(){C.verbose("Scrolling to top of page to avoid animation issues"),y=e(t).scrollTop(),P.scrollTop(0),t.scrollTo(0,0)},scrollBack:function(){C.verbose("Scrolling back to original page position"),t.scrollTo(0,y)},clear:{cache:function(){C.verbose("Clearing cached dimensions"),C.cache={}}},set:{ios:function(){l.addClass(T.ios)},pushed:function(){O.addClass(T.pushed)},pushable:function(){O.addClass(T.pushable)},dimmed:function(){M.addClass(T.dimmed)},active:function(){P.addClass(T.active)},animating:function(){P.addClass(T.animating)},transition:function(e){e=e||C.get.transition(),P.addClass(e)},direction:function(e){e=e||C.get.direction(),P.addClass(T[e])},visible:function(){P.addClass(T.visible)},overlay:function(){P.addClass(T.overlay)}},remove:{inlineCSS:function(){C.debug("Removing inline css styles",a),a&&a.length>0&&a.remove()},ios:function(){l.removeClass(T.ios)},pushed:function(){O.removeClass(T.pushed)},pushable:function(){O.removeClass(T.pushable)},active:function(){P.removeClass(T.active)},animating:function(){P.removeClass(T.animating)},transition:function(e){e=e||C.get.transition(),P.removeClass(e)},direction:function(e){e=e||C.get.direction(),P.removeClass(T[e])},visible:function(){P.removeClass(T.visible)},overlay:function(){P.removeClass(T.overlay)}},get:{direction:function(){return P.hasClass(T.top)?T.top:P.hasClass(T.right)?T.right:P.hasClass(T.bottom)?T.bottom:T.left},transition:function(){var e,t=C.get.direction();return e=C.is.mobile()?"auto"==w.mobileTransition?w.defaultTransition.mobile[t]:w.mobileTransition:"auto"==w.transition?w.defaultTransition.computer[t]:w.transition,C.verbose("Determined transition",e),e},transitionEvent:function(){var e,t=n.createElement("element"),i={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"};for(e in i)if(void 0!==t.style[e])return i[e]}},is:{ie:function(){return!t.ActiveXObject&&"ActiveXObject"in t||"ActiveXObject"in t},ios:function(){var e=navigator.userAgent,t=e.match(D.ios),n=e.match(D.mobileChrome);return!(!t||n)&&(C.verbose("Browser was found to be iOS",e),!0)},mobile:function(){var e=navigator.userAgent;return e.match(D.mobile)?(C.verbose("Browser was found to be mobile",e),!0):(C.verbose("Browser is not mobile, using regular transition",e),!1)},hidden:function(){return!C.is.visible()},visible:function(){return P.hasClass(T.visible)},open:function(){return C.is.visible()},closed:function(){return C.is.hidden()},vertical:function(){return P.hasClass(T.top)},animating:function(){return O.hasClass(T.animating)},rtl:function(){return void 0===C.cache.rtl&&(C.cache.rtl="rtl"===P.attr("dir")||"rtl"===P.css("direction")),C.cache.rtl}},setting:function(t,n){if(C.debug("Changing setting",t,n),e.isPlainObject(t))e.extend(!0,w,t);else{if(void 0===n)return w[t];e.isPlainObject(w[t])?e.extend(!0,w[t],n):w[t]=n}},internal:function(t,n){if(e.isPlainObject(t))e.extend(!0,C,t);else{if(void 0===n)return C[t];C[t]=n}},debug:function(){!w.silent&&w.debug&&(w.performance?C.performance.log(arguments):(C.debug=Function.prototype.bind.call(console.info,console,w.name+":"),C.debug.apply(console,arguments)))},verbose:function(){!w.silent&&w.verbose&&w.debug&&(w.performance?C.performance.log(arguments):(C.verbose=Function.prototype.bind.call(console.info,console,w.name+":"),C.verbose.apply(console,arguments)))},error:function(){w.silent||(C.error=Function.prototype.bind.call(console.error,console,w.name+":"),C.error.apply(console,arguments))},performance:{log:function(e){var t,n;w.performance&&(n=(t=(new Date).getTime())-(d||t),d=t,f.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:I,"Execution Time":n})),clearTimeout(C.performance.timer),C.performance.timer=setTimeout(C.performance.display,500)},display:function(){var t=w.name+":",n=0;d=!1,clearTimeout(C.performance.timer),e.each(f,function(e,t){n+=t["Execution Time"]}),t+=" "+n+"ms",u&&(t+=" '"+u+"'"),(void 0!==console.group||void 0!==console.table)&&f.length>0&&(console.groupCollapsed(t),console.table?console.table(f):e.each(f,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),f=[]}},invoke:function(t,n,i){var a,r,s,l=j;return n=n||p,i=I||i,"string"==typeof t&&void 0!==l&&(t=t.split(/[\. ]/),a=t.length-1,e.each(t,function(n,i){var o=n!=a?i+t[n+1].charAt(0).toUpperCase()+t[n+1].slice(1):t;if(e.isPlainObject(l[o])&&n!=a)l=l[o];else{if(void 0!==l[o])return r=l[o],!1;if(!e.isPlainObject(l[i])||n==a)return void 0!==l[i]?(r=l[i],!1):(C.error(A.method,t),!1);l=l[i]}})),e.isFunction(r)?s=r.apply(i,n):void 0!==r&&(s=r),Array.isArray(o)?o.push(s):void 0!==o?o=[o,s]:void 0!==s&&(o=s),r}},g?(void 0===j&&C.initialize(),C.invoke(m)):(void 0!==j&&C.invoke("destroy"),C.initialize())}),void 0!==o?o:this},e.fn.sidebar.settings={name:"Sidebar",namespace:"sidebar",silent:!1,debug:!1,verbose:!1,performance:!0,transition:"auto",mobileTransition:"auto",defaultTransition:{computer:{left:"uncover",right:"uncover",top:"overlay",bottom:"overlay"},mobile:{left:"uncover",right:"uncover",top:"overlay",bottom:"overlay"}},context:"body",exclusive:!1,closable:!0,dimPage:!0,scrollLock:!1,returnScroll:!1,delaySetup:!1,duration:500,onChange:function(){},onShow:function(){},onHide:function(){},onHidden:function(){},onVisible:function(){},className:{active:"active",animating:"animating",dimmed:"dimmed",ios:"ios",pushable:"pushable",pushed:"pushed",right:"right",top:"top",left:"left",bottom:"bottom",visible:"visible"},selector:{fixed:".fixed",omitted:"script, link, style, .ui.modal, .ui.dimmer, .ui.nag, .ui.fixed",pusher:".pusher",sidebar:".ui.sidebar"},regExp:{ios:/(iPad|iPhone|iPod)/g,mobileChrome:/(CriOS)/g,mobile:/Mobile|iP(hone|od|ad)|Android|BlackBerry|IEMobile|Kindle|NetFront|Silk-Accelerated|(hpw|web)OS|Fennec|Minimo|Opera M(obi|ini)|Blazer|Dolfin|Dolphin|Skyfire|Zune/g},error:{method:"The method you called is not defined.",pusher:"Had to add pusher element. For optimal performance make sure body content is inside a pusher element",movedSidebar:"Had to move sidebar. For optimal performance make sure sidebar and pusher are direct children of your body tag",overlay:"The overlay setting is no longer supported, use animation: overlay",notFound:"There were no elements that matched the specified selector"}}}(jQuery,window,document),function(e,t,n,i){"use strict";e.isFunction=e.isFunction||function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},t=void 0!==t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),e.fn.sticky=function(i){var o,a=e(this),r=a.selector||"",s=(new Date).getTime(),l=[],c=arguments[0],u="string"==typeof c,d=[].slice.call(arguments,1);return a.each(function(){var a,f,m,g,p,v=e.isPlainObject(i)?e.extend(!0,{},e.fn.sticky.settings,i):e.extend({},e.fn.sticky.settings),h=v.className,b=v.namespace,y=v.error,x="."+b,C="module-"+b,w=e(this),k=e(t),T=e(v.scrollContext),S=w.data(C),D=t.requestAnimationFrame||t.mozRequestAnimationFrame||t.webkitRequestAnimationFrame||t.msRequestAnimationFrame||function(e){setTimeout(e,0)},A=this;p={initialize:function(){p.determineContainer(),p.determineContext(),p.verbose("Initializing sticky",v,a),p.save.positions(),p.checkErrors(),p.bind.events(),v.observeChanges&&p.observeChanges(),p.instantiate()},instantiate:function(){p.verbose("Storing instance of module",p),S=p,w.data(C,p)},destroy:function(){p.verbose("Destroying previous instance"),p.reset(),m&&m.disconnect(),g&&g.disconnect(),k.off("load"+x,p.event.load).off("resize"+x,p.event.resize),T.off("scrollchange"+x,p.event.scrollchange),w.removeData(C)},observeChanges:function(){"MutationObserver"in t&&(m=new MutationObserver(p.event.documentChanged),g=new MutationObserver(p.event.changed),m.observe(n,{childList:!0,subtree:!0}),g.observe(A,{childList:!0,subtree:!0}),g.observe(f[0],{childList:!0,subtree:!0}),p.debug("Setting up mutation observer",g))},determineContainer:function(){a=v.container?e(v.container):w.offsetParent()},determineContext:function(){0!==(f=v.context?e(v.context):a).length||p.error(y.invalidContext,v.context,w)},checkErrors:function(){if(p.is.hidden()&&p.error(y.visible,w),p.cache.element.height>p.cache.context.height)return p.reset(),void p.error(y.elementSize,w)},bind:{events:function(){k.on("load"+x,p.event.load).on("resize"+x,p.event.resize),T.off("scroll"+x).on("scroll"+x,p.event.scroll).on("scrollchange"+x,p.event.scrollchange)}},event:{changed:function(e){clearTimeout(p.timer),p.timer=setTimeout(function(){p.verbose("DOM tree modified, updating sticky menu",e),p.refresh()},100)},documentChanged:function(t){[].forEach.call(t,function(t){t.removedNodes&&[].forEach.call(t.removedNodes,function(t){(t==A||e(t).find(A).length>0)&&(p.debug("Element removed from DOM, tearing down events"),p.destroy())})})},load:function(){p.verbose("Page contents finished loading"),D(p.refresh)},resize:function(){p.verbose("Window resized"),D(p.refresh)},scroll:function(){D(function(){T.triggerHandler("scrollchange"+x,T.scrollTop())})},scrollchange:function(e,t){p.stick(t),v.onScroll.call(A)}},refresh:function(e){p.reset(),v.context||p.determineContext(),e&&p.determineContainer(),p.save.positions(),p.stick(),v.onReposition.call(A)},supports:{sticky:function(){var t=e("<div/>");return t.addClass(h.supported),t.css("position").match("sticky")}},save:{lastScroll:function(e){p.lastScroll=e},elementScroll:function(e){p.elementScroll=e},positions:function(){var e={height:T.height()},t={margin:{top:parseInt(w.css("margin-top"),10),bottom:parseInt(w.css("margin-bottom"),10)},offset:w.offset(),width:w.outerWidth(),height:w.outerHeight()},n={offset:f.offset(),height:f.outerHeight()};p.is.standardScroll()||(p.debug("Non-standard scroll. Removing scroll offset from element offset"),e.top=T.scrollTop(),e.left=T.scrollLeft(),t.offset.top+=e.top,n.offset.top+=e.top,t.offset.left+=e.left,n.offset.left+=e.left),p.cache={fits:t.height+v.offset<=e.height,sameHeight:t.height==n.height,scrollContext:{height:e.height},element:{margin:t.margin,top:t.offset.top-t.margin.top,left:t.offset.left,width:t.width,height:t.height,bottom:t.offset.top+t.height},context:{top:n.offset.top,height:n.height,bottom:n.offset.top+n.height}},p.set.containerSize(),p.stick(),p.debug("Caching element positions",p.cache)}},get:{direction:function(e){var t="down";return e=e||T.scrollTop(),void 0!==p.lastScroll&&(p.lastScroll<e?t="down":p.lastScroll>e&&(t="up")),t},scrollChange:function(e){return e=e||T.scrollTop(),p.lastScroll?e-p.lastScroll:0},currentElementScroll:function(){return p.elementScroll?p.elementScroll:p.is.top()?Math.abs(parseInt(w.css("top"),10))||0:Math.abs(parseInt(w.css("bottom"),10))||0},elementScroll:function(e){e=e||T.scrollTop();var t=p.cache.element,n=p.cache.scrollContext,i=p.get.scrollChange(e),o=t.height-n.height+v.offset,a=p.get.currentElementScroll(),r=a+i;return a=p.cache.fits||r<0?0:r>o?o:r}},remove:{lastScroll:function(){delete p.lastScroll},elementScroll:function(e){delete p.elementScroll},minimumSize:function(){a.css("min-height","")},offset:function(){w.css("margin-top","")}},set:{offset:function(){p.verbose("Setting offset on element",v.offset),w.css("margin-top",v.offset)},containerSize:function(){var e=a.get(0).tagName;"HTML"===e||"body"==e?p.determineContainer():Math.abs(a.outerHeight()-p.cache.context.height)>v.jitter&&(p.debug("Context has padding, specifying exact height for container",p.cache.context.height),a.css({height:p.cache.context.height}))},minimumSize:function(){var e=p.cache.element;a.css("min-height",e.height)},scroll:function(e){p.debug("Setting scroll on element",e),p.elementScroll!=e&&(p.is.top()&&w.css("bottom","").css("top",-e),p.is.bottom()&&w.css("top","").css("bottom",e))},size:function(){0!==p.cache.element.height&&0!==p.cache.element.width&&(A.style.setProperty("width",p.cache.element.width+"px","important"),A.style.setProperty("height",p.cache.element.height+"px","important"))}},is:{standardScroll:function(){return T[0]==t},top:function(){return w.hasClass(h.top)},bottom:function(){return w.hasClass(h.bottom)},initialPosition:function(){return!p.is.fixed()&&!p.is.bound()},hidden:function(){return!w.is(":visible")},bound:function(){return w.hasClass(h.bound)},fixed:function(){return w.hasClass(h.fixed)}},stick:function(e){var t=e||T.scrollTop(),n=p.cache,i=n.fits,o=n.sameHeight,a=n.element,r=n.scrollContext,s=n.context,l=p.is.bottom()&&v.pushing?v.bottomOffset:v.offset,c=(e={top:t+l,bottom:t+l+r.height},i?0:p.get.elementScroll(e.top)),u=!i;0!==a.height&&!o&&(p.is.initialPosition()?e.top>=s.bottom?(p.debug("Initial element position is bottom of container"),p.bindBottom()):e.top>a.top&&(a.height+e.top-c>=s.bottom?(p.debug("Initial element position is bottom of container"),p.bindBottom()):(p.debug("Initial element position is fixed"),p.fixTop())):p.is.fixed()?p.is.top()?e.top<=a.top?(p.debug("Fixed element reached top of container"),p.setInitialPosition()):a.height+e.top-c>=s.bottom?(p.debug("Fixed element reached bottom of container"),p.bindBottom()):u&&(p.set.scroll(c),p.save.lastScroll(e.top),p.save.elementScroll(c)):p.is.bottom()&&(e.bottom-a.height<=a.top?(p.debug("Bottom fixed rail has reached top of container"),p.setInitialPosition()):e.bottom>=s.bottom?(p.debug("Bottom fixed rail has reached bottom of container"),p.bindBottom()):u&&(p.set.scroll(c),p.save.lastScroll(e.top),p.save.elementScroll(c))):p.is.bottom()&&(e.top<=a.top?(p.debug("Jumped from bottom fixed to top fixed, most likely used home/end button"),p.setInitialPosition()):v.pushing?p.is.bound()&&e.bottom<=s.bottom&&(p.debug("Fixing bottom attached element to bottom of browser."),p.fixBottom()):p.is.bound()&&e.top<=s.bottom-a.height&&(p.debug("Fixing bottom attached element to top of browser."),p.fixTop())))},bindTop:function(){p.debug("Binding element to top of parent container"),p.remove.offset(),w.css({left:"",top:"",marginBottom:""}).removeClass(h.fixed).removeClass(h.bottom).addClass(h.bound).addClass(h.top),v.onTop.call(A),v.onUnstick.call(A)},bindBottom:function(){p.debug("Binding element to bottom of parent container"),p.remove.offset(),w.css({left:"",top:""}).removeClass(h.fixed).removeClass(h.top).addClass(h.bound).addClass(h.bottom),v.onBottom.call(A),v.onUnstick.call(A)},setInitialPosition:function(){p.debug("Returning to initial position"),p.unfix(),p.unbind()},fixTop:function(){p.debug("Fixing element to top of page"),v.setSize&&p.set.size(),p.set.minimumSize(),p.set.offset(),w.css({left:p.cache.element.left,bottom:"",marginBottom:""}).removeClass(h.bound).removeClass(h.bottom).addClass(h.fixed).addClass(h.top),v.onStick.call(A)},fixBottom:function(){p.debug("Sticking element to bottom of page"),v.setSize&&p.set.size(),p.set.minimumSize(),p.set.offset(),w.css({left:p.cache.element.left,bottom:"",marginBottom:""}).removeClass(h.bound).removeClass(h.top).addClass(h.fixed).addClass(h.bottom),v.onStick.call(A)},unbind:function(){p.is.bound()&&(p.debug("Removing container bound position on element"),p.remove.offset(),w.removeClass(h.bound).removeClass(h.top).removeClass(h.bottom))},unfix:function(){p.is.fixed()&&(p.debug("Removing fixed position on element"),p.remove.minimumSize(),p.remove.offset(),w.removeClass(h.fixed).removeClass(h.top).removeClass(h.bottom),v.onUnstick.call(A))},reset:function(){p.debug("Resetting elements position"),p.unbind(),p.unfix(),p.resetCSS(),p.remove.offset(),p.remove.lastScroll()},resetCSS:function(){w.css({width:"",height:""}),a.css({height:""})},setting:function(t,n){if(e.isPlainObject(t))e.extend(!0,v,t);else{if(void 0===n)return v[t];v[t]=n}},internal:function(t,n){if(e.isPlainObject(t))e.extend(!0,p,t);else{if(void 0===n)return p[t];p[t]=n}},debug:function(){!v.silent&&v.debug&&(v.performance?p.performance.log(arguments):(p.debug=Function.prototype.bind.call(console.info,console,v.name+":"),p.debug.apply(console,arguments)))},verbose:function(){!v.silent&&v.verbose&&v.debug&&(v.performance?p.performance.log(arguments):(p.verbose=Function.prototype.bind.call(console.info,console,v.name+":"),p.verbose.apply(console,arguments)))},error:function(){v.silent||(p.error=Function.prototype.bind.call(console.error,console,v.name+":"),p.error.apply(console,arguments))},performance:{log:function(e){var t,n;v.performance&&(n=(t=(new Date).getTime())-(s||t),s=t,l.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:A,"Execution Time":n})),clearTimeout(p.performance.timer),p.performance.timer=setTimeout(p.performance.display,0)},display:function(){var t=v.name+":",n=0;s=!1,clearTimeout(p.performance.timer),e.each(l,function(e,t){n+=t["Execution Time"]}),t+=" "+n+"ms",r&&(t+=" '"+r+"'"),(void 0!==console.group||void 0!==console.table)&&l.length>0&&(console.groupCollapsed(t),console.table?console.table(l):e.each(l,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),l=[]}},invoke:function(t,n,i){var a,r,s,l=S;return n=n||d,i=A||i,"string"==typeof t&&void 0!==l&&(t=t.split(/[\. ]/),a=t.length-1,e.each(t,function(n,i){var o=n!=a?i+t[n+1].charAt(0).toUpperCase()+t[n+1].slice(1):t;if(e.isPlainObject(l[o])&&n!=a)l=l[o];else{if(void 0!==l[o])return r=l[o],!1;if(!e.isPlainObject(l[i])||n==a)return void 0!==l[i]&&(r=l[i],!1);l=l[i]}})),e.isFunction(r)?s=r.apply(i,n):void 0!==r&&(s=r),Array.isArray(o)?o.push(s):void 0!==o?o=[o,s]:void 0!==s&&(o=s),r}},u?(void 0===S&&p.initialize(),p.invoke(c)):(void 0!==S&&S.invoke("destroy"),p.initialize())}),void 0!==o?o:this},e.fn.sticky.settings={name:"Sticky",namespace:"sticky",silent:!1,debug:!1,verbose:!0,performance:!0,pushing:!1,context:!1,container:!1,scrollContext:t,offset:0,bottomOffset:0,jitter:5,setSize:!0,observeChanges:!1,onReposition:function(){},onScroll:function(){},onStick:function(){},onUnstick:function(){},onTop:function(){},onBottom:function(){},error:{container:"Sticky element must be inside a relative container",visible:"Element is hidden, you must call refresh after element becomes visible. Use silent setting to surpress this warning in production.",method:"The method you called is not defined.",invalidContext:"Context specified does not exist",elementSize:"Sticky element is larger than its container, cannot create sticky."},className:{bound:"bound",fixed:"fixed",supported:"native",top:"top",bottom:"bottom"}}}(jQuery,window,document),function(e,t,n,i){"use strict";e.isWindow=e.isWindow||function(e){return null!=e&&e===e.window},e.isFunction=e.isFunction||function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},t=void 0!==t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),e.fn.tab=function(i){var o,a=e.isFunction(this)?e(t):e(this),r=a.selector||"",s=(new Date).getTime(),l=[],c=arguments[0],u="string"==typeof c,d=[].slice.call(arguments,1),f=!1;return a.each(function(){var m,g,p,v,h,b,y=e.isPlainObject(i)?e.extend(!0,{},e.fn.tab.settings,i):e.extend({},e.fn.tab.settings),x=y.className,C=y.metadata,w=y.selector,k=y.error,T=y.regExp,S="."+y.namespace,D="module-"+y.namespace,A=e(this),E={},F=!0,P=0,O=this,R=A.data(D);h={initialize:function(){h.debug("Initializing tab menu item",A),h.fix.callbacks(),h.determineTabs(),h.debug("Determining tabs",y.context,g),y.auto&&h.set.auto(),h.bind.events(),y.history&&!f&&(h.initializeHistory(),f=!0),y.autoTabActivation&&void 0===R&&null==h.determine.activeTab()&&(h.debug("No active tab detected, setting first tab active",h.get.initialPath()),h.changeTab(!0===y.autoTabActivation?h.get.initialPath():y.autoTabActivation)),h.instantiate()},instantiate:function(){h.verbose("Storing instance of module",h),R=h,A.data(D,h)},destroy:function(){h.debug("Destroying tabs",A),A.removeData(D).off(S)},bind:{events:function(){e.isWindow(O)||(h.debug("Attaching tab activation events to element",A),A.on("click"+S,h.event.click))}},determineTabs:function(){var t;"parent"===y.context?(A.closest(w.ui).length>0?(t=A.closest(w.ui),h.verbose("Using closest UI element as parent",t)):t=A,m=t.parent(),h.verbose("Determined parent element for creating context",m)):y.context?(m=e(y.context),h.verbose("Using selector for tab context",y.context,m)):m=e("body"),y.childrenOnly?(g=m.children(w.tabs),h.debug("Searching tab context children for tabs",m,g)):(g=m.find(w.tabs),h.debug("Searching tab context for tabs",m,g))},fix:{callbacks:function(){e.isPlainObject(i)&&(i.onTabLoad||i.onTabInit)&&(i.onTabLoad&&(i.onLoad=i.onTabLoad,delete i.onTabLoad,h.error(k.legacyLoad,i.onLoad)),i.onTabInit&&(i.onFirstLoad=i.onTabInit,delete i.onTabInit,h.error(k.legacyInit,i.onFirstLoad)),y=e.extend(!0,{},e.fn.tab.settings,i))}},initializeHistory:function(){if(h.debug("Initializing page state"),void 0===e.address)return h.error(k.state),!1;if("state"==y.historyType){if(h.debug("Using HTML5 to manage state"),!1===y.path)return h.error(k.path),!1;e.address.history(!0).state(y.path)}e.address.bind("change",h.event.history.change)},event:{click:function(t){var n=e(this).data(C.tab);void 0!==n?(y.history?(h.verbose("Updating page state",t),e.address.value(n)):(h.verbose("Changing tab",t),h.changeTab(n)),t.preventDefault()):h.debug("No tab specified")},history:{change:function(t){var n=t.pathNames.join("/")||h.get.initialPath(),i=y.templates.determineTitle(n)||!1;h.performance.display(),h.debug("History change event",n,t),b=t,void 0!==n&&h.changeTab(n),i&&e.address.title(i)}}},refresh:function(){p&&(h.debug("Refreshing tab",p),h.changeTab(p))},cache:{read:function(e){return void 0!==e&&E[e]},add:function(e,t){e=e||p,h.debug("Adding cached content for",e),E[e]=t},remove:function(e){e=e||p,h.debug("Removing cached content for",e),delete E[e]}},escape:{string:function(e){return(e=String(e)).replace(T.escape,"\\$&")}},set:{auto:function(){var t="string"==typeof y.path?y.path.replace(/\/$/,"")+"/{$tab}":"/{$tab}";h.verbose("Setting up automatic tab retrieval from server",t),e.isPlainObject(y.apiSettings)?y.apiSettings.url=t:y.apiSettings={url:t}},loading:function(e){var t=h.get.tabElement(e);t.hasClass(x.loading)||(h.verbose("Setting loading state for",t),t.addClass(x.loading).siblings(g).removeClass(x.active+" "+x.loading),t.length>0&&y.onRequest.call(t[0],e))},state:function(t){e.address.value(t)}},changeTab:function(n){var i=t.history&&t.history.pushState&&y.ignoreFirstLoad&&F,o=y.auto||e.isPlainObject(y.apiSettings),a=o&&!i?h.utilities.pathToArray(n):h.get.defaultPathArray(n);n=h.utilities.arrayToPath(a),e.each(a,function(t,r){var s,l,c,u,d=a.slice(0,t+1),f=h.utilities.arrayToPath(d),g=h.is.tab(f),w=t+1==a.length,T=h.get.tabElement(f);if(h.verbose("Looking for tab",r),g){if(h.verbose("Tab was found",r),p=f,v=h.utilities.filterArray(a,d),w?u=!0:(l=a.slice(0,t+2),c=h.utilities.arrayToPath(l),(u=!h.is.tab(c))&&h.verbose("Tab parameters found",l)),u&&o)return i?(h.debug("Ignoring remote content on first tab load",f),F=!1,h.cache.add(n,T.html()),h.activate.all(f),y.onFirstLoad.call(T[0],f,v,b),y.onLoad.call(T[0],f,v,b)):(h.activate.navigation(f),h.fetch.content(f,n)),!1;h.debug("Opened local tab",f),h.activate.all(f),h.cache.read(f)||(h.cache.add(f,!0),h.debug("First time tab loaded calling tab init"),y.onFirstLoad.call(T[0],f,v,b)),y.onLoad.call(T[0],f,v,b)}else{if(-1!=n.search("/")||""===n)return h.error(k.missingTab,A,m,f),!1;if(n=h.escape.string(n),f=(s=e("#"+n+', a[name="'+n+'"]')).closest("[data-tab]").data(C.tab),T=h.get.tabElement(f),s&&s.length>0&&f)return h.debug("Anchor link used, opening parent tab",T,s),T.hasClass(x.active)||setTimeout(function(){h.scrollTo(s)},0),h.activate.all(f),h.cache.read(f)||(h.cache.add(f,!0),h.debug("First time tab loaded calling tab init"),y.onFirstLoad.call(T[0],f,v,b)),y.onLoad.call(T[0],f,v,b),!1}})},scrollTo:function(t){var i=!!(t&&t.length>0)&&t.offset().top;!1!==i&&(h.debug("Forcing scroll to an in-page link in a hidden tab",i,t),e(n).scrollTop(i))},update:{content:function(t,n,i){var o=h.get.tabElement(t),a=o[0];i=void 0!==i?i:y.evaluateScripts,"string"==typeof y.cacheType&&"dom"==y.cacheType.toLowerCase()&&"string"!=typeof n?o.empty().append(e(n).clone(!0)):i?(h.debug("Updating HTML and evaluating inline scripts",t,n),o.html(n)):(h.debug("Updating HTML",t,n),a.innerHTML=n)}},fetch:{content:function(t,n){var i,o,a=h.get.tabElement(t),r={dataType:"html",encodeParameters:!1,on:"now",cache:y.alwaysRefresh,headers:{"X-Remote":!0},onSuccess:function(e){"response"==y.cacheType&&h.cache.add(n,e),h.update.content(t,e),t==p?(h.debug("Content loaded",t),h.activate.tab(t)):h.debug("Content loaded in background",t),y.onFirstLoad.call(a[0],t,v,b),y.onLoad.call(a[0],t,v,b),y.loadOnce?h.cache.add(n,!0):"string"==typeof y.cacheType&&"dom"==y.cacheType.toLowerCase()&&a.children().length>0?setTimeout(function(){var e=a.children().clone(!0);e=e.not("script"),h.cache.add(n,e)},0):h.cache.add(n,a.html())},urlData:{tab:n}},s=a.api("get request")||!1,l=s&&"pending"===s.state();n=n||t,o=h.cache.read(n),y.cache&&o?(h.activate.tab(t),h.debug("Adding cached content",n),y.loadOnce||("once"==y.evaluateScripts?h.update.content(t,o,!1):h.update.content(t,o)),y.onLoad.call(a[0],t,v,b)):l?(h.set.loading(t),h.debug("Content is already loading",n)):void 0!==e.api?(i=e.extend(!0,{},y.apiSettings,r),h.debug("Retrieving remote content",n,i),h.set.loading(t),a.api(i)):h.error(k.api)}},activate:{all:function(e){h.activate.tab(e),h.activate.navigation(e)},tab:function(e){var t=h.get.tabElement(e),n="siblings"==y.deactivate?t.siblings(g):g.not(t),i=t.hasClass(x.active);h.verbose("Showing tab content for",t),i||(t.addClass(x.active),n.removeClass(x.active+" "+x.loading),t.length>0&&y.onVisible.call(t[0],e))},navigation:function(e){var t=h.get.navElement(e),n="siblings"==y.deactivate?t.siblings(a):a.not(t),i=t.hasClass(x.active);h.verbose("Activating tab navigation for",t,e),i||(t.addClass(x.active),n.removeClass(x.active+" "+x.loading))}},deactivate:{all:function(){h.deactivate.navigation(),h.deactivate.tabs()},navigation:function(){a.removeClass(x.active)},tabs:function(){g.removeClass(x.active+" "+x.loading)}},is:{tab:function(e){return void 0!==e&&h.get.tabElement(e).length>0}},get:{initialPath:function(){return a.eq(0).data(C.tab)||g.eq(0).data(C.tab)},path:function(){return e.address.value()},defaultPathArray:function(e){return h.utilities.pathToArray(h.get.defaultPath(e))},defaultPath:function(e){var t=a.filter("[data-"+C.tab+'^="'+h.escape.string(e)+'/"]').eq(0).data(C.tab)||!1;if(t){if(h.debug("Found default tab",t),P<y.maxDepth)return P++,h.get.defaultPath(t);h.error(k.recursion)}else h.debug("No default tabs found for",e,g);return P=0,e},navElement:function(e){return e=e||p,a.filter("[data-"+C.tab+'="'+h.escape.string(e)+'"]')},tabElement:function(e){var t,n,i,o;return e=e||p,i=h.utilities.pathToArray(e),o=h.utilities.last(i),t=g.filter("[data-"+C.tab+'="'+h.escape.string(e)+'"]'),n=g.filter("[data-"+C.tab+'="'+h.escape.string(o)+'"]'),t.length>0?t:n},tab:function(){return p}},determine:{activeTab:function(){var t=null;return g.each(function(n,i){if(e(i).hasClass(x.active)){var o=e(this).data(C.tab);a.filter("[data-"+C.tab+'="'+h.escape.string(o)+'"]').hasClass(x.active)&&(t=o)}}),t}},utilities:{filterArray:function(t,n){return e.grep(t,function(t){return-1==e.inArray(t,n)})},last:function(e){return!!Array.isArray(e)&&e[e.length-1]},pathToArray:function(e){return void 0===e&&(e=p),"string"==typeof e?e.split("/"):[e]},arrayToPath:function(e){return!!Array.isArray(e)&&e.join("/")}},setting:function(t,n){if(h.debug("Changing setting",t,n),e.isPlainObject(t))e.extend(!0,y,t);else{if(void 0===n)return y[t];e.isPlainObject(y[t])?e.extend(!0,y[t],n):y[t]=n}},internal:function(t,n){if(e.isPlainObject(t))e.extend(!0,h,t);else{if(void 0===n)return h[t];h[t]=n}},debug:function(){!y.silent&&y.debug&&(y.performance?h.performance.log(arguments):(h.debug=Function.prototype.bind.call(console.info,console,y.name+":"),h.debug.apply(console,arguments)))},verbose:function(){!y.silent&&y.verbose&&y.debug&&(y.performance?h.performance.log(arguments):(h.verbose=Function.prototype.bind.call(console.info,console,y.name+":"),h.verbose.apply(console,arguments)))},error:function(){y.silent||(h.error=Function.prototype.bind.call(console.error,console,y.name+":"),h.error.apply(console,arguments))},performance:{log:function(e){var t,n;y.performance&&(n=(t=(new Date).getTime())-(s||t),s=t,l.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:O,"Execution Time":n})),clearTimeout(h.performance.timer),h.performance.timer=setTimeout(h.performance.display,500)},display:function(){var t=y.name+":",n=0;s=!1,clearTimeout(h.performance.timer),e.each(l,function(e,t){n+=t["Execution Time"]}),t+=" "+n+"ms",r&&(t+=" '"+r+"'"),(void 0!==console.group||void 0!==console.table)&&l.length>0&&(console.groupCollapsed(t),console.table?console.table(l):e.each(l,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),l=[]}},invoke:function(t,n,i){var a,r,s,l=R;return n=n||d,i=O||i,"string"==typeof t&&void 0!==l&&(t=t.split(/[\. ]/),a=t.length-1,e.each(t,function(n,i){var o=n!=a?i+t[n+1].charAt(0).toUpperCase()+t[n+1].slice(1):t;if(e.isPlainObject(l[o])&&n!=a)l=l[o];else{if(void 0!==l[o])return r=l[o],!1;if(!e.isPlainObject(l[i])||n==a)return void 0!==l[i]?(r=l[i],!1):(h.error(k.method,t),!1);l=l[i]}})),e.isFunction(r)?s=r.apply(i,n):void 0!==r&&(s=r),Array.isArray(o)?o.push(s):void 0!==o?o=[o,s]:void 0!==s&&(o=s),r}},u?(void 0===R&&h.initialize(),h.invoke(c)):(void 0!==R&&R.invoke("destroy"),h.initialize())}),void 0!==o?o:this},e.tab=function(){e(t).tab.apply(this,arguments)},e.fn.tab.settings={name:"Tab",namespace:"tab",silent:!1,debug:!1,verbose:!1,performance:!0,auto:!1,history:!1,historyType:"hash",path:!1,context:!1,childrenOnly:!1,maxDepth:25,deactivate:"siblings",alwaysRefresh:!1,cache:!0,loadOnce:!1,cacheType:"response",ignoreFirstLoad:!1,apiSettings:!1,evaluateScripts:"once",autoTabActivation:!0,onFirstLoad:function(e,t,n){},onLoad:function(e,t,n){},onVisible:function(e,t,n){},onRequest:function(e,t,n){},templates:{determineTitle:function(e){}},error:{api:"You attempted to load content without API module",method:"The method you called is not defined",missingTab:"Activated tab cannot be found. Tabs are case-sensitive.",noContent:"The tab you specified is missing a content url.",path:"History enabled, but no path was specified",recursion:"Max recursive depth reached",legacyInit:"onTabInit has been renamed to onFirstLoad in 2.0, please adjust your code.",legacyLoad:"onTabLoad has been renamed to onLoad in 2.0. Please adjust your code",state:"History requires Asual's Address library <https://github.com/asual/jquery-address>"},regExp:{escape:/[-[\]{}()*+?.,\\^$|#\s:=@]/g},metadata:{tab:"tab",loaded:"loaded",promise:"promise"},className:{loading:"loading",active:"active"},selector:{tabs:".ui.tab",ui:".ui"}}}(jQuery,window,document),function(e,t,n,i){"use strict";e.isFunction=e.isFunction||function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},t=void 0!==t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),e.fn.toast=function(t){var n,i=e(this),o=i.selector||"",a=(new Date).getTime(),r=[],s=arguments[0],l="string"==typeof s,c=[].slice.call(arguments,1);return i.each(function(){var i,u,d,f,m,g,p,v,h=e.isPlainObject(t)?e.extend(!0,{},e.fn.toast.settings,t):e.extend({},e.fn.toast.settings),b=h.className,y=h.selector,x=h.error,C=h.namespace,w=h.fields,k="."+C,T=C+"-module",S=e(this),D=h.context?e(h.context):e("body"),A=S.hasClass("toast")||S.hasClass("message")||S.hasClass("card"),E=this,F=A?S.data(T):void 0;v={initialize:function(){v.verbose("Initializing element"),v.has.container()||v.create.container(),(A||""!==h.message||""!==h.title||""!==v.get.iconClass()||h.showImage||v.has.configActions())&&("string"==typeof h.showProgress&&-1!==[b.top,b.bottom].indexOf(h.showProgress)||(h.showProgress=!1),v.create.toast(),h.closeOnClick&&(h.closeIcon||e(u).find(y.input).length>0||v.has.configActions())&&(h.closeOnClick=!1),h.closeOnClick||i.addClass(b.unclickable),v.bind.events()),v.instantiate(),i&&v.show()},instantiate:function(){v.verbose("Storing instance of toast"),F=v,S.data(T,F)},destroy:function(){i&&(v.debug("Removing toast",i),v.unbind.events(),i.remove(),i=void 0,u=void 0,g=void 0,h.onRemove.call(i,E),f=void 0,m=void 0,p=void 0),S.removeData(T)},show:function(e){e=e||function(){},v.debug("Showing toast"),!1!==h.onShow.call(i,E)?v.animate.show(e):v.debug("onShow callback returned false, cancelling toast animation")},close:function(e){e=e||function(){},v.remove.visible(),v.unbind.events(),v.animate.close(e)},create:{container:function(){v.verbose("Creating container"),D.append(e("<div/>",{class:h.position+" "+b.container+" "+(h.horizontal?b.horizontal:"")}))},toast:function(){i=e("<div/>",{class:b.box});var t=v.get.iconClass();if(A)u=h.cloneModule?S.clone().removeAttr("id"):S,p=u.find("> i"+v.helpers.toClass(b.close)),h.closeIcon=p.length>0,""!==t&&u.find(y.icon).attr("class",t+" "+b.icon),h.showImage&&u.find(y.image).attr("src",h.showImage),""!==h.title&&u.find(y.title).html(v.helpers.escape(h.title,h.preserveHTML)),""!==h.message&&u.find(y.message).html(v.helpers.escape(h.message,h.preserveHTML));else{v.verbose("Creating toast"),u=e("<div/>");var n=e("<div/>",{class:b.content});""!==t&&u.append(e("<i/>",{class:t+" "+b.icon})),h.showImage&&u.append(e("<img>",{class:b.image+" "+h.classImage,src:h.showImage})),""!==h.title&&n.append(e("<div/>",{class:b.title,text:h.title})),n.append(e("<div/>",{class:b.message,html:v.helpers.escape(h.message,h.preserveHTML)})),u.addClass(h.class+" "+b.toast).append(n),u.css("opacity",h.opacity),h.closeIcon&&((p=e("<i/>",{class:b.close+" "+("string"==typeof h.closeIcon?h.closeIcon:"")})).hasClass(b.left)?u.prepend(p):u.append(p))}if(u.hasClass(b.compact)&&(h.compact=!0),u.hasClass("card")&&(h.compact=!1),d=u.find(".actions"),v.has.configActions()&&(0===d.length&&(d=e("<div/>",{class:b.actions+" "+(h.classActions||"")}).appendTo(u)),u.hasClass("card")&&!d.hasClass(b.attached)&&(d.addClass(b.extraContent),d.hasClass(b.vertical)&&(d.removeClass(b.vertical),v.error(x.verticalCard))),h.actions.forEach(function(t){var n=t[w.icon]?'<i class="'+v.helpers.deQuote(t[w.icon])+' icon"></i>':"",i=v.helpers.escape(t[w.text]||"",h.preserveHTML),o=v.helpers.deQuote(t[w.class]||""),a=t[w.click]&&e.isFunction(t[w.click])?t[w.click]:function(){};d.append(e("<button/>",{html:n+i,class:b.button+" "+o,click:function(){!1!==a.call(E,S)&&v.close()}}))})),d&&d.hasClass(b.vertical)&&u.addClass(b.vertical),d.length>0&&!d.hasClass(b.attached)&&(!d||d.hasClass(b.basic)&&!d.hasClass(b.left)||u.addClass(b.actions)),"auto"===h.displayTime&&(h.displayTime=Math.max(h.minDisplayTime,u.text().split(" ").length/h.wordsPerMinute*6e4)),i.append(u),d.length>0&&d.hasClass(b.attached)&&(d.addClass(b.buttons),d.detach(),u.addClass(b.attached),d.hasClass(b.vertical)?(u.wrap(e("<div/>",{class:b.vertical+" "+b.attached+" "+(h.compact?b.compact:"")})),d.hasClass(b.left)?u.addClass(b.left).parent().addClass(b.left).prepend(d):u.parent().append(d)):d.hasClass(b.top)?(i.prepend(d),u.addClass(b.bottom)):(i.append(d),u.addClass(b.top))),S!==u&&(S=u,E=u[0]),h.displayTime>0){var o=b.progressing+" "+(h.pauseOnHover?b.pausable:"");h.showProgress&&(f=e("<div/>",{class:b.progress+" "+(h.classProgress||h.class),"data-percent":""}),h.classProgress||(u.hasClass("toast")&&!u.hasClass(b.inverted)?f.addClass(b.inverted):f.removeClass(b.inverted)),m=e("<div/>",{class:"bar "+(h.progressUp?"up ":"down ")+o}),f.addClass(h.showProgress).append(m),f.hasClass(b.top)?i.prepend(f):i.append(f),m.css("animation-duration",h.displayTime/1e3+"s")),(g=e("<span/>",{class:"wait "+o})).css("animation-duration",h.displayTime/1e3+"s"),g.appendTo(u)}h.compact&&(i.addClass(b.compact),u.addClass(b.compact),f&&f.addClass(b.compact)),h.newestOnTop?i.prependTo(v.get.container()):i.appendTo(v.get.container())}},bind:{events:function(){v.debug("Binding events to toast"),(h.closeOnClick||h.closeIcon)&&(h.closeIcon?p:u).on("click"+k,v.event.click),g&&g.on("animationend"+k,v.close),i.on("click"+k,y.approve,v.event.approve).on("click"+k,y.deny,v.event.deny)}},unbind:{events:function(){v.debug("Unbinding events to toast"),(h.closeOnClick||h.closeIcon)&&(h.closeIcon?p:u).off("click"+k),g&&g.off("animationend"+k),i.off("click"+k)}},animate:{show:function(t){t=e.isFunction(t)?t:function(){},h.transition&&v.can.useElement("transition")&&S.transition("is supported")&&(v.set.visible(),i.transition({animation:h.transition.showMethod+" in",queue:!1,debug:h.debug,verbose:h.verbose,duration:h.transition.showDuration,onComplete:function(){t.call(i,E),h.onVisible.call(i,E)}}))},close:function(t){t=e.isFunction(t)?t:function(){},v.debug("Closing toast"),!1!==h.onHide.call(i,E)?h.transition&&void 0!==e.fn.transition&&S.transition("is supported")?i.transition({animation:h.transition.hideMethod+" out",queue:!1,duration:h.transition.hideDuration,debug:h.debug,verbose:h.verbose,interval:50,onBeforeHide:function(t){t=e.isFunction(t)?t:function(){},""!==h.transition.closeEasing?i&&(i.css("opacity",0),i.wrap("<div/>").parent().hide(h.transition.closeDuration,h.transition.closeEasing,function(){i&&(i.parent().remove(),t.call(i))})):t.call(i)},onComplete:function(){t.call(i,E),h.onHidden.call(i,E),v.destroy()}}):v.error(x.noTransition):v.debug("onHide callback returned false, cancelling toast animation")},pause:function(){g.css("animationPlayState","paused"),m&&m.css("animationPlayState","paused")},continue:function(){g.css("animationPlayState","running"),m&&m.css("animationPlayState","running")}},has:{container:function(){return v.verbose("Determining if there is already a container"),D.find(v.helpers.toClass(h.position)+y.container+(h.horizontal?v.helpers.toClass(b.horizontal):"")).length>0},toast:function(){return!!v.get.toast()},toasts:function(){return v.get.toasts().length>0},configActions:function(){return Array.isArray(h.actions)&&h.actions.length>0}},get:{container:function(){return D.find(v.helpers.toClass(h.position)+y.container)[0]},toastBox:function(){return i||null},toast:function(){return u||null},toasts:function(){return e(v.get.container()).find(y.box)},iconClass:function(){return"string"==typeof h.showIcon?h.showIcon:h.showIcon&&h.icons[h.class]?h.icons[h.class]:""},remainingTime:function(){return g?g.css("opacity")*h.displayTime:0}},set:{visible:function(){u.addClass(b.visible)}},remove:{visible:function(){u.removeClass(b.visible)}},event:{click:function(t){0===e(t.target).closest("a").length&&(h.onClick.call(i,E),v.close())},approve:function(){!1!==h.onApprove.call(E,S)?v.close():v.verbose("Approve callback returned false cancelling close")},deny:function(){!1!==h.onDeny.call(E,S)?v.close():v.verbose("Deny callback returned false cancelling close")}},helpers:{toClass:function(e){var t=e.split(" "),n="";return t.forEach(function(e){n+="."+e}),n},deQuote:function(e){return String(e).replace(/"/g,"")},escape:function(e,t){if(t)return e;var n={"<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"};return/[&<>"'`]/.test(e)?(e=e.replace(/&(?![a-z0-9#]{1,6};)/,"&amp;")).replace(/[<>"'`]/g,function(e){return n[e]}):e}},can:{useElement:function(t){return void 0!==e.fn[t]||(v.error(x.noElement.replace("{element}",t)),!1)}},setting:function(t,n){if(v.debug("Changing setting",t,n),e.isPlainObject(t))e.extend(!0,h,t);else{if(void 0===n)return h[t];e.isPlainObject(h[t])?e.extend(!0,h[t],n):h[t]=n}},internal:function(t,n){if(e.isPlainObject(t))e.extend(!0,v,t);else{if(void 0===n)return v[t];v[t]=n}},debug:function(){!h.silent&&h.debug&&(h.performance?v.performance.log(arguments):(v.debug=Function.prototype.bind.call(console.info,console,h.name+":"),v.debug.apply(console,arguments)))},verbose:function(){!h.silent&&h.verbose&&h.debug&&(h.performance?v.performance.log(arguments):(v.verbose=Function.prototype.bind.call(console.info,console,h.name+":"),v.verbose.apply(console,arguments)))},error:function(){h.silent||(v.error=Function.prototype.bind.call(console.error,console,h.name+":"),v.error.apply(console,arguments))},performance:{log:function(e){var t,n;h.performance&&(n=(t=(new Date).getTime())-(a||t),a=t,r.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:E,"Execution Time":n})),clearTimeout(v.performance.timer),v.performance.timer=setTimeout(v.performance.display,500)},display:function(){var t=h.name+":",n=0;a=!1,clearTimeout(v.performance.timer),e.each(r,function(e,t){n+=t["Execution Time"]}),t+=" "+n+"ms",o&&(t+=" '"+o+"'"),(void 0!==console.group||void 0!==console.table)&&r.length>0&&(console.groupCollapsed(t),console.table?console.table(r):e.each(r,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),r=[]}},invoke:function(t,i,o){var a,r,s,l=F;return i=i||c,o=E||o,"string"==typeof t&&void 0!==l&&(t=t.split(/[\. ]/),a=t.length-1,e.each(t,function(n,i){var o=n!=a?i+t[n+1].charAt(0).toUpperCase()+t[n+1].slice(1):t;if(e.isPlainObject(l[o])&&n!=a)l=l[o];else{if(void 0!==l[o])return r=l[o],!1;if(!e.isPlainObject(l[i])||n==a)return void 0!==l[i]?(r=l[i],!1):(v.error(x.method,t),!1);l=l[i]}})),e.isFunction(r)?s=r.apply(o,i):void 0!==r&&(s=r),Array.isArray(n)?n.push(s):void 0!==n?n=[n,s]:void 0!==s&&(n=s),r}},l?(void 0===F&&v.initialize(),v.invoke(s)):(void 0!==F&&F.invoke("destroy"),v.initialize(),n=S)}),void 0!==n?n:this},e.fn.toast.settings={name:"Toast",namespace:"toast",silent:!1,debug:!1,verbose:!1,performance:!0,context:"body",position:"top right",horizontal:!1,class:"neutral",classProgress:!1,classActions:!1,classImage:"mini",title:"",message:"",displayTime:3e3,minDisplayTime:1e3,wordsPerMinute:120,showIcon:!1,newestOnTop:!1,showProgress:!1,pauseOnHover:!0,progressUp:!1,opacity:1,compact:!0,closeIcon:!1,closeOnClick:!0,cloneModule:!0,actions:!1,preserveHTML:!0,showImage:!1,transition:{showMethod:"scale",showDuration:500,hideMethod:"scale",hideDuration:500,closeEasing:"easeOutCubic",closeDuration:500},error:{method:"The method you called is not defined.",noElement:"This module requires ui {element}",verticalCard:"Vertical but not attached actions are not supported for card layout"},className:{container:"ui toast-container",box:"floating toast-box",progress:"ui attached active progress",toast:"ui toast",icon:"centered icon",visible:"visible",content:"content",title:"ui header",message:"message",actions:"actions",extraContent:"extra content",button:"ui button",buttons:"ui buttons",close:"close icon",image:"ui image",vertical:"vertical",horizontal:"horizontal",attached:"attached",inverted:"inverted",compact:"compact",pausable:"pausable",progressing:"progressing",top:"top",bottom:"bottom",left:"left",basic:"basic",unclickable:"unclickable"},icons:{info:"info",success:"checkmark",warning:"warning",error:"times"},selector:{container:".ui.toast-container",box:".toast-box",toast:".ui.toast",title:".header",message:".message:not(.ui)",image:"> img.image, > .image > img",icon:"> i.icon",input:'input:not([type="hidden"]), textarea, select, button, .ui.button, ui.dropdown',approve:".actions .positive, .actions .approve, .actions .ok",deny:".actions .negative, .actions .deny, .actions .cancel"},fields:{class:"class",text:"text",icon:"icon",click:"click"},onShow:function(){},onVisible:function(){},onClick:function(){},onHide:function(){},onHidden:function(){},onRemove:function(){},onApprove:function(){},onDeny:function(){}},e.extend(e.easing,{easeOutBounce:function(e,t,n,i,o){return(t/=o)<1/2.75?i*(7.5625*t*t)+n:t<2/2.75?i*(7.5625*(t-=1.5/2.75)*t+.75)+n:t<2.5/2.75?i*(7.5625*(t-=2.25/2.75)*t+.9375)+n:i*(7.5625*(t-=2.625/2.75)*t+.984375)+n},easeOutCubic:function(e){return--e*e*e+1}})}(jQuery,window,document),function(e,t,n,i){"use strict";e.isFunction=e.isFunction||function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},t=void 0!==t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),e.fn.transition=function(){var t,i=e(this),o=i.selector||"",a=(new Date).getTime(),r=[],s=arguments,l=s[0],c=[].slice.call(arguments,1),u="string"==typeof l;return i.each(function(d){var f,m,g,p,v,h,b,y,x,C=e(this),w=this;(x={initialize:function(){f=x.get.settings.apply(w,s),p=f.className,g=f.error,v=f.metadata,y="."+f.namespace,b="module-"+f.namespace,m=C.data(b)||x,h=x.get.animationEndEvent(),u&&(u=x.invoke(l)),!1===u&&(x.verbose("Converted arguments into settings object",f),f.interval?x.delay(f.animate):x.animate(),x.instantiate())},instantiate:function(){x.verbose("Storing instance of module",x),m=x,C.data(b,m)},destroy:function(){x.verbose("Destroying previous module for",w),C.removeData(b)},refresh:function(){x.verbose("Refreshing display type on next animation"),delete x.displayType},forceRepaint:function(){x.verbose("Forcing element repaint");var e=C.parent(),t=C.next();0===t.length?C.detach().appendTo(e):C.detach().insertBefore(t)},repaint:function(){x.verbose("Repainting element");w.offsetWidth},delay:function(e){var t,n=x.get.animationDirection();n||(n=x.can.transition()?x.get.direction():"static"),e=void 0!==e?e:f.interval,t="auto"==f.reverse&&n==p.outward||1==f.reverse?(i.length-d)*f.interval:d*f.interval,x.debug("Delaying animation by",t),setTimeout(x.animate,t)},animate:function(e){if(f=e||f,!x.is.supported())return x.error(g.support),!1;if(x.debug("Preparing animation",f.animation),x.is.animating()){if(f.queue)return!f.allowRepeats&&x.has.direction()&&x.is.occurring()&&!0!==x.queuing?x.debug("Animation is currently occurring, preventing queueing same animation",f.animation):x.queue(f.animation),!1;if(!f.allowRepeats&&x.is.occurring())return x.debug("Animation is already occurring, will not execute repeated animation",f.animation),!1;x.debug("New animation started, completing previous early",f.animation),m.complete()}x.can.animate()?x.set.animating(f.animation):x.error(g.noAnimation,f.animation,w)},reset:function(){x.debug("Resetting animation to beginning conditions"),x.remove.animationCallbacks(),x.restore.conditions(),x.remove.animating()},queue:function(e){x.debug("Queueing animation of",e),x.queuing=!0,C.one(h+".queue"+y,function(){x.queuing=!1,x.repaint(),x.animate.apply(this,f)})},complete:function(e){e&&e.target===w&&e.stopPropagation(),x.debug("Animation complete",f.animation),x.remove.completeCallback(),x.remove.failSafe(),x.is.looping()||(x.is.outward()?(x.verbose("Animation is outward, hiding element"),x.restore.conditions(),x.hide()):x.is.inward()?(x.verbose("Animation is outward, showing element"),x.restore.conditions(),x.show()):(x.verbose("Static animation completed"),x.restore.conditions(),f.onComplete.call(w)))},force:{visible:function(){var e=C.attr("style"),t=x.get.userStyle(e),n=x.get.displayType(),i=t+"display: "+n+" !important;",o=C[0].style.display;return!n||"none"===o&&f.skipInlineHidden||C[0].tagName.match(/(script|link|style)/i)?(x.remove.transition(),!1):(x.verbose("Overriding default display to show element",n),C.attr("style",i),!0)},hidden:function(){var e=C.attr("style"),t=void 0===e||""===e;"none"===C.css("display")||x.is.hidden()?t&&C.removeAttr("style"):(x.verbose("Overriding default display to hide element"),C.css("display","none"))}},has:{direction:function(t){var n=!1;return"string"==typeof(t=t||f.animation)&&(t=t.split(" "),e.each(t,function(e,t){t!==p.inward&&t!==p.outward||(n=!0)})),n},inlineDisplay:function(){var e=C.attr("style")||"";return Array.isArray(e.match(/display.*?;/,""))}},set:{animating:function(e){x.remove.completeCallback(),e=e||f.animation;var t=x.get.animationClass(e);x.save.animation(t),x.force.visible()&&(x.remove.hidden(),x.remove.direction(),x.start.animation(t))},duration:function(e,t){((t="number"==typeof(t=t||f.duration)?t+"ms":t)||0===t)&&(x.verbose("Setting animation duration",t),C.css({"animation-duration":t}))},direction:function(e){(e=e||x.get.direction())==p.inward?x.set.inward():x.set.outward()},looping:function(){x.debug("Transition set to loop"),C.addClass(p.looping)},hidden:function(){C.addClass(p.transition).addClass(p.hidden)},inward:function(){x.debug("Setting direction to inward"),C.removeClass(p.outward).addClass(p.inward)},outward:function(){x.debug("Setting direction to outward"),C.removeClass(p.inward).addClass(p.outward)},visible:function(){C.addClass(p.transition).addClass(p.visible)}},start:{animation:function(e){e=e||x.get.animationClass(),x.debug("Starting tween",e),C.addClass(e).one(h+".complete"+y,x.complete),f.useFailSafe&&x.add.failSafe(),x.set.duration(f.duration),f.onStart.call(w)}},save:{animation:function(e){x.cache||(x.cache={}),x.cache.animation=e},displayType:function(e){"none"!==e&&C.data(v.displayType,e)},transitionExists:function(t,n){e.fn.transition.exists[t]=n,x.verbose("Saving existence of transition",t,n)}},restore:{conditions:function(){var e=x.get.currentAnimation();e&&(C.removeClass(e),x.verbose("Removing animation class",x.cache)),x.remove.duration()}},add:{failSafe:function(){var e=x.get.duration();x.timer=setTimeout(function(){C.triggerHandler(h)},e+f.failSafeDelay),x.verbose("Adding fail safe timer",x.timer)}},remove:{animating:function(){C.removeClass(p.animating)},animationCallbacks:function(){x.remove.queueCallback(),x.remove.completeCallback()},queueCallback:function(){C.off(".queue"+y)},completeCallback:function(){C.off(".complete"+y)},display:function(){C.css("display","")},direction:function(){C.removeClass(p.inward).removeClass(p.outward)},duration:function(){C.css("animation-duration","")},failSafe:function(){x.verbose("Removing fail safe timer",x.timer),x.timer&&clearTimeout(x.timer)},hidden:function(){C.removeClass(p.hidden)},visible:function(){C.removeClass(p.visible)},looping:function(){x.debug("Transitions are no longer looping"),x.is.looping()&&(x.reset(),C.removeClass(p.looping))},transition:function(){C.removeClass(p.transition).removeClass(p.visible).removeClass(p.hidden)}},get:{settings:function(t,n,i){return"object"==typeof t?e.extend(!0,{},e.fn.transition.settings,t):"function"==typeof i?e.extend({},e.fn.transition.settings,{animation:t,onComplete:i,duration:n}):"string"==typeof n||"number"==typeof n?e.extend({},e.fn.transition.settings,{animation:t,duration:n}):"object"==typeof n?e.extend({},e.fn.transition.settings,n,{animation:t}):"function"==typeof n?e.extend({},e.fn.transition.settings,{animation:t,onComplete:n}):e.extend({},e.fn.transition.settings,{animation:t})},animationClass:function(e){var t=e||f.animation,n=x.can.transition()&&!x.has.direction()?x.get.direction()+" ":"";return p.animating+" "+p.transition+" "+n+t},currentAnimation:function(){return!(!x.cache||void 0===x.cache.animation)&&x.cache.animation},currentDirection:function(){return x.is.inward()?p.inward:p.outward},direction:function(){return x.is.hidden()||!x.is.visible()?p.inward:p.outward},animationDirection:function(t){var n;return"string"==typeof(t=t||f.animation)&&(t=t.split(" "),e.each(t,function(e,t){t===p.inward?n=p.inward:t===p.outward&&(n=p.outward)})),n||!1},duration:function(e){return!1===(e=e||f.duration)&&(e=C.css("animation-duration")||0),"string"==typeof e?e.indexOf("ms")>-1?parseFloat(e):1e3*parseFloat(e):e},displayType:function(e){if(e=void 0===e||e,f.displayType)return f.displayType;if(e&&void 0===C.data(v.displayType)){var t=C.css("display");""===t||"none"===t?x.can.transition(!0):x.save.displayType(t)}return C.data(v.displayType)},userStyle:function(e){return(e=e||C.attr("style")||"").replace(/display.*?;/,"")},transitionExists:function(t){return e.fn.transition.exists[t]},animationStartEvent:function(){var e,t=n.createElement("div"),i={animation:"animationstart",OAnimation:"oAnimationStart",MozAnimation:"mozAnimationStart",WebkitAnimation:"webkitAnimationStart"};for(e in i)if(void 0!==t.style[e])return i[e];return!1},animationEndEvent:function(){var e,t=n.createElement("div"),i={animation:"animationend",OAnimation:"oAnimationEnd",MozAnimation:"mozAnimationEnd",WebkitAnimation:"webkitAnimationEnd"};for(e in i)if(void 0!==t.style[e])return i[e];return!1}},can:{transition:function(t){var n,i,o,a,r,s,l=f.animation,c=x.get.transitionExists(l),u=x.get.displayType(!1);if(void 0===c||t){if(x.verbose("Determining whether animation exists"),n=C.attr("class"),i=C.prop("tagName"),a=(o=e("<"+i+" />").addClass(n).insertAfter(C)).addClass(l).removeClass(p.inward).removeClass(p.outward).addClass(p.animating).addClass(p.transition).css("animationName"),r=o.addClass(p.inward).css("animationName"),u||(u=o.attr("class",n).removeAttr("style").removeClass(p.hidden).removeClass(p.visible).show().css("display"),x.verbose("Determining final display state",u),x.save.displayType(u)),o.remove(),a!=r)x.debug("Direction exists for animation",l),s=!0;else{if("none"==a||!a)return void x.debug("No animation defined in css",l);x.debug("Static animation found",l,u),s=!1}x.save.transitionExists(l,s)}return void 0!==c?c:s},animate:function(){return void 0!==x.can.transition()}},is:{animating:function(){return C.hasClass(p.animating)},inward:function(){return C.hasClass(p.inward)},outward:function(){return C.hasClass(p.outward)},looping:function(){return C.hasClass(p.looping)},occurring:function(e){return e="."+(e=e||f.animation).replace(" ","."),C.filter(e).length>0},visible:function(){return C.is(":visible")},hidden:function(){return"hidden"===C.css("visibility")},supported:function(){return!1!==h}},hide:function(){x.verbose("Hiding element"),x.is.animating()&&x.reset(),w.blur(),x.remove.display(),x.remove.visible(),e.isFunction(f.onBeforeHide)?f.onBeforeHide.call(w,function(){x.hideNow()}):x.hideNow()},hideNow:function(){x.set.hidden(),x.force.hidden(),f.onHide.call(w),f.onComplete.call(w)},show:function(e){x.verbose("Showing element",e),x.force.visible()&&(x.remove.hidden(),x.set.visible(),f.onShow.call(w),f.onComplete.call(w))},toggle:function(){x.is.visible()?x.hide():x.show()},stop:function(){x.debug("Stopping current animation"),C.triggerHandler(h)},stopAll:function(){x.debug("Stopping all animation"),x.remove.queueCallback(),C.triggerHandler(h)},clear:{queue:function(){x.debug("Clearing animation queue"),x.remove.queueCallback()}},enable:function(){x.verbose("Starting animation"),C.removeClass(p.disabled)},disable:function(){x.debug("Stopping animation"),C.addClass(p.disabled)},setting:function(t,n){if(x.debug("Changing setting",t,n),e.isPlainObject(t))e.extend(!0,f,t);else{if(void 0===n)return f[t];e.isPlainObject(f[t])?e.extend(!0,f[t],n):f[t]=n}},internal:function(t,n){if(e.isPlainObject(t))e.extend(!0,x,t);else{if(void 0===n)return x[t];x[t]=n}},debug:function(){!f.silent&&f.debug&&(f.performance?x.performance.log(arguments):(x.debug=Function.prototype.bind.call(console.info,console,f.name+":"),x.debug.apply(console,arguments)))},verbose:function(){!f.silent&&f.verbose&&f.debug&&(f.performance?x.performance.log(arguments):(x.verbose=Function.prototype.bind.call(console.info,console,f.name+":"),x.verbose.apply(console,arguments)))},error:function(){f.silent||(x.error=Function.prototype.bind.call(console.error,console,f.name+":"),x.error.apply(console,arguments))},performance:{log:function(e){var t,n;f.performance&&(n=(t=(new Date).getTime())-(a||t),a=t,r.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:w,"Execution Time":n})),clearTimeout(x.performance.timer),x.performance.timer=setTimeout(x.performance.display,500)},display:function(){var t=f.name+":",n=0;a=!1,clearTimeout(x.performance.timer),e.each(r,function(e,t){n+=t["Execution Time"]}),t+=" "+n+"ms",o&&(t+=" '"+o+"'"),i.length>1&&(t+=" ("+i.length+")"),(void 0!==console.group||void 0!==console.table)&&r.length>0&&(console.groupCollapsed(t),console.table?console.table(r):e.each(r,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),r=[]}},invoke:function(n,i,o){var a,r,s,l=m;return i=i||c,o=w||o,"string"==typeof n&&void 0!==l&&(n=n.split(/[\. ]/),a=n.length-1,e.each(n,function(t,i){var o=t!=a?i+n[t+1].charAt(0).toUpperCase()+n[t+1].slice(1):n;if(e.isPlainObject(l[o])&&t!=a)l=l[o];else{if(void 0!==l[o])return r=l[o],!1;if(!e.isPlainObject(l[i])||t==a)return void 0!==l[i]&&(r=l[i],!1);l=l[i]}})),e.isFunction(r)?s=r.apply(o,i):void 0!==r&&(s=r),Array.isArray(t)?t.push(s):void 0!==t?t=[t,s]:void 0!==s&&(t=s),void 0!==r&&r}}).initialize()}),void 0!==t?t:this},e.fn.transition.exists={},e.fn.transition.settings={name:"Transition",silent:!1,debug:!1,verbose:!1,performance:!0,namespace:"transition",interval:0,reverse:"auto",onStart:function(){},onComplete:function(){},onShow:function(){},onHide:function(){},useFailSafe:!0,failSafeDelay:100,allowRepeats:!1,displayType:!1,animation:"fade",duration:!1,queue:!0,skipInlineHidden:!1,metadata:{displayType:"display"},className:{animating:"animating",disabled:"disabled",hidden:"hidden",inward:"in",loading:"loading",looping:"looping",outward:"out",transition:"transition",visible:"visible"},error:{noAnimation:"Element is no longer attached to DOM. Unable to animate.  Use silent setting to surpress this warning in production.",repeated:"That animation is already occurring, cancelling repeated animation",method:"The method you called is not defined",support:"This browser does not support CSS animations"}}}(jQuery,window,document),function(e,t,n,i){"use strict";e.isWindow=e.isWindow||function(e){return null!=e&&e===e.window},t=void 0!==t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),e.api=e.fn.api=function(n){var i,o=e.isFunction(this)?e(t):e(this),a=o.selector||"",r=(new Date).getTime(),s=[],l=arguments[0],c="string"==typeof l,u=[].slice.call(arguments,1);return o.each(function(){var o,d,f,m,g,p=e.isPlainObject(n)?e.extend(!0,{},e.fn.api.settings,n):e.extend({},e.fn.api.settings),v=p.namespace,h=p.metadata,b=p.selector,y=p.error,x=p.className,C="."+v,w="module-"+v,k=e(this),T=k.closest(b.form),S=p.stateContext?e(p.stateContext):k,D=this,A=S[0],E=k.data(w);g={initialize:function(){c||g.bind.events(),g.instantiate()},instantiate:function(){g.verbose("Storing instance of module",g),E=g,k.data(w,E)},destroy:function(){g.verbose("Destroying previous module for",D),k.removeData(w).off(C)},bind:{events:function(){var e=g.get.event();e?(g.verbose("Attaching API events to element",e),k.on(e+C,g.event.trigger)):"now"==p.on&&(g.debug("Querying API endpoint immediately"),g.query())}},decode:{json:function(e){if(void 0!==e&&"string"==typeof e)try{e=JSON.parse(e)}catch(t){}return e}},read:{cachedResponse:function(e){var n;if(void 0!==t.Storage)return n=sessionStorage.getItem(e),g.debug("Using cached response",e,n),n=g.decode.json(n);g.error(y.noStorage)}},write:{cachedResponse:function(n,i){i&&""===i?g.debug("Response empty, not caching",i):void 0!==t.Storage?(e.isPlainObject(i)&&(i=JSON.stringify(i)),sessionStorage.setItem(n,i),g.verbose("Storing cached response for url",n,i)):g.error(y.noStorage)}},query:function(){if(g.is.disabled())g.debug("Element is disabled API request aborted");else{if(g.is.loading()){if(!p.interruptRequests)return void g.debug("Cancelling request, previous request is still pending");g.debug("Interrupting previous request"),g.abort()}if(p.defaultData&&e.extend(!0,p.urlData,g.get.defaultData()),p.serializeForm&&(p.data=g.add.formData(p.data)),!1===(d=g.get.settings()))return g.cancelled=!0,void g.error(y.beforeSend);if(g.cancelled=!1,(f=g.get.templatedURL())||g.is.mocked()){if((f=g.add.urlData(f))||g.is.mocked()){if(d.url=p.base+f,o=e.extend(!0,{},p,{type:p.method||p.type,data:void 0,url:p.base+f,beforeSend:p.beforeXHR,success:function(){},failure:function(){},complete:function(){}}),g.debug("Querying URL",o.url),g.verbose("Using AJAX settings",o),"local"===p.cache&&g.read.cachedResponse(f))return g.debug("Response returned from local cache"),g.request=g.create.request(),void g.request.resolveWith(A,[g.read.cachedResponse(f)]);p.throttle?p.throttleFirstRequest||g.timer?(g.debug("Throttling request",p.throttle),clearTimeout(g.timer),g.timer=setTimeout(function(){g.timer&&delete g.timer,g.debug("Sending throttled request",void 0,o.method),g.send.request()},p.throttle)):(g.debug("Sending request",void 0,o.method),g.send.request(),g.timer=setTimeout(function(){},p.throttle)):(g.debug("Sending request",void 0,o.method),g.send.request())}}else g.error(y.missingURL)}},should:{removeError:function(){return!0===p.hideError||"auto"===p.hideError&&!g.is.form()}},is:{disabled:function(){return k.filter(b.disabled).length>0},expectingJSON:function(){return"json"===p.dataType||"jsonp"===p.dataType},form:function(){return k.is("form")||S.is("form")},mocked:function(){return p.mockResponse||p.mockResponseAsync||p.response||p.responseAsync},input:function(){return k.is("input")},loading:function(){return!!g.request&&"pending"==g.request.state()},abortedRequest:function(e){return e&&void 0!==e.readyState&&0===e.readyState?(g.verbose("XHR request determined to be aborted"),!0):(g.verbose("XHR request was not aborted"),!1)},validResponse:function(t){return g.is.expectingJSON()&&e.isFunction(p.successTest)?(g.debug("Checking JSON returned success",p.successTest,t),p.successTest(t)?(g.debug("Response passed success test",t),!0):(g.debug("Response failed success test",t),!1)):(g.verbose("Response is not JSON, skipping validation",p.successTest,t),!0)}},was:{cancelled:function(){return g.cancelled||!1},succesful:function(){return g.verbose('This behavior will be deleted due to typo. Use "was successful" instead.'),g.was.successful()},successful:function(){return g.request&&"resolved"==g.request.state()},failure:function(){return g.request&&"rejected"==g.request.state()},complete:function(){return g.request&&("resolved"==g.request.state()||"rejected"==g.request.state())}},add:{urlData:function(t,n){var i,o;return t&&(i=t.match(p.regExp.required),o=t.match(p.regExp.optional),n=n||p.urlData,i&&(g.debug("Looking for required URL variables",i),e.each(i,function(i,o){var a=-1!==o.indexOf("$")?o.substr(2,o.length-3):o.substr(1,o.length-2),r=e.isPlainObject(n)&&void 0!==n[a]?n[a]:void 0!==k.data(a)?k.data(a):void 0!==S.data(a)?S.data(a):n[a];if(void 0===r)return g.error(y.requiredParameter,a,t),t=!1,!1;g.verbose("Found required variable",a,r),r=p.encodeParameters?g.get.urlEncodedValue(r):r,t=t.replace(o,r)})),o&&(g.debug("Looking for optional URL variables",i),e.each(o,function(i,o){var a=-1!==o.indexOf("$")?o.substr(3,o.length-4):o.substr(2,o.length-3),r=e.isPlainObject(n)&&void 0!==n[a]?n[a]:void 0!==k.data(a)?k.data(a):void 0!==S.data(a)?S.data(a):n[a];void 0!==r?(g.verbose("Optional variable Found",a,r),t=t.replace(o,r)):(g.verbose("Optional variable not found",a),t=-1!==t.indexOf("/"+o)?t.replace("/"+o,""):t.replace(o,""))}))),t},formData:function(t){var n=void 0!==e.fn.serializeObject,i=n?T.serializeObject():T.serialize();return t=t||p.data,e.isPlainObject(t)?n?(g.debug("Extending existing data with form data",t,i),t=e.extend(!0,{},t,i)):(g.error(y.missingSerialize),g.debug("Cant extend data. Replacing data with form data",t,i),t=i):(g.debug("Adding form data",i),t=i),t}},send:{request:function(){g.set.loading(),g.request=g.create.request(),g.is.mocked()?g.mockedXHR=g.create.mockedXHR():g.xhr=g.create.xhr(),p.onRequest.call(A,g.request,g.xhr)}},event:{trigger:function(e){g.query(),"submit"!=e.type&&"click"!=e.type||e.preventDefault()},xhr:{always:function(){},done:function(t,n,i){var o=this,a=(new Date).getTime()-m,r=p.loadingDuration-a,s=!!e.isFunction(p.onResponse)&&(g.is.expectingJSON()&&!p.rawResponse?p.onResponse.call(o,e.extend(!0,{},t)):p.onResponse.call(o,t));r=r>0?r:0,s&&(g.debug("Modified API response in onResponse callback",p.onResponse,s,t),t=s),r>0&&g.debug("Response completed early delaying state change by",r),setTimeout(function(){g.is.validResponse(t)?g.request.resolveWith(o,[t,i]):g.request.rejectWith(o,[i,"invalid"])},r)},fail:function(e,t,n){var i=this,o=(new Date).getTime()-m,a=p.loadingDuration-o;(a=a>0?a:0)>0&&g.debug("Response completed early delaying state change by",a),setTimeout(function(){g.is.abortedRequest(e)?g.request.rejectWith(i,[e,"aborted",n]):g.request.rejectWith(i,[e,"error",t,n])},a)}},request:{done:function(e,t){g.debug("Successful API Response",e),"local"===p.cache&&f&&(g.write.cachedResponse(f,e),g.debug("Saving server response locally",g.cache)),p.onSuccess.call(A,e,k,t)},complete:function(e,t){var n,i;g.was.successful()?(i=e,n=t):(n=e,i=g.get.responseFromXHR(n)),g.remove.loading(),p.onComplete.call(A,i,k,n)},fail:function(e,t,n){var i=g.get.responseFromXHR(e),a=g.get.errorFromRequest(i,t,n);if("aborted"==t)return g.debug("XHR Aborted (Most likely caused by page navigation or CORS Policy)",t,n),p.onAbort.call(A,t,k,e),!0;"invalid"==t?g.debug("JSON did not pass success test. A server-side error has most likely occurred",i):"error"==t&&void 0!==e&&(g.debug("XHR produced a server error",t,n),(e.status<200||e.status>=300)&&void 0!==n&&""!==n&&g.error(y.statusMessage+n,o.url),p.onError.call(A,a,k,e)),p.errorDuration&&"aborted"!==t&&(g.debug("Adding error state"),g.set.error(),g.should.removeError()&&setTimeout(g.remove.error,p.errorDuration)),g.debug("API Request failed",a,e),p.onFailure.call(A,i,k,e)}}},create:{request:function(){return e.Deferred().always(g.event.request.complete).done(g.event.request.done).fail(g.event.request.fail)},mockedXHR:function(){var t,n,i,o=p.mockResponse||p.response,a=p.mockResponseAsync||p.responseAsync;return i=e.Deferred().always(g.event.xhr.complete).done(g.event.xhr.done).fail(g.event.xhr.fail),o?(e.isFunction(o)?(g.debug("Using specified synchronous callback",o),n=o.call(A,d)):(g.debug("Using settings specified response",o),n=o),i.resolveWith(A,[n,!1,{responseText:n}])):e.isFunction(a)&&(t=function(e){g.debug("Async callback returned response",e),e?i.resolveWith(A,[e,!1,{responseText:e}]):i.rejectWith(A,[{responseText:e},!1,!1])},g.debug("Using specified async response callback",a),a.call(A,d,t)),i},xhr:function(){var t;return t=e.ajax(o).always(g.event.xhr.always).done(g.event.xhr.done).fail(g.event.xhr.fail),g.verbose("Created server request",t,o),t}},set:{error:function(){g.verbose("Adding error state to element",S),S.addClass(x.error)},loading:function(){g.verbose("Adding loading state to element",S),S.addClass(x.loading),m=(new Date).getTime()}},remove:{error:function(){g.verbose("Removing error state from element",S),S.removeClass(x.error)},loading:function(){g.verbose("Removing loading state from element",S),S.removeClass(x.loading)}},get:{responseFromXHR:function(t){return!!e.isPlainObject(t)&&(g.is.expectingJSON()?g.decode.json(t.responseText):t.responseText)},errorFromRequest:function(t,n,i){return e.isPlainObject(t)&&void 0!==t.error?t.error:void 0!==p.error[n]?p.error[n]:i},request:function(){return g.request||!1},xhr:function(){return g.xhr||!1},settings:function(){var t;return(t=p.beforeSend.call(k,p))&&(void 0!==t.success&&(g.debug("Legacy success callback detected",t),g.error(y.legacyParameters,t.success),t.onSuccess=t.success),void 0!==t.failure&&(g.debug("Legacy failure callback detected",t),g.error(y.legacyParameters,t.failure),t.onFailure=t.failure),void 0!==t.complete&&(g.debug("Legacy complete callback detected",t),g.error(y.legacyParameters,t.complete),t.onComplete=t.complete)),void 0===t&&g.error(y.noReturnedValue),!1===t?t:void 0!==t?e.extend(!0,{},t):e.extend(!0,{},p)},urlEncodedValue:function(e){var n=t.decodeURIComponent(e),i=t.encodeURIComponent(e);return n!==e?(g.debug("URL value is already encoded, avoiding double encoding",e),e):(g.verbose("Encoding value using encodeURIComponent",e,i),i)},defaultData:function(){var t={};return e.isWindow(D)||(g.is.input()?t.value=k.val():g.is.form()||(t.text=k.text())),t},event:function(){return e.isWindow(D)||"now"==p.on?(g.debug("API called without element, no events attached"),!1):"auto"==p.on?k.is("input")?void 0!==D.oninput?"input":void 0!==D.onpropertychange?"propertychange":"keyup":k.is("form")?"submit":"click":p.on},templatedURL:function(e){if(e=e||k.data(h.action)||p.action||!1,f=k.data(h.url)||p.url||!1)return g.debug("Using specified url",f),f;if(e){if(g.debug("Looking up url for action",e,p.api),void 0===p.api[e]&&!g.is.mocked())return void g.error(y.missingAction,p.action,p.api);f=p.api[e]}else g.is.form()&&(f=k.attr("action")||S.attr("action")||!1,g.debug("No url or action specified, defaulting to form action",f));return f}},abort:function(){var e=g.get.xhr();e&&"resolved"!==e.state()&&(g.debug("Cancelling API request"),e.abort())},reset:function(){g.remove.error(),g.remove.loading()},setting:function(t,n){if(g.debug("Changing setting",t,n),e.isPlainObject(t))e.extend(!0,p,t);else{if(void 0===n)return p[t];e.isPlainObject(p[t])?e.extend(!0,p[t],n):p[t]=n}},internal:function(t,n){if(e.isPlainObject(t))e.extend(!0,g,t);else{if(void 0===n)return g[t];g[t]=n}},debug:function(){!p.silent&&p.debug&&(p.performance?g.performance.log(arguments):(g.debug=Function.prototype.bind.call(console.info,console,p.name+":"),g.debug.apply(console,arguments)))},verbose:function(){!p.silent&&p.verbose&&p.debug&&(p.performance?g.performance.log(arguments):(g.verbose=Function.prototype.bind.call(console.info,console,p.name+":"),g.verbose.apply(console,arguments)))},error:function(){p.silent||(g.error=Function.prototype.bind.call(console.error,console,p.name+":"),g.error.apply(console,arguments))},performance:{log:function(e){var t,n;p.performance&&(n=(t=(new Date).getTime())-(r||t),r=t,s.push({Name:e[0],Arguments:[].slice.call(e,1)||"","Execution Time":n})),clearTimeout(g.performance.timer),g.performance.timer=setTimeout(g.performance.display,500)},display:function(){var t=p.name+":",n=0;r=!1,clearTimeout(g.performance.timer),e.each(s,function(e,t){n+=t["Execution Time"]}),t+=" "+n+"ms",a&&(t+=" '"+a+"'"),(void 0!==console.group||void 0!==console.table)&&s.length>0&&(console.groupCollapsed(t),console.table?console.table(s):e.each(s,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),s=[]}},invoke:function(t,n,o){var a,r,s,l=E;return n=n||u,o=D||o,"string"==typeof t&&void 0!==l&&(t=t.split(/[\. ]/),a=t.length-1,e.each(t,function(n,i){var o=n!=a?i+t[n+1].charAt(0).toUpperCase()+t[n+1].slice(1):t;if(e.isPlainObject(l[o])&&n!=a)l=l[o];else{if(void 0!==l[o])return r=l[o],!1;if(!e.isPlainObject(l[i])||n==a)return void 0!==l[i]?(r=l[i],!1):(g.error(y.method,t),!1);l=l[i]}})),e.isFunction(r)?s=r.apply(o,n):void 0!==r&&(s=r),Array.isArray(i)?i.push(s):void 0!==i?i=[i,s]:void 0!==s&&(i=s),r}},c?(void 0===E&&g.initialize(),g.invoke(l)):(void 0!==E&&E.invoke("destroy"),g.initialize())}),void 0!==i?i:this},e.api.settings={name:"API",namespace:"api",debug:!1,verbose:!1,performance:!0,api:{},cache:!0,interruptRequests:!0,on:"auto",stateContext:!1,loadingDuration:0,hideError:"auto",errorDuration:2e3,encodeParameters:!0,action:!1,url:!1,base:"",urlData:{},defaultData:!0,serializeForm:!1,throttle:0,throttleFirstRequest:!0,method:"get",data:{},dataType:"json",mockResponse:!1,mockResponseAsync:!1,response:!1,responseAsync:!1,rawResponse:!1,beforeSend:function(e){return e},beforeXHR:function(e){},onRequest:function(e,t){},onResponse:!1,onSuccess:function(e,t){},onComplete:function(e,t){},onFailure:function(e,t){},onError:function(e,t){},onAbort:function(e,t){},successTest:!1,error:{beforeSend:"The before send function has aborted the request",error:"There was an error with your request",exitConditions:"API Request Aborted. Exit conditions met",JSONParse:"JSON could not be parsed during error handling",legacyParameters:"You are using legacy API success callback names",method:"The method you called is not defined",missingAction:"API action used but no url was defined",missingSerialize:"jquery-serialize-object is required to add form data to an existing data object",missingURL:"No URL specified for api event",noReturnedValue:"The beforeSend callback must return a settings object, beforeSend ignored.",noStorage:"Caching responses locally requires session storage",parseError:"There was an error parsing your request",requiredParameter:"Missing a required URL parameter: ",statusMessage:"Server gave an error: ",timeout:"Your request timed out"},regExp:{required:/\{\$*[A-z0-9]+\}/g,optional:/\{\/\$*[A-z0-9]+\}/g},className:{loading:"loading",error:"error"},selector:{disabled:".disabled",form:"form"},metadata:{action:"action",url:"url"}}}(jQuery,window,document),function(e,t,n,i){"use strict";e.isFunction=e.isFunction||function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},t=void 0!==t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),e.fn.state=function(t){var n,i=e(this),o=i.selector||"",a=(new Date).getTime(),r=[],s=arguments[0],l="string"==typeof s,c=[].slice.call(arguments,1);return i.each(function(){var u,d=e.isPlainObject(t)?e.extend(!0,{},e.fn.state.settings,t):e.extend({},e.fn.state.settings),f=d.error,m=d.metadata,g=d.className,p=d.namespace,v=d.states,h=d.text,b="."+p,y=p+"-module",x=e(this),C=this,w=x.data(y);u={initialize:function(){u.verbose("Initializing module"),d.automatic&&u.add.defaults(),d.context&&""!==o?e(d.context).on(o,"mouseenter"+b,u.change.text).on(o,"mouseleave"+b,u.reset.text).on(o,"click"+b,u.toggle.state):x.on("mouseenter"+b,u.change.text).on("mouseleave"+b,u.reset.text).on("click"+b,u.toggle.state),u.instantiate()},instantiate:function(){u.verbose("Storing instance of module",u),w=u,x.data(y,u)},destroy:function(){u.verbose("Destroying previous module",w),x.off(b).removeData(y)},refresh:function(){u.verbose("Refreshing selector cache"),x=e(C)},add:{defaults:function(){var n=t&&e.isPlainObject(t.states)?t.states:{};e.each(d.defaults,function(t,i){void 0!==u.is[t]&&u.is[t]()&&(u.verbose("Adding default states",t,C),e.extend(d.states,i,n))})}},is:{active:function(){return x.hasClass(g.active)},loading:function(){return x.hasClass(g.loading)},inactive:function(){return!x.hasClass(g.active)},state:function(e){return void 0!==g[e]&&x.hasClass(g[e])},enabled:function(){return!x.is(d.filter.active)},disabled:function(){return x.is(d.filter.active)},textEnabled:function(){return!x.is(d.filter.text)},button:function(){return x.is(".button:not(a, .submit)")},input:function(){return x.is("input")},progress:function(){return x.is(".ui.progress")}},allow:function(e){u.debug("Now allowing state",e),v[e]=!0},disallow:function(e){u.debug("No longer allowing",e),v[e]=!1},allows:function(e){return v[e]||!1},enable:function(){x.removeClass(g.disabled)},disable:function(){x.addClass(g.disabled)},setState:function(e){u.allows(e)&&x.addClass(g[e])},removeState:function(e){u.allows(e)&&x.removeClass(g[e])},toggle:{state:function(){var t;if(u.allows("active")&&u.is.enabled()){if(u.refresh(),void 0!==e.fn.api)if(t=x.api("get request"),x.api("was cancelled"))u.debug("API Request cancelled by beforesend"),d.activateTest=function(){return!1},d.deactivateTest=function(){return!1};else if(t)return void u.listenTo(t);u.change.state()}}},listenTo:function(t){u.debug("API request detected, waiting for state signal",t),t&&(h.loading&&u.update.text(h.loading),e.when(t).then(function(){"resolved"==t.state()?(u.debug("API request succeeded"),d.activateTest=function(){return!0},d.deactivateTest=function(){return!0}):(u.debug("API request failed"),d.activateTest=function(){return!1},d.deactivateTest=function(){return!1}),u.change.state()}))},change:{state:function(){u.debug("Determining state change direction"),u.is.inactive()?u.activate():u.deactivate(),d.sync&&u.sync(),d.onChange.call(C)},text:function(){u.is.textEnabled()&&(u.is.disabled()?(u.verbose("Changing text to disabled text",h.hover),u.update.text(h.disabled)):u.is.active()?h.hover?(u.verbose("Changing text to hover text",h.hover),u.update.text(h.hover)):h.deactivate&&(u.verbose("Changing text to deactivating text",h.deactivate),u.update.text(h.deactivate)):h.hover?(u.verbose("Changing text to hover text",h.hover),u.update.text(h.hover)):h.activate&&(u.verbose("Changing text to activating text",h.activate),u.update.text(h.activate)))}},activate:function(){d.activateTest.call(C)&&(u.debug("Setting state to active"),x.addClass(g.active),u.update.text(h.active),d.onActivate.call(C))},deactivate:function(){d.deactivateTest.call(C)&&(u.debug("Setting state to inactive"),x.removeClass(g.active),u.update.text(h.inactive),d.onDeactivate.call(C))},sync:function(){u.verbose("Syncing other buttons to current state"),u.is.active()?i.not(x).state("activate"):i.not(x).state("deactivate")},get:{text:function(){return d.selector.text?x.find(d.selector.text).text():x.html()},textFor:function(e){return h[e]||!1}},flash:{text:function(e,t,n){var i=u.get.text();u.debug("Flashing text message",e,t),e=e||d.text.flash,t=t||d.flashDuration,n=n||function(){},u.update.text(e),setTimeout(function(){u.update.text(i),n.call(C)},t)}},reset:{text:function(){var e=h.active||x.data(m.storedText),t=h.inactive||x.data(m.storedText);u.is.textEnabled()&&(u.is.active()&&e?(u.verbose("Resetting active text",e),u.update.text(e)):t&&(u.verbose("Resetting inactive text",e),u.update.text(t)))}},update:{text:function(e){var t=u.get.text();e&&e!==t?(u.debug("Updating text",e),d.selector.text?x.data(m.storedText,e).find(d.selector.text).text(e):x.data(m.storedText,e).html(e)):u.debug("Text is already set, ignoring update",e)}},setting:function(t,n){if(u.debug("Changing setting",t,n),e.isPlainObject(t))e.extend(!0,d,t);else{if(void 0===n)return d[t];e.isPlainObject(d[t])?e.extend(!0,d[t],n):d[t]=n}},internal:function(t,n){if(e.isPlainObject(t))e.extend(!0,u,t);else{if(void 0===n)return u[t];u[t]=n}},debug:function(){!d.silent&&d.debug&&(d.performance?u.performance.log(arguments):(u.debug=Function.prototype.bind.call(console.info,console,d.name+":"),u.debug.apply(console,arguments)))},verbose:function(){!d.silent&&d.verbose&&d.debug&&(d.performance?u.performance.log(arguments):(u.verbose=Function.prototype.bind.call(console.info,console,d.name+":"),u.verbose.apply(console,arguments)))},error:function(){d.silent||(u.error=Function.prototype.bind.call(console.error,console,d.name+":"),u.error.apply(console,arguments))},performance:{log:function(e){var t,n;d.performance&&(n=(t=(new Date).getTime())-(a||t),a=t,r.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:C,"Execution Time":n})),clearTimeout(u.performance.timer),u.performance.timer=setTimeout(u.performance.display,500)},display:function(){var t=d.name+":",n=0;a=!1,clearTimeout(u.performance.timer),e.each(r,function(e,t){n+=t["Execution Time"]}),t+=" "+n+"ms",o&&(t+=" '"+o+"'"),(void 0!==console.group||void 0!==console.table)&&r.length>0&&(console.groupCollapsed(t),console.table?console.table(r):e.each(r,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),r=[]}},invoke:function(t,i,o){var a,r,s,l=w;return i=i||c,o=C||o,"string"==typeof t&&void 0!==l&&(t=t.split(/[\. ]/),a=t.length-1,e.each(t,function(n,i){var o=n!=a?i+t[n+1].charAt(0).toUpperCase()+t[n+1].slice(1):t;if(e.isPlainObject(l[o])&&n!=a)l=l[o];else{if(void 0!==l[o])return r=l[o],!1;if(!e.isPlainObject(l[i])||n==a)return void 0!==l[i]?(r=l[i],!1):(u.error(f.method,t),!1);l=l[i]}})),e.isFunction(r)?s=r.apply(o,i):void 0!==r&&(s=r),Array.isArray(n)?n.push(s):void 0!==n?n=[n,s]:void 0!==s&&(n=s),r}},l?(void 0===w&&u.initialize(),u.invoke(s)):(void 0!==w&&w.invoke("destroy"),u.initialize())}),void 0!==n?n:this},e.fn.state.settings={name:"State",debug:!1,verbose:!1,namespace:"state",performance:!0,onActivate:function(){},onDeactivate:function(){},onChange:function(){},activateTest:function(){return!0},deactivateTest:function(){return!0},automatic:!0,sync:!1,flashDuration:1e3,filter:{text:".loading, .disabled",active:".disabled"},context:!1,error:{beforeSend:"The before send function has cancelled state change",method:"The method you called is not defined."},metadata:{promise:"promise",storedText:"stored-text"},className:{active:"active",disabled:"disabled",error:"error",loading:"loading",success:"success",warning:"warning"},selector:{text:!1},defaults:{input:{disabled:!0,loading:!0,active:!0},button:{disabled:!0,loading:!0,active:!0},progress:{active:!0,success:!0,warning:!0,error:!0}},states:{active:!0,disabled:!0,error:!0,loading:!0,success:!0,warning:!0},text:{disabled:!1,flash:!1,hover:!1,active:!1,inactive:!1,activate:!1,deactivate:!1}}}(jQuery,window,document),function(e,t,n,i){"use strict";e.isFunction=e.isFunction||function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},t=void 0!==t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),e.fn.visibility=function(i){var o,a=e(this),r=a.selector||"",s=(new Date).getTime(),l=[],c=arguments[0],u="string"==typeof c,d=[].slice.call(arguments,1),f=a.length,m=0;return a.each(function(){var a,g,p,v,h=e.isPlainObject(i)?e.extend(!0,{},e.fn.visibility.settings,i):e.extend({},e.fn.visibility.settings),b=h.className,y=h.namespace,x=h.error,C=h.metadata,w="."+y,k="module-"+y,T=e(t),S=e(this),D=e(h.context),A=S.data(k),E=t.requestAnimationFrame||t.mozRequestAnimationFrame||t.webkitRequestAnimationFrame||t.msRequestAnimationFrame||function(e){setTimeout(e,0)},F=this,P=!1;v={initialize:function(){v.debug("Initializing",h),v.setup.cache(),v.should.trackChanges()&&("image"==h.type&&v.setup.image(),"fixed"==h.type&&v.setup.fixed(),h.observeChanges&&v.observeChanges(),v.bind.events()),v.save.position(),v.is.visible()||v.error(x.visible,S),h.initialCheck&&v.checkVisibility(),v.instantiate()},instantiate:function(){v.debug("Storing instance",v),S.data(k,v),A=v},destroy:function(){v.verbose("Destroying previous module"),p&&p.disconnect(),g&&g.disconnect(),T.off("load"+w,v.event.load).off("resize"+w,v.event.resize),D.off("scroll"+w,v.event.scroll).off("scrollchange"+w,v.event.scrollchange),"fixed"==h.type&&(v.resetFixed(),v.remove.placeholder()),S.off(w).removeData(k)},observeChanges:function(){"MutationObserver"in t&&(g=new MutationObserver(v.event.contextChanged),p=new MutationObserver(v.event.changed),g.observe(n,{childList:!0,subtree:!0}),p.observe(F,{childList:!0,subtree:!0}),v.debug("Setting up mutation observer",p))},bind:{events:function(){v.verbose("Binding visibility events to scroll and resize"),h.refreshOnLoad&&T.on("load"+w,v.event.load),T.on("resize"+w,v.event.resize),D.off("scroll"+w).on("scroll"+w,v.event.scroll).on("scrollchange"+w,v.event.scrollchange)}},event:{changed:function(e){v.verbose("DOM tree modified, updating visibility calculations"),v.timer=setTimeout(function(){v.verbose("DOM tree modified, updating sticky menu"),v.refresh()},100)},contextChanged:function(t){[].forEach.call(t,function(t){t.removedNodes&&[].forEach.call(t.removedNodes,function(t){(t==F||e(t).find(F).length>0)&&(v.debug("Element removed from DOM, tearing down events"),v.destroy())})})},resize:function(){v.debug("Window resized"),h.refreshOnResize&&E(v.refresh)},load:function(){v.debug("Page finished loading"),E(v.refresh)},scroll:function(){h.throttle?(clearTimeout(v.timer),v.timer=setTimeout(function(){D.triggerHandler("scrollchange"+w,[D.scrollTop()])},h.throttle)):E(function(){D.triggerHandler("scrollchange"+w,[D.scrollTop()])})},scrollchange:function(e,t){v.checkVisibility(t)}},precache:function(t,i){t instanceof Array||(t=[t]);for(var o=t.length,a=0,r=[],s=n.createElement("img"),l=function(){++a>=t.length&&e.isFunction(i)&&i()};o--;)(s=n.createElement("img")).onload=l,s.onerror=l,s.src=t[o],r.push(s)},enableCallbacks:function(){v.debug("Allowing callbacks to occur"),P=!1},disableCallbacks:function(){v.debug("Disabling all callbacks temporarily"),P=!0},should:{trackChanges:function(){return u?(v.debug("One time query, no need to bind events"),!1):(v.debug("Callbacks being attached"),!0)}},setup:{cache:function(){v.cache={occurred:{},screen:{},element:{}}},image:function(){var e=S.data(C.src);e&&(v.verbose("Lazy loading image",e),h.once=!0,h.observeChanges=!1,h.onOnScreen=function(){v.debug("Image on screen",F),v.precache(e,function(){v.set.image(e,function(){++m==f&&h.onAllLoaded.call(this),h.onLoad.call(this)})})})},fixed:function(){v.debug("Setting up fixed"),h.once=!1,h.observeChanges=!1,h.initialCheck=!0,h.refreshOnLoad=!0,i.transition||(h.transition=!1),v.create.placeholder(),v.debug("Added placeholder",a),h.onTopPassed=function(){v.debug("Element passed, adding fixed position",S),v.show.placeholder(),v.set.fixed(),h.transition&&void 0!==e.fn.transition&&S.transition(h.transition,h.duration)},h.onTopPassedReverse=function(){v.debug("Element returned to position, removing fixed",S),v.hide.placeholder(),v.remove.fixed()}}},create:{placeholder:function(){v.verbose("Creating fixed position placeholder"),a=S.clone(!1).css("display","none").addClass(b.placeholder).insertAfter(S)}},show:{placeholder:function(){v.verbose("Showing placeholder"),a.css("display","block").css("visibility","hidden")}},hide:{placeholder:function(){v.verbose("Hiding placeholder"),a.css("display","none").css("visibility","")}},set:{fixed:function(){v.verbose("Setting element to fixed position"),S.addClass(b.fixed).css({position:"fixed",top:h.offset+"px",left:"auto",zIndex:h.zIndex}),h.onFixed.call(F)},image:function(t,n){if(S.attr("src",t),h.transition)if(void 0!==e.fn.transition){if(S.hasClass(b.visible))return void v.debug("Transition already occurred on this image, skipping animation");S.transition(h.transition,h.duration,n)}else S.fadeIn(h.duration,n);else S.show()}},is:{onScreen:function(){return v.get.elementCalculations().onScreen},offScreen:function(){return v.get.elementCalculations().offScreen},visible:function(){return!(!v.cache||!v.cache.element)&&!(0===v.cache.element.width&&0===v.cache.element.offset.top)},verticallyScrollableContext:function(){var e=D.get(0)!==t&&D.css("overflow-y");return"auto"==e||"scroll"==e},horizontallyScrollableContext:function(){var e=D.get(0)!==t&&D.css("overflow-x");return"auto"==e||"scroll"==e}},refresh:function(){v.debug("Refreshing constants (width/height)"),"fixed"==h.type&&v.resetFixed(),v.reset(),v.save.position(),h.checkOnRefresh&&v.checkVisibility(),h.onRefresh.call(F)},resetFixed:function(){v.remove.fixed(),v.remove.occurred()},reset:function(){v.verbose("Resetting all cached values"),e.isPlainObject(v.cache)&&(v.cache.screen={},v.cache.element={})},checkVisibility:function(e){v.verbose("Checking visibility of element",v.cache.element),!P&&v.is.visible()&&(v.save.scroll(e),v.save.calculations(),v.passed(),v.passingReverse(),v.topVisibleReverse(),v.bottomVisibleReverse(),v.topPassedReverse(),v.bottomPassedReverse(),v.onScreen(),v.offScreen(),v.passing(),v.topVisible(),v.bottomVisible(),v.topPassed(),v.bottomPassed(),h.onUpdate&&h.onUpdate.call(F,v.get.elementCalculations()))},passed:function(t,n){var i=v.get.elementCalculations();if(t&&n)h.onPassed[t]=n;else{if(void 0!==t)return v.get.pixelsPassed(t)>i.pixelsPassed;i.passing&&e.each(h.onPassed,function(e,t){i.bottomVisible||i.pixelsPassed>v.get.pixelsPassed(e)?v.execute(t,e):h.once||v.remove.occurred(t)})}},onScreen:function(e){var t=v.get.elementCalculations(),n=e||h.onOnScreen;if(e&&(v.debug("Adding callback for onScreen",e),h.onOnScreen=e),t.onScreen?v.execute(n,"onScreen"):h.once||v.remove.occurred("onScreen"),void 0!==e)return t.onOnScreen},offScreen:function(e){var t=v.get.elementCalculations(),n=e||h.onOffScreen;if(e&&(v.debug("Adding callback for offScreen",e),h.onOffScreen=e),t.offScreen?v.execute(n,"offScreen"):h.once||v.remove.occurred("offScreen"),void 0!==e)return t.onOffScreen},passing:function(e){var t=v.get.elementCalculations(),n=e||h.onPassing;if(e&&(v.debug("Adding callback for passing",e),h.onPassing=e),t.passing?v.execute(n,"passing"):h.once||v.remove.occurred("passing"),void 0!==e)return t.passing},topVisible:function(e){var t=v.get.elementCalculations(),n=e||h.onTopVisible;if(e&&(v.debug("Adding callback for top visible",e),h.onTopVisible=e),t.topVisible?v.execute(n,"topVisible"):h.once||v.remove.occurred("topVisible"),void 0===e)return t.topVisible},bottomVisible:function(e){var t=v.get.elementCalculations(),n=e||h.onBottomVisible;if(e&&(v.debug("Adding callback for bottom visible",e),h.onBottomVisible=e),t.bottomVisible?v.execute(n,"bottomVisible"):h.once||v.remove.occurred("bottomVisible"),void 0===e)return t.bottomVisible},topPassed:function(e){var t=v.get.elementCalculations(),n=e||h.onTopPassed;if(e&&(v.debug("Adding callback for top passed",e),h.onTopPassed=e),t.topPassed?v.execute(n,"topPassed"):h.once||v.remove.occurred("topPassed"),void 0===e)return t.topPassed},bottomPassed:function(e){var t=v.get.elementCalculations(),n=e||h.onBottomPassed;if(e&&(v.debug("Adding callback for bottom passed",e),h.onBottomPassed=e),t.bottomPassed?v.execute(n,"bottomPassed"):h.once||v.remove.occurred("bottomPassed"),void 0===e)return t.bottomPassed},passingReverse:function(e){var t=v.get.elementCalculations(),n=e||h.onPassingReverse;if(e&&(v.debug("Adding callback for passing reverse",e),h.onPassingReverse=e),t.passing?h.once||v.remove.occurred("passingReverse"):v.get.occurred("passing")&&v.execute(n,"passingReverse"),void 0!==e)return!t.passing},topVisibleReverse:function(e){var t=v.get.elementCalculations(),n=e||h.onTopVisibleReverse;if(e&&(v.debug("Adding callback for top visible reverse",e),h.onTopVisibleReverse=e),t.topVisible?h.once||v.remove.occurred("topVisibleReverse"):v.get.occurred("topVisible")&&v.execute(n,"topVisibleReverse"),void 0===e)return!t.topVisible},bottomVisibleReverse:function(e){var t=v.get.elementCalculations(),n=e||h.onBottomVisibleReverse;if(e&&(v.debug("Adding callback for bottom visible reverse",e),h.onBottomVisibleReverse=e),t.bottomVisible?h.once||v.remove.occurred("bottomVisibleReverse"):v.get.occurred("bottomVisible")&&v.execute(n,"bottomVisibleReverse"),void 0===e)return!t.bottomVisible},topPassedReverse:function(e){var t=v.get.elementCalculations(),n=e||h.onTopPassedReverse;if(e&&(v.debug("Adding callback for top passed reverse",e),h.onTopPassedReverse=e),t.topPassed?h.once||v.remove.occurred("topPassedReverse"):v.get.occurred("topPassed")&&v.execute(n,"topPassedReverse"),void 0===e)return!t.onTopPassed},bottomPassedReverse:function(e){var t=v.get.elementCalculations(),n=e||h.onBottomPassedReverse;if(e&&(v.debug("Adding callback for bottom passed reverse",e),h.onBottomPassedReverse=e),t.bottomPassed?h.once||v.remove.occurred("bottomPassedReverse"):v.get.occurred("bottomPassed")&&v.execute(n,"bottomPassedReverse"),void 0===e)return!t.bottomPassed},execute:function(e,t){var n=v.get.elementCalculations(),i=v.get.screenCalculations();(e=e||!1)&&(h.continuous?(v.debug("Callback being called continuously",t,n),e.call(F,n,i)):v.get.occurred(t)||(v.debug("Conditions met",t,n),e.call(F,n,i))),v.save.occurred(t)},remove:{fixed:function(){v.debug("Removing fixed position"),S.removeClass(b.fixed).css({position:"",top:"",left:"",zIndex:""}),h.onUnfixed.call(F)},placeholder:function(){v.debug("Removing placeholder content"),a&&a.remove()},occurred:function(e){if(e){var t=v.cache.occurred;void 0!==t[e]&&!0===t[e]&&(v.debug("Callback can now be called again",e),v.cache.occurred[e]=!1)}else v.cache.occurred={}}},save:{calculations:function(){v.verbose("Saving all calculations necessary to determine positioning"),v.save.direction(),v.save.screenCalculations(),v.save.elementCalculations()},occurred:function(e){e&&(void 0!==v.cache.occurred[e]&&!0===v.cache.occurred[e]||(v.verbose("Saving callback occurred",e),v.cache.occurred[e]=!0))},scroll:function(e){e=e+h.offset||D.scrollTop()+h.offset,v.cache.scroll=e},direction:function(){var e,t=v.get.scroll(),n=v.get.lastScroll();return e=t>n&&n?"down":t<n&&n?"up":"static",v.cache.direction=e,v.cache.direction},elementPosition:function(){var e=v.cache.element,t=v.get.screenSize();return v.verbose("Saving element position"),e.fits=e.height<t.height,e.offset=S.offset(),e.width=S.outerWidth(),e.height=S.outerHeight(),v.is.verticallyScrollableContext()&&(e.offset.top+=D.scrollTop()-D.offset().top),v.is.horizontallyScrollableContext()&&(e.offset.left+=D.scrollLeft()-D.offset().left),v.cache.element=e,e},elementCalculations:function(){var e=v.get.screenCalculations(),t=v.get.elementPosition();return h.includeMargin?(t.margin={},t.margin.top=parseInt(S.css("margin-top"),10),t.margin.bottom=parseInt(S.css("margin-bottom"),10),t.top=t.offset.top-t.margin.top,t.bottom=t.offset.top+t.height+t.margin.bottom):(t.top=t.offset.top,t.bottom=t.offset.top+t.height),t.topPassed=e.top>=t.top,t.bottomPassed=e.top>=t.bottom,t.topVisible=e.bottom>=t.top&&!t.topPassed,t.bottomVisible=e.bottom>=t.bottom&&!t.bottomPassed,t.pixelsPassed=0,t.percentagePassed=0,t.onScreen=(t.topVisible||t.passing)&&!t.bottomPassed,t.passing=t.topPassed&&!t.bottomPassed,t.offScreen=!t.onScreen,t.passing&&(t.pixelsPassed=e.top-t.top,t.percentagePassed=(e.top-t.top)/t.height),v.cache.element=t,v.verbose("Updated element calculations",t),t},screenCalculations:function(){var e=v.get.scroll();return v.save.direction(),v.cache.screen.top=e,v.cache.screen.bottom=e+v.cache.screen.height,v.cache.screen},screenSize:function(){v.verbose("Saving window position"),v.cache.screen={height:D.height()}},position:function(){v.save.screenSize(),v.save.elementPosition()}},get:{pixelsPassed:function(e){var t=v.get.elementCalculations();return e.search("%")>-1?t.height*(parseInt(e,10)/100):parseInt(e,10)},occurred:function(e){return void 0!==v.cache.occurred&&v.cache.occurred[e]||!1},direction:function(){return void 0===v.cache.direction&&v.save.direction(),v.cache.direction},elementPosition:function(){return void 0===v.cache.element&&v.save.elementPosition(),v.cache.element},elementCalculations:function(){return void 0===v.cache.element&&v.save.elementCalculations(),v.cache.element},screenCalculations:function(){return void 0===v.cache.screen&&v.save.screenCalculations(),v.cache.screen},screenSize:function(){return void 0===v.cache.screen&&v.save.screenSize(),v.cache.screen},scroll:function(){return void 0===v.cache.scroll&&v.save.scroll(),v.cache.scroll},lastScroll:function(){return void 0===v.cache.screen?(v.debug("First scroll event, no last scroll could be found"),!1):v.cache.screen.top}},setting:function(t,n){if(e.isPlainObject(t))e.extend(!0,h,t);else{if(void 0===n)return h[t];h[t]=n}},internal:function(t,n){if(e.isPlainObject(t))e.extend(!0,v,t);else{if(void 0===n)return v[t];v[t]=n}},debug:function(){!h.silent&&h.debug&&(h.performance?v.performance.log(arguments):(v.debug=Function.prototype.bind.call(console.info,console,h.name+":"),v.debug.apply(console,arguments)))},verbose:function(){!h.silent&&h.verbose&&h.debug&&(h.performance?v.performance.log(arguments):(v.verbose=Function.prototype.bind.call(console.info,console,h.name+":"),v.verbose.apply(console,arguments)))},error:function(){h.silent||(v.error=Function.prototype.bind.call(console.error,console,h.name+":"),v.error.apply(console,arguments))},performance:{log:function(e){var t,n;h.performance&&(n=(t=(new Date).getTime())-(s||t),s=t,l.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:F,"Execution Time":n})),clearTimeout(v.performance.timer),v.performance.timer=setTimeout(v.performance.display,500)},display:function(){var t=h.name+":",n=0;s=!1,clearTimeout(v.performance.timer),e.each(l,function(e,t){n+=t["Execution Time"]}),t+=" "+n+"ms",r&&(t+=" '"+r+"'"),(void 0!==console.group||void 0!==console.table)&&l.length>0&&(console.groupCollapsed(t),console.table?console.table(l):e.each(l,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),l=[]}},invoke:function(t,n,i){var a,r,s,l=A;return n=n||d,i=F||i,"string"==typeof t&&void 0!==l&&(t=t.split(/[\. ]/),a=t.length-1,e.each(t,function(n,i){var o=n!=a?i+t[n+1].charAt(0).toUpperCase()+t[n+1].slice(1):t;if(e.isPlainObject(l[o])&&n!=a)l=l[o];else{if(void 0!==l[o])return r=l[o],!1;if(!e.isPlainObject(l[i])||n==a)return void 0!==l[i]?(r=l[i],!1):(v.error(x.method,t),!1);l=l[i]}})),e.isFunction(r)?s=r.apply(i,n):void 0!==r&&(s=r),Array.isArray(o)?o.push(s):void 0!==o?o=[o,s]:void 0!==s&&(o=s),r}},u?(void 0===A&&v.initialize(),A.save.scroll(),A.save.calculations(),v.invoke(c)):(void 0!==A&&A.invoke("destroy"),v.initialize())}),void 0!==o?o:this},e.fn.visibility.settings={name:"Visibility",namespace:"visibility",debug:!1,verbose:!1,performance:!0,observeChanges:!0,initialCheck:!0,refreshOnLoad:!0,refreshOnResize:!0,checkOnRefresh:!0,once:!0,continuous:!1,offset:0,includeMargin:!1,context:t,throttle:!1,type:!1,zIndex:"10",transition:"fade in",duration:1e3,onPassed:{},onOnScreen:!1,onOffScreen:!1,onPassing:!1,onTopVisible:!1,onBottomVisible:!1,onTopPassed:!1,onBottomPassed:!1,onPassingReverse:!1,onTopVisibleReverse:!1,onBottomVisibleReverse:!1,onTopPassedReverse:!1,onBottomPassedReverse:!1,onLoad:function(){},onAllLoaded:function(){},onFixed:function(){},onUnfixed:function(){},onUpdate:!1,onRefresh:function(){},metadata:{src:"src"},className:{fixed:"fixed",placeholder:"constraint",visible:"visible"},error:{method:"The method you called is not defined.",visible:"Element is hidden, you must call refresh after element becomes visible"}}}(jQuery,window,document);
},{}],"XJis":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e,t,n,r,i,o,s={},l=[],a=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|^--/i;function u(e,t){for(var n in t)e[n]=t[n];return e}function c(e){var t=e.parentNode;t&&t.removeChild(e)}function h(e,t,n){var r,i,o,s,l=arguments;if(t=u({},t),arguments.length>3)for(n=[n],r=3;r<arguments.length;r++)n.push(l[r]);if(null!=n&&(t.children=n),null!=e&&null!=e.defaultProps)for(i in e.defaultProps)void 0===t[i]&&(t[i]=e.defaultProps[i]);return s=t.key,null!=(o=t.ref)&&delete t.ref,null!=s&&delete t.key,d(e,t,s,o)}function d(t,n,r,i){var o={type:t,props:n,key:r,ref:i,__k:null,__p:null,__b:0,__e:null,l:null,__c:null,constructor:void 0};return e.vnode&&e.vnode(o),o}function f(e){return e.children}function p(e){if(null==e||"boolean"==typeof e)return null;if("string"==typeof e||"number"==typeof e)return d(null,e,null,null);if(null!=e.__e||null!=e.__c){var t=d(e.type,e.props,e.key,null);return t.__e=e.__e,t}return e}function v(e,t){this.props=e,this.context=t}function g(e,t){if(null==t)return e.__p?g(e.__p,e.__p.__k.indexOf(e)+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?g(e):null}function _(e){var t,n;if(null!=(e=e.__p)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return _(e)}}function b(i){(!i.__d&&(i.__d=!0)&&1===t.push(i)||r!==e.debounceRendering)&&(r=e.debounceRendering,(e.debounceRendering||n)(y))}function y(){var e,n,r,i,o,s,l,a;for(t.sort(function(e,t){return t.__v.__b-e.__v.__b});e=t.pop();)e.__d&&(r=void 0,i=void 0,s=(o=(n=e).__v).__e,l=n.__P,a=n.u,n.u=!1,l&&(r=[],i=C(l,o,u({},o),n.__n,void 0!==l.ownerSVGElement,null,r,a,null==s?g(o):s),T(r,o),i!=s&&_(o)))}function m(e,t,n,r,i,o,a,u,h){var d,f,p,v,_,b,y,m=n&&n.__k||l,k=m.length;if(u==s&&(u=null!=o?o[0]:k?g(n,0):null),d=0,t.__k=x(t.__k,function(n){if(null!=n){if(n.__p=t,n.__b=t.__b+1,null===(p=m[d])||p&&n.key==p.key&&n.type===p.type)m[d]=void 0;else for(f=0;f<k;f++){if((p=m[f])&&n.key==p.key&&n.type===p.type){m[f]=void 0;break}p=null}if(v=C(e,n,p=p||s,r,i,o,a,null,u,h),(f=n.ref)&&p.ref!=f&&(y||(y=[])).push(f,n.__c||v,n),null!=v){if(null==b&&(b=v),null!=n.l)v=n.l,n.l=null;else if(o==p||v!=u||null==v.parentNode){e:if(null==u||u.parentNode!==e)e.appendChild(v);else{for(_=u,f=0;(_=_.nextSibling)&&f<k;f+=2)if(_==v)break e;e.insertBefore(v,u)}"option"==t.type&&(e.value="")}u=v.nextSibling,"function"==typeof t.type&&(t.l=v)}}return d++,n}),t.__e=b,null!=o&&"function"!=typeof t.type)for(d=o.length;d--;)null!=o[d]&&c(o[d]);for(d=k;d--;)null!=m[d]&&M(m[d],m[d]);if(y)for(d=0;d<y.length;d++)A(y[d],y[++d],y[++d])}function x(e,t,n){if(null==n&&(n=[]),null==e||"boolean"==typeof e)t&&n.push(t(null));else if(Array.isArray(e))for(var r=0;r<e.length;r++)x(e[r],t,n);else n.push(t?t(p(e)):e);return n}function k(e,t,n,r,i){var o;for(o in n)o in t||S(e,o,null,n[o],r);for(o in t)i&&"function"!=typeof t[o]||"value"===o||"checked"===o||n[o]===t[o]||S(e,o,t[o],n[o],r)}function w(e,t,n){"-"===t[0]?e.setProperty(t,n):e[t]="number"==typeof n&&!1===a.test(t)?n+"px":null==n?"":n}function S(e,t,n,r,i){var o,s,l,a,u;if("key"===(t=i?"className"===t?"class":t:"class"===t?"className":t)||"children"===t);else if("style"===t)if(o=e.style,"string"==typeof n)o.cssText=n;else{if("string"==typeof r&&(o.cssText="",r=null),r)for(s in r)n&&s in n||w(o,s,"");if(n)for(l in n)r&&n[l]===r[l]||w(o,l,n[l])}else"o"===t[0]&&"n"===t[1]?(a=t!==(t=t.replace(/Capture$/,"")),u=t.toLowerCase(),t=(u in e?u:t).slice(2),n?(r||e.addEventListener(t,E,a),(e.t||(e.t={}))[t]=n):e.removeEventListener(t,E,a)):"list"!==t&&"tagName"!==t&&"form"!==t&&!i&&t in e?e[t]=null==n?"":n:"function"!=typeof n&&"dangerouslySetInnerHTML"!==t&&(t!==(t=t.replace(/^xlink:?/,""))?null==n||!1===n?e.removeAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase()):e.setAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase(),n):null==n||!1===n?e.removeAttribute(t):e.setAttribute(t,n))}function E(t){return this.t[t.type](e.event?e.event(t):t)}function C(t,n,r,i,o,s,l,a,c,h){var d,p,g,_,b,y,k,w,S,E,C=n.type;if(void 0!==n.constructor)return null;(d=e.__b)&&d(n);try{e:if("function"==typeof C){if(w=n.props,S=(d=C.contextType)&&i[d.__c],E=d?S?S.props.value:d.__p:i,r.__c?k=(p=n.__c=r.__c).__p=p.__E:("prototype"in C&&C.prototype.render?n.__c=p=new C(w,E):(n.__c=p=new v(w,E),p.constructor=C,p.render=O),S&&S.sub(p),p.props=w,p.state||(p.state={}),p.context=E,p.__n=i,g=p.__d=!0,p.__h=[]),null==p.__s&&(p.__s=p.state),null!=C.getDerivedStateFromProps&&u(p.__s==p.state?p.__s=u({},p.__s):p.__s,C.getDerivedStateFromProps(w,p.__s)),g)null==C.getDerivedStateFromProps&&null!=p.componentWillMount&&p.componentWillMount(),null!=p.componentDidMount&&l.push(p);else{if(null==C.getDerivedStateFromProps&&null==a&&null!=p.componentWillReceiveProps&&p.componentWillReceiveProps(w,E),!a&&null!=p.shouldComponentUpdate&&!1===p.shouldComponentUpdate(w,p.__s,E)){for(p.props=w,p.state=p.__s,p.__d=!1,p.__v=n,n.__e=null!=c?c!==r.__e?c:r.__e:null,n.__k=r.__k,d=0;d<n.__k.length;d++)n.__k[d]&&(n.__k[d].__p=n);break e}null!=p.componentWillUpdate&&p.componentWillUpdate(w,p.__s,E)}for(_=p.props,b=p.state,p.context=E,p.props=w,p.state=p.__s,(d=e.__r)&&d(n),p.__d=!1,p.__v=n,p.__P=t,d=p.render(p.props,p.state,p.context),n.__k=x(null!=d&&d.type==f&&null==d.key?d.props.children:d),null!=p.getChildContext&&(i=u(u({},i),p.getChildContext())),g||null==p.getSnapshotBeforeUpdate||(y=p.getSnapshotBeforeUpdate(_,b)),m(t,n,r,i,o,s,l,c,h),p.base=n.__e;d=p.__h.pop();)p.__s&&(p.state=p.__s),d.call(p);g||null==_||null==p.componentDidUpdate||p.componentDidUpdate(_,b,y),k&&(p.__E=p.__p=null)}else n.__e=R(r.__e,n,r,i,o,s,l,h);(d=e.diffed)&&d(n)}catch(t){e.__e(t,n,r)}return n.__e}function T(t,n){for(var r;r=t.pop();)try{r.componentDidMount()}catch(t){e.__e(t,r.__v)}e.__c&&e.__c(n)}function R(e,t,n,r,i,o,a,u){var c,h,d,f,p=n.props,v=t.props;if(i="svg"===t.type||i,null==e&&null!=o)for(c=0;c<o.length;c++)if(null!=(h=o[c])&&(null===t.type?3===h.nodeType:h.localName===t.type)){e=h,o[c]=null;break}if(null==e){if(null===t.type)return document.createTextNode(v);e=i?document.createElementNS("http://www.w3.org/2000/svg",t.type):document.createElement(t.type),o=null}return null===t.type?p!==v&&(null!=o&&(o[o.indexOf(e)]=null),e.data=v):t!==n&&(null!=o&&(o=l.slice.call(e.childNodes)),d=(p=n.props||s).dangerouslySetInnerHTML,f=v.dangerouslySetInnerHTML,u||(f||d)&&(f&&d&&f.__html==d.__html||(e.innerHTML=f&&f.__html||"")),k(e,v,p,i,u),t.__k=t.props.children,f||m(e,t,n,r,"foreignObject"!==t.type&&i,o,a,s,u),u||("value"in v&&void 0!==v.value&&v.value!==e.value&&(e.value=null==v.value?"":v.value),"checked"in v&&void 0!==v.checked&&v.checked!==e.checked&&(e.checked=v.checked))),e}function A(t,n,r){try{"function"==typeof t?t(n):t.current=n}catch(t){e.__e(t,r)}}function M(t,n,r){var i,o,s;if(e.unmount&&e.unmount(t),(i=t.ref)&&A(i,null,n),r||"function"==typeof t.type||(r=null!=(o=t.__e)),t.__e=t.l=null,null!=(i=t.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(t){e.__e(t,n)}i.base=i.__P=null}if(i=t.__k)for(s=0;s<i.length;s++)i[s]&&M(i[s],n,r);null!=o&&c(o)}function O(e,t,n){return this.constructor(e,n)}function I(t,n,r){var o,a,u;e.__p&&e.__p(t,n),a=(o=r===i)?null:r&&r.__k||n.__k,t=h(f,null,[t]),u=[],C(n,o?n.__k=t:(r||n).__k=t,a||s,s,void 0!==n.ownerSVGElement,r&&!o?[r]:a?null:l.slice.call(n.childNodes),u,!1,r||s,o),T(u,t)}function P(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function j(e,t,n){return t&&P(e.prototype,t),n&&P(e,n),e}function D(){return(D=Object.assign||function(e){for(var t=arguments,n=1;n<arguments.length;n++){var r=t[n];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e}).apply(this,arguments)}e={},v.prototype.setState=function(e,t){var n=this.__s!==this.state&&this.__s||(this.__s=u({},this.state));("function"!=typeof e||(e=e(n,this.props)))&&u(n,e),null!=e&&this.__v&&(this.u=!1,t&&this.__h.push(t),b(this))},v.prototype.forceUpdate=function(e){this.__v&&(e&&this.__h.push(e),this.u=!0,b(this))},v.prototype.render=f,t=[],n="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,r=e.debounceRendering,e.__e=function(e,t,n){for(var r;t=t.__p;)if((r=t.__c)&&!r.__p)try{if(r.constructor&&null!=r.constructor.getDerivedStateFromError)r.setState(r.constructor.getDerivedStateFromError(e));else{if(null==r.componentDidCatch)continue;r.componentDidCatch(e)}return b(r.__E=r)}catch(t){e=t}throw e},i=s,o=0;var H="[-\\+]?\\d+%?",N="[-\\+]?\\d*\\.\\d+%?",W="(?:"+N+")|(?:"+H+")",$="[\\s|\\(]+("+W+")[,|\\s]+("+W+")[,|\\s]+("+W+")\\s*\\)?",L="[\\s|\\(]+("+W+")[,|\\s]+("+W+")[,|\\s]+("+W+")[,|\\s]+("+W+")\\s*\\)?",z=new RegExp("rgb"+$),U=new RegExp("rgba"+L),B=new RegExp("hsl"+$),F=new RegExp("hsla"+L),q="^(?:#?|0x?)",V="([0-9a-fA-F]{1})",G="([0-9a-fA-F]{2})",K=new RegExp(q+V+V+V+"$"),X=new RegExp(q+V+V+V+V+"$"),Y=new RegExp(q+G+G+G+"$"),Z=new RegExp(q+G+G+G+G+"$"),J=2e3,Q=4e4,ee=Math.log,te=Math.round,ne=Math.floor;function re(e,t,n){return Math.min(Math.max(e,t),n)}function ie(e,t){var n=e.indexOf("%")>-1,r=parseFloat(e);return n?t/100*r:r}function oe(e){return parseInt(e,16)}function se(e){return e.toString(16).padStart(2,"0")}var le=function(){function e(e,t){this.$={h:0,s:0,v:0,a:1},e&&this.set(e),this.onChange=t,this.initialValue=D({},this.$)}var t=e.prototype;return t.set=function(t){if("string"==typeof t)/^(?:#?|0x?)[0-9a-fA-F]{3,8}$/.test(t)?this.hexString=t:/^rgba?/.test(t)?this.rgbString=t:/^hsla?/.test(t)&&(this.hslString=t);else{if("object"!=typeof t)throw new Error("Invalid color value");t instanceof e?this.hsva=t.hsva:"r"in t&&"g"in t&&"b"in t?this.rgb=t:"h"in t&&"s"in t&&"v"in t?this.hsv=t:"h"in t&&"s"in t&&"l"in t?this.hsl=t:"kelvin"in t&&(this.kelvin=t.kelvin)}},t.setChannel=function(e,t,n){var r;this[e]=D({},this[e],((r={})[t]=n,r))},t.reset=function(){this.hsva=this.initialValue},t.clone=function(){return new e(this)},t.unbind=function(){this.onChange=void 0},e.hsvToRgb=function(e){var t=e.h/60,n=e.s/100,r=e.v/100,i=ne(t),o=t-i,s=r*(1-n),l=r*(1-o*n),a=r*(1-(1-o)*n),u=i%6,c=[a,r,r,l,s,s][u],h=[s,s,a,r,r,l][u];return{r:re(255*[r,l,s,s,a,r][u],0,255),g:re(255*c,0,255),b:re(255*h,0,255)}},e.rgbToHsv=function(e){var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.max(t,n,r),o=Math.min(t,n,r),s=i-o,l=0,a=i,u=0===i?0:s/i;switch(i){case o:l=0;break;case t:l=(n-r)/s+(n<r?6:0);break;case n:l=(r-t)/s+2;break;case r:l=(t-n)/s+4}return{h:60*l%360,s:re(100*u,0,100),v:re(100*a,0,100)}},e.hsvToHsl=function(e){var t=e.s/100,n=e.v/100,r=(2-t)*n,i=r<=1?r:2-r,o=i<1e-9?0:t*n/i;return{h:e.h,s:re(100*o,0,100),l:re(50*r,0,100)}},e.hslToHsv=function(e){var t=2*e.l,n=e.s*(t<=100?t:200-t)/100,r=t+n<1e-9?0:2*n/(t+n);return{h:e.h,s:re(100*r,0,100),v:re((t+n)/2,0,100)}},e.kelvinToRgb=function(e){var t,n,r,i=e/100;return i<66?(t=255,n=-155.25485562709179-.44596950469579133*(n=i-2)+104.49216199393888*ee(n),r=i<20?0:.8274096064007395*(r=i-10)-254.76935184120902+115.67994401066147*ee(r)):(t=351.97690566805693+.114206453784165*(t=i-55)-40.25366309332127*ee(t),n=325.4494125711974+.07943456536662342*(n=i-50)-28.0852963507957*ee(n),r=255),{r:re(ne(t),0,255),g:re(ne(n),0,255),b:re(ne(r),0,255)}},e.rgbToKelvin=function(t){for(var n,r=t.r,i=t.b,o=J,s=Q;s-o>.4;){n=.5*(s+o);var l=e.kelvinToRgb(n);l.b/l.r>=i/r?s=n:o=n}return n},j(e,[{key:"hsv",get:function(){var e=this.$;return{h:e.h,s:e.s,v:e.v}},set:function(e){var t=this.$;if(e=D({},t,e),this.onChange){var n={h:!1,v:!1,s:!1,a:!1};for(var r in t)n[r]=e[r]!=t[r];this.$=e,(n.h||n.s||n.v||n.a)&&this.onChange(this,n)}else this.$=e}},{key:"hsva",get:function(){return D({},this.$)},set:function(e){this.hsv=e}},{key:"hue",get:function(){return this.$.h},set:function(e){this.hsv={h:e}}},{key:"saturation",get:function(){return this.$.s},set:function(e){this.hsv={s:e}}},{key:"value",get:function(){return this.$.v},set:function(e){this.hsv={v:e}}},{key:"alpha",get:function(){return this.$.a},set:function(e){this.hsv=D({},this.hsv,{a:e})}},{key:"kelvin",get:function(){return e.rgbToKelvin(this.rgb)},set:function(t){this.rgb=e.kelvinToRgb(t)}},{key:"red",get:function(){return this.rgb.r},set:function(e){this.rgb=D({},this.rgb,{r:e})}},{key:"green",get:function(){return this.rgb.g},set:function(e){this.rgb=D({},this.rgb,{g:e})}},{key:"blue",get:function(){return this.rgb.b},set:function(e){this.rgb=D({},this.rgb,{b:e})}},{key:"rgb",get:function(){var t=e.hsvToRgb(this.$),n=t.r,r=t.g,i=t.b;return{r:te(n),g:te(r),b:te(i)}},set:function(t){this.hsv=D({},e.rgbToHsv(t),{a:void 0===t.a?1:t.a})}},{key:"rgba",get:function(){return D({},this.rgb,{a:this.alpha})},set:function(e){this.rgb=e}},{key:"hsl",get:function(){var t=e.hsvToHsl(this.$),n=t.h,r=t.s,i=t.l;return{h:te(n),s:te(r),l:te(i)}},set:function(t){this.hsv=D({},e.hslToHsv(t),{a:void 0===t.a?1:t.a})}},{key:"hsla",get:function(){return D({},this.hsl,{a:this.alpha})},set:function(e){this.hsl=e}},{key:"rgbString",get:function(){var e=this.rgb;return"rgb("+e.r+", "+e.g+", "+e.b+")"},set:function(e){var t,n,r,i,o=1;if((t=z.exec(e))?(n=ie(t[1],255),r=ie(t[2],255),i=ie(t[3],255)):(t=U.exec(e))&&(n=ie(t[1],255),r=ie(t[2],255),i=ie(t[3],255),o=ie(t[4],1)),!t)throw new Error("Invalid rgb string");this.rgb={r:n,g:r,b:i,a:o}}},{key:"rgbaString",get:function(){var e=this.rgba;return"rgba("+e.r+", "+e.g+", "+e.b+", "+e.a+")"},set:function(e){this.rgbString=e}},{key:"hexString",get:function(){var e=this.rgb;return"#"+se(e.r)+se(e.g)+se(e.b)},set:function(e){var t,n,r,i,o=255;if((t=K.exec(e))?(n=17*oe(t[1]),r=17*oe(t[2]),i=17*oe(t[3])):(t=X.exec(e))?(n=17*oe(t[1]),r=17*oe(t[2]),i=17*oe(t[3]),o=17*oe(t[4])):(t=Y.exec(e))?(n=oe(t[1]),r=oe(t[2]),i=oe(t[3])):(t=Z.exec(e))&&(n=oe(t[1]),r=oe(t[2]),i=oe(t[3]),o=oe(t[4])),!t)throw new Error("Invalid hex string");this.rgb={r:n,g:r,b:i,a:o/255}}},{key:"hex8String",get:function(){var e=this.rgba;return"#"+se(e.r)+se(e.g)+se(e.b)+se(ne(255*e.a))},set:function(e){this.hexString=e}},{key:"hslString",get:function(){var e=this.hsl;return"hsl("+e.h+", "+e.s+"%, "+e.l+"%)"},set:function(e){var t,n,r,i,o=1;if((t=B.exec(e))?(n=ie(t[1],360),r=ie(t[2],100),i=ie(t[3],100)):(t=F.exec(e))&&(n=ie(t[1],360),r=ie(t[2],100),i=ie(t[3],100),o=ie(t[4],1)),!t)throw new Error("Invalid hsl string");this.hsl={h:n,s:r,l:i,a:o}}},{key:"hslaString",get:function(){var e=this.hsla;return"hsla("+e.h+", "+e.s+"%, "+e.l+"%, "+e.a+")"},set:function(e){this.hslString=e}}]),e}(),ae={sliderShape:"bar",sliderType:"value",minTemperature:2200,maxTemperature:11e3};function ue(e){var t,n=e.width,r=e.sliderSize,i=e.borderWidth,o=e.handleRadius,s=e.padding,l=e.sliderShape,a="horizontal"===e.layoutDirection;return r=null!=(t=r)?t:2*s+2*o,"circle"===l?{handleStart:e.padding+e.handleRadius,handleRange:n-2*s-2*o,width:n,height:n,cx:n/2,cy:n/2,radius:n/2-i/2}:{handleStart:r/2,handleRange:n-r,radius:r/2,x:0,y:0,width:a?r:n,height:a?n:r}}function ce(e,t){var n=t.hsva,r=t.rgb;switch(e.sliderType){case"red":return r.r/2.55;case"green":return r.g/2.55;case"blue":return r.b/2.55;case"alpha":return 100*n.a;case"kelvin":var i=e.minTemperature,o=e.maxTemperature-i,s=(t.kelvin-i)/o*100;return Math.max(0,Math.min(s,100));case"hue":return n.h/=3.6;case"saturation":return n.s;case"value":default:return n.v}}function he(e,t,n){var r,i=ue(e),o=i.handleRange,s=i.handleStart;r="horizontal"===e.layoutDirection?-1*n+o+s:t-s,r=Math.max(Math.min(r,o),0);var l=Math.round(100/o*r);switch(e.sliderType){case"kelvin":var a=e.minTemperature;return a+(e.maxTemperature-a)*(l/100);case"alpha":return l/100;case"hue":return 3.6*l;case"red":case"blue":case"green":return 2.55*l;default:return l}}function de(e,t){var n=ue(e),r=n.width,i=n.height,o=n.handleRange,s=n.handleStart,l="horizontal"===e.layoutDirection,a=l?r/2:i/2,u=s+ce(e,t)/100*o;return l&&(u=-1*u+o+2*s),{x:l?a:u,y:l?u:a}}function fe(e,t){var n=t.hsv,r=t.rgb;switch(e.sliderType){case"red":return[[0,"rgb(0,"+r.g+","+r.b+")"],[100,"rgb(255,"+r.g+","+r.b+")"]];case"green":return[[0,"rgb("+r.r+",0,"+r.b+")"],[100,"rgb("+r.r+",255,"+r.b+")"]];case"blue":return[[0,"rgb("+r.r+","+r.g+",0)"],[100,"rgb("+r.r+","+r.g+",255)"]];case"alpha":return[[0,"rgba("+r.r+","+r.g+","+r.b+",0)"],[100,"rgb("+r.r+","+r.g+","+r.b+")"]];case"kelvin":for(var i=[],o=e.minTemperature,s=e.maxTemperature,l=s-o,a=o,u=0;a<s;a+=l/8,u+=1){var c=le.kelvinToRgb(a),h=c.r,d=c.g,f=c.b;i.push([12.5*u,"rgb("+h+","+d+","+f+")"])}return i;case"hue":return[[0,"#f00"],[16.666,"#ff0"],[33.333,"#0f0"],[50,"#0ff"],[66.666,"#00f"],[83.333,"#f0f"],[100,"#f00"]];case"saturation":var p=le.hsvToHsl({h:n.h,s:0,v:n.v}),v=le.hsvToHsl({h:n.h,s:100,v:n.v});return[[0,"hsl("+p.h+","+p.s+"%,"+p.l+"%)"],[100,"hsl("+v.h+","+v.s+"%,"+v.l+"%)"]];case"value":default:var g=le.hsvToHsl({h:n.h,s:n.s,v:100});return[[0,"#000"],[100,"hsl("+g.h+","+g.s+"%,"+g.l+"%)"]]}}var pe,ve=2*Math.PI,ge=function(e,t){return(e%t+t)%t},_e=function(e,t){return Math.sqrt(e*e+t*t)};function be(e){return e.width/2-e.padding-e.handleRadius-e.borderWidth}function ye(e,t,n){var r=me(e),i=r.cx,o=r.cy,s=e.width/2;return _e(i-t,o-n)<s}function me(e){var t=e.width/2;return{width:e.width,radius:t-e.borderWidth,cx:t,cy:t}}function xe(e,t,n){var r=e.wheelAngle,i=e.wheelDirection;return n&&"clockwise"===i?t=r+t:"clockwise"===i?t=360-r+t:n&&"anticlockwise"===i?t=r+180-t:"anticlockwise"===i&&(t=r-t),ge(t,360)}function ke(e,t){var n=t.hsv,r=me(e),i=r.cx,o=r.cy,s=be(e),l=(180+xe(e,n.h,!0))*(ve/360),a=n.s/100*s,u="clockwise"===e.wheelDirection?-1:1;return{x:i+a*Math.cos(l)*u,y:o+a*Math.sin(l)*u}}function we(e,t,n){var r=me(e),i=r.cx,o=r.cy,s=be(e);t=i-t,n=o-n;var l=xe(e,Math.atan2(-n,-t)*(360/ve)),a=Math.min(_e(t,n),s);return{h:Math.round(l),s:Math.round(100/s*a)}}function Se(e){var t=e.width,n=e.boxHeight;return{width:t,height:null!=n?n:t,radius:e.padding+e.handleRadius}}function Ee(e,t,n){var r=Se(e),i=r.width,o=r.height,s=r.radius,l=(t-s)/(i-2*s)*100,a=(n-s)/(o-2*s)*100;return{s:Math.max(0,Math.min(l,100)),v:Math.max(0,Math.min(100-a,100))}}function Ce(e,t){var n=Se(e),r=n.width,i=n.height,o=n.radius,s=t.hsv,l=o,a=r-2*o,u=i-2*o;return{x:l+s.s/100*a,y:l+(u-s.v/100*u)}}function Te(e,t){return[[[0,"#fff"],[100,"hsl("+t.hue+",100%,50%)"]],[[0,"rgba(0,0,0,0)"],[100,"#000"]]]}function Re(e){pe||(pe=document.getElementsByTagName("base"));var t=window.navigator.userAgent,n=/^((?!chrome|android).)*safari/i.test(t),r=/iPhone|iPod|iPad/i.test(t),i=window.location;return(n||r)&&pe.length>0?i.protocol+"//"+i.host+i.pathname+i.search+e:e}function Ae(e,t,n,r){for(var i=0;i<r.length;i++){var o=r[i].x-t,s=r[i].y-n;if(Math.sqrt(o*o+s*s)<e.handleRadius)return i}return null}function Me(e){return{boxSizing:"border-box",border:e.borderWidth+"px solid "+e.borderColor}}function Oe(e,t,n){return e+"-gradient("+t+", "+n.map(function(e){var t=e[0];return e[1]+" "+t+"%"}).join(",")+")"}function Ie(e){return"string"==typeof e?e:e+"px"}var Pe={width:300,height:300,color:"#fff",colors:[],padding:6,layoutDirection:"vertical",borderColor:"#fff",borderWidth:0,handleRadius:8,activeHandleRadius:null,handleSvg:null,handleProps:{x:0,y:0},wheelLightness:!0,wheelAngle:0,wheelDirection:"anticlockwise",sliderSize:null,sliderMargin:12,boxHeight:null},je=["mousemove","touchmove","mouseup","touchend"],De=function(e){function t(t){e.call(this,t),this.uid=(Math.random()+1).toString(36).substring(5)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.render=function(e){var t=this.handleEvent.bind(this),n={onMouseDown:t,ontouchstart:t},r="horizontal"===e.layoutDirection,i=null===e.margin?e.sliderMargin:e.margin,o={overflow:"visible",display:r?"inline-block":"block"};return e.index>0&&(o[r?"marginLeft":"marginTop"]=i),h(f,null,e.children(this.uid,n,o))},t.prototype.handleEvent=function(e){var t=this,n=this.props.onInput,r=this.base.getBoundingClientRect();e.preventDefault();var i=e.touches?e.changedTouches[0]:e,o=i.clientX-r.left,s=i.clientY-r.top;switch(e.type){case"mousedown":case"touchstart":!1!==n(o,s,0)&&je.forEach(function(e){document.addEventListener(e,t,{passive:!1})});break;case"mousemove":case"touchmove":n(o,s,1);break;case"mouseup":case"touchend":n(o,s,2),je.forEach(function(e){document.removeEventListener(e,t,{passive:!1})})}},t}(v);function He(e){var t=e.r,n=e.url,r=t,i=t;return h("svg",{className:"IroHandle IroHandle--"+e.index+" "+(e.isActive?"IroHandle--isActive":""),style:{"-webkit-tap-highlight-color":"rgba(0, 0, 0, 0);",transform:"translate("+Ie(e.x)+", "+Ie(e.y)+")",willChange:"transform",top:Ie(-t),left:Ie(-t),width:Ie(2*t),height:Ie(2*t),position:"absolute",overflow:"visible"}},n&&h("use",Object.assign({xlinkHref:Re(n)},e.props)),!n&&h("circle",{cx:r,cy:i,r:t,fill:"none","stroke-width":2,stroke:"#000"}),!n&&h("circle",{cx:r,cy:i,r:t-2,fill:e.fill,"stroke-width":2,stroke:"#fff"}))}function Ne(e){var t=e.activeIndex,n=void 0!==t&&t<e.colors.length?e.colors[t]:e.color,r=ue(e),i=r.width,o=r.height,s=r.radius,l=de(e,n),a=fe(e,n);return h(De,Object.assign({},e,{onInput:function(t,r,i){var o=he(e,t,r);e.parent.inputActive=!0,n[e.sliderType]=o,e.onInput(i,e.id)}}),function(t,r,u){return h("div",Object.assign({},r,{className:"IroSlider",style:Object.assign({},{position:"relative",width:Ie(i),height:Ie(o),borderRadius:Ie(s),background:"conic-gradient(#ccc 25%, #fff 0 50%, #ccc 0 75%, #fff 0)",backgroundSize:"8px 8px"},u)}),h("div",{className:"IroSliderGradient",style:Object.assign({},{position:"absolute",top:0,left:0,width:"100%",height:"100%",borderRadius:Ie(s),background:Oe("linear","horizontal"===e.layoutDirection?"to top":"to right",a)},Me(e))}),h(He,{isActive:!0,index:n.index,r:e.handleRadius,url:e.handleSvg,props:e.handleProps,x:l.x,y:l.y}))})}function We(e){var t=Se(e),n=t.width,r=t.height,i=t.radius,o=e.colors,s=e.parent,l=e.activeIndex,a=void 0!==l&&l<e.colors.length?e.colors[l]:e.color,u=Te(e,a),c=o.map(function(t){return Ce(e,t)});return h(De,Object.assign({},e,{onInput:function(t,n,r){if(0===r){var i=Ae(e,t,n,c);null!==i?s.setActiveColor(i):(s.inputActive=!0,a.hsv=Ee(e,t,n),e.onInput(r,e.id))}else 1===r&&(s.inputActive=!0,a.hsv=Ee(e,t,n));e.onInput(r,e.id)}}),function(t,s,l){return h("div",Object.assign({},s,{className:"IroBox",style:Object.assign({},{width:Ie(n),height:Ie(r),position:"relative"},l)}),h("div",{className:"IroBox",style:Object.assign({},{width:"100%",height:"100%",borderRadius:Ie(i)},Me(e),{background:Oe("linear","to bottom",u[1])+","+Oe("linear","to right",u[0])})}),o.filter(function(e){return e!==a}).map(function(t){return h(He,{isActive:!1,index:t.index,fill:t.hslString,r:e.handleRadius,url:e.handleSvg,props:e.handleProps,x:c[t.index].x,y:c[t.index].y})}),h(He,{isActive:!0,index:a.index,fill:a.hslString,r:e.activeHandleRadius||e.handleRadius,url:e.handleSvg,props:e.handleProps,x:c[a.index].x,y:c[a.index].y}))})}He.defaultProps={fill:"none",x:0,y:0,r:8,url:null,props:{x:0,y:0}},Ne.defaultProps=Object.assign({},ae);var $e="conic-gradient(red, yellow, lime, aqua, blue, magenta, red)",Le="conic-gradient(red, magenta, blue, aqua, lime, yellow, red)";function ze(e){var t=me(e).width,n=e.colors,r=(e.borderWidth,e.parent),i=e.color,o=i.hsv,s=n.map(function(t){return ke(e,t)}),l={position:"absolute",top:0,left:0,width:"100%",height:"100%",borderRadius:"50%",boxSizing:"border-box"};return h(De,Object.assign({},e,{onInput:function(t,n,o){if(0===o){if(!ye(e,t,n))return!1;var l=Ae(e,t,n,s);null!==l?r.setActiveColor(l):(r.inputActive=!0,i.hsv=we(e,t,n),e.onInput(o,e.id))}else 1===o&&(r.inputActive=!0,i.hsv=we(e,t,n));e.onInput(o,e.id)}}),function(r,a,u){return h("div",Object.assign({},a,{className:"IroWheel",style:Object.assign({},{width:Ie(t),height:Ie(t),position:"relative"},u)}),h("div",{className:"IroWheelHue",style:Object.assign({},l,{transform:"rotateZ("+(e.wheelAngle+90)+"deg)",background:"clockwise"===e.wheelDirection?$e:Le})}),h("div",{className:"IroWheelSaturation",style:Object.assign({},l,{background:"radial-gradient(circle closest-side, #fff, transparent)"})}),e.wheelLightness&&h("div",{className:"IroWheelLightness",style:Object.assign({},l,{background:"#000",opacity:1-o.v/100})}),h("div",{className:"IroWheelBorder",style:Object.assign({},l,Me(e))}),n.filter(function(e){return e!==i}).map(function(t){return h(He,{isActive:!1,index:t.index,fill:t.hslString,r:e.handleRadius,url:e.handleSvg,props:e.handleProps,x:s[t.index].x,y:s[t.index].y})}),h(He,{isActive:!0,index:i.index,fill:i.hslString,r:e.activeHandleRadius||e.handleRadius,url:e.handleSvg,props:e.handleProps,x:s[i.index].x,y:s[i.index].y}))})}function Ue(e){var t=function(t,n){var r,i=document.createElement("div");function o(){var e=t instanceof Element?t:document.querySelector(t);e.appendChild(r.base),r.onMount(e)}return I(h(e,Object.assign({},{ref:function(e){return r=e}},n)),i),"loading"!==document.readyState?o():document.addEventListener("DOMContentLoaded",o),r};return t.prototype=e.prototype,Object.assign(t,e),t.__component=e,t}var Be=function(e){function t(t){var n=this;e.call(this,t),this.colors=[],this.inputActive=!1,this.events={},this.activeEvents={},this.deferredEvents={},this.id=t.id,(t.colors.length>0?t.colors:[t.color]).forEach(function(e){return n.addColor(e)}),this.setActiveColor(0),this.state=Object.assign({},t,{color:this.color,colors:this.colors,layout:t.layout})}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.addColor=function(e,t){void 0===t&&(t=this.colors.length);var n=new le(e,this.onColorChange.bind(this));this.colors.splice(t,0,n),this.colors.forEach(function(e,t){return e.index=t}),this.state&&this.setState({colors:this.colors}),this.deferredEmit("color:init",n)},t.prototype.removeColor=function(e){var t=this.colors.splice(e,1)[0];t.unbind(),this.colors.forEach(function(e,t){return e.index=t}),this.state&&this.setState({colors:this.colors}),t.index===this.color.index&&this.setActiveColor(0),this.emit("color:remove",t)},t.prototype.setActiveColor=function(e){this.color=this.colors[e],this.state&&this.setState({color:this.color}),this.emit("color:setActive",this.color)},t.prototype.setColors=function(e,t){var n=this;void 0===t&&(t=0),this.colors.forEach(function(e){return e.unbind()}),this.colors=[],e.forEach(function(e){return n.addColor(e)}),this.setActiveColor(t),this.emit("color:setAll",this.colors)},t.prototype.on=function(e,t){var n=this,r=this.events;(Array.isArray(e)?e:[e]).forEach(function(e){(r[e]||(r[e]=[])).push(t),n.deferredEvents[e]&&(n.deferredEvents[e].forEach(function(e){t.apply(null,e)}),n.deferredEvents[e]=[])})},t.prototype.off=function(e,t){var n=this;(Array.isArray(e)?e:[e]).forEach(function(e){var r=n.events[e];r&&r.splice(r.indexOf(t),1)})},t.prototype.emit=function(e){for(var t=this,n=[],r=arguments.length-1;r-- >0;)n[r]=arguments[r+1];var i=this.activeEvents;!!i.hasOwnProperty(e)&&i[e]||(i[e]=!0,(this.events[e]||[]).forEach(function(e){return e.apply(t,n)}),i[e]=!1)},t.prototype.deferredEmit=function(e){for(var t,n=[],r=arguments.length-1;r-- >0;)n[r]=arguments[r+1];var i=this.deferredEvents;(t=this).emit.apply(t,[e].concat(n)),(i[e]||(i[e]=[])).push(n)},t.prototype.setOptions=function(e){this.setState(e)},t.prototype.resize=function(e){this.setOptions({width:e})},t.prototype.reset=function(){this.colors.forEach(function(e){return e.reset()}),this.setState({colors:this.colors})},t.prototype.onMount=function(e){this.el=e,this.deferredEmit("mount",this)},t.prototype.onColorChange=function(e,t){this.setState({color:this.color}),this.inputActive&&(this.inputActive=!1,this.emit("input:change",e,t)),this.emit("color:change",e,t)},t.prototype.emitInputEvent=function(e,t){0===e?this.emit("input:start",this.color,t):1===e?this.emit("input:move",this.color,t):2===e&&this.emit("input:end",this.color,t)},t.prototype.render=function(e,t){var n=this,r=t.layout;return Array.isArray(r)||(r=[{component:ze},{component:Ne}],t.transparency&&r.push({component:Ne,options:{sliderType:"alpha"}})),h("div",{class:"IroColorPicker",id:t.id,style:{display:t.display}},r.map(function(e,r){var i=e.component,o=e.options;return h(i,Object.assign({},t,o,{ref:void 0,onInput:n.emitInputEvent.bind(n),parent:n,index:r}))}))},t}(v);Be.defaultProps=Object.assign({},Pe,{colors:[],display:"block",id:null,layout:"default",margin:null});var Fe,qe=Ue(Be);!function(e){e.version="5.5.2",e.Color=le,e.ColorPicker=qe,function(e){e.h=h,e.ComponentBase=De,e.Handle=He,e.Slider=Ne,e.Wheel=ze,e.Box=We}(e.ui||(e.ui={}))}(Fe||(Fe={}));var Ve=Fe,Ge=Ve;exports.default=Ge;
},{}],"YwQ1":[function(require,module,exports) {
"use strict";var t=n(require("@jaames/iro")),e=n(require("jquery"));function n(t){return t&&t.__esModule?t:{default:t}}function o(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=r(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var o=0,i=function(){};return{s:i,n:function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,c=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return s=t.done,t},e:function(t){c=!0,a=t},f:function(){try{s||null==n.return||n.return()}finally{if(c)throw a}}}}function r(t,e){if(t){if("string"==typeof t)return i(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(t,e):void 0}}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,o=new Array(e);n<e;n++)o[n]=t[n];return o}function a(t){if(t.startsWith("/")){var e=window.location;return("https:"===e.protocol?"wss:":"ws:")+"//"+e.host+t}var n=new URL(t);return"https:"===n.protocol?n.protocol="wss:":n.protocol="ws:",n.href}function s(t,e){var n=e(t);if(!1===n)return!1;for(t=t.firstChild;t;){if(!1===(n=s(t,e)))return!1;t=t.nextSibling}}function c(t,n){(0,e.default)(t).closest(".checkbox").checkbox();var o=this;this.subscribeIds=[parseInt(t.getAttribute("data-id"))];var r=t.getAttribute("data-confirm")?t.getAttribute("data-confirm").split(",").map(function(t){return parseInt(t)}):[],i=t.getAttribute("data-confirm-message");this.update=function(e,n){t.checked=e},t.addEventListener("change",function(t){if(-1!==r.indexOf(1*t.target.checked)){if(t.target.checked=!t.target.checked,!window.confirm(i||"Are you sure?"))return;t.target.checked=!t.target.checked}n(o.subscribeIds[0],t.target.checked)})}function u(t,n){var o=this,r=(0,e.default)(t).closest(".dropdown"),i=!1;r.dropdown({onChange:function(t,e,r){i||n(o.subscribeIds[0],JSON.parse(t))}}),this.subscribeIds=[parseInt(t.getAttribute("data-id"))],this.update=function(t,e){i=!0,r.dropdown("set selected",JSON.stringify(t)),i=!1}}function d(t,e){var n=parseInt(t.getAttribute("data-id")),r="True"===t.getAttribute("data-stateful"),i=t.getAttribute("data-confirm")?t.getAttribute("data-confirm").split(",").map(function(t){return parseInt(t)}):[],a=t.getAttribute("data-confirm-message"),s=t.getAttribute("data-on-class")?t.getAttribute("data-on-class").split(" "):[],c=t.getAttribute("data-off-class")?t.getAttribute("data-off-class").split(" "):[],u=!("false"==(t.getAttribute("data-send")||"")),d=!1;this.subscribeIds=[],r&&this.subscribeIds.push(n),this.update=function(e,n){d=e;var r,i=o(s);try{for(i.s();!(r=i.n()).done;){var a=r.value;t.classList.toggle(a,e)}}catch(b){i.e(b)}finally{i.f()}var u,l=o(c);try{for(l.s();!(u=l.n()).done;){var f=u.value;t.classList.toggle(f,!e)}}catch(b){l.e(b)}finally{l.f()}t.classList.remove("loading","active")},u&&t.addEventListener("click",function(o){var s=!d;(-1===i.indexOf(1*s)||window.confirm(a||"Are you sure?"))&&(e(n,s),r&&t.classList.add("active"))})}function l(t,e){this.subscribeIds=[parseInt(t.getAttribute("data-id"))],this.update=function(e,n){t.innerHTML=e}}function f(t,e){var n=parseInt(t.getAttribute("data-id"));this.subscribeIds=[n];var o=null,r=null,i=!1;function a(){i=!0,t.blur(),i=!1,t.value=o}this.update=function(e,n){o=e,document.activeElement!==t&&(t.value=e)},t.addEventListener("blur",function(o){i||e(n,t.value)}),t.addEventListener("keydown",function(e){if(clearTimeout(r),13===e.keyCode)return t.blur(),void e.preventDefault();27!==e.keyCode?r=setTimeout(a,8e3):a()}),t.addEventListener("mousedown",function(t){clearTimeout(r),r=setTimeout(a,8e3)})}function b(t,n){var o=parseInt(t.getAttribute("data-id"));this.subscribeIds=[o];var r=(0,e.default)(t),i=!1;r.slider({min:0,max:1e3,step:1,showLabelTicks:!0,labelDistance:200,interpretLabel:function(t){return t%250==0?Math.round(t/10).toString()+" %":""},onChange:function(){i||n(o,r.slider("get value")/1e3)}});var a=null;s(t.parentNode,function(t){if(1===t.nodeType&&t.classList.contains("value-display"))return a=t,!1}),this.update=function(t,e){i=!0,r.slider("set value",Math.round(1e3*t)),a.textContent=Math.round(100*t).toString()+" %",i=!1}}function p(e,n){var o=parseInt(e.getAttribute("data-id"));this.subscribeIds=[o];var r=new t.default.ColorPicker(e,{color:"#000"});r.on("input:end",function(t){n(o,[t.red,t.green,t.blue])}),this.update=function(t,e){r.color.rgb={r:t[0],g:t[1],b:t[2]}}}function g(t,n){var r=parseInt(t.getAttribute("data-id"));this.subscribeIds=[r];var i,a=o(t.parentNode.childNodes.values());try{for(a.s();!(i=a.n()).done;){var s=i.value;if(1===s.nodeType&&s.classList.contains("value-display")){s;break}}}catch(c){a.e(c)}finally{a.f()}this.update=function(n,o){n===t.classList.contains("hidden")&&(0,e.default)(t).transition("zoom "+(n?"in":"out"))}}WIDGET_TYPES.set("switch",c),WIDGET_TYPES.set("select",u),WIDGET_TYPES.set("button",d),WIDGET_TYPES.set("text-display",l),WIDGET_TYPES.set("text-input",f),WIDGET_TYPES.set("slider",b),WIDGET_TYPES.set("colorchoser",p),WIDGET_TYPES.set("hiderow",g),function(){var t,n=new Map,r=null,i=!1;function s(){console.info("Intializing Smart Home Connect web UI.");var s,l=o(document.querySelectorAll("[data-widget]"));try{for(l.s();!(s=l.n()).done;){var f,b=s.value,p=b.getAttribute("data-widget"),g=new(WIDGET_TYPES.get(p))(b,d),v=o(g.subscribeIds);try{for(v.s();!(f=v.n()).done;){var h=f.value;n.set(h,g)}}catch(m){v.e(m)}finally{v.f()}}}catch(m){l.e(m)}finally{l.f()}!function n(){console.info("Opening websocket ...");t=new WebSocket(a(shcRootURL+"/ws"));t.onopen=c;t.onmessage=u;t.onclose=function(t){console.info("Socket is closed. Reconnect will be attempted in 1 second.",t.reason),r||(r=(0,e.default)("body").toast({message:i?"Connection to websocket server failed ...":"Connection to SHC server lost ...",class:"error",showIcon:"exclamation circle",displayTime:0,closeOnClick:!1})),setTimeout(function(){n()},1e3)};t.onerror=function(e){console.error("Socket encountered error: ",e.message,"Closing socket"),t.close()}}()}function c(){r&&(r.toast("close"),r=null),console.info("Websocket opened. Subscribing widget values ..."),t.send(JSON.stringify({serverToken:shcServerToken}));var e,i=o(n.keys());try{for(i.s();!(e=i.n()).done;){var a=e.value;t.send(JSON.stringify({sub:!0,id:a}))}}catch(s){i.e(s)}finally{i.f()}}function u(t){console.debug("Received message "+t.data);var e=JSON.parse(t.data);e.reload?(console.debug("Reloading page, because server told us to do so."),location.reload()):e.id?(console.debug("Updating widget id "+e.id.toString()+" ..."),n.get(e.id).update(e.v,e.id)):console.error("Don't know how to handle websocket message ",e)}function d(n,o){console.debug("Writing new value "+JSON.stringify(o)+" for widget id "+n.toString());try{if(!t)throw"Websocket not available";if(t.readyState!==WebSocket.OPEN)throw"Websocket is not open.";t.send(JSON.stringify({id:n,v:o}))}catch(r){console.error("Error while sending value via websocket:",r),(0,e.default)("body").toast({message:"Error while sending value.",class:"warning",showIcon:"exclamation circle"})}}document.addEventListener("DOMContentLoaded",function(t){return s()})}(),(0,e.default)(function(){(0,e.default)(".main-menu .ui.dropdown").dropdown(),(0,e.default)(".ui.sidebar").sidebar({transition:"overlay"}).sidebar("attach events","#mobile_item"),(0,e.default)(".shc.image-container .with-popup>*").each(function(){(0,e.default)(this).popup({on:"click",popup:(0,e.default)(this).parent().attr("data-popup-id"),position:(0,e.default)(this).parent().attr("data-popup-position"),movePopup:!1,forcePosition:!0})})});
},{"@jaames/iro":"XJis","jquery":"juYr"}],"zTod":[function(require,module,exports) {
"use strict";function t(t,e,n){return e+" "+t+"px "+n}Object.defineProperty(exports,"__esModule",{value:!0}),exports.A=Re,exports.B=y,exports.C=Rn,exports.D=yn,exports.E=Yn,exports.F=n,exports.I=bn,exports.K=q,exports.L=p,exports.M=b,exports.N=Ye,exports.O=J,exports.Q=ce,exports.R=it,exports.S=le,exports.U=de,exports.V=ye,exports.W=xe,exports.X=Ie,exports._=Le,exports.a=Ce,exports.a0=_,exports.a1=C,exports.a4=Xe,exports.a5=He,exports.a6=$e,exports.a7=k,exports.a9=r,exports.aA=K,exports.aB=z,exports.aC=V,exports.aD=Q,exports.aE=G,exports.aF=fe,exports.aG=We,exports.aH=je,exports.aI=te,exports.aJ=w,exports.aK=M,exports.aL=O,exports.aM=T,exports.aN=ae,exports.aO=ln,exports.aP=pn,exports.aQ=vn,exports.aR=t,exports.aS=ke,exports.aY=nt,exports.aa=In,exports.ab=ue,exports.ad=m,exports.ae=tt,exports.af=Te,exports.ag=gn,exports.ah=Un,exports.ai=Qn,exports.aj=An,exports.ak=Fn,exports.al=jn,exports.am=ge,exports.an=be,exports.ao=he,exports.ap=ve,exports.aq=Pe,exports.ar=Se,exports.as=Zn,exports.at=rt,exports.au=Hn,exports.av=Xn,exports.ax=$n,exports.ay=a,exports.az=et,exports.b=l,exports.c=Gt,exports.f=I,exports.i=u,exports.j=f,exports.l=Ne,exports.n=Nn,exports.o=ot,exports.p=Z,exports.q=st,exports.t=U,exports.u=Be,exports.v=d,exports.x=Tn,exports.y=pe,exports.z=exports.w=exports.s=exports.r=exports.m=exports.k=exports.h=exports.g=exports.e=exports.d=exports.aw=exports.ac=exports.aX=exports.aW=exports.aV=exports.aU=exports.aT=exports.a8=exports.a3=exports.a2=exports.Z=exports.Y=exports.T=exports.P=exports.J=exports.H=exports.G=exports.$=void 0;const e="undefined"==typeof window?function(t){return t()}:window.requestAnimationFrame;function n(t,n,r){const o=r||(t=>Array.prototype.slice.call(t));let s=!1,i=[];return function(...r){i=o(r),s||(s=!0,e.call(window,()=>{s=!1,t.apply(n,i)}))}}function r(t,e){let n;return function(){return e?(clearTimeout(n),n=setTimeout(t,e)):t(),e}}exports.r=e;const o=t=>"start"===t?"left":"end"===t?"right":"center";exports.Y=o;const s=(t,e,n)=>"start"===t?e:"end"===t?n:(e+n)/2;exports.Z=s;const i=(t,e,n,r)=>{return t===(r?"left":"right")?n:"center"===t?(e+n)/2:e};function a(){}exports.aw=i;const c=function(){let t=0;return function(){return t++}}();function f(t){return null==t}function l(t){if(Array.isArray&&Array.isArray(t))return!0;const e=Object.prototype.toString.call(t);return"[object"===e.substr(0,7)&&"Array]"===e.substr(-6)}function u(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)}exports.a8=c;const h=t=>("number"==typeof t||t instanceof Number)&&isFinite(+t);function p(t,e){return h(t)?t:e}function d(t,e){return void 0===t?e:t}exports.g=h;const x=(t,e)=>"string"==typeof t&&t.endsWith("%")?parseFloat(t)/100:t/e;exports.k=x;const g=(t,e)=>"string"==typeof t&&t.endsWith("%")?parseFloat(t)/100*e:+t;function b(t,e,n){if(t&&"function"==typeof t.call)return t.apply(n,e)}function y(t,e,n,r){let o,s,i;if(l(t))if(s=t.length,r)for(o=s-1;o>=0;o--)e.call(n,t[o],o);else for(o=0;o<s;o++)e.call(n,t[o],o);else if(u(t))for(s=(i=Object.keys(t)).length,o=0;o<s;o++)e.call(n,t[i[o]],i[o])}function m(t,e){let n,r,o,s;if(!t||!e||t.length!==e.length)return!1;for(n=0,r=t.length;n<r;++n)if(o=t[n],s=e[n],o.datasetIndex!==s.datasetIndex||o.index!==s.index)return!1;return!0}function w(t){if(l(t))return t.map(w);if(u(t)){const e=Object.create(null),n=Object.keys(t),r=n.length;let o=0;for(;o<r;++o)e[n[o]]=w(t[n[o]]);return e}return t}function v(t){return-1===["__proto__","prototype","constructor"].indexOf(t)}function M(t,e,n,r){if(!v(t))return;const o=e[t],s=n[t];u(o)&&u(s)?_(o,s,r):e[t]=w(s)}function _(t,e,n){const r=l(e)?e:[e],o=r.length;if(!u(t))return t;const s=(n=n||{}).merger||M;for(let i=0;i<o;++i){if(!u(e=r[i]))continue;const o=Object.keys(e);for(let r=0,i=o.length;r<i;++r)s(o[r],t,e,n)}return t}function k(t,e){return _(t,e,{merger:O})}function O(t,e,n){if(!v(t))return;const r=e[t],o=n[t];u(r)&&u(o)?k(r,o):Object.prototype.hasOwnProperty.call(e,t)||(e[t]=w(o))}function T(t,e,n,r){void 0!==e&&console.warn(t+': "'+n+'" is deprecated. Please use "'+r+'" instead')}exports.m=g;const P="",S=".";function R(t,e){const n=t.indexOf(S,e);return-1===n?t.length:n}function I(t,e){if(e===P)return t;let n=0,r=R(e,n);for(;t&&r>n;)t=t[e.substr(n,r-n)],r=R(e,n=r+1);return t}function C(t){return t.charAt(0).toUpperCase()+t.slice(1)}const Y=t=>void 0!==t;exports.h=Y;const j=t=>"function"==typeof t;exports.a3=j;const A=(t,e)=>{if(t.size!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;return!0};exports.ac=A;const F=Math.PI;exports.P=F;const W=2*F;exports.T=W;const E=W+F;exports.aT=E;const N=Number.POSITIVE_INFINITY;exports.aU=N;const B=F/180;exports.aV=B;const L=F/2;exports.H=L;const H=F/4;exports.aW=H;const X=2*F/3;exports.aX=X;const $=Math.log10;exports.J=$;const D=Math.sign;function z(t){const e=Math.round(t);t=Q(t,e,t/1e3)?e:t;const n=Math.pow(10,Math.floor($(t))),r=t/n;return(r<=1?1:r<=2?2:r<=5?5:10)*n}function q(t){const e=[],n=Math.sqrt(t);let r;for(r=1;r<n;r++)t%r==0&&(e.push(r),e.push(t/r));return n===(0|n)&&e.push(n),e.sort((t,e)=>t-e).pop(),e}function Z(t){return!isNaN(parseFloat(t))&&isFinite(t)}function Q(t,e,n){return Math.abs(t-e)<n}function V(t,e){const n=Math.round(t);return n-e<=t&&n+e>=t}function K(t,e,n){let r,o,s;for(r=0,o=t.length;r<o;r++)s=t[r][n],isNaN(s)||(e.min=Math.min(e.min,s),e.max=Math.max(e.max,s))}function U(t){return t*(F/180)}function J(t){return t*(180/F)}function G(t){if(!h(t))return;let e=1,n=0;for(;Math.round(t*e)/e!==t;)e*=10,n++;return n}function tt(t,e){const n=e.x-t.x,r=e.y-t.y,o=Math.sqrt(n*n+r*r);let s=Math.atan2(r,n);return s<-.5*F&&(s+=W),{angle:s,distance:o}}function et(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function nt(t,e){return(t-e+E)%W-F}function rt(t){return(t%W+W)%W}function ot(t,e,n,r){const o=rt(t),s=rt(e),i=rt(n),a=rt(s-o),c=rt(i-o),f=rt(o-s),l=rt(o-i);return o===s||o===i||r&&s===i||a>c&&f<l}function st(t,e,n){return Math.max(e,Math.min(n,t))}function it(t){return st(t,-32768,32767)}exports.s=D;const at=t=>0===t||1===t,ct=(t,e,n)=>-Math.pow(2,10*(t-=1))*Math.sin((t-e)*W/n),ft=(t,e,n)=>Math.pow(2,-10*t)*Math.sin((t-e)*W/n)+1,lt={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>1-Math.cos(t*L),easeOutSine:t=>Math.sin(t*L),easeInOutSine:t=>-.5*(Math.cos(F*t)-1),easeInExpo:t=>0===t?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>1===t?1:1-Math.pow(2,-10*t),easeInOutExpo:t=>at(t)?t:t<.5?.5*Math.pow(2,10*(2*t-1)):.5*(2-Math.pow(2,-10*(2*t-1))),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>at(t)?t:ct(t,.075,.3),easeOutElastic:t=>at(t)?t:ft(t,.075,.3),easeInOutElastic:t=>at(t)?t:t<.5?.5*ct(2*t,.1125,.45):.5+.5*ft(2*t-1,.1125,.45),easeInBack(t){const e=1.70158;return t*t*((e+1)*t-e)},easeOutBack(t){const e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},easeInOutBack(t){let e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},easeInBounce:t=>1-lt.easeOutBounce(1-t),easeOutBounce(t){const e=7.5625,n=2.75;return t<1/n?e*t*t:t<2/n?e*(t-=1.5/n)*t+.75:t<2.5/n?e*(t-=2.25/n)*t+.9375:e*(t-=2.625/n)*t+.984375},easeInOutBounce:t=>t<.5?.5*lt.easeInBounce(2*t):.5*lt.easeOutBounce(2*t-1)+.5};exports.e=lt;const ut={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},ht="0123456789ABCDEF",pt=t=>ht[15&t],dt=t=>ht[(240&t)>>4]+ht[15&t],xt=t=>(240&t)>>4==(15&t);function gt(t){return xt(t.r)&&xt(t.g)&&xt(t.b)&&xt(t.a)}function bt(t){var e,n=t.length;return"#"===t[0]&&(4===n||5===n?e={r:255&17*ut[t[1]],g:255&17*ut[t[2]],b:255&17*ut[t[3]],a:5===n?17*ut[t[4]]:255}:7!==n&&9!==n||(e={r:ut[t[1]]<<4|ut[t[2]],g:ut[t[3]]<<4|ut[t[4]],b:ut[t[5]]<<4|ut[t[6]],a:9===n?ut[t[7]]<<4|ut[t[8]]:255})),e}function yt(t){var e=gt(t)?pt:dt;return t?"#"+e(t.r)+e(t.g)+e(t.b)+(t.a<255?e(t.a):""):t}function mt(t){return t+.5|0}const wt=(t,e,n)=>Math.max(Math.min(t,n),e);function vt(t){return wt(mt(2.55*t),0,255)}function Mt(t){return wt(mt(255*t),0,255)}function _t(t){return wt(mt(t/2.55)/100,0,1)}function kt(t){return wt(mt(100*t),0,100)}const Ot=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function Tt(t){const e=Ot.exec(t);let n,r,o,s=255;if(e){if(e[7]!==n){const t=+e[7];s=255&(e[8]?vt(t):255*t)}return n=+e[1],r=+e[3],o=+e[5],{r:n=255&(e[2]?vt(n):n),g:r=255&(e[4]?vt(r):r),b:o=255&(e[6]?vt(o):o),a:s}}}function Pt(t){return t&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${_t(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`)}const St=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Rt(t,e,n){const r=e*Math.min(n,1-n),o=(e,o=(e+t/30)%12)=>n-r*Math.max(Math.min(o-3,9-o,1),-1);return[o(0),o(8),o(4)]}function It(t,e,n){const r=(r,o=(r+t/60)%6)=>n-n*e*Math.max(Math.min(o,4-o,1),0);return[r(5),r(3),r(1)]}function Ct(t,e,n){const r=Rt(t,1,.5);let o;for(e+n>1&&(e*=o=1/(e+n),n*=o),o=0;o<3;o++)r[o]*=1-e-n,r[o]+=e;return r}function Yt(t){const e=t.r/255,n=t.g/255,r=t.b/255,o=Math.max(e,n,r),s=Math.min(e,n,r),i=(o+s)/2;let a,c,f;return o!==s&&(f=o-s,c=i>.5?f/(2-o-s):f/(o+s),a=60*(a=o===e?(n-r)/f+(n<r?6:0):o===n?(r-e)/f+2:(e-n)/f+4)+.5),[0|a,c||0,i]}function jt(t,e,n,r){return(Array.isArray(e)?t(e[0],e[1],e[2]):t(e,n,r)).map(Mt)}function At(t,e,n){return jt(Rt,t,e,n)}function Ft(t,e,n){return jt(Ct,t,e,n)}function Wt(t,e,n){return jt(It,t,e,n)}function Et(t){return(t%360+360)%360}function Nt(t){const e=St.exec(t);let n,r=255;if(!e)return;e[5]!==n&&(r=e[6]?vt(+e[5]):Mt(+e[5]));const o=Et(+e[2]),s=+e[3]/100,i=+e[4]/100;return{r:(n="hwb"===e[1]?Ft(o,s,i):"hsv"===e[1]?Wt(o,s,i):At(o,s,i))[0],g:n[1],b:n[2],a:r}}function Bt(t,e){var n=Yt(t);n[0]=Et(n[0]+e),n=At(n),t.r=n[0],t.g=n[1],t.b=n[2]}function Lt(t){if(!t)return;const e=Yt(t),n=e[0],r=kt(e[1]),o=kt(e[2]);return t.a<255?`hsla(${n}, ${r}%, ${o}%, ${_t(t.a)})`:`hsl(${n}, ${r}%, ${o}%)`}const Ht={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},Xt={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function $t(){const t={},e=Object.keys(Xt),n=Object.keys(Ht);let r,o,s,i,a;for(r=0;r<e.length;r++){for(i=a=e[r],o=0;o<n.length;o++)s=n[o],a=a.replace(s,Ht[s]);s=parseInt(Xt[i],16),t[a]=[s>>16&255,s>>8&255,255&s]}return t}let Dt;function zt(t){Dt||((Dt=$t()).transparent=[0,0,0,0]);const e=Dt[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:4===e.length?e[3]:255}}function qt(t,e,n){if(t){let r=Yt(t);r[e]=Math.max(0,Math.min(r[e]+r[e]*n,0===e?360:1)),r=At(r),t.r=r[0],t.g=r[1],t.b=r[2]}}function Zt(t,e){return t?Object.assign(e||{},t):t}function Qt(t){var e={r:0,g:0,b:0,a:255};return Array.isArray(t)?t.length>=3&&(e={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(e.a=Mt(t[3]))):(e=Zt(t,{r:0,g:0,b:0,a:1})).a=Mt(e.a),e}function Vt(t){return"r"===t.charAt(0)?Tt(t):Nt(t)}class Kt{constructor(t){if(t instanceof Kt)return t;const e=typeof t;let n;"object"===e?n=Qt(t):"string"===e&&(n=bt(t)||zt(t)||Vt(t)),this._rgb=n,this._valid=!!n}get valid(){return this._valid}get rgb(){var t=Zt(this._rgb);return t&&(t.a=_t(t.a)),t}set rgb(t){this._rgb=Qt(t)}rgbString(){return this._valid?Pt(this._rgb):this._rgb}hexString(){return this._valid?yt(this._rgb):this._rgb}hslString(){return this._valid?Lt(this._rgb):this._rgb}mix(t,e){const n=this;if(t){const r=n.rgb,o=t.rgb;let s;const i=e===s?.5:e,a=2*i-1,c=r.a-o.a,f=((a*c==-1?a:(a+c)/(1+a*c))+1)/2;s=1-f,r.r=255&f*r.r+s*o.r+.5,r.g=255&f*r.g+s*o.g+.5,r.b=255&f*r.b+s*o.b+.5,r.a=i*r.a+(1-i)*o.a,n.rgb=r}return n}clone(){return new Kt(this.rgb)}alpha(t){return this._rgb.a=Mt(t),this}clearer(t){return this._rgb.a*=1-t,this}greyscale(){const t=this._rgb,e=mt(.3*t.r+.59*t.g+.11*t.b);return t.r=t.g=t.b=e,this}opaquer(t){return this._rgb.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return qt(this._rgb,2,t),this}darken(t){return qt(this._rgb,2,-t),this}saturate(t){return qt(this._rgb,1,t),this}desaturate(t){return qt(this._rgb,1,-t),this}rotate(t){return Bt(this._rgb,t),this}}function Ut(t){return new Kt(t)}const Jt=t=>t instanceof CanvasGradient||t instanceof CanvasPattern;function Gt(t){return Jt(t)?t:Ut(t)}function te(t){return Jt(t)?t:Ut(t).saturate(.5).darken(.1).hexString()}const ee=Object.create(null);exports.$=ee;const ne=Object.create(null);function re(t,e){if(!e)return t;const n=e.split(".");for(let r=0,o=n.length;r<o;++r){const e=n[r];t=t[e]||(t[e]=Object.create(null))}return t}function oe(t,e,n){return"string"==typeof e?_(re(t,e),n):_(re(t,""),e)}exports.a2=ne;class se{constructor(t){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=(t=>t.chart.platform.getDevicePixelRatio()),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=((t,e)=>te(e.backgroundColor)),this.hoverBorderColor=((t,e)=>te(e.borderColor)),this.hoverColor=((t,e)=>te(e.color)),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.describe(t)}set(t,e){return oe(this,t,e)}get(t){return re(this,t)}describe(t,e){return oe(ne,t,e)}override(t,e){return oe(ee,t,e)}route(t,e,n,r){const o=re(this,t),s=re(this,n),i="_"+e;Object.defineProperties(o,{[i]:{value:o[e],writable:!0},[e]:{enumerable:!0,get(){const t=this[i],e=s[r];return u(t)?Object.assign({},e,t):d(t,e)},set(t){this[i]=t}}})}}var ie=new se({_scriptable:t=>!t.startsWith("on"),_indexable:t=>"events"!==t,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}});function ae(t){return!t||f(t.size)||f(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}function ce(t,e,n,r,o){let s=e[o];return s||(s=e[o]=t.measureText(o).width,n.push(o)),s>r&&(r=s),r}function fe(t,e,n,r){let o=(r=r||{}).data=r.data||{},s=r.garbageCollect=r.garbageCollect||[];r.font!==e&&(o=r.data={},s=r.garbageCollect=[],r.font=e),t.save(),t.font=e;let i=0;const a=n.length;let c,f,u,h,p;for(c=0;c<a;c++)if(null!=(h=n[c])&&!0!==l(h))i=ce(t,o,s,i,h);else if(l(h))for(f=0,u=h.length;f<u;f++)null==(p=h[f])||l(p)||(i=ce(t,o,s,i,p));t.restore();const d=s.length/2;if(d>n.length){for(c=0;c<d;c++)delete o[s[c]];s.splice(0,d)}return i}function le(t,e,n){const r=t.currentDevicePixelRatio,o=0!==n?Math.max(n/2,.5):0;return Math.round((e-o)*r)/r+o}function ue(t,e){(e=e||t.getContext("2d")).save(),e.resetTransform(),e.clearRect(0,0,t.width,t.height),e.restore()}function he(t,e,n,r){let o,s,i,a,c;const f=e.pointStyle,l=e.rotation,u=e.radius;let h=(l||0)*B;if(f&&"object"==typeof f&&("[object HTMLImageElement]"===(o=f.toString())||"[object HTMLCanvasElement]"===o))return t.save(),t.translate(n,r),t.rotate(h),t.drawImage(f,-f.width/2,-f.height/2,f.width,f.height),void t.restore();if(!(isNaN(u)||u<=0)){switch(t.beginPath(),f){default:t.arc(n,r,u,0,W),t.closePath();break;case"triangle":t.moveTo(n+Math.sin(h)*u,r-Math.cos(h)*u),h+=X,t.lineTo(n+Math.sin(h)*u,r-Math.cos(h)*u),h+=X,t.lineTo(n+Math.sin(h)*u,r-Math.cos(h)*u),t.closePath();break;case"rectRounded":a=u-(c=.516*u),s=Math.cos(h+H)*a,i=Math.sin(h+H)*a,t.arc(n-s,r-i,c,h-F,h-L),t.arc(n+i,r-s,c,h-L,h),t.arc(n+s,r+i,c,h,h+L),t.arc(n-i,r+s,c,h+L,h+F),t.closePath();break;case"rect":if(!l){a=Math.SQRT1_2*u,t.rect(n-a,r-a,2*a,2*a);break}h+=H;case"rectRot":s=Math.cos(h)*u,i=Math.sin(h)*u,t.moveTo(n-s,r-i),t.lineTo(n+i,r-s),t.lineTo(n+s,r+i),t.lineTo(n-i,r+s),t.closePath();break;case"crossRot":h+=H;case"cross":s=Math.cos(h)*u,i=Math.sin(h)*u,t.moveTo(n-s,r-i),t.lineTo(n+s,r+i),t.moveTo(n+i,r-s),t.lineTo(n-i,r+s);break;case"star":s=Math.cos(h)*u,i=Math.sin(h)*u,t.moveTo(n-s,r-i),t.lineTo(n+s,r+i),t.moveTo(n+i,r-s),t.lineTo(n-i,r+s),h+=H,s=Math.cos(h)*u,i=Math.sin(h)*u,t.moveTo(n-s,r-i),t.lineTo(n+s,r+i),t.moveTo(n+i,r-s),t.lineTo(n-i,r+s);break;case"line":s=Math.cos(h)*u,i=Math.sin(h)*u,t.moveTo(n-s,r-i),t.lineTo(n+s,r+i);break;case"dash":t.moveTo(n,r),t.lineTo(n+Math.cos(h)*u,r+Math.sin(h)*u)}t.fill(),e.borderWidth>0&&t.stroke()}}function pe(t,e,n){return n=n||.5,!e||t&&t.x>e.left-n&&t.x<e.right+n&&t.y>e.top-n&&t.y<e.bottom+n}function de(t,e){t.save(),t.beginPath(),t.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),t.clip()}function xe(t){t.restore()}function ge(t,e,n,r,o){if(!e)return t.lineTo(n.x,n.y);if("middle"===o){const r=(e.x+n.x)/2;t.lineTo(r,e.y),t.lineTo(r,n.y)}else"after"===o!=!!r?t.lineTo(e.x,n.y):t.lineTo(n.x,e.y);t.lineTo(n.x,n.y)}function be(t,e,n,r){if(!e)return t.lineTo(n.x,n.y);t.bezierCurveTo(r?e.cp1x:e.cp2x,r?e.cp1y:e.cp2y,r?n.cp2x:n.cp1x,r?n.cp2y:n.cp1y,n.x,n.y)}function ye(t,e,n,r,o,s={}){const i=l(e)?e:[e],a=s.strokeWidth>0&&""!==s.strokeColor;let c,u;for(t.save(),t.font=o.string,me(t,s),c=0;c<i.length;++c)u=i[c],a&&(s.strokeColor&&(t.strokeStyle=s.strokeColor),f(s.strokeWidth)||(t.lineWidth=s.strokeWidth),t.strokeText(u,n,r,s.maxWidth)),t.fillText(u,n,r,s.maxWidth),we(t,n,r,u,s),r+=o.lineHeight;t.restore()}function me(t,e){e.translation&&t.translate(e.translation[0],e.translation[1]),f(e.rotation)||t.rotate(e.rotation),e.color&&(t.fillStyle=e.color),e.textAlign&&(t.textAlign=e.textAlign),e.textBaseline&&(t.textBaseline=e.textBaseline)}function we(t,e,n,r,o){if(o.strikethrough||o.underline){const s=t.measureText(r),i=e-s.actualBoundingBoxLeft,a=e+s.actualBoundingBoxRight,c=n-s.actualBoundingBoxAscent,f=n+s.actualBoundingBoxDescent,l=o.strikethrough?(c+f)/2:f;t.strokeStyle=t.fillStyle,t.beginPath(),t.lineWidth=o.decorationWidth||2,t.moveTo(i,l),t.lineTo(a,l),t.stroke()}}function ve(t,e){const{x:n,y:r,w:o,h:s,radius:i}=e;t.arc(n+i.topLeft,r+i.topLeft,i.topLeft,-L,F,!0),t.lineTo(n,r+s-i.bottomLeft),t.arc(n+i.bottomLeft,r+s-i.bottomLeft,i.bottomLeft,F,L,!0),t.lineTo(n+o-i.bottomRight,r+s),t.arc(n+o-i.bottomRight,r+s-i.bottomRight,i.bottomRight,L,0,!0),t.lineTo(n+o,r+i.topRight),t.arc(n+o-i.topRight,r+i.topRight,i.topRight,0,-L,!0),t.lineTo(n+i.topLeft,r)}exports.d=ie;const Me=new RegExp(/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/),_e=new RegExp(/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/);function ke(t,e){const n=(""+t).match(Me);if(!n||"normal"===n[1])return 1.2*e;switch(t=+n[2],n[3]){case"px":return t;case"%":t/=100}return e*t}const Oe=t=>+t||0;function Te(t,e){const n={},r=u(e),o=r?Object.keys(e):e,s=u(t)?r?n=>d(t[n],t[e[n]]):e=>t[e]:()=>t;for(const i of o)n[i]=Oe(s(i));return n}function Pe(t){return Te(t,{top:"y",right:"x",bottom:"y",left:"x"})}function Se(t){return Te(t,["topLeft","topRight","bottomLeft","bottomRight"])}function Re(t){const e=Pe(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function Ie(t,e){t=t||{},e=e||ie.font;let n=d(t.size,e.size);"string"==typeof n&&(n=parseInt(n,10));let r=d(t.style,e.style);r&&!(""+r).match(_e)&&(console.warn('Invalid font style specified: "'+r+'"'),r="");const o={family:d(t.family,e.family),lineHeight:ke(d(t.lineHeight,e.lineHeight),n),size:n,style:r,weight:d(t.weight,e.weight),string:""};return o.string=ae(o),o}function Ce(t,e,n,r){let o,s,i,a=!0;for(o=0,s=t.length;o<s;++o)if(void 0!==(i=t[o])&&(void 0!==e&&"function"==typeof i&&(i=i(e),a=!1),void 0!==n&&l(i)&&(i=i[n%i.length],a=!1),void 0!==i))return r&&!a&&(r.cacheable=!1),i}function Ye(t,e){const{min:n,max:r}=t;return{min:n-Math.abs(g(e,n)),max:r+g(e,r)}}function je(t,e,n){n=n||(n=>t[n]<e);let r,o=t.length-1,s=0;for(;o-s>1;)n(r=s+o>>1)?s=r:o=r;return{lo:s,hi:o}}const Ae=(t,e,n)=>je(t,n,r=>t[r][e]<n);exports.w=Ae;const Fe=(t,e,n)=>je(t,n,r=>t[r][e]>=n);function We(t,e,n){let r=0,o=t.length;for(;r<o&&t[r]<e;)r++;for(;o>r&&t[o-1]>n;)o--;return r>0||o<t.length?t.slice(r,o):t}exports.z=Fe;const Ee=["push","pop","shift","splice","unshift"];function Ne(t,e){t._chartjs?t._chartjs.listeners.push(e):(Object.defineProperty(t,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),Ee.forEach(e=>{const n="_onData"+C(e),r=t[e];Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value(...e){const o=r.apply(this,e);return t._chartjs.listeners.forEach(t=>{"function"==typeof t[n]&&t[n](...e)}),o}})}))}function Be(t,e){const n=t._chartjs;if(!n)return;const r=n.listeners,o=r.indexOf(e);-1!==o&&r.splice(o,1),r.length>0||(Ee.forEach(e=>{delete t[e]}),delete t._chartjs)}function Le(t){const e=new Set;let n,r;for(n=0,r=t.length;n<r;++n)e.add(t[n]);return e.size===r?t:Array.from(e)}function He(t,e=[""],n=t,r,o=(()=>t[0])){return Y(r)||(r=rn("_fallback",t)),new Proxy({[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:n,_fallback:r,_getTarget:o,override:o=>He([o,...t],e,n,r)},{deleteProperty:(e,n)=>(delete e[n],delete e._keys,delete t[0][n],!0),get:(n,r)=>qe(n,r,()=>nn(r,e,t,n)),getOwnPropertyDescriptor:(t,e)=>Reflect.getOwnPropertyDescriptor(t._scopes[0],e),getPrototypeOf:()=>Reflect.getPrototypeOf(t[0]),has:(t,e)=>on(t).includes(e),ownKeys:t=>on(t),set:(t,e,n)=>((t._storage||(t._storage=o()))[e]=n,delete t[e],delete t._keys,!0)})}function Xe(t,e,n,r){const o={_cacheable:!1,_proxy:t,_context:e,_subProxy:n,_stack:new Set,_descriptors:$e(t,r),setContext:e=>Xe(t,e,n,r),override:o=>Xe(t.override(o),e,n,r)};return new Proxy(o,{deleteProperty:(e,n)=>(delete e[n],delete t[n],!0),get:(t,e,n)=>qe(t,e,()=>Ze(t,e,n)),getOwnPropertyDescriptor:(e,n)=>e._descriptors.allKeys?Reflect.has(t,n)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,n),getPrototypeOf:()=>Reflect.getPrototypeOf(t),has:(e,n)=>Reflect.has(t,n),ownKeys:()=>Reflect.ownKeys(t),set:(e,n,r)=>(t[n]=r,delete e[n],!0)})}function $e(t,e={scriptable:!0,indexable:!0}){const{_scriptable:n=e.scriptable,_indexable:r=e.indexable,_allKeys:o=e.allKeys}=t;return{allKeys:o,scriptable:n,indexable:r,isScriptable:j(n)?n:()=>n,isIndexable:j(r)?r:()=>r}}const De=(t,e)=>t?t+C(e):e,ze=(t,e)=>u(e)&&"adapters"!==t;function qe(t,e,n){let r=t[e];return Y(r)?r:(r=n(),Y(r)&&(t[e]=r),r)}function Ze(t,e,n){const{_proxy:r,_context:o,_subProxy:s,_descriptors:i}=t;let a=r[e];return j(a)&&i.isScriptable(e)&&(a=Qe(e,a,t,n)),l(a)&&a.length&&(a=Ve(e,a,t,i.isIndexable)),ze(e,a)&&(a=Xe(a,o,s&&s[e],i)),a}function Qe(t,e,n,r){const{_proxy:o,_context:s,_subProxy:i,_stack:a}=n;if(a.has(t))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+t);return a.add(t),e=e(s,i||r),a.delete(t),u(e)&&(e=Ge(o._scopes,o,t,e)),e}function Ve(t,e,n,r){const{_proxy:o,_context:s,_subProxy:i,_descriptors:a}=n;if(Y(s.index)&&r(t))e=e[s.index%e.length];else if(u(e[0])){const n=e,r=o._scopes.filter(t=>t!==n);e=[];for(const c of n){const n=Ge(r,o,t,c);e.push(Xe(n,s,i&&i[t],a))}}return e}function Ke(t,e,n){return j(t)?t(e,n):t}const Ue=(t,e)=>!0===t?e:"string"==typeof t?I(e,t):void 0;function Je(t,e,n,r){for(const o of e){const e=Ue(n,o);if(e){t.add(e);const o=Ke(e._fallback,n,e);if(Y(o)&&o!==n&&o!==r)return o}else if(!1===e&&Y(r)&&n!==r)return null}return!1}function Ge(t,e,n,r){const o=e._rootScopes,s=Ke(e._fallback,n,r),i=[...t,...o],a=new Set;a.add(r);let c=tn(a,i,n,s||n);return null!==c&&((!Y(s)||s===n||null!==(c=tn(a,i,s,c)))&&He(Array.from(a),[""],o,s,()=>en(e,n,r)))}function tn(t,e,n,r){for(;n;)n=Je(t,e,n,r);return n}function en(t,e,n){const r=t._getTarget();e in r||(r[e]={});const o=r[e];return l(o)&&u(n)?n:o}function nn(t,e,n,r){let o;for(const s of e)if(o=rn(De(s,t),n),Y(o))return ze(t,o)?Ge(n,r,t,o):o}function rn(t,e){for(const n of e){if(!n)continue;const e=n[t];if(Y(e))return e}}function on(t){let e=t._keys;return e||(e=t._keys=sn(t._scopes)),e}function sn(t){const e=new Set;for(const n of t)for(const t of Object.keys(n).filter(t=>!t.startsWith("_")))e.add(t);return Array.from(e)}const an=Number.EPSILON||1e-14,cn=(t,e)=>e<t.length&&!t[e].skip&&t[e],fn=t=>"x"===t?"y":"x";function ln(t,e,n,r){const o=t.skip?e:t,s=e,i=n.skip?e:n,a=et(s,o),c=et(i,s);let f=a/(a+c),l=c/(a+c);const u=r*(f=isNaN(f)?0:f),h=r*(l=isNaN(l)?0:l);return{previous:{x:s.x-u*(i.x-o.x),y:s.y-u*(i.y-o.y)},next:{x:s.x+h*(i.x-o.x),y:s.y+h*(i.y-o.y)}}}function un(t,e,n){const r=t.length;let o,s,i,a,c,f=cn(t,0);for(let l=0;l<r-1;++l)c=f,f=cn(t,l+1),c&&f&&(Q(e[l],0,an)?n[l]=n[l+1]=0:(o=n[l]/e[l],s=n[l+1]/e[l],(a=Math.pow(o,2)+Math.pow(s,2))<=9||(i=3/Math.sqrt(a),n[l]=o*i*e[l],n[l+1]=s*i*e[l])))}function hn(t,e,n="x"){const r=fn(n),o=t.length;let s,i,a,c=cn(t,0);for(let f=0;f<o;++f){if(i=a,a=c,c=cn(t,f+1),!a)continue;const o=a[n],l=a[r];i&&(s=(o-i[n])/3,a[`cp1${n}`]=o-s,a[`cp1${r}`]=l-s*e[f]),c&&(s=(c[n]-o)/3,a[`cp2${n}`]=o+s,a[`cp2${r}`]=l+s*e[f])}}function pn(t,e="x"){const n=fn(e),r=t.length,o=Array(r).fill(0),s=Array(r);let i,a,c,f=cn(t,0);for(i=0;i<r;++i)if(a=c,c=f,f=cn(t,i+1),c){if(f){const t=f[e]-c[e];o[i]=0!==t?(f[n]-c[n])/t:0}s[i]=a?f?D(o[i-1])!==D(o[i])?0:(o[i-1]+o[i])/2:o[i-1]:o[i]}un(t,o,s),hn(t,s,e)}function dn(t,e,n){return Math.max(Math.min(t,n),e)}function xn(t,e){let n,r,o,s,i,a=pe(t[0],e);for(n=0,r=t.length;n<r;++n)i=s,s=a,a=n<r-1&&pe(t[n+1],e),s&&(o=t[n],i&&(o.cp1x=dn(o.cp1x,e.left,e.right),o.cp1y=dn(o.cp1y,e.top,e.bottom)),a&&(o.cp2x=dn(o.cp2x,e.left,e.right),o.cp2y=dn(o.cp2y,e.top,e.bottom)))}function gn(t,e,n,r,o){let s,i,a,c;if(e.spanGaps&&(t=t.filter(t=>!t.skip)),"monotone"===e.cubicInterpolationMode)pn(t,o);else{let n=r?t[t.length-1]:t[0];for(s=0,i=t.length;s<i;++s)c=ln(n,a=t[s],t[Math.min(s+1,i-(r?0:1))%i],e.tension),a.cp1x=c.previous.x,a.cp1y=c.previous.y,a.cp2x=c.next.x,a.cp2y=c.next.y,n=a}e.capBezierPoints&&xn(t,n)}function bn(){return"undefined"!=typeof window&&"undefined"!=typeof document}function yn(t){let e=t.parentNode;return e&&"[object ShadowRoot]"===e.toString()&&(e=e.host),e}function mn(t,e,n){let r;return"string"==typeof t?(r=parseInt(t,10),-1!==t.indexOf("%")&&(r=r/100*e.parentNode[n])):r=t,r}const wn=t=>window.getComputedStyle(t,null);function vn(t,e){return wn(t).getPropertyValue(e)}const Mn=["top","right","bottom","left"];function _n(t,e,n){const r={};n=n?"-"+n:"";for(let o=0;o<4;o++){const s=Mn[o];r[s]=parseFloat(t[e+"-"+s+n])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}const kn=(t,e,n)=>(t>0||e>0)&&(!n||!n.shadowRoot);function On(t,e){const n=t.native||t,r=n.touches,o=r&&r.length?r[0]:n,{offsetX:s,offsetY:i}=o;let a,c,f=!1;if(kn(s,i,n.target))a=s,c=i;else{const t=e.getBoundingClientRect();a=o.clientX-t.left,c=o.clientY-t.top,f=!0}return{x:a,y:c,box:f}}function Tn(t,e){const{canvas:n,currentDevicePixelRatio:r}=e,o=wn(n),s="border-box"===o.boxSizing,i=_n(o,"padding"),a=_n(o,"border","width"),{x:c,y:f,box:l}=On(t,n),u=i.left+(l&&a.left),h=i.top+(l&&a.top);let{width:p,height:d}=e;return s&&(p-=i.width+a.width,d-=i.height+a.height),{x:Math.round((c-u)/p*n.width/r),y:Math.round((f-h)/d*n.height/r)}}function Pn(t,e,n){let r,o;if(void 0===e||void 0===n){const s=yn(t);if(s){const t=s.getBoundingClientRect(),i=wn(s),a=_n(i,"border","width"),c=_n(i,"padding");e=t.width-c.width-a.width,n=t.height-c.height-a.height,r=mn(i.maxWidth,s,"clientWidth"),o=mn(i.maxHeight,s,"clientHeight")}else e=t.clientWidth,n=t.clientHeight}return{width:e,height:n,maxWidth:r||N,maxHeight:o||N}}const Sn=t=>Math.round(10*t)/10;function Rn(t,e,n,r){const o=wn(t),s=_n(o,"margin"),i=mn(o.maxWidth,t,"clientWidth")||N,a=mn(o.maxHeight,t,"clientHeight")||N,c=Pn(t,e,n);let{width:f,height:l}=c;if("content-box"===o.boxSizing){const t=_n(o,"border","width"),e=_n(o,"padding");f-=e.width+t.width,l-=e.height+t.height}return f=Math.max(0,f-s.width),l=Math.max(0,r?Math.floor(f/r):l-s.height),f=Sn(Math.min(f,i,c.maxWidth)),l=Sn(Math.min(l,a,c.maxHeight)),f&&!l&&(l=Sn(f/2)),{width:f,height:l}}function In(t,e,n){const r=e||1,o=Math.floor(t.height*r),s=Math.floor(t.width*r);t.height=o/r,t.width=s/r;const i=t.canvas;return i.style&&(n||!i.style.height&&!i.style.width)&&(i.style.height=`${t.height}px`,i.style.width=`${t.width}px`),(t.currentDevicePixelRatio!==r||i.height!==o||i.width!==s)&&(t.currentDevicePixelRatio=r,i.height=o,i.width=s,t.ctx.setTransform(r,0,0,r,0,0),!0)}const Cn=function(){let t=!1;try{const n={get passive(){return t=!0,!1}};window.addEventListener("test",null,n),window.removeEventListener("test",null,n)}catch(e){}return t}();function Yn(t,e){const n=vn(t,e),r=n&&n.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}function jn(t,e,n,r){return{x:t.x+n*(e.x-t.x),y:t.y+n*(e.y-t.y)}}function An(t,e,n,r){return{x:t.x+n*(e.x-t.x),y:"middle"===r?n<.5?t.y:e.y:"after"===r?n<1?t.y:e.y:n>0?e.y:t.y}}function Fn(t,e,n,r){const o={x:t.cp2x,y:t.cp2y},s={x:e.cp1x,y:e.cp1y},i=jn(t,o,n),a=jn(o,s,n),c=jn(s,e,n),f=jn(i,a,n),l=jn(a,c,n);return jn(f,l,n)}exports.G=Cn;const Wn=new Map;function En(t,e){e=e||{};const n=t+JSON.stringify(e);let r=Wn.get(n);return r||(r=new Intl.NumberFormat(t,e),Wn.set(n,r)),r}function Nn(t,e,n){return En(e,n).format(t)}const Bn=function(t,e){return{x:n=>t+t+e-n,setWidth(t){e=t},textAlign:t=>"center"===t?t:"right"===t?"left":"right",xPlus:(t,e)=>t-e,leftForLtr:(t,e)=>t-e}},Ln=function(){return{x:t=>t,setWidth(t){},textAlign:t=>t,xPlus:(t,e)=>t+e,leftForLtr:(t,e)=>t}};function Hn(t,e,n){return t?Bn(e,n):Ln()}function Xn(t,e){let n,r;"ltr"!==e&&"rtl"!==e||(r=[(n=t.canvas.style).getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",e,"important"),t.prevTextDirection=r)}function $n(t,e){void 0!==e&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function Dn(t){return"angle"===t?{between:ot,compare:nt,normalize:rt}:{between:(t,e,n)=>t>=Math.min(e,n)&&t<=Math.max(n,e),compare:(t,e)=>t-e,normalize:t=>t}}function zn({start:t,end:e,count:n,loop:r,style:o}){return{start:t%n,end:e%n,loop:r&&(e-t+1)%n==0,style:o}}function qn(t,e,n){const{property:r,start:o,end:s}=n,{between:i,normalize:a}=Dn(r),c=e.length;let f,l,{start:u,end:h,loop:p}=t;if(p){for(u+=c,h+=c,f=0,l=c;f<l&&i(a(e[u%c][r]),o,s);++f)u--,h--;u%=c,h%=c}return h<u&&(h+=c),{start:u,end:h,loop:p,style:t.style}}function Zn(t,e,n){if(!n)return[t];const{property:r,start:o,end:s}=n,i=e.length,{compare:a,between:c,normalize:f}=Dn(r),{start:l,end:u,loop:h,style:p}=qn(t,e,n),d=[];let x,g,b,y=!1,m=null;const w=()=>y||(()=>c(o,b,x)&&0!==a(o,b))(),v=()=>!y||(()=>0===a(s,x)||c(s,b,x))();for(let M=l,_=l;M<=u;++M)(g=e[M%i]).skip||(x=f(g[r]))!==b&&(y=c(x,o,s),null===m&&w()&&(m=0===a(x,o)?M:_),null!==m&&v()&&(d.push(zn({start:m,end:M,loop:h,count:i,style:p})),m=null),_=M,b=x);return null!==m&&d.push(zn({start:m,end:u,loop:h,count:i,style:p})),d}function Qn(t,e){const n=[],r=t.segments;for(let o=0;o<r.length;o++){const s=Zn(r[o],t.points,e);s.length&&n.push(...s)}return n}function Vn(t,e,n,r){let o=0,s=e-1;if(n&&!r)for(;o<e&&!t[o].skip;)o++;for(;o<e&&t[o].skip;)o++;for(o%=e,n&&(s+=o);s>o&&t[s%e].skip;)s--;return{start:o,end:s%=e}}function Kn(t,e,n,r){const o=t.length,s=[];let i,a=e,c=t[e];for(i=e+1;i<=n;++i){const n=t[i%o];n.skip||n.stop?c.skip||(r=!1,s.push({start:e%o,end:(i-1)%o,loop:r}),e=a=n.stop?i:null):(a=i,c.skip&&(e=i)),c=n}return null!==a&&s.push({start:e%o,end:a%o,loop:r}),s}function Un(t,e){const n=t.points,r=t.options.spanGaps,o=n.length;if(!o)return[];const s=!!t._loop,{start:i,end:a}=Vn(n,o,s,r);return Jn(t,!0===r?[{start:i,end:a,loop:s}]:Kn(n,i,a<i?a+o:a,!!t._fullLoop&&0===i&&a===o-1),n,e)}function Jn(t,e,n,r){return r&&r.setContext&&n?Gn(t,e,n,r):e}function Gn(t,e,n,r){const o=tr(t.options),s=n.length,i=[];let a=e[0].start,c=a;for(const f of e){let e,l=o,u=n[a%s];for(c=a+1;c<=f.end;c++){const o=n[c%s];er(e=tr(r.setContext({type:"segment",p0:u,p1:o,p0DataIndex:(c-1)%s,p1DataIndex:c%s,datasetIndex:t._datasetIndex})),l)&&(i.push({start:a,end:c-1,loop:f.loop,style:l}),l=e,a=c-1),u=o,l=e}a<c-1&&(i.push({start:a,end:c-1,loop:f.loop,style:e}),a=c-1)}return i}function tr(t){return{backgroundColor:t.backgroundColor,borderCapStyle:t.borderCapStyle,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderJoinStyle:t.borderJoinStyle,borderWidth:t.borderWidth,borderColor:t.borderColor}}function er(t,e){return e&&JSON.stringify(t)!==JSON.stringify(e)}
},{}],"I6XY":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports._detectPlatform=Qt,Object.defineProperty(exports,"defaults",{enumerable:!0,get:function(){return t.d}}),exports.scales=exports.registry=exports.registerables=exports.plugins=exports.layouts=exports.elements=exports.controllers=exports.animator=exports._adapters=exports.Tooltip=exports.Title=exports.TimeSeriesScale=exports.TimeScale=exports.Ticks=exports.SubTitle=exports.ScatterController=exports.Scale=exports.RadialLinearScale=exports.RadarController=exports.PolarAreaController=exports.PointElement=exports.PieController=exports.LogarithmicScale=exports.LinearScale=exports.LineElement=exports.LineController=exports.Legend=exports.Interaction=exports.Filler=exports.Element=exports.DoughnutController=exports.DomPlatform=exports.Decimation=exports.DatasetController=exports.Chart=exports.CategoryScale=exports.BubbleController=exports.BasicPlatform=exports.BasePlatform=exports.BarElement=exports.BarController=exports.ArcElement=exports.Animations=exports.Animation=void 0;var t=require("./chunks/helpers.segment.js");class e{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,i,o){const n=e.listeners[o],s=e.duration;n.forEach(o=>o({chart:t,initial:e.initial,numSteps:s,currentStep:Math.min(i-e.start,s)}))}_refresh(){const e=this;e._request||(e._running=!0,e._request=t.r.call(window,()=>{e._update(),e._request=null,e._running&&e._refresh()}))}_update(t=Date.now()){const e=this;let i=0;e._charts.forEach((o,n)=>{if(!o.running||!o.items.length)return;const s=o.items;let a,r=s.length-1,l=!1;for(;r>=0;--r)(a=s[r])._active?(a._total>o.duration&&(o.duration=a._total),a.tick(t),l=!0):(s[r]=s[s.length-1],s.pop());l&&(n.draw(),e._notify(n,o,t,"progress")),s.length||(o.running=!1,e._notify(n,o,t,"complete"),o.initial=!1),i+=s.length}),e._lastDate=t,0===i&&(e._running=!1)}_getAnims(t){const e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){e&&e.length&&this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((t,e)=>Math.max(t,e._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!!(e&&e.running&&e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const i=e.items;let o=i.length-1;for(;o>=0;--o)i[o].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var i=new e;exports.animator=i;const o="transparent",n={boolean:(t,e,i)=>i>.5?e:t,color(e,i,n){const s=(0,t.c)(e||o),a=s.valid&&(0,t.c)(i||o);return a&&a.valid?a.mix(s,n).hexString():i},number:(t,e,i)=>t+(e-t)*i};class s{constructor(e,i,o,s){const a=i[o];s=(0,t.a)([e.to,s,a,e.from]);const r=(0,t.a)([e.from,a,s]);this._active=!0,this._fn=e.fn||n[e.type||typeof r],this._easing=t.e[e.easing]||t.e.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=i,this._prop=o,this._from=r,this._to=s,this._promises=void 0}active(){return this._active}update(e,i,o){const n=this;if(n._active){n._notify(!1);const s=n._target[n._prop],a=o-n._start,r=n._duration-a;n._start=o,n._duration=Math.floor(Math.max(r,e.duration)),n._total+=a,n._loop=!!e.loop,n._to=(0,t.a)([e.to,i,s,e.from]),n._from=(0,t.a)([e.from,s,i])}}cancel(){const t=this;t._active&&(t.tick(Date.now()),t._active=!1,t._notify(!1))}tick(t){const e=this,i=t-e._start,o=e._duration,n=e._prop,s=e._from,a=e._loop,r=e._to;let l;if(e._active=s!==r&&(a||i<o),!e._active)return e._target[n]=r,void e._notify(!0);i<0?e._target[n]=s:(l=i/o%2,l=a&&l>1?2-l:l,l=e._easing(Math.min(1,Math.max(0,l))),e._target[n]=e._fn(s,r,l))}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,i)=>{t.push({res:e,rej:i})})}_notify(t){const e=t?"res":"rej",i=this._promises||[];for(let o=0;o<i.length;o++)i[o][e]()}}exports.Animation=s;const a=["x","y","borderWidth","radius","tension"],r=["color","borderColor","backgroundColor"];t.d.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0});const l=Object.keys(t.d.animation);t.d.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>"onProgress"!==t&&"onComplete"!==t&&"fn"!==t}),t.d.set("animations",{colors:{type:"color",properties:r},numbers:{type:"number",properties:a}}),t.d.describe("animations",{_fallback:"animation"}),t.d.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>0|t}}}});class c{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(e){if(!(0,t.i)(e))return;const i=this._properties;Object.getOwnPropertyNames(e).forEach(o=>{const n=e[o];if(!(0,t.i)(n))return;const s={};for(const t of l)s[t]=n[t];((0,t.b)(n.properties)&&n.properties||[o]).forEach(t=>{t!==o&&i.has(t)||i.set(t,s)})})}_animateOptions(t,e){const i=e.options,o=d(t,i);if(!o)return[];const n=this._createAnimations(o,i);return i.$shared&&h(t.options.$animations,i).then(()=>{t.options=i},()=>{}),n}_createAnimations(t,e){const i=this._properties,o=[],n=t.$animations||(t.$animations={}),a=Object.keys(e),r=Date.now();let l;for(l=a.length-1;l>=0;--l){const c=a[l];if("$"===c.charAt(0))continue;if("options"===c){o.push(...this._animateOptions(t,e));continue}const h=e[c];let d=n[c];const u=i.get(c);if(d){if(u&&d.active()){d.update(u,h,r);continue}d.cancel()}u&&u.duration?(n[c]=d=new s(u,t,c,h),o.push(d)):t[c]=h}return o}update(t,e){if(0===this._properties.size)return void Object.assign(t,e);const o=this._createAnimations(t,e);return o.length?(i.add(this._chart,o),!0):void 0}}function h(t,e){const i=[],o=Object.keys(e);for(let n=0;n<o.length;n++){const e=t[o[n]];e&&e.active()&&i.push(e.wait())}return Promise.all(i)}function d(t,e){if(!e)return;let i=t.options;if(i)return i.$shared&&(t.options=i=Object.assign({},i,{$shared:!1,$animations:{}})),i;t.options=e}function u(t,e){const i=t&&t.options||{},o=i.reverse,n=void 0===i.min?e:0,s=void 0===i.max?e:0;return{start:o?s:n,end:o?n:s}}function g(t,e,i){if(!1===i)return!1;const o=u(t,i),n=u(e,i);return{top:n.end,right:o.end,bottom:n.start,left:o.start}}function p(e){let i,o,n,s;return(0,t.i)(e)?(i=e.top,o=e.right,n=e.bottom,s=e.left):i=o=n=s=e,{top:i,right:o,bottom:n,left:s,disabled:!1===e}}function f(t,e){const i=[],o=t._getSortedDatasetMetas(e);let n,s;for(n=0,s=o.length;n<s;++n)i.push(o[n].index);return i}function m(e,i,o,n){const s=e.keys,a="single"===n.mode;let r,l,c,h;if(null!==i){for(r=0,l=s.length;r<l;++r){if((c=+s[r])===o){if(n.all)continue;break}h=e.values[c],(0,t.g)(h)&&(a||0===i||(0,t.s)(i)===(0,t.s)(h))&&(i+=h)}return i}}function x(t){const e=Object.keys(t),i=new Array(e.length);let o,n,s;for(o=0,n=e.length;o<n;++o)s=e[o],i[o]={x:s,y:t[s]};return i}function b(t,e){const i=t&&t.options.stacked;return i||void 0===i&&void 0!==e.stack}function _(t,e,i){return`${t.id}.${e.id}.${i.stack||i.type}`}function y(t){const{min:e,max:i,minDefined:o,maxDefined:n}=t.getUserBounds();return{min:o?e:Number.NEGATIVE_INFINITY,max:n?i:Number.POSITIVE_INFINITY}}function v(t,e,i){const o=t[e]||(t[e]={});return o[i]||(o[i]={})}function M(t,e,i){for(const o of e.getMatchingVisibleMetas("bar").reverse()){const e=t[o.index];if(i&&e>0||!i&&e<0)return o.index}return null}function w(t,e){const{chart:i,_cachedMeta:o}=t,n=i._stacks||(i._stacks={}),{iScale:s,vScale:a,index:r}=o,l=s.axis,c=a.axis,h=_(s,a,o),d=e.length;let u;for(let g=0;g<d;++g){const t=e[g],{[l]:i,[c]:o}=t;(u=(t._stacks||(t._stacks={}))[c]=v(n,h,i))[r]=o,u._top=M(u,a,!0),u._bottom=M(u,a,!1)}}function k(t,e){const i=t.scales;return Object.keys(i).filter(t=>i[t].axis===e).shift()}function S(t,e){return Object.assign(Object.create(t),{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function D(t,e,i){return Object.assign(Object.create(t),{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:i,index:e,mode:"default",type:"data"})}function P(t,e){const i=t.controller.index,o=t.vScale&&t.vScale.axis;if(o){e=e||t._parsed;for(const t of e){const e=t._stacks;if(!e||void 0===e[o]||void 0===e[o][i])return;delete e[o][i]}}}exports.Animations=c;const C=t=>"reset"===t||"none"===t,A=(t,e)=>e?t:Object.assign({},t);class L{constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.$context=void 0,this._syncList=[],this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=b(t.vScale,t),this.addElements()}updateIndex(t){this.index!==t&&P(this._cachedMeta),this.index=t}linkScales(){const e=this,i=e.chart,o=e._cachedMeta,n=e.getDataset(),s=(t,e,i,o)=>"x"===t?e:"r"===t?o:i,a=o.xAxisID=(0,t.v)(n.xAxisID,k(i,"x")),r=o.yAxisID=(0,t.v)(n.yAxisID,k(i,"y")),l=o.rAxisID=(0,t.v)(n.rAxisID,k(i,"r")),c=o.indexAxis,h=o.iAxisID=s(c,a,r,l),d=o.vAxisID=s(c,r,a,l);o.xScale=e.getScaleForId(a),o.yScale=e.getScaleForId(r),o.rScale=e.getScaleForId(l),o.iScale=e.getScaleForId(h),o.vScale=e.getScaleForId(d)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const e=this._cachedMeta;this._data&&(0,t.u)(this._data,this),e._stacked&&P(e)}_dataCheck(){const e=this,i=e.getDataset(),o=i.data||(i.data=[]),n=e._data;if((0,t.i)(o))e._data=x(o);else if(n!==o){if(n){(0,t.u)(n,e);const i=e._cachedMeta;P(i),i._parsed=[]}o&&Object.isExtensible(o)&&(0,t.l)(o,e),e._syncList=[],e._data=o}}addElements(){const t=this,e=t._cachedMeta;t._dataCheck(),t.datasetElementType&&(e.dataset=new t.datasetElementType)}buildOrUpdateElements(t){const e=this,i=e._cachedMeta,o=e.getDataset();let n=!1;e._dataCheck();const s=i._stacked;i._stacked=b(i.vScale,i),i.stack!==o.stack&&(n=!0,P(i),i.stack=o.stack),e._resyncElements(t),(n||s!==i._stacked)&&w(e,i._parsed)}configure(){const t=this,e=t.chart.config,i=e.datasetScopeKeys(t._type),o=e.getOptionScopes(t.getDataset(),i,!0);t.options=e.createResolver(o,t.getContext()),t._parsing=t.options.parsing}parse(e,i){const o=this,{_cachedMeta:n,_data:s}=o,{iScale:a,_stacked:r}=n,l=a.axis;let c,h,d,u=0===e&&i===s.length||n._sorted,g=e>0&&n._parsed[e-1];if(!1===o._parsing)n._parsed=s,n._sorted=!0,d=s;else{d=(0,t.b)(s[e])?o.parseArrayData(n,s,e,i):(0,t.i)(s[e])?o.parseObjectData(n,s,e,i):o.parsePrimitiveData(n,s,e,i);const a=()=>null===h[l]||g&&h[l]<g[l];for(c=0;c<i;++c)n._parsed[c+e]=h=d[c],u&&(a()&&(u=!1),g=h);n._sorted=u}r&&w(o,d)}parsePrimitiveData(t,e,i,o){const{iScale:n,vScale:s}=t,a=n.axis,r=s.axis,l=n.getLabels(),c=n===s,h=new Array(o);let d,u,g;for(d=0,u=o;d<u;++d)g=d+i,h[d]={[a]:c||n.parse(l[g],g),[r]:s.parse(e[g],g)};return h}parseArrayData(t,e,i,o){const{xScale:n,yScale:s}=t,a=new Array(o);let r,l,c,h;for(r=0,l=o;r<l;++r)h=e[c=r+i],a[r]={x:n.parse(h[0],c),y:s.parse(h[1],c)};return a}parseObjectData(e,i,o,n){const{xScale:s,yScale:a}=e,{xAxisKey:r="x",yAxisKey:l="y"}=this._parsing,c=new Array(n);let h,d,u,g;for(h=0,d=n;h<d;++h)g=i[u=h+o],c[h]={x:s.parse((0,t.f)(g,r),u),y:a.parse((0,t.f)(g,l),u)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,i){const o=this.chart,n=this._cachedMeta,s=e[t.axis];return m({keys:f(o,!0),values:e._stacks[t.axis]},s,n.index,{mode:i})}updateRangeFromParsed(t,e,i,o){const n=i[e.axis];let s=null===n?NaN:n;const a=o&&i._stacks[e.axis];o&&a&&(o.values=a,t.min=Math.min(t.min,s),t.max=Math.max(t.max,s),s=m(o,n,this._cachedMeta.index,{all:!0})),t.min=Math.min(t.min,s),t.max=Math.max(t.max,s)}getMinMax(e,i){const o=this,n=o._cachedMeta,s=n._parsed,a=n._sorted&&e===n.iScale,r=s.length,l=o._getOtherScale(e),c=i&&n._stacked&&{keys:f(o.chart,!0),values:null},h={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:d,max:u}=y(l);let g,p,m,x;function b(){return m=s[g],p=m[e.axis],x=m[l.axis],!(0,t.g)(p)||d>x||u<x}for(g=0;g<r&&(b()||(o.updateRangeFromParsed(h,e,m,c),!a));++g);if(a)for(g=r-1;g>=0;--g)if(!b()){o.updateRangeFromParsed(h,e,m,c);break}return h}getAllParsedValues(e){const i=this._cachedMeta._parsed,o=[];let n,s,a;for(n=0,s=i.length;n<s;++n)a=i[n][e.axis],(0,t.g)(a)&&o.push(a);return o}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,i=e.iScale,o=e.vScale,n=this.getParsed(t);return{label:i?""+i.getLabelForValue(n[i.axis]):"",value:o?""+o.getLabelForValue(n[o.axis]):""}}_update(e){const i=this,o=i._cachedMeta;i.configure(),i._cachedDataOpts={},i.update(e||"default"),o._clip=p((0,t.v)(i.options.clip,g(o.xScale,o.yScale,i.getMaxOverflow())))}update(t){}draw(){const t=this,e=t._ctx,i=t.chart,o=t._cachedMeta,n=o.data||[],s=i.chartArea,a=[],r=t._drawStart||0,l=t._drawCount||n.length-r;let c;for(o.dataset&&o.dataset.draw(e,s,r,l),c=r;c<r+l;++c){const t=n[c];t.hidden||(t.active?a.push(t):t.draw(e,s))}for(c=0;c<a.length;++c)a[c].draw(e,s)}getStyle(t,e){const i=e?"active":"default";return void 0===t&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,e,i){const o=this,n=o.getDataset();let s;if(t>=0&&t<o._cachedMeta.data.length){const e=o._cachedMeta.data[t];(s=e.$context||(e.$context=D(o.getContext(),t,e))).parsed=o.getParsed(t),s.raw=n.data[t],s.index=s.dataIndex=t}else(s=o.$context||(o.$context=S(o.chart.getContext(),o.index))).dataset=n,s.index=s.datasetIndex=o.index;return s.active=!!e,s.mode=i,s}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(e,i="default",o){const n=this,s="active"===i,a=n._cachedDataOpts,r=e+"-"+i,l=a[r],c=n.enableOptionSharing&&(0,t.h)(o);if(l)return A(l,c);const h=n.chart.config,d=h.datasetElementScopeKeys(n._type,e),u=s?[`${e}Hover`,"hover",e,""]:[e,""],g=h.getOptionScopes(n.getDataset(),d),p=Object.keys(t.d.elements[e]),f=h.resolveNamedOptions(g,p,()=>n.getContext(o,s),u);return f.$shared&&(f.$shared=c,a[r]=Object.freeze(A(f,c))),f}_resolveAnimations(t,e,i){const o=this,n=o.chart,s=o._cachedDataOpts,a=`animation-${e}`,r=s[a];if(r)return r;let l;if(!1!==n.options.animation){const n=o.chart.config,s=n.datasetAnimationScopeKeys(o._type,e),a=n.getOptionScopes(o.getDataset(),s);l=n.createResolver(a,o.getContext(t,i,e))}const h=new c(n,l&&l.animations);return l&&l._cacheable&&(s[a]=Object.freeze(h)),h}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||C(t)||this.chart._animationsDisabled}updateElement(t,e,i,o){C(o)?Object.assign(t,i):this._resolveAnimations(e,o).update(t,i)}updateSharedOptions(t,e,i){t&&!C(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,o){t.active=o;const n=this.getStyle(e,o);this._resolveAnimations(e,i,o).update(t,{options:!o&&this.getSharedOptions(n)||n})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this,i=e._data,o=e._cachedMeta.data;for(const[r,l,c]of e._syncList)e[r](l,c);e._syncList=[];const n=o.length,s=i.length,a=Math.min(s,n);a&&e.parse(0,a),s>n?e._insertElements(n,s-n,t):s<n&&e._removeElements(s,n-s)}_insertElements(t,e,i=!0){const o=this,n=o._cachedMeta,s=n.data,a=t+e;let r;const l=t=>{for(t.length+=e,r=t.length-1;r>=a;r--)t[r]=t[r-e]};for(l(s),r=t;r<a;++r)s[r]=new o.dataElementType;o._parsing&&l(n._parsed),o.parse(t,e),i&&o.updateElements(s,t,e,"reset")}updateElements(t,e,i,o){}_removeElements(t,e){const i=this._cachedMeta;if(this._parsing){const o=i._parsed.splice(t,e);i._stacked&&P(i,o)}i.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,i,o]=t;this[e](i,o)}}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){this._sync(["_removeElements",t,e]),this._sync(["_insertElements",t,arguments.length-2])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}function T(e){if(!e._cache.$bar){const i=e.getMatchingVisibleMetas("bar");let o=[];for(let t=0,n=i.length;t<n;t++)o=o.concat(i[t].controller.getAllParsedValues(e));e._cache.$bar=(0,t._)(o.sort((t,e)=>t-e))}return e._cache.$bar}function O(e){const i=T(e);let o,n,s,a,r=e._length;const l=()=>{32767!==s&&-32768!==s&&((0,t.h)(a)&&(r=Math.min(r,Math.abs(s-a)||r)),a=s)};for(o=0,n=i.length;o<n;++o)s=e.getPixelForValue(i[o]),l();for(a=void 0,o=0,n=e.ticks.length;o<n;++o)s=e.getPixelForTick(o),l();return r}function E(e,i,o,n){const s=o.barThickness;let a,r;return(0,t.j)(s)?(a=i.min*o.categoryPercentage,r=o.barPercentage):(a=s*n,r=1),{chunk:a/n,ratio:r,start:i.pixels[e]-a/2}}function R(t,e,i,o){const n=e.pixels,s=n[t];let a=t>0?n[t-1]:null,r=t<n.length-1?n[t+1]:null;const l=i.categoryPercentage;null===a&&(a=s-(null===r?e.end-e.start:r-s)),null===r&&(r=s+s-a);const c=s-(s-Math.min(a,r))/2*l;return{chunk:Math.abs(r-a)/2*l/o,ratio:i.barPercentage,start:c}}function z(t,e,i,o){const n=i.parse(t[0],o),s=i.parse(t[1],o),a=Math.min(n,s),r=Math.max(n,s);let l=a,c=r;Math.abs(a)>Math.abs(r)&&(l=r,c=a),e[i.axis]=c,e._custom={barStart:l,barEnd:c,start:n,end:s,min:a,max:r}}function F(e,i,o,n){return(0,t.b)(e)?z(e,i,o,n):i[o.axis]=o.parse(e,n),i}function B(t,e,i,o){const n=t.iScale,s=t.vScale,a=n.getLabels(),r=n===s,l=[];let c,h,d,u;for(c=i,h=i+o;c<h;++c)u=e[c],(d={})[n.axis]=r||n.parse(a[c],c),l.push(F(u,d,s,c));return l}function I(t){return t&&void 0!==t.barStart&&void 0!==t.barEnd}function V(e,i,o){return 0!==e?(0,t.s)(e):(i.isHorizontal()?1:-1)*(i.min>=o?1:-1)}function W(t){let e,i,o,n,s;return t.horizontal?(e=t.base>t.x,i="left",o="right"):(e=t.base<t.y,i="bottom",o="top"),e?(n="end",s="start"):(n="start",s="end"),{start:i,end:o,reverse:e,top:n,bottom:s}}function j(t,e,i,o){let n=e.borderSkipped;const s={};if(!n)return void(t.borderSkipped=s);const{start:a,end:r,reverse:l,top:c,bottom:h}=W(t);"middle"===n&&i&&(t.enableBorderRadius=!0,(i._top||0)===o?n=c:(i._bottom||0)===o?n=h:(s[H(h,a,r,l)]=!0,n=c)),s[H(n,a,r,l)]=!0,t.borderSkipped=s}function H(t,e,i,o){return t=o?$(t=N(t,e,i),i,e):$(t,e,i)}function N(t,e,i){return t===e?i:t===i?e:t}function $(t,e,i){return"start"===t?e:"end"===t?i:t}exports.DatasetController=L,L.defaults={},L.prototype.datasetElementType=null,L.prototype.dataElementType=null;class U extends L{parsePrimitiveData(t,e,i,o){return B(t,e,i,o)}parseArrayData(t,e,i,o){return B(t,e,i,o)}parseObjectData(e,i,o,n){const{iScale:s,vScale:a}=e,{xAxisKey:r="x",yAxisKey:l="y"}=this._parsing,c="x"===s.axis?r:l,h="x"===a.axis?r:l,d=[];let u,g,p,f;for(u=o,g=o+n;u<g;++u)f=i[u],(p={})[s.axis]=s.parse((0,t.f)(f,c),u),d.push(F((0,t.f)(f,h),p,a,u));return d}updateRangeFromParsed(t,e,i,o){super.updateRangeFromParsed(t,e,i,o);const n=i._custom;n&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,n.min),t.max=Math.max(t.max,n.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const e=this._cachedMeta,{iScale:i,vScale:o}=e,n=this.getParsed(t),s=n._custom,a=I(s)?"["+s.start+", "+s.end+"]":""+o.getLabelForValue(n[o.axis]);return{label:""+i.getLabelForValue(n[i.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize(),this._cachedMeta.stack=this.getDataset().stack}update(t){const e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(e,i,o,n){const s=this,a="reset"===n,{index:r,_cachedMeta:{vScale:l}}=s,c=l.getBasePixel(),h=l.isHorizontal(),d=s._getRuler(),u=s.resolveDataElementOptions(i,n),g=s.getSharedOptions(u),p=s.includeOptions(n,g);s.updateSharedOptions(g,n,u);for(let f=i;f<i+o;f++){const i=s.getParsed(f),o=a||(0,t.j)(i[l.axis])?{base:c,head:c}:s._calculateBarValuePixels(f),u=s._calculateBarIndexPixels(f,d),m=(i._stacks||{})[l.axis],x={horizontal:h,base:o.base,enableBorderRadius:!m||I(i._custom)||r===m._top||r===m._bottom,x:h?o.head:u.center,y:h?u.center:o.head,height:h?u.size:Math.abs(o.size),width:h?Math.abs(o.size):u.size};p&&(x.options=g||s.resolveDataElementOptions(f,e[f].active?"active":n)),j(x,x.options||e[f].options,m,r),s.updateElement(e[f],f,x,n)}}_getStacks(e,i){const o=this._cachedMeta.iScale,n=o.getMatchingVisibleMetas(this._type),s=o.options.stacked,a=n.length,r=[];let l,c;for(l=0;l<a;++l)if((c=n[l]).controller.options.grouped){if(void 0!==i){const e=c.controller.getParsed(i)[c.controller._cachedMeta.vScale.axis];if((0,t.j)(e)||isNaN(e))continue}if((!1===s||-1===r.indexOf(c.stack)||void 0===s&&void 0===c.stack)&&r.push(c.stack),c.index===e)break}return r.length||r.push(void 0),r}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,i){const o=this._getStacks(t,i),n=void 0!==e?o.indexOf(e):-1;return-1===n?o.length-1:n}_getRuler(){const t=this,e=t.options,i=t._cachedMeta,o=i.iScale,n=[];let s,a;for(s=0,a=i.data.length;s<a;++s)n.push(o.getPixelForValue(t.getParsed(s)[o.axis],s));const r=e.barThickness;return{min:r||O(o),pixels:n,start:o._startPixel,end:o._endPixel,stackCount:t._getStackCount(),scale:o,grouped:e.grouped,ratio:r?1:e.categoryPercentage*e.barPercentage}}_calculateBarValuePixels(e){const{_cachedMeta:{vScale:i,_stacked:o},options:{base:n,minBarLength:s}}=this,a=n||0,r=this.getParsed(e),l=r._custom,c=I(l);let h,d,u=r[i.axis],g=0,p=o?this.applyStack(i,r,o):u;p!==u&&(g=p-u,p=u),c&&(u=l.barStart,p=l.barEnd-l.barStart,0!==u&&(0,t.s)(u)!==(0,t.s)(l.barEnd)&&(g=0),g+=u);const f=(0,t.j)(n)||c?g:n;let m=i.getPixelForValue(f);if(d=(h=this.chart.getDataVisibility(e)?i.getPixelForValue(g+p):m)-m,Math.abs(d)<s&&(d=V(d,i,a)*s,u===a&&(m-=d/2),h=m+d),m===i.getPixelForValue(a)){const e=(0,t.s)(d)*i.getLineWidthForValue(a)/2;m+=e,d-=e}return{size:d,base:m,head:h,center:h+d/2}}_calculateBarIndexPixels(e,i){const o=this,n=i.scale,s=o.options,a=s.skipNull,r=(0,t.v)(s.maxBarThickness,1/0);let l,c;if(i.grouped){const t=a?o._getStackCount(e):i.stackCount,n="flex"===s.barThickness?R(e,i,s,t):E(e,i,s,t),h=o._getStackIndex(o.index,o._cachedMeta.stack,a?e:void 0);l=n.start+n.chunk*h+n.chunk/2,c=Math.min(r,n.chunk*n.ratio)}else l=n.getPixelForValue(o.getParsed(e)[n.axis],e),c=Math.min(r,i.min*i.ratio);return{base:l-c/2,head:l+c/2,center:l,size:c}}draw(){const t=this,e=t._cachedMeta,i=e.vScale,o=e.data,n=o.length;let s=0;for(;s<n;++s)null!==t.getParsed(s)[i.axis]&&o[s].draw(t._ctx)}}exports.BarController=U,U.id="bar",U.defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}},U.overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};class X extends L{initialize(){this.enableOptionSharing=!0,super.initialize()}parseObjectData(e,i,o,n){const{xScale:s,yScale:a}=e,{xAxisKey:r="x",yAxisKey:l="y"}=this._parsing,c=[];let h,d,u;for(h=o,d=o+n;h<d;++h)u=i[h],c.push({x:s.parse((0,t.f)(u,r),h),y:a.parse((0,t.f)(u,l),h),_custom:u&&u.r&&+u.r});return c}getMaxOverflow(){const{data:t,_parsed:e}=this._cachedMeta;let i=0;for(let o=t.length-1;o>=0;--o)i=Math.max(i,t[o].size()/2,e[o]._custom);return i>0&&i}getLabelAndValue(t){const e=this._cachedMeta,{xScale:i,yScale:o}=e,n=this.getParsed(t),s=i.getLabelForValue(n.x),a=o.getLabelForValue(n.y),r=n._custom;return{label:e.label,value:"("+s+", "+a+(r?", "+r:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,o){const n=this,s="reset"===o,{iScale:a,vScale:r}=n._cachedMeta,l=n.resolveDataElementOptions(e,o),c=n.getSharedOptions(l),h=n.includeOptions(o,c),d=a.axis,u=r.axis;for(let g=e;g<e+i;g++){const e=t[g],i=!s&&n.getParsed(g),l={},c=l[d]=s?a.getPixelForDecimal(.5):a.getPixelForValue(i[d]),p=l[u]=s?r.getBasePixel():r.getPixelForValue(i[u]);l.skip=isNaN(c)||isNaN(p),h&&(l.options=n.resolveDataElementOptions(g,e.active?"active":o),s&&(l.options.radius=0)),n.updateElement(e,g,l,o)}n.updateSharedOptions(c,o,l)}resolveDataElementOptions(e,i){const o=this.getParsed(e);let n=super.resolveDataElementOptions(e,i);n.$shared&&(n=Object.assign({},n,{$shared:!1}));const s=n.radius;return"active"!==i&&(n.radius=0),n.radius+=(0,t.v)(o&&o._custom,s),n}}function Y(e,i,o){let n=1,s=1,a=0,r=0;if(i<t.T){const l=e,c=l+i,h=Math.cos(l),d=Math.sin(l),u=Math.cos(c),g=Math.sin(c),p=(e,i,n)=>(0,t.o)(e,l,c,!0)?1:Math.max(i,i*o,n,n*o),f=(e,i,n)=>(0,t.o)(e,l,c,!0)?-1:Math.min(i,i*o,n,n*o),m=p(0,h,u),x=p(t.H,d,g),b=f(t.P,h,u),_=f(t.P+t.H,d,g);n=(m-b)/2,s=(x-_)/2,a=-(m+b)/2,r=-(x+_)/2}return{ratioX:n,ratioY:s,offsetX:a,offsetY:r}}exports.BubbleController=X,X.id="bubble",X.defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}},X.overrides={scales:{x:{type:"linear"},y:{type:"linear"}},plugins:{tooltip:{callbacks:{title:()=>""}}}};class q extends L{constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const i=this.getDataset().data,o=this._cachedMeta;let n,s;for(n=t,s=t+e;n<s;++n)o._parsed[n]=+i[n]}_getRotation(){return(0,t.t)(this.options.rotation-90)}_getCircumference(){return(0,t.t)(this.options.circumference)}_getRotationExtents(){let e=t.T,i=-t.T;const o=this;for(let t=0;t<o.chart.data.datasets.length;++t)if(o.chart.isDatasetVisible(t)){const n=o.chart.getDatasetMeta(t).controller,s=n._getRotation(),a=n._getCircumference();e=Math.min(e,s),i=Math.max(i,s+a)}return{rotation:e,circumference:i-e}}update(e){const i=this,o=i.chart,{chartArea:n}=o,s=i._cachedMeta,a=s.data,r=i.getMaxBorderWidth()+i.getMaxOffset(a)+i.options.spacing,l=Math.max((Math.min(n.width,n.height)-r)/2,0),c=Math.min((0,t.k)(i.options.cutout,l),1),h=i._getRingWeight(i.index),{circumference:d,rotation:u}=i._getRotationExtents(),{ratioX:g,ratioY:p,offsetX:f,offsetY:m}=Y(u,d,c),x=(n.width-r)/g,b=(n.height-r)/p,_=Math.max(Math.min(x,b)/2,0),y=(0,t.m)(i.options.radius,_),v=(y-Math.max(y*c,0))/i._getVisibleDatasetWeightTotal();i.offsetX=f*y,i.offsetY=m*y,s.total=i.calculateTotal(),i.outerRadius=y-v*i._getRingWeightOffset(i.index),i.innerRadius=Math.max(i.outerRadius-v*h,0),i.updateElements(a,0,a.length,e)}_circumference(e,i){const o=this.options,n=this._cachedMeta,s=this._getCircumference();return i&&o.animation.animateRotate||!this.chart.getDataVisibility(e)||null===n._parsed[e]||n.data[e].hidden?0:this.calculateCircumference(n._parsed[e]*s/t.T)}updateElements(t,e,i,o){const n=this,s="reset"===o,a=n.chart,r=a.chartArea,l=a.options.animation,c=(r.left+r.right)/2,h=(r.top+r.bottom)/2,d=s&&l.animateScale,u=d?0:n.innerRadius,g=d?0:n.outerRadius,p=n.resolveDataElementOptions(e,o),f=n.getSharedOptions(p),m=n.includeOptions(o,f);let x,b=n._getRotation();for(x=0;x<e;++x)b+=n._circumference(x,s);for(x=e;x<e+i;++x){const e=n._circumference(x,s),i=t[x],a={x:c+n.offsetX,y:h+n.offsetY,startAngle:b,endAngle:b+e,circumference:e,outerRadius:g,innerRadius:u};m&&(a.options=f||n.resolveDataElementOptions(x,i.active?"active":o)),b+=e,n.updateElement(i,x,a,o)}n.updateSharedOptions(f,o,p)}calculateTotal(){const t=this._cachedMeta,e=t.data;let i,o=0;for(i=0;i<e.length;i++){const n=t._parsed[i];null===n||isNaN(n)||!this.chart.getDataVisibility(i)||e[i].hidden||(o+=Math.abs(n))}return o}calculateCircumference(e){const i=this._cachedMeta.total;return i>0&&!isNaN(e)?t.T*(Math.abs(e)/i):0}getLabelAndValue(e){const i=this._cachedMeta,o=this.chart,n=o.data.labels||[],s=(0,t.n)(i._parsed[e],o.options.locale);return{label:n[e]||"",value:s}}getMaxBorderWidth(t){const e=this;let i=0;const o=e.chart;let n,s,a,r,l;if(!t)for(n=0,s=o.data.datasets.length;n<s;++n)if(o.isDatasetVisible(n)){t=(a=o.getDatasetMeta(n)).data,(r=a.controller)!==e&&r.configure();break}if(!t)return 0;for(n=0,s=t.length;n<s;++n)"inner"!==(l=r.resolveDataElementOptions(n)).borderAlign&&(i=Math.max(i,l.borderWidth||0,l.hoverBorderWidth||0));return i}getMaxOffset(t){let e=0;for(let i=0,o=t.length;i<o;++i){const t=this.resolveDataElementOptions(i);e=Math.max(e,t.offset||0,t.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let i=0;i<t;++i)this.chart.isDatasetVisible(i)&&(e+=this._getRingWeight(i));return e}_getRingWeight(e){return Math.max((0,t.v)(this.chart.data.datasets[e].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}exports.DoughnutController=q,q.id="doughnut",q.defaults={datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"},q.descriptors={_scriptable:t=>"spacing"!==t,_indexable:t=>"spacing"!==t},q.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i}}=t.legend.options;return e.labels.map((e,o)=>{const n=t.getDatasetMeta(0).controller.getStyle(o);return{text:e,fillStyle:n.backgroundColor,strokeStyle:n.borderColor,lineWidth:n.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(o),index:o}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}},tooltip:{callbacks:{title:()=>"",label(e){let i=e.label;const o=": "+e.formattedValue;return(0,t.b)(i)?(i=i.slice())[0]+=o:i+=o,i}}}}};class J extends L{initialize(){this.enableOptionSharing=!0,super.initialize()}update(t){const e=this,i=e._cachedMeta,{dataset:o,data:n=[],_dataset:s}=i,a=e.chart._animationsDisabled;let{start:r,count:l}=K(i,n,a);e._drawStart=r,e._drawCount=l,Z(i)&&(r=0,l=n.length),o._datasetIndex=e.index,o._decimated=!!s._decimated,o.points=n;const c=e.resolveDatasetElementOptions(t);e.options.showLine||(c.borderWidth=0),c.segment=e.options.segment,e.updateElement(o,void 0,{animated:!a,options:c},t),e.updateElements(n,r,l,t)}updateElements(e,i,o,n){const s=this,a="reset"===n,{iScale:r,vScale:l,_stacked:c}=s._cachedMeta,h=s.resolveDataElementOptions(i,n),d=s.getSharedOptions(h),u=s.includeOptions(n,d),g=r.axis,p=l.axis,f=s.options.spanGaps,m=(0,t.p)(f)?f:Number.POSITIVE_INFINITY,x=s.chart._animationsDisabled||a||"none"===n;let b=i>0&&s.getParsed(i-1);for(let _=i;_<i+o;++_){const i=e[_],o=s.getParsed(_),h=x?i:{},f=(0,t.j)(o[p]),y=h[g]=r.getPixelForValue(o[g],_),v=h[p]=a||f?l.getBasePixel():l.getPixelForValue(c?s.applyStack(l,o,c):o[p],_);h.skip=isNaN(y)||isNaN(v)||f,h.stop=_>0&&o[g]-b[g]>m,h.parsed=o,u&&(h.options=d||s.resolveDataElementOptions(_,i.active?"active":n)),x||s.updateElement(i,_,h,n),b=o}s.updateSharedOptions(d,n,h)}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,o=t.data||[];if(!o.length)return i;const n=o[0].size(this.resolveDataElementOptions(0)),s=o[o.length-1].size(this.resolveDataElementOptions(o.length-1));return Math.max(i,n,s)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}function K(e,i,o){const n=i.length;let s=0,a=n;if(e._sorted){const{iScale:r,_parsed:l}=e,c=r.axis,{min:h,max:d,minDefined:u,maxDefined:g}=r.getUserBounds();u&&(s=(0,t.q)(Math.min((0,t.w)(l,r.axis,h).lo,o?n:(0,t.w)(i,c,r.getPixelForValue(h)).lo),0,n-1)),a=g?(0,t.q)(Math.max((0,t.w)(l,r.axis,d).hi+1,o?0:(0,t.w)(i,c,r.getPixelForValue(d)).hi+1),s,n)-s:n-s}return{start:s,count:a}}function Z(t){const{xScale:e,yScale:i,_scaleRanges:o}=t,n={xmin:e.min,xmax:e.max,ymin:i.min,ymax:i.max};if(!o)return t._scaleRanges=n,!0;const s=o.xmin!==e.min||o.xmax!==e.max||o.ymin!==i.min||o.ymax!==i.max;return Object.assign(o,n),s}exports.LineController=J,J.id="line",J.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1},J.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};class G extends L{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(e){const i=this._cachedMeta,o=this.chart,n=o.data.labels||[],s=(0,t.n)(i._parsed[e].r,o.options.locale);return{label:n[e]||"",value:s}}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}_updateRadius(){const t=this,e=t.chart,i=e.chartArea,o=e.options,n=Math.min(i.right-i.left,i.bottom-i.top),s=Math.max(n/2,0),a=(s-Math.max(o.cutoutPercentage?s/100*o.cutoutPercentage:1,0))/e.getVisibleDatasetCount();t.outerRadius=s-a*t.index,t.innerRadius=t.outerRadius-a}updateElements(e,i,o,n){const s=this,a="reset"===n,r=s.chart,l=s.getDataset(),c=r.options.animation,h=s._cachedMeta.rScale,d=h.xCenter,u=h.yCenter,g=h.getIndexAngle(0)-.5*t.P;let p,f=g;const m=360/s.countVisibleElements();for(p=0;p<i;++p)f+=s._computeAngle(p,n,m);for(p=i;p<i+o;p++){const t=e[p];let i=f,o=f+s._computeAngle(p,n,m),x=r.getDataVisibility(p)?h.getDistanceFromCenterForValue(l.data[p]):0;f=o,a&&(c.animateScale&&(x=0),c.animateRotate&&(i=o=g));const b={x:d,y:u,innerRadius:0,outerRadius:x,startAngle:i,endAngle:o,options:s.resolveDataElementOptions(p,t.active?"active":n)};s.updateElement(t,p,b,n)}}countVisibleElements(){const t=this.getDataset(),e=this._cachedMeta;let i=0;return e.data.forEach((e,o)=>{!isNaN(t.data[o])&&this.chart.getDataVisibility(o)&&i++}),i}_computeAngle(e,i,o){return this.chart.getDataVisibility(e)?(0,t.t)(this.resolveDataElementOptions(e,i).angle||o):0}}exports.PolarAreaController=G,G.id="polarArea",G.defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0},G.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i}}=t.legend.options;return e.labels.map((e,o)=>{const n=t.getDatasetMeta(0).controller.getStyle(o);return{text:e,fillStyle:n.backgroundColor,strokeStyle:n.borderColor,lineWidth:n.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(o),index:o}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}},tooltip:{callbacks:{title:()=>"",label:t=>t.chart.data.labels[t.dataIndex]+": "+t.formattedValue}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};class Q extends q{}exports.PieController=Q,Q.id="pie",Q.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};class tt extends L{getLabelAndValue(t){const e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}update(t){const e=this,i=e._cachedMeta,o=i.dataset,n=i.data||[],s=i.iScale.getLabels();if(o.points=n,"resize"!==t){const i=e.resolveDatasetElementOptions(t);e.options.showLine||(i.borderWidth=0);const a={_loop:!0,_fullLoop:s.length===n.length,options:i};e.updateElement(o,void 0,a,t)}e.updateElements(n,0,n.length,t)}updateElements(t,e,i,o){const n=this,s=n.getDataset(),a=n._cachedMeta.rScale,r="reset"===o;for(let l=e;l<e+i;l++){const e=t[l],i=n.resolveDataElementOptions(l,e.active?"active":o),c=a.getPointPositionForValue(l,s.data[l]),h=r?a.xCenter:c.x,d=r?a.yCenter:c.y,u={x:h,y:d,angle:c.angle,skip:isNaN(h)||isNaN(d),options:i};n.updateElement(e,l,u,o)}}}exports.RadarController=tt,tt.id="radar",tt.defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}},tt.overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};class et extends J{}exports.ScatterController=et,et.id="scatter",et.defaults={showLine:!1,fill:!1},et.overrides={interaction:{mode:"point"},plugins:{tooltip:{callbacks:{title:()=>"",label:t=>"("+t.label+", "+t.formattedValue+")"}}},scales:{x:{type:"linear"},y:{type:"linear"}}};var it=Object.freeze({__proto__:null,BarController:U,BubbleController:X,DoughnutController:q,LineController:J,PolarAreaController:G,PieController:Q,RadarController:tt,ScatterController:et});function ot(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}exports.controllers=it;class nt{constructor(t){this.options=t||{}}formats(){return ot()}parse(t,e){return ot()}format(t,e){return ot()}add(t,e,i){return ot()}diff(t,e,i){return ot()}startOf(t,e,i){return ot()}endOf(t,e){return ot()}}nt.override=function(t){Object.assign(nt.prototype,t)};var st={_date:nt};function at(e,i){return"native"in e?{x:e.x,y:e.y}:(0,t.x)(e,i)}function rt(t,e){const i=t.getSortedVisibleDatasetMetas();let o,n,s;for(let a=0,r=i.length;a<r;++a){({index:o,data:n}=i[a]);for(let t=0,i=n.length;t<i;++t)(s=n[t]).skip||e(s,o,t)}}function lt(e,i,o,n){const{controller:s,data:a,_sorted:r}=e,l=s._cachedMeta.iScale;if(l&&i===l.axis&&r&&a.length){const e=l._reversePixels?t.z:t.w;if(!n)return e(a,i,o);if(s._sharedOptions){const t=a[0],n="function"==typeof t.getRange&&t.getRange(i);if(n){const t=e(a,i,o-n),s=e(a,i,o+n);return{lo:t.lo,hi:s.hi}}}}return{lo:0,hi:a.length-1}}function ct(t,e,i,o,n){const s=t.getSortedVisibleDatasetMetas(),a=i[e];for(let r=0,l=s.length;r<l;++r){const{index:t,data:i}=s[r],{lo:l,hi:c}=lt(s[r],e,a,n);for(let e=l;e<=c;++e){const n=i[e];n.skip||o(n,t,e)}}}function ht(t){const e=-1!==t.indexOf("x"),i=-1!==t.indexOf("y");return function(t,o){const n=e?Math.abs(t.x-o.x):0,s=i?Math.abs(t.y-o.y):0;return Math.sqrt(Math.pow(n,2)+Math.pow(s,2))}}function dt(e,i,o,n){const s=[];if(!(0,t.y)(i,e.chartArea,e._minPadding))return s;return ct(e,o,i,function(t,e,o){t.inRange(i.x,i.y,n)&&s.push({element:t,datasetIndex:e,index:o})},!0),s}function ut(e,i,o,n,s){const a=ht(o);let r=Number.POSITIVE_INFINITY,l=[];if(!(0,t.y)(i,e.chartArea,e._minPadding))return l;return ct(e,o,i,function(o,c,h){if(n&&!o.inRange(i.x,i.y,s))return;const d=o.getCenterPoint(s);if(!(0,t.y)(d,e.chartArea,e._minPadding)&&!o.inRange(i.x,i.y,s))return;const u=a(i,d);u<r?(l=[{element:o,datasetIndex:c,index:h}],r=u):u===r&&l.push({element:o,datasetIndex:c,index:h})}),l}function gt(t,e,i,o){const n=at(e,t),s=[],a=i.axis,r="x"===a?"inXRange":"inYRange";let l=!1;return rt(t,(t,e,i)=>{t[r](n[a],o)&&s.push({element:t,datasetIndex:e,index:i}),t.inRange(n.x,n.y,o)&&(l=!0)}),i.intersect&&!l?[]:s}exports._adapters=st;var pt={modes:{index(t,e,i,o){const n=at(e,t),s=i.axis||"x",a=i.intersect?dt(t,n,s,o):ut(t,n,s,!1,o),r=[];return a.length?(t.getSortedVisibleDatasetMetas().forEach(t=>{const e=a[0].index,i=t.data[e];i&&!i.skip&&r.push({element:i,datasetIndex:t.index,index:e})}),r):[]},dataset(t,e,i,o){const n=at(e,t),s=i.axis||"xy";let a=i.intersect?dt(t,n,s,o):ut(t,n,s,!1,o);if(a.length>0){const e=a[0].datasetIndex,i=t.getDatasetMeta(e).data;a=[];for(let t=0;t<i.length;++t)a.push({element:i[t],datasetIndex:e,index:t})}return a},point:(t,e,i,o)=>dt(t,at(e,t),i.axis||"xy",o),nearest:(t,e,i,o)=>ut(t,at(e,t),i.axis||"xy",i.intersect,o),x:(t,e,i,o)=>(i.axis="x",gt(t,e,i,o)),y:(t,e,i,o)=>(i.axis="y",gt(t,e,i,o))}};exports.Interaction=pt;const ft=["left","top","right","bottom"];function mt(t,e){return t.filter(t=>t.pos===e)}function xt(t,e){return t.filter(t=>-1===ft.indexOf(t.pos)&&t.box.axis===e)}function bt(t,e){return t.sort((t,i)=>{const o=e?i:t,n=e?t:i;return o.weight===n.weight?o.index-n.index:o.weight-n.weight})}function _t(t){const e=[];let i,o,n,s,a,r;for(i=0,o=(t||[]).length;i<o;++i)n=t[i],({position:s,options:{stack:a,stackWeight:r=1}}=n),e.push({index:i,box:n,pos:s,horizontal:n.isHorizontal(),weight:n.weight,stack:a&&s+a,stackWeight:r});return e}function yt(t){const e={};for(const i of t){const{stack:t,pos:o,stackWeight:n}=i;if(!t||!ft.includes(o))continue;const s=e[t]||(e[t]={count:0,placed:0,weight:0,size:0});s.count++,s.weight+=n}return e}function vt(t,e){const i=yt(t),{vBoxMaxWidth:o,hBoxMaxHeight:n}=e;let s,a,r;for(s=0,a=t.length;s<a;++s){r=t[s];const{fullSize:a}=r.box,l=i[r.stack],c=l&&r.stackWeight/l.weight;r.horizontal?(r.width=c?c*o:a&&e.availableWidth,r.height=n):(r.width=o,r.height=c?c*n:a&&e.availableHeight)}return i}function Mt(t){const e=_t(t),i=bt(e.filter(t=>t.box.fullSize),!0),o=bt(mt(e,"left"),!0),n=bt(mt(e,"right")),s=bt(mt(e,"top"),!0),a=bt(mt(e,"bottom")),r=xt(e,"x"),l=xt(e,"y");return{fullSize:i,leftAndTop:o.concat(s),rightAndBottom:n.concat(l).concat(a).concat(r),chartArea:mt(e,"chartArea"),vertical:o.concat(n).concat(l),horizontal:s.concat(a).concat(r)}}function wt(t,e,i,o){return Math.max(t[i],e[i])+Math.max(t[o],e[o])}function kt(t,e){t.top=Math.max(t.top,e.top),t.left=Math.max(t.left,e.left),t.bottom=Math.max(t.bottom,e.bottom),t.right=Math.max(t.right,e.right)}function St(e,i,o,n){const{pos:s,box:a}=o,r=e.maxPadding;if(!(0,t.i)(s)){o.size&&(e[s]-=o.size);const t=n[o.stack]||{size:0,count:1};t.size=Math.max(t.size,o.horizontal?a.height:a.width),o.size=t.size/t.count,e[s]+=o.size}a.getPadding&&kt(r,a.getPadding());const l=Math.max(0,i.outerWidth-wt(r,e,"left","right")),c=Math.max(0,i.outerHeight-wt(r,e,"top","bottom")),h=l!==e.w,d=c!==e.h;return e.w=l,e.h=c,o.horizontal?{same:h,other:d}:{same:d,other:h}}function Dt(t){const e=t.maxPadding;function i(i){const o=Math.max(e[i]-t[i],0);return t[i]+=o,o}t.y+=i("top"),t.x+=i("left"),i("right"),i("bottom")}function Pt(t,e){const i=e.maxPadding;function o(t){const o={left:0,top:0,right:0,bottom:0};return t.forEach(t=>{o[t]=Math.max(e[t],i[t])}),o}return o(t?["left","right"]:["top","bottom"])}function Ct(t,e,i,o){const n=[];let s,a,r,l,c,h;for(s=0,a=t.length,c=0;s<a;++s){(l=(r=t[s]).box).update(r.width||e.w,r.height||e.h,Pt(r.horizontal,e));const{same:a,other:d}=St(e,i,r,o);c|=a&&n.length,h=h||d,l.fullSize||n.push(r)}return c&&Ct(n,e,i,o)||h}function At(t,e,i,o,n){t.top=i,t.left=e,t.right=e+o,t.bottom=i+n,t.width=o,t.height=n}function Lt(e,i,o,n){const s=o.padding;let{x:a,y:r}=i;for(const l of e){const e=l.box,c=n[l.stack]||{count:1,placed:0,weight:1},h=l.stackWeight/c.weight||1;if(l.horizontal){const n=i.w*h,a=c.size||e.height;(0,t.h)(c.start)&&(r=c.start),e.fullSize?At(e,s.left,r,o.outerWidth-s.right-s.left,a):At(e,i.left+c.placed,r,n,a),c.start=r,c.placed+=n,r=e.bottom}else{const n=i.h*h,r=c.size||e.width;(0,t.h)(c.start)&&(a=c.start),e.fullSize?At(e,a,s.top,r,o.outerHeight-s.bottom-s.top):At(e,a,i.top+c.placed,r,n),c.start=a,c.placed+=n,a=e.right}}i.x=a,i.y=r}t.d.set("layout",{padding:{top:0,right:0,bottom:0,left:0}});var Tt={addBox(t,e){t.boxes||(t.boxes=[]),e.fullSize=e.fullSize||!1,e.position=e.position||"top",e.weight=e.weight||0,e._layers=e._layers||function(){return[{z:0,draw(t){e.draw(t)}}]},t.boxes.push(e)},removeBox(t,e){const i=t.boxes?t.boxes.indexOf(e):-1;-1!==i&&t.boxes.splice(i,1)},configure(t,e,i){e.fullSize=i.fullSize,e.position=i.position,e.weight=i.weight},update(e,i,o,n){if(!e)return;const s=(0,t.A)(e.options.layout.padding),a=Math.max(i-s.width,0),r=Math.max(o-s.height,0),l=Mt(e.boxes),c=l.vertical,h=l.horizontal;(0,t.B)(e.boxes,t=>{"function"==typeof t.beforeLayout&&t.beforeLayout()});const d=c.reduce((t,e)=>e.box.options&&!1===e.box.options.display?t:t+1,0)||1,u=Object.freeze({outerWidth:i,outerHeight:o,padding:s,availableWidth:a,availableHeight:r,vBoxMaxWidth:a/2/d,hBoxMaxHeight:r/2}),g=Object.assign({},s);kt(g,(0,t.A)(n));const p=Object.assign({maxPadding:g,w:a,h:r,x:s.left,y:s.top},s),f=vt(c.concat(h),u);Ct(l.fullSize,p,u,f),Ct(c,p,u,f),Ct(h,p,u,f)&&Ct(c,p,u,f),Dt(p),Lt(l.leftAndTop,p,u,f),p.x+=p.w,p.y+=p.h,Lt(l.rightAndBottom,p,u,f),e.chartArea={left:p.left,top:p.top,right:p.left+p.w,bottom:p.top+p.h,height:p.h,width:p.w},(0,t.B)(l.chartArea,t=>{const i=t.box;Object.assign(i,e.chartArea),i.update(p.w,p.h)})}};exports.layouts=Tt;class Ot{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,o){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,o?Math.floor(e/o):i)}}isAttached(t){return!0}}exports.BasePlatform=Ot;class Et extends Ot{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}}exports.BasicPlatform=Et;const Rt="$chartjs",zt={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Ft=t=>null===t||""===t;function Bt(e,i){const o=e.style,n=e.getAttribute("height"),s=e.getAttribute("width");if(e[Rt]={initial:{height:n,width:s,style:{display:o.display,height:o.height,width:o.width}}},o.display=o.display||"block",o.boxSizing=o.boxSizing||"border-box",Ft(s)){const i=(0,t.E)(e,"width");void 0!==i&&(e.width=i)}if(Ft(n))if(""===e.style.height)e.height=e.width/(i||2);else{const i=(0,t.E)(e,"height");void 0!==i&&(e.height=i)}return e}const It=!!t.G&&{passive:!0};function Vt(t,e,i){t.addEventListener(e,i,It)}function Wt(t,e,i){t.canvas.removeEventListener(e,i,It)}function jt(e,i){const o=zt[e.type]||e.type,{x:n,y:s}=(0,t.x)(e,i);return{type:o,chart:i,native:e,x:void 0!==n?n:null,y:void 0!==s?s:null}}function Ht(e,i,o){const n=e.canvas,s=n&&(0,t.D)(n)||n,a=new MutationObserver(e=>{const i=(0,t.D)(s);e.forEach(t=>{for(let e=0;e<t.addedNodes.length;e++){const n=t.addedNodes[e];n!==s&&n!==i||o(t.target)}})});return a.observe(document,{childList:!0,subtree:!0}),a}function Nt(e,i,o){const n=e.canvas,s=n&&(0,t.D)(n);if(!s)return;const a=new MutationObserver(t=>{t.forEach(t=>{for(let e=0;e<t.removedNodes.length;e++)if(t.removedNodes[e]===n){o();break}})});return a.observe(s,{childList:!0}),a}const $t=new Map;let Ut=0;function Xt(){const t=window.devicePixelRatio;t!==Ut&&(Ut=t,$t.forEach((e,i)=>{i.currentDevicePixelRatio!==t&&e()}))}function Yt(t,e){$t.size||window.addEventListener("resize",Xt),$t.set(t,e)}function qt(t){$t.delete(t),$t.size||window.removeEventListener("resize",Xt)}function Jt(e,i,o){const n=e.canvas,s=n&&(0,t.D)(n);if(!s)return;const a=(0,t.F)((t,e)=>{const i=s.clientWidth;o(t,e),i<s.clientWidth&&o()},window),r=new ResizeObserver(t=>{const e=t[0],i=e.contentRect.width,o=e.contentRect.height;0===i&&0===o||a(i,o)});return r.observe(s),Yt(e,a),r}function Kt(t,e,i){i&&i.disconnect(),"resize"===e&&qt(t)}function Zt(e,i,o){const n=e.canvas,s=(0,t.F)(t=>{null!==e.ctx&&o(jt(t,e))},e,t=>{const e=t[0];return[e,e.offsetX,e.offsetY]});return Vt(n,i,s),s}class Gt extends Ot{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(Bt(t,e),i):null}releaseContext(e){const i=e.canvas;if(!i[Rt])return!1;const o=i[Rt].initial;["height","width"].forEach(e=>{const n=o[e];(0,t.j)(n)?i.removeAttribute(e):i.setAttribute(e,n)});const n=o.style||{};return Object.keys(n).forEach(t=>{i.style[t]=n[t]}),i.width=i.width,delete i[Rt],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const o=t.$proxies||(t.$proxies={}),n={attach:Ht,detach:Nt,resize:Jt}[e]||Zt;o[e]=n(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),o=i[e];o&&(({attach:Kt,detach:Kt,resize:Kt}[e]||Wt)(t,e,o),i[e]=void 0)}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,i,o,n){return(0,t.C)(e,i,o,n)}isAttached(e){const i=(0,t.D)(e);return!(!i||!i.isConnected)}}function Qt(e){return!(0,t.I)()||"undefined"!=typeof OffscreenCanvas&&e instanceof OffscreenCanvas?Et:Gt}exports.DomPlatform=Gt;class te{constructor(){this.x=void 0,this.y=void 0,this.active=!1,this.options=void 0,this.$animations=void 0}tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return(0,t.p)(this.x)&&(0,t.p)(this.y)}getProps(t,e){const i=this,o=this.$animations;if(!e||!o)return i;const n={};return t.forEach(t=>{n[t]=o[t]&&o[t].active()?o[t]._to:i[t]}),n}}exports.Element=te,te.defaults={},te.defaultRoutes=void 0;const ee={values:e=>(0,t.b)(e)?e:""+e,numeric(e,i,o){if(0===e)return"0";const n=this.chart.options.locale;let s,a=e;if(o.length>1){const t=Math.max(Math.abs(o[0].value),Math.abs(o[o.length-1].value));(t<1e-4||t>1e15)&&(s="scientific"),a=ie(e,o)}const r=(0,t.J)(Math.abs(a)),l=Math.max(Math.min(-1*Math.floor(r),20),0),c={notation:s,minimumFractionDigits:l,maximumFractionDigits:l};return Object.assign(c,this.options.ticks.format),(0,t.n)(e,n,c)},logarithmic(e,i,o){if(0===e)return"0";const n=e/Math.pow(10,Math.floor((0,t.J)(e)));return 1===n||2===n||5===n?ee.numeric.call(this,e,i,o):""}};function ie(t,e){let i=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(i)>=1&&t!==Math.floor(t)&&(i=t-Math.floor(t)),i}var oe={formatters:ee};function ne(e,i){const o=e.options.ticks,n=o.maxTicksLimit||se(e),s=o.major.enabled?re(i):[],a=s.length,r=s[0],l=s[a-1],c=[];if(a>n)return le(i,c,s,a/n),c;const h=ae(s,i,n);if(a>0){let e,o;const n=a>1?Math.round((l-r)/(a-1)):null;for(ce(i,c,h,(0,t.j)(n)?0:r-n,r),e=0,o=a-1;e<o;e++)ce(i,c,h,s[e],s[e+1]);return ce(i,c,h,l,(0,t.j)(n)?i.length:l+n),c}return ce(i,c,h),c}function se(t){const e=t.options.offset,i=t._tickSize(),o=t._length/i+(e?0:1),n=t._maxLength/i;return Math.floor(Math.min(o,n))}function ae(e,i,o){const n=he(e),s=i.length/o;if(!n)return Math.max(s,1);const a=(0,t.K)(n);for(let t=0,r=a.length-1;t<r;t++){const e=a[t];if(e>s)return e}return Math.max(s,1)}function re(t){const e=[];let i,o;for(i=0,o=t.length;i<o;i++)t[i].major&&e.push(i);return e}function le(t,e,i,o){let n,s=0,a=i[0];for(o=Math.ceil(o),n=0;n<t.length;n++)n===a&&(e.push(t[n]),a=i[++s*o])}function ce(e,i,o,n,s){const a=(0,t.v)(n,0),r=Math.min((0,t.v)(s,e.length),e.length);let l,c,h,d=0;for(o=Math.ceil(o),s&&(o=(l=s-n)/Math.floor(l/o)),h=a;h<0;)d++,h=Math.round(a+d*o);for(c=Math.max(a,0);c<r;c++)c===h&&(i.push(e[c]),d++,h=Math.round(a+d*o))}function he(t){const e=t.length;let i,o;if(e<2)return!1;for(o=t[0],i=1;i<e;++i)if(t[i]-t[i-1]!==o)return!1;return o}exports.Ticks=oe,t.d.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",grace:0,grid:{display:!0,lineWidth:1,drawBorder:!0,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1,borderDash:[],borderDashOffset:0,borderWidth:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:oe.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),t.d.route("scale.ticks","color","","color"),t.d.route("scale.grid","color","","borderColor"),t.d.route("scale.grid","borderColor","","borderColor"),t.d.route("scale.title","color","","color"),t.d.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&"callback"!==t&&"parser"!==t,_indexable:t=>"borderDash"!==t&&"tickBorderDash"!==t}),t.d.describe("scales",{_fallback:"scale"}),t.d.describe("scale.ticks",{_scriptable:t=>"backdropPadding"!==t&&"callback"!==t,_indexable:t=>"backdropPadding"!==t});const de=t=>"left"===t?"right":"right"===t?"left":t,ue=(t,e,i)=>"top"===e||"left"===e?t[e]+i:t[e]-i;function ge(t,e){const i=[],o=t.length/e,n=t.length;let s=0;for(;s<n;s+=o)i.push(t[Math.floor(s)]);return i}function pe(t,e,i){const o=t.ticks.length,n=Math.min(e,o-1),s=t._startPixel,a=t._endPixel;let r,l=t.getPixelForTick(n);if(!(i&&(r=1===o?Math.max(l-s,a-l):0===e?(t.getPixelForTick(1)-l)/2:(l-t.getPixelForTick(n-1))/2,(l+=n<e?r:-r)<s-1e-6||l>a+1e-6)))return l}function fe(e,i){(0,t.B)(e,t=>{const e=t.gc,o=e.length/2;let n;if(o>i){for(n=0;n<o;++n)delete t.data[e[n]];e.splice(0,o)}})}function me(t){return t.drawTicks?t.tickLength:0}function xe(e,i){if(!e.display)return 0;const o=(0,t.X)(e.font,i),n=(0,t.A)(e.padding);return((0,t.b)(e.text)?e.text.length:1)*o.lineHeight+n.height}function be(t,e){return Object.assign(Object.create(t),{scale:e,type:"scale"})}function _e(t,e,i){return Object.assign(Object.create(t),{tick:i,index:e,type:"tick"})}function ye(e,i,o){let n=(0,t.Y)(e);return(o&&"right"!==i||!o&&"right"===i)&&(n=de(n)),n}function ve(e,i,o,n){const{top:s,left:a,bottom:r,right:l,chart:c}=e,{chartArea:h,scales:d}=c;let u,g,p,f=0;const m=r-s,x=l-a;if(e.isHorizontal()){if(g=(0,t.Z)(n,a,l),(0,t.i)(o)){const t=Object.keys(o)[0],e=o[t];p=d[t].getPixelForValue(e)+m-i}else p="center"===o?(h.bottom+h.top)/2+m-i:ue(e,o,i);u=l-a}else{if((0,t.i)(o)){const t=Object.keys(o)[0],e=o[t];g=d[t].getPixelForValue(e)-x+i}else g="center"===o?(h.left+h.right)/2-x+i:ue(e,o,i);p=(0,t.Z)(n,r,s),f="left"===o?-t.H:t.H}return{titleX:g,titleY:p,maxWidth:u,rotation:f}}class Me extends te{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){const e=this;e.options=t.setContext(e.getContext()),e.axis=t.axis,e._userMin=e.parse(t.min),e._userMax=e.parse(t.max),e._suggestedMin=e.parse(t.suggestedMin),e._suggestedMax=e.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:e,_userMax:i,_suggestedMin:o,_suggestedMax:n}=this;return e=(0,t.L)(e,Number.POSITIVE_INFINITY),i=(0,t.L)(i,Number.NEGATIVE_INFINITY),o=(0,t.L)(o,Number.POSITIVE_INFINITY),n=(0,t.L)(n,Number.NEGATIVE_INFINITY),{min:(0,t.L)(e,o),max:(0,t.L)(i,n),minDefined:(0,t.g)(e),maxDefined:(0,t.g)(i)}}getMinMax(e){const i=this;let o,{min:n,max:s,minDefined:a,maxDefined:r}=i.getUserBounds();if(a&&r)return{min:n,max:s};const l=i.getMatchingVisibleMetas();for(let t=0,c=l.length;t<c;++t)o=l[t].controller.getMinMax(i,e),a||(n=Math.min(n,o.min)),r||(s=Math.max(s,o.max));return{min:(0,t.L)(n,(0,t.L)(s,n)),max:(0,t.L)(s,(0,t.L)(n,s))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){(0,t.M)(this.options.beforeUpdate,[this])}update(e,i,o){const n=this,s=n.options.ticks,a=s.sampleSize;n.beforeUpdate(),n.maxWidth=e,n.maxHeight=i,n._margins=o=Object.assign({left:0,right:0,top:0,bottom:0},o),n.ticks=null,n._labelSizes=null,n._gridLineItems=null,n._labelItems=null,n.beforeSetDimensions(),n.setDimensions(),n.afterSetDimensions(),n._maxLength=n.isHorizontal()?n.width+o.left+o.right:n.height+o.top+o.bottom,n._dataLimitsCached||(n.beforeDataLimits(),n.determineDataLimits(),n.afterDataLimits(),n._range=(0,t.N)(n,n.options.grace),n._dataLimitsCached=!0),n.beforeBuildTicks(),n.ticks=n.buildTicks()||[],n.afterBuildTicks();const r=a<n.ticks.length;n._convertTicksToLabels(r?ge(n.ticks,a):n.ticks),n.configure(),n.beforeCalculateLabelRotation(),n.calculateLabelRotation(),n.afterCalculateLabelRotation(),s.display&&(s.autoSkip||"auto"===s.source)&&(n.ticks=ne(n,n.ticks),n._labelSizes=null),r&&n._convertTicksToLabels(n.ticks),n.beforeFit(),n.fit(),n.afterFit(),n.afterUpdate()}configure(){const t=this;let e,i,o=t.options.reverse;t.isHorizontal()?(e=t.left,i=t.right):(e=t.top,i=t.bottom,o=!o),t._startPixel=e,t._endPixel=i,t._reversePixels=o,t._length=i-e,t._alignToPixels=t.options.alignToPixels}afterUpdate(){(0,t.M)(this.options.afterUpdate,[this])}beforeSetDimensions(){(0,t.M)(this.options.beforeSetDimensions,[this])}setDimensions(){const t=this;t.isHorizontal()?(t.width=t.maxWidth,t.left=0,t.right=t.width):(t.height=t.maxHeight,t.top=0,t.bottom=t.height),t.paddingLeft=0,t.paddingTop=0,t.paddingRight=0,t.paddingBottom=0}afterSetDimensions(){(0,t.M)(this.options.afterSetDimensions,[this])}_callHooks(e){this.chart.notifyPlugins(e,this.getContext()),(0,t.M)(this.options[e],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){(0,t.M)(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(e){const i=this,o=i.options.ticks;let n,s,a;for(n=0,s=e.length;n<s;n++)(a=e[n]).label=(0,t.M)(o.callback,[a.value,n,e],i)}afterTickToLabelConversion(){(0,t.M)(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){(0,t.M)(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const e=this,i=e.options,o=i.ticks,n=e.ticks.length,s=o.minRotation||0,a=o.maxRotation;let r,l,c,h=s;if(!e._isVisible()||!o.display||s>=a||n<=1||!e.isHorizontal())return void(e.labelRotation=s);const d=e._getLabelSizes(),u=d.widest.width,g=d.highest.height,p=(0,t.q)(e.chart.width-u,0,e.maxWidth);u+6>(r=i.offset?e.maxWidth/n:p/(n-1))&&(r=p/(n-(i.offset?.5:1)),l=e.maxHeight-me(i.grid)-o.padding-xe(i.title,e.chart.options.font),c=Math.sqrt(u*u+g*g),h=(0,t.O)(Math.min(Math.asin((0,t.q)((d.highest.height+6)/r,-1,1)),Math.asin((0,t.q)(l/c,-1,1))-Math.asin((0,t.q)(g/c,-1,1)))),h=Math.max(s,Math.min(a,h))),e.labelRotation=h}afterCalculateLabelRotation(){(0,t.M)(this.options.afterCalculateLabelRotation,[this])}beforeFit(){(0,t.M)(this.options.beforeFit,[this])}fit(){const e=this,i={width:0,height:0},{chart:o,options:{ticks:n,title:s,grid:a}}=e,r=e._isVisible(),l=e.isHorizontal();if(r){const r=xe(s,o.options.font);if(l?(i.width=e.maxWidth,i.height=me(a)+r):(i.height=e.maxHeight,i.width=me(a)+r),n.display&&e.ticks.length){const{first:o,last:s,widest:a,highest:r}=e._getLabelSizes(),c=2*n.padding,h=(0,t.t)(e.labelRotation),d=Math.cos(h),u=Math.sin(h);if(l){const t=n.mirror?0:u*a.width+d*r.height;i.height=Math.min(e.maxHeight,i.height+t+c)}else{const t=n.mirror?0:d*a.width+u*r.height;i.width=Math.min(e.maxWidth,i.width+t+c)}e._calculatePadding(o,s,u,d)}}e._handleMargins(),l?(e.width=e._length=o.width-e._margins.left-e._margins.right,e.height=i.height):(e.width=i.width,e.height=e._length=o.height-e._margins.top-e._margins.bottom)}_calculatePadding(t,e,i,o){const n=this,{ticks:{align:s,padding:a},position:r}=n.options,l=0!==n.labelRotation,c="top"!==r&&"x"===n.axis;if(n.isHorizontal()){const r=n.getPixelForTick(0)-n.left,h=n.right-n.getPixelForTick(n.ticks.length-1);let d=0,u=0;l?c?(d=o*t.width,u=i*e.height):(d=i*t.height,u=o*e.width):"start"===s?u=e.width:"end"===s?d=t.width:(d=t.width/2,u=e.width/2),n.paddingLeft=Math.max((d-r+a)*n.width/(n.width-r),0),n.paddingRight=Math.max((u-h+a)*n.width/(n.width-h),0)}else{let i=e.height/2,o=t.height/2;"start"===s?(i=0,o=t.height):"end"===s&&(i=e.height,o=0),n.paddingTop=i+a,n.paddingBottom=o+a}}_handleMargins(){const t=this;t._margins&&(t._margins.left=Math.max(t.paddingLeft,t._margins.left),t._margins.top=Math.max(t.paddingTop,t._margins.top),t._margins.right=Math.max(t.paddingRight,t._margins.right),t._margins.bottom=Math.max(t.paddingBottom,t._margins.bottom))}afterFit(){(0,t.M)(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return"top"===e||"bottom"===e||"x"===t}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){let i,o;for(this.beforeTickToLabelConversion(),this.generateTickLabels(e),i=0,o=e.length;i<o;i++)(0,t.j)(e[i].label)&&(e.splice(i,1),o--,i--);this.afterTickToLabelConversion()}_getLabelSizes(){const t=this;let e=t._labelSizes;if(!e){const i=t.options.ticks.sampleSize;let o=t.ticks;i<o.length&&(o=ge(o,i)),t._labelSizes=e=t._computeLabelSizes(o,o.length)}return e}_computeLabelSizes(e,i){const{ctx:o,_longestTextCache:n}=this,s=[],a=[];let r,l,c,h,d,u,g,p,f,m,x,b=0,_=0;for(r=0;r<i;++r){if(h=e[r].label,d=this._resolveTickFontOptions(r),o.font=u=d.string,g=n[u]=n[u]||{data:{},gc:[]},p=d.lineHeight,f=m=0,(0,t.j)(h)||(0,t.b)(h)){if((0,t.b)(h))for(l=0,c=h.length;l<c;++l)x=h[l],(0,t.j)(x)||(0,t.b)(x)||(f=(0,t.Q)(o,g.data,g.gc,f,x),m+=p)}else f=(0,t.Q)(o,g.data,g.gc,f,h),m=p;s.push(f),a.push(m),b=Math.max(f,b),_=Math.max(m,_)}fe(n,i);const y=s.indexOf(b),v=a.indexOf(_),M=t=>({width:s[t]||0,height:a[t]||0});return{first:M(0),last:M(i-1),widest:M(y),highest:M(v),widths:s,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(e){const i=this;i._reversePixels&&(e=1-e);const o=i._startPixel+e*i._length;return(0,t.R)(i._alignToPixels?(0,t.S)(i.chart,o,0):o)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this,i=e.ticks||[];if(t>=0&&t<i.length){const o=i[t];return o.$context||(o.$context=_e(e.getContext(),t,o))}return e.$context||(e.$context=be(e.chart.getContext(),e))}_tickSize(){const e=this.options.ticks,i=(0,t.t)(this.labelRotation),o=Math.abs(Math.cos(i)),n=Math.abs(Math.sin(i)),s=this._getLabelSizes(),a=e.autoSkipPadding||0,r=s?s.widest.width+a:0,l=s?s.highest.height+a:0;return this.isHorizontal()?l*o>r*n?r/o:l/n:l*n<r*o?l/o:r/n}_isVisible(){const t=this.options.display;return"auto"!==t?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(e){const i=this,o=i.axis,n=i.chart,s=i.options,{grid:a,position:r}=s,l=a.offset,c=i.isHorizontal(),h=i.ticks.length+(l?1:0),d=me(a),u=[],g=a.setContext(i.getContext()),p=g.drawBorder?g.borderWidth:0,f=p/2,m=function(e){return(0,t.S)(n,e,p)};let x,b,_,y,v,M,w,k,S,D,P,C;if("top"===r)x=m(i.bottom),M=i.bottom-d,k=x-f,D=m(e.top)+f,C=e.bottom;else if("bottom"===r)x=m(i.top),D=e.top,C=m(e.bottom)-f,M=x+f,k=i.top+d;else if("left"===r)x=m(i.right),v=i.right-d,w=x-f,S=m(e.left)+f,P=e.right;else if("right"===r)x=m(i.left),S=e.left,P=m(e.right)-f,v=x+f,w=i.left+d;else if("x"===o){if("center"===r)x=m((e.top+e.bottom)/2+.5);else if((0,t.i)(r)){const t=Object.keys(r)[0],e=r[t];x=m(i.chart.scales[t].getPixelForValue(e))}D=e.top,C=e.bottom,k=(M=x+f)+d}else if("y"===o){if("center"===r)x=m((e.left+e.right)/2);else if((0,t.i)(r)){const t=Object.keys(r)[0],e=r[t];x=m(i.chart.scales[t].getPixelForValue(e))}w=(v=x-f)-d,S=e.left,P=e.right}const A=(0,t.v)(s.ticks.maxTicksLimit,h),L=Math.max(1,Math.ceil(h/A));for(b=0;b<h;b+=L){const e=a.setContext(i.getContext(b)),o=e.lineWidth,s=e.color,r=a.borderDash||[],h=e.borderDashOffset,d=e.tickWidth,g=e.tickColor,p=e.tickBorderDash||[],f=e.tickBorderDashOffset;void 0!==(_=pe(i,b,l))&&(y=(0,t.S)(n,_,o),c?v=w=S=P=y:M=k=D=C=y,u.push({tx1:v,ty1:M,tx2:w,ty2:k,x1:S,y1:D,x2:P,y2:C,width:o,color:s,borderDash:r,borderDashOffset:h,tickWidth:d,tickColor:g,tickBorderDash:p,tickBorderDashOffset:f}))}return i._ticksLength=h,i._borderValue=x,u}_computeLabelItems(e){const i=this,o=i.axis,n=i.options,{position:s,ticks:a}=n,r=i.isHorizontal(),l=i.ticks,{align:c,crossAlign:h,padding:d,mirror:u}=a,g=me(n.grid),p=g+d,f=u?-d:p,m=-(0,t.t)(i.labelRotation),x=[];let b,_,y,v,M,w,k,S,D,P,C,A,L="middle";if("top"===s)w=i.bottom-f,k=i._getXAxisLabelAlignment();else if("bottom"===s)w=i.top+f,k=i._getXAxisLabelAlignment();else if("left"===s){const t=i._getYAxisLabelAlignment(g);k=t.textAlign,M=t.x}else if("right"===s){const t=i._getYAxisLabelAlignment(g);k=t.textAlign,M=t.x}else if("x"===o){if("center"===s)w=(e.top+e.bottom)/2+p;else if((0,t.i)(s)){const t=Object.keys(s)[0],e=s[t];w=i.chart.scales[t].getPixelForValue(e)+p}k=i._getXAxisLabelAlignment()}else if("y"===o){if("center"===s)M=(e.left+e.right)/2-p;else if((0,t.i)(s)){const t=Object.keys(s)[0],e=s[t];M=i.chart.scales[t].getPixelForValue(e)}k=i._getYAxisLabelAlignment(g).textAlign}"y"===o&&("start"===c?L="top":"end"===c&&(L="bottom"));const T=i._getLabelSizes();for(b=0,_=l.length;b<_;++b){v=(y=l[b]).label;const e=a.setContext(i.getContext(b));S=i.getPixelForTick(b)+a.labelOffset,P=(D=i._resolveTickFontOptions(b)).lineHeight;const o=(C=(0,t.b)(v)?v.length:1)/2,n=e.color,c=e.textStrokeColor,d=e.textStrokeWidth;let g;if(r?(M=S,A="top"===s?"near"===h||0!==m?-C*P+P/2:"center"===h?-T.highest.height/2-o*P+P:-T.highest.height+P/2:"near"===h||0!==m?P/2:"center"===h?T.highest.height/2-o*P:T.highest.height-C*P,u&&(A*=-1)):(w=S,A=(1-C)*P/2),e.showLabelBackdrop){const i=(0,t.A)(e.backdropPadding),o=T.heights[b],n=T.widths[b];let s=w+A-i.top,a=M-i.left;switch(L){case"middle":s-=o/2;break;case"bottom":s-=o}switch(k){case"center":a-=n/2;break;case"right":a-=n}g={left:a,top:s,width:n+i.width,height:o+i.height,color:e.backdropColor}}x.push({rotation:m,label:v,font:D,color:n,strokeColor:c,strokeWidth:d,textOffset:A,textAlign:k,textBaseline:L,translation:[M,w],backdrop:g})}return x}_getXAxisLabelAlignment(){const{position:e,ticks:i}=this.options;if(-(0,t.t)(this.labelRotation))return"top"===e?"left":"right";let o="center";return"start"===i.align?o="left":"end"===i.align&&(o="right"),o}_getYAxisLabelAlignment(t){const e=this,{position:i,ticks:{crossAlign:o,mirror:n,padding:s}}=e.options,a=t+s,r=e._getLabelSizes().widest.width;let l,c;return"left"===i?n?(c=e.right+s,"near"===o?l="left":"center"===o?(l="center",c+=r/2):(l="right",c+=r)):(c=e.right-a,"near"===o?l="right":"center"===o?(l="center",c-=r/2):(l="left",c=e.left)):"right"===i?n?(c=e.left+s,"near"===o?l="right":"center"===o?(l="center",c-=r/2):(l="left",c-=r)):(c=e.left+a,"near"===o?l="left":"center"===o?(l="center",c+=r/2):(l="right",c=e.right)):l="right",{textAlign:l,x:c}}_computeLabelArea(){const t=this;if(t.options.ticks.mirror)return;const e=t.chart,i=t.options.position;return"left"===i||"right"===i?{top:0,left:t.left,bottom:e.height,right:t.right}:"top"===i||"bottom"===i?{top:t.top,left:0,bottom:t.bottom,right:e.width}:void 0}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:i,top:o,width:n,height:s}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,o,n,s),t.restore())}getLineWidthForValue(t){const e=this,i=e.options.grid;if(!e._isVisible()||!i.display)return 0;const o=e.ticks.findIndex(e=>e.value===t);if(o>=0){return i.setContext(e.getContext(o)).lineWidth}return 0}drawGrid(t){const e=this,i=e.options.grid,o=e.ctx,n=e._gridLineItems||(e._gridLineItems=e._computeGridLineItems(t));let s,a;const r=(t,e,i)=>{i.width&&i.color&&(o.save(),o.lineWidth=i.width,o.strokeStyle=i.color,o.setLineDash(i.borderDash||[]),o.lineDashOffset=i.borderDashOffset,o.beginPath(),o.moveTo(t.x,t.y),o.lineTo(e.x,e.y),o.stroke(),o.restore())};if(i.display)for(s=0,a=n.length;s<a;++s){const t=n[s];i.drawOnChartArea&&r({x:t.x1,y:t.y1},{x:t.x2,y:t.y2},t),i.drawTicks&&r({x:t.tx1,y:t.ty1},{x:t.tx2,y:t.ty2},{color:t.tickColor,width:t.tickWidth,borderDash:t.tickBorderDash,borderDashOffset:t.tickBorderDashOffset})}}drawBorder(){const e=this,{chart:i,ctx:o,options:{grid:n}}=e,s=n.setContext(e.getContext()),a=n.drawBorder?s.borderWidth:0;if(!a)return;const r=n.setContext(e.getContext(0)).lineWidth,l=e._borderValue;let c,h,d,u;e.isHorizontal()?(c=(0,t.S)(i,e.left,a)-a/2,h=(0,t.S)(i,e.right,r)+r/2,d=u=l):(d=(0,t.S)(i,e.top,a)-a/2,u=(0,t.S)(i,e.bottom,r)+r/2,c=h=l),o.save(),o.lineWidth=s.borderWidth,o.strokeStyle=s.borderColor,o.beginPath(),o.moveTo(c,d),o.lineTo(h,u),o.stroke(),o.restore()}drawLabels(e){const i=this;if(!i.options.ticks.display)return;const o=i.ctx,n=i._computeLabelArea();n&&(0,t.U)(o,n);const s=i._labelItems||(i._labelItems=i._computeLabelItems(e));let a,r;for(a=0,r=s.length;a<r;++a){const e=s[a],i=e.font,n=e.label;e.backdrop&&(o.fillStyle=e.backdrop.color,o.fillRect(e.backdrop.left,e.backdrop.top,e.backdrop.width,e.backdrop.height));let r=e.textOffset;(0,t.V)(o,n,0,r,i,e)}n&&(0,t.W)(o)}drawTitle(){const{ctx:e,options:{position:i,title:o,reverse:n}}=this;if(!o.display)return;const s=(0,t.X)(o.font),a=(0,t.A)(o.padding),r=o.align;let l=s.lineHeight/2;"bottom"===i||"center"===i||(0,t.i)(i)?(l+=a.bottom,(0,t.b)(o.text)&&(l+=s.lineHeight*(o.text.length-1))):l+=a.top;const{titleX:c,titleY:h,maxWidth:d,rotation:u}=ve(this,l,i,r);(0,t.V)(e,o.text,0,0,s,{color:o.color,maxWidth:d,rotation:u,textAlign:ye(r,i,n),textBaseline:"middle",translation:[c,h]})}draw(t){const e=this;e._isVisible()&&(e.drawBackground(),e.drawGrid(t),e.drawBorder(),e.drawTitle(),e.drawLabels(t))}_layers(){const e=this,i=e.options,o=i.ticks&&i.ticks.z||0,n=(0,t.v)(i.grid&&i.grid.z,-1);return e._isVisible()&&e.draw===Me.prototype.draw?[{z:n,draw(t){e.drawBackground(),e.drawGrid(t),e.drawTitle()}},{z:n+1,draw(){e.drawBorder()}},{z:o,draw(t){e.drawLabels(t)}}]:[{z:o,draw(t){e.draw(t)}}]}getMatchingVisibleMetas(t){const e=this,i=e.chart.getSortedVisibleDatasetMetas(),o=e.axis+"AxisID",n=[];let s,a;for(s=0,a=i.length;s<a;++s){const a=i[s];a[o]!==e.id||t&&a.type!==t||n.push(a)}return n}_resolveTickFontOptions(e){const i=this.options.ticks.setContext(this.getContext(e));return(0,t.X)(i.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}exports.Scale=Me;class we{constructor(t,e,i){this.type=t,this.scope=e,this.override=i,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(e){const i=this,o=Object.getPrototypeOf(e);let n;De(o)&&(n=i.register(o));const s=i.items,a=e.id,r=i.scope+"."+a;if(!a)throw new Error("class does not have id: "+e);return a in s?r:(s[a]=e,ke(e,r,n),i.override&&t.d.override(e.id,e.overrides),r)}get(t){return this.items[t]}unregister(e){const i=this.items,o=e.id,n=this.scope;o in i&&delete i[o],n&&o in t.d[n]&&(delete t.d[n][o],this.override&&delete t.$[o])}}function ke(e,i,o){const n=(0,t.a0)(Object.create(null),[o?t.d.get(o):{},t.d.get(i),e.defaults]);t.d.set(i,n),e.defaultRoutes&&Se(i,e.defaultRoutes),e.descriptors&&t.d.describe(i,e.descriptors)}function Se(e,i){Object.keys(i).forEach(o=>{const n=o.split("."),s=n.pop(),a=[e].concat(n).join("."),r=i[o].split("."),l=r.pop(),c=r.join(".");t.d.route(a,s,c,l)})}function De(t){return"id"in t&&"defaults"in t}class Pe{constructor(){this.controllers=new we(L,"datasets",!0),this.elements=new we(te,"elements"),this.plugins=new we(Object,"plugins"),this.scales=new we(Me,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(e,i,o){const n=this;[...i].forEach(i=>{const s=o||n._getRegistryForType(i);o||s.isForType(i)||s===n.plugins&&i.id?n._exec(e,s,i):(0,t.B)(i,t=>{const i=o||n._getRegistryForType(t);n._exec(e,i,t)})})}_exec(e,i,o){const n=(0,t.a1)(e);(0,t.M)(o["before"+n],[],o),i[e](o),(0,t.M)(o["after"+n],[],o)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const i=this._typedRegistries[e];if(i.isForType(t))return i}return this.plugins}_get(t,e,i){const o=e.get(t);if(void 0===o)throw new Error('"'+t+'" is not a registered '+i+".");return o}}var Ce=new Pe;exports.registry=Ce;class Ae{constructor(){this._init=[]}notify(t,e,i,o){const n=this;"beforeInit"===e&&(n._init=n._createDescriptors(t,!0),n._notify(n._init,t,"install"));const s=o?n._descriptors(t).filter(o):n._descriptors(t),a=n._notify(s,t,e,i);return"destroy"===e&&(n._notify(s,t,"stop"),n._notify(n._init,t,"uninstall")),a}_notify(e,i,o,n){n=n||{};for(const s of e){const e=s.plugin,a=e[o],r=[i,n,s.options];if(!1===(0,t.M)(a,r,e)&&n.cancelable)return!1}return!0}invalidate(){(0,t.j)(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(e,i){const o=e&&e.config,n=(0,t.v)(o.options&&o.options.plugins,{}),s=Le(o);return!1!==n||i?Oe(e,s,n,i):[]}_notifyStateChanges(t){const e=this._oldCache||[],i=this._cache,o=(t,e)=>t.filter(t=>!e.some(e=>t.plugin.id===e.plugin.id));this._notify(o(e,i),t,"stop"),this._notify(o(i,e),t,"start")}}function Le(t){const e=[],i=Object.keys(Ce.plugins.items);for(let n=0;n<i.length;n++)e.push(Ce.getPlugin(i[n]));const o=t.plugins||[];for(let n=0;n<o.length;n++){const t=o[n];-1===e.indexOf(t)&&e.push(t)}return e}function Te(t,e){return e||!1!==t?!0===t?{}:t:null}function Oe(t,e,i,o){const n=[],s=t.getContext();for(let a=0;a<e.length;a++){const r=e[a],l=Te(i[r.id],o);null!==l&&n.push({plugin:r,options:Ee(t.config,r,l,s)})}return n}function Ee(t,e,i,o){const n=t.pluginScopeKeys(e),s=t.getOptionScopes(i,n);return t.createResolver(s,o,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Re(e,i){const o=t.d.datasets[e]||{};return((i.datasets||{})[e]||{}).indexAxis||i.indexAxis||o.indexAxis||"x"}function ze(t,e){let i=t;return"_index_"===t?i=e:"_value_"===t&&(i="x"===e?"y":"x"),i}function Fe(t,e){return t===e?"_index_":"_value_"}function Be(t){return"top"===t||"bottom"===t?"x":"left"===t||"right"===t?"y":void 0}function Ie(t,e){return"x"===t||"y"===t?t:e.axis||Be(e.position)||t.charAt(0).toLowerCase()}function Ve(e,i){const o=t.$[e.type]||{scales:{}},n=i.scales||{},s=Re(e.type,i),a=Object.create(null),r=Object.create(null);return Object.keys(n).forEach(e=>{const i=n[e],l=Ie(e,i),c=Fe(l,s),h=o.scales||{};a[l]=a[l]||e,r[e]=(0,t.a7)(Object.create(null),[{axis:l},i,h[l],h[c]])}),e.data.datasets.forEach(o=>{const s=o.type||e.type,l=o.indexAxis||Re(s,i),c=(t.$[s]||{}).scales||{};Object.keys(c).forEach(e=>{const i=ze(e,l),s=o[i+"AxisID"]||a[i]||i;r[s]=r[s]||Object.create(null),(0,t.a7)(r[s],[{axis:i},n[s],c[e]])})}),Object.keys(r).forEach(e=>{const i=r[e];(0,t.a7)(i,[t.d.scales[i.type],t.d.scale])}),r}function We(e){const i=e.options||(e.options={});i.plugins=(0,t.v)(i.plugins,{}),i.scales=Ve(e,i)}function je(t){return(t=t||{}).datasets=t.datasets||[],t.labels=t.labels||[],t}function He(t){return(t=t||{}).data=je(t.data),We(t),t}const Ne=new Map,$e=new Set;function Ue(t,e){let i=Ne.get(t);return i||(i=e(),Ne.set(t,i),$e.add(i)),i}const Xe=(e,i,o)=>{const n=(0,t.f)(i,o);void 0!==n&&e.add(n)};class Ye{constructor(t){this._config=He(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=je(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),We(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Ue(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return Ue(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return Ue(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id;return Ue(`${this.type}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const i=this._scopeCache;let o=i.get(t);return o&&!e||(o=new Map,i.set(t,o)),o}getOptionScopes(e,i,o){const{options:n,type:s}=this,a=this._cachedScopes(e,o),r=a.get(i);if(r)return r;const l=new Set;i.forEach(i=>{e&&(l.add(e),i.forEach(t=>Xe(l,e,t))),i.forEach(t=>Xe(l,n,t)),i.forEach(e=>Xe(l,t.$[s]||{},e)),i.forEach(e=>Xe(l,t.d,e)),i.forEach(e=>Xe(l,t.a2,e))});const c=Array.from(l);return 0===c.length&&c.push(Object.create(null)),$e.has(i)&&a.set(i,c),c}chartOptionScopes(){const{options:e,type:i}=this;return[e,t.$[i]||{},t.d.datasets[i]||{},{type:i},t.d,t.a2]}resolveNamedOptions(e,i,o,n=[""]){const s={$shared:!0},{resolver:a,subPrefixes:r}=qe(this._resolverCache,e,n);let l=a;if(Je(a,i)){s.$shared=!1,o=(0,t.a3)(o)?o():o;const i=this.createResolver(e,o,r);l=(0,t.a4)(a,o,i)}for(const t of i)s[t]=l[t];return s}createResolver(e,i,o=[""],n){const{resolver:s}=qe(this._resolverCache,e,o);return(0,t.i)(i)?(0,t.a4)(s,i,void 0,n):s}}function qe(e,i,o){let n=e.get(i);n||(n=new Map,e.set(i,n));const s=o.join();let a=n.get(s);if(!a){a={resolver:(0,t.a5)(i,o),subPrefixes:o.filter(t=>!t.toLowerCase().includes("hover"))},n.set(s,a)}return a}function Je(e,i){const{isScriptable:o,isIndexable:n}=(0,t.a6)(e);for(const s of i)if(o(s)&&(0,t.a3)(e[s])||n(s)&&(0,t.b)(e[s]))return!0;return!1}var Ke="3.5.1";const Ze=["top","bottom","left","right","chartArea"];function Ge(t,e){return"top"===t||"bottom"===t||-1===Ze.indexOf(t)&&"x"===e}function Qe(t,e){return function(i,o){return i[t]===o[t]?i[e]-o[e]:i[t]-o[t]}}function ti(e){const i=e.chart,o=i.options.animation;i.notifyPlugins("afterRender"),(0,t.M)(o&&o.onComplete,[e],i)}function ei(e){const i=e.chart,o=i.options.animation;(0,t.M)(o&&o.onProgress,[e],i)}function ii(e){return(0,t.I)()&&"string"==typeof e?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const oi={},ni=t=>{const e=ii(t);return Object.values(oi).filter(t=>t.canvas===e).pop()};class si{constructor(e,o){const n=this,s=this.config=new Ye(o),a=ii(e),r=ni(a);if(r)throw new Error("Canvas is already in use. Chart with ID '"+r.id+"' must be destroyed before the canvas can be reused.");const l=s.createResolver(s.chartOptionScopes(),n.getContext());this.platform=new(s.platform||Qt(a));const c=n.platform.acquireContext(a,l.aspectRatio),h=c&&c.canvas,d=h&&h.height,u=h&&h.width;this.id=(0,t.a8)(),this.ctx=c,this.canvas=h,this.width=u,this.height=d,this._options=l,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new Ae,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=(0,t.a9)(()=>this.update("resize"),l.resizeDelay||0),oi[n.id]=n,c&&h?(i.listen(n,"complete",ti),i.listen(n,"progress",ei),n._initialize(),n.attached&&n.update()):console.error("Failed to create chart: can't acquire context from the given item")}get aspectRatio(){const{options:{aspectRatio:e,maintainAspectRatio:i},width:o,height:n,_aspectRatio:s}=this;return(0,t.j)(e)?i&&s?s:n?o/n:null:e}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}_initialize(){const e=this;return e.notifyPlugins("beforeInit"),e.options.responsive?e.resize():(0,t.aa)(e,e.options.devicePixelRatio),e.bindEvents(),e.notifyPlugins("afterInit"),e}clear(){return(0,t.ab)(this.canvas,this.ctx),this}stop(){return i.stop(this),this}resize(t,e){i.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(e,i){const o=this,n=o.options,s=o.canvas,a=n.maintainAspectRatio&&o.aspectRatio,r=o.platform.getMaximumSize(s,e,i,a),l=n.devicePixelRatio||o.platform.getDevicePixelRatio();o.width=r.width,o.height=r.height,o._aspectRatio=o.aspectRatio,(0,t.aa)(o,l,!0)&&(o.notifyPlugins("resize",{size:r}),(0,t.M)(n.onResize,[o,r],o),o.attached&&o._doResize()&&o.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};(0,t.B)(e,(t,e)=>{t.id=e})}buildOrUpdateScales(){const e=this,i=e.options,o=i.scales,n=e.scales,s=Object.keys(n).reduce((t,e)=>(t[e]=!1,t),{});let a=[];o&&(a=a.concat(Object.keys(o).map(t=>{const e=o[t],i=Ie(t,e),n="r"===i,s="x"===i;return{options:e,dposition:n?"chartArea":s?"bottom":"left",dtype:n?"radialLinear":s?"category":"linear"}}))),(0,t.B)(a,o=>{const a=o.options,r=a.id,l=Ie(r,a),c=(0,t.v)(a.type,o.dtype);void 0!==a.position&&Ge(a.position,l)===Ge(o.dposition)||(a.position=o.dposition),s[r]=!0;let h=null;if(r in n&&n[r].type===c)h=n[r];else{h=new(Ce.getScale(c))({id:r,type:c,ctx:e.ctx,chart:e}),n[h.id]=h}h.init(a,i)}),(0,t.B)(s,(t,e)=>{t||delete n[e]}),(0,t.B)(n,t=>{Tt.configure(e,t,t.options),Tt.addBox(e,t)})}_updateMetasets(){const t=this,e=t._metasets,i=t.data.datasets.length,o=e.length;if(e.sort((t,e)=>t.index-e.index),o>i){for(let e=i;e<o;++e)t._destroyDatasetMeta(e);e.splice(i,o-i)}t._sortedMetasets=e.slice(0).sort(Qe("order","index"))}_removeUnreferencedMetasets(){const t=this,{_metasets:e,data:{datasets:i}}=t;e.length>i.length&&delete t._stacks,e.forEach((e,o)=>{0===i.filter(t=>t===e._dataset).length&&t._destroyDatasetMeta(o)})}buildOrUpdateControllers(){const e=this,i=[],o=e.data.datasets;let n,s;for(e._removeUnreferencedMetasets(),n=0,s=o.length;n<s;n++){const s=o[n];let a=e.getDatasetMeta(n);const r=s.type||e.config.type;if(a.type&&a.type!==r&&(e._destroyDatasetMeta(n),a=e.getDatasetMeta(n)),a.type=r,a.indexAxis=s.indexAxis||Re(r,e.options),a.order=s.order||0,a.index=n,a.label=""+s.label,a.visible=e.isDatasetVisible(n),a.controller)a.controller.updateIndex(n),a.controller.linkScales();else{const o=Ce.getController(r),{datasetElementType:s,dataElementType:l}=t.d.datasets[r];Object.assign(o.prototype,{dataElementType:Ce.getElement(l),datasetElementType:s&&Ce.getElement(s)}),a.controller=new o(e,n),i.push(a.controller)}}return e._updateMetasets(),i}_resetElements(){const e=this;(0,t.B)(e.data.datasets,(t,i)=>{e.getDatasetMeta(i).controller.reset()},e)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(e){const i=this,o=i.config;o.update(),i._options=o.createResolver(o.chartOptionScopes(),i.getContext()),(0,t.B)(i.scales,t=>{Tt.removeBox(i,t)});const n=i._animationsDisabled=!i.options.animation;i.ensureScalesHaveIDs(),i.buildOrUpdateScales();const s=new Set(Object.keys(i._listeners)),a=new Set(i.options.events);if((0,t.ac)(s,a)&&!!this._responsiveListeners===i.options.responsive||(i.unbindEvents(),i.bindEvents()),i._plugins.invalidate(),!1===i.notifyPlugins("beforeUpdate",{mode:e,cancelable:!0}))return;const r=i.buildOrUpdateControllers();i.notifyPlugins("beforeElementsUpdate");let l=0;for(let t=0,c=i.data.datasets.length;t<c;t++){const{controller:e}=i.getDatasetMeta(t),o=!n&&-1===r.indexOf(e);e.buildOrUpdateElements(o),l=Math.max(+e.getMaxOverflow(),l)}i._minPadding=l,i._updateLayout(l),n||(0,t.B)(r,t=>{t.reset()}),i._updateDatasets(e),i.notifyPlugins("afterUpdate",{mode:e}),i._layers.sort(Qe("z","_idx")),i._lastEvent&&i._eventHandler(i._lastEvent,!0),i.render()}_updateLayout(e){const i=this;if(!1===i.notifyPlugins("beforeLayout",{cancelable:!0}))return;Tt.update(i,i.width,i.height,e);const o=i.chartArea,n=o.width<=0||o.height<=0;i._layers=[],(0,t.B)(i.boxes,t=>{n&&"chartArea"===t.position||(t.configure&&t.configure(),i._layers.push(...t._layers()))},i),i._layers.forEach((t,e)=>{t._idx=e}),i.notifyPlugins("afterLayout")}_updateDatasets(t){const e=this,i="function"==typeof t;if(!1!==e.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})){for(let o=0,n=e.data.datasets.length;o<n;++o)e._updateDataset(o,i?t({datasetIndex:o}):t);e.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const i=this.getDatasetMeta(t),o={meta:i,index:t,mode:e,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetUpdate",o)&&(i.controller._update(e),o.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",o))}render(){const t=this;!1!==t.notifyPlugins("beforeRender",{cancelable:!0})&&(i.has(t)?t.attached&&!i.running(t)&&i.start(t):(t.draw(),ti({chart:t})))}draw(){const t=this;let e;if(t._resizeBeforeDraw){const{width:e,height:i}=t._resizeBeforeDraw;t._resize(e,i),t._resizeBeforeDraw=null}if(t.clear(),t.width<=0||t.height<=0)return;if(!1===t.notifyPlugins("beforeDraw",{cancelable:!0}))return;const i=t._layers;for(e=0;e<i.length&&i[e].z<=0;++e)i[e].draw(t.chartArea);for(t._drawDatasets();e<i.length;++e)i[e].draw(t.chartArea);t.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const e=this._sortedMetasets,i=[];let o,n;for(o=0,n=e.length;o<n;++o){const n=e[o];t&&!n.visible||i.push(n)}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){const t=this;if(!1===t.notifyPlugins("beforeDatasetsDraw",{cancelable:!0}))return;const e=t.getSortedVisibleDatasetMetas();for(let i=e.length-1;i>=0;--i)t._drawDataset(e[i]);t.notifyPlugins("afterDatasetsDraw")}_drawDataset(e){const i=this,o=i.ctx,n=e._clip,s=!n.disabled,a=i.chartArea,r={meta:e,index:e.index,cancelable:!0};!1!==i.notifyPlugins("beforeDatasetDraw",r)&&(s&&(0,t.U)(o,{left:!1===n.left?0:a.left-n.left,right:!1===n.right?i.width:a.right+n.right,top:!1===n.top?0:a.top-n.top,bottom:!1===n.bottom?i.height:a.bottom+n.bottom}),e.controller.draw(),s&&(0,t.W)(o),r.cancelable=!1,i.notifyPlugins("afterDatasetDraw",r))}getElementsAtEventForMode(t,e,i,o){const n=pt.modes[e];return"function"==typeof n?n(this,t,i,o):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let o=i.filter(t=>t&&t._dataset===e).pop();return o||(o={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(o)),o}getContext(){return this.$context||(this.$context={chart:this,type:"chart"})}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const i=this.getDatasetMeta(t);return"boolean"==typeof i.hidden?!i.hidden:!e.hidden}setDatasetVisibility(t,e){this.getDatasetMeta(t).hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(e,i,o){const n=this,s=o?"show":"hide",a=n.getDatasetMeta(e),r=a.controller._resolveAnimations(void 0,s);(0,t.h)(i)?(a.data[i].hidden=!o,n.update()):(n.setDatasetVisibility(e,o),r.update(a,{visible:o}),n.update(t=>t.datasetIndex===e?s:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this,i=e._metasets&&e._metasets[t];i&&i.controller&&(i.controller._destroy(),delete e._metasets[t])}destroy(){const e=this,{canvas:o,ctx:n}=e;let s,a;for(e.stop(),i.remove(e),s=0,a=e.data.datasets.length;s<a;++s)e._destroyDatasetMeta(s);e.config.clearCache(),o&&(e.unbindEvents(),(0,t.ab)(o,n),e.platform.releaseContext(n),e.canvas=null,e.ctx=null),e.notifyPlugins("destroy"),delete oi[e.id]}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const e=this,i=e._listeners,o=e.platform,n=function(t,i,o){t.offsetX=i,t.offsetY=o,e._eventHandler(t)};(0,t.B)(e.options.events,t=>((t,n)=>{o.addEventListener(e,t,n),i[t]=n})(t,n))}bindResponsiveEvents(){const t=this;t._responsiveListeners||(t._responsiveListeners={});const e=t._responsiveListeners,i=t.platform,o=(o,n)=>{i.addEventListener(t,o,n),e[o]=n},n=(o,n)=>{e[o]&&(i.removeEventListener(t,o,n),delete e[o])},s=(e,i)=>{t.canvas&&t.resize(e,i)};let a;const r=()=>{n("attach",r),t.attached=!0,t.resize(),o("resize",s),o("detach",a)};a=(()=>{t.attached=!1,n("resize",s),o("attach",r)}),i.isAttached(t.canvas)?r():a()}unbindEvents(){const e=this;(0,t.B)(e._listeners,(t,i)=>{e.platform.removeEventListener(e,i,t)}),e._listeners={},(0,t.B)(e._responsiveListeners,(t,i)=>{e.platform.removeEventListener(e,i,t)}),e._responsiveListeners=void 0}updateHoverStyle(t,e,i){const o=i?"set":"remove";let n,s,a,r;for("dataset"===e&&(n=this.getDatasetMeta(t[0].datasetIndex)).controller["_"+o+"DatasetHoverStyle"](),a=0,r=t.length;a<r;++a){const e=(s=t[a])&&this.getDatasetMeta(s.datasetIndex).controller;e&&e[o+"HoverStyle"](s.element,s.datasetIndex,s.index)}}getActiveElements(){return this._active||[]}setActiveElements(e){const i=this,o=i._active||[],n=e.map(({datasetIndex:t,index:e})=>{const o=i.getDatasetMeta(t);if(!o)throw new Error("No dataset found at index "+t);return{datasetIndex:t,element:o.data[e],index:e}});!(0,t.ad)(n,o)&&(i._active=n,i._updateHoverStyles(n,o))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}_updateHoverStyles(t,e,i){const o=this,n=o.options.hover,s=(t,e)=>t.filter(t=>!e.some(e=>t.datasetIndex===e.datasetIndex&&t.index===e.index)),a=s(e,t),r=i?t:s(t,e);a.length&&o.updateHoverStyle(a,n.mode,!1),r.length&&n.mode&&o.updateHoverStyle(r,n.mode,!0)}_eventHandler(t,e){const i=this,o={event:t,replay:e,cancelable:!0},n=e=>(e.options.events||this.options.events).includes(t.type);if(!1===i.notifyPlugins("beforeEvent",o,n))return;const s=i._handleEvent(t,e);return o.cancelable=!1,i.notifyPlugins("afterEvent",o,n),(s||o.changed)&&i.render(),i}_handleEvent(e,i){const o=this,{_active:n=[],options:s}=o,a=s.hover,r=i;let l=[],c=!1,h=null;return"mouseout"!==e.type&&(l=o.getElementsAtEventForMode(e,a.mode,a,r),h="click"===e.type?o._lastEvent:e),o._lastEvent=null,(0,t.y)(e,o.chartArea,o._minPadding)&&((0,t.M)(s.onHover,[e,l,o],o),"mouseup"!==e.type&&"click"!==e.type&&"contextmenu"!==e.type||(0,t.M)(s.onClick,[e,l,o],o)),((c=!(0,t.ad)(l,n))||i)&&(o._active=l,o._updateHoverStyles(l,n,i)),o._lastEvent=h,c}}exports.Chart=si;const ai=()=>(0,t.B)(si.instances,t=>t._plugins.invalidate()),ri=!0;function li(e,i,o){const{startAngle:n,pixelMargin:s,x:a,y:r,outerRadius:l,innerRadius:c}=i;let h=s/l;e.beginPath(),e.arc(a,r,l,n-h,o+h),c>s?(h=s/c,e.arc(a,r,c,o+h,n-h,!0)):e.arc(a,r,s,o+t.H,n-t.H),e.closePath(),e.clip()}function ci(e){return(0,t.af)(e,["outerStart","outerEnd","innerStart","innerEnd"])}function hi(e,i,o,n){const s=ci(e.options.borderRadius),a=(o-i)/2,r=Math.min(a,n*i/2),l=e=>{const i=(o-Math.min(a,e))*n/2;return(0,t.q)(e,0,Math.min(a,i))};return{outerStart:l(s.outerStart),outerEnd:l(s.outerEnd),innerStart:(0,t.q)(s.innerStart,0,r),innerEnd:(0,t.q)(s.innerEnd,0,r)}}function di(t,e,i,o){return{x:i+t*Math.cos(e),y:o+t*Math.sin(e)}}function ui(e,i,o,n,s){const{x:a,y:r,startAngle:l,pixelMargin:c,innerRadius:h}=i,d=Math.max(i.outerRadius+n+o-c,0),u=h>0?h+n+o+c:0;let g=0;const p=s-l;if(n){const t=((h>0?h-n:0)+(d>0?d-n:0))/2;g=(p-(0!==t?p*t/(t+n):p))/2}const f=(p-Math.max(.001,p*d-o/t.P)/d)/2,m=l+f+g,x=s-f-g,{outerStart:b,outerEnd:_,innerStart:y,innerEnd:v}=hi(i,u,d,x-m),M=d-b,w=d-_,k=m+b/M,S=x-_/w,D=u+y,P=u+v,C=m+y/D,A=x-v/P;if(e.beginPath(),e.arc(a,r,d,k,S),_>0){const i=di(w,S,a,r);e.arc(i.x,i.y,_,S,x+t.H)}const L=di(P,x,a,r);if(e.lineTo(L.x,L.y),v>0){const i=di(P,A,a,r);e.arc(i.x,i.y,v,x+t.H,A+Math.PI)}if(e.arc(a,r,u,x-v/u,m+y/u,!0),y>0){const i=di(D,C,a,r);e.arc(i.x,i.y,y,C+Math.PI,m-t.H)}const T=di(M,m,a,r);if(e.lineTo(T.x,T.y),b>0){const i=di(M,k,a,r);e.arc(i.x,i.y,b,m-t.H,k)}e.closePath()}function gi(e,i,o,n){const{fullCircles:s,startAngle:a,circumference:r}=i;let l=i.endAngle;if(s){ui(e,i,o,n,a+t.T);for(let t=0;t<s;++t)e.fill();isNaN(r)||(l=a+r%t.T,r%t.T==0&&(l+=t.T))}return ui(e,i,o,n,l),e.fill(),l}function pi(e,i,o){const{x:n,y:s,startAngle:a,pixelMargin:r,fullCircles:l}=i,c=Math.max(i.outerRadius-r,0),h=i.innerRadius+r;let d;for(o&&li(e,i,a+t.T),e.beginPath(),e.arc(n,s,h,a+t.T,a,!0),d=0;d<l;++d)e.stroke();for(e.beginPath(),e.arc(n,s,c,a,a+t.T),d=0;d<l;++d)e.stroke()}function fi(t,e,i,o,n){const{options:s}=e,a="inner"===s.borderAlign;s.borderWidth&&(a?(t.lineWidth=2*s.borderWidth,t.lineJoin="round"):(t.lineWidth=s.borderWidth,t.lineJoin="bevel"),e.fullCircles&&pi(t,e,a),a&&li(t,e,n),ui(t,e,i,o,n),t.stroke())}Object.defineProperties(si,{defaults:{enumerable:!0,value:t.d},instances:{enumerable:!0,value:oi},overrides:{enumerable:!0,value:t.$},registry:{enumerable:!0,value:Ce},version:{enumerable:!0,value:Ke},getChart:{enumerable:!0,value:ni},register:{enumerable:!0,value:(...t)=>{Ce.add(...t),ai()}},unregister:{enumerable:!0,value:(...t)=>{Ce.remove(...t),ai()}}});class mi extends te{constructor(t){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t)}inRange(e,i,o){const n=this.getProps(["x","y"],o),{angle:s,distance:a}=(0,t.ae)(n,{x:e,y:i}),{startAngle:r,endAngle:l,innerRadius:c,outerRadius:h,circumference:d}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],o),u=this.options.spacing/2;return(d>=t.T||(0,t.o)(s,r,l))&&(a>=c+u&&a<=h+u)}getCenterPoint(t){const{x:e,y:i,startAngle:o,endAngle:n,innerRadius:s,outerRadius:a}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],t),{offset:r,spacing:l}=this.options,c=(o+n)/2,h=(s+a+l+r)/2;return{x:e+Math.cos(c)*h,y:i+Math.sin(c)*h}}tooltipPosition(t){return this.getCenterPoint(t)}draw(e){const i=this,{options:o,circumference:n}=i,s=(o.offset||0)/2,a=(o.spacing||0)/2;if(i.pixelMargin="inner"===o.borderAlign?.33:0,i.fullCircles=n>t.T?Math.floor(n/t.T):0,0===n||i.innerRadius<0||i.outerRadius<0)return;e.save();let r=0;if(s){r=s/2;const o=(i.startAngle+i.endAngle)/2;e.translate(Math.cos(o)*r,Math.sin(o)*r),i.circumference>=t.P&&(r=s)}e.fillStyle=o.backgroundColor,e.strokeStyle=o.borderColor,fi(e,i,r,a,gi(e,i,r,a)),e.restore()}}function xi(e,i,o=i){e.lineCap=(0,t.v)(o.borderCapStyle,i.borderCapStyle),e.setLineDash((0,t.v)(o.borderDash,i.borderDash)),e.lineDashOffset=(0,t.v)(o.borderDashOffset,i.borderDashOffset),e.lineJoin=(0,t.v)(o.borderJoinStyle,i.borderJoinStyle),e.lineWidth=(0,t.v)(o.borderWidth,i.borderWidth),e.strokeStyle=(0,t.v)(o.borderColor,i.borderColor)}function bi(t,e,i){t.lineTo(i.x,i.y)}function _i(e){return e.stepped?t.am:e.tension||"monotone"===e.cubicInterpolationMode?t.an:bi}function yi(t,e,i={}){const o=t.length,{start:n=0,end:s=o-1}=i,{start:a,end:r}=e,l=Math.max(n,a),c=Math.min(s,r),h=n<a&&s<a||n>r&&s>r;return{count:o,start:l,loop:e.loop,ilen:c<l&&!h?o+c-l:c-l}}function vi(t,e,i,o){const{points:n,options:s}=e,{count:a,start:r,loop:l,ilen:c}=yi(n,i,o),h=_i(s);let d,u,g,{move:p=!0,reverse:f}=o||{};for(d=0;d<=c;++d)(u=n[(r+(f?c-d:d))%a]).skip||(p?(t.moveTo(u.x,u.y),p=!1):h(t,g,u,f,s.stepped),g=u);return l&&h(t,g,u=n[(r+(f?c:0))%a],f,s.stepped),!!l}function Mi(t,e,i,o){const n=e.points,{count:s,start:a,ilen:r}=yi(n,i,o),{move:l=!0,reverse:c}=o||{};let h,d,u,g,p,f,m=0,x=0;const b=t=>(a+(c?r-t:t))%s,_=()=>{g!==p&&(t.lineTo(m,p),t.lineTo(m,g),t.lineTo(m,f))};for(l&&(d=n[b(0)],t.moveTo(d.x,d.y)),h=0;h<=r;++h){if((d=n[b(h)]).skip)continue;const e=d.x,i=d.y,o=0|e;o===u?(i<g?g=i:i>p&&(p=i),m=(x*m+e)/++x):(_(),t.lineTo(e,i),u=o,x=0,g=p=i),f=i}_()}function wi(t){const e=t.options,i=e.borderDash&&e.borderDash.length;return!(t._decimated||t._loop||e.tension||"monotone"===e.cubicInterpolationMode||e.stepped||i)?Mi:vi}function ki(e){return e.stepped?t.aj:e.tension||"monotone"===e.cubicInterpolationMode?t.ak:t.al}function Si(t,e,i,o){let n=e._path;n||(n=e._path=new Path2D,e.path(n,i,o)&&n.closePath()),xi(t,e.options),t.stroke(n)}function Di(t,e,i,o){const{segments:n,options:s}=e,a=wi(e);for(const r of n)xi(t,s,r.style),t.beginPath(),a(t,e,r,{start:i,end:i+o-1})&&t.closePath(),t.stroke()}exports.ArcElement=mi,mi.id="arc",mi.defaults={borderAlign:"center",borderColor:"#fff",borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0},mi.defaultRoutes={backgroundColor:"backgroundColor"};const Pi="function"==typeof Path2D;function Ci(t,e,i,o){Pi&&1===e.segments.length?Si(t,e,i,o):Di(t,e,i,o)}class Ai extends te{constructor(t){super(),this.animated=!0,this.options=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(e,i){const o=this,n=o.options;if((n.tension||"monotone"===n.cubicInterpolationMode)&&!n.stepped&&!o._pointsUpdated){const s=n.spanGaps?o._loop:o._fullLoop;(0,t.ag)(o._points,n,e,s,i),o._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=(0,t.ah)(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,i=t.length;return i&&e[t[i-1].end]}interpolate(e,i){const o=this.options,n=e[i],s=this.points,a=(0,t.ai)(this,{property:i,start:n,end:n});if(!a.length)return;const r=[],l=ki(o);let c,h;for(c=0,h=a.length;c<h;++c){const{start:t,end:h}=a[c],d=s[t],u=s[h];if(d===u){r.push(d);continue}const g=l(d,u,Math.abs((n-d[i])/(u[i]-d[i])),o.stepped);g[i]=e[i],r.push(g)}return 1===r.length?r[0]:r}pathSegment(t,e,i){return wi(this)(t,this,e,i)}path(t,e,i){const o=this,n=o.segments,s=wi(o);let a=o._loop;e=e||0,i=i||o.points.length-e;for(const r of n)a&=s(t,o,r,{start:e,end:e+i-1});return!!a}draw(t,e,i,o){const n=this,s=n.options||{};(n.points||[]).length&&s.borderWidth&&(t.save(),Ci(t,n,i,o),t.restore(),n.animated&&(n._pointsUpdated=!1,n._path=void 0))}}function Li(t,e,i,o){const n=t.options,{[i]:s}=t.getProps([i],o);return Math.abs(e-s)<n.radius+n.hitRadius}exports.LineElement=Ai,Ai.id="line",Ai.defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0},Ai.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"},Ai.descriptors={_scriptable:!0,_indexable:t=>"borderDash"!==t&&"fill"!==t};class Ti extends te{constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,e,i){const o=this.options,{x:n,y:s}=this.getProps(["x","y"],i);return Math.pow(t-n,2)+Math.pow(e-s,2)<Math.pow(o.hitRadius+o.radius,2)}inXRange(t,e){return Li(this,t,"x",e)}inYRange(t,e){return Li(this,t,"y",e)}getCenterPoint(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}size(t){let e=(t=t||this.options||{}).radius||0;return 2*((e=Math.max(e,e&&t.hoverRadius||0))+(e&&t.borderWidth||0))}draw(e,i){const o=this,n=o.options;o.skip||n.radius<.1||!(0,t.y)(o,i,o.size(n)/2)||(e.strokeStyle=n.borderColor,e.lineWidth=n.borderWidth,e.fillStyle=n.backgroundColor,(0,t.ao)(e,n,o.x,o.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}function Oi(t,e){const{x:i,y:o,base:n,width:s,height:a}=t.getProps(["x","y","base","width","height"],e);let r,l,c,h,d;return t.horizontal?(d=a/2,r=Math.min(i,n),l=Math.max(i,n),c=o-d,h=o+d):(r=i-(d=s/2),l=i+d,c=Math.min(o,n),h=Math.max(o,n)),{left:r,top:c,right:l,bottom:h}}function Ei(e,i,o,n){return e?0:(0,t.q)(i,o,n)}function Ri(e,i,o){const n=e.options.borderWidth,s=e.borderSkipped,a=(0,t.aq)(n);return{t:Ei(s.top,a.top,0,o),r:Ei(s.right,a.right,0,i),b:Ei(s.bottom,a.bottom,0,o),l:Ei(s.left,a.left,0,i)}}function zi(e,i,o){const{enableBorderRadius:n}=e.getProps(["enableBorderRadius"]),s=e.options.borderRadius,a=(0,t.ar)(s),r=Math.min(i,o),l=e.borderSkipped,c=n||(0,t.i)(s);return{topLeft:Ei(!c||l.top||l.left,a.topLeft,0,r),topRight:Ei(!c||l.top||l.right,a.topRight,0,r),bottomLeft:Ei(!c||l.bottom||l.left,a.bottomLeft,0,r),bottomRight:Ei(!c||l.bottom||l.right,a.bottomRight,0,r)}}function Fi(t){const e=Oi(t),i=e.right-e.left,o=e.bottom-e.top,n=Ri(t,i/2,o/2),s=zi(t,i/2,o/2);return{outer:{x:e.left,y:e.top,w:i,h:o,radius:s},inner:{x:e.left+n.l,y:e.top+n.t,w:i-n.l-n.r,h:o-n.t-n.b,radius:{topLeft:Math.max(0,s.topLeft-Math.max(n.t,n.l)),topRight:Math.max(0,s.topRight-Math.max(n.t,n.r)),bottomLeft:Math.max(0,s.bottomLeft-Math.max(n.b,n.l)),bottomRight:Math.max(0,s.bottomRight-Math.max(n.b,n.r))}}}}function Bi(t,e,i,o){const n=null===e,s=null===i,a=t&&!(n&&s)&&Oi(t,o);return a&&(n||e>=a.left&&e<=a.right)&&(s||i>=a.top&&i<=a.bottom)}function Ii(t){return t.topLeft||t.topRight||t.bottomLeft||t.bottomRight}function Vi(t,e){t.rect(e.x,e.y,e.w,e.h)}function Wi(t,e,i={}){const o=t.x!==i.x?-e:0,n=t.y!==i.y?-e:0,s=(t.x+t.w!==i.x+i.w?e:0)-o,a=(t.y+t.h!==i.y+i.h?e:0)-n;return{x:t.x+o,y:t.y+n,w:t.w+s,h:t.h+a,radius:t.radius}}exports.PointElement=Ti,Ti.id="point",Ti.defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0},Ti.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};class ji extends te{constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,t&&Object.assign(this,t)}draw(e){const i=this.options,{inner:o,outer:n}=Fi(this),s=Ii(n.radius)?t.ap:Vi;e.save(),n.w===o.w&&n.h===o.h||(e.beginPath(),s(e,Wi(n,.33,o)),e.clip(),s(e,Wi(o,-.33,n)),e.fillStyle=i.borderColor,e.fill("evenodd")),e.beginPath(),s(e,Wi(o,.33,n)),e.fillStyle=i.backgroundColor,e.fill(),e.restore()}inRange(t,e,i){return Bi(this,t,e,i)}inXRange(t,e){return Bi(this,t,null,e)}inYRange(t,e){return Bi(this,null,t,e)}getCenterPoint(t){const{x:e,y:i,base:o,horizontal:n}=this.getProps(["x","y","base","horizontal"],t);return{x:n?(e+o)/2:e,y:n?i:(i+o)/2}}getRange(t){return"x"===t?this.width/2:this.height/2}}exports.BarElement=ji,ji.id="bar",ji.defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,enableBorderRadius:!0,pointStyle:void 0},ji.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};var Hi=Object.freeze({__proto__:null,ArcElement:mi,LineElement:Ai,PointElement:Ti,BarElement:ji});function Ni(t,e,i,o,n){const s=n.samples||o;if(s>=i)return t.slice(e,e+i);const a=[],r=(i-2)/(s-2);let l=0;const c=e+i-1;let h,d,u,g,p,f=e;for(a[l++]=t[f],h=0;h<s-2;h++){let o,n=0,s=0;const c=Math.floor((h+1)*r)+1+e,m=Math.min(Math.floor((h+2)*r)+1,i)+e,x=m-c;for(o=c;o<m;o++)n+=t[o].x,s+=t[o].y;n/=x,s/=x;const b=Math.floor(h*r)+1+e,_=Math.min(Math.floor((h+1)*r)+1,i)+e,{x:y,y:v}=t[f];for(u=g=-1,o=b;o<_;o++)(g=.5*Math.abs((y-n)*(t[o].y-v)-(y-t[o].x)*(s-v)))>u&&(u=g,d=t[o],p=o);a[l++]=d,f=p}return a[l++]=t[c],a}function $i(e,i,o,n){let s,a,r,l,c,h,d,u,g,p,f=0,m=0;const x=[],b=i+o-1,_=e[i].x,y=e[b].x-_;for(s=i;s<i+o;++s){r=((a=e[s]).x-_)/y*n,l=a.y;const i=0|r;if(i===c)l<g?(g=l,h=s):l>p&&(p=l,d=s),f=(m*f+a.x)/++m;else{const o=s-1;if(!(0,t.j)(h)&&!(0,t.j)(d)){const t=Math.min(h,d),i=Math.max(h,d);t!==u&&t!==o&&x.push({...e[t],x:f}),i!==u&&i!==o&&x.push({...e[i],x:f})}s>0&&o!==u&&x.push(e[o]),x.push(a),c=i,m=0,g=p=l,h=d=u=s}}return x}function Ui(t){if(t._decimated){const e=t._data;delete t._decimated,delete t._data,Object.defineProperty(t,"data",{value:e})}}function Xi(t){t.data.datasets.forEach(t=>{Ui(t)})}function Yi(e,i){const o=i.length;let n,s=0;const{iScale:a}=e,{min:r,max:l,minDefined:c,maxDefined:h}=a.getUserBounds();return c&&(s=(0,t.q)((0,t.w)(i,a.axis,r).lo,0,o-1)),{start:s,count:n=h?(0,t.q)((0,t.w)(i,a.axis,l).hi+1,s,o)-s:o-s}}exports.elements=Hi;var qi={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(e,i,o)=>{if(!o.enabled)return void Xi(e);const n=e.width;e.data.datasets.forEach((i,s)=>{const{_data:a,indexAxis:r}=i,l=e.getDatasetMeta(s),c=a||i.data;if("y"===(0,t.a)([r,e.options.indexAxis]))return;if("line"!==l.type)return;const h=e.scales[l.xAxisID];if("linear"!==h.type&&"time"!==h.type)return;if(e.options.parsing)return;let{start:d,count:u}=Yi(l,c);if(u<=(o.threshold||4*n))return void Ui(i);let g;switch((0,t.j)(a)&&(i._data=c,delete i.data,Object.defineProperty(i,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(t){this._data=t}})),o.algorithm){case"lttb":g=Ni(c,d,u,n,o);break;case"min-max":g=$i(c,d,u,n);break;default:throw new Error(`Unsupported decimation algorithm '${o.algorithm}'`)}i._decimated=g})},destroy(t){Xi(t)}};function Ji(t,e){const i=t.getDatasetMeta(e);return i&&t.isDatasetVisible(e)?i.dataset:null}function Ki(e){const i=e.options,o=i.fill;let n=(0,t.v)(o&&o.target,o);return void 0===n&&(n=!!i.backgroundColor),!1!==n&&null!==n&&(!0===n?"origin":n)}function Zi(e,i,o){const n=Ki(e);if((0,t.i)(n))return!isNaN(n.value)&&n;let s=parseFloat(n);return(0,t.g)(s)&&Math.floor(s)===s?("-"!==n[0]&&"+"!==n[0]||(s=i+s),!(s===i||s<0||s>=o)&&s):["origin","start","end","stack","shape"].indexOf(n)>=0&&n}function Gi(e){const{scale:i={},fill:o}=e;let n,s=null;return"start"===o?s=i.bottom:"end"===o?s=i.top:(0,t.i)(o)?s=i.getPixelForValue(o.value):i.getBasePixel&&(s=i.getBasePixel()),(0,t.g)(s)?{x:(n=i.isHorizontal())?s:null,y:n?null:s}:null}exports.Decimation=qi;class Qi{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(e,i,o){const{x:n,y:s,radius:a}=this;return i=i||{start:0,end:t.T},e.arc(n,s,a,i.end,i.start,!0),!o.bounds}interpolate(t){const{x:e,y:i,radius:o}=this,n=t.angle;return{x:e+Math.cos(n)*o,y:i+Math.sin(n)*o,angle:n}}}function to(e){const{scale:i,fill:o}=e,n=i.options,s=i.getLabels().length,a=[],r=n.reverse?i.max:i.min,l=n.reverse?i.min:i.max;let c,h,d;if(d="start"===o?r:"end"===o?l:(0,t.i)(o)?o.value:i.getBaseValue(),n.grid.circular)return h=i.getPointPositionForValue(0,r),new Qi({x:h.x,y:h.y,radius:i.getDistanceFromCenterForValue(d)});for(c=0;c<s;++c)a.push(i.getPointPositionForValue(c,d));return a}function eo(t){return(t.scale||{}).getPointPositionForValue?to(t):Gi(t)}function io(t,e,i){for(;e>t;e--){const t=i[e];if(!isNaN(t.x)&&!isNaN(t.y))break}return e}function oo(t,e){const{x:i=null,y:o=null}=t||{},n=e.points,s=[];return e.segments.forEach(({start:t,end:e})=>{e=io(t,e,n);const a=n[t],r=n[e];null!==o?(s.push({x:a.x,y:o}),s.push({x:r.x,y:o})):null!==i&&(s.push({x:i,y:a.y}),s.push({x:i,y:r.y}))}),s}function no(t){const{chart:e,scale:i,index:o,line:n}=t,s=[],a=n.segments,r=n.points,l=ao(e,o);l.push(ho({x:null,y:i.bottom},n));for(let c=0;c<a.length;c++){const t=a[c];for(let e=t.start;e<=t.end;e++)ro(s,r[e],l)}return new Ai({points:s,options:{}})}const so=t=>"line"===t.type&&!t.hidden;function ao(t,e){const i=[],o=t.getSortedVisibleDatasetMetas();for(let n=0;n<o.length;n++){const t=o[n];if(t.index===e)break;so(t)&&i.unshift(t.dataset)}return i}function ro(t,e,i){const o=[];for(let n=0;n<i.length;n++){const s=i[n],{first:a,last:r,point:l}=lo(s,e,"x");if(!(!l||a&&r))if(a)o.unshift(l);else if(t.push(l),!r)break}t.push(...o)}function lo(t,e,i){const o=t.interpolate(e,i);if(!o)return{};const n=o[i],s=t.segments,a=t.points;let r=!1,l=!1;for(let c=0;c<s.length;c++){const t=s[c],e=a[t.start][i],o=a[t.end][i];if(n>=e&&n<=o){r=n===e,l=n===o;break}}return{first:r,last:l,point:o}}function co(e){const{chart:i,fill:o,line:n}=e;if((0,t.g)(o))return Ji(i,o);if("stack"===o)return no(e);if("shape"===o)return!0;const s=eo(e);return s instanceof Qi?s:ho(s,n)}function ho(e,i){let o=[],n=!1;return(0,t.b)(e)?(n=!0,o=e):o=oo(e,i),o.length?new Ai({points:o,options:{tension:0},_loop:n,_fullLoop:n}):null}function uo(e,i,o){let n=e[i].fill;const s=[i];let a;if(!o)return n;for(;!1!==n&&-1===s.indexOf(n);){if(!(0,t.g)(n))return n;if(!(a=e[n]))return!1;if(a.visible)return n;s.push(n),n=a.fill}return!1}function go(t,e,i){t.beginPath(),e.path(t),t.lineTo(e.last().x,i),t.lineTo(e.first().x,i),t.closePath(),t.clip()}function po(e,i,o,n){if(n)return;let s=i[e],a=o[e];return"angle"===e&&(s=(0,t.at)(s),a=(0,t.at)(a)),{property:e,start:s,end:a}}function fo(t,e,i,o){return t&&e?o(t[i],e[i]):t?t[i]:e?e[i]:0}function mo(e,i,o){const n=e.segments,s=e.points,a=i.points,r=[];for(const l of n){let{start:e,end:n}=l;n=io(e,n,s);const c=po(o,s[e],s[n],l.loop);if(!i.segments){r.push({source:l,target:c,start:s[e],end:s[n]});continue}const h=(0,t.ai)(i,c);for(const i of h){const e=po(o,a[i.start],a[i.end],i.loop),n=(0,t.as)(l,s,e);for(const t of n)r.push({source:t,target:i,start:{[o]:fo(c,e,"start",Math.max)},end:{[o]:fo(c,e,"end",Math.min)}})}}return r}function xo(t,e,i){const{top:o,bottom:n}=e.chart.chartArea,{property:s,start:a,end:r}=i||{};"x"===s&&(t.beginPath(),t.rect(a,o,r-a,n-o),t.clip())}function bo(t,e,i,o){const n=e.interpolate(i,o);n&&t.lineTo(n.x,n.y)}function _o(t,e){const{line:i,target:o,property:n,color:s,scale:a}=e,r=mo(i,o,n);for(const{source:l,target:c,start:h,end:d}of r){const{style:{backgroundColor:e=s}={}}=l,r=!0!==o;t.save(),t.fillStyle=e,xo(t,a,r&&po(n,h,d)),t.beginPath();const u=!!i.pathSegment(t,l);let g;if(r){u?t.closePath():bo(t,o,d,n);const e=!!o.pathSegment(t,c,{move:u,reverse:!0});(g=u&&e)||bo(t,o,h,n)}t.closePath(),t.fill(g?"evenodd":"nonzero"),t.restore()}}function yo(t,e){const{line:i,target:o,above:n,below:s,area:a,scale:r}=e,l=i._loop?"angle":e.axis;t.save(),"x"===l&&s!==n&&(go(t,o,a.top),_o(t,{line:i,target:o,color:n,scale:r,property:l}),t.restore(),t.save(),go(t,o,a.bottom)),_o(t,{line:i,target:o,color:s,scale:r,property:l}),t.restore()}function vo(e,i,o){const n=co(i),{line:s,scale:a,axis:r}=i,l=s.options,c=l.fill,h=l.backgroundColor,{above:d=h,below:u=h}=c||{};n&&s.points.length&&((0,t.U)(e,o),yo(e,{line:s,target:n,above:d,below:u,area:o,scale:a,axis:r}),(0,t.W)(e))}var Mo={id:"filler",afterDatasetsUpdate(t,e,i){const o=(t.data.datasets||[]).length,n=[];let s,a,r,l;for(a=0;a<o;++a)l=null,(r=(s=t.getDatasetMeta(a)).dataset)&&r.options&&r instanceof Ai&&(l={visible:t.isDatasetVisible(a),index:a,fill:Zi(r,a,o),chart:t,axis:s.controller.options.indexAxis,scale:s.vScale,line:r}),s.$filler=l,n.push(l);for(a=0;a<o;++a)(l=n[a])&&!1!==l.fill&&(l.fill=uo(n,a,i.propagate))},beforeDraw(t,e,i){const o="beforeDraw"===i.drawTime,n=t.getSortedVisibleDatasetMetas(),s=t.chartArea;for(let a=n.length-1;a>=0;--a){const e=n[a].$filler;e&&(e.line.updateControlPoints(s,e.axis),o&&vo(t.ctx,e,s))}},beforeDatasetsDraw(t,e,i){if("beforeDatasetsDraw"!==i.drawTime)return;const o=t.getSortedVisibleDatasetMetas();for(let n=o.length-1;n>=0;--n){const e=o[n].$filler;e&&vo(t.ctx,e,t.chartArea)}},beforeDatasetDraw(t,e,i){const o=e.meta.$filler;o&&!1!==o.fill&&"beforeDatasetDraw"===i.drawTime&&vo(t.ctx,o,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};exports.Filler=Mo;const wo=(t,e)=>{let{boxHeight:i=e,boxWidth:o=e}=t;return t.usePointStyle&&(i=Math.min(i,e),o=Math.min(o,e)),{boxWidth:o,boxHeight:i,itemHeight:Math.max(e,i)}},ko=(t,e)=>null!==t&&null!==e&&t.datasetIndex===e.datasetIndex&&t.index===e.index;class So extends te{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,i){const o=this;o.maxWidth=t,o.maxHeight=e,o._margins=i,o.setDimensions(),o.buildLabels(),o.fit()}setDimensions(){const t=this;t.isHorizontal()?(t.width=t.maxWidth,t.left=t._margins.left,t.right=t.width):(t.height=t.maxHeight,t.top=t._margins.top,t.bottom=t.height)}buildLabels(){const e=this,i=e.options.labels||{};let o=(0,t.M)(i.generateLabels,[e.chart],e)||[];i.filter&&(o=o.filter(t=>i.filter(t,e.chart.data))),i.sort&&(o=o.sort((t,o)=>i.sort(t,o,e.chart.data))),e.options.reverse&&o.reverse(),e.legendItems=o}fit(){const e=this,{options:i,ctx:o}=e;if(!i.display)return void(e.width=e.height=0);const n=i.labels,s=(0,t.X)(n.font),a=s.size,r=e._computeTitleHeight(),{boxWidth:l,itemHeight:c}=wo(n,a);let h,d;o.font=s.string,e.isHorizontal()?(h=e.maxWidth,d=e._fitRows(r,a,l,c)+10):(d=e.maxHeight,h=e._fitCols(r,a,l,c)+10),e.width=Math.min(h,i.maxWidth||e.maxWidth),e.height=Math.min(d,i.maxHeight||e.maxHeight)}_fitRows(t,e,i,o){const{ctx:n,maxWidth:s,options:{labels:{padding:a}}}=this,r=this.legendHitBoxes=[],l=this.lineWidths=[0],c=o+a;let h=t;n.textAlign="left",n.textBaseline="middle";let d=-1,u=-c;return this.legendItems.forEach((t,g)=>{const p=i+e/2+n.measureText(t.text).width;(0===g||l[l.length-1]+p+2*a>s)&&(h+=c,l[l.length-(g>0?0:1)]=0,u+=c,d++),r[g]={left:0,top:u,row:d,width:p,height:o},l[l.length-1]+=p+a}),h}_fitCols(t,e,i,o){const{ctx:n,maxHeight:s,options:{labels:{padding:a}}}=this,r=this.legendHitBoxes=[],l=this.columnSizes=[],c=s-t;let h=a,d=0,u=0,g=0,p=0;return this.legendItems.forEach((t,s)=>{const f=i+e/2+n.measureText(t.text).width;s>0&&u+o+2*a>c&&(h+=d+a,l.push({width:d,height:u}),g+=d+a,p++,d=u=0),r[s]={left:g,top:u,col:p,width:f,height:o},d=Math.max(d,f),u+=o+a}),h+=d,l.push({width:d,height:u}),h}adjustHitBoxes(){const e=this;if(!e.options.display)return;const i=e._computeTitleHeight(),{legendHitBoxes:o,options:{align:n,labels:{padding:s},rtl:a}}=e,r=(0,t.au)(a,e.left,e.width);if(this.isHorizontal()){let a=0,l=(0,t.Z)(n,e.left+s,e.right-e.lineWidths[a]);for(const c of o)a!==c.row&&(a=c.row,l=(0,t.Z)(n,e.left+s,e.right-e.lineWidths[a])),c.top+=e.top+i+s,c.left=r.leftForLtr(r.x(l),c.width),l+=c.width+s}else{let a=0,l=(0,t.Z)(n,e.top+i+s,e.bottom-e.columnSizes[a].height);for(const c of o)c.col!==a&&(a=c.col,l=(0,t.Z)(n,e.top+i+s,e.bottom-e.columnSizes[a].height)),c.top=l,c.left+=e.left+s,c.left=r.leftForLtr(r.x(c.left),c.width),l+=c.height+s}}isHorizontal(){return"top"===this.options.position||"bottom"===this.options.position}draw(){const e=this;if(e.options.display){const i=e.ctx;(0,t.U)(i,e),e._draw(),(0,t.W)(i)}}_draw(){const e=this,{options:i,columnSizes:o,lineWidths:n,ctx:s}=e,{align:a,labels:r}=i,l=t.d.color,c=(0,t.au)(i.rtl,e.left,e.width),h=(0,t.X)(r.font),{color:d,padding:u}=r,g=h.size,p=g/2;let f;e.drawTitle(),s.textAlign=c.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=h.string;const{boxWidth:m,boxHeight:x,itemHeight:b}=wo(r,g),_=e.isHorizontal(),y=this._computeTitleHeight();f=_?{x:(0,t.Z)(a,e.left+u,e.right-n[0]),y:e.top+u+y,line:0}:{x:e.left+u,y:(0,t.Z)(a,e.top+y+u,e.bottom-o[0].height),line:0},(0,t.av)(e.ctx,i.textDirection);const v=b+u;e.legendItems.forEach((M,w)=>{s.strokeStyle=M.fontColor||d,s.fillStyle=M.fontColor||d;const k=s.measureText(M.text).width,S=c.textAlign(M.textAlign||(M.textAlign=r.textAlign)),D=m+p+k;let P=f.x,C=f.y;c.setWidth(e.width),_?w>0&&P+D+u>e.right&&(C=f.y+=v,f.line++,P=f.x=(0,t.Z)(a,e.left+u,e.right-n[f.line])):w>0&&C+v>e.bottom&&(P=f.x=P+o[f.line].width+u,f.line++,C=f.y=(0,t.Z)(a,e.top+y+u,e.bottom-o[f.line].height)),function(e,i,o){if(isNaN(m)||m<=0||isNaN(x)||x<0)return;s.save();const n=(0,t.v)(o.lineWidth,1);if(s.fillStyle=(0,t.v)(o.fillStyle,l),s.lineCap=(0,t.v)(o.lineCap,"butt"),s.lineDashOffset=(0,t.v)(o.lineDashOffset,0),s.lineJoin=(0,t.v)(o.lineJoin,"miter"),s.lineWidth=n,s.strokeStyle=(0,t.v)(o.strokeStyle,l),s.setLineDash((0,t.v)(o.lineDash,[])),r.usePointStyle){const a={radius:m*Math.SQRT2/2,pointStyle:o.pointStyle,rotation:o.rotation,borderWidth:n},r=c.xPlus(e,m/2),l=i+p;(0,t.ao)(s,a,r,l)}else{const a=i+Math.max((g-x)/2,0),r=c.leftForLtr(e,m),l=(0,t.ar)(o.borderRadius);s.beginPath(),Object.values(l).some(t=>0!==t)?(0,t.ap)(s,{x:r,y:a,w:m,h:x,radius:l}):s.rect(r,a,m,x),s.fill(),0!==n&&s.stroke()}s.restore()}(c.x(P),C,M),P=(0,t.aw)(S,P+m+p,_?P+D:e.right,i.rtl),function(e,i,o){(0,t.V)(s,o.text,e,i+b/2,h,{strikethrough:o.hidden,textAlign:c.textAlign(o.textAlign)})}(c.x(P),C,M),_?f.x+=D+u:f.y+=v}),(0,t.ax)(e.ctx,i.textDirection)}drawTitle(){const e=this,i=e.options,o=i.title,n=(0,t.X)(o.font),s=(0,t.A)(o.padding);if(!o.display)return;const a=(0,t.au)(i.rtl,e.left,e.width),r=e.ctx,l=o.position,c=n.size/2,h=s.top+c;let d,u=e.left,g=e.width;if(this.isHorizontal())g=Math.max(...e.lineWidths),d=e.top+h,u=(0,t.Z)(i.align,u,e.right-g);else{const o=e.columnSizes.reduce((t,e)=>Math.max(t,e.height),0);d=h+(0,t.Z)(i.align,e.top,e.bottom-o-i.labels.padding-e._computeTitleHeight())}const p=(0,t.Z)(l,u,u+g);r.textAlign=a.textAlign((0,t.Y)(l)),r.textBaseline="middle",r.strokeStyle=o.color,r.fillStyle=o.color,r.font=n.string,(0,t.V)(r,o.text,p,d,n)}_computeTitleHeight(){const e=this.options.title,i=(0,t.X)(e.font),o=(0,t.A)(e.padding);return e.display?i.lineHeight+o.height:0}_getLegendItemAt(t,e){const i=this;let o,n,s;if(t>=i.left&&t<=i.right&&e>=i.top&&e<=i.bottom)for(s=i.legendHitBoxes,o=0;o<s.length;++o)if(t>=(n=s[o]).left&&t<=n.left+n.width&&e>=n.top&&e<=n.top+n.height)return i.legendItems[o];return null}handleEvent(e){const i=this,o=i.options;if(!Do(e.type,o))return;const n=i._getLegendItemAt(e.x,e.y);if("mousemove"===e.type){const s=i._hoveredItem,a=ko(s,n);s&&!a&&(0,t.M)(o.onLeave,[e,s,i],i),i._hoveredItem=n,n&&!a&&(0,t.M)(o.onHover,[e,n,i],i)}else n&&(0,t.M)(o.onClick,[e,n,i],i)}}function Do(t,e){return!("mousemove"!==t||!e.onHover&&!e.onLeave)||!(!e.onClick||"click"!==t&&"mouseup"!==t)}var Po={id:"legend",_element:So,start(t,e,i){const o=t.legend=new So({ctx:t.ctx,options:i,chart:t});Tt.configure(t,o,i),Tt.addBox(t,o)},stop(t){Tt.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,e,i){const o=t.legend;Tt.configure(t,o,i),o.options=i},afterUpdate(t){const e=t.legend;e.buildLabels(),e.adjustHitBoxes()},afterEvent(t,e){e.replay||t.legend.handleEvent(e.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(t,e,i){const o=e.datasetIndex,n=i.chart;n.isDatasetVisible(o)?(n.hide(o),e.hidden=!0):(n.show(o),e.hidden=!1)},onHover:null,onLeave:null,labels:{color:t=>t.chart.options.color,boxWidth:40,padding:10,generateLabels(e){const i=e.data.datasets,{labels:{usePointStyle:o,pointStyle:n,textAlign:s,color:a}}=e.legend.options;return e._getSortedDatasetMetas().map(e=>{const r=e.controller.getStyle(o?0:void 0),l=(0,t.A)(r.borderWidth);return{text:i[e.index].label,fillStyle:r.backgroundColor,fontColor:a,hidden:!e.visible,lineCap:r.borderCapStyle,lineDash:r.borderDash,lineDashOffset:r.borderDashOffset,lineJoin:r.borderJoinStyle,lineWidth:(l.width+l.height)/4,strokeStyle:r.borderColor,pointStyle:n||r.pointStyle,rotation:r.rotation,textAlign:s||r.textAlign,borderRadius:0,datasetIndex:e.index}},this)}},title:{color:t=>t.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:t=>!t.startsWith("on"),labels:{_scriptable:t=>!["generateLabels","filter","sort"].includes(t)}}};exports.Legend=Po;class Co extends te{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(e,i){const o=this,n=o.options;if(o.left=0,o.top=0,!n.display)return void(o.width=o.height=o.right=o.bottom=0);o.width=o.right=e,o.height=o.bottom=i;const s=(0,t.b)(n.text)?n.text.length:1;o._padding=(0,t.A)(n.padding);const a=s*(0,t.X)(n.font).lineHeight+o._padding.height;o.isHorizontal()?o.height=a:o.width=a}isHorizontal(){const t=this.options.position;return"top"===t||"bottom"===t}_drawArgs(e){const{top:i,left:o,bottom:n,right:s,options:a}=this,r=a.align;let l,c,h,d=0;return this.isHorizontal()?(c=(0,t.Z)(r,o,s),h=i+e,l=s-o):("left"===a.position?(c=o+e,h=(0,t.Z)(r,n,i),d=-.5*t.P):(c=s-e,h=(0,t.Z)(r,i,n),d=.5*t.P),l=n-i),{titleX:c,titleY:h,maxWidth:l,rotation:d}}draw(){const e=this.ctx,i=this.options;if(!i.display)return;const o=(0,t.X)(i.font),n=o.lineHeight/2+this._padding.top,{titleX:s,titleY:a,maxWidth:r,rotation:l}=this._drawArgs(n);(0,t.V)(e,i.text,0,0,o,{color:i.color,maxWidth:r,rotation:l,textAlign:(0,t.Y)(i.align),textBaseline:"middle",translation:[s,a]})}}function Ao(t,e){const i=new Co({ctx:t.ctx,options:e,chart:t});Tt.configure(t,i,e),Tt.addBox(t,i),t.titleBlock=i}var Lo={id:"title",_element:Co,start(t,e,i){Ao(t,i)},stop(t){const e=t.titleBlock;Tt.removeBox(t,e),delete t.titleBlock},beforeUpdate(t,e,i){const o=t.titleBlock;Tt.configure(t,o,i),o.options=i},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};exports.Title=Lo;const To=new WeakMap;var Oo={id:"subtitle",start(t,e,i){const o=new Co({ctx:t.ctx,options:i,chart:t});Tt.configure(t,o,i),Tt.addBox(t,o),To.set(t,o)},stop(t){Tt.removeBox(t,To.get(t)),To.delete(t)},beforeUpdate(t,e,i){const o=To.get(t);Tt.configure(t,o,i),o.options=i},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};exports.SubTitle=Oo;const Eo={average(t){if(!t.length)return!1;let e,i,o=0,n=0,s=0;for(e=0,i=t.length;e<i;++e){const i=t[e].element;if(i&&i.hasValue()){const t=i.tooltipPosition();o+=t.x,n+=t.y,++s}}return{x:o/s,y:n/s}},nearest(e,i){if(!e.length)return!1;let o,n,s,a=i.x,r=i.y,l=Number.POSITIVE_INFINITY;for(o=0,n=e.length;o<n;++o){const n=e[o].element;if(n&&n.hasValue()){const e=n.getCenterPoint(),o=(0,t.az)(i,e);o<l&&(l=o,s=n)}}if(s){const t=s.tooltipPosition();a=t.x,r=t.y}return{x:a,y:r}}};function Ro(e,i){return i&&((0,t.b)(i)?Array.prototype.push.apply(e,i):e.push(i)),e}function zo(t){return("string"==typeof t||t instanceof String)&&t.indexOf("\n")>-1?t.split("\n"):t}function Fo(t,e){const{element:i,datasetIndex:o,index:n}=e,s=t.getDatasetMeta(o).controller,{label:a,value:r}=s.getLabelAndValue(n);return{chart:t,label:a,parsed:s.getParsed(n),raw:t.data.datasets[o].data[n],formattedValue:r,dataset:s.getDataset(),dataIndex:n,datasetIndex:o,element:i}}function Bo(e,i){const o=e._chart.ctx,{body:n,footer:s,title:a}=e,{boxWidth:r,boxHeight:l}=i,c=(0,t.X)(i.bodyFont),h=(0,t.X)(i.titleFont),d=(0,t.X)(i.footerFont),u=a.length,g=s.length,p=n.length,f=(0,t.A)(i.padding);let m=f.height,x=0,b=n.reduce((t,e)=>t+e.before.length+e.lines.length+e.after.length,0);if(b+=e.beforeBody.length+e.afterBody.length,u&&(m+=u*h.lineHeight+(u-1)*i.titleSpacing+i.titleMarginBottom),b){m+=p*(i.displayColors?Math.max(l,c.lineHeight):c.lineHeight)+(b-p)*c.lineHeight+(b-1)*i.bodySpacing}g&&(m+=i.footerMarginTop+g*d.lineHeight+(g-1)*i.footerSpacing);let _=0;const y=function(t){x=Math.max(x,o.measureText(t).width+_)};return o.save(),o.font=h.string,(0,t.B)(e.title,y),o.font=c.string,(0,t.B)(e.beforeBody.concat(e.afterBody),y),_=i.displayColors?r+2:0,(0,t.B)(n,e=>{(0,t.B)(e.before,y),(0,t.B)(e.lines,y),(0,t.B)(e.after,y)}),_=0,o.font=d.string,(0,t.B)(e.footer,y),o.restore(),{width:x+=f.width,height:m}}function Io(t,e){const{y:i,height:o}=e;return i<o/2?"top":i>t.height-o/2?"bottom":"center"}function Vo(t,e,i,o){const{x:n,width:s}=o,a=i.caretSize+i.caretPadding;return"left"===t&&n+s+a>e.width||("right"===t&&n-s-a<0||void 0)}function Wo(t,e,i,o){const{x:n,width:s}=i,{width:a,chartArea:{left:r,right:l}}=t;let c="center";return"center"===o?c=n<=(r+l)/2?"left":"right":n<=s/2?c="left":n>=a-s/2&&(c="right"),Vo(c,t,e,i)&&(c="center"),c}function jo(t,e,i){const o=e.yAlign||Io(t,i);return{xAlign:e.xAlign||Wo(t,e,i,o),yAlign:o}}function Ho(t,e){let{x:i,width:o}=t;return"right"===e?i-=o:"center"===e&&(i-=o/2),i}function No(t,e,i){let{y:o,height:n}=t;return"top"===e?o+=i:o-="bottom"===e?n+i:n/2,o}function $o(e,i,o,n){const{caretSize:s,caretPadding:a,cornerRadius:r}=e,{xAlign:l,yAlign:c}=o,h=s+a,d=r+a;let u=Ho(i,l);const g=No(i,c,h);return"center"===c?"left"===l?u+=h:"right"===l&&(u-=h):"left"===l?u-=d:"right"===l&&(u+=d),{x:(0,t.q)(u,0,n.width-i.width),y:(0,t.q)(g,0,n.height-i.height)}}function Uo(e,i,o){const n=(0,t.A)(o.padding);return"center"===i?e.x+e.width/2:"right"===i?e.x+e.width-n.right:e.x+n.left}function Xo(t){return Ro([],zo(t))}function Yo(t,e,i){return Object.assign(Object.create(t),{tooltip:e,tooltipItems:i,type:"tooltip"})}function qo(t,e){const i=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return i?t.override(i):t}class Jo extends te{constructor(t){super(),this.opacity=0,this._active=[],this._chart=t._chart,this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this,e=t._cachedAnimations;if(e)return e;const i=t._chart,o=t.options.setContext(t.getContext()),n=o.enabled&&i.options.animation&&o.animations,s=new c(t._chart,n);return n._cacheable&&(t._cachedAnimations=Object.freeze(s)),s}getContext(){const t=this;return t.$context||(t.$context=Yo(t._chart.getContext(),t,t._tooltipItems))}getTitle(t,e){const{callbacks:i}=e,o=i.beforeTitle.apply(this,[t]),n=i.title.apply(this,[t]),s=i.afterTitle.apply(this,[t]);let a=[];return a=Ro(a,zo(o)),a=Ro(a,zo(n)),a=Ro(a,zo(s))}getBeforeBody(t,e){return Xo(e.callbacks.beforeBody.apply(this,[t]))}getBody(e,i){const o=this,{callbacks:n}=i,s=[];return(0,t.B)(e,t=>{const e={before:[],lines:[],after:[]},i=qo(n,t);Ro(e.before,zo(i.beforeLabel.call(o,t))),Ro(e.lines,i.label.call(o,t)),Ro(e.after,zo(i.afterLabel.call(o,t))),s.push(e)}),s}getAfterBody(t,e){return Xo(e.callbacks.afterBody.apply(this,[t]))}getFooter(t,e){const{callbacks:i}=e,o=i.beforeFooter.apply(this,[t]),n=i.footer.apply(this,[t]),s=i.afterFooter.apply(this,[t]);let a=[];return a=Ro(a,zo(o)),a=Ro(a,zo(n)),a=Ro(a,zo(s))}_createItems(e){const i=this,o=i._active,n=i._chart.data,s=[],a=[],r=[];let l,c,h=[];for(l=0,c=o.length;l<c;++l)h.push(Fo(i._chart,o[l]));return e.filter&&(h=h.filter((t,i,o)=>e.filter(t,i,o,n))),e.itemSort&&(h=h.sort((t,i)=>e.itemSort(t,i,n))),(0,t.B)(h,t=>{const o=qo(e.callbacks,t);s.push(o.labelColor.call(i,t)),a.push(o.labelPointStyle.call(i,t)),r.push(o.labelTextColor.call(i,t))}),i.labelColors=s,i.labelPointStyles=a,i.labelTextColors=r,i.dataPoints=h,h}update(t,e){const i=this,o=i.options.setContext(i.getContext()),n=i._active;let s,a=[];if(n.length){const t=Eo[o.position].call(i,n,i._eventPosition);a=i._createItems(o),i.title=i.getTitle(a,o),i.beforeBody=i.getBeforeBody(a,o),i.body=i.getBody(a,o),i.afterBody=i.getAfterBody(a,o),i.footer=i.getFooter(a,o);const e=i._size=Bo(i,o),r=Object.assign({},t,e),l=jo(i._chart,o,r),c=$o(o,r,l,i._chart);i.xAlign=l.xAlign,i.yAlign=l.yAlign,s={opacity:1,x:c.x,y:c.y,width:e.width,height:e.height,caretX:t.x,caretY:t.y}}else 0!==i.opacity&&(s={opacity:0});i._tooltipItems=a,i.$context=void 0,s&&i._resolveAnimations().update(i,s),t&&o.external&&o.external.call(i,{chart:i._chart,tooltip:i,replay:e})}drawCaret(t,e,i,o){const n=this.getCaretPosition(t,i,o);e.lineTo(n.x1,n.y1),e.lineTo(n.x2,n.y2),e.lineTo(n.x3,n.y3)}getCaretPosition(t,e,i){const{xAlign:o,yAlign:n}=this,{cornerRadius:s,caretSize:a}=i,{x:r,y:l}=t,{width:c,height:h}=e;let d,u,g,p,f,m;return"center"===n?(f=l+h/2,"left"===o?(u=(d=r)-a,p=f+a,m=f-a):(u=(d=r+c)+a,p=f-a,m=f+a),g=d):(u="left"===o?r+s+a:"right"===o?r+c-s-a:this.caretX,"top"===n?(f=(p=l)-a,d=u-a,g=u+a):(f=(p=l+h)+a,d=u+a,g=u-a),m=p),{x1:d,x2:u,x3:g,y1:p,y2:f,y3:m}}drawTitle(e,i,o){const n=this,s=n.title,a=s.length;let r,l,c;if(a){const h=(0,t.au)(o.rtl,n.x,n.width);for(e.x=Uo(n,o.titleAlign,o),i.textAlign=h.textAlign(o.titleAlign),i.textBaseline="middle",r=(0,t.X)(o.titleFont),l=o.titleSpacing,i.fillStyle=o.titleColor,i.font=r.string,c=0;c<a;++c)i.fillText(s[c],h.x(e.x),e.y+r.lineHeight/2),e.y+=r.lineHeight+l,c+1===a&&(e.y+=o.titleMarginBottom-l)}}_drawColorBox(e,i,o,n,s){const a=this.labelColors[o],r=this.labelPointStyles[o],{boxHeight:l,boxWidth:c}=s,h=(0,t.X)(s.bodyFont),d=Uo(this,"left",s),u=n.x(d),g=l<h.lineHeight?(h.lineHeight-l)/2:0,p=i.y+g;if(s.usePointStyle){const i={radius:Math.min(c,l)/2,pointStyle:r.pointStyle,rotation:r.rotation,borderWidth:1},o=n.leftForLtr(u,c)+c/2,h=p+l/2;e.strokeStyle=s.multiKeyBackground,e.fillStyle=s.multiKeyBackground,(0,t.ao)(e,i,o,h),e.strokeStyle=a.borderColor,e.fillStyle=a.backgroundColor,(0,t.ao)(e,i,o,h)}else{e.lineWidth=a.borderWidth||1,e.strokeStyle=a.borderColor,e.setLineDash(a.borderDash||[]),e.lineDashOffset=a.borderDashOffset||0;const i=n.leftForLtr(u,c),o=n.leftForLtr(n.xPlus(u,1),c-2),r=(0,t.ar)(a.borderRadius);Object.values(r).some(t=>0!==t)?(e.beginPath(),e.fillStyle=s.multiKeyBackground,(0,t.ap)(e,{x:i,y:p,w:c,h:l,radius:r}),e.fill(),e.stroke(),e.fillStyle=a.backgroundColor,e.beginPath(),(0,t.ap)(e,{x:o,y:p+1,w:c-2,h:l-2,radius:r}),e.fill()):(e.fillStyle=s.multiKeyBackground,e.fillRect(i,p,c,l),e.strokeRect(i,p,c,l),e.fillStyle=a.backgroundColor,e.fillRect(o,p+1,c-2,l-2))}e.fillStyle=this.labelTextColors[o]}drawBody(e,i,o){const n=this,{body:s}=n,{bodySpacing:a,bodyAlign:r,displayColors:l,boxHeight:c,boxWidth:h}=o,d=(0,t.X)(o.bodyFont);let u=d.lineHeight,g=0;const p=(0,t.au)(o.rtl,n.x,n.width),f=function(t){i.fillText(t,p.x(e.x+g),e.y+u/2),e.y+=u+a},m=p.textAlign(r);let x,b,_,y,v,M,w;for(i.textAlign=r,i.textBaseline="middle",i.font=d.string,e.x=Uo(n,m,o),i.fillStyle=o.bodyColor,(0,t.B)(n.beforeBody,f),g=l&&"right"!==m?"center"===r?h/2+1:h+2:0,y=0,M=s.length;y<M;++y){for(x=s[y],b=n.labelTextColors[y],i.fillStyle=b,(0,t.B)(x.before,f),_=x.lines,l&&_.length&&(n._drawColorBox(i,e,y,p,o),u=Math.max(d.lineHeight,c)),v=0,w=_.length;v<w;++v)f(_[v]),u=d.lineHeight;(0,t.B)(x.after,f)}g=0,u=d.lineHeight,(0,t.B)(n.afterBody,f),e.y-=a}drawFooter(e,i,o){const n=this,s=n.footer,a=s.length;let r,l;if(a){const c=(0,t.au)(o.rtl,n.x,n.width);for(e.x=Uo(n,o.footerAlign,o),e.y+=o.footerMarginTop,i.textAlign=c.textAlign(o.footerAlign),i.textBaseline="middle",r=(0,t.X)(o.footerFont),i.fillStyle=o.footerColor,i.font=r.string,l=0;l<a;++l)i.fillText(s[l],c.x(e.x),e.y+r.lineHeight/2),e.y+=r.lineHeight+o.footerSpacing}}drawBackground(t,e,i,o){const{xAlign:n,yAlign:s}=this,{x:a,y:r}=t,{width:l,height:c}=i,h=o.cornerRadius;e.fillStyle=o.backgroundColor,e.strokeStyle=o.borderColor,e.lineWidth=o.borderWidth,e.beginPath(),e.moveTo(a+h,r),"top"===s&&this.drawCaret(t,e,i,o),e.lineTo(a+l-h,r),e.quadraticCurveTo(a+l,r,a+l,r+h),"center"===s&&"right"===n&&this.drawCaret(t,e,i,o),e.lineTo(a+l,r+c-h),e.quadraticCurveTo(a+l,r+c,a+l-h,r+c),"bottom"===s&&this.drawCaret(t,e,i,o),e.lineTo(a+h,r+c),e.quadraticCurveTo(a,r+c,a,r+c-h),"center"===s&&"left"===n&&this.drawCaret(t,e,i,o),e.lineTo(a,r+h),e.quadraticCurveTo(a,r,a+h,r),e.closePath(),e.fill(),o.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this,i=e._chart,o=e.$animations,n=o&&o.x,s=o&&o.y;if(n||s){const o=Eo[t.position].call(e,e._active,e._eventPosition);if(!o)return;const a=e._size=Bo(e,t),r=Object.assign({},o,e._size),l=jo(i,t,r),c=$o(t,r,l,i);n._to===c.x&&s._to===c.y||(e.xAlign=l.xAlign,e.yAlign=l.yAlign,e.width=a.width,e.height=a.height,e.caretX=o.x,e.caretY=o.y,e._resolveAnimations().update(e,c))}}draw(e){const i=this,o=i.options.setContext(i.getContext());let n=i.opacity;if(!n)return;i._updateAnimationTarget(o);const s={width:i.width,height:i.height},a={x:i.x,y:i.y};n=Math.abs(n)<.001?0:n;const r=(0,t.A)(o.padding),l=i.title.length||i.beforeBody.length||i.body.length||i.afterBody.length||i.footer.length;o.enabled&&l&&(e.save(),e.globalAlpha=n,i.drawBackground(a,e,s,o),(0,t.av)(e,o.textDirection),a.y+=r.top,i.drawTitle(a,e,o),i.drawBody(a,e,o),i.drawFooter(a,e,o),(0,t.ax)(e,o.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,i){const o=this,n=o._active,s=e.map(({datasetIndex:t,index:e})=>{const i=o._chart.getDatasetMeta(t);if(!i)throw new Error("Cannot find a dataset at index "+t);return{datasetIndex:t,element:i.data[e],index:e}}),a=!(0,t.ad)(n,s),r=o._positionChanged(s,i);(a||r)&&(o._active=s,o._eventPosition=i,o.update(!0))}handleEvent(e,i){const o=this,n=o.options,s=o._active||[];let a=!1,r=[];"mouseout"!==e.type&&(r=o._chart.getElementsAtEventForMode(e,n.mode,n,i),n.reverse&&r.reverse());const l=o._positionChanged(r,e);return(a=i||!(0,t.ad)(r,s)||l)&&(o._active=r,(n.enabled||n.external)&&(o._eventPosition={x:e.x,y:e.y},o.update(!0,i))),a}_positionChanged(t,e){const{caretX:i,caretY:o,options:n}=this,s=Eo[n.position].call(this,t,e);return!1!==s&&(i!==s.x||o!==s.y)}}Jo.positioners=Eo;var Ko={id:"tooltip",_element:Jo,positioners:Eo,afterInit(t,e,i){i&&(t.tooltip=new Jo({_chart:t,options:i}))},beforeUpdate(t,e,i){t.tooltip&&t.tooltip.initialize(i)},reset(t,e,i){t.tooltip&&t.tooltip.initialize(i)},afterDraw(t){const e=t.tooltip,i={tooltip:e};!1!==t.notifyPlugins("beforeTooltipDraw",i)&&(e&&e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",i))},afterEvent(t,e){if(t.tooltip){const i=e.replay;t.tooltip.handleEvent(e.event,i)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:{beforeTitle:t.ay,title(t){if(t.length>0){const e=t[0],i=e.chart.data.labels,o=i?i.length:0;if(this&&this.options&&"dataset"===this.options.mode)return e.dataset.label||"";if(e.label)return e.label;if(o>0&&e.dataIndex<o)return i[e.dataIndex]}return""},afterTitle:t.ay,beforeBody:t.ay,beforeLabel:t.ay,label(e){if(this&&this.options&&"dataset"===this.options.mode)return e.label+": "+e.formattedValue||e.formattedValue;let i=e.dataset.label||"";i&&(i+=": ");const o=e.formattedValue;return(0,t.j)(o)||(i+=o),i},labelColor(t){const e=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(t){const e=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:t.ay,afterBody:t.ay,beforeFooter:t.ay,footer:t.ay,afterFooter:t.ay}},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>"filter"!==t&&"itemSort"!==t&&"external"!==t,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};exports.Tooltip=Ko;var Zo=Object.freeze({__proto__:null,Decimation:qi,Filler:Mo,Legend:Po,SubTitle:Oo,Title:Lo,Tooltip:Ko});exports.plugins=Zo;const Go=(t,e,i)=>"string"==typeof e?t.push(e)-1:isNaN(e)?null:i;function Qo(t,e,i){const o=t.indexOf(e);return-1===o?Go(t,e,i):o!==t.lastIndexOf(e)?i:o}const tn=(e,i)=>null===e?null:(0,t.q)(Math.round(e),0,i);class en extends Me{constructor(t){super(t),this._startValue=void 0,this._valueRange=0}parse(e,i){if((0,t.j)(e))return null;const o=this.getLabels();return i=isFinite(i)&&o[i]===e?i:Qo(o,e,(0,t.v)(i,e)),tn(i,o.length-1)}determineDataLimits(){const t=this,{minDefined:e,maxDefined:i}=t.getUserBounds();let{min:o,max:n}=t.getMinMax(!0);"ticks"===t.options.bounds&&(e||(o=0),i||(n=t.getLabels().length-1)),t.min=o,t.max=n}buildTicks(){const t=this,e=t.min,i=t.max,o=t.options.offset,n=[];let s=t.getLabels();s=0===e&&i===s.length-1?s:s.slice(e,i+1),t._valueRange=Math.max(s.length-(o?0:1),1),t._startValue=t.min-(o?.5:0);for(let a=e;a<=i;a++)n.push({value:a});return n}getLabelForValue(t){const e=this.getLabels();return t>=0&&t<e.length?e[t]:t}configure(){const t=this;super.configure(),t.isHorizontal()||(t._reversePixels=!t._reversePixels)}getPixelForValue(t){const e=this;return"number"!=typeof t&&(t=e.parse(t)),null===t?NaN:e.getPixelForDecimal((t-e._startValue)/e._valueRange)}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}function on(e,i){const o=[],{bounds:n,step:s,min:a,max:r,precision:l,count:c,maxTicks:h,maxDigits:d,includeBounds:u}=e,g=s||1,p=h-1,{min:f,max:m}=i,x=!(0,t.j)(a),b=!(0,t.j)(r),_=!(0,t.j)(c),y=(m-f)/(d+1);let v,M,w,k,S=(0,t.aB)((m-f)/p/g)*g;if(S<1e-14&&!x&&!b)return[{value:f},{value:m}];(k=Math.ceil(m/S)-Math.floor(f/S))>p&&(S=(0,t.aB)(k*S/p/g)*g),(0,t.j)(l)||(v=Math.pow(10,l),S=Math.ceil(S*v)/v),"ticks"===n?(M=Math.floor(f/S)*S,w=Math.ceil(m/S)*S):(M=f,w=m),x&&b&&s&&(0,t.aC)((r-a)/s,S/1e3)?(S=(r-a)/(k=Math.round(Math.min((r-a)/S,h))),M=a,w=r):_?S=((w=b?r:w)-(M=x?a:M))/(k=c-1):(k=(w-M)/S,k=(0,t.aD)(k,Math.round(k),S/1e3)?Math.round(k):Math.ceil(k));const D=Math.max((0,t.aE)(S),(0,t.aE)(M));v=Math.pow(10,(0,t.j)(l)?D:l),M=Math.round(M*v)/v,w=Math.round(w*v)/v;let P=0;for(x&&(u&&M!==a?(o.push({value:a}),M<a&&P++,(0,t.aD)(Math.round((M+P*S)*v)/v,a,nn(a,y,e))&&P++):M<a&&P++);P<k;++P)o.push({value:Math.round((M+P*S)*v)/v});return b&&u&&w!==r?(0,t.aD)(o[o.length-1].value,r,nn(r,y,e))?o[o.length-1].value=r:o.push({value:r}):b&&w!==r||o.push({value:w}),o}function nn(e,i,{horizontal:o,minRotation:n}){const s=(0,t.t)(n),a=(o?Math.sin(s):Math.cos(s))||.001,r=.75*i*(""+e).length;return Math.min(i/a,r)}exports.CategoryScale=en,en.id="category",en.defaults={ticks:{callback:en.prototype.getLabelForValue}};class sn extends Me{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(e,i){return(0,t.j)(e)?null:("number"==typeof e||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){const e=this,{beginAtZero:i}=e.options,{minDefined:o,maxDefined:n}=e.getUserBounds();let{min:s,max:a}=e;const r=t=>s=o?s:t,l=t=>a=n?a:t;if(i){const e=(0,t.s)(s),i=(0,t.s)(a);e<0&&i<0?l(0):e>0&&i>0&&r(0)}if(s===a){let t=1;(a>=Number.MAX_SAFE_INTEGER||s<=Number.MIN_SAFE_INTEGER)&&(t=Math.abs(.05*a)),l(a+t),i||r(s-t)}e.min=s,e.max=a}getTickLimit(){const t=this,e=t.options.ticks;let i,{maxTicksLimit:o,stepSize:n}=e;return n?i=Math.ceil(t.max/n)-Math.floor(t.min/n)+1:(i=t.computeTickLimit(),o=o||11),o&&(i=Math.min(o,i)),i}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const e=this,i=e.options,o=i.ticks;let n=e.getTickLimit();const s=on({maxTicks:n=Math.max(2,n),bounds:i.bounds,min:i.min,max:i.max,precision:o.precision,step:o.stepSize,count:o.count,maxDigits:e._maxDigits(),horizontal:e.isHorizontal(),minRotation:o.minRotation||0,includeBounds:!1!==o.includeBounds},e._range||e);return"ticks"===i.bounds&&(0,t.aA)(s,e,"value"),i.reverse?(s.reverse(),e.start=e.max,e.end=e.min):(e.start=e.min,e.end=e.max),s}configure(){const t=this,e=t.ticks;let i=t.min,o=t.max;if(super.configure(),t.options.offset&&e.length){const t=(o-i)/Math.max(e.length-1,1)/2;i-=t,o+=t}t._startValue=i,t._endValue=o,t._valueRange=o-i}getLabelForValue(e){return(0,t.n)(e,this.chart.options.locale)}}class an extends sn{determineDataLimits(){const{min:e,max:i}=this.getMinMax(!0);this.min=(0,t.g)(e)?e:0,this.max=(0,t.g)(i)?i:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this,i=e.isHorizontal(),o=i?e.width:e.height,n=(0,t.t)(e.options.ticks.minRotation),s=(i?Math.sin(n):Math.cos(n))||.001,a=e._resolveTickFontOptions(0);return Math.ceil(o/Math.min(40,a.lineHeight/s))}getPixelForValue(t){return null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}function rn(e){return 1===e/Math.pow(10,Math.floor((0,t.J)(e)))}function ln(e,i){const o=Math.floor((0,t.J)(i.max)),n=Math.ceil(i.max/Math.pow(10,o)),s=[];let a=(0,t.L)(e.min,Math.pow(10,Math.floor((0,t.J)(i.min)))),r=Math.floor((0,t.J)(a)),l=Math.floor(a/Math.pow(10,r)),c=r<0?Math.pow(10,Math.abs(r)):1;do{s.push({value:a,major:rn(a)}),10===++l&&(l=1,c=++r>=0?1:c),a=Math.round(l*Math.pow(10,r)*c)/c}while(r<o||r===o&&l<n);const h=(0,t.L)(e.max,a);return s.push({value:h,major:rn(a)}),s}exports.LinearScale=an,an.id="linear",an.defaults={ticks:{callback:oe.formatters.numeric}};class cn extends Me{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(e,i){const o=sn.prototype.parse.apply(this,[e,i]);if(0!==o)return(0,t.g)(o)&&o>0?o:null;this._zero=!0}determineDataLimits(){const e=this,{min:i,max:o}=e.getMinMax(!0);e.min=(0,t.g)(i)?Math.max(0,i):null,e.max=(0,t.g)(o)?Math.max(0,o):null,e.options.beginAtZero&&(e._zero=!0),e.handleTickRangeOptions()}handleTickRangeOptions(){const e=this,{minDefined:i,maxDefined:o}=e.getUserBounds();let n=e.min,s=e.max;const a=t=>n=i?n:t,r=t=>s=o?s:t,l=(e,i)=>Math.pow(10,Math.floor((0,t.J)(e))+i);n===s&&(n<=0?(a(1),r(10)):(a(l(n,-1)),r(l(s,1)))),n<=0&&a(l(s,-1)),s<=0&&r(l(n,1)),e._zero&&e.min!==e._suggestedMin&&n===l(e.min,0)&&a(l(n,-1)),e.min=n,e.max=s}buildTicks(){const e=this,i=e.options,o=ln({min:e._userMin,max:e._userMax},e);return"ticks"===i.bounds&&(0,t.aA)(o,e,"value"),i.reverse?(o.reverse(),e.start=e.max,e.end=e.min):(e.start=e.min,e.end=e.max),o}getLabelForValue(e){return void 0===e?"0":(0,t.n)(e,this.chart.options.locale)}configure(){const e=this.min;super.configure(),this._startValue=(0,t.J)(e),this._valueRange=(0,t.J)(this.max)-(0,t.J)(e)}getPixelForValue(e){const i=this;return void 0!==e&&0!==e||(e=i.min),null===e||isNaN(e)?NaN:i.getPixelForDecimal(e===i.min?0:((0,t.J)(e)-i._startValue)/i._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}function hn(e){const i=e.ticks;if(i.display&&e.display){const e=(0,t.A)(i.backdropPadding);return(0,t.v)(i.font&&i.font.size,t.d.font.size)+e.height}return 0}function dn(e,i,o){return o=(0,t.b)(o)?o:[o],{w:(0,t.aF)(e,i.string,o),h:o.length*i.lineHeight}}function un(t,e,i,o,n){return t===o||t===n?{start:e-i/2,end:e+i/2}:t<o||t>n?{start:e-i,end:e}:{start:e,end:e+i}}function gn(e){const i={l:0,r:e.width,t:0,b:e.height-e.paddingTop},o={},n=[],s=[],a=e.getLabels().length;for(let r=0;r<a;r++){const a=e.options.pointLabels.setContext(e.getPointLabelContext(r));s[r]=a.padding;const l=e.getPointPosition(r,e.drawingArea+s[r]),c=(0,t.X)(a.font),h=dn(e.ctx,c,e._pointLabels[r]);n[r]=h;const d=e.getIndexAngle(r),u=(0,t.O)(d),g=un(u,l.x,h.w,0,180),p=un(u,l.y,h.h,90,270);g.start<i.l&&(i.l=g.start,o.l=d),g.end>i.r&&(i.r=g.end,o.r=d),p.start<i.t&&(i.t=p.start,o.t=d),p.end>i.b&&(i.b=p.end,o.b=d)}e._setReductions(e.drawingArea,i,o),e._pointLabelItems=pn(e,n,s)}function pn(e,i,o){const n=[],s=e.getLabels().length,a=e.options,r=hn(a),l=e.getDistanceFromCenterForValue(a.ticks.reverse?e.min:e.max);for(let c=0;c<s;c++){const s=0===c?r/2:0,a=e.getPointPosition(c,l+s+o[c]),h=(0,t.O)(e.getIndexAngle(c)),d=i[c],u=xn(a.y,d.h,h),g=fn(h),p=mn(a.x,d.w,g);n.push({x:a.x,y:u,textAlign:g,left:p,top:u,right:p+d.w,bottom:u+d.h})}return n}function fn(t){return 0===t||180===t?"center":t<180?"left":"right"}function mn(t,e,i){return"right"===i?t-=e:"center"===i&&(t-=e/2),t}function xn(t,e,i){return 90===i||270===i?t-=e/2:(i>270||i<90)&&(t-=e),t}function bn(e,i){const{ctx:o,options:{pointLabels:n}}=e;for(let s=i-1;s>=0;s--){const i=n.setContext(e.getPointLabelContext(s)),a=(0,t.X)(i.font),{x:r,y:l,textAlign:c,left:h,top:d,right:u,bottom:g}=e._pointLabelItems[s],{backdropColor:p}=i;if(!(0,t.j)(p)){const e=(0,t.A)(i.backdropPadding);o.fillStyle=p,o.fillRect(h-e.left,d-e.top,u-h+e.width,g-d+e.height)}(0,t.V)(o,e._pointLabels[s],r,l+a.lineHeight/2,a,{color:i.color,textAlign:c,textBaseline:"middle"})}}function _n(e,i,o,n){const{ctx:s}=e;if(o)s.arc(e.xCenter,e.yCenter,i,0,t.T);else{let t=e.getPointPosition(0,i);s.moveTo(t.x,t.y);for(let o=1;o<n;o++)t=e.getPointPosition(o,i),s.lineTo(t.x,t.y)}}function yn(t,e,i,o){const n=t.ctx,s=e.circular,{color:a,lineWidth:r}=e;!s&&!o||!a||!r||i<0||(n.save(),n.strokeStyle=a,n.lineWidth=r,n.setLineDash(e.borderDash),n.lineDashOffset=e.borderDashOffset,n.beginPath(),_n(t,i,s,o),n.closePath(),n.stroke(),n.restore())}function vn(e){return(0,t.p)(e)?e:0}function Mn(t,e,i){return Object.assign(Object.create(t),{label:i,index:e,type:"pointLabel"})}exports.LogarithmicScale=cn,cn.id="logarithmic",cn.defaults={ticks:{callback:oe.formatters.logarithmic,major:{enabled:!0}}};class wn extends sn{constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this;t.width=t.maxWidth,t.height=t.maxHeight,t.paddingTop=hn(t.options)/2,t.xCenter=Math.floor(t.width/2),t.yCenter=Math.floor((t.height-t.paddingTop)/2),t.drawingArea=Math.min(t.height-t.paddingTop,t.width)/2}determineDataLimits(){const{min:e,max:i}=this.getMinMax(!1);this.min=(0,t.g)(e)&&!isNaN(e)?e:0,this.max=(0,t.g)(i)&&!isNaN(i)?i:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/hn(this.options))}generateTickLabels(e){const i=this;sn.prototype.generateTickLabels.call(i,e),i._pointLabels=i.getLabels().map((e,o)=>{const n=(0,t.M)(i.options.pointLabels.callback,[e,o],i);return n||0===n?n:""})}fit(){const t=this,e=t.options;e.display&&e.pointLabels.display?gn(t):t.setCenterPoint(0,0,0,0)}_setReductions(t,e,i){const o=this;let n=e.l/Math.sin(i.l),s=Math.max(e.r-o.width,0)/Math.sin(i.r),a=-e.t/Math.cos(i.t),r=-Math.max(e.b-(o.height-o.paddingTop),0)/Math.cos(i.b);n=vn(n),s=vn(s),a=vn(a),r=vn(r),o.drawingArea=Math.max(t/2,Math.min(Math.floor(t-(n+s)/2),Math.floor(t-(a+r)/2))),o.setCenterPoint(n,s,a,r)}setCenterPoint(t,e,i,o){const n=this,s=n.width-e-n.drawingArea,a=t+n.drawingArea,r=i+n.drawingArea,l=n.height-n.paddingTop-o-n.drawingArea;n.xCenter=Math.floor((a+s)/2+n.left),n.yCenter=Math.floor((r+l)/2+n.top+n.paddingTop)}getIndexAngle(e){const i=t.T/this.getLabels().length,o=this.options.startAngle||0;return(0,t.at)(e*i+(0,t.t)(o))}getDistanceFromCenterForValue(e){const i=this;if((0,t.j)(e))return NaN;const o=i.drawingArea/(i.max-i.min);return i.options.reverse?(i.max-e)*o:(e-i.min)*o}getValueForDistanceFromCenter(e){if((0,t.j)(e))return NaN;const i=this,o=e/(i.drawingArea/(i.max-i.min));return i.options.reverse?i.max-o:i.min+o}getPointLabelContext(t){const e=this,i=e._pointLabels||[];if(t>=0&&t<i.length){const o=i[t];return Mn(e.getContext(),t,o)}}getPointPosition(e,i){const o=this.getIndexAngle(e)-t.H;return{x:Math.cos(o)*i+this.xCenter,y:Math.sin(o)*i+this.yCenter,angle:o}}getPointPositionForValue(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:e,top:i,right:o,bottom:n}=this._pointLabelItems[t];return{left:e,top:i,right:o,bottom:n}}drawBackground(){const t=this,{backgroundColor:e,grid:{circular:i}}=t.options;if(e){const o=t.ctx;o.save(),o.beginPath(),_n(t,t.getDistanceFromCenterForValue(t._endValue),i,t.getLabels().length),o.closePath(),o.fillStyle=e,o.fill(),o.restore()}}drawGrid(){const t=this,e=t.ctx,i=t.options,{angleLines:o,grid:n}=i,s=t.getLabels().length;let a,r,l;if(i.pointLabels.display&&bn(t,s),n.display&&t.ticks.forEach((e,i)=>{if(0!==i){r=t.getDistanceFromCenterForValue(e.value);const o=n.setContext(t.getContext(i-1));yn(t,o,r,s)}}),o.display){for(e.save(),a=t.getLabels().length-1;a>=0;a--){const n=o.setContext(t.getPointLabelContext(a)),{color:s,lineWidth:c}=n;c&&s&&(e.lineWidth=c,e.strokeStyle=s,e.setLineDash(n.borderDash),e.lineDashOffset=n.borderDashOffset,r=t.getDistanceFromCenterForValue(i.ticks.reverse?t.min:t.max),l=t.getPointPosition(a,r),e.beginPath(),e.moveTo(t.xCenter,t.yCenter),e.lineTo(l.x,l.y),e.stroke())}e.restore()}}drawBorder(){}drawLabels(){const e=this,i=e.ctx,o=e.options,n=o.ticks;if(!n.display)return;const s=e.getIndexAngle(0);let a,r;i.save(),i.translate(e.xCenter,e.yCenter),i.rotate(s),i.textAlign="center",i.textBaseline="middle",e.ticks.forEach((s,l)=>{if(0===l&&!o.reverse)return;const c=n.setContext(e.getContext(l)),h=(0,t.X)(c.font);if(a=e.getDistanceFromCenterForValue(e.ticks[l].value),c.showLabelBackdrop){i.font=h.string,r=i.measureText(s.label).width,i.fillStyle=c.backdropColor;const e=(0,t.A)(c.backdropPadding);i.fillRect(-r/2-e.left,-a-h.size/2-e.top,r+e.width,h.size+e.height)}(0,t.V)(i,s.label,0,-a,h,{color:c.color})}),i.restore()}drawTitle(){}}exports.RadialLinearScale=wn,wn.id="radialLinear",wn.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:oe.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback:t=>t,padding:5}},wn.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"},wn.descriptors={angleLines:{_fallback:"grid"}};const kn={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},Sn=Object.keys(kn);function Dn(t,e){return t-e}function Pn(e,i){if((0,t.j)(i))return null;const o=e._adapter,{parser:n,round:s,isoWeekday:a}=e._parseOpts;let r=i;return"function"==typeof n&&(r=n(r)),(0,t.g)(r)||(r="string"==typeof n?o.parse(r,n):o.parse(r)),null===r?null:(s&&(r="week"!==s||!(0,t.p)(a)&&!0!==a?o.startOf(r,s):o.startOf(r,"isoWeek",a)),+r)}function Cn(t,e,i,o){const n=Sn.length;for(let s=Sn.indexOf(t);s<n-1;++s){const t=kn[Sn[s]],n=t.steps?t.steps:Number.MAX_SAFE_INTEGER;if(t.common&&Math.ceil((i-e)/(n*t.size))<=o)return Sn[s]}return Sn[n-1]}function An(t,e,i,o,n){for(let s=Sn.length-1;s>=Sn.indexOf(i);s--){const i=Sn[s];if(kn[i].common&&t._adapter.diff(n,o,i)>=e-1)return i}return Sn[i?Sn.indexOf(i):0]}function Ln(t){for(let e=Sn.indexOf(t)+1,i=Sn.length;e<i;++e)if(kn[Sn[e]].common)return Sn[e]}function Tn(e,i,o){if(o){if(o.length){const{lo:n,hi:s}=(0,t.aH)(o,i);e[o[n]>=i?o[n]:o[s]]=!0}}else e[i]=!0}function On(t,e,i,o){const n=t._adapter,s=+n.startOf(e[0].value,o),a=e[e.length-1].value;let r,l;for(r=s;r<=a;r=+n.add(r,1,o))(l=i[r])>=0&&(e[l].major=!0);return e}function En(t,e,i){const o=[],n={},s=e.length;let a,r;for(a=0;a<s;++a)n[r=e[a]]=a,o.push({value:r,major:!1});return 0!==s&&i?On(t,o,n,i):o}class Rn extends Me{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(e,i){const o=e.time||(e.time={}),n=this._adapter=new st._date(e.adapters.date);(0,t.a7)(o.displayFormats,n.formats()),this._parseOpts={parser:o.parser,round:o.round,isoWeekday:o.isoWeekday},super.init(e),this._normalized=i.normalized}parse(t,e){return void 0===t?null:Pn(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const e=this,i=e.options,o=e._adapter,n=i.time.unit||"day";let{min:s,max:a,minDefined:r,maxDefined:l}=e.getUserBounds();function c(t){r||isNaN(t.min)||(s=Math.min(s,t.min)),l||isNaN(t.max)||(a=Math.max(a,t.max))}r&&l||(c(e._getLabelBounds()),"ticks"===i.bounds&&"labels"===i.ticks.source||c(e.getMinMax(!1))),s=(0,t.g)(s)&&!isNaN(s)?s:+o.startOf(Date.now(),n),a=(0,t.g)(a)&&!isNaN(a)?a:+o.endOf(Date.now(),n)+1,e.min=Math.min(s,a-1),e.max=Math.max(s+1,a)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){const e=this,i=e.options,o=i.time,n=i.ticks,s="labels"===n.source?e.getLabelTimestamps():e._generate();"ticks"===i.bounds&&s.length&&(e.min=e._userMin||s[0],e.max=e._userMax||s[s.length-1]);const a=e.min,r=e.max,l=(0,t.aG)(s,a,r);return e._unit=o.unit||(n.autoSkip?Cn(o.minUnit,e.min,e.max,e._getLabelCapacity(a)):An(e,l.length,o.minUnit,e.min,e.max)),e._majorUnit=n.major.enabled&&"year"!==e._unit?Ln(e._unit):void 0,e.initOffsets(s),i.reverse&&l.reverse(),En(e,l,e._majorUnit)}initOffsets(e){const i=this;let o,n,s=0,a=0;i.options.offset&&e.length&&(o=i.getDecimalForValue(e[0]),s=1===e.length?1-o:(i.getDecimalForValue(e[1])-o)/2,n=i.getDecimalForValue(e[e.length-1]),a=1===e.length?n:(n-i.getDecimalForValue(e[e.length-2]))/2);const r=e.length<3?.5:.25;s=(0,t.q)(s,0,r),a=(0,t.q)(a,0,r),i._offsets={start:s,end:a,factor:1/(s+1+a)}}_generate(){const e=this,i=e._adapter,o=e.min,n=e.max,s=e.options,a=s.time,r=a.unit||Cn(a.minUnit,o,n,e._getLabelCapacity(o)),l=(0,t.v)(a.stepSize,1),c="week"===r&&a.isoWeekday,h=(0,t.p)(c)||!0===c,d={};let u,g,p=o;if(h&&(p=+i.startOf(p,"isoWeek",c)),p=+i.startOf(p,h?"day":r),i.diff(n,o,r)>1e5*l)throw new Error(o+" and "+n+" are too far apart with stepSize of "+l+" "+r);const f="data"===s.ticks.source&&e.getDataTimestamps();for(u=p,g=0;u<n;u=+i.add(u,l,r),g++)Tn(d,u,f);return u!==n&&"ticks"!==s.bounds&&1!==g||Tn(d,u,f),Object.keys(d).sort((t,e)=>t-e).map(t=>+t)}getLabelForValue(t){const e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}_tickFormatFunction(e,i,o,n){const s=this,a=s.options,r=a.time.displayFormats,l=s._unit,c=s._majorUnit,h=l&&r[l],d=c&&r[c],u=o[i],g=c&&d&&u&&u.major,p=s._adapter.format(e,n||(g?d:h)),f=a.ticks.callback;return f?(0,t.M)(f,[p,i,o],s):p}generateTickLabels(t){let e,i,o;for(e=0,i=t.length;e<i;++e)(o=t[e]).label=this._tickFormatFunction(o.value,e,t)}getDecimalForValue(t){return null===t?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,i=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+i)*e.factor)}getValueForPixel(t){const e=this,i=e._offsets,o=e.getDecimalForPixel(t)/i.factor-i.end;return e.min+o*(e.max-e.min)}_getLabelSize(e){const i=this.options.ticks,o=this.ctx.measureText(e).width,n=(0,t.t)(this.isHorizontal()?i.maxRotation:i.minRotation),s=Math.cos(n),a=Math.sin(n),r=this._resolveTickFontOptions(0).size;return{w:o*s+r*a,h:o*a+r*s}}_getLabelCapacity(t){const e=this,i=e.options.time,o=i.displayFormats,n=o[i.unit]||o.millisecond,s=e._tickFormatFunction(t,0,En(e,[t],e._majorUnit),n),a=e._getLabelSize(s),r=Math.floor(e.isHorizontal()?e.width/a.w:e.height/a.h)-1;return r>0?r:1}getDataTimestamps(){const t=this;let e,i,o=t._cache.data||[];if(o.length)return o;const n=t.getMatchingVisibleMetas();if(t._normalized&&n.length)return t._cache.data=n[0].controller.getAllParsedValues(t);for(e=0,i=n.length;e<i;++e)o=o.concat(n[e].controller.getAllParsedValues(t));return t._cache.data=t.normalize(o)}getLabelTimestamps(){const t=this,e=t._cache.labels||[];let i,o;if(e.length)return e;const n=t.getLabels();for(i=0,o=n.length;i<o;++i)e.push(Pn(t,n[i]));return t._cache.labels=t._normalized?e:t.normalize(e)}normalize(e){return(0,t._)(e.sort(Dn))}}function zn(e,i,o){let n,s,a,r,l=0,c=e.length-1;o?(i>=e[l].pos&&i<=e[c].pos&&({lo:l,hi:c}=(0,t.w)(e,"pos",i)),({pos:n,time:a}=e[l]),({pos:s,time:r}=e[c])):(i>=e[l].time&&i<=e[c].time&&({lo:l,hi:c}=(0,t.w)(e,"time",i)),({time:n,pos:a}=e[l]),({time:s,pos:r}=e[c]));const h=s-n;return h?a+(r-a)*(i-n)/h:a}exports.TimeScale=Rn,Rn.id="time",Rn.defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",major:{enabled:!1}}};class Fn extends Rn{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this,e=t._getTimestampsForTable(),i=t._table=t.buildLookupTable(e);t._minPos=zn(i,t.min),t._tableRange=zn(i,t.max)-t._minPos,super.initOffsets(e)}buildLookupTable(t){const{min:e,max:i}=this,o=[],n=[];let s,a,r,l,c;for(s=0,a=t.length;s<a;++s)(l=t[s])>=e&&l<=i&&o.push(l);if(o.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(s=0,a=o.length;s<a;++s)c=o[s+1],r=o[s-1],l=o[s],Math.round((c+r)/2)!==l&&n.push({time:l,pos:s/(a-1)});return n}_getTimestampsForTable(){const t=this;let e=t._cache.all||[];if(e.length)return e;const i=t.getDataTimestamps(),o=t.getLabelTimestamps();return e=i.length&&o.length?t.normalize(i.concat(o)):i.length?i:o,e=t._cache.all=e}getDecimalForValue(t){return(zn(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this,i=e._offsets,o=e.getDecimalForPixel(t)/i.factor-i.end;return zn(e._table,o*e._tableRange+e._minPos,!0)}}exports.TimeSeriesScale=Fn,Fn.id="timeseries",Fn.defaults=Rn.defaults;var Bn=Object.freeze({__proto__:null,CategoryScale:en,LinearScale:an,LogarithmicScale:cn,RadialLinearScale:wn,TimeScale:Rn,TimeSeriesScale:Fn});exports.scales=Bn;const In=[it,Hi,Zo,Bn];exports.registerables=In;
},{"./chunks/helpers.segment.js":"zTod"}],"uD8j":[function(require,module,exports) {
"use strict";var e=require("chart.js");function t(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=r(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var a=0,o=function(){};return{s:o,n:function(){return a>=e.length?{done:!0}:{done:!1,value:e[a++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,c=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return c=e.done,e},e:function(e){l=!0,i=e},f:function(){try{c||null==n.return||n.return()}finally{if(l)throw i}}}}function r(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}}function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function a(e,r){var n=parseInt(e.getAttribute("data-interval")),a=new Intl.DateTimeFormat(void 0,{month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),o=JSON.parse(e.getAttribute("data-spec"));this.subscribeIds=[];var i,c=new Map,l=new Map,u=t(o);try{for(u.s();!(i=u.n()).done;){var s=i.value;this.subscribeIds.push(s.id),l.set(s.id,s.color)}}catch(m){u.e(m)}finally{u.f()}function d(r,n,o){var i=document.createElement("div");i.setAttribute("class","item "+l.get(o)),i.logTimeStamp=r,i.logObjectId=o;var c,u=null,s=t(e.childNodes);try{for(s.s();!(c=s.n()).done;){var d=c.value;if(d.logTimeStamp<=r)break;u=d}}catch(m){s.e(m)}finally{s.f()}u?u.after(i):e.prepend(i);var f=document.createElement("div");f.setAttribute("class","right floated content the-value"),f.innerHTML=n,i.appendChild(f);var v=document.createElement("div");return v.setAttribute("class","content"),v.innerText=a.format(r),i.appendChild(v),i}setInterval(function(){var t=new Date,r=new Date(t.getTime()-n),a=Array.from(e.childNodes);a.reverse();for(var o=0,i=a;o<i.length;o++){var l=i[o];if(!(l.logTimeStamp<r))break;l.remove(),c.get(l.logObjectId)===l&&c.delete(l.logObjectId)}},5e3),this.update=function(r,n){if(r.init){var a,o=t(e.childNodes);try{for(o.s();!(a=o.n()).done;){var i=a.value;i.logObjectId===n&&i.remove()}}catch(m){o.e(m)}finally{o.f()}var l,u=t(r.data);try{for(u.s();!(l=u.n()).done;){var s=l.value,f=d(Date.parse(s[0]),s[1]);c.set(n,f)}}catch(m){u.e(m)}finally{u.f()}}else{var v,h=c.get(n),p=t(r.data);try{for(p.s();!(v=p.n()).done;){var g=v.value,y=Date.parse(g[0]);if(h&&y===h.logTimeStamp)h.getElementsByClassName("the-value")[0].innerHTML=g[1];else if(!(h&&y<h.logTimeStamp)){var b=d(y,g[1]);c.set(n,b)}}}catch(m){p.e(m)}finally{p.f()}}}}function o(r,n){var a=JSON.parse(r.getAttribute("data-spec")),o=parseInt(r.getAttribute("data-interval")),i=parseInt(r.getAttribute("data-align-ticks-to"));this.subscribeIds=[];var c,l=d(o,8),u=[],s=new Map,m=t(a);try{for(m.s();!(c=m.n()).done;){var f=c.value;this.subscribeIds.push(f.id);var v=[];u.push({data:v,label:f.label,backgroundColor:"rgba(".concat(f.color[0],", ").concat(f.color[1],", ").concat(f.color[2],", 0.1)"),borderColor:"rgba(".concat(f.color[0],", ").concat(f.color[1],", ").concat(f.color[2],", .5)"),pointBackgroundColor:"rgba(".concat(f.color[0],", ").concat(f.color[1],", ").concat(f.color[2],", 0.5)"),pointBorderColor:"rgba(".concat(f.color[0],", ").concat(f.color[1],", ").concat(f.color[2],", 0.5)"),stepped:f.is_aggregated?void 0:"before",pointRadius:f.is_aggregated?3:0,pointHitRadius:3,tension:.2}),s.set(f.id,v)}}catch(y){m.e(y)}finally{m.f()}var h=r.getContext("2d"),p=new e.Chart(h,{type:"line",data:{datasets:u,labels:[]},options:{plugins:{legend:{display:u.length>1}},scales:{x:{type:"time",min:new Date(new Date-o),max:new Date,ticks:{source:"labels"}}},responsive:!0}});function g(){var e=new Date,t=new Date(e.getTime()-o);p.options.scales.x.max=e,p.options.scales.x.min=t;for(var r=[],n=i+l*Math.ceil((t.getTime()-i)/l);n<e;)r.push(new Date(n)),n+=l;p.data.labels=r,p.update()}setInterval(function(){!function(){var e,r=new Date,n=new Date(r.getTime()-o),a=0,i=t(p.data.datasets);try{for(i.s();!(e=i.n()).done;){var c=e.value.data;if(c.length){for(var l=0;l<c.length&&!(c[l].x>=n);l++);var u=Math.max(0,l-1);u>0&&(c.splice(0,u),a++)}}}catch(y){i.e(y)}finally{i.f()}a&&p.update(0)}(),g()},Math.max(o/500,5e3)),this.update=function(e,r){var n=s.get(r);if(e.init){n.length=0;var a,o=t(e.data);try{for(o.s();!(a=o.n()).done;){var i=a.value;n.push({x:Date.parse(i[0]),y:i[1]})}}catch(y){o.e(y)}finally{o.f()}}else{var c,l=n.length?n[n.length-1]:null,u=t(e.data);try{for(u.s();!(c=u.n()).done;){var d=c.value,m=Date.parse(d[0]);l&&m===l.x?(console.debug("Updating last value of dataset with ".concat(d)),l.y=d[1]):l&&m<l.x?console.warn("chart update ".concat(d," ignored, since it is older than the current last row")):(console.debug("Adding entry ".concat(d," to chart")),n.push({x:m,y:d[1]}))}}catch(y){u.e(y)}finally{u.f()}}g()}}e.Chart.register(e.LineElement,e.PointElement,e.LineController,e.LinearScale,e.TimeScale,e.Decimation,e.Filler,e.Legend,e.Tooltip),WIDGET_TYPES.set("log.log_list",a);var i=1e3,c=6e4,l=36e5,u=864e5,s=[25,50,100,250,500,i,2*i,5*i,10*i,20*i,30*i,c,2*c,5*c,10*c,20*c,30*c,l,2*l,3*l,6*l,12*l,u,2*u,5*u,10*u,20*u,30*u,60*u,90*u,120*u,365*u,730*u,1095*u,1825*u,3650*u];function d(e,r){var n,a=t(s);try{for(a.s();!(n=a.n()).done;){var o=n.value;if(e/o<r)return o}}catch(i){a.e(i)}finally{a.f()}throw"No suiting tick interval found. 10 years is too less."}WIDGET_TYPES.set("log.line_chart",o),e._adapters._date.override({_id:"minimal-intl",formats:function(){var e={datetime:new Intl.DateTimeFormat(void 0,{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),millisecond:new Intl.DateTimeFormat(void 0,{hour:"numeric",minute:"numeric",second:"numeric"}),second:new Intl.DateTimeFormat(void 0,{hour:"numeric",minute:"numeric",second:"numeric"}),minute:new Intl.DateTimeFormat(void 0,{hour:"numeric",minute:"numeric"}),hour:new Intl.DateTimeFormat(void 0,{hour:"numeric",minute:"numeric"}),day:new Intl.DateTimeFormat(void 0,{month:"numeric",day:"numeric"}),week:new Intl.DateTimeFormat(void 0,{month:"numeric",day:"numeric"}),month:new Intl.DateTimeFormat(void 0,{year:"numeric",month:"numeric"}),quater:new Intl.DateTimeFormat(void 0,{year:"numeric",month:"numeric"}),year:new Intl.DateTimeFormat(void 0,{year:"numeric"})},t={};for(var r in t[Symbol.toStringTag]="Intl.DateTimeFormat",t.__proto__=Intl.DateTimeFormat.prototype,e)e[r].__proto__=t;return e},parse:function(e,t){return e},format:function(e,t){return t.format(e)},add:void 0,diff:function(e,t,r){switch(r){case"millisecond":return e-t;case"second":return(e-t)/i;case"minute":return(e-t)/c;case"hour":return(e-t)/l;case"day":return(e-t)/u;case"week":return(e-t)/u/7;case"month":return(e-t)/u/30;case"quarter":return(e-t)/7884e6;case"year":return(e-t)/u/365;default:return 0}},startOf:void 0,endOf:void 0});
},{"chart.js":"I6XY"}],"epB2":[function(require,module,exports) {
"use strict";require("fomantic-ui-css/semantic.css"),require("./main.css");var e=require("jquery");window.$=window.jQuery=e,require("fomantic-ui-css/semantic.js"),window.WIDGET_TYPES=new Map,require("./shc_base.js"),require("./log.js");
},{"fomantic-ui-css/semantic.css":"jO1i","./main.css":"Sr7R","jquery":"juYr","fomantic-ui-css/semantic.js":"I3hs","./shc_base.js":"YwQ1","./log.js":"uD8j"}]},{},["epB2"], null)
//# sourceMappingURL=main.js.map